/* BotBowl Bench - site styles. Tokens first; light + dark.
   Look: an evals results page. Plex Sans for prose, Plex Mono for numbers and labels,
   hairline rules instead of boxes, one orange accent; team colours stay blue (home) / red (away). */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f5f5f4;
  --border: #e7e5e4;
  --ink: #111111;             /* strong hairlines, active nav, primary buttons */
  --ink-text: #ffffff;        /* text on --ink */
  --text-primary: #111111;
  --text-secondary: #57534e;
  --text-muted: #8a8580;
  --accent: #ff5a1f;          /* orange: rank 1, live, brand mark */
  --accent-ink: #ffffff;
  --accent-soft: #fff4ee;
  --home: #2563eb;            /* matches the board: home = blue */
  --away: #dc2626;            /* away = red */
  --home-soft: #eff4ff;
  --away-soft: #fef2f2;
  --good: #15803d;
  --warning: #ca8a04;
  --critical: #dc2626;
  --bar: #111111;
  --grid: #efedeb;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --radius: 0px;
  --shadow: none;
  --sans: "IBM Plex Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f0e; --surface-1: #0f0f0e; --surface-2: #1c1c1a; --border: #2c2b29;
    --ink: #ededeb; --ink-text: #0f0f0e;
    --text-primary: #f5f5f4; --text-secondary: #c3c0ba; --text-muted: #8f8b85;
    --accent: #ff6a33; --accent-ink: #0f0f0e; --accent-soft: #2a1810;
    --home: #5b8def; --away: #f05252; --home-soft: #172340; --away-soft: #3a1717;
    --good: #3fb950; --warning: #d4a72c; --critical: #f05252;
    --bar: #ededeb; --grid: #242422;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0e; --surface-1: #0f0f0e; --surface-2: #1c1c1a; --border: #2c2b29;
  --ink: #ededeb; --ink-text: #0f0f0e;
  --text-primary: #f5f5f4; --text-secondary: #c3c0ba; --text-muted: #8f8b85;
  --accent: #ff6a33; --accent-ink: #0f0f0e; --accent-soft: #2a1810;
  --home: #5b8def; --away: #f05252; --home-soft: #172340; --away-soft: #3a1717;
  --good: #3fb950; --warning: #d4a72c; --critical: #f05252;
  --bar: #ededeb; --grid: #242422;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text-primary);
  font: 15px/1.55 var(--sans);
}
a { color: inherit; text-decoration-color: var(--text-muted); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; font-weight: 600; letter-spacing: -.02em; }
h2 { font-family: var(--mono); font-size: .8rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
h3 { font-size: 1rem; }
.muted { color: var(--text-muted); } .secondary { color: var(--text-secondary); }
.mono { font-family: var(--mono); font-size: .88em; }
.num { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }

/* header */
.topbar { background: var(--surface-1); border-bottom: 1px solid var(--ink); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-family: var(--mono); font-weight: 600; font-size: .95rem; text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark { width: 14px; height: 14px; background: var(--accent); display: block; font-size: 0; }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { font-family: var(--mono); font-size: .82rem; text-decoration: none; padding: 6px 10px; color: var(--text-secondary); white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text-primary); }
.nav a.active { background: var(--ink); color: var(--ink-text); }
.status-pill { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.dot.live { background: var(--critical); animation: pulse 1.4s infinite; }
.dot.idle { background: var(--good); }
.dot.wait { background: var(--warning); }
@keyframes pulse { 50% { opacity: .35; } }

main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: transparent; border-top: 1px solid var(--ink); padding: 14px 0 16px; min-width: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.section { margin-top: 24px; }
.empty { color: var(--text-muted); padding: 12px 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 500; border-bottom-color: var(--ink); }
td { border-bottom-color: var(--grid); }
th.num, td.num { text-align: right; }
tbody tr:hover { background: var(--accent-soft); }
tr.disabled td { opacity: .55; }
.rank { font-family: var(--mono); font-weight: 500; color: var(--text-muted); width: 2em; }
#lb tbody tr:first-child td, #top tbody tr:first-child td { font-weight: 600; }
#lb tbody tr:first-child .rank, #top tbody tr:first-child .rank { color: var(--accent); }

/* chips and badges */
.badge { display: inline-block; font-family: var(--mono); font-size: .7rem; padding: 1px 8px; background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.badge.live { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); font-weight: 600; }
.badge.win { color: var(--good); border-color: currentColor; background: transparent; }
.badge.loss { color: var(--critical); border-color: currentColor; background: transparent; }
.side-h { color: var(--home); font-weight: 700; } .side-a { color: var(--away); font-weight: 700; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: baseline; margin-right: 6px; }

/* match list rows */
.match-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.match-row:last-child { border-bottom: 0; }
.match-row .home { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row .away { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row .score { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: center; }
.match-row:hover { background: var(--surface-2); }

/* scoreboard */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.scoreboard .team { min-width: 0; }
.scoreboard .team .name { font-size: 1.15rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* mirrors the board: away (red) defends the left endzone, home (blue) the right one */
.scoreboard .team.away { text-align: right; border-right: 4px solid var(--away); padding-right: 12px; }
.scoreboard .team.home { border-left: 4px solid var(--home); padding-left: 12px; }
.scoreboard .big { font-family: var(--mono); font-size: 2.2rem; font-weight: 500; font-variant-numeric: tabular-nums; text-align: center; line-height: 1; }
.scoreboard .meta { text-align: center; font-size: .82rem; color: var(--text-muted); margin-top: 4px; }

/* live layout */
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .live-layout { grid-template-columns: 1fr; } }
.board-frame { width: 100%; height: 640px; border: 0; border-radius: var(--radius); background: #2b5a2b; display: block; }
@media (max-width: 700px) { .board-frame { height: 300px; } .feed { height: 520px; } }
.feed { height: 640px; display: flex; flex-direction: column; padding: 0; }
.feed-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.feed-tabs button, .btn {
  font: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary);
  padding: 4px 10px; cursor: pointer; font-family: var(--mono); font-size: .78rem;
}
.feed-tabs button.active, .btn.primary { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.feed-body { overflow-y: auto; padding: 8px 12px 16px; flex: 1; font-size: .88rem; }
.ev { padding: 6px 0; border-bottom: 1px dashed var(--border); overflow-wrap: anywhere; }
.ev:last-child { border-bottom: 0; }
.ev .who { font-weight: 700; font-size: .78rem; }
.ev.home .who { color: var(--home); } .ev.away .who { color: var(--away); }
.ev .kind { font-family: var(--mono); font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-left: 6px; }
.ev.thought .body { font-style: italic; color: var(--text-secondary); white-space: pre-wrap; }
.ev.tool .call { font-weight: 500; }
.ev.tool.bad .call { color: var(--critical); }
.ev.tool details { margin-top: 2px; }
.ev.tool summary { cursor: pointer; color: var(--text-muted); font-size: .78rem; }
.ev.tool pre { white-space: pre-wrap; font-family: var(--mono); font-size: .76rem; background: var(--surface-2); padding: 8px; border-radius: 6px; margin: 4px 0 0; max-height: 260px; overflow: auto; }
.ev.episode { color: var(--text-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; padding-top: 12px; }
.ev.reflection { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 6px 0; border-bottom: 0; }
.ev.system, .ev.error { color: var(--text-secondary); }
.ev.error { color: var(--critical); }
.log-group { margin-top: 8px; }
.log-turn { font-family: var(--mono); position: sticky; top: -8px; background: var(--surface-1); margin: 0 -12px 2px; padding: 6px 12px 4px;
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); z-index: 1; }
.log-turn.home { color: var(--home); } .log-turn.away { color: var(--away); }
.log-line { padding: 3px 6px; margin: 0 -6px; border-radius: 4px; overflow-wrap: anywhere; }
.log-line.seek { cursor: pointer; }
.log-line.seek:hover { background: var(--surface-2); }
.log-line.now { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--text-muted); }
.log-line .pid { font-weight: 700; }
.log-line .pid.home { color: var(--home); } .log-line .pid.away { color: var(--away); }
.log-line.k-td { font-weight: 700; color: var(--good); box-shadow: inset 3px 0 0 var(--good); }
.log-line.k-turnover { font-weight: 700; color: var(--critical); }
.log-line.k-injury { color: var(--critical); }
.log-line.k-fail { color: var(--critical); opacity: .85; }
.log-line.k-down { color: var(--text-secondary); font-style: italic; }
.ev.tool.info { opacity: .7; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; margin: 6px 0; overflow-wrap: anywhere; }
.bubble .who { font-size: .72rem; font-weight: 700; display: block; margin-bottom: 2px; }
.bubble.home { background: var(--home-soft); border-bottom-left-radius: 4px; }
.bubble.home .who { color: var(--home); }
.bubble.away { background: var(--away-soft); margin-left: auto; border-bottom-right-radius: 4px; }
.bubble.away .who { color: var(--away); }

.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 12px; font-size: .85rem; color: var(--text-secondary); }
.filters select { font: inherit; margin-left: 4px; height: 30px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); max-width: 220px; }

/* replay player */
.player { margin-top: 10px; padding: 10px 12px; }
.player-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pbtn { font: inherit; font-size: .9rem; min-width: 36px; height: 32px; border: 1px solid var(--border);
        background: var(--surface-1); color: var(--text-primary); cursor: pointer; }
.pbtn:hover { background: var(--surface-2); }
.pbtn.play { background: var(--ink); color: var(--ink-text); border-color: var(--ink); min-width: 44px; }
.player-row select { font: inherit; font-size: .85rem; height: 32px; border: 1px solid var(--border);
                     background: var(--surface-1); color: var(--text-primary); padding: 0 6px; }
.player-pos { font-size: .85rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-left: 4px; }
.player-opt { font-size: .82rem; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.player-row .player-opt { margin-left: auto; }
.feed-tabs .player-opt { margin-left: auto; }
.scrub { position: relative; padding-top: 14px; margin-top: 6px; }
.scrub input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); }
.scrub-marks { position: absolute; left: 8px; right: 8px; top: 0; height: 26px; pointer-events: none; }
.scrub-marks .tick { position: absolute; top: 16px; width: 1px; height: 7px; background: var(--text-muted); opacity: .5; }
.scrub-marks .td { position: absolute; top: -2px; transform: translateX(-50%); pointer-events: auto; border: 0; background: none;
                   cursor: pointer; font-size: 12px; line-height: 1; padding: 0 2px; }
.scrub-marks .td.home { color: var(--home); } .scrub-marks .td.away { color: var(--away); }
.player-final { font-size: .8rem; margin-top: 4px; }

/* stat comparison */
.compare td:first-child { text-align: right; font-variant-numeric: tabular-nums; width: 30%; }
.compare td:last-child { font-variant-numeric: tabular-nums; width: 30%; }
.compare td:nth-child(2) { text-align: center; color: var(--text-muted); font-size: .82rem; white-space: normal; }
.compare td.lead { font-weight: 800; }

/* inline bars (single-hue magnitude) */
.cellbar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cellbar .track { width: 70px; height: 6px; background: var(--surface-2); overflow: hidden; flex: none; }
.cellbar .fill { height: 100%; background: var(--bar); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.tile { border-left: 1px solid var(--ink); padding: 4px 12px; }
.tile .label { font-family: var(--mono); font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .value { font-family: var(--mono); font-size: 1.4rem; font-weight: 500; font-variant-numeric: tabular-nums; }

/* chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-muted); font-size: 11px; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.dim { opacity: .15; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--text-secondary); margin-top: 8px; }
.legend button { all: unset; cursor: pointer; display: inline-flex; align-items: center; }
.legend button.off { opacity: .4; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: .8rem; box-shadow: 0 4px 16px rgba(0,0,0,.15); min-width: 150px; display: none; z-index: 5; }
.tooltip .row { display: flex; justify-content: space-between; gap: 12px; }

.prose { max-width: 760px; }
.prose code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; font-size: .88em; }
.prose pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; }
footer { max-width: 1280px; margin: 0 auto; padding: 16px; color: var(--text-muted); font-size: .82rem; }
@media (max-width: 640px) {
  .topbar-inner { gap: 10px; }
  .status-pill .txt { display: none; }
  .scoreboard .big { font-size: 1.6rem; }
  .scoreboard .team .name { font-size: .95rem; }
  .scoreboard .team .muted { font-size: .75rem; }
  .compare td, .compare th { padding: 6px 4px; }
  .match-row { grid-template-columns: 1fr auto 1fr; }
  .match-row .tag { display: none; }
}

/* ---- stadium: native board (header + pitch + dugouts + ticker, one card) ---- */
.stadium { padding: 0; overflow: hidden; position: relative; border: 1px solid var(--ink); }
.stadium-card { border-top: 0; padding-top: 0; }
.st-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 16px; }
.st-team { min-width: 0; max-width: 100%; padding: 4px 10px; border-radius: 8px; transition: background .2s; }
.st-team.away { text-align: right; border-right: 4px solid var(--away); justify-self: end; }
.st-team.home { border-left: 4px solid var(--home); justify-self: start; }
.st-team.acting.away { background: var(--away-soft); }
.st-team.acting.home { background: var(--home-soft); }
.st-name { font-weight: 600; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-name a { text-decoration: none; }
.st-name a:hover { text-decoration: underline; }
.st-sub { display: flex; gap: 8px; align-items: center; font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.st-team.away .st-sub { justify-content: flex-end; }
.st-turn-tag { font-weight: 700; color: var(--text-secondary); }
.st-rerolls { display: inline-flex; gap: 3px; }
.st-rerolls i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-block; opacity: .5; }
.st-rerolls i.on { opacity: 1; }
.st-team.away .st-rerolls i.on { background: var(--away); border-color: var(--away); }
.st-team.home .st-rerolls i.on { background: var(--home); border-color: var(--home); }
.st-centre { text-align: center; }
.st-score { font-family: var(--mono); font-size: 2.2rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; display: flex; gap: 8px; justify-content: center; }
.st-score .dash { color: var(--text-muted); font-weight: 400; }
.st-phase { font-size: .78rem; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; justify-content: center; white-space: nowrap; }
.st-phase img { width: 16px; height: 16px; }
.st-centre .badge { margin-bottom: 4px; }

.st-pitch-wrap { padding: 0 12px; }
/* never taller than ~56% of the viewport: wide screens get a centred pitch instead of a scroll */
.st-pitch { position: relative; width: min(100%, calc(56vh * var(--ar, 1.78))); margin: 0 auto; background-size: 100% 100%;
            container-type: inline-size;
            box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.st-layer { position: absolute; inset: 0; }
.st-player, .st-step, .st-ballsq { position: absolute; display: grid; place-items: center; }
.st-player img { width: 92%; height: 92%; image-rendering: pixelated; transition: transform .15s; }
.st-player.down img { transform: rotate(90deg); filter: brightness(.8); }
.st-player.used img { filter: saturate(.45) brightness(.9); }
.st-player.down.used img { filter: saturate(.45) brightness(.75); }
.st-player.active { border-radius: 50%; }
.st-player.active.home { box-shadow: 0 0 0 2px var(--home), 0 0 10px 2px var(--home); }
.st-player.active.away { box-shadow: 0 0 0 2px var(--away), 0 0 10px 2px var(--away); }
.st-nr { position: absolute; right: -2%; top: -4%; font-size: clamp(7px, 1.25cqw, 11px); font-weight: 700; line-height: 1;
         color: #fff; padding: 1px 3px; border-radius: 4px; pointer-events: none; }
.st-player.home .st-nr { background: var(--home); }
.st-player.away .st-nr { background: var(--away); }
.st-status { position: absolute; left: 0; top: -4%; font-size: clamp(8px, 1.4cqw, 12px); font-weight: 800; color: #fff;
             text-shadow: 0 0 3px #000; pointer-events: none; }
.st-ball { width: 38%; height: 30%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c8864a, #6b3a14);
           border: 1px solid #2b1606; box-shadow: 0 1px 2px rgba(0,0,0,.6); display: block; }
.st-ball.carried { position: absolute; right: 2%; bottom: 4%; width: 34%; height: 26%; }
.st-ball.air { box-shadow: 0 6px 6px rgba(0,0,0,.35); transform: translateY(-20%); }
.st-step { pointer-events: none; }
.st-step::after { content: ""; width: 22%; height: 22%; border-radius: 50%; opacity: .85; }
.st-step.home::after { background: var(--home); }
.st-step.away::after { background: var(--away); }

.st-player, .st-dg img { cursor: pointer; }
.st-player:hover img { transform: scale(1.12); }
.st-player.down:hover img { transform: rotate(90deg) scale(1.12); }
.st-now { display: flex; align-items: center; gap: 6px; margin: 8px 16px 0; padding: 4px 10px; border-radius: 8px;
  font-size: .8rem; color: var(--text-secondary); cursor: pointer; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-now.home { background: var(--home-soft); border-left: 4px solid var(--home); }
.st-now.away { background: var(--away-soft); border-left: 4px solid var(--away); }
.st-now img { width: 20px; height: 20px; image-rendering: pixelated; flex: none; }
.st-now b { color: var(--text-primary); }
.st-now-label { text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; font-weight: 700; color: var(--text-muted); }
.st-card { position: absolute; z-index: 5; width: 230px; max-width: calc(100% - 8px); pointer-events: auto; }
.st-card-in { background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); padding: 10px 12px; font-size: .8rem; }
.st-card-in.home { border-top: 4px solid var(--home); }
.st-card-in.away { border-top: 4px solid var(--away); }
.st-card-top { display: flex; gap: 8px; align-items: center; }
.st-card-top img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.st-card-id { min-width: 0; }
.st-card-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-card-role { color: var(--text-muted); font-size: .75rem; }
.st-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; text-align: center; }
.st-stat { background: var(--surface-2); border-radius: 6px; padding: 4px 0; line-height: 1.1; }
.st-stat b { display: block; font-family: var(--mono); font-weight: 500; font-size: 1rem; font-variant-numeric: tabular-nums; }
.st-stat span { font-size: .65rem; color: var(--text-muted); letter-spacing: .04em; }
.st-stat small { display: block; font-size: .62rem; color: var(--text-secondary); }
.st-card-doing { margin-top: 8px; font-weight: 600; }
.st-skills { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.st-skill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; font-size: .7rem; color: var(--text-secondary); }
.st-card-inj { margin-top: 6px; font-size: .72rem; color: var(--critical); }
.st-card-hint { margin-top: 6px; font-size: .68rem; color: var(--text-muted); }
.st-dugouts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 16px 0; }
.st-dugout { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-height: 26px; font-size: .75rem; color: var(--text-muted); }
.st-dugout.away { justify-content: flex-end; }
.st-dg { display: inline-flex; align-items: center; gap: 2px; }
.st-dg img { width: 22px; height: 22px; image-rendering: pixelated; }
.st-dg-label { margin-right: 3px; text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; }
/* fixed height so the board doesn't jump as lines change; lines wrap, the oldest get clipped */
.st-ticker { list-style: none; margin: 0 0 8px; padding: 6px 16px 0; font-family: var(--mono); font-size: .74rem; line-height: 1.35;
  color: var(--text-muted); height: calc(4 * 1.35em + 6px); overflow: hidden; }
.st-ticker li { overflow-wrap: anywhere; }
.st-ticker.clickable { cursor: pointer; }
.st-ticker.clickable:hover li.latest { text-decoration: underline; }
.st-ticker li.latest { color: var(--text-primary); font-weight: 600; }
.stadium .player { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.stadium-empty { padding: 48px 16px; text-align: center; color: var(--text-muted); }
@media (max-width: 640px) {
  .st-head { gap: 6px; padding: 10px 8px; }
  .st-name { font-size: .9rem; }
  .st-turn-tag, .st-tag { display: none; }
  .st-team { padding: 4px 6px; }
  .st-score { font-size: 1.5rem; }
  .st-pitch-wrap { padding: 0 6px; }
  .st-dugouts { padding: 6px 8px 0; }
  .st-dg img { width: 16px; height: 16px; }
  .st-ticker { padding: 6px 8px 10px; }
  .st-now { margin: 6px 8px 0; }
}
.match-bar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: .9rem; }
.match-links { display: flex; gap: 14px; font-size: .85rem; }
.now-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; }
.now-bar .btn { margin-left: auto; text-decoration: none; }
