:root {
  --bg: #000000;
  --surface: #121212;
  --line: #242424;
  --text: #f4f4f4;
  --muted: #8d8d8d;
  --accent: #f2b544;      /* floodlight amber: live state, primary action */
  --ok: #58d08c;
  --bad: #ff5c5c;
  --radius: 10px;
  --side: 220px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Figtree", system-ui, sans-serif; font-feature-settings: "tnum" 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 28px 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); margin-bottom: 24px; }

/* gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-box { width: min(380px, 100%); text-align: center; }
.logo { display: block; height: auto; max-width: 100%; object-fit: contain; }
.logo-gate { max-height: 84px; max-width: 220px; margin: 0 auto; }
.side-logo { padding: 22px 20px 16px; }
.logo-side { max-height: 40px; max-width: 150px; }
.gate-text { color: var(--muted); margin: 18px 0 28px; }
.gate-msg { color: var(--bad); min-height: 22px; margin-top: 14px; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; padding: 9px 14px; cursor: pointer; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #3a3a3a; background: #181818; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 13px 18px; background: transparent; border: 1px solid #3a3a3a; border-radius: 10px; font-weight: 500; font-size: 15px; letter-spacing: 0.01em; transition: border-color .15s, background .15s, transform .15s; }
.btn-google:hover { border-color: #6a6a6a; background: rgba(255,255,255,.04); }
.btn-google:active { transform: scale(.99); }
.btn-google .g { flex: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 0; text-align: left; }
.btn-ghost:hover { background: transparent; color: var(--text); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-accent { border-color: #5a4418; color: var(--accent); }
.btn-accent:hover { background: #1c160a; border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }

/* shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.nav { display: flex; flex-direction: column; padding: 4px 12px; }
.nav a { padding: 9px 10px; border-radius: 7px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface); }
.count { font-size: 12px; color: var(--accent); }
.count:empty { display: none; }
.side-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pulse { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pulse.live .dot { background: var(--accent); box-shadow: 0 0 0 0 rgba(242,181,68,.6); animation: beat 1.6s ease-out infinite; }
.pulse.idle .dot { background: var(--ok); }
.pulse.stale .dot { background: var(--bad); }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(242,181,68,.6); } 100% { box-shadow: 0 0 0 10px rgba(242,181,68,0); } }
@media (prefers-reduced-motion: reduce) { .pulse.live .dot { animation: none; } }
.who { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 36px 40px 80px; max-width: 1180px; width: 100%; }

/* data display */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 8px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 22px; font-weight: 600; margin-top: 2px; }
.stat .v.live { color: var(--accent); }
.stat .v.bad { color: var(--bad); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #0d0d0d; }
td.num, th.num { text-align: right; }
.id { color: var(--muted); font-size: 13px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--accent); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pill.live { border-color: var(--accent); color: var(--accent); }
.pill.ok { border-color: #245a3a; color: var(--ok); }
.pill.bad { border-color: #5a2424; color: var(--bad); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; }
input[type=search], input[type=text], input[type=number], select { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 12px; min-width: 240px; }
select { min-width: 160px; }
.empty { color: var(--muted); padding: 28px 0; }
.row-detail { background: #0b0b0b; }
.row-detail td { padding: 14px 10px 18px; }
.cands { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; max-width: 720px; }
.cands .meta { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.actions input[type=search] { min-width: 320px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.toast.show { opacity: 1; }
.err-box { border: 1px solid #5a2424; border-radius: var(--radius); padding: 12px 16px; color: var(--bad); margin: 16px 0; }

@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; overflow-x: auto; }
  .side-foot { display: none; }
  .main { padding: 20px 16px 60px; }
  table { font-size: 13px; } td, th { padding: 7px 6px; }
}

/* ---------- navigation sections ---------- */
.side { overflow: hidden; }
.nav { overflow-y: auto; flex: 1; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
.nav-h { color: #5c5c5c; font-size: 12px; padding: 16px 10px 4px; }
.nav a { padding: 7px 10px; font-size: 14px; }
.who .role { color: #5c5c5c; }
.link { color: var(--accent); }
.clickable { cursor: pointer; }
.grow { flex: 1; }
.scope { display: inline-flex; gap: 8px; }
.scope select, .scope input { min-width: 160px; }
.tbl-wrap { overflow-x: auto; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--text); } th.sorted { color: var(--text); }
h2.first { margin-top: 0; }
.chk, .inl { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.colpick { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.colpick label { display: inline-flex; gap: 6px; align-items: center; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; } .chip button:hover { color: var(--text); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 12px; cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--text); } .tab.active { color: var(--text); border-bottom-color: var(--accent); }
.toolbar .tabs { margin: 0; border: 0; }

/* ---------- today ---------- */
.today { display: grid; grid-template-columns: 1fr 320px; gap: 36px; align-items: start; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.mcard { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; transition: border-color .12s; }
.mcard:hover { border-color: #3a3a3a; }
.mcard.live { border-color: #4a3a14; }
.mrow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.mrow .team { font-weight: 500; } .team.r { text-align: right; }
.mrow .sc { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.mcard.live .sc { color: var(--accent); }
.mmeta { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; min-height: 22px; }
.mmeta.center { justify-content: center; }
.feed { font-size: 14px; }
.fitem { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.fitem:last-child { border-bottom: 0; }
.ftime { color: #5c5c5c; font-size: 12px; padding-top: 2px; white-space: nowrap; }
.card { display: inline-block; width: 9px; height: 13px; border-radius: 2px; vertical-align: -2px; background: var(--accent); } .card.red { background: var(--bad); }

/* ---------- match ---------- */
.mhead { margin-bottom: 6px; }
.back { color: var(--muted); font-size: 13px; } .back:hover { color: var(--text); }
.mtitle { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin: 10px 0 6px; }
.mtitle .team { font-size: 22px; font-weight: 600; }
.mtitle .big { font-size: 36px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.timeline .ev { display: grid; grid-template-columns: 44px 52px 1fr auto; white-space: nowrap; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .ev.a .who { color: var(--muted); } .timeline .ev.a .who b { color: var(--text); }
.timeline .min { color: var(--muted); font-variant-numeric: tabular-nums; } .timeline .tm { font-size: 12px; }
.bars .bar { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; align-items: center; padding: 6px 0; position: relative; }
.bars .bv { font-variant-numeric: tabular-nums; } .bars .bv + .btrack + .bv { text-align: right; }
.bars .bl { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 12px; margin-top: -2px; }
.btrack { display: flex; height: 6px; gap: 3px; } .btrack .bh { background: var(--text); border-radius: 3px; height: 6px; margin-left: auto; } .btrack .ba { background: #4a4a4a; border-radius: 3px; height: 6px; }
.btrack { justify-content: center; } .btrack .bh { flex: none; } .btrack .ba { flex: none; }
.pitch { background: #0a0f0a; border: 1px solid #1e2a1e; border-radius: var(--radius); padding: 18px 10px; display: flex; flex-direction: column; gap: 18px; min-height: 300px; justify-content: space-between; }
.prow { display: flex; justify-content: space-around; }
.pp { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 72px; }
.pn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #3a3a3a; display: grid; place-items: center; font-size: 12px; background: #141414; }
.pname { font-size: 12px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
.bench { margin-top: 10px; font-size: 13px; line-height: 1.6; }
.fplrow { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .fplrow:last-child { border-bottom: 0; }

/* ---------- probabilities ---------- */
.prob { margin: 8px 0 14px; } .plabel { font-size: 13px; margin-bottom: 6px; }
.ptrack { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; font-size: 12px; }
.ptrack.small { height: 6px; margin-top: 10px; }
.ptrack > div { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; white-space: nowrap; transition: width .2s; }
.ptrack .ph { background: #e8e8e8; color: #111; } .ptrack .pd { background: #4a4a4a; color: #f4f4f4; } .ptrack .pa { background: #262626; color: #cfcfcf; }
.ptrack.small .ph, .ptrack.small .pd, .ptrack.small .pa { color: transparent; }

/* ---------- predictions ---------- */
.pcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; }
.pcard.todo { border-left: 2px solid var(--accent); }
.pcard.locked { opacity: .85; }
.pch { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.pch .team { font-weight: 500; font-size: 16px; }
.pch > .muted { text-align: center; }
.pinputs { max-width: 560px; }
.pin { display: inline-flex; align-items: center; gap: 8px; margin: 0 20px 6px 0; }
.pin input { width: 72px; min-width: 0; text-align: right; padding: 6px 8px; }
.pcent { color: var(--muted); }
.ppick { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ppick .pstate { margin-left: 8px; font-size: 13px; }
.btn-accent.on { background: #1c160a; }
tr.me td { background: #0f0d08; } tr.ref td { color: var(--muted); }
.plocked .prob { margin-top: 0; }

/* ---------- charts ---------- */
.chart { width: 100%; max-width: 760px; height: auto; display: block; }
.chart .grid { stroke: var(--line); } .chart .lbl { fill: var(--muted); font-size: 11px; }
.chart .ln { fill: none; stroke-width: 2; stroke: hsl(calc(38 + var(--i) * 47), 70%, 62%); } .chart .ln.ref { stroke: #4a4a4a; stroke-dasharray: 4 4; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; align-items: center; }
.lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: hsl(calc(38 + var(--i) * 47), 70%, 62%); vertical-align: -1px; }
.lg.ref::before { background: #4a4a4a; }
.radar { display: flex; gap: 24px; align-items: center; margin: 4px 0 18px; flex-wrap: wrap; }
.radar svg { width: 260px; height: 260px; }
.radar .grid { fill: none; stroke: var(--line); } .radar .lbl { fill: var(--muted); font-size: 10px; }
.radar .area { fill: hsl(calc(38 + var(--i) * 47), 70%, 62%); fill-opacity: .12; stroke: hsl(calc(38 + var(--i) * 47), 70%, 62%); stroke-width: 1.5; }
table.cmp th { text-align: left; color: var(--muted); font-weight: 500; } table.cmp thead th { color: var(--text); }
table.cmp td.best { color: var(--accent); font-weight: 600; }
table.cmp tr.sep th { padding-top: 18px; color: var(--text); }
.fd { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; background: #333; }
.fd.w { background: var(--ok); } .fd.d { background: #6a6a6a; } .fd.l { background: var(--bad); }

@media (max-width: 1000px) { .today, .two { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .nav { flex-direction: row; } .nav-h { display: none; }
  .mtitle .team { font-size: 16px; } .mtitle .big { font-size: 26px; min-width: 70px; }
}
table.sheet td, table.sheet th { white-space: nowrap; font-size: 13px; padding: 7px 10px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
table.cmp { table-layout: fixed; max-width: 960px; } table.cmp th:first-child { width: 160px; }
