/* Dirt Legacy: 2D supercross. Fonts are self-hosted (OFL, see assets/fonts). */
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 800; font-display: swap; src: url('assets/fonts/big-shoulders-display-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 900; font-display: swap; src: url('assets/fonts/big-shoulders-display-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Saira Condensed'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/saira-condensed-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Saira Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/saira-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Saira Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/saira-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Saira Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/saira-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Saira Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url('assets/fonts/saira-condensed-latin-800-normal.woff2') format('woff2'); }

/* Layout: full-bleed canvas world; pit-board panels float over it with a safe-area gutter. */
:root {
  --ink: #0b0e13;          /* stadium black */
  --board: #141921;        /* pit board slate */
  --board-2: #1c232d;
  --line: #2b3440;
  --chalk: #f2efe6;        /* chalk-white numerals */
  --muted: #98a2ae;
  --flag: #f5c518;         /* caution-flag yellow, the one accent */
  --flag-ink: #1a1500;
  --dirt: #9a6438;
  --green: #3fc26b;
  --red: #e5484d;
  --f-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --f-ui: 'Saira Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html { box-sizing: border-box; height: 100%; background: var(--ink); }
*, *::before, *::after { box-sizing: inherit; }
body { height: 100%; margin: 0; background: var(--ink); color: var(--chalk); font-family: var(--f-ui); font-size: 16px; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app { position: relative; width: 100%; height: 100%; overflow: hidden; outline: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font-family: var(--f-ui); color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: linear-gradient(90deg, rgba(8,10,14,.92) 0%, rgba(8,10,14,.72) 55%, rgba(8,10,14,.35) 100%); overflow-y: auto; z-index: 20; }
.screen.center { background: rgba(8,10,14,.78); }
.panel { width: min(1040px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 18px; }
.board { background: var(--board); border: 1px solid var(--line); border-radius: 6px; padding: 18px; min-width: 0; }
.chex { height: 10px; border-radius: 2px; background: repeating-conic-gradient(var(--chalk) 0 25%, var(--ink) 0 50%) 0 0 / 10px 10px; opacity: .9; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .01em; line-height: .92; text-wrap: balance; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--flag); }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 4px; border: 1px solid var(--line); background: var(--board-2); font-size: 18px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--muted); background: #242c38; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--flag); color: var(--flag-ink); border-color: var(--flag); }
.btn.primary:hover { background: #ffd43b; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--flag); white-space: nowrap; }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, var(--flag) 45%, #b38a00); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); flex: none; }

/* title */
#scrTitle .panel { max-width: 560px; margin-right: auto; margin-left: max(0px, calc((100vw - 1040px)/2)); }
.logo { font-size: clamp(56px, 11vw, 116px); font-weight: 900; color: var(--chalk); }
.logo em { font-style: normal; color: var(--flag); }
.home-link { align-self: flex-start; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; text-decoration: none; }
.home-link:hover { color: var(--chalk); }
.logo span { display: block; font-size: .3em; letter-spacing: .2em; color: var(--muted); margin-top: 8px; font-weight: 800; }
.lede { font-size: 19px; line-height: 1.4; max-width: 34ch; margin: 0; color: #d9d5ca; }
.menu { display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.menu .btn { justify-content: space-between; min-height: 56px; font-size: 22px; }
.menu .btn small { font-size: 14px; font-weight: 600; letter-spacing: .04em; opacity: .75; text-transform: none; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 15px; color: var(--muted); max-width: 360px; }
.keys b { color: var(--chalk); font-weight: 700; white-space: nowrap; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 4px; background: var(--board-2); color: var(--chalk); font: 700 14px var(--f-ui); text-align: center; }

/* garage */
.garage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.preview { position: relative; display: flex; flex-direction: column; gap: 10px; }
#previewCanvas { width: 100%; aspect-ratio: 16 / 10; border-radius: 4px; background: #0b0d12; display: block; max-width: 100%; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px; font-size: 17px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tab[aria-selected="true"] { color: var(--chalk); border-bottom-color: var(--flag); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bcard { text-align: left; background: var(--board-2); border: 2px solid transparent; border-radius: 5px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bcard[aria-pressed="true"] { border-color: var(--flag); }
.bcard .name { font-family: var(--f-display); font-size: 26px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.swatch { display: flex; height: 8px; border-radius: 2px; overflow: hidden; }
.swatch i { flex: 1; }
.stat { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; white-space: nowrap; }
.pips { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.pips i { height: 7px; background: #2c3440; border-radius: 1px; }
.pips i.on { background: var(--chalk); }
.pips i.up { background: var(--flag); }
.uprow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.uprow h3 { font-size: 24px; }
.uprow p { margin: 4px 0 6px; color: var(--muted); font-size: 15px; }
.lvl { display: flex; gap: 4px; }
.lvl i { width: 26px; height: 8px; background: #2c3440; border-radius: 1px; }
.lvl i.on { background: var(--flag); }
.grid-gear { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gear { background: var(--board-2); border: 2px solid transparent; border-radius: 5px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; min-width: 0; }
.gear canvas { width: 64px; height: 48px; }
.gear[aria-pressed="true"] { border-color: var(--flag); }
.gear .price { display: inline-flex; align-items: center; gap: 4px; color: var(--flag); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.gear.locked { opacity: .82; }
.numpick { display: flex; align-items: center; gap: 10px; }
.numpick output { font-family: var(--f-display); font-weight: 900; font-size: 40px; min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }

/* career + results tables */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px solid #222a35; font-size: 16px; white-space: nowrap; }
td.num { text-align: right; }
tr.you td { color: var(--flag); font-weight: 800; }
tr.next td { background: rgba(245,197,24,.08); }
.tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: #273041; color: #c9d2de; margin-left: 4px; }
.tag.mud { background: #3a2a1a; color: #e2b48a; }
.tag.out { background: #1f3423; color: #9fe0b0; }
.pos-big { font-family: var(--f-display); font-weight: 900; font-size: 96px; line-height: .85; color: var(--flag); }
.platebig { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 44px; border-radius: 6px 6px 14px 14px; background: var(--chalk); color: var(--ink); font-family: var(--f-display); font-weight: 900; font-size: 30px; }
.scroll-x { overflow-x: auto; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.hud-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.pit { background: var(--board); border: 2px solid #39424f; border-radius: 4px; padding: 6px 12px 8px; min-width: 104px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.pit-pos { font-family: var(--f-display); font-weight: 900; font-size: 54px; line-height: .9; font-variant-numeric: tabular-nums; }
.pit-pos small { font-size: 22px; color: var(--muted); margin-left: 2px; }
.pit-sub { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.prog { position: relative; height: 34px; margin-top: 8px; }
.prog-line { position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.4); box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.prog-flag { position: absolute; right: -2px; top: 6px; width: 16px; height: 22px; background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 8px 8px; border-radius: 2px; }
.dot { position: absolute; top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid rgba(0,0,0,.6); }
.dot.you { top: 4px; width: 26px; height: 26px; margin-left: -13px; border: 3px solid var(--flag); display: flex; align-items: center; justify-content: center; font: 900 12px var(--f-ui); color: var(--ink); background: var(--chalk) !important; z-index: 2; }
.hud-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.time { font-family: var(--f-display); font-weight: 800; font-size: 32px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.hud-btn { pointer-events: auto; width: 44px; height: 44px; border-radius: 4px; border: 1px solid #39424f; background: rgba(20,25,33,.85); font-size: 18px; font-weight: 800; }
#toast { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; pointer-events: none; z-index: 11; }
.toast-line { font-family: var(--f-display); font-weight: 900; font-size: clamp(30px, 6vw, 58px); color: var(--chalk); text-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 24px rgba(0,0,0,.4); animation: pop 1.6s ease-out forwards; white-space: nowrap; }
.toast-line small { display: block; font: 800 18px var(--f-ui); color: var(--flag); letter-spacing: .1em; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 12% { transform: scale(1.08); opacity: 1; } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
#count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 11; font-family: var(--f-display); font-weight: 900; font-size: clamp(90px, 20vw, 200px); color: var(--chalk); text-shadow: 0 6px 0 rgba(0,0,0,.4); }
#count.go { color: var(--flag); }
#hint { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); background: var(--board); border: 1px solid var(--line); border-radius: 4px; padding: 10px 16px; font-size: 18px; font-weight: 700; letter-spacing: .04em; z-index: 11; pointer-events: auto; cursor: pointer; white-space: nowrap; }

/* touch controls */
#touch { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); z-index: 12; pointer-events: none; }
#touch .grp { display: flex; gap: 12px; pointer-events: auto; }
.tbtn { width: 76px; height: 76px; border-radius: 50%; border: 2px solid rgba(255,255,255,.28); background: rgba(16,20,27,.55); color: var(--chalk); display: flex; align-items: center; justify-content: center; touch-action: none; -webkit-user-select: none; user-select: none; }
.tbtn.on { background: rgba(245,197,24,.85); color: var(--ink); border-color: var(--flag); }
.tbtn svg { width: 34px; height: 34px; }
.tbtn.gas { width: 92px; height: 92px; }

@media (max-width: 760px) {
  .garage, .cols { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .pit-pos { font-size: 40px; }
  .time { font-size: 24px; }
  .hud-top { gap: 10px; }
  .tbtn { width: 64px; height: 64px; }
  .tbtn.gas { width: 78px; height: 78px; }
  .screen { align-items: flex-start; }
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: var(--board-2); padding: 8px 16px; min-height: 40px; font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--flag); color: var(--flag-ink); }
.rotate-tip { display: none; }
@media (orientation: portrait) and (pointer: coarse) { .rotate-tip { display: block; } .keys { display: none; } }
@media (pointer: coarse) { .keys { display: none; } }
@media (prefers-reduced-motion: reduce) { .toast-line { animation-duration: .01s; animation-fill-mode: forwards; } .btn { transition: none; } }

/* money + championship */
.jackpot-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 10px 12px; border: 1px solid rgba(245,197,24,.35); border-radius: 4px; background: rgba(245,197,24,.06); }
.jackpot-line b { font-family: var(--f-display); font-weight: 900; font-size: clamp(18px, 2.6vw, 28px); color: var(--flag); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.champ { background: radial-gradient(ellipse at 50% 28%, rgba(60,44,6,.6), rgba(5,6,10,.9) 72%); align-items: center; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.champ-panel { position: relative; width: min(1000px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.champ-title { font-size: clamp(64px, 12vw, 148px); color: var(--flag); text-shadow: 0 6px 0 rgba(0,0,0,.45), 0 0 48px rgba(245,197,24,.35); }
#trophy { width: 150px; height: 170px; max-width: 40vw; }
.champ-label { margin: 6px 0 0; font-size: 14px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.jackpot { font-family: var(--f-display); font-weight: 900; font-size: clamp(26px, 4.8vw, 60px); line-height: 1.04; color: var(--chalk); font-variant-numeric: tabular-nums; max-width: 100%; min-width: 0; overflow-wrap: anywhere; text-shadow: 0 0 28px rgba(245,197,24,.45); }
.champ-bank { margin: 0; max-width: 60ch; overflow-wrap: anywhere; }
.champ-bank span { color: var(--flag); font-weight: 800; }

/* build your own bike */
.tabs { overflow-x: auto; scrollbar-width: none; }
.build { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.buildrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.txt { flex: 1 1 160px; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--board-2); color: var(--chalk); font: 700 20px var(--f-ui); letter-spacing: .02em; }
.txt:focus-visible { outline: 3px solid var(--flag); outline-offset: 1px; }
.slabel { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.part { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; }
.pdot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); flex: none; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); background: var(--c); padding: 0; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.sw[aria-pressed="true"] { border-color: var(--chalk); box-shadow: 0 0 0 2px var(--flag), inset 0 -3px 0 rgba(0,0,0,.25); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--board-2); font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--flag); border-color: var(--flag); color: var(--flag-ink); }
.statrow { display: grid; grid-template-columns: 96px auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.statrow .step { min-height: 32px; padding: 0 12px; font-size: 18px; }
.pts { font-weight: 800; font-size: 14px; letter-spacing: .04em; color: var(--muted); }
.pts.left { color: var(--flag); }
.build-note { margin: 0; font-size: 14px; }
.build-tag { background: rgba(245,197,24,.15); color: var(--flag); vertical-align: middle; font-family: var(--f-ui); }
.bcard.mine { border-style: dashed; border-color: rgba(245,197,24,.45); }
.bcard.mine[aria-pressed="true"] { border-style: solid; border-color: var(--flag); }
.build-cta { margin-top: 10px; width: 100%; }
#scrGarage { align-items: flex-start; }
#scrGarage .panel { max-height: none; margin-block: auto; }

/* ---------- sponsors ---------- */
#scrSpons { align-items: flex-start; }
#scrSpons .panel { max-height: none; margin-block: auto; }
.stars { color: var(--flag); letter-spacing: .06em; }
.fame-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid rgba(245,197,24,.35); border-radius: 999px; background: rgba(245,197,24,.07); font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.fame-chip:empty { display: none; }
.spons-top { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: center; }
#sPreview { width: 100%; aspect-ratio: 16 / 10; border-radius: 4px; background: #0b0d12; display: block; }
.fame-box { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fame-box p { margin: 0; font-size: 16px; line-height: 1.35; }
.fame-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.fame-top .stars { font-size: 26px; }
.fame-top b { font-family: var(--f-display); font-size: 40px; font-weight: 900; text-transform: uppercase; line-height: 1; }
.fbar { height: 12px; border-radius: 6px; background: #2c3440; overflow: hidden; }
.fbar i { display: block; height: 100%; background: linear-gradient(90deg, #d9a400, var(--flag)); border-radius: 6px; }
.smsg { margin: 0; padding: 10px 12px; border-radius: 4px; background: rgba(63,194,107,.12); border: 1px solid rgba(63,194,107,.4); color: #b8f0c8; font-weight: 700; }
.smsg:empty { display: none; }
.shead { font-size: 26px; margin: 4px 0 10px; }
.snote { margin: 10px 0 14px; font-size: 14px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.scard { background: var(--board-2); border: 2px solid transparent; border-radius: 5px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.scard.main { border-color: var(--flag); }
.scard.empty { border: 2px dashed var(--line); background: none; justify-content: center; min-height: 120px; font-size: 15px; }
.scard.empty b { font-size: 18px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.scard.locked .sban, .scard.locked .srow { opacity: .55; }
.sban { width: 100%; aspect-ratio: 360 / 64; border-radius: 3px; display: block; }
.srow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.srow .tag { margin-left: 0; }
.tag.main { background: var(--flag); color: var(--flag-ink); }
.sname { font-family: var(--f-display); font-size: 24px; font-weight: 800; text-transform: uppercase; line-height: 1; margin-right: 4px; }
.sterms { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.sterms b { color: var(--flag); font-variant-numeric: tabular-nums; }
.scard .row { gap: 6px; margin-top: auto; }
.sbadge { display: inline-block; padding: 2px 7px; border-radius: 3px; background: var(--bg); color: var(--fg); font: 900 14px var(--f-display); letter-spacing: .06em; text-transform: uppercase; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); white-space: nowrap; }
.sbadges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.spons-strip, .sfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.spons-strip:empty { display: none; }
.soffer { color: var(--flag); font-weight: 700; font-size: 15px; }
.rspons { display: flex; flex-direction: column; gap: 8px; }
.rspons:empty { display: none; }
.slines { display: flex; flex-direction: column; gap: 4px; }
.sline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 15px; }
.sline b { color: var(--flag); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .spons-top { grid-template-columns: minmax(0, 1fr); } }
#scrResults { align-items: flex-start; }
#scrResults .panel { max-height: none; margin-block: auto; }
#scrCareer { align-items: flex-start; }
#scrCareer .panel { max-height: none; margin-block: auto; }
.flipcount { font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--chalk); text-shadow: 0 2px 6px rgba(0,0,0,.7); font-variant-numeric: tabular-nums; }
.flipcount b { color: var(--flag); font-size: 20px; }

/* ---------- fan zone ---------- */
#scrFans { align-items: flex-start; }
#scrFans .panel { max-height: none; margin-block: auto; }
#fanCanvas { width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; background: #05070c; display: block; }
.fz-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.fz-hype { flex: 1 1 240px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.fz-hype .fbar { flex: 1; }
.hypebar i { background: linear-gradient(90deg, #e5484d, #ff7a1a, var(--flag)); transition: width .3s; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.gcard { background: var(--board-2); border-radius: 5px; padding: 10px; display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 4px 10px; align-items: center; min-width: 0; }
.gicon { width: 66px; height: 46px; }
.gtext { display: flex; flex-direction: column; gap: 1px; font-size: 14px; min-width: 0; }
.gtext b { font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.gtext .ghave { color: var(--flag); font-size: 16px; }
.gbtns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.gbtns .btn { flex: 1 1 auto; }
.fz-main { display: grid; gap: 14px; min-width: 0; }
.fz-stage { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fz-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fz-side .snote { margin: 0; }
/* short, wide screens (phones held sideways): stage and gear side by side so you can tap and watch */
@media (min-width: 700px) and (max-height: 640px) {
  .fz-main { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
  .fz-stage { position: sticky; top: 0; }
  .gear-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .gcard { grid-template-columns: 48px minmax(0, 1fr); padding: 6px 8px; gap: 2px 8px; }
  .gicon { width: 48px; height: 34px; }
  .gtext .muted { display: none; }
  .gtext b { font-size: 16px; }
  .gbtns .btn { min-height: 34px; font-size: 14px; padding: 0 10px; }
  #scrFans h2 { font-size: 30px !important; }
  #scrFans .panel { gap: 10px; }
}
/* narrow portrait phones: keep the stage in view while scrolling the gear */
@media (max-width: 699px) {
  .fz-stage { position: sticky; top: -16px; z-index: 3; background: var(--board); padding: 6px 0 8px; }
}
.build-speed { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.build-speed b { font-family: var(--f-display); font-size: 34px; font-weight: 900; color: var(--flag); line-height: 1; font-variant-numeric: tabular-nums; }
.build-speed .muted { font-size: 14px; }
.kmh { font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--flag); font-variant-numeric: tabular-nums; }
