/* =========================================================
   CS2GAMES.RU — оформление
   ========================================================= */
:root {
  --bg: #0b0d10;
  --bg-2: #12151a;
  --card: #181c23;
  --card-2: #1f242d;
  --border: #2a303a;
  --text: #e8eaed;
  --muted: #8b929d;
  --accent: #f5a623;
  --accent-2: #ffbe4d;
  --accent-dark: #c47f0a;
  --green: #45a856;
  --yellow: #d4a72c;
  --blue: #3d7fd6;
  --purple: #9b5fd1;
  --red: #e5484d;
  --gray: #3a3f48;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(245, 166, 35, 0.10), transparent 60%),
    radial-gradient(800px 400px at 100% 0%, rgba(61, 127, 214, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ===== Шапка ===== */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 13, 16, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.5px; }
.logo-mark {
  background: var(--accent); color: #111; font-weight: 900; font-size: 15px;
  padding: 5px 9px; border-radius: 5px; transform: skewX(-10deg);
}
.logo-text { font-size: 19px; text-transform: uppercase; }
.logo-text span { color: var(--accent); }

.header-stats { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.pill {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 11px; white-space: nowrap;
}
.pill b { color: var(--text); }
.pill.win b { color: var(--green); }
.pill.loss b { color: var(--red); }

.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 18px; }
.nav a {
  padding: 7px 13px; border-radius: 7px; font-size: 14px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; transition: 0.15s;
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.active { color: #111; background: var(--accent); }

/* ===== Общие блоки ===== */
.main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 16px 48px; }
.section-title {
  font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted);
  margin: 36px 0 14px; display: flex; align-items: center; gap: 10px;
}
.section-title::before { content: ""; width: 18px; height: 3px; background: var(--accent); border-radius: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #111; border: none;
  padding: 11px 22px; font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  border-radius: 8px; cursor: pointer; transition: 0.15s;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent-dark); }
.btn-ghost:hover { background: rgba(245, 166, 35, 0.1); }
.btn-small { padding: 8px 14px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 5px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-accent { color: var(--accent); border-color: var(--accent-dark); }
.badge-green { color: var(--green); border-color: var(--green); }

kbd {
  background: var(--bg-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 3px; padding: 1px 6px; font-size: 12px; color: var(--text);
}

/* ===== Главная ===== */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: stretch; }
.hero-text h1 { font-size: 38px; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.5px; }
.hero-text h1 span { color: var(--accent); white-space: nowrap; }
.hero-text p { color: var(--muted); margin-top: 14px; font-size: 16px; max-width: 520px; }
.hero-text .btn-row { justify-content: flex-start; }

.stats-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; text-align: center;
}
.stat-value { font-size: 28px; font-weight: 900; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.stat.wide { grid-column: span 2; }
.stat .green { color: var(--green); }
.stat .red { color: var(--red); }
.stat .amber { color: var(--accent); font-variant-numeric: tabular-nums; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px; }
.game-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: 0.2s;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--accent-dark); box-shadow: 0 14px 30px rgba(0,0,0,0.45); }
.game-cover {
  height: 120px; display: grid; place-items: center; position: relative;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.game-cover svg { width: 64px; height: 64px; color: #fff; opacity: 0.95; }
.game-cover::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.04) 0 8px, transparent 8px 16px);
}
.game-done {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; font-weight: 800;
  padding: 4px 8px; border-radius: 5px; text-transform: uppercase;
}
.game-done.win { color: #7ee08c; }
.game-done.loss { color: #ff8f92; }
.game-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-body h3 { font-size: 19px; text-transform: uppercase; letter-spacing: 0.5px; }
.game-body p { color: var(--muted); font-size: 14px; flex: 1; }
.game-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.how-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.how-item b { display: block; margin-bottom: 6px; color: var(--accent); }
.how-item span { color: var(--muted); font-size: 14px; }

.timeline { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline .chip {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px;
}
.timeline .chip b { color: var(--accent); margin-right: 6px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 36px 0 14px; }
.section-head .section-title { margin: 0; }
.more-link { color: var(--accent); font-weight: 700; font-size: 14px; }
.more-link:hover { color: var(--accent-2); }

/* ===== Страница «Все игры» ===== */
.all-list { display: grid; gap: 14px; }
.all-game {
  display: grid; grid-template-columns: 180px 1fr; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); transition: 0.2s;
}
.all-game:hover { border-color: var(--accent-dark); }
.all-cover { display: grid; place-items: center; background: linear-gradient(135deg, var(--c1), var(--c2)); min-height: 150px; }
.all-cover svg { width: 64px; height: 64px; color: #fff; }
.all-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.all-body h3 { font-size: 21px; text-transform: uppercase; letter-spacing: 0.5px; }
.all-tag { color: var(--text); font-size: 15px; }
.all-how { color: var(--muted); font-size: 14px; }
.all-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.q-cat { margin-bottom: 10px; }

/* ===== Страница игры ===== */
.game-page { max-width: 640px; margin: 0 auto; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.back { color: var(--muted); font-size: 14px; font-weight: 600; }
.back:hover { color: var(--accent); }
.game-title { font-size: 28px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.game-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

details.howto {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 14px; color: var(--muted);
}
details.howto summary { cursor: pointer; color: var(--text); font-weight: 600; }
details.howto p { margin-top: 8px; }

.message { min-height: 24px; text-align: center; margin: 12px 0; font-weight: 700; }
.message.win { color: var(--green); }
.message.lose { color: var(--red); }
.message.info { color: var(--accent); }

.done-box { text-align: center; padding: 10px 0; }
.done-box .big { font-size: 46px; font-weight: 900; color: var(--accent); margin: 8px 0; }
.done-box p { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: #111; padding: 10px 18px; border-radius: 8px;
  font-weight: 700; z-index: 50; animation: fadein 0.2s;
}
@keyframes fadein { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ===== Викторина ===== */
.quiz-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.progress-bar { height: 4px; background: var(--bg-2); border-radius: 2px; margin: 14px 0 20px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.4s; }
.question { font-size: 20px; line-height: 1.4; margin-bottom: 18px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 13px 15px; border-radius: 8px; font-size: 16px; cursor: pointer; transition: 0.15s;
}
.option:hover:not(:disabled) { border-color: var(--accent); background: var(--card-2); }
.option .num {
  flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 5px;
  font-size: 13px; font-weight: 800; color: var(--accent);
}
.option:disabled { cursor: default; }
.option.correct { background: rgba(69, 168, 86, 0.16); border-color: var(--green); }
.option.wrong { background: rgba(229, 72, 77, 0.16); border-color: var(--red); }
.explain {
  margin-top: 14px; padding: 11px 13px; border-left: 3px solid var(--accent);
  background: var(--bg-2); color: var(--muted); font-size: 14px; border-radius: 0 6px 6px 0;
}

/* ===== Wordle ===== */
.board { display: grid; gap: 6px; justify-content: center; margin: 6px 0; }
.row { display: flex; gap: 6px; justify-content: center; }
.row.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.tile {
  width: 50px; height: 50px; border: 2px solid var(--border); border-radius: 5px;
  display: grid; place-items: center; font-size: 22px; font-weight: 800; background: var(--bg-2);
}
.tile.filled { border-color: #59616e; }
.tile.correct { background: var(--green); border-color: var(--green); color: #fff; }
.tile.present { background: var(--yellow); border-color: var(--yellow); color: #111; }
.tile.absent { background: var(--gray); border-color: var(--gray); color: #bbb; }
.tile.reveal { animation: flip 0.45s; }
@keyframes flip { 50% { transform: rotateX(90deg); } }

.keyboard { display: grid; gap: 6px; margin-top: 8px; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1; max-width: 44px; height: 52px; background: #3a404b; color: var(--text);
  border: none; border-radius: 5px; font-size: 15px; font-weight: 800; cursor: pointer;
}
.key:hover { filter: brightness(1.15); }
.key.wide { max-width: 74px; font-size: 12px; }
.key.correct { background: var(--green); }
.key.present { background: var(--yellow); color: #111; }
.key.absent { background: #22262d; color: #666; }

/* ===== Карьерный путь ===== */
.path { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 16px; }
.path-step {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px;
}
.path-step .n {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #111; font-weight: 900; font-size: 13px;
}
.path-step.locked { color: var(--muted); border-style: dashed; }
.path-step.locked .n { background: var(--gray); color: var(--muted); }
.path-step.hint .n { background: var(--blue); color: #fff; }
.guess-form { display: flex; gap: 8px; }
.input {
  flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 8px; font-size: 16px; outline: none;
}
.input:focus { border-color: var(--accent); }
.guesses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.guess-chip {
  font-size: 13px; padding: 4px 10px; border-radius: 999px;
  background: rgba(229, 72, 77, 0.15); border: 1px solid var(--red);
}
.guess-chip.ok { background: rgba(69, 168, 86, 0.15); border-color: var(--green); }
.lives { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
.lives b { color: var(--accent); }

/* ===== Связи ===== */
.conn-solved { display: grid; gap: 8px; margin-bottom: 8px; }
.conn-group { border-radius: 8px; padding: 12px; text-align: center; color: #111; animation: fadein2 0.3s; }
@keyframes fadein2 { from { opacity: 0; transform: scale(0.97); } }
.conn-group b { display: block; text-transform: uppercase; letter-spacing: 0.5px; font-size: 14px; }
.conn-group span { font-size: 14px; }
.g0 { background: #e9c14a; }
.g1 { background: #6fbf6f; }
.g2 { background: #79a7e8; }
.g3 { background: #b98be0; }
.conn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.conn-tile {
  min-height: 64px; padding: 6px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text); font-weight: 800; font-size: 14px;
  cursor: pointer; transition: 0.12s; word-break: break-word;
}
.conn-tile:hover { border-color: var(--accent-dark); }
.conn-tile.sel { background: var(--accent); color: #111; border-color: var(--accent); }
.mistakes { text-align: center; margin-top: 12px; color: var(--muted); font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin: 0 3px; }
.dot.used { background: var(--gray); }

/* ===== Назови всех ===== */
.list-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin: 14px 0; }
.slot {
  background: var(--bg-2); border: 1px dashed var(--border); border-radius: 7px;
  padding: 9px 11px; font-size: 14px; color: var(--muted); min-height: 40px;
}
.slot.found { border-style: solid; border-color: var(--green); color: var(--text); background: rgba(69,168,86,0.12); animation: fadein2 0.3s; }
.slot.missed { border-style: solid; border-color: var(--red); color: #ff9c9f; }
.list-count { font-size: 14px; color: var(--muted); }
.list-count b { color: var(--accent); }

/* ===== Подвал ===== */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 20px; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 28px 16px;
  display: grid; grid-template-columns: 1fr; gap: 20px; font-size: 14px; color: var(--muted);
}
.footer h4 { color: var(--text); text-transform: uppercase; letter-spacing: 1px; font-size: 13px; margin-bottom: 10px; }
.footer ul { list-style: none; display: grid; gap: 6px; }
.footer a:hover { color: var(--accent); }
.footer .copy { grid-column: span 1; border-top: 1px solid var(--border); padding-top: 14px; font-size: 12px; }

/* ===== Телефоны ===== */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 30px; }
  .header-stats .pill.hide-sm { display: none; }
  .all-game { grid-template-columns: 1fr; }
  .all-cover { min-height: 100px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer .copy { grid-column: span 1; }
}
@media (max-width: 520px) {
  .card { padding: 16px 13px; }
  .game-title { font-size: 23px; }
  .question { font-size: 18px; }
  .row { gap: 4px; }
  .tile { width: 34px; height: 34px; font-size: 17px; }
  .key { height: 46px; font-size: 13px; }
  .kb-row { gap: 3px; }
  .conn-tile { font-size: 12px; min-height: 56px; }
  .conn-grid { gap: 5px; }
  .logo-text { font-size: 16px; }
  .header-stats { display: none; }
  .nav { margin-left: 8px; }
  .nav a { padding: 6px 9px; font-size: 12px; }
  .logo-mark { display: none; }
}

/* ===== v3: шапка ===== */
.pill-btn { cursor: pointer; font-family: inherit; color: var(--muted); font-size: 13px; }
.pill-btn:hover { border-color: var(--accent-dark); color: var(--text); }
#h-nick { color: var(--text); font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
#h-nick.guest { color: var(--accent); }

/* ===== Окна ===== */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.65);
  display: grid; place-items: center; padding: 16px; animation: fadein3 0.2s;
}
@keyframes fadein3 { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 22px;
}
.modal h3 { font-size: 20px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-item { background: var(--bg-2); border: 1px dashed var(--border); border-radius: 8px; padding: 14px; text-align: center; }
.shop-item b { display: block; font-size: 20px; }
.shop-item span { color: var(--muted); font-size: 12px; text-transform: uppercase; }

/* ===== Результат игры ===== */
.result-box { margin-top: 14px; text-align: center; }
.points { font-size: 26px; font-weight: 900; margin: 6px 0; }
.points.plus { color: var(--green); }
.points.minus { color: var(--red); }
.badge-hard { color: #ff8f92; border-color: var(--red); }

/* ===== Лидерборд ===== */
.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.lb td { padding: 10px; border-bottom: 1px solid var(--border); }
.lb td:first-child { width: 48px; font-weight: 800; color: var(--muted); }
.lb td:last-child, .lb th:last-child { text-align: right; font-weight: 800; color: var(--accent); }
.lb tr.mine td { background: rgba(245,166,35,0.10); color: var(--text); }
.me-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.me-card b { display: block; font-size: 18px; }
.me-card span { color: var(--muted); font-size: 14px; }
.tabs-row { display: flex; gap: 6px; margin-bottom: 12px; }
.tab-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--muted); font-weight: 700;
  padding: 8px 16px; border-radius: 7px; cursor: pointer; text-transform: uppercase; font-size: 13px; letter-spacing: 0.5px;
}
.tab-btn.active { background: var(--accent); color: #111; border-color: var(--accent); }

/* ===== Уровни ===== */
.lvl-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.lvl {
  aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--border); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: 0.15s;
}
.lvl-n { font-size: 22px; font-weight: 900; }
.lvl-i { font-size: 13px; color: var(--muted); }
.lvl.done { background: rgba(69,168,86,0.15); border-color: var(--green); }
.lvl.done .lvl-i { color: var(--green); }
.lvl.open { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,166,35,0.25); }
.lvl.open .lvl-i { color: var(--accent); }
.lvl.open:hover, .lvl.done:hover { transform: translateY(-2px); }
.lvl.locked { opacity: 0.45; }

/* ===== Состав финала ===== */
.match-head { text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.match-event { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }
.match-score { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 4px; font-size: 17px; font-weight: 800; }
.match-score b { font-size: 26px; color: var(--accent); }
.match-maps { color: var(--muted); font-size: 13px; }
.match-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-team-name { font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: 0.5px; margin-bottom: 6px; color: var(--muted); }
.m-slot {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px dashed var(--border); border-radius: 7px; padding: 8px 10px; margin-bottom: 6px; min-height: 40px;
}
.m-country { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.m-nick { font-weight: 800; }
.m-slot.found { border-style: solid; border-color: var(--green); background: rgba(69,168,86,0.12); }
.m-slot.missed { border-style: solid; border-color: var(--red); }
.m-slot.missed .m-nick { color: #ff9c9f; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin: 4px 0 0; justify-content: center; }
}
@media (max-width: 520px) {
  .header-stats { display: flex; }
  .header-stats .pill.win { display: none; }
  .lvl-grid { gap: 6px; }
  .lvl-n { font-size: 18px; }
  .match-teams { gap: 6px; }
  .m-slot { padding: 7px; }
  .m-country { font-size: 9px; }
  .match-score { font-size: 14px; gap: 8px; }
}

/* Шесть игр — ровная сетка 3×2 */
.games-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .games-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .games-grid { grid-template-columns: 1fr; } }

/* ===== Кто это? ===== */
.wh-wrap { overflow-x: auto; margin-top: 12px; }
.wh-table { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 13px; min-width: 520px; }
.wh-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; padding: 4px; }
.wh-table td { text-align: center; padding: 9px 6px; border-radius: 6px; font-weight: 700; background: var(--gray); animation: fadein2 0.3s; }
.wh-table td.hit { background: var(--green); color: #fff; }
.wh-table td.near { background: var(--yellow); color: #111; }
.wh-table td.miss { background: var(--gray); color: #ddd; }
.wh-legend { margin-top: 10px; text-align: center; font-size: 12px; }

/* ===== Сетка ===== */
.grid-board { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 6px; }
.gb-corner { min-height: 20px; }
.gb-head {
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 6px; min-height: 52px;
  border-radius: 8px; font-size: 13px; font-weight: 800; background: var(--bg-2); border: 1px solid var(--border);
}
.gb-head.team { color: var(--accent); }
.gb-head.country { color: #79a7e8; }
.gb-head.special { color: #b98be0; }
.gb-cell {
  aspect-ratio: 1 / 1; border-radius: 8px; border: 1px dashed var(--border); background: var(--card-2); color: var(--text);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px;
  font-size: 13px; word-break: break-word; transition: 0.12s; font-family: inherit;
}
.gb-cell:hover { border-color: var(--accent-dark); }
.gb-cell.sel { border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(245,166,35,0.2); }
.gb-cell.ok { border-style: solid; border-color: var(--green); background: rgba(69,168,86,0.15); cursor: default; }
.gb-cell.missed { border-style: solid; border-color: var(--red); }
.gb-cell.shake { animation: shake 0.4s; }
.gb-plus { font-size: 22px; color: var(--muted); }
.gb-ex { font-size: 11px; color: #ff9c9f; }
.gb-cell.p1 { border-style: solid; border-color: var(--accent); background: rgba(245,166,35,0.15); }
.gb-cell.p2 { border-style: solid; border-color: #79a7e8; background: rgba(121,167,232,0.15); }
.duo-mark { font-size: 22px; font-weight: 900; }
.gb-cell.p1 .duo-mark, span.p1 { color: var(--accent); }
.gb-cell.p2 .duo-mark, span.p2 { color: #79a7e8; }
.duo-turn { text-align: center; font-weight: 800; margin-bottom: 12px; font-size: 16px; }

/* ===== Бинго ===== */
.bingo-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bingo-player { flex: 1; text-align: center; font-size: 26px; font-weight: 900; color: var(--accent); }
.bingo-card { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bg-cell {
  min-height: 74px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-2); color: var(--text);
  cursor: pointer; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: inherit; font-size: 12px; font-weight: 700; text-align: center; transition: 0.12s;
}
.bg-cell:hover { border-color: var(--accent); }
.bg-cell.team span { color: var(--accent); }
.bg-cell.country span { color: #79a7e8; }
.bg-cell.special span { color: #b98be0; }
.bg-cell.ok { background: rgba(69,168,86,0.18); border-color: var(--green); cursor: default; }
.bg-cell b { font-size: 13px; color: var(--text); }

/* ===== Дуэль финалов ===== */
.duel-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.duel-vs { align-self: center; font-weight: 900; color: var(--muted); font-size: 14px; text-align: center; }
.duel-card {
  position: relative; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  padding: 14px 12px 16px; cursor: pointer; text-align: center; font-family: inherit; display: flex; flex-direction: column; gap: 6px; justify-content: flex-start;
}
.duel-card:hover:not(:disabled) { border-color: var(--accent); }
.duel-card:disabled { cursor: default; }
.duel-card.correct { border-color: var(--green); background: rgba(69,168,86,0.15); }
.duel-card.wrong { border-color: var(--red); background: rgba(229,72,77,0.15); }
.duel-key { align-self: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 5px; display: grid; place-items: center; margin-bottom: 4px; background: var(--card); border: 1px solid var(--border); color: var(--accent); font-size: 12px; font-weight: 800; }
.duel-teams { font-weight: 800; font-size: 15px; }
.duel-score { color: var(--accent); font-weight: 900; font-size: 20px; }
.duel-reveal { color: var(--muted); font-size: 12px; }

/* ===== Выше или ниже / Скин-прайс ===== */
.hl-q { text-align: center; margin: 14px 0; font-size: 17px; }
.hl-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.hl-card {
  position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2);
  padding: 18px 12px; text-align: center; display: flex; flex-direction: column; gap: 4px; justify-content: center; min-height: 170px; transition: 0.2s;
}
.hl-card.ok { border-color: var(--green); background: rgba(69,168,86,0.15); }
.hl-card.bad { border-color: var(--red); background: rgba(229,72,77,0.15); }
.hl-name { font-size: 20px; font-weight: 900; word-break: break-word; }
.hl-sub { color: var(--muted); font-size: 13px; font-weight: 700; }
.hl-label { color: var(--muted); font-size: 12px; margin-top: 6px; }
.hl-value { font-size: 26px; font-weight: 900; color: var(--accent); }
.skin-stripe { position: absolute; left: 0; right: 0; top: 0; height: 5px; }
.st { color: #cf6a32; font-size: 11px; font-weight: 800; }

/* ===== Редкий ответ ===== */
.rare-hit { margin-top: 12px; padding: 12px; border-radius: 8px; background: rgba(69,168,86,0.12); border: 1px solid var(--green); }
.rare-bar { height: 8px; background: var(--bg-2); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.rare-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--accent), #b98be0); }

/* ===== Топ-10 ===== */
.top10 { list-style: none; display: grid; gap: 6px; margin: 14px 0; }
.top10 li {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px dashed var(--border); min-height: 42px;
}
.top10 li.found { border-style: solid; border-color: var(--green); background: rgba(69,168,86,0.12); animation: fadein2 0.3s; }
.top10 li.missed { border-style: solid; border-color: var(--red); }
.top10 li.missed b { color: #ff9c9f; }
.tp-rank { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #111; font-weight: 900; font-size: 13px; }
.tp-hidden { color: var(--muted); }
.tp-val { margin-left: auto; color: var(--muted); font-size: 13px; }

@media (max-width: 520px) {
  .grid-board { gap: 4px; }
  .gb-head { font-size: 10px; padding: 4px 3px; min-height: 44px; }
  .gb-cell { font-size: 11px; }
  .bingo-card { gap: 4px; }
  .bg-cell { min-height: 64px; font-size: 10px; padding: 4px; }
  .bg-cell b { font-size: 11px; }
  .bingo-player { font-size: 22px; }
  .duel-pair, .hl-pair { grid-template-columns: 1fr; }
  .duel-vs { padding: 2px 0; }
  .hl-card { min-height: 130px; }
  .hl-name { font-size: 17px; }
}

/* ===== v3: ежедневный квиз ===== */
.dq-card { padding: 22px; margin-bottom: 8px; }
.dq-main { display: flex; gap: 18px; align-items: flex-start; }
.dq-icon { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #c47f0a, #7a3d00); color: #fff; }
.dq-icon svg { width: 36px; height: 36px; }
.dq-text h3 { font-size: 22px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.dq-text p { color: var(--muted); font-size: 15px; }
.dq-text .dq-score { color: var(--text); margin-top: 10px; }
.dq-text .dq-score b { color: var(--accent); font-size: 18px; }
.dq-dots { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.dq-dot { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--card-2); display: grid; place-items: center; color: var(--muted); }
.dq-dot svg { width: 20px; height: 20px; }
.dq-dot.win { background: rgba(69,168,86,0.18); border-color: var(--green); color: var(--green); }
.dq-dot.part { background: rgba(212,167,44,0.18); border-color: var(--yellow); color: var(--yellow); }
.dq-dot.loss { background: rgba(229,72,77,0.15); border-color: var(--red); color: var(--red); }
.dq-dot.cur { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,166,35,0.3); color: var(--accent); }
.dq-warn { margin: 6px 0 10px; }
.dq-table td.num, .dq-table th:last-child { text-align: right; }
.dq-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.dq-card .btn-row { justify-content: flex-start; margin-top: 14px; }

/* ===== v3: уровни, финалы, редкие ответы ===== */
@media (min-width: 720px) { .lvl-grid { grid-template-columns: repeat(10, 1fr); } .lvl-n { font-size: 18px; } }
.match-stage { color: var(--accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.match-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.duel-stage { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.rare-all { color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* ===== Таймер игры ===== */
.gtimer { margin: 0 0 14px; }
.gtimer-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.gtimer-top b { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }
.gtimer-delta { font-weight: 900; font-size: 15px; }
.gtimer-delta.plus { color: var(--green); }
.gtimer-delta.minus { color: var(--red); }
.gtimer-bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.gtimer-fill { height: 100%; width: 100%; background: var(--accent); border-radius: 3px; transition: width 0.12s linear; }
.gtimer.low .gtimer-fill { background: var(--red); }
.gtimer.low .gtimer-top b { color: var(--red); }
.howto-mode { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.mode-level .pts { display: none !important; }
ol.rare-all { margin: 8px 0 0 0; padding-left: 28px; columns: 2; column-gap: 24px; }
ol.rare-all li { break-inside: avoid; }
@media (max-width: 560px) { ol.rare-all { columns: 1; } }
.quiz-top .badge + .badge { margin-left: 0; }

/* ===== Экран старта игры ===== */
.start-card { text-align: center; padding: 34px 22px; }
.start-icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.start-icon svg { width: 40px; height: 40px; }
.start-card h2 { font-size: 24px; margin-bottom: 8px; }
.start-card p { color: var(--muted); max-width: 460px; margin: 0 auto 8px; }
.start-card .start-meta { color: var(--text); font-weight: 700; font-size: 14px; margin-bottom: 22px; }
.btn-go { font-size: 20px; padding: 14px 44px; letter-spacing: 1px; text-transform: none; }

/* ---------- Подсказки при вводе ---------- */
.sg-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.sg-wrap .input { width: 100%; }
.sg-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  list-style: none; margin: 0; padding: 6px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--accent-dark); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(245, 166, 35, 0.12);
  animation: sg-in 0.12s ease-out;
}
.sg-list.hidden { display: none; }
.sg-list li {
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sg-list li b { color: var(--accent-2); font-weight: 700; }
.sg-list li:hover, .sg-list li.active { background: rgba(245, 166, 35, 0.14); color: var(--text); }
@keyframes sg-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.wh-hint {
  display: inline-block; margin-top: 6px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--accent-dark); background: rgba(245, 166, 35, 0.1); color: var(--accent-2);
}
a.dq-dot { text-decoration: none; transition: transform 0.12s; }
a.dq-dot:hover { transform: translateY(-2px); }
.dq-share { white-space: pre-wrap; font-family: inherit; color: var(--muted); font-size: 14px; margin: 8px 0; }
.skin-rarity { display: inline-block; margin: 8px 0 2px; padding: 3px 10px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; background: rgba(255, 255, 255, 0.04); }

/* ---------- Ежедневный бонус ---------- */
.bn-card { padding: 18px; }
.bn-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.bn-day { position: relative; border: 1px solid var(--border); background: var(--card-2); border-radius: 10px; padding: 10px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px; min-height: 84px; justify-content: center; }
.bn-n { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bn-p { font-size: 18px; font-weight: 800; color: var(--text); }
.bn-i { font-size: 15px; min-height: 18px; }
.bn-day.done { background: rgba(69,168,86,0.15); border-color: var(--green); }
.bn-day.done .bn-p { color: var(--green); }
.bn-day.open { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,166,35,0.3); background: rgba(245,166,35,0.1); }
.bn-day.open .bn-p { color: var(--accent-2); }
.bn-day.big .bn-p { font-size: 20px; color: var(--accent-2); }
.bn-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.bn-foot .list-count { flex: 1; min-width: 200px; margin: 0; }
@media (max-width: 560px) { .bn-grid { gap: 4px; } .bn-p { font-size: 14px; } .bn-day.big .bn-p { font-size: 15px; } .bn-n { font-size: 9px; } }

/* ---------- Служебные страницы и ссылки в подвале ---------- */
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 6px; }
.footer-links a { color: var(--muted); font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: var(--accent-2); }
.legal-body { padding: 22px; line-height: 1.6; }
.legal-body h3 { margin: 18px 0 6px; font-size: 16px; }
.legal-body p, .legal-body ul { color: var(--text); margin-bottom: 8px; }
.legal-body ul { padding-left: 20px; }
.legal-body li { margin-bottom: 6px; }
.legal-body a { color: var(--accent-2); }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }
.legal-links a { color: var(--muted); font-size: 14px; text-decoration: none; }
.legal-links a.active, .legal-links a:hover { color: var(--accent-2); }

/* ---------- Профиль и вход через Steam ---------- */
.nav a[hidden] { display: none; }
.steam-btn { background: #1b2838; color: #c7d5e0; border: 1px solid #2a475e; }
.steam-btn:hover { background: #2a475e; color: #fff; }
.pf-head { display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.pf-avatar { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; }
.pf-noimg { display: flex; align-items: center; justify-content: center; background: var(--panel-2, #1c2230); font-size: 30px; font-weight: 800; color: var(--accent-2); }
.pf-who { flex: 1; min-width: 180px; }
.pf-who h1 { margin: 0 0 4px; font-size: 24px; word-break: break-word; }
.pf-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 8px; }
.pf-grid .stat { text-align: center; }
.pf-ok { color: var(--green); }
.pf-bad { color: var(--red); }
.pf-table { overflow-x: auto; }
.pf-table table { width: 100%; }
.pf-table .pf-zero td { opacity: .5; }
@media (max-width: 640px) { .pf-grid { grid-template-columns: repeat(2, 1fr); } .pf-grid .stat:last-child { grid-column: span 2; } }
@media (max-width: 520px) {
  .nav { gap: 2px; }
  .nav a { padding: 6px 7px; font-size: 11px; letter-spacing: 0; }
  .pf-table table th, .pf-table table td { padding: 8px 5px; font-size: 12px; }
  .pf-table { padding: 8px; }
}
@media (max-width: 520px) { .pf-table table th { font-size: 10px; letter-spacing: 0; } .pf-table table th, .pf-table table td { padding: 8px 3px; } .pf-table table td:first-child { max-width: 90px; } }
