:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --juice: #eda100;
  --good: #006300;
  --good-bg: rgba(12, 163, 12, 0.10);
  --bad: #b42323;
  --bad-bg: rgba(208, 59, 59, 0.10);
  --neutral-bg: rgba(11, 11, 11, 0.06);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #9a9890;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --good: #3cc23c;
    --good-bg: rgba(12, 163, 12, 0.18);
    --bad: #f08080;
    --bad-bg: rgba(230, 103, 103, 0.16);
    --neutral-bg: rgba(255, 255, 255, 0.08);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9a9890;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10); --accent: #3987e5; --accent-ink: #86b6ef;
  --good: #3cc23c; --good-bg: rgba(12, 163, 12, 0.18); --bad: #f08080; --bad-bg: rgba(230, 103, 103, 0.16); --neutral-bg: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-ink); text-underline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); position: relative; }
.mark::after { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--juice); }
nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
nav a:hover { background: var(--neutral-bg); color: var(--ink); }
nav a[aria-current] { color: var(--ink); font-weight: 600; background: var(--neutral-bg); }

/* hero */
.hero { padding: 32px 0 8px; max-width: 760px; }
.eyebrow { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.lede { color: var(--ink-2); margin: 0; font-size: 17px; }
.hero-figure { font-size: 56px; font-weight: 650; line-height: 1; margin: 8px 0 12px; letter-spacing: -0.02em; }
.note { background: var(--surface-2); border-radius: 8px; padding: 10px 14px; color: var(--ink-2); font-size: 14px; margin: 12px 0; }
.fine { color: var(--muted); font-size: 13px; max-width: 860px; }
.prose p { color: var(--ink-2); max-width: 680px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 24px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile-label { font-size: 13px; color: var(--ink-2); }
.tile-value { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -0.01em; }
.tile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* controls */
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.chip { font: inherit; font-size: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }
.sort { margin-left: auto; font-size: 14px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.sort select { font: inherit; font-size: 14px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }

/* tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table.games { width: 100%; border-collapse: collapse; font-size: 14px; }
.games th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 10px 12px; border-bottom: 1px solid var(--grid); background: var(--surface); position: sticky; top: 0; }
.games td { padding: 10px 12px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.games tbody tr:last-child td { border-bottom: 0; }
.games tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.n, th.num { white-space: nowrap; }
.pick { font-weight: 600; }
@media (min-width: 721px) { .games td:nth-child(2) { min-width: 150px; } .move { min-width: 150px; } }
.move { font-size: 13px; }
.edge { display: inline-block; min-width: 2.6em; margin-left: 8px; padding: 1px 6px; border-radius: 6px; background: var(--neutral-bg);
  font-variant-numeric: tabular-nums; font-size: 13px; text-align: center; }
tr[data-edge] .edge { font-weight: 600; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 6px; margin-left: 4px; white-space: nowrap; }
.tag-good { color: var(--good); background: var(--good-bg); }
.tag-bad { color: var(--bad); background: var(--bad-bg); }
.tag-neutral { color: var(--ink-2); background: var(--neutral-bg); }

/* charts */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 6px; position: relative; }
.chart figcaption { display: flex; flex-direction: column; margin-bottom: 4px; }
.chart-title { font-weight: 600; }
.chart-sub { font-size: 13px; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); }
.chart .hit:hover .bar, .chart .hit:focus .bar { opacity: 0.8; }
.chart .hit:focus { outline: none; }
.chart .ref { stroke: var(--ink-2); stroke-width: 1.5; }
.chart .ref-label { fill: var(--ink-2); font-size: 12px; }
.tooltip { position: absolute; pointer-events: none; background: var(--ink); color: var(--page); font-size: 13px; padding: 6px 9px;
  border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); }

/* lists */
.list { list-style: none; padding: 0; margin: 16px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--grid); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }

.foot { padding: 32px 16px 48px; color: var(--muted); font-size: 13px; }
.foot p { max-width: 860px; }

/* phones: rows become cards */
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .sort { margin-left: 0; }
  .hero-figure { font-size: 48px; }
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  table.games thead { display: none; }
  table.games, .games tbody, .games tr, .games td { display: block; width: 100%; }
  .games tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; }
  .games tbody tr:last-child td, .games td { border-bottom: 0; }
  .games td { padding: 5px 14px; text-align: right; overflow: hidden; }
  .games td::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 13px; text-align: left; }
  .games td .muted.small, .games td div.small { display: block; }
  .games td.num { white-space: normal; }
}
