:root {
  --bg: #0b0f17;
  --panel: #131a26;
  --panel-2: #1a2333;
  --line: #263044;
  --text: #e8edf5;
  --muted: #8a96ab;
  --accent: #ff7a1a;
  --good: #22c55e;
  --warn: #f5b301;
  --bad: #ef4444;
  --radius: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fa; --panel: #ffffff; --panel-2: #eef2f8; --line: #dde3ee;
    --text: #111827; --muted: #5b6475; --accent: #e8590c; --good: #15803d; --warn: #b45309; --bad: #dc2626;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1, h2 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .8rem; margin: .5rem 0 0; }
.note { background: var(--panel-2); border-left: 3px solid var(--warn); padding: .5rem .75rem; border-radius: 6px; font-size: .85rem; margin: 0 0 .75rem; }
.error { color: var(--bad); }
.pos { color: var(--good); } .neg { color: var(--bad); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); z-index: 10;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 1rem; }
nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
nav a[aria-current="page"], nav a:hover { color: var(--text); }

main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.03em; }
.sub { color: var(--muted); margin: 0 0 1rem; }
.paste { display: flex; gap: .5rem; }
.paste input { flex: 1; min-width: 0; }
input, select, button {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: .65rem .8rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { cursor: pointer; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); font-weight: 600; padding: .35rem .7rem; font-size: .85rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .5rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid.two { grid-template-columns: 1fr; } }
#game { display: grid; gap: 16px; }
#game[hidden] { display: none; }

.scorebug { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.team { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.team.home { flex-direction: row-reverse; text-align: right; }
.team img { flex: none; }
.tname { font-weight: 700; }
.rank { color: var(--muted); font-size: .8em; margin-right: .3em; }
.score { text-align: center; }
.nums { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.dash { color: var(--muted); margin: 0 .4rem; }
.status { font-weight: 600; color: var(--muted); }
.status.live, .gs.live { color: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 6px; animation: pulse 1.4s infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .3; } }
@media (max-width: 560px) {
  .scorebug { grid-template-columns: 1fr; text-align: center; }
  .team, .team.home { flex-direction: column; text-align: center; }
  .scorebug .team.away { order: 1; } .scorebug .score { order: 2; } .scorebug .team.home { order: 3; }
}

.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); font-weight: 700; display: flex; gap: .5rem; align-items: center; }
.pick { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: .25rem 0 .75rem; }
.pick .odds { color: var(--muted); font-weight: 600; font-size: 1.1rem; }
.badge { text-transform: none; letter-spacing: 0; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; }
.badge.good { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.badge.muted { background: var(--panel-2); }
.bestbet { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .5rem; }
.stats3 div { background: var(--panel-2); border-radius: 10px; padding: .5rem; text-align: center; }
.stats3 b { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stats3 span { font-size: .75rem; color: var(--muted); }
.grade { margin-top: .5rem; font-weight: 800; }
.grade.win { color: var(--good); } .grade.loss { color: var(--bad); } .grade.push { color: var(--warn); }

.meter { position: relative; height: 14px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.meter-fill { position: absolute; top: 0; bottom: 0; transition: all .4s; }
.meter-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--muted); }
.meter-labels { display: flex; justify-content: space-between; color: var(--muted); margin-top: .25rem; }
.facts { margin: .75rem 0 0; padding-left: 1.1rem; }
.facts li { margin-bottom: .35rem; }

.chart svg { width: 100%; height: auto; display: block; }
.chart .zero { stroke: var(--muted); stroke-width: 1; }
.chart .gridline { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .worm { stroke: var(--text); stroke-width: 1.5; }
.chart .cut { stroke: var(--accent); stroke-width: 2; }
.chart .lbl { fill: var(--muted); font-size: 12px; font-weight: 600; }
.replay { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; flex-wrap: wrap; }
.replay input[type=range] { flex: 1; min-width: 140px; accent-color: var(--accent); padding: 0; }
.toggle { display: flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--muted); }

.projscore { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin: .25rem 0 .75rem; }
.projscore > div:not(.muted) { display: flex; flex-direction: column; align-items: center; }
.projscore b { font-size: 2rem; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table.compact td, .table.compact th { padding: .35rem .5rem; }
.table th { color: var(--muted); font-size: .8rem; font-weight: 600; }
.table tr.best td { background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 700; }
#projection .table td:last-child { white-space: normal; }

.lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.lines label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--muted); min-width: 0; }
.lines input { width: 100%; }
.settings summary { cursor: pointer; font-weight: 700; margin-bottom: .5rem; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.gamecard { text-align: left; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-weight: 400; padding: .6rem .7rem; display: grid; gap: .25rem; }
.gamecard:hover { border-color: var(--accent); }
.gamecard.in { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.gs { font-size: .75rem; color: var(--muted); font-weight: 700; }
.gl { display: flex; align-items: center; gap: .45rem; }
.gl span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl b { font-variant-numeric: tabular-nums; }

/* teams page */
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.teamcard { display: flex; align-items: center; gap: .6rem; text-align: left; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; padding: .5rem .6rem; }
.teamcard:hover { border-color: var(--accent); }
.teamcard img { flex: none; }
.teamcard span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.stat { background: var(--panel-2); border-radius: 10px; padding: .5rem .6rem; }
.stat b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .75rem; color: var(--muted); }

footer { max-width: 1100px; margin: 1rem auto 2rem; padding: 0 16px; font-size: .8rem; color: var(--muted); }
@media (max-width: 560px) {
  .lines { grid-template-columns: 1fr 1fr; }
  .topbar { flex-wrap: wrap; row-gap: .4rem; }
  nav { gap: 1rem; width: 100%; overflow-x: auto; }
}

/* screenshot reader */
.dropzone { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; border: 1.5px dashed var(--line); border-radius: 10px; padding: .6rem .75rem; margin-bottom: .75rem; }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.shot-btn { cursor: pointer; background: var(--accent); color: #fff; font-weight: 700; border-radius: 8px; padding: .45rem .75rem; font-size: .9rem; }
.shot-btn:focus-within { outline: 2px solid var(--text); }
#shot-status { margin-bottom: .75rem; }
#shot-status ul { margin: .35rem 0; padding-left: 1.1rem; }
#shot-status details { margin-top: .35rem; }
#shot-status pre { white-space: pre-wrap; font-size: .75rem; max-height: 180px; overflow: auto; background: var(--panel-2); padding: .5rem; border-radius: 6px; }
.lines input.filled { border-color: var(--good); }
.lines input.guess { border-color: var(--warn); }
