:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #15181d;
  --muted: #5d6673;
  --line: #e3e6eb;
  --good: #1a7f4b;
  --bad: #c0392b;
  --accent: #2b59c3;
  --chip: #eef1f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --c-market_ev: #2b59c3;
  --c-ai_analyst: #8e44ad;
  --c-baseline_fav: #d68910;
  --c-baseline_random: #7f8c8d;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --panel: #171b21;
    --ink: #e8ebef;
    --muted: #9aa3ae;
    --line: #2a3038;
    --good: #3ccf86;
    --bad: #ff6b5e;
    --accent: #6e94ff;
    --chip: #222831;
    --shadow: none;
    --c-market_ev: #6e94ff;
    --c-ai_analyst: #c08ae0;
    --c-baseline_fav: #f0b04a;
    --c-baseline_random: #a5b0b5;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
body.locked { overflow: hidden; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header.top { padding-top: 24px; padding-bottom: 8px; }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.word { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.word span { color: var(--accent); }
.tagline { color: var(--muted); margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.status { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.st-dot.ok { background: var(--good); }
.st-dot.failed { background: var(--bad); }
.st-dot.running { background: #e0a100; }
.chip { font-size: 12px; font-weight: 600; color: var(--ink); background: var(--chip); border-radius: 999px; padding: 2px 10px; }
.updated { color: var(--muted); font-size: 13px; margin: 0; }
.muted { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.section-head .muted { font-size: 13px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.table-wrap { padding: 0; overflow-x: auto; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; flex: none; }

/* Today's bets: scoreboard cards */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: thin; }
.rail .none { color: var(--muted); padding: 16px; }
.game { flex: 0 0 250px; height: 240px; scroll-snap-align: start; perspective: 1000px; cursor: pointer; outline: none; }
.game:focus-visible .face { outline: 2px solid var(--c); outline-offset: 2px; }
.flip { position: relative; width: 100%; height: 100%; transition: transform 0.45s ease; transform-style: preserve-3d; }
.game.flipped .flip { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.back { transform: rotateY(180deg); }
.g-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--chip); font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.g-top .who { color: var(--c); text-transform: uppercase; letter-spacing: 0.06em; }
.teams { padding: 6px 8px 0; display: flex; flex-direction: column; gap: 2px; flex: 1; justify-content: center; }
.team { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 10px; }
.team.picked { background: color-mix(in srgb, var(--c) 14%, transparent); }
.team .logo, .team .logo img { width: 32px; height: 32px; flex: none; display: block; object-fit: contain; }
.logo.fallback { width: 32px; height: 32px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.tn { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tn b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn span { font-size: 11.5px; color: var(--muted); }
.team:not(.picked) .tn b { font-weight: 600; color: var(--muted); }
.pick-tag { margin-left: auto; background: var(--c); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.bet-line { display: flex; align-items: center; gap: 8px; margin: 6px 12px 0; padding: 5px 6px 5px 5px; border-radius: 999px; background: var(--bg); border: 1px dashed var(--line); font-size: 13px; min-width: 0; }
.bet-line span { flex: none; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; }
.bet-line b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bottom { display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: end; gap: 6px; padding: 8px 12px 10px; margin-top: 6px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-bottom span { display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.flip-hint { color: var(--muted); font-size: 15px; align-self: center; }
.why { padding: 10px 14px 12px; overflow-y: auto; font-size: 13px; }
.why p { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }
.prob-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.probline { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.probline b { color: var(--ink); font-size: 16px; margin-left: 4px; }
@media (prefers-reduced-motion: reduce) { .flip { transition: none; } }

/* Portfolio cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.card { all: unset; box-sizing: border-box; cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; border-top: 4px solid var(--c); box-shadow: var(--shadow); display: block; transition: transform 0.12s ease, border-color 0.12s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--c); }
.card:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.card h3 { margin: 0 0 6px; font-size: 15px; display: flex; justify-content: space-between; }
.card h3 .go { color: var(--muted); font-weight: 400; }
.card .big, .sheet .big { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; font-size: 13px; }
.stats div span { display: block; color: var(--muted); font-size: 12px; }
.card .foot { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.chart-panel { height: 300px; position: relative; }
.empty { color: var(--muted); text-align: center; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 16px; }
.empty[hidden] { display: none; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted { font-size: 12px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--chip); }
.pill.win { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.loss { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 4px 10px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; }
.filters button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.more { display: block; margin: 10px auto 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 16px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.more:hover { border-color: var(--muted); }
.more[hidden] { display: none; }

/* Team mini-logos in tables and lists */
.matchup { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mini { display: inline-flex; align-items: center; gap: 5px; }
.mini .logo, .mini .logo img { width: 20px; height: 20px; display: block; object-fit: contain; }
.mini .logo.fallback { width: 20px; height: 20px; font-size: 8px; }
.mini b { font-size: 13px; }
.at { color: var(--muted); font-size: 12px; }

/* AI's take: compact expandable list */
.reads { list-style: none; margin: 0; padding: 0; }
.read { border-bottom: 1px solid var(--line); }
.read:last-child { border-bottom: none; }
.read-row { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 1fr auto auto 16px; align-items: center; gap: 12px; padding: 12px 16px; }
.read-row:hover { background: var(--chip); }
.read-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.read-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.verdict { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.verdict.pos { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.verdict.neg { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.chev { color: var(--muted); transition: transform 0.15s ease; text-align: center; }
.read-row[aria-expanded="true"] .chev { transform: rotate(90deg); }
.read-detail { padding: 0 16px 14px; }
.read-detail p { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.probs { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.probs b { color: var(--ink); }
.bar { position: relative; height: 6px; background: var(--chip); border-radius: 3px; margin: 8px 0 2px; }
.bar .m { position: absolute; top: -4px; width: 2px; height: 14px; background: var(--muted); }
.bar .a { position: absolute; top: -4px; width: 10px; height: 14px; margin-left: -5px; border-radius: 4px; background: var(--c-ai_analyst); }
.empty-row { padding: 14px 16px; }

/* How it works */
.how { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.how-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.how-card h3 { margin: 0 0 4px; font-size: 15px; }
.how-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.mini-h { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.steps { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; margin-bottom: 10px; font-size: 13.5px; }
.steps li::before { content: counter(step); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.steps span { color: var(--muted); }
.terms { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13.5px; }
.terms dt { font-weight: 700; }
.terms dd { margin: 0; color: var(--muted); }

/* Portfolio detail sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(8, 10, 14, 0.55); z-index: 10; }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--bg); z-index: 11; overflow-y: auto; box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25); animation: slide 0.18s ease-out; }
.sheet[hidden], .sheet-backdrop[hidden] { display: none; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-inner { padding: 20px 20px 40px; }
.sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 4px solid var(--c); }
.sheet-top h2 { font-size: 22px; margin: 0; }
.sheet-top p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.close { border: 1px solid var(--line); background: var(--panel); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; flex: none; }
.sheet section { margin-top: 24px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi b { font-size: 18px; }
.sheet .chart-panel { height: 220px; }
.note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

footer.wrap { color: var(--muted); font-size: 12px; padding-top: 32px; padding-bottom: 32px; }

@media (max-width: 820px) {
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .read-row { grid-template-columns: 1fr auto 16px; row-gap: 4px; }
  .read-time { grid-column: 1; grid-row: 2; }
  .verdict { grid-column: 2; grid-row: 1 / span 2; }
  .chev { grid-column: 3; grid-row: 1 / span 2; }
  .word { font-size: 22px; }
  .how-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .game { flex-basis: 78%; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 12px; }
  .card .big { font-size: 21px; margin-top: 6px; }
  .card .stats { grid-template-columns: 1fr 1fr; font-size: 12px; }
  .card .stats div:nth-child(3) { display: none; }
  .sheet-inner { padding: 16px 16px 40px; }
}
