:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #111418;
  --muted: #5f6b7a;
  --border: #e2e6eb;
  --accent: #1f6feb;
  --win: #1e8e3e;
  --loss: #d93025;
  --warn: #b26a00;
  --warn-bg: #fff4e0;
  --lock: #1e8e3e;
  --strong: #34a853;
  --lean: #f9ab00;
  --toss: #9aa0a6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1f2630;
    --text: #e6edf3;
    --muted: #8b98a8;
    --border: #2a323d;
    --accent: #58a6ff;
    --win: #3fb950;
    --loss: #f85149;
    --warn: #e3b341;
    --warn-bg: #2b2111;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #161b22; --surface-2: #1f2630; --text: #e6edf3; --muted: #8b98a8;
  --border: #2a323d; --accent: #58a6ff; --win: #3fb950; --loss: #f85149; --warn: #e3b341;
  --warn-bg: #2b2111; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 28px 0 10px; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.05rem; }
.tabs { display: flex; gap: 4px; }
.tab {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-2); }

main { padding: 24px 16px 40px; }
.week-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.week-bar p { margin: 0; }
select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
}

.record-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.pill {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: .85rem;
}
.pill b { font-variant-numeric: tabular-nums; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.chip {
  font: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.chip.active { color: var(--text); border-color: var(--accent); }

/* game cards */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .games { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card-head { padding: 14px 16px 10px; border-top: 4px solid var(--toss); }
.card-head.Lock { border-top-color: var(--lock); }
.card-head.Strong { border-top-color: var(--strong); }
.card-head.Lean { border-top-color: var(--lean); }
.kick { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.matchup { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 10px; }
.team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team.home { justify-content: flex-end; text-align: right; }
.team img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.team .abbr { font-weight: 700; font-size: 1.1rem; }
.team .qb { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team.picked .abbr { color: var(--accent); }
.score { font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.score small { display: block; font-size: .65rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.prob { margin-top: 12px; }
.prob-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex;
  outline: 1px solid color-mix(in srgb, var(--text) 18%, transparent); }
.prob-bar span + span { border-left: 2px solid var(--surface); }
.prob-bar span { display: block; height: 100%; }
.prob-label { display: flex; justify-content: space-between; font-size: .8rem; margin-top: 4px; }
.badge { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); }

.card-body { padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.lines { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 2px 10px; font-size: .85rem; align-items: center; }
.lines .h { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lean { font-weight: 600; }
.alert { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 6px 10px; font-size: .82rem; }
.writeup { font-size: .88rem; margin: 0; }
.result { font-size: .85rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.res { font-weight: 700; padding: 1px 8px; border-radius: 6px; font-size: .75rem; }
.res.W { background: color-mix(in srgb, var(--win) 18%, transparent); color: var(--win); }
.res.L { background: color-mix(in srgb, var(--loss) 18%, transparent); color: var(--loss); }
.res.P { background: var(--surface-2); color: var(--muted); }

details { border-top: 1px solid var(--border); padding-top: 8px; }
details summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--muted); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
details ul { margin: 6px 0 0; padding-left: 18px; font-size: .84rem; }
details li { margin: 2px 0; }
.props-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 6px; }
.props-table td, .props-table th { padding: 4px 4px; text-align: left; border-bottom: 1px solid var(--border); }
.props-table th { font-size: .7rem; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.props-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.edge { color: var(--win); font-weight: 600; }
.tag { font-size: .7rem; color: var(--muted); }

/* record */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .s { font-size: .8rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: .88rem; }
table.data th, table.data td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }

.prose { max-width: 720px; }
.prose p { margin: 0 0 14px; }
.footer { padding: 24px 16px 40px; font-size: .8rem; }

/* bet ladder */
.ladder { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 16px 0 4px; box-shadow: var(--shadow); }
.ladder h2 { margin: 0 0 2px; }
.ladder p { margin: 0 0 8px; }
.ladder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ladder-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 4px; }
.ladder-sum .tile { background: var(--surface-2); border: 0; }
.ladder .table-scroll { margin: 8px 0; }
.ladder-empty { margin: 16px 0 4px; font-size: .88rem; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg-btn small { font-weight: 500; opacity: .8; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tested { background: color-mix(in srgb, var(--win) 12%, transparent); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: .82rem; }
.info-note { margin: -4px 0 0; }
.lines { grid-template-columns: auto 1fr 1fr; }
