:root {
  --bg: #0e1116;
  --panel: #161b23;
  --panel-2: #1d2430;
  --line: #2a3342;
  --text: #e8edf4;
  --muted: #8b97a8;
  --accent: #ff5a36;
  --accent-2: #ffb020;
  --hit: #2fa36b;
  --near: #c9a227;
  --miss: #2a3342;
  --radius: 12px;
  color-scheme: dark;
}
/* dark-first; light palette when the system or the toggle asks for it */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f3f4f7; --panel: #ffffff; --panel-2: #eceef3; --line: #d5d9e2; --text: #151a22; --muted: #5b6575;
    --accent: #e8461f; --accent-2: #a86200; --hit: #23885a; --near: #b58f12; --miss: #e2e6ed; color-scheme: light; }
}
:root[data-theme="light"] { --bg: #f3f4f7; --panel: #ffffff; --panel-2: #eceef3; --line: #d5d9e2; --text: #151a22; --muted: #5b6575;
    --accent: #e8461f; --accent-2: #a86200; --hit: #23885a; --near: #b58f12; --miss: #e2e6ed; color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent-2); }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main.wrap { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--panel); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; letter-spacing: .3px; }
.logo b { color: var(--accent); }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; }
.tab .short { display: none; }
.tab { background: none; border: 0; color: var(--muted); padding: 7px 14px; border-radius: 7px; cursor: pointer; font: inherit; font-weight: 600; }
.tab.active { background: var(--accent); color: #fff; }

/* mode tabs */
.mode-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 20px 0 12px; }
.mode-tab { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 12px; font: inherit; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.mode-tab.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-icon { font-size: 18px; opacity: .85; }
.day-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 7px; font: inherit; cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--text); font-weight: 600; }

.mode-root { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.mode-intro { margin: 0 0 14px; color: var(--muted); }
.mode-footer { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.loading, .error { text-align: center; padding: 40px 0; color: var(--muted); }
.error { color: #ff7a7a; }

.btn { background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }

.flag { font-size: 1.1em; line-height: 1; }
.flag-text { font-size: 10px; font-weight: 700; border: 1px solid var(--line); border-radius: 3px; padding: 1px 3px; color: var(--muted); }
.chip { padding: 1px 7px; border-radius: 5px; color: #fff; font-weight: 600; }
.chip.hit { background: var(--hit); } .chip.near { background: var(--near); }

/* status */
.status-line { display: flex; justify-content: center; gap: 22px; margin-bottom: 14px; flex-wrap: wrap; color: var(--muted); }
.status-line b { color: var(--text); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* grid */
.grid-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 620px; margin: 0 auto; }
.grid-corner { display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.grid-head { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; min-height: 76px; font-weight: 700; line-height: 1.2; }
.grid-head small { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.grid-head .flag { font-size: 24px; margin-bottom: 2px; }
.grid-cell { aspect-ratio: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 28px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: inherit; padding: 4px; min-width: 0; }
.grid-cell:hover:not(.filled) { border-color: var(--accent); color: var(--text); }
.grid-cell.filled { background: color-mix(in srgb, var(--hit) 22%, var(--panel-2)); border-color: var(--hit); color: var(--text); cursor: default; font-size: 15px; }
.grid-cell.filled b { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.grid-cell.filled small { color: var(--muted); font-size: 12px; }
.grid-cell.revealed { font-size: 13px; }
.answer-list { list-style: none; padding: 0; margin: 0; max-height: 55vh; overflow: auto; }
.answer-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* search */
.search { position: relative; }
.search-input { width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; outline: none; }
.search-input:focus { border-color: var(--accent); }
.search-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; list-style: none; margin: 0; padding: 4px; display: none; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.search-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.search-list li .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-list li.active, .search-list li:hover { background: var(--panel-2); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: start center; padding: 12vh 16px 16px; z-index: 30; }
.modal { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 16px; }

/* who am i */
.who-search { max-width: 460px; margin: 0 auto 14px; }
.who-table { overflow-x: auto; }
.who-row { display: grid; grid-template-columns: 1.1fr repeat(var(--cols, 5), 1fr); gap: 6px; margin-bottom: 6px; min-width: 620px; }
.who-row.head div { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; text-align: center; }
.who-name { font-weight: 700; display: flex; align-items: center; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
.who-name.hit { color: var(--hit); }
.who-cell { border-radius: 8px; padding: 8px 4px; text-align: center; font-size: 13px; min-height: 52px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; color: #fff; animation: flip .35s ease both; }
.who-cell.hit { background: var(--hit); } .who-cell.near { background: var(--near); } .who-cell.miss { background: var(--miss); color: var(--text); }
.arrow { font-weight: 800; font-size: 16px; margin-left: 3px; }
@keyframes flip { from { transform: rotateX(90deg); } to { transform: none; } }
.clues { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }
.clue { background: var(--panel-2); border: 1px dashed var(--accent-2); border-radius: 8px; padding: 6px 12px; }

/* chain */
.chain-ends { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.chain-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; text-align: center; min-width: 150px; display: flex; flex-direction: column; }
.chain-card .big { font-size: 20px; font-weight: 800; }
.chain-arrow { font-size: 26px; color: var(--muted); }
.chain { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; }
.chain .node { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }
.chain .node.end { border-color: var(--accent); }
.chain .node.ghost { opacity: .5; border-style: dashed; }
.chain .link { border-left: 2px solid var(--line); height: 34px; display: flex; align-items: center; }
.chain .link span { margin-left: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chain .link.pending { border-left-style: dashed; }
.best-path { text-align: left; max-width: 560px; margin: 0 auto; }
.best-path ol { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.chain-search { max-width: 460px; margin: 0 auto 10px; }
.chain-tools { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }

.result { text-align: center; }
.result h3 { margin: 4px 0; font-size: 22px; }
.result p { margin: 6px 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 9px; transition: .25s; z-index: 50; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.site-footer { color: var(--muted); font-size: 13px; padding-top: 18px; padding-bottom: 24px; }
.site-footer p { margin: 4px 0; }

@media (max-width: 560px) {
  .top-inner { height: auto; padding-block: 10px; flex-wrap: wrap; }
  .mode-tab { flex-direction: column; gap: 2px; padding: 10px 6px; font-size: 14px; }
  .mode-root { padding: 12px; }
  .grid-board { gap: 5px; }
  .grid-head { min-height: 60px; font-size: 12px; padding: 2px; }
  .grid-head small { font-size: 9px; }
  .grid-cell.filled { font-size: 12px; }
  .chain-card { min-width: 0; padding: 8px 10px; }
  .chain-card .big { font-size: 16px; }
}

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* results & stats */
.score { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.score b { font-size: 40px; line-height: 1; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.score small { color: var(--muted); }
.stats-line { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 420px; margin: 12px auto; }
.stats-line div { display: flex; flex-direction: column; align-items: center; background: var(--panel-2); border-radius: 8px; padding: 6px 2px; }
.stats-line b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stats-line small { color: var(--muted); font-size: 11px; }
.result-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.countdown { display: block; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hint-box { display: flex; justify-content: center; }
.bar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; }
.top-right { display: flex; align-items: center; gap: 8px; }
.icon-pill { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; height: 38px; min-width: 38px; font-size: 17px; cursor: pointer; }
.modal.wide { max-width: 680px; max-height: 80vh; overflow: auto; }
.modal h4 { margin: 4px 0 0; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.profile-table { overflow-x: auto; }
.pt-row { display: grid; grid-template-columns: 1.8fr repeat(6, minmax(52px, 1fr)); gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 520px; font-variant-numeric: tabular-nums; }
.pt-row.head { color: var(--muted); font-size: 12px; }
.pt-row div:not(:first-child) { text-align: center; }
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.ach { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; opacity: .55; }
.ach.got { opacity: 1; border-color: var(--accent-2); }
.ach-icon { font-size: 22px; width: 28px; text-align: center; filter: grayscale(1); }
.ach.got .ach-icon { filter: none; }
.ach b { display: block; }
.ach small { color: var(--muted); }

.icon-pill.text { font-size: 13px; font-weight: 700; }
.duel { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.duel h3 { margin: 0; }
.duel p { margin: 0; }
.duel-vs { display: flex; gap: 18px; align-items: center; justify-content: center; }
.duel-vs span { display: flex; flex-direction: column; align-items: center; }
.duel-vs b { font-size: 30px; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.duel-link { display: flex; gap: 8px; width: 100%; max-width: 520px; }
.duel-link input { flex: 1; min-width: 0; font-size: 13px; padding: 8px 10px; }
.duel-table { width: 100%; max-width: 420px; }
.board { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.board li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--panel-2); border-radius: 8px; font-variant-numeric: tabular-nums; }
.board li.me { outline: 1px solid var(--accent-2); }
.board .rank { width: 22px; color: var(--muted); }
.board .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.who-row.items { grid-template-columns: 1.1fr repeat(var(--cols, 5), 1fr); min-width: calc(120px + var(--cols, 5) * 92px); }

/* game picker: its own row under the header, scrolls sideways when there are many games */
.game-row { padding-top: 12px; display: flex; gap: 10px; align-items: center; }
.game-row .tabs { flex: 1; min-width: 0; }
.section-tabs { flex: none; }
.section-tabs button { white-space: nowrap; }
@media (max-width: 760px) { .game-row { flex-direction: column; align-items: stretch; } .section-tabs { display: flex; } .section-tabs button { flex: 1; } }
.game-row .tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.game-row .tabs::-webkit-scrollbar { display: none; }
.game-row .tab { white-space: nowrap; flex: 1 0 auto; }
@media (max-width: 760px) { .tab .full { display: none; } .tab .short { display: inline; } .game-row .tab { padding: 7px 9px; } }
[hidden] { display: none !important; }
.account-seg { display: flex; } .account-seg button { flex: 1; }

/* highlighted login button */
.icon-pill.cta { background: var(--accent); border-color: var(--accent); color: #fff; padding: 0 14px; animation: cta-pulse 2.4s ease-out 3; }
@keyframes cta-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 54, .6); } 70% { box-shadow: 0 0 0 10px rgba(255, 90, 54, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 54, 0); } }
@media (prefers-reduced-motion: reduce) { .icon-pill.cta { animation: none; } }

/* item icons, player photos, club logos */
.pic { width: 28px; height: 28px; object-fit: contain; flex: none; border-radius: 5px; background: var(--panel-2); }
.pic.big { width: 44px; height: 44px; }
.pic.round { border-radius: 50%; object-fit: cover; }
.search-list li .pic { width: 26px; height: 26px; }
.who-name { gap: 8px; }
.answer { display: inline-flex; align-items: center; gap: 8px; }

.pic.logo { border-radius: 4px; background: transparent; object-fit: contain; }
.pic.big.logo { width: 36px; height: 36px; }
.with-logo { display: inline-flex; align-items: center; gap: 6px; }
.with-logo .pic { width: 20px; height: 20px; }
.grid-head .pic { margin-bottom: 2px; }
.grid-cell.filled .pic.big { width: 40px; height: 40px; }
.node .pic.big { width: 40px; height: 40px; margin-right: 6px; vertical-align: middle; }

.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; flex: none; width: 28px; height: 28px; }
.with-logo .badge { width: 20px; height: 20px; font-size: 9px; }
.pic.big.badge { width: 36px; height: 36px; font-size: 13px; }

/* ===== Matchday theme: scoreboard / keycap look ===== */
:root {
  --bg: #0b0e17; --panel: #131827; --panel-2: #1b2236; --line: #2a3350; --text: #eef1fa; --muted: #8f9bb8;
  --accent: #ff5a36; --accent-2: #ffc247; --radius: 16px;
  --shadow: 0 10px 30px -14px rgba(0,0,0,.7);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f6f1e7; --panel: #fffdf8; --panel-2: #efe8d8; --line: #ddd3bd; --text: #1d1a14; --muted: #6d6552; --shadow: 0 10px 26px -16px rgba(80,60,20,.45); }
}
:root[data-theme="light"] { --bg: #f6f1e7; --panel: #fffdf8; --panel-2: #efe8d8; --line: #ddd3bd; --text: #1d1a14; --muted: #6d6552; --shadow: 0 10px 26px -16px rgba(80,60,20,.45); }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 480px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 420px at -10% 10%, color-mix(in srgb, #5b6cff 14%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.top { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
body::before { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.logo { font-weight: 800; letter-spacing: -.2px; }
.logo-mark { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 14px -6px var(--accent), inset 0 -3px 0 rgba(0,0,0,.18); transform: rotate(-6deg); }
.logo:hover .logo-mark { transform: rotate(6deg); transition: transform .2s; }
.tabs { background: transparent; padding: 0; gap: 8px; flex-wrap: wrap; }
.tab { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; box-shadow: 0 2px 0 var(--line); transition: transform .12s, box-shadow .12s; }
.tab:hover { color: var(--text); }
.tab:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.tab.active { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #000)); border-color: transparent; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.seg { border-radius: 999px; }
.seg button { border-radius: 999px; }
.seg button.active { background: var(--accent); color: #fff; }
.icon-pill { border-radius: 12px; box-shadow: 0 2px 0 var(--line); }
.icon-pill:active { transform: translateY(2px); box-shadow: none; }
.mode-tab { border-radius: 14px; box-shadow: 0 3px 0 var(--line); transition: transform .12s, box-shadow .12s; }
.mode-tab:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.mode-tab:active { transform: translateY(3px); box-shadow: none; }
.mode-tab.active { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); box-shadow: 0 3px 0 var(--accent), inset 0 0 0 1px var(--accent); }
.mode-root { box-shadow: var(--shadow); border-radius: 20px; }
.btn { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 82%, #000)); border-radius: 12px; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 50%, #000); transition: transform .1s, box-shadow .1s; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.btn.ghost { background: var(--panel-2); box-shadow: 0 3px 0 var(--line); }
.grid-cell { border-radius: 14px; box-shadow: 0 3px 0 var(--line); transition: transform .12s, box-shadow .12s, border-color .12s; }
.grid-cell:hover:not(.filled) { transform: translateY(-2px); box-shadow: 0 5px 0 var(--accent); }
.grid-cell.filled { box-shadow: 0 3px 0 color-mix(in srgb, var(--hit) 60%, #000); animation: pop .3s ease both; }
.who-cell { border-radius: 10px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.22); font-weight: 600; }
@keyframes pop { from { transform: scale(.88); opacity: .3; } to { transform: none; opacity: 1; } }

/* home hub */
.hero { display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 26px 0 8px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(30px, 6vw, 46px); line-height: 1.05; letter-spacing: -1px; font-weight: 900;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--muted); max-width: 440px; }
.hero-side { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; min-width: 230px; box-shadow: var(--shadow); flex: 0 1 280px; }
.hero-count { font-size: 15px; color: var(--muted); display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.hero-count b { font-size: 30px; color: var(--text); font-weight: 900; }
.hero-count span { margin-left: 6px; font-size: 13px; }
.hub-bar { height: 8px; border-radius: 99px; background: var(--panel-2); margin: 8px 0 12px; overflow: hidden; }
.hub-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.hero-btn { width: 100%; }
.hub-sec h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin: 22px 0 10px; font-weight: 800; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.game-card { --gc: var(--accent); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: 0 4px 0 var(--line);
  position: relative; overflow: hidden; }
.game-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gc); }
.gc-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 6px 2px 10px; text-align: left; }
.gc-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--gc) 22%, var(--panel-2)); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--gc) 45%, transparent); }
.gc-title { font-weight: 800; font-size: 18px; flex: 1; }
.gc-left { font-size: 12px; font-weight: 700; color: var(--gc); background: color-mix(in srgb, var(--gc) 16%, transparent); padding: 3px 9px; border-radius: 99px; }
.gc-left.all { color: #fff; background: var(--hit); }
.gc-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-mode { display: inline-flex; gap: 6px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 7px 11px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.gc-mode:hover { border-color: var(--gc); }
.gc-mode:active { transform: translateY(2px); box-shadow: none; }
.gc-mode.done { background: color-mix(in srgb, var(--hit) 20%, var(--panel-2)); border-color: var(--hit); }
.gc-mode i { font-style: normal; color: var(--hit); font-weight: 900; }
body.is-home .game-row, body.is-home .mode-tabs, body.is-home .day-bar { display: none; }
body.is-home .mode-root { background: none; border: 0; box-shadow: none; padding: 0; }

/* phones: one-row header, mode tabs become a bottom bar */
@media (max-width: 760px) {
  .top-inner { height: 52px; }
  .game-row { padding-bottom: 8px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding: 6px 12px; }
  body:not(.is-home) { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body:not(.is-home) .mode-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  body:not(.is-home) .mode-tab { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 12px; box-shadow: none; border-radius: 12px; }
  body:not(.is-home) .mode-tab .mode-icon { font-size: 18px; }
  .mode-root { padding: 12px; border-radius: 16px; }
}
@media (max-width: 460px) {
  .logo > span:not(.logo-mark) { display: none; }
  .top-inner { gap: 6px; }
  .top-right { gap: 5px; }
  .icon-pill { height: 36px; min-width: 36px; font-size: 16px; padding: 0 8px; }
  .hero { padding-top: 14px; }
  .hero-side { flex: 1 1 100%; }
}

/* legal pages, consent bar, admin */
.legal { max-width: 760px; padding-top: 24px; padding-bottom: 30px; line-height: 1.6; }
.legal h1 { font-size: 28px; margin: 18px 0 6px; } .legal h2 { font-size: 17px; margin: 20px 0 4px; } .legal hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.foot-links { margin: 0 0 10px; } .foot-links a { color: var(--muted); }
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; max-width: 640px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: 0 12px 40px -10px rgba(0,0,0,.6); font-size: 14px; }
.consent p { margin: 0 0 10px; } .consent-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.social { margin-bottom: 4px; } .social-btn { width: 100%; justify-content: center; }
.report-box { width: 100%; resize: vertical; font-family: inherit; }
.admin { padding-top: 20px; padding-bottom: 40px; } .admin .range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; } .admin .range input { width: auto; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.stat-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; box-shadow: 0 3px 0 var(--line); }
.stat-tile b { font-size: 30px; font-weight: 900; } .stat-tile span { color: var(--muted); font-size: 13px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 8px 4px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.bar { flex: 1 0 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 14px; }
.bar i { display: block; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 4px 4px 0 0; }
.bar small { position: absolute; bottom: -18px; left: 0; font-size: 9px; color: var(--muted); white-space: nowrap; transform: rotate(-35deg); transform-origin: left top; }
.pages, .reports { list-style: none; padding: 0; margin: 0; } .pages li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); } .reports li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hero-links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.howto-row { display: flex; gap: 12px; align-items: flex-start; } .howto-row p { margin: 2px 0 0; }
.howto-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); font-size: 18px; font-weight: 800; }
/* game badges */
.gico { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 7px; border-radius: 7px; background: var(--gc); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: -.3px; vertical-align: -5px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.22); }
.tab.active .gico { background: #fff; color: var(--gc); box-shadow: none; }
.gico.big { min-width: 34px; height: 34px; font-size: 15px; border-radius: 10px; margin: 0; }
.gc-icon:has(.gico) { background: none; box-shadow: none; }
.gico.has-img { background: none; box-shadow: none; padding: 0; min-width: 0; }
.gico .gimg { height: 22px; width: auto; max-width: 64px; border-radius: 5px; display: block; }
.gico.g-cs .gimg, .gico.g-dota .gimg, .gico.g-deadlock .gimg { width: 22px; object-fit: cover; }
.gico.g-lol .gimg { height: 16px; }
.tab.active .gico.has-img { background: none; }
.gico.big.has-img .gimg { height: 36px; max-width: 80px; border-radius: 9px; }
.gico.big.g-cs .gimg, .gico.big.g-dota .gimg, .gico.big.g-deadlock .gimg { width: 36px; }
.gico.big.g-lol .gimg { height: 24px; }
/* the login button stands apart from the tool icons */
.top-right { gap: 18px; }
.tools { display: flex; gap: 6px; padding-right: 18px; border-right: 1px solid var(--line); }
.login-btn { height: 40px; padding: 0 20px; border-radius: 999px; border: 0; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #000)); color: #fff; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 50%, #000); white-space: nowrap; }
.login-btn:active { transform: translateY(3px); box-shadow: none; }
.login-btn:not(.cta) { background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 3px 0 var(--line); font-weight: 700; }
.login-btn.cta { animation: cta-pulse 2.4s ease-out 3; }
@media (max-width: 460px) { .top-right { gap: 8px; } .tools { gap: 4px; padding-right: 8px; } .login-btn { height: 36px; padding: 0 12px; font-size: 14px; } }

/* "Угадай команду" */
.chip.miss { background: var(--miss, #5b6275); }
.team-guesses { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.team-guesses .chip { display: inline-flex; align-items: center; gap: 4px; }
.cclue { margin-right: 6px; white-space: nowrap; }
.clues { display: grid; gap: 6px; margin: 10px 0; }
.lineup-team { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin: 6px 0 10px; }
.lineup-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.lineup-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line, #2a3144); min-height: 86px; justify-content: center; }
.lineup-slot.hit { background: var(--hit); color: #fff; } .lineup-slot.hit small { color: #fff; }
.lineup-slot.miss { opacity: .85; border-color: var(--miss, #5b6275); }
.lineup-team .select { margin-left: auto; font-size: .9rem; }
.lineup-team .muted { margin-left: 8px; }
.flag-img { height: 1em; width: 1.33em; object-fit: cover; border-radius: 2px; vertical-align: -0.12em; box-shadow: 0 0 0 1px rgba(128,128,128,.35); }
.slot-country { font-size: .85rem; text-align: center; }
.tabs-wrap { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
.tabs-wrap .tabs { flex: 1; min-width: 0; scroll-behavior: smooth; }
.tabs-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 30px; height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); padding: 0 0 3px; }
.tabs-arrow.left { left: 0; } .tabs-arrow.right { right: 0; }
.tabs-arrow:hover { background: var(--accent); color: #fff; }

/* ===== Grain theme (variant B): warm paper, soft grain gradients, ink buttons. Light and dark, same structure as above ===== */
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url(fonts/manrope-cyrillic-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url(fonts/manrope-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url(fonts/manrope-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url(fonts/manrope-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  --bg: #14110e; --panel: #1e1914; --panel-2: #282119; --line: #322a21; --text: #f3ece1; --muted: #a79d8e;
  --accent: #ff7a4d; --accent-2: #ffb066; --shadow: 0 14px 34px -18px rgba(0,0,0,.8);
  --g1: #7a3b1d; --g2: #6b2a47; --g3: #1f3f73; --gbase: #1c1612; --grain-blend: screen; --grain-op: .16;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f4efe6; --panel: #fffaf1; --panel-2: #f0e4d0; --line: #e6dccb; --text: #1d1a16; --muted: #6d655a;
    --accent: #e4572e; --accent-2: #b4521a; --shadow: 0 14px 30px -20px rgba(90,60,20,.45);
    --g1: #ffcf9e; --g2: #f7a1b4; --g3: #9ec9ff; --gbase: #f7e9d8; --grain-blend: multiply; --grain-op: .32; color-scheme: light; }
}
:root[data-theme="light"] { --bg: #f4efe6; --panel: #fffaf1; --panel-2: #f0e4d0; --line: #e6dccb; --text: #1d1a16; --muted: #6d655a;
    --accent: #e4572e; --accent-2: #b4521a; --shadow: 0 14px 30px -20px rgba(90,60,20,.45);
    --g1: #ffcf9e; --g2: #f7a1b4; --g3: #9ec9ff; --gbase: #f7e9d8; --grain-blend: multiply; --grain-op: .32; color-scheme: light; }
:root[data-theme="dark"] { --bg: #14110e; --panel: #1e1914; --panel-2: #282119; --line: #322a21; --text: #f3ece1; --muted: #a79d8e;
    --accent: #ff7a4d; --accent-2: #ffb066; --shadow: 0 14px 34px -18px rgba(0,0,0,.8);
    --g1: #7a3b1d; --g2: #6b2a47; --g3: #1f3f73; --gbase: #1c1612; --grain-blend: screen; --grain-op: .16; color-scheme: dark; }
body { background: var(--bg); font-family: var(--font); }
h1, h2, h3, .logo, .gc-title, .hero-count b { font-family: var(--font); letter-spacing: -.02em; }
/* ink buttons, pill shapes */
.btn { background: var(--text); color: var(--bg); border-radius: 999px; box-shadow: none; font-weight: 800; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.tab { box-shadow: none; }
.tab.active { background: var(--text); color: var(--bg); border-color: transparent; box-shadow: none; }
.tab.active .gico { box-shadow: none; }
.seg button.active { background: var(--text); color: var(--bg); }
.icon-pill, .mode-tab, .grid-cell { box-shadow: none; }
.grid-cell:hover:not(.filled) { box-shadow: 0 0 0 2px var(--accent); transform: none; }
.mode-tab.active { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mode-root { border-radius: 24px; }
.top, body::before { background: color-mix(in srgb, var(--bg) 82%, transparent); }
/* logo: ring with a question mark */
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.logo b { color: var(--accent); font-weight: 800; }
.logo-mark { width: 34px; height: 34px; background: none; box-shadow: none; transform: none; border-radius: 0; color: var(--text); }
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo:hover .logo-mark { transform: rotate(-8deg); }
/* home: grain hero */
.hero { position: relative; overflow: hidden; margin-top: 18px; padding: clamp(22px, 5vw, 44px); border-radius: 28px;
  background: radial-gradient(60% 90% at 15% 20%, var(--g1), transparent 70%), radial-gradient(55% 80% at 85% 25%, var(--g2), transparent 70%), radial-gradient(70% 90% at 55% 100%, var(--g3), transparent 70%), var(--gbase); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(34px, 7vw, 64px); line-height: .98; letter-spacing: -.04em; font-weight: 800; background: none; color: var(--text); -webkit-background-clip: border-box; background-clip: border-box; text-wrap: balance; }
.hero p { color: color-mix(in srgb, var(--text) 78%, transparent); font-size: 16px; }
.hero-side { background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 22px; }
.hub-bar i { background: var(--accent); }
.hub-sec h2 { letter-spacing: .12em; }
/* game cards */
.game-card { border-radius: 24px; box-shadow: none; padding: 16px; }
.game-card::before { display: none; }
.game-card:hover { border-color: color-mix(in srgb, var(--gc) 55%, var(--line)); }
.gc-icon { border-radius: 50%; background: none; box-shadow: none; border: 1.5px solid var(--text); }
.gc-icon:has(.gico) { border: 0; }
.gc-title { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.gc-left { border-radius: 99px; }
.gc-mode { border-radius: 999px; box-shadow: none; }
.login-btn { background: var(--text); color: var(--bg); box-shadow: none; border-color: transparent; }
.gate { padding: clamp(24px, 6vw, 56px) 16px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.gate h3 { margin: 0; font-size: clamp(24px, 5vw, 34px); letter-spacing: -.03em; }
.gate p { margin: 0; color: var(--muted); max-width: 46ch; }
.gate .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.visitors{width:100%;border-collapse:collapse;font-size:.9rem}.visitors th,.visitors td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line,rgba(128,128,128,.25))}

.player-head{display:flex;gap:14px;align-items:center}.avatar-big{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;font-size:32px;background:var(--card,rgba(128,128,128,.15));border:1px solid var(--line)}
.avatar-pick{display:flex;flex-wrap:wrap;gap:6px}.avatar-pick button{width:40px;height:40px;font-size:20px;border-radius:10px;border:1px solid var(--line);background:transparent;cursor:pointer}.avatar-pick button.on{outline:2px solid var(--accent);background:rgba(228,87,46,.12)}
.row-between{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid var(--line)}
.card-soft{padding:12px 14px;border:1px solid var(--line);border-radius:14px}.btn.danger{color:#d64545;border-color:#d64545}

.notice-bar{display:flex;gap:12px;justify-content:center;align-items:center;padding:8px 16px;background:var(--accent);color:#fff;font-weight:600;font-size:14px;text-align:center}.notice-bar button{background:transparent;border:0;color:inherit;font-size:20px;cursor:pointer;line-height:1}
.admin-tabs{margin:12px 0}.rep{padding:10px 0;border-bottom:1px solid var(--line)}.rep .acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.chip{display:inline-block;padding:1px 8px;border-radius:99px;font-size:12px;border:1px solid var(--line)}
.chip.open{color:#d64545;border-color:#d64545}.chip.progress{color:#c89b3c;border-color:#c89b3c}.chip.fixed{color:#3a9a5b;border-color:#3a9a5b}
.admin textarea{width:100%;min-height:70px}.utable{width:100%;border-collapse:collapse;font-size:.88rem}.utable th,.utable td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line);vertical-align:top}.utable .acts{display:flex;flex-wrap:wrap;gap:4px}
.xscroll{overflow-x:auto}.row-acts{display:flex;gap:8px;flex-wrap:wrap}
.perms{display:flex;flex-direction:column;gap:4px;margin:8px 0}.perm{font-size:14px}

.hero-streak{display:flex;justify-content:space-between;gap:10px;font-size:14px;font-weight:700;flex-wrap:wrap}
.share-img{width:100%;max-width:340px;border-radius:14px;align-self:center;border:1px solid var(--line)}
.seo .btn{text-decoration:none}.catalog-links{font-size:13px;line-height:1.8}
