/* Fonts: Barlow Condensed (labels, names, numbers) and Barlow (text), self-hosted woff2 in /fonts (SIL OFL, see fonts/OFL.txt), latin and latin-ext (Polish letters). */
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 700; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-ext-700-italic.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-ext-800-italic.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/barlow-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/barlow-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/barlow-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 700; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-700-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-800-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/barlow-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/* Speedway chrome, "direction D": broadcast graphics. Dark only, one shale-orange accent
   (buttons, focus, selection), Barlow Condensed for everything that is a label, name or number,
   Barlow for running text. Helmet and club colours only ever mark riders and teams.
   Text pairs (checked, all >= 4.5:1): ink and muted on ground / surface / raised, accent on ground /
   surface, on-accent on accent, danger on ground / surface. */
:root {
  color-scheme: dark;
  --ground: #0E0F12;
  --surface: #17191F;
  --raised: #20232B;
  --line: #2C303A;
  --ink: #F4F4F0;
  --muted: #A2A8B4;
  --accent: #FF7A2E;
  --accent-hi: #FF9254;
  --on-accent: #0E0F12;
  --danger: #FF6B6B;
  --ok: #3DD68C;
  --hover: rgba(244, 244, 240, 0.08);
  --helmet-red: #e0242f;
  --helmet-blue: #1f5fd6;
  --helmet-white: #f4f4f0;
  --helmet-yellow: #f2c318;
  --shadow: rgba(0, 0, 0, 0.55);
  --scrim: rgba(14, 15, 18, 0.55);
  --hud: rgba(12, 14, 18, 0.62);
  --hud-ink: #f4f4f4;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --slant: 14px;
  --inset-t: max(10px, env(safe-area-inset-top));
  --inset-b: max(10px, env(safe-area-inset-bottom));
  --inset-l: max(10px, env(safe-area-inset-left));
  --inset-r: max(10px, env(safe-area-inset-right));
}

* { box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
html {
  background: var(--ground); color: var(--ink); height: 100%;
  font: 16px/1.35 Barlow, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none; -webkit-text-size-adjust: 100%;
}
body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; position: fixed; inset: 0; background: var(--ground); }
@media (hover: none) { body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } input { -webkit-user-select: text; user-select: text; } }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.edge { display: none; position: fixed; left: 0; right: 0; height: 12px; z-index: 50; pointer-events: none; background: var(--ground); }
.ios .edge { display: block; }
#edgeTop { top: 0; -webkit-mask-image: linear-gradient(#000, transparent 10px); mask-image: linear-gradient(#000, transparent 10px); }
#edgeBot { bottom: 0; -webkit-mask-image: linear-gradient(transparent 4px, #000); mask-image: linear-gradient(transparent 4px, #000); }

/* ---- HUD (direction D, phase C) ----
   Broadcast graphics over the track: Barlow Condensed italic caps, square surfaces on a near-black ground, the accent only on
   your own marker (your place, your row in the tower) and on the one button. Where the thumbs are (input.js: `one` lands a thumb
   anywhere, `two` splits the screen into a lean half and a gas half, so the bottom corners and the middle of the lower half are
   covered while riding) nothing is drawn: the corners at the top hold the bug and the pause button, the left column the running
   order, the right column the speed and the bars (or, with no bike of yours, the skip bar), and the chips sit above your bike.
   Every box has a fixed size, so no number moving changes a layout. */
#hud {
  position: fixed; inset: 0; z-index: 5; pointer-events: none; color: var(--ink);
  font: italic 800 17px/1 var(--display); text-transform: uppercase; font-variant-numeric: tabular-nums;
  --hud: rgba(14, 15, 18, 0.82);
  --col-t: calc(var(--inset-t) + 52px); /* under the pause button */
  --tower-t: calc(var(--inset-t) + 62px); /* under the bug */
}
#hudTop { position: absolute; top: var(--inset-t); left: var(--inset-l); right: var(--inset-r); display: flex; align-items: flex-start; gap: 8px; }
#hudSp { flex: 1; }
/* place over lap: your marker in the accent, the lap on the ground colour */
#bug { display: flex; flex-direction: column; min-width: 92px; width: max-content; max-width: 46vw; flex: none; }
#posBox { display: flex; align-items: center; justify-content: center; height: 36px; padding: 0 12px; background: var(--accent); color: var(--on-accent); font-size: 32px; }
#posBox b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lapBox { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 20px; padding: 0 10px; background: var(--hud); font-size: 15px; }
#lapBox .lbl { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }
#pauseBtn { flex: none; pointer-events: auto; width: 44px; height: 44px; border: 0; border-radius: 0; background: var(--hud); display: grid; place-items: center; cursor: pointer; padding: 0; }
#pauseBtn svg { width: 18px; height: 18px; fill: var(--ink); }
#pauseBtn:active { scale: 0.92; }
#netInfo { flex: none; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; background: var(--hud); font-size: 14px; }
#netInfo .dot { width: 7px; height: 7px; background: #34c759; }
#netInfo.slow .dot { background: #ffcc00; }
#netInfo.bad .dot { background: #ff3b30; }
/* the running order as a TV tower: helmet bar, place, SURNAME, the gap to the leader (an out rider: the reason) */
#order { position: absolute; top: var(--tower-t); left: var(--inset-l); margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
#order li { display: flex; align-items: center; box-sizing: border-box; width: 178px; max-width: 48vw; height: 28px; padding: 0 8px 0 0; background: var(--hud); font-size: 17px; }
#order li::before { content: attr(data-pos); width: 22px; flex: none; text-align: center; }
#order li .hd { order: -1; width: 5px; height: auto; align-self: stretch; flex: none; border-radius: 0; box-shadow: none; }
#order li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#order li .gp { flex: none; min-width: 42px; text-align: right; font-size: 15px; color: var(--muted); white-space: nowrap; }
#order li.me { background: var(--accent); color: var(--on-accent); }
#order li.me .gp { color: inherit; }
#order li.out { opacity: 0.6; }
#order li.out .nm { text-decoration: line-through; }
#order li.out .gp { font-size: 13px; }

#stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); display: none; }
#stick.on { display: block; }
#stickKnob { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
#pedal { position: absolute; width: 52px; height: 132px; margin: -26px 0 0 -26px; border-radius: 26px; border: 2px solid rgba(255, 255, 255, 0.35); display: none; }
#pedal.on { display: block; }
#pedal i { position: absolute; left: 50%; top: 4px; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }

/* the rider's dashboard (hidden with your bike: out, home, watching): the speed, the throttle and the lean in the right column, the chips above the bike */
#gauge { display: contents; }
#dash { position: absolute; top: var(--col-t); right: var(--inset-r); width: 120px; box-sizing: border-box; display: flex; flex-direction: column; gap: 5px; padding: 4px 8px 8px; background: var(--hud); }
#spd { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 40px; }
#spd b { order: 1; flex: none; min-width: 54px; text-align: right; font-size: 40px; font-weight: 800; }
#spd small { order: 2; flex: none; width: 28px; font-size: 14px; color: var(--muted); text-transform: none; }
/* the dirt under the rear wheel: tacky / slick / deep (empty off the shale) */
#grip { order: 0; flex: none; width: 9px; height: 9px; background: transparent; box-shadow: inset 0 0 0 1px transparent; }
#grip.tacky { background: #7bd35a; }
#grip.slick { background: #9aa3a8; }
#grip.deep { background: #b07a45; }
#thr, #leanBar { height: 6px; background: rgba(244, 244, 240, 0.16); overflow: hidden; position: relative; }
#thr i { position: absolute; inset: 0; width: 0; background: var(--ink); }
#leanBar i { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; background: var(--ink); }
#leanBar.slide { background: rgba(232, 163, 23, 0.55); }
#leanBar.hard { background: rgba(229, 55, 43, 0.7); }
/* fixed slots (nothing moves when one lights), shown only while they matter: a column right under the speed, beside the
   track rather than over it (the bend first, then the white line, the fence, the assist) */
#chips { position: absolute; top: calc(var(--col-t) + 80px); right: var(--inset-r); width: 120px; display: grid; grid-template-columns: 1fr; gap: 4px; }
#chipBend { grid-row: 1; } #chipLine { grid-row: 2; } #chipFence { grid-row: 3; } #chipAssist { grid-row: 4; }
.hchip { box-sizing: border-box; width: 100%; height: 24px; display: flex; align-items: center; justify-content: center; font: italic 800 13px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; background: var(--hud); opacity: 0; white-space: nowrap; }
.hchip.amber { background: #e8a317; color: #1d1400; opacity: 1; }
.hchip.red { background: #e5372b; color: #fff; opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .hchip { transition: opacity 0.14s, background-color 0.14s; } }
/* after your exclusion or your finish the right column is the skip bar (the gauge is gone then) */
#outBar { position: absolute; top: var(--col-t); right: var(--inset-r); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 54vw; }
#outTxt { display: flex; align-items: center; min-height: 36px; padding: 0 12px; background: var(--hud); border-left: 4px solid var(--danger); font-size: 18px; line-height: 1.05; }
#skipBtn { pointer-events: auto; min-height: 44px; padding: 0 18px; border: 0; border-radius: 0; background: var(--accent); color: var(--on-accent); font: italic 800 18px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; }
#skipBtn:active { scale: 0.96; }
@media (prefers-reduced-motion: no-preference) { #outBar:not([hidden]) { animation: outbar-in 150ms ease-out; } }
@keyframes outbar-in { from { opacity: 0; } to { opacity: 1; } }
#ctrlHint { position: absolute; left: 0; right: 0; bottom: calc(var(--inset-b) + 40px); margin: 0 auto; width: max-content; max-width: 90vw; text-align: center; background: var(--hud); padding: 8px 14px; font: 500 15px/1.3 Barlow, system-ui, sans-serif; font-style: normal; text-transform: none; }

#toast {
  position: fixed; left: 50%; top: 38%; translate: -50% -50%; z-index: 15; pointer-events: none;
  padding: 10px 20px; border-radius: 16px; background: var(--hud); color: var(--hud-ink);
  font-weight: 750; font-size: 20px; text-align: center;
  width: max-content; max-width: min(calc(100vw - var(--inset-l) - var(--inset-r)), 340px);
}


/* The toast and the call banner ride over everything: broadcast captions */
#toast {
  position: fixed; left: 50%; top: 38%; translate: -50% -50%; z-index: 15; pointer-events: none;
  padding: 10px 20px; border-radius: 4px; background: var(--ground); color: var(--ink); border: 1px solid var(--line);
  font: italic 800 24px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; text-align: center;
  width: max-content; max-width: min(calc(100vw - var(--inset-l) - var(--inset-r)), 340px);
}

/* no visible scrollbars anywhere: the content scrolls by touch / wheel */
.panel, .card, #sheet, .fill, .board, .meetlist, .prog, .gpt, .gpprog { scrollbar-width: none; }
.panel::-webkit-scrollbar, .card::-webkit-scrollbar, #sheet::-webkit-scrollbar, .fill::-webkit-scrollbar, .board::-webkit-scrollbar, .meetlist::-webkit-scrollbar, .prog::-webkit-scrollbar { display: none; }

/* ---- panels ---- */
.panel {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; grid-template-columns: minmax(0, 1fr);
  padding: var(--inset-t) var(--inset-r) calc(var(--inset-b) + var(--keyboard, 0px)) var(--inset-l);
  background: var(--scrim); overflow: auto;
}
.panel.out { opacity: 0; }
.panel.in { opacity: 1; }
.card {
  width: min(420px, 100%); padding: 20px 18px 14px; border-radius: 4px;
  background: rgba(14, 15, 18, 0.97); border: 1px solid var(--line); color: var(--ink);
  box-shadow: 0 24px 60px var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card.small { width: min(300px, 100%); text-align: center; }
.page { display: flex; flex-direction: column; gap: 12px; }

/* the header row of the menu: wordmark left, the account chip right (home only) */
.menuhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.logo { margin: 0; font: italic 800 34px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.logo .way { color: var(--accent); }
#menu[data-page]:not([data-page="pgHome"]) .logo { font-size: 26px; }
#menu[data-page]:not([data-page="pgHome"]) .acct { display: none; }
.menuhead + .page { margin-top: 0; }

h2, h3 { font-family: var(--display); }
h2 {
  margin: 0 0 4px; font-style: italic; font-weight: 800; font-size: 38px; line-height: 0.95; text-transform: uppercase;
  overflow-wrap: anywhere;
}
/* the slanted accent bar under a heading, as on the broadcast graphics */
h2::after { content: ""; display: block; width: 90px; height: 6px; margin-top: 8px; background: var(--accent); transform: skewX(-20deg); transform-origin: left; }
.card.small h2::after { margin-inline: auto; transform-origin: center; }
.mthead h2, #result h2, #pause h2 { font-size: 32px; }
h3 { font-style: italic; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- buttons ---- */
.big {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 10px 18px; border-radius: 4px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink);
  font: italic 800 22px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.03em; text-align: left;
  transition: background-color 0.2s, scale 0.12s;
}
.big:active { scale: 0.97; }
.big:disabled { opacity: 0.45; cursor: default; scale: 1; }
.big svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.big span { flex: 1; }
.big small { display: block; margin-top: 2px; font: 500 13px/1.25 Barlow, system-ui, sans-serif; text-transform: none; letter-spacing: 0; color: var(--muted); }
.big .txt { flex: 1; display: flex; flex-direction: column; }
.card.small .big { justify-content: center; text-align: center; }
.card.small .big span { flex: none; }
/* the main button: accent fill, slanted ends */
.big.primary {
  background: var(--accent); color: var(--on-accent); min-height: 56px; padding-inline: calc(var(--slant) + 10px);
  clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}
.big.primary small { color: var(--on-accent); opacity: 0.8; }
.big.slim { --slant: 10px; min-height: 48px; justify-content: center; width: auto; flex: none; padding: 8px 22px; font-size: 19px; }
.big.slim.primary { padding-inline: 26px; }
/* secondary: a 2 px accent outline */
.big.outline { background: transparent; border: 2px solid var(--accent); }
.big.outline svg { stroke: var(--accent); }
.big.outline .arr { stroke: var(--ink); width: 20px; height: 20px; }
@media (hover: hover) {
  .big:not(:disabled):not(.primary):not(.outline):hover { background: var(--raised); }
  .big.outline:not(:disabled):hover { background: var(--hover); }
  .big.primary:not(:disabled):hover { background: var(--accent-hi); }
}
.big.center { justify-content: center; text-align: center; text-decoration: none; }
.big.center span { flex: none; }
.setgrid { display: flex; flex-direction: column; gap: 8px; }

.link { background: none; border: 0; color: var(--muted); font: 700 16px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.link:hover { color: var(--ink); }
.back { align-self: center; }
.hint { margin: 0; color: var(--muted); font-size: 15px; text-align: center; }
.hint.small { font-size: 13px; }
.rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.rules b { font: italic 700 17px var(--display); text-transform: uppercase; letter-spacing: 0.03em; }

/* ---- the home page ---- */
.acct { display: flex; min-width: 0; font-size: 14px; color: var(--muted); }
.acct #whoami, .acct .link {
  display: block; height: 44px; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--surface); color: var(--ink); border-radius: 0;
  font: italic 800 17px/44px var(--display); text-transform: uppercase; letter-spacing: 0.02em;
}
.acct #whoami { padding: 0 12px 0 10px; border-left: 6px solid var(--helmet-blue); }
.acct .link { padding: 0 14px; text-decoration: none; }
@media (hover: hover) { .acct .link:hover { background: var(--raised); } }

.hero {
  display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px 18px;
  background: var(--surface); border-left: 8px solid var(--accent);
}
.hero .kick { font: italic 700 17px/1.1 var(--display); color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; }
.herobody { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.hero svg { flex: none; width: 62px; height: 40px; }
.hero svg .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.hero svg .tick { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.herometa { font: italic 700 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.herometa small { display: block; margin-top: 3px; font: 500 14px/1.2 Barlow, system-ui, sans-serif; color: var(--muted); text-transform: none; letter-spacing: 0; }
.heroscore { display: flex; align-items: center; gap: 8px; width: 100%; }
.heroscore .city { flex: 1 1 0; min-width: 0; font: italic 800 clamp(18px, 5.4vw, 26px)/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.heroscore .city.r { text-align: right; }
.heroscore .sc { display: flex; align-items: center; gap: 8px; flex: none; padding: 4px 10px; background: var(--ground); font: italic 800 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.heroscore .sc i { width: 4px; height: 24px; background: var(--accent); }
.herosub { margin: 0; text-align: center; font: italic 700 16px/1 var(--display); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left;
  padding: 12px 14px; border: 0; border-top: 5px solid var(--bar, var(--line)); border-radius: 0; background: var(--surface); color: var(--ink);
  cursor: pointer; transition: scale 0.12s, background-color 0.2s;
}
.tile svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile b { font: italic 800 clamp(20px, 6.6vw, 26px)/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.tile.red { --bar: var(--helmet-red); }
.tile.blue { --bar: var(--helmet-blue); }
.tile.white { --bar: var(--helmet-white); }
.tile.yellow { --bar: var(--helmet-yellow); }
.tile.orange { --bar: var(--accent); }
.tile.green { --bar: var(--ok); }
.tile.wide { grid-column: span 2; min-height: 84px; }
@media (hover: hover) { .tile:hover { background: var(--raised); } }

.foot { display: flex; justify-content: center; gap: 2px 16px; flex-wrap: wrap; }
.foot .link { font-size: 14px; padding: 8px 4px; }
.foot .link svg { width: 15px; height: 15px; }
@media (max-width: 360px) { .foot .link svg { display: none; } }

.reslist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
/* a rider row of the broadcast graphics: helmet bar, place, slanted rule, name, points block */
.reslist li {
  display: grid; grid-template-columns: 8px 30px minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
  padding: 0 0 0 0; min-height: 52px; background: var(--surface); font-variant-numeric: tabular-nums;
}
.reslist li .hd { order: -1; align-self: stretch; width: 8px; height: auto; border-radius: 0; box-shadow: none; }
.reslist li.me { box-shadow: inset 0 0 0 2px var(--ink); }
.reslist .pl { position: relative; font: italic 800 26px/1 var(--display); text-align: center; }
.reslist .pl::after { content: ""; position: absolute; right: -6px; top: 50%; width: 2px; height: 30px; margin-top: -15px; background: var(--accent); transform: skewX(-20deg); }
.reslist .nm { font: italic 800 22px/1.05 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 6px; }
.reslist .tm { color: var(--muted); font: italic 700 16px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.reslist .pt { align-self: stretch; display: flex; align-items: center; justify-content: center; min-width: 64px; padding: 0 8px; background: var(--accent); color: var(--on-accent); font: italic 800 22px/1 var(--display); text-align: center; }

/* ---- segmented control; main.js slides the thumb ---- */
.seg {
  position: relative; display: flex; padding: 3px; border-radius: 4px;
  background: var(--surface); touch-action: none; -webkit-touch-callout: none;
}
.seg .thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 2px; pointer-events: none; background: var(--accent); }
.seg button {
  flex: 1; border: 0; background: none; color: var(--muted); font: italic 700 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.03em;
  position: relative; padding: 11px 2px; border-radius: 2px; cursor: pointer; transition: color 0.25s; touch-action: none;
}
.seg button[aria-checked="true"] { color: var(--on-accent); }

/* ---- track chips: a row that scrolls sideways ---- */
.chips {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 6px; padding: 3px;
  border-radius: 4px; background: var(--surface); touch-action: pan-x;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  scroll-padding: 0 3px; min-width: 0; max-width: 100%;
}
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 84px; padding: 7px 8px 6px; border: 0; border-radius: 2px; background: none; cursor: pointer;
  color: var(--muted); font: inherit; transition: color 0.25s, background-color 0.25s, box-shadow 0.25s;
}
.chip svg { display: block; overflow: visible; }
.chip svg .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.chip svg .tick { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.chip .nm { font: italic 700 16px/1.15 var(--display); text-transform: uppercase; white-space: nowrap; }
.chip small { font-size: 12px; font-variant-numeric: tabular-nums; }
.chip[aria-checked="true"] { color: var(--ink); background: var(--raised); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- settings sheet ---- */
#scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.55); }
#scrim.out { opacity: 0; }
#scrim.in { opacity: 1; }
#sheet {
  position: fixed; z-index: 21; left: 50%; bottom: 0; width: min(440px, 100%);
  max-height: 88vh; max-height: 88svh; overflow: auto; overscroll-behavior: contain;
  padding: 16px 20px calc(var(--inset-b) + 8px); border-radius: 4px 4px 0 0;
  background: var(--ground); color: var(--ink); border: 1px solid var(--line); border-bottom: 0; /* opaque: the menu behind must not show through */
  translate: -50% 0; display: flex; flex-direction: column; gap: 4px;
}
#sheet.shut { translate: -50% 105%; }
#sheet.open { translate: -50% 0; }
.sheethead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheethead h2 { margin: 0; font-size: 28px; }
.sheethead h2::after { display: none; }
.sheethead .link { color: var(--accent); font-weight: 800; font-size: 18px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font: italic 700 18px/1.15 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.setrow.col { flex-direction: column; align-items: stretch; }
.setrow.col .hint { text-align: left; font: 400 14px/1.35 Barlow, system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.setrow .sub { display: block; color: var(--muted); font: 400 14px/1.3 Barlow, system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.pill {
  border: 0; background: var(--surface); color: var(--ink); border-radius: 4px; padding: 9px 16px;
  font: italic 800 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; transition: scale 0.12s, background-color 0.2s;
}
.link.inline { display: inline; padding: 0; color: var(--ink); text-decoration: underline; font-size: inherit; text-transform: none; letter-spacing: 0; }
.standalone #installRow { display: none; }

/* switch: a square-cornered track, the knob a block; accent when on */
.tog { cursor: pointer; }
.tog input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; cursor: pointer;
  width: 52px; height: 30px; border-radius: 4px; position: relative;
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 0.25s;
}
.tog input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 24px; border-radius: 2px;
  background: var(--ink); transition: translate 0.25s cubic-bezier(.3, 1.3, .5, 1);
}
.tog input:checked { background: var(--accent); box-shadow: none; }
.tog input:checked::after { translate: 24px 0; background: var(--on-accent); }

@media (max-height: 560px) {
  .card { padding: 14px 16px 10px; gap: 8px; }
  .page { gap: 8px; }
  .logo { font-size: 28px; }
  .big { min-height: 46px; font-size: 20px; }
  .tile { min-height: 84px; }
}

/* ---- online ---- */
.big .offnote { display: none; }
.offline #btnQuick .offnote { display: block; position: absolute; right: 16px; top: 8px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font: italic 700 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.field input, .join input, .field select, .setrow .sel, .word {
  height: 56px; border-radius: 4px; border: 0; border-left: 6px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 20px/1 Barlow, system-ui, sans-serif; text-transform: none; letter-spacing: 0; padding: 0 14px; min-width: 0;
}
.field select, .setrow .sel { padding: 0 10px; }
.setrow .sel { max-width: 58%; height: 48px; font-size: 17px; }
.field input:focus, .join input:focus, .field select:focus, .setrow .sel:focus, .word:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-left-color: var(--accent); }
.join { display: flex; gap: 8px; }
.join input { flex: 1; width: 0; font: italic 800 28px/1 var(--display); letter-spacing: 0.3em; text-align: center; text-transform: uppercase; }
.join input::placeholder, .field input::placeholder { color: var(--muted); opacity: 0.7; }
.err { margin: 0; min-height: 1.2em; color: var(--danger); font-size: 15px; text-align: center; }
.err:empty { display: none; }
.status { margin: 0; text-align: center; font: italic 800 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.code { font: italic 800 60px/1 var(--display); letter-spacing: 0.16em; text-align: center; padding: 6px 0 2px 0.16em; }
#roomBox { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#roomQr { border-radius: 4px; background: #fff; padding: 6px; }
@media (hover: none) { #roomQr { display: none; } }
.row { display: flex; justify-content: center; gap: 8px; }
#hostBox { display: flex; flex-direction: column; gap: 8px; }
.riders { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.riders li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); font: italic 800 20px/1.1 var(--display); text-transform: uppercase; }
.riders li.me { box-shadow: inset 0 0 0 2px var(--ink); }
.riders li.bot { color: var(--muted); font-weight: 700; }
.riders li small { margin-left: auto; color: var(--muted); font: 500 13px Barlow, system-ui, sans-serif; text-transform: none; }
.spinner { width: 26px; height: 26px; margin: 4px auto; border-radius: 50%; border: 3px solid var(--raised); border-top-color: var(--ink); animation: spin 0.9s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.kbonly { display: none; }
.kb-open .kbonly { display: block; }
.kb-open #menu .menuhead, .kb-open #btnCreate, .kb-open #pgFriends h2, .kb-open #pgFriends .field { display: none; }

/* ---- forms, boards, meetings ---- */
.lbl { font: italic 700 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: -4px; }
.stat { text-align: center; font-size: 16px; }
.stat b { font: italic 800 30px/1 var(--display); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font: italic 700 19px/1.1 var(--display); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.board { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; }
.board li { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; background: var(--surface); font-variant-numeric: tabular-nums; }
.board li.me { box-shadow: inset 0 0 0 2px var(--ink); }
.board li .r { color: var(--muted); font: italic 800 22px/1 var(--display); }
.board li .n { font: italic 800 20px/1.1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .n small { color: var(--muted); margin-left: 8px; font: 500 13px Barlow, system-ui, sans-serif; text-transform: none; }
.board li .v { font: italic 800 22px/1 var(--display); }
.board li.res { opacity: 0.7; }
.board .empty { display: block; background: none; color: var(--muted); text-align: center; font: 500 16px Barlow, system-ui, sans-serif; text-transform: none; }
.meetlist { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow: auto; }
.meetlist h3, .mtcols h3 { margin: 6px 0 2px; font-size: 15px; color: var(--muted); }
.mrow { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 2px; padding: 10px 12px; border-radius: 0; border: 0; background: var(--surface); cursor: pointer; }
.mrow b { font: italic 800 20px/1.1 var(--display); text-transform: uppercase; }
.mrow small { color: var(--muted); font-size: 14px; }
.mrow .live { color: var(--danger); font-weight: 600; }
.card.wide { width: min(760px, 100%); max-height: calc(100svh - 20px); overflow: auto; }
.mthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mthead h2 { margin: 0; }
.row.left { justify-content: flex-start; flex-wrap: wrap; }
.word { width: 9em; font-size: 18px; }
.mtcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; }
@media (max-width: 620px) { .mtcols { grid-template-columns: minmax(0, 1fr); } }
.prog { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; }
.prog li { padding: 8px 10px; background: var(--surface); font-size: 15px; }
.prog li.cur { outline: 2px solid var(--ink); outline-offset: -2px; }
.prog li .hn { font: italic 800 19px var(--display); text-transform: uppercase; margin-right: 6px; }
.prog li .gates { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; }
.prog li .g { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prog li .g i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.prog li .g.you { font-weight: 600; }
.prog li .g em { font: italic 700 15px var(--display); margin-left: auto; color: var(--muted); }
#callBox { position: fixed; left: 50%; top: calc(var(--inset-t) + 8px); translate: -50% 0; z-index: 30; background: var(--raised); color: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: 4px; font: italic 800 19px/1.15 var(--display); text-transform: uppercase; box-shadow: 0 10px 30px var(--shadow); width: max-content; max-width: 92vw; text-align: center; }

/* ---- Grand Prix ---- */
.slot { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 0; background: var(--surface); }
.slot b { font: italic 800 21px/1.1 var(--display); text-transform: uppercase; }
.slot small { color: var(--muted); font-size: 14px; }
.slot small.warn { color: var(--danger); }
.slot .row { justify-content: flex-start; flex-wrap: wrap; margin-top: 8px; }
.pill.primary { background: var(--accent); color: var(--on-accent); }
.pill:disabled { opacity: 0.45; cursor: default; }
.field textarea {
  min-height: 96px; border-radius: 4px; border: 0; border-left: 6px solid var(--line); background: var(--surface); color: var(--ink);
  font: 12px/1.3 ui-monospace, "SF Mono", Menlo, monospace; text-transform: none; letter-spacing: 0; padding: 10px 12px; resize: vertical; min-width: 0;
}
.field input[type="file"] { height: auto; padding: 10px; font-size: 14px; }
.gpact { display: flex; flex-direction: column; gap: 8px; }
.gpact .row { justify-content: flex-start; }
.big .dot { width: 24px; height: 24px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45); }
.slots { display: flex; flex-direction: column; gap: 8px; }
/* the event panel: the card scrolls as a whole (no nested scroll areas) */
#gp .card { gap: 12px; }
#gpState { font-size: 19px; }
#gpNote[hidden] { display: none; }
.gptop { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.gptop.solo { grid-template-columns: minmax(0, 1fr); }
.gpnext[hidden] { display: none; }
@media (min-width: 621px) {
  .gptop:not(.solo) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .gptop.pick:not(.solo) { grid-template-columns: minmax(0, 1fr); }
  .gpnext.picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; align-items: start; }
  .gpnext.picker .hh, .gpnext.picker .hint { grid-column: 1 / -1; }
}
.gpnext { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 0; background: var(--surface); }
.hh { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hh b { font: italic 800 20px/1.1 var(--display); text-transform: uppercase; }
.hh small { color: var(--muted); font-size: 13px; }
.hh .now { margin-left: auto; flex: none; font: italic 800 14px/1.4 var(--display); letter-spacing: 0.04em; text-transform: uppercase; padding: 0 8px; border-radius: 2px; background: var(--ink); color: var(--ground); }
.gpnext .hh b { font-size: 22px; }
.gprow { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.gprow li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--raised); font: italic 800 19px/1.1 var(--display); text-transform: uppercase; min-width: 0; }
.gprow li.me { background: var(--ink); color: var(--ground); }
.gprow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gprow small { color: var(--muted); font: 500 13px Barlow, system-ui, sans-serif; text-transform: none; white-space: nowrap; }
.gprow li.me small { color: var(--ground); opacity: 0.75; }
.gprow .pn { width: 1.1em; text-align: center; color: var(--muted); }
.gprow li.me .pn { color: inherit; }
.gprow .at { display: flex; align-items: center; gap: 5px; margin-left: auto; font: italic 700 16px var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hd { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.35); }
.gprow li.me .hd { box-shadow: 0 0 0 1.5px rgba(14, 15, 18, 0.55), inset 0 0 0 1.5px rgba(0, 0, 0, 0.35); }
.gfl { flex: none; width: 27px; font-style: normal; font-size: 18px; line-height: 1; text-align: center; }
.gpick { display: flex; flex-direction: column; gap: 6px; }
.gpick .big { min-height: 56px; background: var(--raised); }
.gpick .big.best { box-shadow: inset 0 0 0 2px var(--ink); }
.gpick .big small { white-space: nowrap; }
.gpick .ph { display: none; }
.gpick .tagbest { font: italic 800 13px/1.5 var(--display); letter-spacing: 0.04em; text-transform: uppercase; padding: 0 8px; border-radius: 2px; background: var(--ink); color: var(--ground); }
.gpick .big:disabled .dot { opacity: 0.5; }
@media (hover: hover) { .gpick .big:not(:disabled):hover { background: var(--line); } }
/* the result: a podium, then the full table */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 0; border-top: 5px solid var(--line); background: var(--surface); text-align: center; min-width: 0; }
.pod .pl { font: italic 800 28px/1 var(--display); }
.pod .gfl { font-size: 28px; width: auto; }
.pod b { font: italic 800 19px/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.pod small { color: var(--muted); font-size: 13px; }
.pod.p1 { order: 2; padding-block: 20px 14px; border-top-color: var(--helmet-yellow); }
.pod.p1 .pl { font-size: 36px; }
.pod.p2 { order: 1; }
.pod.p3 { order: 3; }
.pod.me { background: var(--ink); color: var(--ground); }
.pod.me small { color: var(--ground); opacity: 0.75; }
.gpyou { margin: 0; padding: 8px 12px; background: var(--ink); color: var(--ground); font: italic 800 19px/1.1 var(--display); text-transform: uppercase; text-align: center; }
.gpyou[hidden] { display: none; }
/* Table | Heats on a phone, side by side on a wider screen */
.gpcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.gpcol h3 { margin: 4px 0; font-size: 15px; color: var(--muted); }
.gpcol .hint { font-size: 13px; margin-bottom: 4px; }
.gpcol .key i { display: inline-block; width: 3px; height: 11px; border-radius: 2px; margin: 0 5px 0 0; vertical-align: -1px; }
.gpcol .key i + i, .gpcol .key .k2 { margin-left: 10px; }
.k1 { background: #34c759; } .k2 { background: #e8a317; }
.gpcol .key[hidden] { display: none; }
@media (min-width: 621px) { #segGpTab { display: none; } }
@media (max-width: 620px) {
  .gpcols { grid-template-columns: minmax(0, 1fr); }
  #gp[data-tab="table"] #gpColHeats, #gp[data-tab="heats"] #gpColTable { display: none; }
}
.gpt, .gpprog { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.gpt li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 40px; column-gap: 8px; align-items: center; position: relative; padding: 6px 10px 6px 4px; background: var(--surface); font-variant-numeric: tabular-nums; }
.gpt.fin li { grid-template-columns: 34px minmax(0, 1fr) 40px 40px; }
.gpt li.me { outline: 2px solid var(--ink); outline-offset: -2px; }
.gpt li.q1::before, .gpt li.q2::before { content: ""; position: absolute; left: 3px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: #e8a317; }
.gpt li.q1::before { background: #34c759; }
.gpt li.hdr span:nth-child(2) { padding-left: 33px; }
.gpt li.hdr { background: none; outline: 0; box-shadow: none; padding-block: 0; color: var(--muted); font: italic 700 14px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.05em; }
.gpt .p { text-align: center; font: italic 800 22px/1 var(--display); }
.gpt li.hdr .p { font-size: 14px; font-weight: 700; }
.gpt .v { text-align: right; font: italic 800 22px/1 var(--display); }
.gpt .v.dim { color: var(--muted); font-weight: 700; }
.gpt li.hdr .v { font-size: 14px; font-weight: 700; }
.gpw { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gnm { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.gnm b { font: italic 800 20px/1.05 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gnm small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.wc { margin-left: 6px; padding: 0 6px; border-radius: 2px; background: var(--ink); color: var(--ground); font: italic 800 12px/1.5 var(--display); letter-spacing: 0.05em; vertical-align: 2px; }
.gpprog li { padding: 8px 10px; background: var(--surface); font-size: 15px; }
.gpprog li.done { opacity: 0.7; }
.gpprog li.cur { outline: 2px solid var(--ink); outline-offset: -2px; }
.gpprog .pickline { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.gpprog .gr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; margin-top: 6px; }
.gpprog .gc { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; font: italic 700 16px/1.2 var(--display); text-transform: uppercase; }
.gpprog .gc .hd { width: 10px; height: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.gpprog .gc .gfl { width: 1.3em; font-size: 15px; }
.gpprog .gc .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gpprog .gc .nm.open { color: var(--muted); }
.gpprog .gc.you { font-weight: 800; }
.gpprog .gc em { font-style: italic; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-height: 560px) { #gp .card { gap: 8px; } .gpnext { padding: 8px 10px; gap: 6px; } .gprow li { padding-block: 4px; } }
/* ---- .fit: a panel that fills the screen on a phone (opt-in: #gp, #season, #match, #league) ----
   On <= 620 px the card takes the whole panel (same insets), the panel itself never scrolls and there is at most ONE scrolling
   area: the list `.fill` (flex 1, scrolls inside) with the action bar `.gpact` last, at the thumb. When the fixed parts do not fit
   (a gate pick on a small phone) the card itself scrolls and the list does not. Above 620 px nothing changes. */
.gpact[hidden] { display: none; }
.gpt .st, .wcp { display: none; }
@media (max-width: 620px) {
  #gp, #season, #match, #league { grid-template-rows: minmax(0, 1fr); }
  .card.fit { align-self: stretch; max-height: none; min-height: 0; padding: 12px; gap: 8px; }
  .fit > .gptop { display: contents; }
  .fit .gpact { order: 9; flex: none; position: sticky; bottom: 0; z-index: 1; gap: 6px; padding-top: 6px; background: var(--ground); box-shadow: 0 -8px 8px -4px var(--ground); }
  .fit .gpact .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .fit .gpact .big { min-height: 52px; }
  .fit .gpact .big.slim { width: 100%; padding-inline: 8px; min-height: 44px; font-size: 18px; }
  .fit .fill { flex: 1 1 0; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; }
  .fit > * { flex-shrink: 0; }
  .fit > .fill { flex-shrink: 1; }
  .fit .mthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; }
  .fit .mthead > div { min-width: 0; }
  .fit .mthead .link { align-self: center; min-height: 44px; min-width: 44px; justify-content: center; padding-inline: 8px; }
  .fit .mthead h2 { font-size: 24px; line-height: 1.05; margin: 0; }
  .fit .mthead h2::after { width: 56px; height: 4px; margin-top: 4px; }
  .fit .mthead .hint { margin: 3px 0 0; text-align: left; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* the Grand Prix event panel, phone: dense, one screen */
@media (max-width: 620px) {
  #gp .status { font-size: 16px; line-height: 1.2; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #gp .hint.gpkit { margin-top: -4px; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #gp #gpNote { font-size: 13px; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #gp .gpnext { padding: 8px 10px; gap: 6px; }
  #gp .gpnext .hh b { font-size: 18px; }
  #gp .hh .now { font-size: 12px; line-height: 1.5; }
  #gp .gprow { gap: 3px; }
  #gp .gprow li { min-height: 36px; padding: 0 8px; font-size: 17px; gap: 6px; }
  #gp .gprow small { font-size: 12px; }
  #gp .gprow .at { font-size: 15px; }
  #gp .gpnext.picker .hint { font-size: 12px; line-height: 1.25; margin: 0; }
  #gp .gpick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  #gp .gpick .big { flex-direction: column; justify-content: flex-start; align-items: center; gap: 4px; min-height: 64px; padding: 8px 2px 6px; text-align: center; font-size: 17px; }
  #gp .gpick .big .dot { width: 16px; height: 16px; }
  #gp .gpick .big .txt { flex: none; align-items: center; }
  #gp .gpick .big small { font-size: 13px; line-height: 1.15; white-space: normal; text-align: center; margin: 1px 0 0; }
  #gp .gpick .wd { display: none; }
  #gp .gpick .ph { display: block; }
  #gp .gpick .ph b { display: block; font: italic 800 16px/1.1 var(--display); color: var(--ink); text-transform: uppercase; white-space: nowrap; }
  #gp .gpick .ph .gn { display: block; white-space: nowrap; }
  #gp .gpick .ph.t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  #gp .gpick .tagbest { position: absolute; top: 3px; right: 3px; padding: 0 4px; font-size: 10px; line-height: 1.4; }
  #gp .gpick .big.best { box-shadow: inset 0 0 0 2px var(--ink); }
  #gp #segGpTab button { min-height: 44px; }
  /* the podium after the event: compact */
  :is(#gp, #season, #league) .podium { gap: 4px; }
  :is(#gp, #season, #league) .pod { padding: 6px 4px; gap: 1px; border-top-width: 4px; }
  :is(#gp, #season, #league) .pod.p1 { padding-block: 10px 6px; }
  :is(#gp, #season, #league) .pod .pl, :is(#gp, #season, #league) .pod .gfl { font-size: 20px; line-height: 1.05; }
  :is(#gp, #season, #league) .pod.p1 .pl { font-size: 24px; }
  #league .pod .crest svg, #league .pod .crest img { height: 28px; width: auto; }
  :is(#gp, #season, #league) .pod b { font-size: 15px; line-height: 1; }
  :is(#gp, #season, #league) .pod small { font-size: 12px; }
  :is(#gp, #season, #league) .gpyou { padding: 5px 10px; font-size: 16px; }
  /* the list area: table or heats */
  #gp .gpcols { display: block; }
  #gp #gpColTable { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; }
  #gp #gpColTable > .gpt { grid-column: 1 / -1; }
  #gp .gpcol h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.2; }
  #gp #gpColHeats h3 { display: none; }
  #gp .gpcol .hint.key { margin: 0 0 4px; font-size: 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #gp .gpcol .key i + i, #gp .gpcol .key .k2 { margin-left: 8px; }
  #gp .gpt, #gp .gpprog { gap: 2px; }
  #gp .gpt li { grid-template-columns: 26px minmax(0, 1fr) 42px 34px; column-gap: 6px; min-height: 34px; padding: 0 8px 0 4px; }
  #gp .gpt.fin li { grid-template-columns: 26px minmax(0, 1fr) 34px 34px; }
  #gp .gpt .st { display: block; text-align: center; color: var(--muted); font: italic 700 15px/1 var(--display); }
  #gp .gpt .p, #gp .gpt .v { font-size: 19px; }
  #gp .gpt li.hdr { min-height: 22px; position: sticky; top: 0; z-index: 1; background: var(--ground); box-shadow: 0 2px 0 var(--ground); }
  #gp .gpt li.hdr .p, #gp .gpt li.hdr .v, #gp .gpt li.hdr .st { font-size: 13px; font-weight: 700; }
  #gp .gpt li.hdr span:nth-child(2) { padding-left: 25px; }
  #gp .gpt li.q1::before, #gp .gpt li.q2::before { top: 7px; bottom: 7px; }
  #gp .gpt .gnm small { display: none; }
  #gp .gpt .wcp { display: inline-block; flex: none; margin-left: 0; }
  #gp .gpt .gnm b { font-size: 17px; line-height: 1.1; }
  #gp .gpt .gfl { width: 22px; font-size: 16px; }
  #gp .gpprog li { padding: 5px 8px; }
  #gp .gpprog .hh { gap: 6px; }
  #gp .gpprog .hh b { font-size: 15px; line-height: 1.05; }
  #gp .gpprog .hh small { font-size: 12px; }
  #gp .gpprog .pickline { font-size: 12px; line-height: 1.2; margin-top: 1px; }
  #gp .gpprog .gr { gap: 0 10px; margin-top: 2px; }
  #gp .gpprog .gc { font-size: 14px; line-height: 15px; gap: 3px; }
  #gp .gpprog .gc .gfl { width: 1.2em; font-size: 13px; }
  #gp .gpprog .gc .hd { width: 8px; height: 8px; }
  /* a gate pick on a short phone: the card scrolls as a whole, the list below the picker does not */
  #gp.picking .fill { overflow: visible; flex: none; min-height: 0; }
}
@media (max-width: 620px) and (max-height: 720px) {
  .card.fit { gap: 6px; }
  #gp .gpnext { padding: 6px 8px; gap: 4px; }
  #gp .gprow li { min-height: 32px; }
  #gp .gpnext .hh b { font-size: 17px; }
  #gp .fit .gpact .big, #gp .gpact .big { min-height: 48px; }
}
@media (max-width: 620px) and (min-height: 760px) {
  #gp.picking .fill { overflow-y: auto; flex: 1 1 0; min-height: 120px; }
}
/* the season hub: a calendar and the championship, the event panel's look */
#season .card { gap: 12px; }
#season .card.wide { width: min(980px, 100%); }
#snState { font-size: 19px; }
.gpact .big[hidden] { display: none; }
#season .gpcol#snColTable { container-type: inline-size; }
@media (min-width: 621px) {
  #segSnTab { display: none; }
  #season .gpcols { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); }
}
@media (max-width: 620px) {
  #season[data-tab="table"] #snColCal, #season[data-tab="cal"] #snColTable { display: none; }
}
.sncal, .rlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.rnd { background: var(--surface); font-size: 15px; }
.rnd:not(.done):not(.cur) { opacity: 0.7; }
.rnd.cur { outline: 2px solid var(--ink); outline-offset: -2px; }
.rtop { transition: background-color 0.2s; display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 8px 10px; background: none; border: 0; color: inherit; font: inherit; text-align: left; }
button.rtop { cursor: pointer; }
.rn { flex: none; width: 22px; font: italic 800 20px/1 var(--display); text-align: center; color: var(--muted); }
.rtop .gnm b { font-size: 20px; }
.rtop .now { margin-left: auto; flex: none; font: italic 800 14px/1.4 var(--display); letter-spacing: 0.04em; text-transform: uppercase; padding: 0 8px; border-radius: 2px; background: var(--ink); color: var(--ground); }
.rres { margin-left: auto; flex: none; font: italic 700 16px/1 var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rlist { padding: 0 8px 8px; }
/* a done round unfolds in place: the body grid goes 0fr -> 1fr (JS only flips .open) */
.rbody { display: grid; grid-template-rows: 0fr; visibility: hidden; }
.rnd.open .rbody { grid-template-rows: 1fr; visibility: visible; }
.rinner { min-height: 0; overflow: hidden; opacity: 0; }
.rnd.open .rinner { opacity: 1; }
.chev { flex: none; width: 7px; height: 7px; margin: 0 4px 0 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); rotate: -45deg; }
.rnd.open .chev { rotate: 45deg; }
@media (prefers-reduced-motion: no-preference) {
  .rbody { transition: grid-template-rows 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.28s; }
  .rinner { transition: opacity 0.2s; }
  .chev { transition: rotate 0.2s; }
}
.rlist li { display: grid; grid-template-columns: 26px 26px minmax(0, 1fr) 30px; column-gap: 6px; align-items: center; padding: 4px 6px; background: var(--raised); font: italic 700 17px/1.15 var(--display); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.rlist li.me { background: var(--ink); color: var(--ground); }
.rlist .p { text-align: center; font-weight: 800; }
.rlist .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlist .v { text-align: right; font-weight: 800; }
.snt .m { display: none; text-align: center; font: italic 700 15px var(--display); color: var(--muted); }
.snt li.hdr .m { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
@container (min-width: 500px) {
  .snt li { grid-template-columns: 34px minmax(0, 1fr) repeat(var(--n), 28px) 44px; column-gap: 4px; }
  .snt .m { display: block; }
}
@media (max-height: 560px) { #season .card { gap: 8px; } }

/* ---- the workshop (season hub), the sponsor choice, the money note ---- */
.shop, .sponsors { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 0; background: var(--surface); }
.shop[hidden], .sponsors[hidden], .snnote[hidden] { display: none; }
.shophead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.shop h3, .sponsors h3 { margin: 0; font-size: 15px; color: var(--muted); }
.money { font: italic 800 34px/1 var(--display); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.shoprow { display: flex; flex-direction: column; gap: 8px; }
.shopeng { display: flex; align-items: center; gap: 12px; }
.shopeng b { font: italic 800 20px/1.1 var(--display); text-transform: uppercase; white-space: nowrap; }
.cond { flex: 1; min-width: 60px; height: 8px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.cond i { display: block; height: 100%; width: 100%; border-radius: 2px; background: #34c759; transition: width 0.3s; }
.cond.amber i { background: #e8a317; }
.cond.red i { background: #e5372b; }
.shopbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.shopbtns .pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 44px; background: var(--raised); }
.tagrec { font: italic 800 13px/1.5 var(--display); letter-spacing: 0.04em; text-transform: uppercase; padding: 0 7px; border-radius: 2px; background: #e8a317; color: #1d1400; }
.tagrec[hidden] { display: none; }
#snGearBox { display: flex; flex-direction: column; gap: 6px; }
.forecast { margin: 0; font: italic 700 17px/1.2 var(--display); text-transform: uppercase; }
.forecast i { font-style: normal; margin-right: 6px; }
.shop .hint { font-size: 14px; }
.shop .seg { background: var(--raised); }
.sponsors { gap: 10px; }
.sponsors .link { align-self: flex-start; padding-left: 0; }
.sponsorgrid { display: flex; flex-direction: column; gap: 8px; }
.offer { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 12px 14px; min-height: 76px; border-radius: 4px; border: 2px solid var(--accent); background: var(--raised); color: var(--ink); cursor: pointer; font: inherit; }
.offer b { font: italic 800 22px/1.1 var(--display); text-transform: uppercase; }
.offer .fee { font: italic 700 18px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.offer small { color: var(--muted); font-size: 14px; }
@media (min-width: 621px) { .sponsorgrid { flex-direction: row; } .offer { flex: 1; } .shoprow { flex-direction: row; align-items: center; justify-content: space-between; } .shopeng { flex: 1; max-width: 340px; } }
.snnote { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 12px; background: var(--surface); font: 600 15px/1.3 Barlow, system-ui, sans-serif; }
.snnote .link { padding: 0 6px; font-size: 24px; line-height: 1; }
.shopsum, .shoptog { display: none; }
.shopbtns[hidden], .shop .hint[hidden] { display: none; }
/* the season hub on a phone (.fit): state in one line, the workshop folded into one row (the toggle unfolds it in place and then
   it is the one scrolling area), compact sponsor offers, the money note in one line, the calendar / standings in the list */
@media (max-width: 620px) {
  #season .status { font-size: 16px; line-height: 1.2; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #season .gpcol h3 { display: none; }
  #season .gpcols { display: grid; align-content: start; }
  .snnote { align-items: center; min-height: 44px; padding: 0 0 0 10px; font-size: 13px; line-height: 1.2; }
  .snnote > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .snnote .link { min-width: 44px; min-height: 44px; justify-content: center; }
  .sponsors { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "h l" "o o" "t t"; align-items: center; gap: 2px 8px; padding: 2px 10px 6px; }
  .sponsors h3 { grid-area: h; }
  .sponsors .link { grid-area: l; align-self: center; min-height: 44px; padding: 0 4px; }
  .sponsorgrid { grid-area: o; flex-direction: row; gap: 6px; }
  .sponsors .hint { grid-area: t; font-size: 12px; line-height: 1.25; text-align: left; }
  .offer { flex: 1; min-width: 0; min-height: 0; gap: 1px; padding: 8px 10px; }
  .offer b { font-size: 17px; }
  .offer .fee { font-size: 15px; }
  .offer small { font-size: 12px; line-height: 1.2; }
  #season .shop { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 44px; align-items: center; column-gap: 8px; row-gap: 6px; padding: 4px 2px 4px 10px; min-height: 56px; }
  #season .shophead, #season .shoprow { display: contents; }
  #season .shop h3 { display: none; }
  #season .shop > * { grid-column: 1 / -1; }
  #season .shopeng { grid-area: 1 / 1; flex-direction: column; align-items: stretch; gap: 5px; min-width: 0; }
  #season .shopeng b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
  #season .cond { flex: none; min-width: 0; height: 5px; }
  #season .shop .money { grid-area: 1 / 2; font-size: 20px; }
  #season .shopsum { display: block; grid-area: 1 / 3; font: italic 700 14px/1.1 var(--display); text-transform: uppercase; white-space: nowrap; }
  #season .shopsum i { font-style: normal; margin-left: 4px; }
  #season .shoptog { display: flex; grid-area: 1 / 4; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
  #season .shop.open .chev { rotate: 45deg; }
  #season .shopbtns { grid-column: 1 / -1; }
  #season .shop:not(.open) > :not(.shophead):not(.shoprow):not(.shopsum):not(.shoptog),
  #season .shop:not(.open) .shopbtns { display: none; }
  #season .shop.open { flex: 1 1 0; min-height: 56px; overflow-y: auto; align-content: start; }
  #season .gpact .big { padding-block: 6px; }
  #season.shopopen #segSnTab, #season.shopopen .fill { display: none; }
}
.gpkit { margin-top: -6px; }
.rmoney { display: block; margin: 0 10px 8px; font-size: 13px; color: var(--muted); }
.gpkit span { display: block; }

/* ---- team match: the new-match page and the match panel (club colours only in the crests and a thin accent line per team) ---- */
.crest { display: flex; flex: none; }
.crest svg { display: block; }
.crest-real { display: block; object-fit: contain; } /* the real club logo (realclubs.js), same box as the SVG crest */
.chips.clubs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; overflow: visible; scroll-snap-type: none; touch-action: auto; }
.chip.club { min-width: 0; padding: 8px 2px 6px; gap: 3px; text-align: center; }
.chip.club .nm { white-space: normal; font-size: 15px; line-height: 1.05; }
.chip.club small { font-size: 11.5px; }
.tmnos { display: flex; flex-direction: column; gap: 4px; }
.tmno {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px 8px 8px; border-radius: 2px; border: 0; background: var(--surface);
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.tmno b { text-align: center; font: italic 800 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.tmno .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 800 19px/1.1 var(--display); text-transform: uppercase; }
.tmno small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tmno[aria-checked="true"] { background: var(--raised); box-shadow: inset 0 0 0 2px var(--accent); }
#match .card { gap: 12px; }
#tmState { font-size: 19px; }
#tmNote[hidden], .tmfinal[hidden] { display: none; }
.tmscore { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); }
.tmside { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding-top: 8px; border-top: 4px solid transparent; background: linear-gradient(90deg, var(--team, transparent) 50%, var(--team2, var(--team, transparent)) 50%) top / 100% 4px no-repeat border-box; text-align: center; }
.tmside b { font: italic 800 21px/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.tmside small { color: var(--muted); font-size: 13px; }
.tmnum { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tmnum b { font: italic 800 44px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tmnum small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tmfinal { display: flex; flex-direction: column; gap: 8px; }
.tmwin { padding: 10px 12px; background: var(--ink); color: var(--ground); text-align: center; font: italic 800 26px/1.05 var(--display); text-transform: uppercase; }
.tmbest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tmb { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px; border-left: 4px solid transparent; background: linear-gradient(180deg, var(--team, transparent) 50%, var(--team2, var(--team, transparent)) 50%) left / 4px 100% no-repeat border-box, var(--surface); }
.tmb.me { outline: 2px solid var(--ink); outline-offset: -2px; }
.tmb .gfl { width: auto; }
.tmb .gnm small { white-space: normal; }
/* the team accent: a thin line in the club's first two colours, half and half (clubs share a first colour) */
.gprow li.tmr, .tmheats .gc, .lgx.mine, .lgtr {
  border-left: 4px solid transparent; background-origin: border-box;
  background-image: linear-gradient(180deg, var(--team, transparent) 50%, var(--team2, var(--team, transparent)) 50%); background-size: 4px 100%; background-position: left; background-repeat: no-repeat;
}
.tmheats .gc { padding-left: 4px; }
.tmr .no, .gpprog .gc .no { flex: none; min-width: 1.6em; text-align: center; font-style: italic; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tmr.me .no { color: inherit; }
.rtag { flex: none; padding: 0 5px; border-radius: 2px; background: var(--ink); color: var(--ground); font: italic 800 12px/1.5 var(--display); letter-spacing: 0.04em; }
.tmr.me .rtag { background: var(--ground); color: var(--ink); }
.tmheats .hh .hs { margin-left: auto; font: italic 800 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.tmheats .hh .run { min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; }
.gpprog li.brk { display: flex; align-items: center; gap: 8px; padding: 2px 4px; background: none; color: var(--muted); font: italic 700 14px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; opacity: 1; }
.gpprog li.brk::before, .gpprog li.brk::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gpprog li.brk.done { color: var(--ink); }
.tmteams { display: flex; flex-direction: column; gap: 12px; }
.tmcard { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 6px; border-top: 4px solid transparent; background: linear-gradient(90deg, var(--team, var(--line)) 50%, var(--team2, var(--team, var(--line))) 50%) top / 100% 4px no-repeat border-box, var(--surface); }
.tmch { display: flex; align-items: center; gap: 8px; }
.tmch b { font: italic 800 22px/1.05 var(--display); text-transform: uppercase; }
.tmch small { color: var(--muted); font-size: 13px; }
.tmch .tot { margin-left: auto; font: italic 800 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.tmt { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.tmt li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 6px 8px 6px 4px; background: var(--raised); font-variant-numeric: tabular-nums; }
.tmt li.me { outline: 2px solid var(--ink); outline-offset: -2px; }
.tmt li.idle { opacity: 0.65; }
.tmt .no { text-align: center; font: italic 800 17px/1 var(--display); color: var(--muted); }
.tmt .v { text-align: right; font: italic 800 20px/1 var(--display); }
.tmt .rides { display: flex; flex-wrap: wrap; gap: 0 8px; min-height: 1.2em; white-space: normal; }
.rd { font: italic 700 18px/1.2 var(--display); color: var(--ink); }
.rd.out { color: var(--muted); }
.rd.tr { text-decoration: underline dotted; text-underline-offset: 3px; }
@media (min-width: 621px) { #segTmTab { display: none; } }
@media (max-width: 620px) {
  #match[data-tab="teams"] #tmColHeats, #match[data-tab="heats"] #tmColTeams { display: none; }
  .tmbest { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 560px) { #match .card { gap: 8px; } #league .card { gap: 8px; } }
/* the league hub on a phone (.fit): the state in two lines, your match and its action at the bottom, the opponent choice compact (its
   explanation behind a ?), Table | Fixtures | Riders | Play-off in the one list area */
.lgch { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lgq { display: none; }
@media (max-width: 620px) {
  #league .lghead { gap: 8px; }
  #league .lgcrest svg, #league .lgcrest img { height: 30px; width: auto; }
  #league .status { font-size: 15px; line-height: 1.2; text-align: left; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #league #lgNote { font-size: 13px; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #league .lgsim { padding: 6px 10px; gap: 4px; font-size: 15px; }
  #league .gpact .big .txt { font-size: 18px; line-height: 1.1; }
  #league .gpact .big .txt small { font-size: 13px; }
  #league .lgchoice { padding: 8px; gap: 6px; }
  #league .lgch h3 { font-size: 14px; }
  #league .lgq { display: flex; width: 44px; min-height: 44px; margin: -8px -4px -8px 0; padding: 0; align-items: center; justify-content: center; font: italic 800 20px/1 var(--display); }
  #league .lgchoice.hintopen .lgq { color: var(--ink); }
  #league #lgChoiceHint { display: none; margin: 0; font-size: 12px; line-height: 1.3; }
  #league .lgchoice.hintopen #lgChoiceHint { display: block; }
  #league .lgopts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #league .lgopt { flex-direction: column; justify-content: flex-start; align-items: center; gap: 2px; min-height: 76px; padding: 6px 2px 6px; text-align: center; font-size: 15px; position: relative; }
  #league .lgopt .crest svg, #league .lgopt .crest img { height: 28px; width: auto; }
  #league .lgopt .gnm { align-items: center; }
  #league .lgopt .gnm small { font-size: 12px; white-space: normal; }
  #league .lgopt .tagbest { position: absolute; top: 3px; right: 3px; padding: 0 4px; font-size: 10px; line-height: 1.4; }
  #league .gpcol h3 { display: none; }
  #league .lgcols { align-content: start; gap: 8px; }
  #league .gpcol .hint { font-size: 12px; line-height: 1.25; margin: 0 0 4px; text-align: left; }
  #league .gpcol .hint.key { text-align: right; }
  #league .gpt, #league .lgfix { gap: 2px; }
  #league .gpt li { min-height: 34px; padding-block: 0; }
  #league .gpt li.hdr { min-height: 22px; position: sticky; top: 0; z-index: 1; background: var(--ground); box-shadow: 0 2px 0 var(--ground); }
  #league .gpt .gnm small { display: none; }
  #league .lgfin .gnm small { display: block; }
  #league .lgr .gnm small { display: flex; }
  #league .gpt.lgr li { padding-block: 3px; }
  #league .lgtie { padding: 6px; }
  #league .lgtr { padding-block: 3px; grid-template-columns: minmax(0, 1fr) 54px 54px 30px; }
  #league .lgtr.hdr .g { font-size: 12px; letter-spacing: 0; white-space: nowrap; line-height: 1.2; }
  #league #segLgTab button { min-height: 44px; }
}
@media (max-width: 620px) and (max-height: 720px) {
  #league .lgchoice { padding: 6px; }
  #league .lgopt { min-height: 68px; }
  #league .gpact .big { min-height: 48px; }
}
/* the new-match and new-league pages: the form is one list that scrolls inside (`.pgfill`), the Start action stays at the bottom
   (`.pgact`: Back at the left, Start at the thumb) on a phone; wide keeps the old flow */
.pgfill, .pgact { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 620px) {
  #menu:is([data-page="pgMatchNew"], [data-page="pgLeagueNew"], [data-page="pgCoop"]) { grid-template-rows: minmax(0, 1fr); }
  #menu:is([data-page="pgMatchNew"], [data-page="pgLeagueNew"], [data-page="pgCoop"]) .card { align-self: stretch; min-height: 0; padding: 12px; gap: 6px; }
  #menu:is([data-page="pgMatchNew"], [data-page="pgLeagueNew"], [data-page="pgCoop"]) .menuhead { min-height: 32px; }
  #menu:is([data-page="pgMatchNew"], [data-page="pgLeagueNew"], [data-page="pgCoop"]) .logo { font-size: 22px; }
  :is(#pgMatchNew, #pgLeagueNew, #pgCoop):not([hidden]) { flex: 1 1 0; min-height: 0; gap: 8px; }
  :is(#pgMatchNew, #pgLeagueNew, #pgCoop) > * { flex-shrink: 0; }
  :is(#pgMatchNew, #pgLeagueNew, #pgCoop) h2 { margin: 0; font-size: 28px; }
  :is(#pgMatchNew, #pgLeagueNew, #pgCoop) h2::after { width: 56px; height: 4px; margin-top: 4px; }
  :is(#pgMatchNew, #pgLeagueNew, #pgCoop) > .big { min-height: 52px; }
  .pgfill { flex: 1 1 0 !important; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; gap: 8px; }
  .pgfill > * { flex-shrink: 0; }
  .pgfill > .hint { font-size: 14px; line-height: 1.3; margin: 0; text-align: left; }
  .pgfill .lbl { margin-bottom: -2px; }
  .pgact { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: stretch; padding-top: 6px; background: var(--ground); box-shadow: 0 -8px 8px -4px var(--ground); }
  .pgact .big { grid-column: 2; grid-row: 1; min-height: 52px; }
  .pgact .link { grid-column: 1; grid-row: 1; min-height: 44px; padding-inline: 12px; justify-content: center; }
  .chip.club { padding: 5px 2px 4px; gap: 2px; min-height: 44px; }
  .chip.club .crest svg, .chip.club .crest img { height: 28px; width: auto; }
  .chip.club .nm { font-size: 14px; }
  .chip.club small { font-size: 11px; }
  .tmno { min-height: 44px; padding: 3px 10px 3px 6px; gap: 6px; grid-template-columns: 30px minmax(0, 1fr) auto; }
  .tmno b { font-size: 20px; }
  .tmno .nm { font-size: 17px; }
  .tmno small { font-size: 12px; }
  .tmnos { gap: 3px; }
  .pgfill .field { gap: 2px; }
}
/* the co-op match page (pgCoop, 2026-11-29): the lobby is one list that scrolls inside like the new-match form; a rider who is not the host sees
   the host's choices read-only (`.ro`), a number the team-mate holds is disabled */
.coopbox { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 620px) { .coopbox { gap: 8px; } .coopbox .code { font-size: 48px; padding: 0 0 0 0.16em; } }
.ro { pointer-events: none; }
.ro .chip[aria-checked="false"], .ro .seg button[aria-checked="false"] { opacity: 0.45; }
.tmno:disabled { opacity: 0.4; cursor: default; }
.rtag.mate, .bc .bc-mate { background: var(--muted); color: var(--ground); }
.bc .bc-mate { flex: none; margin-left: 6px; padding: 0 5px; border-radius: 2px; font: italic 800 11px/1.5 var(--display); letter-spacing: 0.04em; vertical-align: 2px; }
/* the team match panel on a phone (.fit): a slim scoreboard, the state in two lines, the next heat compact, the action bar at the thumb;
   Teams | Heats in the one list area `.fill`, the legend of the scorecards folded behind the ? beside the tabs */
.tmtabs { display: flex; align-items: stretch; gap: 6px; }
.tmtabs .seg { flex: 1; min-width: 0; }
.tmq { display: none; }
@media (max-width: 620px) {
  #match .status { font-size: 15px; line-height: 1.2; text-align: left; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #match #tmNote { font-size: 13px; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #match .tmscore { padding: 6px 10px; gap: 6px; }
  #match .tmside { gap: 0; padding-top: 5px; }
  #match .tmside .crest svg, #match .tmside .crest img { height: 28px; width: auto; }
  #match .tmside b { font-size: 17px; line-height: 1.1; }
  #match .tmside small { font-size: 12px; line-height: 1.2; }
  #match .tmnum { gap: 0; }
  #match .tmnum b { font-size: 36px; }
  #match .tmnum small { font-size: 12px; }
  #match .gpnext { padding: 8px 10px; gap: 6px; }
  #match .gpnext .hh b { font-size: 18px; }
  #match .hh .now { font-size: 12px; line-height: 1.5; }
  #match .gprow { gap: 3px; }
  #match .gprow li { min-height: 34px; padding: 0 8px; font-size: 17px; gap: 6px; }
  #match .gprow small { font-size: 12px; }
  #match .gprow .gfl { font-size: 16px; }
  #match .tmr .no { min-width: 1.4em; font-size: 14px; }
  #match .tmtabs { gap: 0; }
  #match .tmtabs .seg button { min-height: 44px; }
  #match .tmq { display: none; flex: none; width: 44px; align-items: center; justify-content: center; padding: 0; background: var(--surface); font: italic 800 20px/1 var(--display); }
  #match[data-tab="teams"] .tmq { display: flex; }
  #match.keyopen .tmq { background: var(--raised); box-shadow: inset 0 0 0 2px var(--accent); }
  #match .tmtabs .seg { margin-right: 6px; }
  #match[data-tab="heats"] .tmtabs .seg { margin-right: 0; }
  #match .gpcol h3 { display: none; }
  #match .gpcols { display: block; }
  #match .tmkey { display: none; margin: 0 0 6px; font-size: 12px; line-height: 1.3; }
  #match.keyopen .tmkey { display: block; }
  /* the scorecards: slim rows, a small header, no second score bug (the scoreboard above says it) */
  #match .tmteams { gap: 8px; }
  #match .bc.bc-cards { padding: 0; gap: 8px; }
  #match .bc.bc-cards > .bc-bug { display: none; }
  #match .bc .bc-th { gap: 8px; margin-bottom: 2px; padding-right: 4px; }
  #match .bc .bc-crest svg, #match .bc .bc-crest img { height: 26px; width: auto; }
  #match .bc .bc-tn { font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #match .bc .bc-ts { font-size: 13px; }
  #match .bc.bc-team { gap: 2px; }
  #match .bc .bc-srow { min-height: 32px; gap: 6px; padding-right: 8px; }
  #match .bc .bc-srow .bc-no { font-size: 17px; width: 22px; }
  #match .bc .bc-sname { font-size: 17px; }
  #match .bc .bc-rides { font-size: 15px; }
  #match .bc .bc-spts { font-size: 19px; min-width: 38px; }
  #match .bc .bc-total { margin-top: 2px; padding: 2px 12px; font-size: 19px; }
  #match .bc .bc-flag, #match .bc .bc-srow .gfl { font-size: 15px; }
  /* the heats */
  #match .gpprog { gap: 2px; }
  #match .gpprog li { padding: 5px 8px; }
  #match .gpprog .hh { gap: 6px; }
  #match .gpprog .hh b { font-size: 15px; line-height: 1.05; }
  #match .gpprog .hh small { font-size: 12px; }
  #match .tmheats .hh .hs { font-size: 17px; }
  #match .gpprog .pickline { font-size: 12px; line-height: 1.2; margin-top: 1px; }
  #match .gpprog .gr { gap: 0 10px; margin-top: 2px; }
  #match .gpprog .gc { font-size: 14px; line-height: 15px; gap: 3px; }
  #match .gpprog .gc .no { font-size: 13px; }
  #match .gpprog .gc .hd { width: 8px; height: 8px; }
  #match .gpprog li.brk { padding-block: 0; font-size: 12px; }
  /* the full-time block */
  #match .tmwin { padding: 6px 10px; font-size: 22px; }
  #match .tmfinal { gap: 6px; }
  #match .tmbest { gap: 4px; }
  #match .tmb { padding: 6px 8px; gap: 6px; }
  #match .tmb .crest svg, #match .tmb .crest img { height: 26px; width: auto; }
  #match .fit .gpact .big, #match .gpact .big { padding-block: 6px; }
}
@media (max-width: 620px) and (max-height: 720px) {
  #match .gpnext { padding: 6px 8px; gap: 4px; }
  #match.panel .card.fit { gap: 4px; }
  #match .tmside small { display: none; }
  #match .gprow { gap: 2px; }
  #match .gprow li { min-height: 28px; }
  #match .gpnext .hh b { font-size: 17px; }
  #match .mthead .hint { display: none; }
  #match .tmscore { padding-block: 4px; }
  #match .tmnum b { font-size: 32px; }
  #match .fit .gpact .big, #match .gpact .big { min-height: 48px; }
}
/* ---- league season: the page and the hub (the season hub's look; club colours only in crests and thin accents) ---- */
.lghead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lgcrest { display: flex; flex: none; }
#league .card { gap: 12px; }
#league .card.wide { width: min(980px, 100%); }
#lgState { font-size: 19px; }
#lgNote[hidden], .lgsim[hidden], .lgchoice[hidden] { display: none; }
.lgsim { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--surface); font: italic 700 17px/1.2 var(--display); text-transform: uppercase; }
.lgsim .bar { height: 6px; background: var(--raised); overflow: hidden; }
.lgsim .bar i { display: block; height: 100%; width: 0; background: var(--accent); }
/* league news (hub, after a round) and the preview of your match (match panel): a small card of short lines, a marker shape per group
   (you: accent square, hot: ink triangle, table: muted bar, out: red cross, tie/meeting: muted diamond). On a phone the list is folded to
   its first two lines (.fold) and the More toggle unfolds the rest in place; from 621 px every line shows. */
.lgnews[hidden], .lgmore[hidden] { display: none; }
.lgnews { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--surface); }
.lgnh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lgnt { margin: 0; font: italic 700 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lgmore { display: none; }
.lgnl { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lgnl li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; align-items: start; font: 500 15px/1.3 Barlow, system-ui, sans-serif; }
.lgnl .mk { width: 10px; height: 10px; margin-top: 5px; background: var(--ink); }
.lgnl .mk[data-g="you"] { background: var(--accent); }
.lgnl .mk[data-g="hot"] { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.lgnl .mk[data-g="table"] { height: 4px; margin-top: 8px; background: var(--muted); }
.lgnl .mk[data-g="out"] { background: var(--danger); clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
.lgnl .mk[data-g="tie"] { background: var(--muted); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); } /* a diamond: an outlined square read as a checkbox */
.lgnl .gfl { display: inline; width: auto; font-size: inherit; }
@media (max-width: 620px) {
  .lgnews { gap: 2px; padding: 6px 10px; }
  .lgnh { min-height: 20px; }
  .lgnt { font-size: 13px; }
  .lgmore { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -12px -6px -12px 0; padding: 0 8px; font: italic 800 14px/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
  .lgmore[hidden] { display: none; }
  .lgnl { gap: 3px; }
  .lgnl li { gap: 6px; font-size: 13px; line-height: 1.2; }
  .lgnl .mk { margin-top: 3px; }
  .lgnl .mk[data-g="table"] { margin-top: 6px; }
  .lgnews.fold .lgnl li:nth-child(n+3) { display: none; }
  .lgnews.fold .lgnl .tx { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .lgnews:not(.fold) .lgnl { max-height: 32vh; overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 620px) and (min-height: 721px) { .lgnews[data-n="2"] .lgmore { display: none; } } /* two lines both show: nothing to unfold */
@media (max-width: 620px) and (max-height: 720px) { .lgnews.fold .lgnl li:nth-child(n+2) { display: none; } } /* a short phone (SE): one line, More for the rest */
@media (max-width: 620px) { #match.pv .fill { min-height: 72px; } }
.lgchoice { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); }
.lgchoice h3 { margin: 0; font: italic 700 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lgopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lgopt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding: 8px 10px; text-align: left; cursor: pointer;
  border: 0; border-top: 4px solid transparent; border-radius: 0; color: inherit; font: italic 700 17px/1.15 var(--display); text-transform: uppercase;
  background: linear-gradient(90deg, var(--team, var(--line)) 50%, var(--team2, var(--team, var(--line))) 50%) top / 100% 4px no-repeat border-box, var(--raised);
}
.lgopt.def { outline: 2px solid var(--ink); outline-offset: -2px; }
.lgopt .tagbest { flex: none; font: italic 800 13px/1.5 var(--display); letter-spacing: 0.04em; text-transform: uppercase; padding: 0 7px; border-radius: 2px; background: #e8a317; color: #1d1400; }
@media (max-width: 620px) { .lgopts { grid-template-columns: minmax(0, 1fr); } }
.lgcols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.lgcols .gpcol { container-type: inline-size; }
#segLgTabW { display: none; }
@media (max-width: 899px) {
  #league[data-tab="table"] :is(#lgColFixtures, #lgColRiders, #lgColPlayoff),
  #league[data-tab="fixtures"] :is(#lgColTable, #lgColRiders, #lgColPlayoff),
  #league[data-tab="riders"] :is(#lgColTable, #lgColFixtures, #lgColPlayoff),
  #league[data-tab="playoff"] :is(#lgColTable, #lgColFixtures, #lgColRiders) { display: none; }
}
@media (min-width: 900px) {
  #segLgTab { display: none; }
  #segLgTabW { display: flex; }
  .lgcols { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr); }
  #lgColTable { grid-column: 1; grid-row: 1; }
  #lgColFixtures, #lgColRiders, #lgColPlayoff { grid-column: 2; grid-row: 1; }
  #league[data-tab="table"] :is(#lgColRiders, #lgColPlayoff),
  #league[data-tab="fixtures"] :is(#lgColRiders, #lgColPlayoff),
  #league[data-tab="riders"] :is(#lgColFixtures, #lgColPlayoff),
  #league[data-tab="playoff"] :is(#lgColFixtures, #lgColRiders) { display: none; }
}
/* the table and the riders: columns that do not fit a phone appear when the column is wide enough */
.gpt.lgt li { grid-template-columns: 28px minmax(0, 1fr) 26px 40px 46px; column-gap: 6px; }
.gpt.lgr li { grid-template-columns: 26px minmax(0, 1fr) 28px 52px 70px; column-gap: 6px; }
.lgt .x, .lgt .x2, .lgr .x, .lgr .x2 { text-align: center; font: italic 700 16px/1 var(--display); color: var(--muted); }
.lgt li.hdr .x, .lgt li.hdr .x2, .lgr li.hdr .x, .lgr li.hdr .x2 { font-size: 14px; }
.lgt .x2, .lgr .x2 { display: none; }
@container (min-width: 400px) {
  .gpt.lgt li { grid-template-columns: 28px minmax(0, 1fr) 26px 26px 26px 26px 40px 32px 46px; }
  .gpt.lgr li { grid-template-columns: 26px minmax(0, 1fr) 30px 28px 52px 70px; }
  .lgt .x2, .lgr .x2 { display: block; }
}
.lgr .v { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; }
.lgr .v small { font: 500 12px/1 Barlow, system-ui, sans-serif; color: var(--muted); }
.lgr li.hdr .v { font-size: 14px; }
.gcl { display: flex; align-items: center; gap: 4px; }
.lgr li.div { display: block; padding: 8px 4px 2px; background: none; color: var(--muted); font: italic 700 14px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.medal { flex: none; width: 10px; height: 10px; margin-left: 2px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.medal.gold { background: #d4a514; } .medal.silver { background: #a9b0b8; } .medal.bronze { background: #b0703a; }
.pod .crest { margin: 0 auto; }
/* the fixtures: a round unfolds into its four matches */
.lgfix .rnd:not(.done):not(.cur) { opacity: 1; }
.lgfix .rnd.tbd { opacity: 0.6; }
.lgfix .rtop .gnm b { font-size: 17px; }
.lgm { margin: 0; padding: 0 8px 8px; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.lgx { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 5px 6px; border-left: 4px solid transparent; background-color: var(--raised); font: italic 700 16px/1.15 var(--display); text-transform: uppercase; }
.lgx.mine { font-weight: 800; outline: 2px solid var(--ink); outline-offset: -2px; }
.lgh { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lgh.away { flex-direction: row-reverse; text-align: right; }
.lgh .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lgs { min-width: 3.8em; text-align: center; font: italic 800 19px/1 var(--display); font-variant-numeric: tabular-nums; }
.lgx:not(.done) .lgs { color: var(--muted); font-weight: 700; }
/* the play-off bracket */
.lgbracket h4 { margin: 12px 0 2px; font: italic 700 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lgbracket .hint { font-size: 13px; margin: 0 0 6px; }
.lgties { display: flex; flex-direction: column; gap: 8px; }
.lgtie { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--surface); }
.lgtie.mine { outline: 2px solid var(--ink); outline-offset: -2px; }
.lgtie.tbd { opacity: 0.6; }
.lgth { display: flex; align-items: baseline; gap: 8px; }
.lgth b { font: italic 800 20px/1.1 var(--display); text-transform: uppercase; }
.lgth small { margin-left: auto; color: var(--muted); font-size: 13px; }
.lgtr { display: grid; grid-template-columns: minmax(0, 1fr) 46px 46px 32px; align-items: center; column-gap: 6px; padding: 5px 6px; background-color: var(--raised); font-variant-numeric: tabular-nums; }
.lgtr.hdr { padding-block: 0; background: none; border-left-color: transparent; background-image: none; color: var(--muted); font: italic 700 14px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.05em; }
.lgtr .g { text-align: center; font: italic 800 19px/1 var(--display); }
.lgtr .gpw b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 700 17px/1.1 var(--display); text-transform: uppercase; }
.lgtr .gpw small { color: var(--muted); font-size: 13px; }
.lgtr.win .gpw b, .lgtr.win .mp { font-weight: 800; }
.lgtr.me { outline: 2px solid var(--ink); outline-offset: -2px; }

@media (prefers-reduced-motion: no-preference) {
  .tmno { transition: background-color 0.2s, box-shadow 0.2s, scale 0.12s; }
  .chip.club { transition: color 0.25s, background-color 0.25s, box-shadow 0.25s, scale 0.12s; }
  .lgsim .bar i { transition: width 0.25s; }
}

/* ---- install: the steps page and the home nudge (public/js/install.js decides what shows) ---- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 10px 14px; background: var(--surface); border-left: 6px solid var(--line); }
.steps li:first-child { border-left-color: var(--accent); }
.steps .ico { position: relative; flex: none; width: 48px; height: 48px; display: grid; place-items: center; background: var(--raised); }
.steps .ico svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps b { display: block; font: italic 800 21px/1.05 var(--display); text-transform: uppercase; }
.steps small { display: block; color: var(--muted); font-size: 15px; line-height: 1.3; }
.nudge { display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 12px; background: var(--surface); border-left: 6px solid var(--accent); font-size: 14px; }
.nudge > svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.nudge span { flex: 1; color: var(--ink); }
.nudge .link { min-height: 44px; padding: 0 8px; }
@media (prefers-reduced-motion: no-preference) {
  .steps li:first-child .ico::after { content: ''; position: absolute; inset: 0; border: 3px solid var(--accent); animation: ping 1.4s ease-out infinite; }
  @keyframes ping { from { transform: scale(0.85); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
}

/* ---- states: keyboard focus, hover and press on every kind of button ---- */
.big:focus-visible, .tile:focus-visible, .pill:focus-visible, .link:focus-visible, .offer:focus-visible, .rtop:focus-visible,
.mrow:focus-visible, #pauseBtn:focus-visible, #skipBtn:focus-visible, .seg button:focus-visible, .tmno:focus-visible, .lgopt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a slanted accent button clips its own outline: the ring is drawn inside, in ground */
.big.primary:focus-visible, .pill.primary:focus-visible { outline: 3px solid var(--ground); outline-offset: -7px; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rtop:focus-visible, .tmno:focus-visible { outline-offset: -2px; }
.pill:not(:disabled):active, .offer:not(:disabled):active, .mrow:not(:disabled):active, .tile:not(:disabled):active, .tmno:active, .chip.club:active, .lgopt:active { scale: 0.97; }
.pill:disabled { scale: 1; }
.offer, .mrow { transition: scale 0.12s, background-color 0.2s; }
@media (hover: hover) {
  .pill:not(:disabled):not(.primary):hover, .offer:hover, .mrow:hover, button.rtop:hover { background-color: var(--raised); }
  .pill.primary:not(:disabled):hover { background: var(--accent-hi); }
  .shopbtns .pill:not(:disabled):hover { background-color: var(--line); }
  .tmno[aria-checked="false"]:hover, .chip.club[aria-checked="false"]:hover, .chip[aria-checked="false"]:hover, .lgopt:hover { background-color: var(--hover); }
}

/* motion off: the stylesheet's transitions finish at once (the spinner keeps turning) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* === Polish (html[lang="pl"]) ===
   Polish words are longer than the English ones and the labels are Barlow Condensed italic caps.
   Keep a label on its line with a touch less letter-spacing; where it still does not fit, the
   tiles and buttons take a second line (their heights are minimums) and a long word breaks
   rather than overflows; running text hyphenates. Only rules that are needed. */
html[lang="pl"] :is(.big, .link, .pill, .seg button, .lbl, .field, .setrow, .status, .forecast, #skipBtn, .hh b, .hh .now, .gprow li, .rlist li, .tmno b, .chip .nm, .gpt li.hdr) { letter-spacing: 0.01em; }
html[lang="pl"] :is(.big span, .big small, .tile b, .seg button, .link, .pill, .lbl, .field > span, .setrow > span, .status, .forecast, .hh b, .gpt li.hdr, .rtop .gnm, .bc .bc-title, .bc .bc-kick, #callBox, #outTxt) { overflow-wrap: anywhere; }
html[lang="pl"] :is(.hint, .rules li, .big small, .setrow .sub, .snnote, .steps small) { hyphens: auto; overflow-wrap: break-word; }
html[lang="pl"] .tile b { font-size: clamp(18px, 5.8vw, 24px); line-height: 1.02; letter-spacing: 0; }
html[lang="pl"] .seg button { padding-inline: 1px; font-size: 16px; }
html[lang="pl"] .hchip { letter-spacing: 0.02em; }
html[lang="pl"] .bc .bc-chip { letter-spacing: 0; }

/* === broadcast (K3) === */
/* Score graphics like on TV (public/js/broadcast.js builds the markup, main.js and match.js place it). Direction D:
   near-black grounds, Barlow Condensed ExtraBold Italic, an orange accent for frames, points and buttons;
   helmet and club colours only mark riders and teams. Every selector sits under .bc; #hud gets the class
   while a Grand Prix or match heat runs. */
.bc {
  --bc-ground: #0e0f12; --bc-surface: #17191f; --bc-raised: #20232b;
  --bc-ink: #f4f4f0; --bc-muted: #a2a8b4; --bc-accent: #ff7a2e; --bc-accent-ink: #0e0f12;
  --bc-font: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}
.bc[hidden] { display: none !important; }
.bc.bc-layer, .bc.bc-card, .bc.bc-team, .bc.bc-cards, .bc.bc-bugwrap, .bc.bc-resbox { font-family: var(--bc-font); font-style: italic; font-weight: 800; color: var(--bc-ink); }

/* the pieces */
.bc .bc-rows, .bc .bc-srows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bc .bc-rows { gap: 8px; }
.bc .bc-row { display: flex; align-items: center; gap: 10px; min-height: 62px; padding-right: 10px; background: var(--bc-surface); }
.bc .bc-row.you { background: var(--bc-raised); box-shadow: inset 0 0 0 2px var(--bc-accent); }
.bc .bc-bar { width: 8px; align-self: stretch; flex: none; background: var(--bar, var(--bc-muted)); }
.bc .bc-gate, .bc .bc-pos { font-size: 26px; width: 22px; text-align: center; flex: none; }
.bc .bc-hair { width: 2px; height: 44px; flex: none; background: var(--bc-accent); transform: skewX(-20deg); }
.bc .bc-row .bc-no { font-size: 22px; width: 28px; flex: none; color: var(--bc-muted); text-align: center; }
.bc .bc-flag { font-size: 20px; line-height: 1; flex: none; font-style: normal; }
.bc .bc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1; }
.bc .bc-first { font-weight: 500; font-size: 16px; color: var(--bc-muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc .bc-fl { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.bc .bc-fl .bc-first { min-width: 0; }
.bc .bc-sofar { flex: none; font-weight: 600; font-size: 15px; color: var(--bc-muted); white-space: nowrap; }
.bc .bc-sofar b { font-weight: 800; color: var(--bc-ink); }
.bc .bc-last { font-weight: 800; font-size: 26px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc .bc-tag { flex: none; background: var(--tc); color: var(--ti); font-size: 15px; padding: 3px 6px; }

/* the title plate */
.bc .bc-plate { align-self: center; width: max-content; max-width: 100%; box-sizing: border-box; margin: 0 auto 14px; padding: 10px 26px 12px; background: var(--bc-ink); color: var(--bc-ground); transform: rotate(-2deg); display: flex; flex-direction: column; align-items: center; clip-path: polygon(3% 0, 100% 6%, 97% 100%, 0 94%); }
.bc .bc-kick { font-size: 22px; line-height: 1; text-transform: uppercase; }
.bc .bc-title { font-size: 50px; line-height: 1; text-transform: uppercase; }
.bc .bc-chip { background: var(--bc-ground); color: var(--bc-accent); font-weight: 700; font-size: 16px; padding: 2px 10px; text-transform: uppercase; }
.bc.bc-resbox .bc-title { font-size: 44px; }
/* the stake board under the plate (what the heat is for): ink on the accent, slanted like the plate, one line each */
.bc .bc-stake { align-self: center; max-width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: -4px 0 12px; }
.bc .bc-stk { max-width: 100%; box-sizing: border-box; background: var(--bc-accent); color: var(--bc-accent-ink); font-size: 20px; line-height: 1.05; padding: 4px 22px 5px; text-transform: uppercase; text-align: center; overflow-wrap: anywhere; clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); }

/* the score bug */
.bc .bc-bug { display: flex; align-items: stretch; height: 40px; }
.bc .bc-bug.lg { height: 46px; }
.bc .bc-bt { display: flex; }
.bc .bc-bt .bc-tag { display: flex; align-items: center; padding: 0 8px; font-size: 16px; }
.bc .bc-bt .bc-tag svg, .bc .bc-bt .bc-tag img { display: block; height: 26px; width: auto; }
.bc .bc-bug.lg .bc-bt .bc-tag { padding: 0 12px; font-size: 18px; }
.bc .bc-bs { display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--bc-ground); font-size: 24px; }
.bc .bc-bug.lg .bc-bs { gap: 10px; padding: 0 14px; font-size: 32px; background: var(--bc-surface); }
.bc .bc-sep { width: 3px; height: 20px; background: var(--bc-accent); }
.bc .bc-bug.lg .bc-sep { width: 4px; height: 28px; }
.bc .bc-bl { display: flex; align-items: center; padding: 0 10px; background: var(--bc-accent); color: var(--bc-accent-ink); font-size: 18px; text-transform: uppercase; }
.bc .bc-bug.lg .bc-bl { font-size: 22px; padding: 0 14px; }
.bc .bc-bl + .bc-bs { background: var(--bc-ground); }
/* in the race HUD the place block is the one accent: the Grand Prix heat label beside it is quiet */
#hud .bc .bc-bl { background: var(--bc-raised); color: var(--bc-ink); }
.bc .bc-bs small { font-size: 14px; color: var(--bc-accent); margin-left: 2px; }

/* the heat line-up over the track */
.bc.bc-layer { position: absolute; z-index: 4; left: var(--inset-l); right: var(--inset-r); top: calc(var(--inset-t) + 56px); display: flex; justify-content: center; pointer-events: none; }
.bc.bc-card { display: flex; flex-direction: column; width: min(100%, 440px); box-sizing: border-box; padding: 14px 12px; background: rgba(14, 15, 18, 0.9); }
.bc .bc-top { display: flex; justify-content: center; margin-bottom: 12px; }

/* the heat result */
.bc.bc-resbox .bc-card { width: 100%; background: var(--bc-ground); }
.bc .bc-ptshead { align-self: flex-end; font-size: 16px; color: var(--bc-muted); padding-right: 12px; margin-bottom: 4px; }
.bc .bc-row.res { min-height: 64px; }
.bc .bc-row.res .bc-first { white-space: normal; }
.bc .bc-pts { width: 58px; align-self: stretch; flex: none; background: var(--bc-accent); color: var(--bc-accent-ink); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.bc .bc-pts sup { font-size: 15px; }
.bc .bc-row.out { opacity: 0.75; }
.bc .bc-row.out .bc-pts { background: var(--bc-raised); color: var(--bc-muted); }
.bc .bc-teams { display: flex; height: 76px; margin-top: 12px; }
.bc .bc-tb { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; background: var(--tc); color: var(--ti); clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.bc .bc-tb.away { clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%); }
.bc .bc-tb span { font-size: 22px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc .bc-tb b { font-size: 52px; line-height: 1; }
.bc .bc-foot { align-self: center; display: flex; align-items: center; gap: 12px; margin-top: 10px; background: var(--bc-surface); padding: 6px 12px; }
.bc .bc-cap { font-size: 15px; color: var(--bc-muted); }
.bc .bc-foot.bare { background: none; padding: 0; } /* the match score under a heat result: the bug alone */
.bc .bc-ev { font-size: 24px; text-transform: uppercase; }

/* a team's scorecard */
.bc.bc-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 12px; background: var(--bc-ground); }
.bc.bc-cards > .bc-bug { justify-self: center; }
.bc.bc-team { display: flex; flex-direction: column; gap: 4px; }
.bc .bc-th { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bc .bc-crest { display: inline-flex; flex: none; }
.bc .bc-tn { flex: 1; min-width: 0; font-size: 36px; line-height: 1; text-transform: uppercase; border-bottom: 3px solid var(--tc); padding-bottom: 2px; }
.bc .bc-ts { flex: none; font-weight: 700; font-size: 16px; color: var(--bc-muted); text-transform: uppercase; }
.bc .bc-srow { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 10px 0 4px; background: var(--bc-surface); }
.bc .bc-srow.you { background: var(--bc-raised); box-shadow: inset 4px 0 0 var(--bc-accent); }
.bc .bc-srow.idle { opacity: 0.6; }
.bc .bc-srow .bc-no { font-size: 20px; width: 26px; flex: none; text-align: center; color: var(--bc-accent); }
.bc .bc-sname { flex: 1; min-width: 0; font-size: 20px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc .bc-sname .bc-first { font-size: inherit; color: inherit; display: inline; }
.bc .bc-sname .bc-last { font-size: inherit; display: inline; }
.bc .bc-rides { font-weight: 600; font-size: 17px; color: var(--bc-muted); white-space: nowrap; }
.bc .bc-rd.tr { text-decoration: underline dotted; text-underline-offset: 3px; }
.bc .bc-rd.out { opacity: 0.8; text-transform: lowercase; }
.bc .bc-spts { min-width: 44px; text-align: right; font-size: 22px; color: var(--bc-accent); }
.bc .bc-spts sup { font-size: 12px; }
.bc .bc-total { align-self: flex-end; margin-top: 4px; padding: 6px 16px; background: var(--bc-surface); font-size: 24px; border-right: 6px solid var(--bc-accent); }
@media (min-width: 621px) {
  .bc.bc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .bc.bc-cards > .bc-bug { grid-column: 1 / -1; }
}

/* the live HUD of a Grand Prix or match heat: the score bug (bcBug) sits beside the place and lap bug, the HUD section above does the rest */
.bc.bc-bugwrap { display: flex; flex: none; }

/* a phone on its side: the line-up shrinks to two columns */
@media (max-height: 520px) {
  .bc.bc-layer { top: calc(var(--inset-t) + 48px); }
  .bc.bc-card { width: min(100%, 640px); padding: 8px; }
  .bc.bc-layer .bc-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .bc.bc-layer .bc-row { min-height: 48px; }
  .bc.bc-layer .bc-hair { height: 34px; }
  .bc.bc-layer .bc-last { font-size: 21px; }
  .bc.bc-layer .bc-plate { margin-bottom: 8px; padding: 4px 18px 6px; }
  .bc.bc-layer .bc-title { font-size: 30px; }
  .bc.bc-layer .bc-kick { font-size: 16px; }
  .bc.bc-layer .bc-top { margin-bottom: 6px; }
  .bc.bc-layer .bc-stake { margin-bottom: 8px; flex-direction: row; justify-content: center; flex-wrap: wrap; }
  .bc.bc-layer .bc-stk { font-size: 16px; padding: 2px 16px 3px; }
}

/* the stake board on a phone: smaller, so the longest Polish line stays on one row and the To the tapes button stays on a 375 x 667 screen */
@media (max-width: 620px) and (min-height: 521px) {
  .bc .bc-stake { gap: 3px; margin: -4px 0 8px; }
  .bc .bc-stk { font-size: 17px; padding: 3px 14px 4px; }
}

/* the heat result on a phone: a match heat fits 390 x 844 without scrolling and Continue stays in view on 375 x 667 (the card of
   rows is then the one scrolling area, the buttons sit in one row at the bottom) */
.resact { display: contents; }
@media (max-width: 620px) {
  #result .card { max-height: calc(100svh - var(--inset-t) - var(--inset-b)); padding: 12px; gap: 8px; }
  #result #bcResult { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
  #result #bcResult::-webkit-scrollbar { display: none; }
  #result .card > * { flex-shrink: 0; }
  #result .card > #bcResult { flex-shrink: 1; }
  .bc.bc-resbox .bc-card { padding: 4px 0 0; }
  .bc.bc-resbox .bc-plate { margin-bottom: 8px; padding: 4px 20px 6px; }
  .bc.bc-resbox .bc-kick { font-size: 14px; }
  .bc.bc-resbox .bc-title { font-size: 30px; }
  .bc.bc-resbox .bc-chip { font-size: 14px; padding: 1px 8px; }
  .bc.bc-resbox .bc-ptshead { font-size: 13px; margin-bottom: 2px; padding-right: 8px; }
  .bc.bc-resbox .bc-rows { gap: 5px; }
  .bc.bc-resbox .bc-row.res { min-height: 48px; gap: 8px; padding-right: 8px; }
  .bc.bc-resbox .bc-hair { height: 30px; }
  .bc.bc-resbox .bc-pos { font-size: 22px; }
  .bc.bc-resbox .bc-first { font-size: 13px; white-space: nowrap; }
  .bc.bc-resbox .bc-last { font-size: 22px; }
  .bc.bc-resbox .bc-pts { width: 46px; font-size: 28px; }
  .bc.bc-resbox .bc-teams { height: 50px; margin-top: 8px; }
  .bc.bc-resbox .bc-tb { padding: 0 12px; }
  .bc.bc-resbox .bc-tb span { font-size: 17px; }
  .bc.bc-resbox .bc-tb b { font-size: 34px; }
  .bc.bc-resbox .bc-foot { margin-top: 6px; padding: 3px 10px; gap: 8px; }
  .bc.bc-resbox .bc-ev { font-size: 18px; }
  .bc.bc-resbox .bc-bug.lg { height: 38px; }
  .bc.bc-resbox .bc-bug.lg .bc-bs { font-size: 26px; padding: 0 10px; }
  #resNote { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #resTrack { font-size: 12px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .resact { display: flex; gap: 8px; }
  .resact .big { min-height: 52px; }
  #btnAgain { flex: 1; min-width: 0; }
  #btnMenu { flex: none; width: auto; padding-inline: 20px; }
}

/* the rematch under the result of an online heat: one scrolling row of chips (Random track first, then the tracks) and who is ready */
#rematch { display: flex; flex-direction: column; gap: 6px; }
#rematch[hidden] { display: none; }
#rematch .chip { min-width: 0; flex-direction: row; gap: 6px; padding: 9px 12px; align-items: center; }
#rematch .chip svg { display: none; }
#rematch .chip small { display: none; }
#rematch .chip .nm { font-size: 15px; }
#rematch .hint { min-height: 2.6em; font-size: 13px; line-height: 1.3; }
@media (max-width: 620px) {
  #result .card > #rematch { gap: 4px; }
  #rematch .hint { min-height: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* motion: the rows slide in 40 ms apart, the plate drops in */
@media (prefers-reduced-motion: no-preference) {
  @keyframes bc-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
  @keyframes bc-plate { from { opacity: 0; transform: rotate(-2deg) scale(0.9); } to { opacity: 1; transform: rotate(-2deg); } }
  @keyframes bc-fade { from { opacity: 0; } to { opacity: 1; } }
  .bc .bc-row { animation: bc-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
  .bc .bc-plate { animation: bc-plate 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  /* the result card is one 150 ms fade, no stagger (the line-up before the heat keeps its) */
  .bc.bc-resbox .bc-row, .bc.bc-resbox .bc-plate { animation: none; }
  .bc.bc-resbox .bc-card { animation: bc-fade 0.15s ease-out both; }
}

/* the line-up waits for your tap: the card takes taps, a Go button under the riders */
.bc.bc-layer.hold { pointer-events: auto; }
.bc.bc-layer .bc-go { margin: 12px auto 0; align-self: center; width: min(100%, 420px); pointer-events: auto; display: flex; align-items: center; justify-content: center; }
.bc.bc-layer.hold { flex-direction: column; align-items: center; }
/* === account (K2) === */
/* The onboarding / profile page (#pgOnboard, built by public/js/account.js) and the Settings account row.
   The live "on the heat card" preview is a real broadcast row (.bc, see the broadcast section), only
   its plate and its entrance animation are switched off here. */
.onb .onbstep { font: italic 700 16px/1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.onb .onbform, .onb .onbpart { display: flex; flex-direction: column; gap: 14px; }
.onb .onbpart[hidden] { display: none; }
.onb .field input[aria-invalid="true"], .onb .field select[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 0; }
.onb .onbcard { padding: 0; background: none; }
.onb .onbcard .bc-card { width: 100%; padding: 0; background: none; }
.onb .onbcard .bc-plate, .onb .onbcard .bc-top { display: none; }
.onb .onbcard .bc-row { animation: none; }
.onb .onbcard.ph .bc-who { opacity: 0.45; }
.onb .onbalt { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.onb .onbalt .link, .onb #btnOnbBack { align-self: center; }
.onb #btnOnbSignIn { color: var(--ink); }
.acctbtns { display: flex; flex-wrap: wrap; gap: 8px; }
/* on a computer the passkey usually lives on the phone: say how to reach it */
.onb .onbdesk { display: none; max-width: 32ch; text-align: center; }
@media (hover: hover) and (pointer: fine) { .onb .onbdesk { display: block; } }

/* === invitations (web push) === */
/* The quiet row at the bottom of Online and the unfolding list of recent riders in a lobby (push.js). */
.pushrow { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pushrow .hint { margin: 0; text-align: center; max-width: 34ch; }
.invbox { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.invbox > .hint { margin: 0; text-align: center; }
.invbox .riders li { padding: 4px 4px 4px 12px; min-height: 44px; }
.invbox .riders li.dim { opacity: 0.55; padding-block: 10px; }
.invbox .riders li .link { margin-left: auto; color: var(--accent); min-height: 44px; padding: 0 10px; }
.invbox .riders li .link:disabled { color: var(--muted); cursor: default; }
