/* Both files below are variable fonts covering their whole weight range in one download — same
   files/approach as faq/css/fonts.css. Inter's file is referenced by all three weights this app
   uses (400/600/700) and Space Grotesk's by both of its (500/700); the browser resolves each
   declared font-weight to the matching instance on the variable axis, so this is only two actual
   font-file downloads even though there are five @font-face blocks. Previously five separate
   static-weight files (~104KB total) — down to inter-var.woff2 + space-grotesk-var.woff2
   (~70KB total, and 3 fewer requests) for the exact same rendered weights. */
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/inter-var.woff2') format('woff2')}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/inter-var.woff2') format('woff2')}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/inter-var.woff2') format('woff2')}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/space-grotesk-var.woff2') format('woff2')}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/space-grotesk-var.woff2') format('woff2')}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root,[data-theme="dark"]{
  --bg-primary:#000;--bg-card:#0d0d0d;--bg-card-alt:#141414;--bg-input:#1c1c1c;--bg-hover:#242424;
  --border:#2e2e2e;--border-light:#404040;--border-strong:#5c5c5c;
  /* The boundary of anything INTERACTIVE — inputs, buttons, wager/bonus/result chips, the team
     checkboxes. WCAG 1.4.11 wants 3:1 for "visual information required to identify user interface
     components", and for these the boundary IS that information: an unselected wager button is
     --btn-used-bg on a --bg-card-alt row, i.e. the same colour as what it sits on, so nothing but
     its edge says a control is there at all. --border/--border-light manage 1.1-2.0:1 against the
     surfaces they are drawn on, so every one of them fell short.
     #6f6f6f is the lightest neutral that still clears 3:1 against every dark surface a control
     can sit on, from --bg-primary (#000, 4.18:1) through --bg-hover (#242424, 3.09:1) and the
     Beer Round wash (3.08:1) — chosen at the boundary rather than brighter so controls gain a
     legible edge without the UI turning into a wireframe.
     Deliberately NOT applied to decorative container edges (.section, .aud-round, table rules,
     the audit modal): those are not UI components, 1.4.11 does not cover them, and pushing them
     all this bright would change the look of the app far more than it would help anyone. */
  --border-control:#6f6f6f;--text-primary:#fff;--text-secondary:#ccc;--text-muted:#aeaeae;
  --accent-cyan:#00ffff;--accent-magenta:#ff44aa;--accent-gold:#ffee00;--accent-green:#44ff44;
  --accent-red:#ff4444;--accent-orange:#ffaa00;--shadow:0 4px 24px rgba(0,0,0,.8);--shadow-lg:0 16px 48px rgba(0,0,0,.85),0 2px 10px rgba(0,0,0,.7);
  /* Shared "edge fade" used by every scroll-boundary depth cue that should read at one intensity:
     the mobile Settings panel's pinned head/foot, the mobile scores sheet (.col-right.open) and
     its dock, and the top/bottom of the scrolling scores list. Pale in dark (glow against near
     black), darker + slightly stronger in light. Tuned down from an earlier louder pass. */
  --edge-fade:rgba(255,255,255,.24);
  --row-stripe:rgba(255,255,255,.055);--radius:8px;--radius-lg:12px;
  --font-display:'Space Grotesk',sans-serif;--font-body:'Inter',sans-serif;
  --transition:.18s ease;--row-pad:8px;--wager-size:2.6rem;--cp-sq-size:5rem;
  --btn-idle-bg:#1c1c1c;--btn-correct-bg:#0d2e0d;--btn-incorrect-bg:#2e0d0d;--btn-used-bg:#141414;
  /* Correct-badge square (.wager-badge.bg-correct, app.js's CORRECT_BADGE_SVG) — opaque and
     theme-independent (same value for dark and light, no override in the light block below)
     since the badge floats over whatever wager-button color is underneath and needs to read as
     its own solid chip either way, not blend into a per-theme wash the way --btn-correct-bg does.
     #0c7a0c is the exact hex already used as --pts-pos-bg in light — reused here rather than
     inventing a new green — and white on it clears ~5.5:1 (AA). #0067c5 is likewise light's
     existing cb1 --pts-pos-bg; white clears ~5.6:1. Tritanopia (cb2) doesn't change green per the
     COLOR VISION MODES rule below, so there's no cb2 override — only [data-cb="1"] further down. */
  --correct-badge-bg:#0c7a0c;--correct-badge-fg:#fff;
  --pts-pos-bg:rgba(68,255,68,.25);--pts-pos-border:rgba(68,255,68,.55);--pts-pos-fg:#8dff8d;
  --pts-neg-bg:rgba(255,68,68,.25);--pts-neg-border:rgba(255,68,68,.6);--pts-neg-fg:#ffa3a3;
  --pts-nil-bg:rgba(255,255,255,.06);--pts-nil-border:rgba(255,255,255,.12);
  --on-accent-cyan:#000;--on-accent-gold:#000;--on-badge:#000;
  /* Each of these is BOTH the chip's own text colour (against --bg-input) and, once ticked, the
     fill sitting under --check-icon-color. With white ink those two roles pull in opposite
     directions and neither pair could satisfy both: lightening the token to fix the text sinks
     white-on-fill, darkening it does the reverse. #5B84A8 failed both at once (4.31 text, 3.95
     under white); #B4552F failed the text role at 3.47.
     Fixed by flipping the ticked ink to black rather than by splitting either token in two —
     that is the same resolution blue-yellow mode already uses, and with black ink both roles
     want the same thing (a lighter chip), so one value serves both. The colours themselves then
     only needed the smallest lift that clears AA: OKLab dE 0.068 and 0.017, hue held exactly, so
     the terracotta and slate read as the same two colours they always were. */
  --item-border:#c76c49;--item-fill-checked:#c76c49;
  --njcb-border:#6189ac;--njcb-fill-checked:#6189ac;
  /* Black, because in BOTH dark palettes the ticked chip's fill is the lighter surface — see
     above, and the brighter #ff66cc/#00cc88 pair blue-yellow swaps in. Light mode overrides this
     back to white, where the same fills are the darker surface. */
  --check-icon-color:#000;
  --badge-gold-fg:#ffee00;--badge-green-fg:#44ff44;
  /* The theme toggle's sun, as its own two-part pair rather than the shared
     --badge-gold-fg it used to borrow. That token is a TEXT colour, held to 4.5:1 on the
     darkest surface it ever renders on, and in light mode that ceiling drags it all the way
     down to #845e00 — a dark olive-brown. Correct for text, and the reason the light sun
     did not look like a sun. Splitting the disc from the rays is what buys the yellow back:
     the disc is a filled area that only has to be seen, so it can be a genuinely vivid
     yellow, while the rays and the ring drawn around the disc are the thin marks that carry
     the shape, so they take the darker, still-saturated amber and hold 3:1 on their own.
     Dark mode never actually shows this icon — the toggle carries the moon whenever the
     theme is not light — so these are the fallback that keeps the var() chain valid
     rather than a rendered appearance. */
  --sun-disc:#ffe14d;--sun-ray:#ffb300;
  /* PICTOGRAPH TINTS. The icons that replaced emoji are stroke-only and inherit currentColor,
     which is right for the UI action glyphs (Sort, Reset, Refresh, Shuffle, the check and the X)
     — those ARE the control, so they should carry the control's own audited text colour. It is
     wrong for the pictographs: a beer that renders in whatever grey or white the surrounding
     label happens to be does not read as a beer, and the emoji it replaced did carry a colour.
     These give each pictograph its emoji's hue back, as a token rather than a baked-in glyph, so
     it still follows the theme.
     Deliberately NOT swapped by colour-vision mode, and this is the one place in the app where
     that is the correct answer rather than an oversight. Every other colour here encodes
     something — which team is winning, whether an answer was right — so a mode that cannot
     distinguish two of them loses information. These encode nothing: each icon sits directly
     beside its own text label, nothing in the app asks you to tell the beer from the clover by
     hue, and remapping green would only stop the clover looking like a clover. Same exemption,
     and the same reason, as the podium metals. They still have to be SEEN, so every value below
     clears 3:1 against all five surfaces it can render on in its own theme (worst case 4.31:1
     dark, 3.29:1 light). */
  /* The vivid set is declared once, on :root only, and is NOT overridden by the light theme —
     that is deliberate. On a solid accent button both themes now render the pictograph in these
     values, because the dark rendering is the one that actually looks like the emoji: a saturated
     amber mug with cream foam, a red drum with a cream head. Light mode's own (darkened) tints
     were tuned to sit on a near-white card, and on the button they came out washed out and pale.
     --tint-* below alias these for the dark theme, so there is one source of truth per colour. */
  /* Which way the accent-button stroke is pulled, and how far. Dark mode's button is bright
     cyan, so darkening the outline separates the icon from it; light mode's is mid-dark teal, so
     the outline has to go the other way. See the note on the stroke rule further down. */
  --icon-stroke-ink:#000;--icon-stroke-mix:62%;
  --tint-sheet:#2fbf72;
  --vivid-beer:#f5b53d;--vivid-beer-2:#fff1cf;
  --vivid-drum:#e8563f;--vivid-drum-2:#ffe0b8;--vivid-drum-3:#c99a63;
  --tint-beer:var(--vivid-beer);--tint-beer-2:var(--vivid-beer-2);
  --tint-drum:var(--vivid-drum);--tint-drum-2:var(--vivid-drum-2);--tint-drum-3:var(--vivid-drum-3);
  --tint-trophy:#f5c542;--tint-trophy-2:#c9922a;
  --tint-mic:#cfd6dc;--tint-mic-2:#8b949c;
  --tint-heart:#ff5a72;
  --tint-clipboard:#c98f52;--tint-clipboard-2:#dfe3e7;
  --tint-plane:#4db8ff;--tint-plane-2:#d4efff;--tint-plane-3:#8fd0ff;
  --tint-pdf:#e0574f;
  --tint-alert:#ffaa00;--tint-alert-2:#ffd24d;
  /* Try Example's flask and Save's floppy disk (--icon-save below), plus the shuffle icon's
     decorative (non-button) copy — see the note on --tint-shuffle below. --tint-cap originally
     tinted Take the Tour's own icon too (a graduation cap, then an ℹ️) before that button moved
     to --accent-gold (see .icon-hand) for its own reasons; it kept the name since Save still
     uses it. Neither the flask nor this blue stands for a real-world colour the way the
     beer/drum/trophy do, so hue was picked to stay visually distinct from every tint already in
     the palette rather than to match anything. Both clear 3:1 against every dark surface a
     settings row can sit on (--bg-card/-alt/-input/-hover): 5.3-6.6:1 and 8.3-10.4:1. */
  --tint-flask:#b07cff;--tint-cap:#5ec8ff;--tint-theme-2:#ffee00;
  /* Same swap as ICON_CLIPBOARD's own tint (app.js): a magenta distinct from the app's team-2
     accent, picked so a decorative "shuffle" pictograph beside a text label doesn't borrow the
     control-glyph's plain currentColor. Clears 6.6-8.2:1 on every dark surface. */
  --tint-shuffle:#ff7ac9;
  /* AAA (7:1) text-safe variants of the brand accents, for use as TEXT on neutral surfaces
     (bg-card/bg-card-alt/bg-input) — kept separate from --accent-* so borders, focus rings,
     and button fills can stay at full brand saturation without dragging text below AAA. */
  --txt-cyan:#00ffff;--txt-magenta:#ff72d8;--txt-red:#ff8282;--txt-orange:#ffaa00;--txt-purple:#caa8ff;
  /* #a52c2c was too dark to read as a control against the surfaces it sits on: the Reset button
     and the incorrect badge are solid fills, and a fill is what identifies them, but it managed
     only 2.4-2.6:1 against --bg-input/--bg-card-alt (WCAG 1.4.11 wants 3:1). #eb0025 is the most
     saturated red at the same hue that keeps white text on it at AA (4.61:1) while clearing 3:1
     on every dark surface (3.37-4.00:1) — so it fixes the boundary problem and is 52% more
     chromatic into the bargain. It also lines light and dark up: light mode already uses #eb0000. */
  --accent-cyan-solid:#00ffff;--danger-solid-bg:#eb0025;
  /* Beer Round highlight: a solid dark amber-brown (not a see-through gold rgba — this is a
     literal container background, not a layer stacked over other content) so the whole
     question/wager block reads as "golden" at a glance instead of just its border. Chosen
     dark enough that every text color already used inside a beer-round block (white, cyan,
     magenta, muted gray, and the gold badge/border itself) still clears WCAG AA against it —
     see the contrast check run when this was added. */
  --beer-bg:#2a2410;--beer-border:#ffee00;
  /* Color Vision dropdown swatches — a static preview of the pass/fail (or accent) colors each
     mode actually swaps to, shown next to the option regardless of which mode is currently
     active, so picking one is an informed choice instead of a guess. Values are duplicated from
     the [data-cb="1"]/[data-cb="2"] tokens below (dark theme) rather than referenced live,
     since the dropdown lists all modes at once and can't borrow color from a data-cb state that
     may not be the active one. Both colors in both pairs clear >=6:1 against --bg-card here. */
  --cv-preview-rg-a:#3399ff;--cv-preview-rg-b:#ff8800;
  --cv-preview-by-a:#ff66cc;--cv-preview-by-b:#00cc88;
}
[data-theme="light"]{
  /* VIBRANCY / CONTRAST TARGET. Every accent below is the most saturated value its own hue can
     take while still clearing WCAG AA against the darkest surface it actually renders on. The
     hue angles are untouched — only chroma and lightness move — so this is the same palette,
     not a different one.
     They used to be tuned to AAA (7:1) instead, which is what made light mode read as muted: at
     7:1 against a near-white card there is almost no lightness left to spend, so each hue
     collapses towards black and renders as its muddy neighbour — orange as brown (#723300),
     gold as olive (#55420e), cyan as navy (#004b64), the NJCB blue as slate (#3B5B7A). Dropping
     to a comfortable AA (every value here lands at 4.6-5.2:1 as text, or 3.2:1+ where it is only
     a border/fill edge) buys back 20-120% chroma per token.
     Checked by auditing all 1,895 rendered text pairs in the running app — resolving effective
     backgrounds through gradients, alpha layers and color-mix() rather than assuming the nearest
     --bg-* token: 0 AA failures, down from 6. The 6 were --item-border's "+5 Bonus" chip at
     4.0:1, which the new value fixes as a side effect of being more saturated.
     Dark mode is deliberately not part of this — it has the opposite problem (light ink on black
     has lightness to spare) and its accents are already at full brand saturation. */
  --bg-primary:#e9f0fb;--bg-card:#fff;--bg-card-alt:#e8f0fb;--bg-input:#dfe9f8;--bg-hover:#d2e1f6;
  --border:#a6b9d4;--border-light:#8aa0c2;--border-strong:#7a92b8;
  /* Light-theme counterpart — see the note in the dark block. #7b7b7b is the darkest neutral that
     clears 3:1 on every light surface a control sits on, from --bg-card (#fff, 4.23:1) down to
     --bg-hover (#dcdcdc, 3.09:1). */
  --border-control:#5d779f;--text-primary:#000;--text-secondary:#2a2a2a;--text-muted:#454545;
  /* #10a710 read at only 2.21:1 against --btn-correct-bg, the mint fill of the very button it
     outlines, so the selected state's own boundary was the least visible thing about it (WCAG
     1.4.11 covers component STATES, not just components). #008b02 clears 3:1 there (3.08) and
     improves every neutral surface too (3.93 on --bg-card-alt, 4.47 on white), for 11% less
     chroma at an unchanged hue. --accent-red needs no such move: it already sits at 3.05:1
     against its own --btn-incorrect-bg fill. */
  --accent-cyan:#006688;--accent-magenta:#bb0055;--accent-gold:#ffb300;--accent-green:#008b02;
  --accent-red:#cc0000;--accent-orange:#c45900;--shadow:0 4px 24px rgba(20,60,140,.16);--shadow-lg:0 16px 48px rgba(0,0,0,.28),0 2px 10px rgba(0,0,0,.18);
  --edge-fade:rgba(0,0,0,.3);
  --row-stripe:rgba(20,70,160,.065);
  --btn-idle-bg:#dfe9f8;--btn-correct-bg:#54f377;--btn-incorrect-bg:#f7a5a6;--btn-used-bg:#e8f0fb;
  --pts-pos-bg:#008802;--pts-pos-border:#007900;--pts-pos-fg:#fff;
  --pts-neg-bg:#eb0012;--pts-neg-border:#d80000;--pts-neg-fg:#fff;
  --pts-nil-bg:rgba(0,0,0,.07);--pts-nil-border:rgba(0,0,0,.22);
  --on-accent-cyan:#fff;--on-accent-gold:#000;--on-badge:#fff;
  --item-border:#b54000;--item-fill-checked:#b54000;
  --njcb-border:#006ab3;--njcb-fill-checked:#006ab3;
  /* Explicit, not inherited: the dark block now sets this to black for its own lighter fills,
     and light mode's fills are the dark surface of the pair, so white is what clears AA here
     (5.7:1 and 5.7:1). */
  --check-icon-color:#fff;
  --badge-gold-fg:#845e00;--badge-green-fg:#006a03;
  /* The light sun (see the pair's note in the dark block above for why it is two tokens).
     #ffc400 is +66% chroma and far lighter than the #845e00 this icon used to inherit
     (OKLCh L .850/C .174 against L .508/C .105), which is the whole point — it is a real
     yellow now instead of an olive-brown. It measures 1.6:1 on a white card and is not
     meant to clear anything on its own: it is an enclosed area with the ray colour ringing
     it, so what has to be legible is that ring. #ffb300, this theme's own --accent-gold,
     would not do that job at 1.79:1, so the rays step down the same hue family to a deeper
     amber that clears 3:1 on every light surface this button takes, including the #dcdcdc
     it turns on hover: 4.72:1 on --bg-card, 4.14 on --bg-card-alt, 3.44 on --bg-hover. It
     is still +33% chroma on the old value, so the icon gains saturation in both parts. */
  --sun-disc:#ffc400;--sun-ray:#b35c00;
  /* Same hues as the dark set above, darkened to clear 3:1 against a near-white card rather
     than near-black. See that block for why these are not colour-vision-swapped. */
  --icon-stroke-ink:#fff;--icon-stroke-mix:32%;
  --tint-sheet:#1a7f4b;
  --tint-beer:#a56a00;--tint-beer-2:#d9a441;
  --tint-drum:#c0341f;--tint-drum-2:#a8703c;--tint-drum-3:#7a5330;
  --tint-trophy:#96700a;--tint-trophy-2:#6b4f05;
  --tint-mic:#5c6469;--tint-mic-2:#98a0a6;
  --tint-heart:#c62741;
  --tint-clipboard:#8a5f2c;--tint-clipboard-2:#b9a48c;
  --tint-plane:#1b6fb8;--tint-plane-2:#a9d2f2;--tint-plane-3:#5a9fd4;
  --tint-alert:#c45900;--tint-alert-2:#8a3d00;
  --tint-pdf:#c0332b;
  /* Light counterparts — see the dark block's note. Darkened to clear 3:1 against a near-white
     card instead of near-black: 4.4-6.0:1 and 4.0-5.5:1. */
  --tint-flask:#7a3fd6;--tint-cap:#0d6fa8;--tint-theme-2:#8a6100;--tint-shuffle:#a3006b;
  --txt-cyan:#006788;--txt-magenta:#bd0059;--txt-red:#9a0000;--txt-orange:#9b4800;--txt-purple:#6d28c9;
  --accent-cyan-solid:#0077b6;--danger-solid-bg:#eb0000;
  /* A true bright gold (like --accent-gold) only clears 3:1 non-text contrast against a
     background this dark — anything as light as --bg-card-alt forces the border down to a
     muddy, muted brown-olive to pass at all. Rather than accept that duller color, give the
     Beer Round card its own barely-there warm cream background (still ~17:1 for the existing
     black team-name text) so the border can be a real golden yellow instead. */
  /* Beer Round, light. The old #f1e7d0 / #9f7804 / #785b00 set was the dullest thing in the
     light theme: at OKLCh chroma .032 the background was a near-neutral beige, so the block that
     is supposed to read as the fun moment of the night looked like unstyled paper. The
     background is the lever — it carries far more of the impression than the text does, and it
     had far more room. #fff0c4 is +83% chroma and slightly lighter, which also buys headroom for
     the text sitting on it. --accent-gold (all the 7-14% washes: the badge, the stripe, the CB
     Prize row and tag, the flash) goes to #ffb300, +7%. The border takes the most chromatic gold
     that still clears 3:1 against the new background, +10%.
     --badge-gold-fg could only gain 5%, and that is the honest number: it has to hold 4.5:1 as
     text on the Beer Round badge — the darkest surface it ever renders on, and darker than the
     block behind it because the badge lays a gold wash over it — while also serving as the fill
     under white on .fr-tiebadge and the active standings sort button. 4.51:1 and 5.86:1. The
     lesson from the first attempt at this: the ceiling has to come from measuring the composited
     badge surface in the running app, not from computing the wash over the card. The wash sits on
     --beer-bg, not on the card, and guessing put the first value 9% too bright. */
  --beer-bg:#fff0c4;--beer-border:#b68000;
  /* Same Color Vision dropdown swatches as the dark theme above, duplicated from the
     [data-theme="light"][data-cb="1"]/[data-cb="2"] tokens below. --cv-preview-rg-b uses the
     darker #b35900 (the cb1 pts-neg-bg) rather than the lighter #cc6600 accent-red so the swatch
     still clears 3:1 against --bg-hover (#dcdcdc), not just the ~4.5:1 it'd get against the
     lighter --bg-card the accent-red value itself clears. */
  --cv-preview-rg-a:#0067c5;--cv-preview-rg-b:#b35900;
  --cv-preview-by-a:#c2007a;--cv-preview-by-b:#008060;
}
/* COLOR VISION MODES — independent of theme.
   1 = red-green (deuteranopia/protanopia): swaps green/red pass-fail colors for blue/orange.
   2 = blue-yellow (tritanopia): keeps green/red (tritanopes see these fine) but swaps the
       blue/gold accent pair, which is where tritanopes actually lose contrast. */
[data-theme="dark"][data-cb="1"]{
  --accent-green:#3399ff;--accent-red:#ff8800;
  --btn-correct-bg:#0d1f2e;--btn-incorrect-bg:#2e1f0d;
  --pts-pos-bg:rgba(51,153,255,.25);--pts-pos-border:rgba(51,153,255,.6);--pts-pos-fg:#8fc6ff;
  --pts-neg-bg:rgba(255,136,0,.25);--pts-neg-border:rgba(255,136,0,.6);--pts-neg-fg:#ffc182;
  --badge-green-fg:#55bbff;--txt-red:#ff9008;
  /* Same fix as the base dark theme's --danger-solid-bg: #884900 was a solid fill that read at
     only 2.2-2.4:1 against the surfaces it sits on, so nothing identified the Reset button or the
     incorrect badge as a control. #b16000 is the most saturated orange at that hue keeping white
     on it at AA (4.62:1) while clearing 3:1 on every dark surface (3.36-3.99:1). */
  --danger-solid-bg:#b16000;
}
[data-theme="light"][data-cb="1"]{
  --accent-green:#0067c5;--accent-red:#cc6600;
  --btn-correct-bg:#cfe6fb;--btn-incorrect-bg:#ffe1bf;
  --pts-pos-bg:#0067c5;--pts-pos-border:#005aae;--pts-pos-fg:#fff;
  --pts-neg-bg:#b35900;--pts-neg-border:#9c4e00;--pts-neg-fg:#fff;
  --badge-green-fg:#004585;--txt-red:#6d3600;--danger-solid-bg:#8c4600;
}
/* Unlike the theme-qualified blocks above/below, --correct-badge-bg isn't split per theme in the
   first place (see its definition up top) — it's the same fixed blue in cb1 regardless of which
   theme is active too, so one plain [data-cb="1"] rule covers both instead of two duplicates. */
[data-cb="1"]{--correct-badge-bg:#0067c5}
[data-theme="dark"][data-cb="2"]{
  --accent-gold:#ff66cc;--accent-cyan:#00cc88;
  --item-border:#ff66cc;--item-fill-checked:#ff66cc;
  --njcb-border:#00cc88;--njcb-fill-checked:#00cc88;
  /* --txt-cyan was missing from this block, so every piece of cyan TEXT — the Scores heading, the
     score figures, Grand Total — kept the base theme's #00ffff in the one mode whose whole purpose
     is to get blue out of the palette. Matched to this mode's own --accent-cyan; clears 7.4-10:1
     on every dark surface. */
  --badge-gold-fg:#ff96fc;--accent-cyan-solid:#00cc88;--txt-cyan:#00cc88;
  /* The pink/magenta gold-substitute already clears 7:1 on the normal --bg-card-alt (unlike
     real gold), so beer round doesn't need the special cream background here. */
  --beer-bg:var(--bg-card-alt);--beer-border:#ff66cc;
}
[data-theme="light"][data-cb="2"]{
  --accent-gold:#c2007a;--accent-cyan:#008060;
  /* The beer mug's own amber, darkened for this mode alone. Its worst surface is the Beer Round
     badge's wash, which is a color-mix off --accent-gold — magenta here rather than gold, so the
     wash is pink and light (L .636) where every other variant's is a deeper gold. The base light
     amber #a56a00 lands at 2.94:1 on it: a miss by 0.06, and the only one across all six modes.
     #9a6300 clears it at 3.30 and still holds 3.68:1 on the darkest ordinary light surface it
     renders on. Hue is untouched — this is the same amber, two steps darker. */
  --tint-beer:#9a6300;
  /* Pinned to the pre-vibrancy green. This mode swaps gold for magenta, which turns .fr-tie's
     row wash (color-mix of --accent-gold with white) from cream into pink — and the brighter
     #006a03 the base light theme now uses drops to 3.2:1 against that pink, under AA. The
     darker green clears it at 4.53:1. Only this mode needs the exception; the cream row every
     other light-mode variant uses is light enough for the vivid green. */
  --badge-green-fg:#0a500a;
  /* Each of these doubles as the chip's own TEXT color (on --bg-input) and, when the box is
     ticked, as the fill sitting under --check-icon-color. The old pair was tuned for the fill
     role and left the text role short of AA — 3.76:1 and 3.78:1 on --bg-input. Darkened just far
     enough to clear it (4.60/4.65), which costs almost no chroma (.247->.226, .111->.102) and
     improves the fill role too: white on them goes 4.7->5.6 and 4.8->5.7. Hues are untouched, so
     the magenta/green split this mode relies on — a red-green distinction, which is exactly what
     tritanopes still see — is unchanged. */
  --item-border:#c7007d;--item-fill-checked:#c7007d;
  --njcb-border:#007557;--njcb-fill-checked:#007557;
  /* #004f3b landed at 4.49:1 on .fr-tie's row wash — this mode swaps gold for magenta, so that
     wash is pink (#e799ca) rather than the cream every other variant gets, and it is the one
     surface --txt-cyan sits on that is dark enough to bind. Two points of lightness clears it. */
  --badge-gold-fg:#880056;--txt-cyan:#004d39;--accent-cyan-solid:#00654c;
  /* The sun swaps with everything else gold in this mode. A yellow sun is exactly the
     wrong thing here — blue-yellow mode exists to get yellow out of the palette — and the
     old inherit-from---badge-gold-fg wiring got this swap for free, so the split pair has
     to keep it deliberately. Both parts reuse magenta already in the palette: the rays take
     this mode's own --accent-gold (4.28:1 on --bg-hover, clear of 3:1), and the disc takes
     the brighter #ff66cc the DARK tritan block uses for the same token, which is the
     closest thing this palette has to the vivid-fill role #ffc400 plays above. */
  --sun-disc:#ff66cc;--sun-ray:#c2007a;
  --beer-bg:var(--bg-card-alt);--beer-border:#c2007a;
  /* #c2007a is too dark for black text at small sizes here (~3.6:1, under the 4.5:1 AA floor
     for normal text — the base #000 only clears AA on LARGE text, e.g. the question timer's
     own big countdown digits). White text clears 5.9:1 on this same background. */
  --on-accent-gold:#fff;
}

/* --wager-size drives the square wager / result buttons (kept width == height so they stay
   square) and the square Craft Prize buttons — Relaxed grows them into the extra row space,
   Compact shrinks them. */
[data-density="compact"]{--row-pad:4px;--wager-size:2.3rem;--cp-sq-size:4.4rem}
[data-density="relaxed"]{--row-pad:12px;--wager-size:3.3rem;--cp-sq-size:5.6rem}

[data-theme="dark"][data-stripe="1"],[data-stripe="1"]{--row-stripe:rgba(255,255,255,.11)}
[data-theme="dark"][data-stripe="2"],[data-stripe="2"]{--row-stripe:rgba(255,255,255,.19)}
[data-theme="light"][data-stripe="1"]{--row-stripe:rgba(0,0,0,.09)}
[data-theme="light"][data-stripe="2"]{--row-stripe:rgba(0,0,0,.16)}

/* overflow-x lives on body only, not html: with both elements declaring it, the CSS overflow-
   propagation rules split scrolling ambiguously between html and body instead of the browser
   treating the viewport as one scroll container — which breaks position:sticky (.header,
   .mini-progress) on mobile, where the document itself is what scrolls. Leaving it on body
   only lets body's overflow propagate to the viewport as the single, well-defined scroller. */
/* background here too (not just on body): iOS Safari's rubber-band overscroll bounce on a
   position:fixed + -webkit-overflow-scrolling:touch container (e.g. .audit-overlay, the Team
   Report modal's own scroller) can momentarily reveal whatever's painted behind the fixed
   element's edge during the bounce — if html itself has no background, that's the browser's
   default transparent/white canvas showing through, which read as "the header goes transparent
   while scrolling" in Team Report on mobile. Matching body's own --bg-primary here closes that
   gap so an overscroll bounce reveals more of the same dark background instead. */
/* The standard visually-hidden recipe: clipped to a 1px box rather than display:none or
   visibility:hidden, both of which take an element out of the accessibility tree along with the
   viewport — which would defeat the point of a live region. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html{font-size:16px;max-width:100%;background:var(--bg-primary)}
/* touch-action:manipulation app-wide: without it, two rapid taps on rapidly re-rendered
   controls (e.g. the standings Random button, which replaces its own DOM node on every tap)
   can be read by mobile browsers as a double-tap-to-zoom gesture instead of two clicks. */
/* Placeholder text: the browser default (#757575) is 3.7:1 on the dark input fill, under AA. --text-muted clears 4.5:1 on every input surface in both themes. opacity:1 because Firefox dims placeholders on its own. */
input::placeholder,textarea::placeholder{color:var(--text-muted);opacity:1}
body{font-family:var(--font-body);background:var(--bg-primary);color:var(--text-primary);min-height:100vh;-webkit-tap-highlight-color:transparent;overflow-x:hidden;max-width:100%;overflow-anchor:none;touch-action:manipulation}
/* Belt-and-suspenders on top of body's own touch-action above: per the CSS Touch Action spec, a
   descendant with no touch-action of its own already computes to "manipulation" here (the UA
   intersects an element's own value — "auto", unset — with every ancestor's, and body's value
   wins that intersection), so this is redundant with every actual <button>/[role="button"] in the
   app today. It's here anyway so the double-tap-zoom fix doesn't quietly depend on a distant
   ancestor's rule and everyone remembering the intersection rule above — a future component that
   sets its own touch-action for some OTHER reason (a drag handle, say — see .sheet-grab-handle/
   .mobile-scores-peek's deliberate touch-action:none) is far more likely to accidentally leave a
   button that also needs "manipulation" without a value of its own, than to explicitly set
   touch-action back to its "auto" default and undo this line directly. */
button,[role="button"]{touch-action:manipulation}
::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg-primary)}::-webkit-scrollbar-thumb{background:var(--border-light);border-radius:3px}

/* HEADER */
/* z-index kept above .drag-handle (101) and every other app-layout child, AND above the mobile
   scores sheet (.col-right.open, 250) and bottom timer dock (.mobile-bottom-dock, 245): .header
   creates its own stacking context, so a lower value here would let those paint over the
   settings panel (which lives inside .header) wherever their boxes overlap on screen — either
   the old "drag handle pokes through the settings panel" bug, or settings opening underneath an
   already-expanded scores sheet on mobile. .settings-backdrop (a sibling, not a header child)
   needs its own bump to match, see below. */
/* transform:translateZ(0) forces this sticky header onto its own GPU compositing layer — the
   same iOS Safari layer-boundary fix already used on .mini-progress/.audit-head (both
   position:sticky, same as this) and .settings-panel-head below (flex-shrink:0 pinned by
   layout instead — the glitch turned out not to be sticky-specific, see its own comment).
   Regular Safari tabs mostly get away
   without it because the address bar collapsing/expanding on scroll forces a viewport resize
   (and with it a sticky recalculation) on nearly every scroll tick, which papers over the
   underlying glitch. An installed standalone PWA has no address bar to collapse — the viewport
   height never changes, so that recalculation never fires, and the header is left stuck in
   whatever position it last (mis)computed instead of self-correcting. Promoting it to its own
   layer keeps its position tracked independently instead of depending on that browser-chrome
   side effect to paper over it. */
.header{position:sticky;top:0;z-index:260;background:var(--bg-primary);border-bottom:3px solid var(--mode-accent,transparent);padding:calc(10px + env(safe-area-inset-top)) 16px 10px;transform:translateZ(0);-webkit-transform:translateZ(0);backface-visibility:hidden;-webkit-backface-visibility:hidden}
/* flex-wrap here (not on .toolbar) means Save/Load/Gear wrap onto a new line as one group
   under the logo when they don't fit — .toolbar itself no longer wraps its own buttons
   individually, so it's all-or-nothing instead of one icon peeling off at a time. */
.header-top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;row-gap:8px}
.logo{font-family:var(--font-display);font-size:1.3rem;font-weight:700;color:var(--accent-cyan);text-transform:uppercase;letter-spacing:2px}
.logo span{color:var(--accent-magenta)}
.toolbar{display:flex;gap:6px;align-items:center;flex-wrap:nowrap}
.toolbar>button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4em;font-family:var(--font-body);font-size:max(12px,.78rem);font-weight:600;padding:5px 10px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);cursor:pointer;transition:var(--transition);white-space:nowrap}
@media (hover:hover) and (pointer:fine){.toolbar>button:hover,.btn:hover{background:var(--bg-hover);border-color:var(--border-light)}}
.btn-accent{background:var(--accent-cyan-solid)!important;color:var(--on-accent-cyan)!important;border-color:var(--accent-cyan-solid)!important;font-weight:700!important}
.btn-accent:hover{filter:brightness(.92)}
.btn-danger{border-color:var(--accent-red)!important;color:var(--txt-red)!important}
.btn-danger:hover{background:color-mix(in srgb,var(--accent-red) 13%,transparent)!important}

/* min-height, not line-height — this button is flex/inline-flex like Save/Load, and a flex
   container's own height comes from its tallest CHILD, not from line-height on the container
   itself (line-height only sizes an actual text line box, which this icon-only button, unlike
   Save/Load's icon-plus-" Save" text, never has one of). Save/Load end up taller purely because
   their bare " Save"/" Load" text node forces a text line-box at the button's font-size, which
   this button's single 1em-square icon child never triggers. calc(1.24em + 12px) reconstructs
   that same text-driven height directly — 1.24 is Save/Load's own line-box-to-font-size ratio at
   this font stack, and 12px is this rule's own padding+border (5px×2 + 1px×2) — so it tracks
   Settings > Size the same way Save/Load's real text metrics already do, rather than a fixed px
   height that wouldn't scale alongside them. */
.settings-toggle-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:.4em;font-family:var(--font-body);font-size:max(12px,.78rem);font-weight:600;min-height:calc(1.24em + 12px);padding:5px 12px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-card);color:var(--text-muted);cursor:pointer;transition:var(--transition)}
.settings-toggle-btn:hover{background:var(--bg-hover);color:var(--text-primary)}
/* The new-version banner (showUpdateBanner(), js/app.js). Laid out like the first-run tour card, with
   a thicker gold border, a gold tint and a full-size button so it's hard to miss. */
.update-banner{background:color-mix(in srgb,var(--accent-gold) 16%,var(--bg-card));border:2px solid var(--accent-gold);border-radius:var(--radius-lg);padding:16px;margin:12px 16px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}
.update-banner[hidden]{display:none}
.update-banner p{margin:0;color:var(--text-primary);font-weight:700;font-size:max(14px,1rem)}
.update-banner .btn-row{display:flex}
.update-banner .btn{min-height:44px;padding-inline:24px;font-size:max(14px,1rem)}
.update-help-link{font-size:max(12px,.75rem);color:var(--text-primary);text-underline-offset:2px}

/* Overlay, not in-flow: .header is position:sticky (a valid containing block for an
   absolutely-positioned child), so this floats above the app instead of pushing the
   scoreboard down every time it opens. */
/* -webkit-overflow-scrolling/overscroll-behavior: same touch-scroll fix as .audit-overlay below —
   without it, a touch-drag started inside this panel on iOS Safari can fail to scroll the panel
   at all (or chain into scrolling the page behind it) once the panel's content is taller than the
   viewport, e.g. with Advanced Settings expanded. */
/* max-height used to subtract a flat 80px guess at "how tall .header already is above this
   panel's top:100% anchor", plus env(safe-area-inset-top) on top of that guess for notched
   phones. The guess undershot on any phone where the header runs taller than 80px+inset for a
   reason that isn't the notch — .header-top wrapping Save/Load/⚙️ onto their own line under the
   logo when they don't fit one row (see .header-top above), or a bumped-up Size setting growing
   the header's own font. An undershoot means too much max-height, not too little: the panel is
   let grow taller than the space actually left below the header, so its bottom — the last
   Advanced Settings rows, the CLOSE button — renders past the bottom of the viewport with no
   internal scrollbar (the panel isn't "full" by its own oversized max-height) and no page scroll
   either (the panel is an absolute overlay, not part of document flow), leaving it permanently
   unreachable. --header-h (see .mini-progress's use of it above) is kept in sync with the
   header's real rendered offsetHeight for exactly this set of reasons already, so reuse it here
   instead of re-guessing; it already bakes in safe-area-inset-top since that's baked into the
   header's own padding. The 8px matches this panel's own margin-top gap below the header, and
   safe-area-inset-bottom is still subtracted so the panel's bottom edge — and the CLOSE button at
   the end of its scrollable content — stays above the home indicator instead of running under
   it. */
/* overflow-x:hidden is load-bearing, not decorative: setting overflow-y to anything but visible
   makes the UA compute an unset overflow-x as auto instead (CSS Overflow §3), so without this the
   panel was silently horizontally scrollable on mobile whenever a row's content ran wide — see
   the .settings-row/.settings-controls flex-wrap rules in the mobile breakpoint below, which stop
   that content from running wide in the first place; this stays as the hard backstop. */
/* max-height is declared twice below on purpose — 100vh first, then 100dvh. Mobile Safari's
   100vh is the LARGEST possible viewport, as if its address bar/toolbar were already collapsed;
   whenever that chrome is actually on screen (the normal case — it only hides once the page has
   been scrolled), the real visible area is shorter than 100vh says, so the panel sized itself
   taller than what was actually visible and its bottom — the footer with the version/date/
   disclaimer — rendered off the bottom of the screen with no way to reach it, same unreachable-
   footer failure mode as the --header-h bug above, just from the other side of the calc. 100dvh
   tracks the ACTUAL visible viewport as the toolbar shows/hides, which is what this needed.
   Redeclaring the property (not one calc with a fallback function) is the safe way to prefer it:
   a browser that doesn't parse `dvh` discards that whole second declaration and simply keeps the
   100vh one above it, rather than the whole rule breaking. */
.settings-panel{display:none;position:absolute;top:100%;left:16px;right:16px;margin-top:8px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));border:1px solid var(--border-strong);border-radius:var(--radius-lg);background:var(--bg-card);box-shadow:var(--shadow-lg);z-index:150;max-height:calc(100vh - var(--header-h,80px) - 8px - env(safe-area-inset-bottom));max-height:calc(100dvh - var(--header-h,80px) - 8px - env(safe-area-inset-bottom));overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;animation:dialogPop .22s cubic-bezier(.2,.9,.3,1.2)}
/* Deployed-panel-over-page shadows: a plain dark shadow disappears against this app's
   near-black dark background, so it gets its own pale glow to read as "floating above" the
   page instead; light mode already has a light background to contrast against, so it just
   gets a stronger/darker version of the normal shadow instead of a glow. Zero x/y offset
   (blur-only) so the halo spreads evenly on all four sides instead of pooling underneath.
   Opacity/blur bumped up from the first pass (was .16/.10 and .32/.24) — still theme-aware,
   just a clearly more visible halo in both themes. */
/* light-dark() (v22.48): one rule instead of a dark/light pair. The first box-shadow is the
   fallback a browser without light-dark() keeps (it drops the second declaration). */
.settings-panel{box-shadow:0 0 52px rgba(255,255,255,.30),0 0 16px rgba(255,255,255,.20);box-shadow:0 0 52px light-dark(rgba(0,0,0,.46),rgba(255,255,255,.30)),0 0 16px light-dark(rgba(0,0,0,.34),rgba(255,255,255,.20))}
/* Text-selection highlight (click-drag over labels/inputs on desktop) defaults to the browser's
   own gray/blue, which reads as a flat light-gray smear against this panel's own dark surface.
   --bg-hover is already "a lighter version of the button background" everywhere else in the
   app (buttons rest at --bg-card, brighten to --bg-hover on hover/interaction), so reusing it
   here keeps the selection color part of the same palette instead of an OS-default gray. */
.settings-panel ::selection{background:var(--bg-hover);color:var(--text-primary)}
.settings-panel.settings-visible{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));column-gap:24px}
/* .settings-panel-body/.settings-panel-foot exist only so the mobile breakpoint below can pin a
   scrolling middle between an anchored header and footer (the same header/scroll/footer split
   .col-right's mobile scores sheet already uses — see .scores-list further down). Above that
   breakpoint display:contents removes both wrapper boxes from layout entirely, so their children
   (the settings rows, the advanced group, .settings-meta) become direct
   children of the grid above exactly as if the wrappers weren't there — this rule exists purely
   to keep the desktop/tablet grid identical to before the wrappers were added. */
.settings-panel-body,.settings-panel-foot{display:contents}
/* Above the mobile breakpoint, keep Settings a narrow single column anchored under the gear icon
   it opens from, rather than a band spanning the whole window. The auto-fill grid above turned a
   1200px-wide panel into five columns of settings flowing left-to-right, each row stretched so
   its label and its control sat at opposite ends — hard to scan, and nothing like the vertical
   list the same panel is on a phone. 440px comfortably fits the longest label/control pair
   ("Legacy Exports (CSV / XLSM)" plus its toggle) on one line, and the panel's existing
   max-height/overflow-y absorbs the extra height that stacking the rows creates. Starting at
   601px (where the mobile single-column rule below leaves off) means every width now gets the
   same one-column list; only the panel's width differs. */
@media(min-width:601px){
  .settings-panel{left:auto;right:16px;width:min(440px,calc(100vw - 32px))}
  /* .settings-advanced-group is qualified by .settings-panel purely for specificity — its own
     auto-fill rule is declared later in this file and would otherwise win the tie. */
  .settings-panel.settings-visible,.settings-panel .settings-advanced-group{grid-template-columns:1fr}
  /* Desktop keeps the plain scrolling-grid layout (no anchored head like the ≤600 sheet), but the
     version/disclaimer line still gets pinned to the bottom the same way: when the panel is taller
     than the window it scrolls (the panel's own max-height + overflow-y:auto), and this sticks
     flush to its bottom edge with the settings scrolling under it. When it fits, sticky just sits
     at the natural bottom and nothing changes. Scoped to #settingsPanel so the FAQ's short reused
     panel (always overflow:visible, never scrolls) is untouched. padding-bottom moves off the
     panel and onto this bar so it can sit truly flush; -16px margins + overflow-x:hidden clip the
     full-bleed background/shadow to the panel edge, same as the ≤600 head/foot. */
  #settingsPanel{padding-bottom:0}
  #settingsPanel .settings-panel-foot{display:block;position:sticky;bottom:0;z-index:3;grid-column:1/-1;margin:8px -16px 0;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:var(--bg-card);border-top:1px solid var(--border-strong);box-shadow:0 -7px 11px 0 var(--edge-fade)}
}
.settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 4px;border-bottom:1px solid var(--border)}
/* Marks a row as only meaningful once the toggle above it is on (Drumroll Crossfade and Sound
   Test Buttons both only appear once Manual Drumroll Control is — see drumCrossfadeRow/
   soundTestRow's own display:none wiring in applyPrefs, js/app.js) — the extra left padding
   alone is enough to read as "nested under the row above" without a connector line or bullet,
   and composes with .settings-row's own responsive padding since it only touches padding-left.
   Qualified as .settings-row.settings-row-sub (two classes), not .settings-row-sub alone: the
   mobile breakpoint below (@media max-width:600px) sets its own `padding` shorthand on
   .settings-row at the SAME specificity as a bare .settings-row-sub, and being later in the
   file it won the cascade there — the indent was applying on desktop and silently vanishing on
   mobile. Two classes doubles the specificity so this wins regardless of viewport width. */
.settings-row.settings-row-sub{padding-left:20px}
.settings-controls{display:inline-flex;align-items:center;gap:4px;flex-shrink:0}
/* Slider controls (drumroll crossfade). accent-color themes the track and thumb from the same
   token the rest of the app's active controls use, in every browser this app targets, without
   the -webkit-slider-thumb/-moz-range-thumb duplication a hand-built slider needs — and it
   follows the theme automatically because the token already does. The readout is display-font
   and tabular so it doesn't jitter in width as the value changes under a drag. */
.settings-range{width:120px;accent-color:var(--accent-cyan-solid);background:transparent;cursor:pointer;flex-shrink:0}
.settings-range:focus-visible{outline:2px solid var(--accent-cyan);outline-offset:2px}
.settings-range-val{font-family:var(--font-display);font-size:max(12px,.78rem);font-weight:700;color:var(--txt-cyan);min-width:2.7rem;text-align:right;font-variant-numeric:tabular-nums}
@keyframes slideDown{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
@keyframes dialogPop{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.settings-panel,.audit-modal,.confirm-modal{animation:none}}
/* ADVANCED SETTINGS — collapsible group holding the rarer controls (point adjustments,
   legacy CSV/XLSM export) so the default settings list stays short. */
.settings-advanced-toggle-row{grid-column:1/-1;margin-top:2px}
/* Off (collapsed) vs enabled (expanded) get distinct backgrounds so the state
   reads at a glance, the same accent-fill convention the settings toggles use. */
.settings-advanced-toggle{width:100%;display:flex;align-items:center;justify-content:center;gap:6px;font-family:var(--font-body);font-size:max(12px,.78rem);font-weight:700;padding:8px 10px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-card);color:var(--text-muted);cursor:pointer;transition:var(--transition);text-transform:uppercase;letter-spacing:.5px}
.settings-advanced-toggle:hover{background:var(--bg-hover);color:var(--text-primary)}
.settings-advanced-toggle.open{background:var(--accent-cyan-solid);color:var(--on-accent-cyan);border-color:var(--accent-cyan-solid)}
.settings-advanced-toggle.open:hover{background:var(--accent-cyan-solid);color:var(--on-accent-cyan)}
/* scale(), not font-size, so a bigger chevron is purely visual and never grows the button's
   line box / height. */
.settings-advanced-toggle .adv-chevron{transition:transform .25s;display:inline-block;transform:scale(1.55)}
.settings-advanced-toggle.open .adv-chevron{transform:rotate(180deg) scale(1.55)}
.settings-advanced-group{grid-column:1/-1;display:none;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));column-gap:24px}
.settings-advanced-group.open{display:grid}

.settings-btn{display:inline-flex;align-items:center;justify-content:center;gap:.4em;font-family:var(--font-body);font-size:max(12px,.8rem);font-weight:600;padding:5px 10px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);cursor:pointer;transition:var(--transition);white-space:nowrap}
.settings-btn:hover{background:var(--bg-hover)}
/* Theme toggle's sun/moon (THEME_ICON_SUN/THEME_ICON_MOON, app.js) — see the const comment there
   for why these replaced the old ☀️/🌑 emoji. --badge-gold-fg/--txt-cyan are this app's existing
   "AAA(7:1) text-safe on neutral surfaces" token pair, and --bg-card (this button's own
   background) is exactly that surface, so reusing them needs no new contrast check — and both
   already carry their own [data-cb] swap, so the icon follows Settings > Color Vision for free.
   #faqThemeToggle (FAQ_THEME_SUN_SVG/FAQ_THEME_MOON_SVG, faq/js/faq.js) is the FAQ page's own
   copy of this exact button — same geometry (the ic-sun/ic-moon <symbol> defs in faq/index.html
   are byte-identical to these paths), so it gets the identical styling here rather than
   rendering as a plain uncoloured icon-ui the way it did before this rule covered it too. */
#themeToggle,#faqThemeToggle{display:inline-flex;align-items:center;gap:4px}
/* .8em, not 1em+: unlike a Unicode glyph, this SVG has no built-in internal padding baked into
   its own bounding box, so it needs to render visibly SMALLER than the em square to end up the
   same on-page size the old 🌑/☀️ emoji was. */
#themeToggle svg,#faqThemeToggle svg{width:.8em;height:.8em;flex-shrink:0}
#themeToggle svg circle,#themeToggle svg path,#faqThemeToggle svg circle,#faqThemeToggle svg path{fill:currentColor}
#themeToggle svg line,#faqThemeToggle svg line{stroke:currentColor}
/* The sun is the one icon here painted from two tokens rather than one inherited colour:
   --sun-ray drives currentColor, so the eight rays (stroked <line>s) and the ring around
   the disc both take it, and --sun-disc fills the disc inside that ring. The ring is what
   makes the vivid fill usable — a #ffc400 circle alone on a white card is a 1.6:1 smudge,
   and at the .8em this renders it would read as a blank gap between the rays.
   stroke-width is set here rather than on the <circle> in app.js because the ring is a
   presentational choice this rule is making; 2 matches the <g stroke-width="2"> the rays
   are drawn with, so the ring and the rays are one continuous weight. The circle's own r=5
   is unchanged — the stroke straddles it, so the disc reads slightly larger against the
   rays than it did as a flat fill, which is the right direction for a sun. */
#themeToggle .icon-sun,#faqThemeToggle .icon-sun{color:var(--sun-ray)}
#themeToggle .icon-sun circle,#faqThemeToggle .icon-sun circle{fill:var(--sun-disc);stroke:var(--sun-ray);stroke-width:2}
#themeToggle .icon-moon,#faqThemeToggle .icon-moon{color:var(--txt-cyan)}
/* Settings > Theme: the sun/moon beside the button, the same 2rem square as the Game Mode pictograph. */
#themeIcon{display:flex;flex-shrink:0;margin-right:4px}
#themeIcon:empty{display:none}
#themeIcon .icon-sun,#themeIcon .icon-moon{width:2rem;height:2rem;flex-shrink:0}
#themeIcon .icon-sun{color:var(--sun-ray)}
#themeIcon svg path{fill:currentColor}
#themeIcon svg line{stroke:currentColor}
#themeIcon .icon-sun circle{fill:var(--sun-disc);stroke:var(--sun-ray);stroke-width:2}
#themeIcon .icon-moon{color:var(--txt-cyan)}
/* Hidden by default (desktop's multi-column grid rarely needs to scroll, so a heading here would
   just be dead weight) — shown only in the mobile single-column layout below, where Advanced
   Settings expanding can push the panel well past the viewport height and the "Theme" row
   scrolling out of view is the only remaining clue you're still inside Settings. */
.settings-panel-head{display:none}
@media(max-width:600px){
  /* SCOREBOARD LAYOUT: below 600px the panel adopts the same anchored-header/scrolling-middle/
     anchored-footer split as .col-right's mobile scores sheet (header/.scores-list/timer,
     further down) instead of being one long scrolling column with a sticky heading bar. The
     panel itself becomes the flex column (grid-template-columns from the desktop rule no longer
     applies once display is flex, not grid) and is capped at its existing max-height (still
     tracked via --header-h, see the base rule above); .settings-panel-head and
     .settings-panel-foot are flex-shrink:0 so they hold their place at the top/bottom, and
     .settings-panel-body — display:contents above 600px — becomes the one flexed, scrolling
     middle (min-height:0 is required here or a flex child won't shrink below its content's
     natural height and would just push the footer off the bottom instead of scrolling).
     overflow-y:hidden on the panel itself hands scrolling to the body alone, so the header/footer
     never scroll out of view with the rows between them. */
  .settings-panel.settings-visible{display:flex;flex-direction:column;overflow-y:hidden}
  /* .settings-panel.settings-visible switching to flex above already collapses the main list to
     one column (grid-template-columns no longer applies once display isn't grid), but
     .settings-advanced-group is its OWN display:grid element nested inside — its base rule
     further down this file (repeat(auto-fill,minmax(220px,1fr))) still applies here, since
     nothing between here and 600px ever overrode it the way the min-width:601px rule below does.
     At a width that fits two 220px columns plus the 24px gap (~464px+ — a phone in landscape, or
     a resized window) that meant Advanced Settings alone popped into two columns while
     everything above and below it in the same panel stayed one, right in the gap between "mobile
     enough to use the flex layout" and "wide enough to hit the desktop override". Pinning it to
     one column here closes that gap: single column now holds everywhere on both sides of the
     600px breakpoint, never two. */
  .settings-advanced-group{grid-template-columns:1fr}
  /* overflow-x:hidden is load-bearing here too, same reasoning as the panel's own rule above it
     in the file: setting overflow-y to anything but visible makes the UA compute an unset
     overflow-x as auto instead, which would silently reopen the horizontal-scroll bug that rule
     exists to close — now on this element, since it's the one actually scrolling. */
  /* padding-top is the "breathing room" before the first row (Theme) that used to live in
     .settings-panel-head's own bottom margin instead — moved here deliberately: that margin sat
     *outside* this scrolling box, so it was a fixed 16px of dead black space the header's
     border-line never actually touched, and the first row only started disappearing under the
     line 16px into the scroll instead of right at it. As padding-top on the scrolling box itself,
     it scrolls away with the rest of the content, so the line and the first row's clip point are
     the same pixel from the very start of a scroll gesture. */
  /* margin:0 -16px + matching padding full-bleeds the scrolling box to the panel's inner edges so
     its scrollbar rides the right edge of the panel (was inset 16px, sitting right against the
     controls); the 16px/18px padding puts the rows back where they were, with the extra 2px on
     the right as clearance between the content and the scrollbar track. */
  .settings-panel-body{display:block;flex:1 1 auto;min-height:0;margin:0 -16px;padding:12px 18px 0 16px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .settings-panel-foot{display:block;flex-shrink:0}
  /* grid-column:1/-1 spans the single-column layout's full width. Negative margin cancels
     .settings-panel's own 10px/16px padding so the bar bleeds edge-to-edge instead of floating
     with a gap on both sides. No bottom margin here (see below for why) — position:sticky was
     dropped here on the assumption that pinning this in place by flex layout instead of
     scroll-tracking made the iOS translateZ(0) workaround (still used on .mini-progress/
     .audit-head elsewhere in this file) sticky-specific and no longer needed — wrong: a host on a
     real iPhone still saw the row right below this one double-expose/ghost while scrolling,
     because the underlying glitch is a compositing-layer boundary artifact next to a
     -webkit-overflow-scrolling:touch container (.settings-panel-body below), not something
     specific to position:sticky itself. Re-added for that reason, sticky or not. */
  /* box-shadow is a faint downward fade under the border-line, hinting the row right below it is
     genuinely scrollable content and not just static space — picked over a plain flush edge once
     the 12px gap above moved inside the scroll box (V5 of the gap-fix variations). */
  /* box-shadow spread is 0 (not the old -8px): with a negative spread the fade pulled ~8px in
     from each side and died well short of the panel's left/right edges, leaving a bare strip
     under the corners. At spread 0 the shadow runs the head's full width and .settings-panel's
     overflow-x:hidden clips it flush to the panel edge instead. position:relative + z-index lift
     the head (and its shadow) above .settings-panel-body, so the row buttons scrolling under the
     shadow's 9px overlap sit *beneath* it rather than punching through on top. */
  .settings-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;grid-column:1/-1;flex-shrink:0;position:relative;z-index:3;margin:-10px -16px 0;padding:10px 16px;background:var(--bg-card);border-bottom:1px solid var(--border-strong);box-shadow:0 7px 11px 0 var(--edge-fade);transform:translateZ(0);-webkit-transform:translateZ(0);backface-visibility:hidden;-webkit-backface-visibility:hidden}
  .settings-panel-title{font-family:var(--font-display);font-size:max(12px,.8rem);font-weight:700;text-transform:uppercase;letter-spacing:1.5px;color:var(--txt-cyan)}
  /* X close button — same circular affordance as .resume-banner-close, reused here for visual
     consistency. With the panel now capped at max-height and scrolling only in the middle, the
     header is always on screen the instant Settings opens, so this is reachable without
     scrolling down first. */
  /* Border/icon red (same --accent-red/--txt-red pair as every other close/dismiss X in the
     app — .remove-team button, .audit-close, .resume-banner-close) for the same reason: it's a
     plain X with no label, and red is what now carries the "this closes something" signal. */
  .settings-x-btn{width:1.7rem;height:1.7rem;flex-shrink:0;border-radius:50%;border:1px solid var(--accent-red);background:none;color:var(--txt-red);line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:var(--transition);touch-action:manipulation}
  .settings-x-btn svg{width:.8rem;height:.8rem;display:block}
  .settings-x-btn:hover{background:color-mix(in srgb,var(--accent-red) 15%,transparent)}
  /* Icon Style's Emoji mode swaps the pictograph X above for a bare "✕" character (app.js
     STATIC_ICON_TARGETS) — at the button's own small text size that glyph read thin and
     undersized next to the drawn pictograph's bolder two-stroke X, so it gets its own bump here
     rather than inheriting whatever size .settings-x-btn's text happens to run at. */
  .settings-x-btn .icon-emoji{font-size:1.3rem}
  .settings-row{padding:10px 2px;gap:10px}
  .settings-row .size-label{font-size:max(12px,.78rem)}
  .settings-controls .settings-btn{padding:7px 12px;font-size:max(12px,.85rem)}
  /* Footer divider — the panel-foot's border-top does the job .settings-meta's own padding-top
     used to (visually separating the version/disclaimer block from the scrolling settings rows
     above); moved to the wrapper since it separates the whole anchored footer from the body,
     not just .settings-meta specifically. */
  /* Same idea as .settings-panel-head's shadow above (see its comment), mirrored: a faint upward
     fade off the footer's own top edge, hinting the row just above it is scrollable content
     sliding in underneath a pinned bar rather than the panel simply ending there. Needs its own
     opaque background for the same reason the head does — .settings-panel-body's rows scroll
     behind this footer, not past it, so without one the shadow would read through whatever row
     happens to be scrolled underneath instead of sitting on top of it. */
  /* margin:-16px sides + matching 16px padding full-bleeds the footer to the panel edges (it had
     no horizontal negative margin before, so its shadow started 16px in from each side and fell
     even shorter of the edges than the head's). spread 0 + overflow-x:hidden clip, and
     position/z-index, mirror the head rule above for the same reasons. */
  .settings-panel-foot{background:var(--bg-card);border-top:1px solid var(--border-strong);position:relative;z-index:3;margin:2px -16px 0;padding:8px 16px 0;box-shadow:0 -7px 11px 0 var(--edge-fade)}
  .settings-meta{padding-top:0}
  /* .settings-controls is flex-shrink:0 by design (the slider needs its fixed 120px), and a few
     rows pack two buttons into it ("Copy"+"TXT", "Save"+"Load") or pair it with a long label
     ("Craft Prize Eligible List", "Per-Question Percentage Correct Labels"). At the panel's fixed
     440px on tablet/desktop that combination fits on one line; the mobile panel is only as wide
     as the viewport minus margins, so the same combination can run past it. Wrapping instead of
     refusing to shrink is what the overflow-x:hidden backstop above was silently clipping. */
  .settings-row{flex-wrap:wrap}
  .settings-controls{flex-wrap:wrap;justify-content:flex-end}
}
/* The head/foot depth shadow used to need a theme-split override here (a black shadow is nearly
   invisible against Dark's #0d0d0d --bg-card). Both directions now use --edge-fade, which is
   already defined per theme — pale in Dark, darker in Light — so the per-theme override is gone. */
.theme-select{min-height:1.75rem;font-family:var(--font-body);font-size:max(12px,.72rem);font-weight:700;padding:4px 22px 4px 8px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);cursor:pointer;appearance:none;-webkit-appearance:none;outline:none;transition:var(--transition);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888888'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center}
.theme-select:hover{background-color:var(--bg-hover)}
.theme-select:focus-visible{outline:2px solid var(--accent-cyan-solid);outline-offset:2px}
.theme-select:focus{border-color:var(--accent-cyan);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-cyan) 13%,transparent)}
.theme-select option{background:var(--bg-card);color:var(--text-primary)}
/* Custom color-vision dropdown — a native <select> can't wrap an option's text onto a
   second line, and its closed box auto-sizes to the longest option ("Red-Green
   (deuteranopia/protanopia)"), which overflowed the viewport at narrower widths. This
   shows only the short label when closed and wraps the detail onto its own line in the
   open menu, with JS-computed top/left (toggleCvMenu) so the menu itself never runs
   off-screen. position:fixed (not absolute) is load-bearing: .cv-select sits inside
   .settings-panel/.settings-panel-body, both overflow-y:auto, and an absolutely-positioned
   menu is still clipped by that scrollable ancestor's box even though it visually "floats"
   above the row it opens from — cutting the menu off at the panel's bottom edge instead of
   overlaying the rest of the page. Fixed positioning is laid out against the viewport, so it
   escapes that clipping entirely; the JS also flips the menu above the button instead of
   below when opening downward would run past the bottom of the viewport itself. */
.cv-select{position:relative;display:inline-block}
.cv-select-btn{font-family:var(--font-body);font-size:max(12px,.72rem);font-weight:700;padding:4px 8px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;transition:var(--transition)}
.cv-select-btn:hover{background:var(--bg-hover)}
.cv-select-btn:focus-visible{outline:2px solid var(--accent-cyan-solid);outline-offset:2px}
.cv-select-arrow{font-size:max(12px,.6rem);color:var(--text-muted);transition:transform .15s}
.cv-select.open .cv-select-arrow{transform:rotate(180deg)}
/* z-index above the tutorial overlay's own layers (bars/ring 600, callout 601), not merely above
   the settings panel it lives in. An open dropdown is the most transient, most foreground thing
   on screen, and during the tutorial the Color Vision step spotlights this very control — at 300
   the callout painted straight over the options the step is asking the host to look at. The step
   also places its callout above the target now (see tutorial.js), so the two no longer overlap at
   all at normal sizes; this is what keeps the options readable when the viewport is too short for
   that and the callout has to fall back below. */
.cv-select-menu{position:fixed;min-width:0;width:max-content;max-width:min(260px,calc(100vw - 24px));margin:0;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);z-index:700;list-style:none;padding:4px;display:none;max-height:60vh;overflow-y:auto}
/* Two selectors, because the menu is re-parented to <body> while open (see toggleCvMenu in
   app.js) and is no longer a descendant of .cv-select.open at that point. The descendant form is
   kept as the belt-and-braces case for any path that adds .open without going through there. */
.cv-select.open .cv-select-menu,.cv-select-menu.cv-open{display:block}
.cv-select-menu li{padding:6px 8px;border-radius:6px;cursor:pointer;font-size:max(12px,.78rem);color:var(--text-primary);display:flex;flex-direction:column;gap:1px;line-height:1.25}
.cv-select-menu li:hover{background:var(--bg-hover)}
.cv-select-menu li[aria-selected="true"]{font-weight:700;color:var(--txt-cyan)}
.cv-opt-sub{font-size:max(12px,.68rem);font-weight:500;color:var(--text-muted)}
/* Swatch squares next to "Red-Green"/"Blue-Yellow" — a color preview so the label isn't just a
   clinical name for the deficiency; see the --cv-preview-* tokens above for the values and their
   contrast notes. aria-hidden since the option's own text already names the mode. */
.cv-opt-main{display:inline-flex;align-items:center;gap:5px}
.cv-swatch-pair{display:inline-flex;gap:2px}
.cv-swatch{width:.6rem;height:.6rem;border-radius:2px;display:inline-block}
.cv-swatch-rg-a{background:var(--cv-preview-rg-a)}
.cv-swatch-rg-b{background:var(--cv-preview-rg-b)}
.cv-swatch-by-a{background:var(--cv-preview-by-a)}
.cv-swatch-by-b{background:var(--cv-preview-by-b)}
/* The closed button's own preview, next to the label rather than only inside the open menu —
   see setCvSelectDisplay in app.js, which copies the selected option's own .cv-swatch-pair
   markup in here. Empty (and so zero-width) whenever "Off" is selected, since Off has no
   swatch pair of its own either. */
.cv-select-swatch:empty{display:none}
.size-label{font-size:max(12px,.68rem);color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;font-weight:600}
.sep{width:1px;height:18px;background:var(--border-light);margin:0 2px;flex-shrink:0}

.resume-banner{position:relative;background:var(--bg-card);border:1px solid var(--accent-gold);border-radius:var(--radius-lg);padding:16px;margin:0 16px 12px;display:none}
.resume-banner.show{display:block}
.resume-banner p{margin:0 28px 12px 0;color:var(--badge-gold-fg);font-weight:600}
.resume-banner .btn-row{display:flex;gap:8px}
/* Escape hatch for a host who ignores Resume/New Game and heads straight for the tutorial or a
   practice game instead — dismisses the banner without touching the saved session in storage,
   same effect resumeSession()/startNewGame() have on it, just without the decision. */
/* Border/icon red (same --accent-red/--txt-red pair as .remove-team button/.audit-close) so
   this dismiss X reads with the same "closes/discards something" signal every other X in the
   app now carries, instead of the old neutral gray. X_ICON_SVG (app.js) replaces the Unicode ✕
   glyph here too, for the same centering/consistency reasons as everywhere else it was swapped. */
.resume-banner-close{position:absolute;top:10px;right:10px;width:1.6rem;height:1.6rem;border-radius:50%;border:1px solid var(--accent-red);background:none;color:var(--txt-red);line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:var(--transition);touch-action:manipulation}
.resume-banner-close svg{width:.85rem;height:.85rem;display:block}
.resume-banner-close:hover{background:color-mix(in srgb,var(--accent-red) 15%,transparent)}

/* LAYOUT */
/* --layout-top is how far down the viewport this panel actually starts, kept in sync with the
   real rendered geometry by a ResizeObserver in app.js (the same pattern --header-h /
   --mini-progress-h / --mobile-dock-h already use). It replaces a hardcoded 60px, which was a
   guess at "the header's height" and was wrong in both directions:
     - Too SMALL whenever anything above this panel was taller than 60px — the sticky .header is
       47px at the default 15px text but grows to 70px at the 30px setting, and the Resume banner
       sits in flow above this panel for another ~91px on every load with a saved session. In
       those cases the panel's bottom edge landed BELOW the viewport, which made the document
       itself scrollable by the difference, into a strip of blank background under the layout.
       Nothing is rendered there — .col-left and .col-right are their own scrolling panes and end
       with the panel — so it was pure void. It was reachable from anywhere the wheel could
       chain to the document: most easily with the cursor over the Scores column, which either
       is not scrollable at all (few teams) or hands the scroll straight on once it bottoms out,
       so a normal scroll-down gesture over the scoreboard dragged the whole app up the screen.
     - Too LARGE whenever they were shorter than 60px, leaving a dead strip of background below
       the panel that the columns could have been using.
   Measuring the panel's own top edge rather than summing the parts above it means it stays
   correct for anything that is ever added, shown or hidden up there without a second variable
   to keep in sync. The 60px fallback is only what applies for the one frame before app.js's
   first measurement lands.
   100dvh restated after 100vh for the same reason .settings-panel does it: on mobile Safari
   100vh is the viewport as if the toolbars were already collapsed, so it over-measures while
   they are still shown. Browsers without dvh keep the 100vh line above it. This whole height is
   desktop-only in effect anyway — the mobile media query below sets height:auto, since there the
   document is the scroller and the columns stack. */
.app-layout{display:flex;height:calc(100vh - var(--layout-top,60px));height:calc(100dvh - var(--layout-top,60px));overflow:hidden}
.col-left{position:relative;flex:1;min-width:300px;padding:0 16px 40px;overflow-y:auto;overflow-x:hidden;max-width:100%;container-type:inline-size;container-name:scorecol;overflow-anchor:none}
.col-right{position:relative;width:max(clamp(260px,30vw,380px),min(560px,calc(100vw - 1000px)));min-width:200px;max-width:60vw;height:100%;overflow-y:auto;background:var(--bg-card);display:flex;flex-direction:column;flex-shrink:0;border-left:1px solid var(--border)}
.drag-handle{position:relative;width:6px;flex-shrink:0;height:100%;background:var(--border);cursor:col-resize;z-index:101;transition:background .15s}
.drag-handle:hover,.drag-handle.dragging,.drag-handle:focus-visible{background:var(--accent-cyan)}
/* A wider invisible grab area than the 6px bar, for trackpads. */
.drag-handle::before{content:'';position:absolute;top:0;bottom:0;left:-4px;right:-4px}
/* Wide desktop windows: stop the scoring column's cards stretching, so a team's name stays near its
   score buttons. The spare width goes to the scoreboard (see .col-right) and to even side margins. */
@media(min-width:769px){
  .col-left>:not(.mini-progress){max-width:960px;margin-left:auto;margin-right:auto}
}
.drag-handle::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:2px;height:32px;border-radius:1px;background:var(--text-muted);opacity:.5}
.drag-handle:hover::after,.drag-handle.dragging::after{background:#000;opacity:.8}
body.col-resizing{cursor:col-resize!important;user-select:none!important}
body.col-resizing *{cursor:col-resize!important;user-select:none!important}

/* MINI PROGRESS BAR — shows which round the host is currently working through so they don't
   have to scroll back up to find it. It's the first child of .col-left (rendered by JS, not
   static markup) so on desktop, where .col-left is its own scrolling pane, position:sticky
   pins it to that pane's own top edge. On mobile .col-left isn't a scroll container (the
   document is), so the sticky context bubbles up to the page — there it needs to sit below
   the always-sticky .header instead of underneath it, hence the --header-h offset swapped in
   by the media query below (kept in sync by a ResizeObserver in app.js, since the header's
   rendered height varies with font-size settings and notch safe-area insets). */
/* line-height fixed at 1.3 (not "normal", which is font-metric-dependent) so the .mp-complete
   state — a single .mp-label span — resolves to exactly the same line-box height as the normal
   state's row of spans, as long as every one of those spans shares the same font-size (see
   .mp-round/.mp-label below, both explicitly .95rem for this reason). Without that, the two
   states render at different heights and the sticky bar visibly resizes when a round finishes. */
/* transform:translateZ(0) forces this onto its own GPU compositing layer — same iOS Safari
   sticky-positioning bug as .audit-head below, except here it's worse than a late-repaint flash:
   this bar is torn down and rebuilt (a fresh DOM node, via renderAll's innerHTML swap) on nearly
   every interaction, and replacing an un-promoted sticky element mid-momentum-scroll can make
   Safari lose track of its stuck position entirely until another scroll event nudges it back —
   it visibly scrolls away with the rest of the page instead of staying pinned. Promoting it to
   its own layer keeps that position tracked independently of the surrounding reflow/repaint. */
.mini-progress{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:8px;padding:8px 12px;margin:0 -16px 10px;background:var(--bg-card-alt);border-bottom:1px solid var(--border-strong);cursor:pointer;transition:var(--transition);touch-action:manipulation;line-height:1.3;transform:translateZ(0);-webkit-transform:translateZ(0);backface-visibility:hidden;-webkit-backface-visibility:hidden}
/* Halo shadow (blur-only, no offset, so it reads on all sides) — same theme-aware treatment as
   .settings-panel/.col-right.open: dark mode needs a pale glow to read as "floating above" its
   own near-black background, light mode gets a plain shadow instead. Scaled down from those
   bigger panels since this is a slim bar, not a full overlay. */
.mini-progress{box-shadow:0 5px 22px rgba(255,255,255,.24),0 0 8px rgba(255,255,255,.16);box-shadow:0 5px 22px light-dark(rgba(0,0,0,.38),rgba(255,255,255,.24)),0 0 8px light-dark(rgba(0,0,0,.26),rgba(255,255,255,.16))}
.mini-progress:hover{background:var(--bg-hover)}
.mp-round{font-family:var(--font-display);font-weight:700;font-size:max(12px,.95rem);flex-shrink:0}
.mp-count{font-family:var(--font-body);font-size:max(12px,.8rem);font-weight:600;color:var(--text-secondary);white-space:nowrap}
.mp-bar{flex:1;height:6px;border-radius:3px;background:var(--bg-input);overflow:hidden;min-width:40px}
.mp-fill{height:100%;background:var(--accent-cyan-solid);border-radius:3px;transition:width .25s ease}
.mp-pct{font-family:var(--font-display);font-size:max(12px,.8rem);font-weight:700;color:var(--text-secondary);flex-shrink:0;min-width:2.4em;text-align:right}
.mini-progress.mp-complete{justify-content:center}
/* Rendered with real content before the first score lands (see renderLeft() in app.js), just
   invisible — reserves its actual height so Event Details and everything below it don't jump
   down the moment scoring starts and the bar switches to visible. visibility (not display:none)
   is what keeps the space claimed; it also removes the bar from tab order/hit-testing on its own
   while pending, so no extra aria-hidden/pointer-events handling is needed here. */
.mini-progress.mp-pending{visibility:hidden}
/* Same .95rem as .mp-round above — see the line-height comment on .mini-progress for why these
   two need to match. */
.mp-label{font-family:var(--font-body);font-size:max(12px,.95rem);font-weight:700;color:var(--badge-green-fg)}
/* Shared sizing/coloring for CHECK_ICON_SVG/X_ICON_SVG (app.js) wherever they sit inline in
   text — the mini-progress label above, round/question "Done" badges, per-question correct/
   incorrect stat pills, the Quiz ID "looks good" check, and Team Report lines. currentColor
   picks up whichever color token the surrounding pill/label already resolves to
   (--badge-green-fg, --pts-pos-fg, --txt-red, etc.), so this one rule works correctly in every
   one of those already-themed, already-colorblind-aware contexts without needing its own color
   per place it's used. 1em/stroke-width:4 (not the original .8em/3) — next to the questions'
   own check/X (CORRECT_BADGE_SVG/X_ICON_SVG at .wager-badge scale), the smaller/thinner original
   read as a different, weaker icon rather than the same mark reused consistently. Contexts that
   need a different size (.wager-badge.bg-incorrect, .remove-team button) target `svg` directly
   there, which is more specific than this class and wins. */
.icon-mark{width:1em;height:1em;display:inline-block;vertical-align:-.15em;flex-shrink:0}
/* Sort / Reset / Refresh / Shuffle (app.js ICON_* constants). Separate from .icon-mark because
   those are two-or-three-stroke marks at stroke-width 4 in a 24-unit box, while these are Lucide
   line icons that read correctly at 2.25 — heavier than Lucide's own 2 so they hold up at the
   .7rem these buttons run at, where a 2-unit stroke renders under a physical pixel and goes grey.
   Stroke-only + currentColor, so each icon inherits the contrast-audited text color of whatever
   button it sits in, in every theme and color-vision mode. */
.icon-ui{width:1em;height:1em;display:inline-block;vertical-align:-.15em;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2.25;stroke-linecap:round;stroke-linejoin:round}
/* Icon Style's emoji wrapper (every *_EMOJI string in app.js). A plain text glyph has no
   width/height to size the way .icon-ui's svgs do above — it only responds to font-size, which
   in a small button (.sort-btn is .86rem) renders it noticeably smaller than the pictograph it
   replaced. transform:scale rather than font-size for the per-button boosts below: font-size
   would grow the glyph's own line box and, with it, the button's padded height; a transform only
   enlarges what's already painted, so every one of these buttons stays exactly the size it was
   with the pictograph in it. Un-boosted (scale defaults to 1) everywhere that doesn't opt in
   below, since .wager-badge's own font-size (1.15rem/1.05rem) already sizes an emoji there
   proportionately without help. */
/* line-height:1 (not inherited from whatever button/label surrounds it, which is often the
   browser default ~1.15-1.2) is what makes the flex align-items:center every icon-only button
   below already uses actually center the glyph rather than centering a line-box that's taller
   than the glyph itself and leaves it riding off-centre inside that extra leading. */
.icon-emoji{display:inline-block;line-height:1}
/* Reset carries a heavier nominal stroke than the other three, to match their apparent weight
   rather than their measurements. Its glyph is one big open circle: two strokes far apart around
   a large empty middle, where Sort — sitting immediately beside it — is four strokes packed into
   the same box. The sparse shape reads lighter even though it is not: rasterised at the 12px
   these buttons use, Reset at 2.25 actually put down MORE ink than Sort (0.243 vs 0.209 coverage,
   mean alpha .58 vs .50), so this is a composition effect, not an anti-aliasing or gamma one, and
   no amount of measuring the pixels would have found it — it came from looking at the button.
   3 is where the pair stops looking mismatched; 3.5 overshoots and starts closing up the arc. */
.icon-ui-reset{stroke-width:3}
/* Checkered flag (Final Results). The filled squares are solid currentColor with no stroke — at
   the 16px this header renders, a 4x5-unit square outlined at stroke-width 2.25 would be almost
   entirely stroke and the checker would close up into a blob. The edge rect keeps the default
   stroke but at 1.5 rather than 2.25, for the same reason in reverse: at full weight it eats into
   the squares it is supposed to be containing. */
/* XLSX's spreadsheet icon takes Excel's green, and ONLY on the stroke — no .icon-tinted, so it
   keeps .icon-ui's fill:none. The green here is a hint about the file format, not a picture of an
   object the way the mug and the drum are, and a 38% green wash inside a document outline reads
   as a highlighted page rather than as a spreadsheet. */
.icon-sheet{color:var(--tint-sheet)}
/* The header band is the one filled part, and it is what makes this read as a SPREADSHEET rather
   than a generic table — a plain grid of cells could be anything. Filled at 34% rather than
   solid so the two column dividers still show through the top row instead of the band reading as
   a solid green bar. Landscape, because a spreadsheet is wider than it is tall and the portrait
   document this replaced was indistinguishable from the PDF button beside it. */
.icon-sheet .sh-head{fill:currentColor;fill-opacity:.34;stroke:none}
.icon-flag .fl-cloth{fill:#fff;stroke:none}
.icon-flag .fl-sq{fill:#14161c;stroke:none}
.icon-flag .fl-edge{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round}
/* Each pictograph carries .icon-tinted plus its own class; the class only sets --icon-tint, so
   the two rules below can both read it without repeating a colour.
   These get a FILL as well as a stroke, which is the other half of looking like the emoji they
   replaced: an emoji is a solid coloured shape, and a bare Lucide outline in the right hue still
   reads as a line drawing. The fill is the same colour at 38% rather than 100% so the interior
   strokes — the foam line on the mug, the tension rods on the drum — survive instead of being
   swallowed by a silhouette. Taken from currentColor rather than --icon-tint directly, so the
   .btn-accent override below only has to change one property and the fill follows it. */
.icon-tinted{color:var(--icon-tint);fill:color-mix(in srgb,currentColor 38%,transparent)}
.icon-beer{--icon-tint:var(--tint-beer);--icon-tint-2:var(--tint-beer-2);
  --icon-tint-acc:var(--vivid-beer);--icon-tint-acc-2:var(--vivid-beer-2)}
.icon-drum{--icon-tint:var(--tint-drum);--icon-tint-2:var(--tint-drum-2);--icon-tint-3:var(--tint-drum-3);
  --icon-tint-acc:var(--vivid-drum);--icon-tint-acc-2:var(--vivid-drum-2);--icon-tint-acc-3:var(--vivid-drum-3)}
.icon-trophy{--icon-tint:var(--tint-trophy);--icon-tint-2:var(--tint-trophy-2)}
.icon-mic{--icon-tint:var(--tint-mic);--icon-tint-2:var(--tint-mic-2)}
.icon-heart{--icon-tint:var(--tint-heart)}
.icon-alert{--icon-tint:var(--tint-alert);--icon-tint-2:var(--tint-alert-2)}
.icon-clipboard{--icon-tint:var(--tint-clipboard);--icon-tint-2:var(--tint-clipboard-2)}
/* Game Submission's paper plane: sky-blue outline, pale keel fold (.ip-2), lighter wind lines (.ip-3). */
.icon-plane{--icon-tint:var(--tint-plane);--icon-tint-2:var(--tint-plane-2);--icon-tint-3:var(--tint-plane-3)}
/* Green body + silver neck, like the 🧪 emoji it replaced — a deliberate reversal of this icon's
   original "arbitrary purple, picked only to stay distinct from every other tint" choice (see the
   removed note this replaced). --tint-sheet/--tint-mic reused as-is rather than inventing new
   hex values: this app already has an audited green (XLSX's own icon) and an audited silver
   (the mic), and neither needs its own one-off variant just for this icon to borrow it. */
.icon-flask{--icon-tint:var(--tint-sheet);--icon-tint-2:var(--tint-mic)}
/* Per-mode accent (set by data-mode on <html>, see syncGameModeSelect in app.js): a bar under the
   header and the left edge of every section header, so the mode is readable at a glance. The same
   three audited tints as the Game Mode pictograms; tests/v21-1.test.js holds each to 3:1 against the
   header and card backgrounds in every theme x color vision combination. */
[data-mode="regular"]{--mode-accent:var(--tint-trophy)}
[data-mode="theme"]{--mode-accent:var(--tint-flask)}
[data-mode="tune"]{--mode-accent:var(--tint-cap)}
[data-mode="rivals"]{--mode-accent:var(--tint-heart)}
/* Light theme: vivid accents. They are borders/bars, not text, so they only need 3:1 (checked in tests/v21-1.test.js), which leaves far more saturation than the text-safe tints above. Color Vision modes get their own palettes: red-green = orange / blue / rose, blue-yellow = magenta / vermilion / green (Okabe-Ito based, each set kept apart for that deficiency). */
[data-theme="light"][data-mode="regular"]{--mode-accent:#b57d00}
[data-theme="light"][data-mode="theme"]{--mode-accent:#8a3ffc}
[data-theme="light"][data-mode="tune"]{--mode-accent:#0a84cc}
[data-theme="light"][data-mode="rivals"]{--mode-accent:#c62741}
/* Light theme section headers pick up a faint wash of the mode accent instead of flat grey (9% keeps every header text pair above AA; audited in the browser). */
[data-theme="light"] .section-header{background:color-mix(in srgb,var(--mode-accent) 9%,var(--bg-card-alt))}
[data-theme="light"][data-cb="1"][data-mode="regular"]{--mode-accent:#c76b00}
[data-theme="light"][data-cb="1"][data-mode="theme"]{--mode-accent:#0a6fe0}
[data-theme="light"][data-cb="1"][data-mode="tune"]{--mode-accent:#c4177f}
[data-theme="light"][data-cb="1"][data-mode="rivals"]{--mode-accent:#00806a}
[data-theme="light"][data-cb="2"][data-mode="regular"]{--mode-accent:#d6007f}
[data-theme="light"][data-cb="2"][data-mode="theme"]{--mode-accent:#c4510a}
[data-theme="light"][data-cb="2"][data-mode="tune"]{--mode-accent:#00946a}
[data-theme="light"][data-cb="2"][data-mode="rivals"]{--mode-accent:#5a3fd0}
[data-theme="dark"][data-cb="1"][data-mode="regular"]{--mode-accent:#e69f00}
[data-theme="dark"][data-cb="1"][data-mode="theme"]{--mode-accent:#56b4e9}
[data-theme="dark"][data-cb="1"][data-mode="tune"]{--mode-accent:#cc79a7}
[data-theme="dark"][data-cb="1"][data-mode="rivals"]{--mode-accent:#f0e442}
[data-theme="dark"][data-cb="2"][data-mode="regular"]{--mode-accent:#ff66cc}
[data-theme="dark"][data-cb="2"][data-mode="theme"]{--mode-accent:#ff8a5c}
[data-theme="dark"][data-cb="2"][data-mode="tune"]{--mode-accent:#00cc88}
[data-theme="dark"][data-cb="2"][data-mode="rivals"]{--mode-accent:#ffd84d}
/* Game Mode: Regular = trophy-gold target, Theme Night = flask-purple sparkles with gold glints
   (--tint-theme-2, not --accent-gold: the light theme's #ffb300 is only 1.8:1 on white),
   Name That Tune = cap-blue note. Every tint is checked against --bg-card in all six theme x color
   vision combinations by tests/contrast-modes.test.js. */
.icon-mode-regular{--icon-tint:var(--tint-trophy);--icon-tint-2:var(--tint-trophy-2)}
.icon-mode-theme{--icon-tint:var(--tint-flask);--icon-tint-2:var(--tint-theme-2)}
.icon-mode-tune{--icon-tint:var(--tint-cap);--icon-tint-2:var(--tint-cap)}
.icon-mode-rivals{--icon-tint:var(--tint-heart);--icon-tint-2:var(--tint-heart)}
/* Game Mode row: the dropdown with its current mode's pictograph beside it. */
.game-mode-picker{display:inline-flex;align-items:center;gap:8px}
/* Pictograph mode: the drawn icon sits beside the select (an <option> can only hold text). Emoji
   mode leaves the span empty and puts the emoji in the option text instead. */
#gameModeIcon:empty{display:none}
/* Fixed-size pictograph (v21.47's stretch/aspect-ratio sizing collapsed to 0 width, and v21.48's grid
   version overlapped the select on iOS Safari). An explicit square can't depend on browser layout quirks;
   the select is trimmed on touch screens (16px font, min-height 44px) so the pair stays compact. */
#gameModeIcon{display:flex;flex-shrink:0}
#gameModeIcon .icon-ui,#gameModeIcon .icon-emoji{width:2rem;height:2rem;flex-shrink:0}
#gameModeSelect.theme-select{min-height:2.25rem;padding-top:2px;padding-bottom:2px}
/* Take the Tour's own icon — a waving hand, since the ℹ️ it had before this read as an
   unlabeled dot at mobile sizes. --accent-gold rather than a bespoke tint: it's already
   contrast-audited for both themes and every color-vision mode (unlike a new one-off hex pair),
   and reads as a plain "hi, welcome" yellow without implying anything else already spoken for
   (gold/beer, cyan/accent, magenta/accent). One SVG, no separate light/dark variant — the
   --accent-gold token itself already carries the light/dark split, same as --icon-tint does for
   every other icon here. */
/* transform: tilted ~15° to match the lean the 👋 platform emoji it stands in for is drawn with
   (Settings > Take the Tour) — an upright hand read as a "stop" gesture rather than a wave. */
.icon-hand{--icon-tint:var(--accent-gold);transform:rotate(-15deg)}
/* JD Form's Guy Fawkes mask — purple plate (--tint-flask, freed when the flask icon
   moved to green) with a thin 1.4 outline, and the mustache/goatee as SOLID fills with no
   stroke: at .icon-ui's 2.25 stroke the two features merged into one blob at button size. */
.icon-fawkes{--icon-tint:var(--tint-flask);stroke-width:1.4}
.icon-fawkes .ip-2,.icon-tinted.icon-fawkes .ip-2{fill:#fff;stroke:none}
/* Light theme only: a pale purple wash plate with deep purple mustache and goatee. */
[data-theme="light"] .icon-tinted.icon-fawkes{fill:color-mix(in srgb,var(--icon-tint) 12%,#fff)}
[data-theme="light"] .icon-fawkes .ip-2,[data-theme="light"] .icon-tinted.icon-fawkes .ip-2{fill:#12041f}
/* Mustache: the first .ip-2 path gets a hairline same-colour stroke so its fine tips stay visible (goatee stays a plain fill). */
.icon-fawkes path.ip-2:nth-of-type(2){stroke:#fff;stroke-width:.25;stroke-linejoin:round}
[data-theme="light"] .icon-fawkes path.ip-2:nth-of-type(2){stroke:#12041f}
.icon-shuffle{--icon-tint:var(--tint-shuffle)}
/* Test Sounds bar: Crash echoes 💥 — a jagged red-orange outer burst (--tint-drum, the identifying
   outline held to WCAG AA), an orange mid layer (--vivid-drum) and a small bright-yellow core star
   (--vivid-beer), the emoji's own red-body / hot-centre gradient. Horn echoes 🎺 in the trophy's
   brass gold. --tint-drum and --tint-trophy are both contrast-audited (>=4.5:1, WCAG AA) on
   --bg-card in Dark and Light; --vivid-drum / --vivid-beer are interior detail (each only has to
   separate from the layer it sits on, both themes). */
.icon-snd-crash{--icon-tint:var(--tint-drum)}
/* Each layer solid (not the 38% .icon-tinted wash) and un-stroked so the spikes stay sharp — the
   emoji is a saturated shape, not a faint one. The .ip-2 selector carries .icon-tinted too so it
   outranks the generic `.icon-tinted [class^="ip-"]` interior rule further down (equal specificity
   there, and that one wins on source order otherwise — which had painted the core red not yellow). */
.icon-snd-crash .snd-burst{fill:var(--icon-tint);stroke:none}
.icon-snd-crash .snd-mid{fill:var(--vivid-drum);stroke:none}
.icon-snd-crash.icon-tinted .ip-2{fill:var(--vivid-beer);stroke:none}
/* Horn = 📢 loudspeaker, tinted silver. Body solid; the grip + sound-wave arcs are strokes.
   Same specificity bump as Crash above, for the same source-order reason. */
.icon-snd-horn{--icon-tint:var(--tint-mic);--icon-tint-2:var(--tint-mic-2)}
.icon-snd-horn .snd-body{fill:var(--icon-tint);stroke:none}
.icon-snd-horn.icon-tinted .ip-2{fill:none;stroke:var(--icon-tint-2)}
/* Settings > App Preferences (Save/Load) and > Craft Prize Eligible List (Copy/TXT) — the only
   four pictographs left with no colour of their own after every OTHER Settings row got one.
   --tint-cap reused for Save's floppy disk (this app's existing audited blue) and --tint-mic for
   its silver label/window detail, same reasoning as icon-flask's reuse above.
   --accent-gold for Load's folder needs no second tone — it's one path, not a picture split into
   separate parts — and comes with color-vision-mode overrides already, for free, that a bespoke
   --tint-load never would. TXT's page reuses --tint-mic/-2 for the same plain silver-on-silver
   .icon-mic already is; Copy reuses .icon-clipboard verbatim below, not a class of its own — it's
   the exact same clipboard shape already drawn for ICON_CLIPBOARD_PICT (app.js), just missing the
   classes that would have tinted it the same way. */
.icon-save{--icon-tint:var(--tint-cap);--icon-tint-2:var(--tint-mic)}
.icon-load{--icon-tint:var(--accent-gold)}
.icon-txt{--icon-tint:var(--tint-mic);--icon-tint-2:var(--tint-mic-2)}
/* Play Horn's play triangle — filled, and keeping .icon-ui's own stroke rather than clearing it.
   The stroke is what rounds the three corners (stroke-linejoin:round, inherited), so the glyph
   matches the rounded ends every other mark in this family is drawn with instead of coming to
   three hard points. Filled as well as stroked because at this size an outline-only triangle
   reads as a hollow arrow. */
.icon-play .pl-tri{fill:currentColor}
/* PDF: a page with a download arrow through it, not the closed book it was. The arrow is the
   only one of the five candidates that survived the 13px this button actually renders at, and it
   is what keeps it distinct from the spreadsheet sitting immediately beside it. */
.icon-pdf{--icon-tint:var(--tint-pdf)}
.icon-camera{--icon-tint:var(--tint-cap)}
/* Second and third colours, for the icons whose emoji had more than one: the cream head of the
   drum against its red shell and its wooden sticks, the foam on the beer, the trophy's darker
   plinth, the mic's darker yoke, the pale clip on the clipboard. Each part needs fill and stroke
   restated rather than inherited — both resolve currentColor at the element that declares them,
   so a child that only changes `color` would still inherit the PARENT's already-resolved paint.
   Only the primary colour is held to 3:1 against every surface: that is the icon's outline, the
   part that says which icon this is. The secondaries are interior detail — the foam on a real
   beer emoji is white and vanishes on a white background too — and only have to separate from
   the primary. */
.icon-tinted [class^="ip-"]{fill:color-mix(in srgb,currentColor 38%,transparent);stroke:currentColor}
.icon-tinted .ip-2{color:var(--icon-tint-2,var(--icon-tint))}
.icon-tinted .ip-3{color:var(--icon-tint-3,var(--icon-tint))}
/* The beer's foam cap specifically: a real beer's head is a solid pale cream, so this one part
   opts out of the 38%-opacity "interior detail" treatment above — a full --vivid-beer-2 (#fff1cf,
   deliberately NOT the light theme's darkened --tint-beer-2) fill with an amber (--icon-tint)
   outline so the cream cap still reads on a white background instead of vanishing into it. Every
   place the pictograph renders — main app, FAQ, both themes — picks this up. */
.icon-beer .ip-2{fill:var(--vivid-beer-2);stroke:var(--icon-tint)}
/* Drum: the red shell fills solid (not the 38% .icon-tinted wash) so it reads as the 🥁 emoji's
   body rather than a hollow outline; the drumhead borrows the beer cap's cream opt-out above; and
   three tension rods lace down the shell (.ip-3 for colour, .dr-rod only trims the stroke weight
   so they don't blob at button size). All three land on every drum instance — sound test, Start
   Drumroll, FAQ. */
.icon-drum .dr-shell{fill:currentColor;stroke:currentColor}
.icon-drum .ip-2{fill:var(--vivid-beer-2);stroke:var(--icon-tint)}
.icon-plane .ip-2{fill:var(--icon-tint-2);stroke:var(--icon-tint)}
.icon-plane .ip-3{fill:none}
.icon-drum .dr-rod{fill:none;stroke-width:1.9}
/* On the accent button the shared `[class^="ip-"]` stroke rule pulls every stick/rod stroke
   toward --icon-stroke-ink, which in Light mode is nearly white — the drumsticks then blend into
   the cream drumhead's own outline where they meet it. Keep the sticks a real brown instead
   (mixed toward black, not white), dark enough to read against both the cream head and the teal
   Light-mode button. The rods sit on the dark-red shell and don't have this problem, so they're
   left alone. */
.btn-accent .icon-drum .dr-stick{stroke:color-mix(in srgb,currentColor 68%,#000)}
/* On a solid accent fill (Start Drumroll, Choose Craft Prize Winner) the tints above
   cannot be used as-is: --accent-cyan-solid runs from #00ffff to #00654c across the six
   theme x colour-vision combinations, so a value legible on one is invisible on another. Mixing
   towards currentColor — which here resolves to the button's inherited --on-accent-cyan, already
   audited against its own fill — moves each tint in whichever direction that particular fill has
   contrast to spare, automatically and in every mode. At 60% the hue still reads: a deep brick
   drum on bright cyan, a soft salmon one on dark teal. These are decoration next to their own
   text labels, not the "visual information required to identify" the button, so 1.4.11's 3:1 is
   not the binding constraint on them the way it is on the tints themselves. */
/* Every part is pulled the SAME distance towards black, primary and secondaries alike. Mixing
   only the primary inverted the icon: the drum's head is lighter than its shell on a card, but
   with the shell mixed and the head left alone it came out darker than the shell on the button.
   One shared ratio keeps every part's relative lightness.
   Both themes use the vivid tints and mix towards black here, rather than each theme using its
   own tints and its own foreground. That is a deliberate choice of appearance over measurement:
   the vivid-on-black rendering is the one that reads as the emoji, and light mode's own tints
   mixed towards white came out as a pale wash of the same shape. See the note on the light-mode
   figures in the v18.62 changelog — these are decoration sitting beside their own text label
   ("Start Drumroll", "Choose Craft Prize Winner"), not the information that identifies the
   button, which is what 1.4.11 covers. */
.btn-accent .icon-tinted,.btn-accent .icon-tinted [class^="ip-"]{
  color:color-mix(in srgb,var(--part-tint,var(--icon-tint-acc,var(--icon-tint))) 78%,#000)}
.btn-accent .icon-tinted .ip-2{--part-tint:var(--icon-tint-acc-2,var(--icon-tint-2,var(--icon-tint)))}
.btn-accent .icon-tinted .ip-3{--part-tint:var(--icon-tint-acc-3,var(--icon-tint-3,var(--icon-tint)))}
/* The Beer Round badge, its stripe and the CB Prize tag used to opt out of the tint entirely and
   inherit their own gold, on the grounds that the context was already saying "beer". It was the
   wrong call: a mug rendered in one flat gold has no foam, and the foam is most of what makes it
   read as a mug rather than a tankard-shaped blob. They take the full tint now, amber body and
   cream head, like every other beer in the app.
   The reason for the old exemption was real, though, and it is handled below instead: amber on
   the gold wash measured 2.94:1 in LIGHT blue-yellow mode, where that wash turns pink. That is
   the only one of the six modes it was ever a problem in, and a mode-scoped darkening of the
   tint is a far smaller concession than dropping the colour in all six. */
/* On a solid fill the pictographs are painted OPAQUE, not at the 38% they use on a card. At 38%
   the button's own cyan came up through the mug and the drum shell and tinted them — the icon
   read as a cyan object rather than an amber or red one, which is the whole thing the tints were
   added to fix. Opaque also changes what has to clear the button: only the outer silhouette
   touches the cyan now, so what has to be legible against it is the stroke ringing that
   silhouette rather than every part of the icon.
   The stroke does two jobs: it keeps the interior lines from being swallowed by the fill —
   without it an opaque icon is a silhouette, and the beer loses its two vertical ridges and the
   drum loses its head — and, because it rings the outside as well, it is what separates the icon
   from the button. Which direction it is pulled therefore depends on the button, not the icon:
   away from a bright cyan fill means darker, away from a mid-dark teal one means lighter. The
   fills stay vivid in both (see above); only the outline flips. --icon-stroke-ink and
   --icon-stroke-mix carry that, and the light share is much smaller than the dark one because
   #007ea8 gives white itself only 4.4:1 — there is little room, so the outline has to go most of
   the way to white to clear 3:1 against it.
   This is also why the two icons' paths are ordered back-to-front in app.js rather than in
   Lucide's original order. Opaque fills paint over each other, so the mug body drawn last would
   erase the ridges and foam, and the drum shell drawn after the head would take a bite out of the
   cream oval. Translucent fills hid that; nothing about the order looked wrong until now. */
.btn-accent .icon-tinted,.btn-accent .icon-tinted [class^="ip-"]{
  fill:currentColor;stroke:color-mix(in srgb,currentColor var(--icon-stroke-mix),var(--icon-stroke-ink))}
.icon-mark polyline{fill:none;stroke:currentColor;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}

/* Base (desktop-hidden) state for the mobile bottom sheet's peek strip + backdrop — declared
   here, before the @media block below, so that block's display:flex/block override actually
   wins at narrow widths instead of losing to this display:none on source-order (same selector
   specificity either way, so whichever comes LAST in the file wins — these must come first). */
.sidebar-backdrop{display:none}
.mobile-bottom-dock{display:none}

/* QUESTION TIMER — one shared look for the desktop and mobile copies of the widget (see
   .qtimer-desktop / .qtimer-mobile below for where each one actually sits). Kept visually out
   of the way of the scoring UI on purpose: it never overlaps game content, only the scores
   list/peek strip it's docked against — see the placement rules further down. Centered (not
   space-between) so the countdown and its Start/Reset buttons read as one centered control
   cluster rather than being pulled apart to the widget's edges. No box-shadow on the shared
   rule — only .qtimer-desktop gets one (see below); the collapsed mobile peek-strip copy
   doesn't need the extra visual weight since it's not overlaying anything. */
.qtimer{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;background:var(--bg-card-alt)}
/* Advanced Settings > Timer Widget: Hidden. Set on <html> by applyPrefs() in app.js. Hides both
   copies of the widget (desktop and mobile) with one rule rather than duplicating it per class. */
[data-timer-hidden] .qtimer{display:none}
/* A transparent 4px border is reserved here at rest, ALWAYS — not "no border" — so warn/crit/
   over below only ever change its COLOR (transparent -> --bg-primary), never its width. This
   used to be genuinely no border at rest, with warn/crit/over each adding their own halo-ring
   border on top; that meant the box actually grew a few px the instant an alert state kicked in
   (and again between warn's 3px and crit/over's 4px), which read as the whole timer — and
   whatever sits next to it — jarringly shifting mid-countdown rather than a deliberate "pop".
   Reserving the same 4px up front keeps the box's rendered size fully constant across every
   state, at the cost of the border-width escalation (3px warn -> 4px crit/over) that used to be
   a second, color-independent urgency signal — background/text color already carries that. */
.qtimer-display{font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-weight:700;font-size:1.5rem;line-height:1;padding:5px 10px;border:4px solid transparent;border-radius:6px;transition:background-color .2s ease,color .2s ease,border-color .2s ease}
/* Reserves the minus sign's width at all times (opacity, not display:none, so the layout space
   stays even while hidden) — the countdown going negative then only reveals a glyph already
   sitting in its slot instead of widening the whole display. */
.qt-sign{opacity:0}
.qtimer-display.qt-neg .qt-sign{opacity:1}
.qtimer-btns{display:flex;gap:6px;flex-shrink:0}
/* Progress bar under the countdown (v22.53). Shrinks toward the LEFT as time runs out: the fill is
   a full-width element scaled on X from its left edge (transform, no layout, no animation — the
   200ms tick just sets the scale). Deliberately ONE neutral high-contrast colour the whole way
   down, never gold/red: gold-vs-red is the pair colour-vision users confuse, so urgency is carried
   by POSITION instead — two fixed notches (--qt-n1 / --qt-n2, set from JS) mark where the 1:00 and
   0:30 warn/crit thresholds fall, and the fill visibly passes them. The notches are cut in
   --bg-primary so they show against both the fill and the track in either theme. flex-basis:100%
   puts the bar on its own line under the display/buttons in both widget copies. No flashing. */
.qtimer-bar{opacity:.3;transition:opacity .4s ease;position:relative;flex:0 0 100%;height:4px;margin-top:2px;border-radius:2px;background:var(--border-control);overflow:hidden}
.qtimer-bar.qt-live{opacity:1}
@media (prefers-reduced-motion:reduce){.qtimer-bar{transition:none}}
/* Light theme: the "time left" fill is black, so the "time elapsed" track is a pale blue-grey instead of the mid-blue --border-control, which sat too close to it. */
[data-theme="light"] .qtimer-bar{background:#c3d0e6}
.qtimer-bar-fill{position:absolute;inset:0;background:var(--text-primary);transform-origin:left center;transform:scaleX(1)}
/* On reset the fill used to snap to full, which read as a blink (and, from overtime, a bright flash). While not live, refill it with a quick ease-out sweep instead, running alongside the fade-out. */
.qtimer-bar:not(.qt-live) .qtimer-bar-fill{transition:transform var(--qt-refill-dur,.3s) ease-out}
/* Reset from overtime: drop straight to the dim idle opacity (no fade) so the refilling fill is never shown bright. */
.qtimer-bar.qt-refill{transition:none}
@media (prefers-reduced-motion:reduce){.qtimer-bar:not(.qt-live) .qtimer-bar-fill,.qtimer-bar.qt-refill{transition:none}}
.qtimer-bar::before,.qtimer-bar::after{content:"";position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background:var(--bg-primary);z-index:1;display:none}
.qtimer-bar[data-n1]::before{display:block;left:var(--qt-n1)}
.qtimer-bar[data-n2]::after{display:block;left:var(--qt-n2)}
.qtimer-btn{min-height:2rem;padding:5px 10px;border:1px solid var(--border-control);border-radius:6px;background:var(--bg-card);color:var(--text-primary);font-family:var(--font-body);font-weight:700;font-size:max(12px,.8rem);cursor:pointer;touch-action:manipulation;white-space:nowrap;transition:var(--transition)}
.qtimer-btn:hover{background:var(--bg-hover)}
.qtimer-btn:disabled{opacity:.4;cursor:not-allowed}
/* Icon-only (play/pause, no "Start"/"Pause"/"Resume" label) — same fixed square treatment as
   .qtimer-reset below, so the toggle button never changes size as its icon cycles between
   Start/Pause/Resume. The accessible name (what the icon alone can't convey) comes from
   aria-label, kept in sync with the icon by renderQtControls() in app.js. */
.qtimer-btn.qtimer-toggle{width:2rem;height:2rem;min-height:2rem;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:1.1rem;line-height:1}
/* SVG, not the ▶/⏸ text glyphs this replaced: those are Unicode symbols with their own default
   emoji presentation on iOS/Android, which most browsers render from a fixed-color system emoji
   font — `color` on the button (already the audited --text-primary/--on-accent-gold pairing that
   changes with the Start/Pause/Resume state, in every theme × color-vision-mode combination) had
   no effect on it, so the icon could end up looking mismatched against its own button fill,
   or just illegible, depending entirely on the platform's emoji art rather than this app's
   palette. fill:currentColor makes the icon inherit that already-audited color instead, the same
   way the text glyph should have. width/height:1em (not a fixed rem) keeps it sized off the
   button's own font-size exactly like the glyph was, so it still scales with the Settings > Size
   font control. */
.qtimer-btn.qtimer-toggle svg{width:1em;height:1em;display:block;fill:currentColor}
/* +/-30s nudge buttons — Advanced Settings > Timer Stepper Buttons, hidden by default (see
   [data-timer-steppers] below, set on <html> by applyPrefs() in app.js) since most hosts drive
   the countdown from Start/Pause/Reset alone; shown for hosts who want fine control mid-timer.
   Each button sits directly in .qtimer's own flex row now (−30 before .qtimer-display, +30
   after it) rather than sharing a wrapper, so the two visually flank the countdown instead of
   both landing on the same side of it. */
.qtimer-btn.qtimer-step{display:none;padding:5px 8px;font-size:max(12px,.75rem)}
[data-timer-steppers] .qtimer-btn.qtimer-step{display:inline-block}
/* Only the control that's actually "live" right now gets the bold treatment — same halo-ring
   language as .qtimer-display above (a --bg-primary ring separating a solid fill from the
   --bg-card-alt bar behind it), reusing the same already-AAA-paired tokens. Start (idle) and
   Reset (idle) stay the plain neutral .qtimer-btn outline — nothing to signal yet. */
/* Pause: shown while the countdown is actually running — solid gold fill + halo ring, same
   --accent-gold/--on-accent-gold pairing qt-warn uses. */
.qtimer-btn.qtimer-pause{background:var(--accent-gold);border:2px solid var(--bg-primary);color:var(--on-accent-gold)}
.qtimer-btn.qtimer-pause:hover{filter:brightness(1.15)}
/* Resume: shown while paused — a ring only, no fill. Paused isn't as urgent as "running and
   about to expire", so it gets the gold outline without the loud solid fill Pause/Reset-active
   carry; --text-primary already clears AAA against the unchanged --bg-card fill underneath. */
.qtimer-btn.qtimer-resume{border:2px solid var(--accent-gold);color:var(--text-primary)}
/* Reset: neutral while idle (nothing to reset), solid red + halo ring once a timer is actually
   running or paused — same --danger-solid-bg/#fff pairing used for destructive
   states elsewhere. Icon-only (no "Reset" label) and a fixed equal width/height — rather than sizing to
   its content like every other .qtimer-btn — so the docked and deployed copies of the widget
   render this button identically instead of the deployed one being a wider text+icon pill.
   Font-size bumped up from the shared .8rem base so the glyph reads clearly at this smaller
   square size. */
/* The ↺ glyph's own ink sits almost entirely above its baseline (negligible descent), so
   centering the line box (align-items:center) still leaves the visible glyph looking low —
   asymmetric bottom padding (vs even 0 all around) shifts the centered content up ~3px to
   compensate for that glyph-specific baseline skew, without touching the button's own size. */
/* padding:0, not the 0 0 6px this carried while it held a ↺ text glyph. That bottom padding was
   a nudge to counteract where the glyph's own font metrics parked it inside the line box; the SVG
   that replaced it is drawn centred in its viewBox, so the same nudge would now push a centred
   icon off-centre instead of correcting one. */
.qtimer-btn.qtimer-reset{width:2rem;height:2rem;min-height:2rem;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:1.15rem;line-height:1}
.qtimer-btn.qtimer-reset .icon-ui{width:1.1em;height:1.1em}
.qtimer-btn.qtimer-reset .icon-emoji{transform:scale(1.1)}
.qtimer-btn.qtimer-reset-active{background:var(--danger-solid-bg);border:2px solid var(--bg-primary);color:#fff}
.qtimer-btn.qtimer-reset-active:hover{filter:brightness(1.15)}

/* Alert states — background/text reuse the app's own already-AAA-paired solid tokens
   (--accent-gold/--on-accent-gold, --danger-solid-bg/#fff) rather than inventing new colors, so
   every theme x color-vision-mode combination this app already supports (dark/light x off/
   red-green/blue-yellow) stays correct for free: --accent-gold becomes the tritanopia-safe pink
   substitute under data-cb="2", --danger-solid-bg becomes the deuteranopia/protanopia-safe
   orange substitute under data-cb="1", etc.
   Each state also gets a border color of --bg-primary — the page's own base color, one step
   darker (light theme: lighter) than the --bg-card-alt bar the badge sits on — so it reads as a
   ring cut into the bar rather than a flat patch flush with it. Needs no contrast check of its
   own: border/non-text contrast (WCAG 1.4.11) only asks for 3:1 against what's adjacent, and
   --bg-primary vs --bg-card-alt is already the app's own foundational surface split. Width is
   always the 4px .qtimer-display already reserves at rest (see its own comment) — only the
   color changes here, transparent -> --bg-primary, so no state ever resizes the box.
   The brightness floor (.75, not a near-black .55) is a hard WCAG floor, not a stylistic
   choice: at the darkest point of the pulse, --on-accent-gold's #000 text sits on top of
   --accent-gold, and the worst combination this app ships — dark theme + tritanopia mode,
   where --accent-gold becomes #ff66cc — only clears 4.5:1 (AA) against black text down to
   ~.73 brightness; every other theme/color-vision pairing has more headroom than that one.
   .75 keeps a safety margin above that floor in every combination. --danger-solid-bg/#fff
   (qt-crit) has no such ceiling — white text on a darkening red only gains contrast — so it
   isn't the binding constraint here.
   Only qt-crit still pulses — qt-warn's color/border change already reads as "time is short"
   on its own, and flashing two different states at two different speeds (2s vs 1.5s previously)
   read as more agitated than the countdown actually warrants. qt-crit's own cycle is slowed to
   2.9s (from 1.5s) for the same reason, with the .75 floor left untouched. */
.qtimer-display.qt-warn{background:var(--accent-gold);color:var(--on-accent-gold);border-color:var(--bg-primary);transition-duration:1s}
@media (prefers-reduced-motion:reduce){.qtimer-display.qt-warn{transition-duration:.2s}}
.qtimer-display.qt-crit{background:var(--danger-solid-bg);color:#fff;border-color:var(--bg-primary);animation:qtFlash 2.9s ease-in-out infinite}
.qtimer-display.qt-over{background:var(--danger-solid-bg);color:#fff;border-color:var(--bg-primary)}
/* An animated filter — brightness(), as this used to be — forces the element onto its own
   compositing layer for as long as the animation is running, even at the 0%/100% keyframes where
   the computed value is a no-op. That layer's own edge antialiasing reads as a faint grey halo
   traced around the box wherever it sits against a light background — invisible in dark mode,
   where the page behind it is already dark enough to hide it, but plainly visible in light mode,
   which is what it looked like: a dark overlay sitting on top of the timer rather than the timer
   itself pulsing. An inset box-shadow filled with the box's own radius (a huge spread, zero blur)
   is a normal paint op with no such layer, and rgba(0,0,0,.25) over the fill is the exact
   equivalent darkening — result = original x (1-.45) is the same arithmetic a brightness(.55)
   would be doing. Border and text are untouched either way: the border already had its own
   resting colour transition, never part of this pulse, and white text over a darkening red only
   gains contrast as the fill goes darker, so nothing here reopens the contrast floor the old
   comment on this block used to defend. The dip is .45 (was .25 — too faint to register at a
   glance across a room); only qt-crit pulses, and its white-on-red only improves as it darkens. */
@keyframes qtFlash{0%,100%{box-shadow:inset 0 0 0 0 rgba(0,0,0,0)}50%{box-shadow:inset 0 0 0 999px rgba(0,0,0,.45)}}
/* qt-over doesn't pulse — but crossing 0:01 -> 0:00 used to chop the flash off wherever it
   happened to be in its cycle and snap the box back with no transition, and waiting out however
   much of a 2.9s cycle was left (the fix before this one) traded that snap for a settle that
   could take most of 3 seconds — too slow for the one moment a host is most likely watching this
   number. qtSetDisplayClass in app.js now freezes whatever box-shadow the pulse was actually
   showing at the instant of crossing as an inline style, adds this class, and flips that inline
   value to transparent on the next frame — a plain CSS transition, unrelated to qtFlash's own
   timing, so however far into a beat the pulse was, it always finishes over the same short .35s
   rather than up to 2.9s. */
.qtimer-display.qt-settle-fast{transition:box-shadow .35s ease-out}
@media(prefers-reduced-motion:reduce){
  .qtimer-display.qt-crit{animation:none}
  .qtimer-display.qt-settle-fast{transition:none}
}
/* Advanced Settings > Timer Pulse: Hidden. Set on <html> by applyPrefs() in app.js. The crit
   background/text/border still apply (they're the actual "time's nearly up" signal) — this only
   drops the flashing animation for hosts who find it distracting. */
[data-timer-no-pulse] .qtimer-display.qt-crit{animation:none}
[data-timer-no-pulse] .qtimer-display.qt-settle-fast{transition:none}

/* Pinned to the bottom of the scores column (#sidebar / .col-right), overlaying .scores-list
   rather than sitting below it — the extra padding-bottom on .scores-list (its CSS rule,
   further down) reserves room so the last team row can still scroll up clear of it, and every
   row above that scrolls BEHIND the timer as the list scrolls, rather than the timer
   displacing the list. This same element and rule is what's visible on mobile once the scores
   sheet is expanded (#sidebar is shared across breakpoints, only repositioned/resized by the
   mobile media query below) — flush against the sheet's own bottom edge, so there's no gap
   between the sheet and the timer, and it only carries a drop shadow while a real overlay like
   this actually needs the separation; the collapsed mobile dock copy (.qtimer-mobile) doesn't
   get one. Extra bottom padding via env(safe-area-inset-bottom): this element is positioned
   absolute, so it's placed relative to #sidebar's padding BOX edge and ignores #sidebar's own
   padding-bottom entirely — without its own inset here, the mobile expanded sheet's Start/Reset
   buttons render flush against the true screen edge, under the iPhone Home Bar. */
/* The leading --edge-fade layer is the upward "scrollable content passes under this pinned bar"
   cue for the bottom of .scores-list (this bar overlays that edge) — the counterpart to the
   downward cast on .sort-mode-label. --shadow-lg stays as the outer lift of the whole bar. */
.qtimer-desktop{position:absolute;left:0;right:0;bottom:0;z-index:5;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--border-strong);box-shadow:0 -7px 11px 0 var(--edge-fade),var(--shadow-lg)}
/* Tablet and up: the shared .qtimer look is sized for the cramped mobile peek-strip, which left
   the countdown — and especially the play/reset glyphs — noticeably small everywhere .qtimer-
   desktop actually renders at size: the desktop sidebar AND the tablet expanded scores sheet,
   both of which have plenty of room. v21.17: now at every width, so the timer inside the deployed
   phone sheet matches the big timer in the docked strip (.qtimer-mobile) instead of staying small. */
@media(min-width:0){
  .qtimer-desktop .qtimer-display{font-size:2.15rem;padding:6px 14px}
  .qtimer-desktop .qtimer-btn{min-height:2.5rem;padding:7px 14px;font-size:max(12px,.95rem)}
  .qtimer-desktop .qtimer-btn.qtimer-toggle,
  .qtimer-desktop .qtimer-btn.qtimer-reset{width:2.5rem;height:2.5rem;min-height:2.5rem;font-size:1.35rem}
  /* The toggle/reset glyphs (an SVG in Pictograph mode) inherit width:1em from the base rule —
     ~1.35rem in a 2.5rem box, which reads undersized at this larger button. Bump the icon itself
     so it fills the enlarged button the way it does at the base mobile size. min-width + flex-
     shrink:0 because the play/pause <svg> (unlike the reset icon, which carries .icon-ui) is a
     bare flex child with no shrink guard of its own and was collapsing to a sliver. */
  .qtimer-desktop .qtimer-btn.qtimer-toggle svg{width:1.5em;height:1.5em;min-width:1.5em;flex-shrink:0}
  .qtimer-desktop .qtimer-btn.qtimer-reset .icon-ui{width:1.15em;height:1.15em}
  .qtimer-desktop .qtimer-btn.qtimer-toggle .icon-emoji,
  .qtimer-desktop .qtimer-btn.qtimer-reset .icon-emoji{transform:scale(1.1)}
  .qtimer-desktop .qtimer-btn.qtimer-step{padding:6px 12px;font-size:max(12px,.85rem)}
}

/* Settings backdrop dims the page behind the dropdown exactly like the scores drawer's own
   backdrop dims the page behind it — same rgba/opacity/transition values, reused rather than
   invented fresh. Unlike the scores backdrop this isn't gated to a mobile media query: the
   settings dropdown itself opens at every viewport width, so its dimming does too. z-index 255
   sits below .header's own 260 (not above it) so the header bar and the panel it contains —
   both already inside that same stacking context — stay crisp on top of the dim instead of
   being darkened along with the rest of the page. It also sits above the mobile scores sheet
   (.col-right.open, 250) and bottom timer dock (245), so opening settings while the scores
   sheet is expanded dims (and the header/panel still render above) the sheet too, rather than
   the sheet poking through undimmed. */
.settings-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.45);opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:255}
.settings-backdrop.show{opacity:1;pointer-events:auto}

/* 768px (was 900px) — 900 was flipping ordinary laptop/small-desktop windows into the mobile
   bottom-sheet layout well before they actually ran out of room for the two-column game+scores
   view (col-left's own 300px min-width plus the 380px sidebar and 6px drag handle only need
   ~690px, so 900 was giving up ~200px of usable desktop width for no reason). 768 lines up with
   the standard tablet-portrait cutoff instead. */
@media(max-width:768px){
  /* Bottom sheet with a persistent "peek" strip: a slim bar stays docked to the bottom of the
     screen at all times, showing a live top-3 ticker so scores are glanceable without opening
     anything. Tapping it (or the grab handle once open) slides up a full sheet with the sort
     controls and complete list, overlaying the page instead of displacing it — the main content
     never needs reserved padding for it since it's never part of the layout flow. */
  .app-layout{flex-direction:column;height:auto;overflow:visible}
  /* .col-left keeps overflow-y:auto from the desktop rule above, but on mobile its height is
     never clipped (app-layout is height:auto here) so it never actually scrolls internally —
     the document does. Left as overflow-y:auto anyway, .col-left still counts as a "scroll
     container" for position:sticky purposes and hijacks .mini-progress's containing block away
     from the real (document-level) scroller, so it visually never sticks. overflow:visible
     (both axes, not just -y, to dodge the same x/y overflow auto-promotion this fixes at the
     html/body level above) hands that back to the document, matching .header's behavior. */
  .col-left{overflow:visible}
  .drag-handle{display:none}
  /* left/right insets (not full-bleed 0/0) so the deployed sheet's width roughly matches the
     docked peek strip's own 8px inset below (see .mobile-bottom-dock) — before this they were
     16px apart (0 vs 16px), so opening the sheet visibly "flared out" wider than the strip it
     opened from instead of reading as a continuation of it. */
  /* Closed transform stops at "100% minus the docked panel's own height" (--mobile-dock-h, kept
     in sync by a ResizeObserver in app.js) instead of a full 100% — sliding all the way off
     screen would keep a shrinking sliver of the sheet visibly overlapping the dock (peek strip +
     timer) it's supposed to reveal for the last stretch of the animation. Stopping exactly at the
     dock's own height means the sheet is the same size/position as the dock right as it
     disappears (opacity, delayed so it stays fully solid while sliding and only fades right at
     the end — same delayed-fade convention as .mobile-scores-peek.msp-hidden below), instead of
     visibly overlapping itself while collapsing. pointer-events:none once closed so this
     now-invisible box (still sitting exactly over the dock) doesn't swallow taps meant for the
     peek strip/timer underneath it. */
  .col-right{position:fixed;left:8px;right:8px;bottom:0;top:auto;width:auto!important;min-width:0;max-width:none;height:calc(100vh - var(--header-h,67px) - 8px);height:calc(100svh - var(--header-h,67px) - 8px);max-height:none;border-left:none;border-top:1px solid var(--border-strong);border-radius:var(--radius-lg) var(--radius-lg) 0 0;z-index:250;transform:translateY(calc(100% - var(--mobile-dock-h,97px)));opacity:0;pointer-events:none;transition:transform .28s ease,opacity .12s ease .16s;padding-bottom:env(safe-area-inset-bottom)}
  .col-right.open{transform:translateY(0);opacity:1;pointer-events:auto;transition:transform .28s ease,opacity .16s ease}
  /* .qtimer-desktop stays visible here (no display:none override) — expanding the scores
     sheet on mobile should still show the timer, not hide it; it's the same #sidebar element
     as the desktop sidebar, just repositioned/resized by this media query, so it naturally
     shows once .col-right.open slides the whole sheet (timer included) into view. */
  /* Extra bottom padding (not just the 40px other viewports get) so the last section clears
     the fixed peek strip + timer dock with visible breathing room once scrolled all the way
     down — the dock floats on top of this padding rather than being part of the scrollable
     flow, so without the extra room the last box's bottom edge sits flush against its top.
     This used to be a flat 150px guess at the dock's height, the same bug as the Settings
     panel's old flat header-height guess above: the dock isn't a fixed size — Timer Stepper
     Buttons, a larger Size setting, or a taller safe-area-inset-bottom on a notched phone can
     all push it past 150px, and once it does, the last section's bottom edge scrolls in
     permanently behind it with no further scroll room left to clear it. --mobile-dock-h is the
     dock's real rendered height, already kept in sync by the same ResizeObserver in app.js that
     .col-right's own closed-transform above relies on — reuse it here too instead of re-guessing. */
  .col-left{padding-bottom:calc(var(--mobile-dock-h,97px) + 24px)}
  /* .col-left is no longer its own scroll container here (the document is), so
     .mini-progress's sticky context bubbles up to the same one .header already uses — it
     needs to sit below the header's actual rendered height instead of top:0, or the two
     would overlap once both are stuck. */
  .mini-progress{top:var(--header-h,64px)}

  .sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(0,0,0,.45);opacity:0;pointer-events:none;transition:opacity .28s ease;z-index:240}
  .sidebar-backdrop.show{opacity:1;pointer-events:auto}

  /* Grab handle at the very top of the open sheet — a dedicated drag target for swipe-down-to-
     close, kept separate from .sidebar-header so dragging it doesn't also fire the header's own
     tap-to-close handler. --text-muted (not --border-strong, which only measures ~2.9:1 against
     --bg-card in dark mode — under the WCAG 1.4.11 3:1 floor for a meaningful UI component) is
     reused instead: it's the same token already used for every collapse chevron in the app, and
     it clears >=3:1 non-text contrast against --bg-card in both themes. */
  .sheet-grab-handle{width:100%;padding:8px 0 4px;display:flex;align-items:center;justify-content:center;flex-shrink:0;touch-action:none;cursor:grab}
  .sheet-grab-handle::after{content:'';width:36px;height:4px;border-radius:2px;background:var(--text-muted)}

  /* Shadow on all four sides so the sheet reads as fully lifted off the page. Four separate
     directional layers (not one 0/0 blur) so each side gets pushed outward into its own small
     margin instead of a symmetric halo whose blur mostly bled past the narrow 8px inset. Single
     --edge-fade colour (per-theme: pale glow in Dark, darker in Light) so this sits at the same
     intensity as the Settings panel's own edge shadows. */
  .col-right.open{box-shadow:0 -5px 16px var(--edge-fade),0 5px 16px var(--edge-fade),5px 0 16px var(--edge-fade),-5px 0 16px var(--edge-fade)}

  /* BOTTOM DOCK — a single fixed, rounded card holding the peek strip and the question timer
     stacked top-to-bottom (a border divider between them, not a gap), so the two read as one
     cohesive control rather than two separate boxes. The dock itself now owns the
     background/border/radius/shadow that each piece used to carry on its own; the peek strip
     and timer inside are flush, borderless rows separated by .qtimer-mobile's own border-top.
     The whole dock sits below the open sheet in z-order (245 < 250): opening the sheet
     ("sliding up" the scores) visually covers the dock — including the timer — the same way it
     already covered the peek strip, so the timer never fights the full scores list for
     attention. Out of the way of the game content in .col-left the same way the peek strip
     always was, via that column's own reserved bottom padding above, not by overlapping it.
     overflow:hidden clips both children to the dock's own rounded top corners. */
  /* 8px inset (was 16px) — see the matching .col-right comment above for why: this now lines up
     with the deployed sheet's own width instead of sitting noticeably narrower than it. */
  .mobile-bottom-dock{display:flex;flex-direction:column;position:fixed;left:8px;right:8px;bottom:0;z-index:245;background:var(--bg-card);border:1px solid var(--border-strong);border-bottom:none;border-radius:var(--radius-lg) var(--radius-lg) 0 0;overflow:hidden;padding-bottom:calc(10px + env(safe-area-inset-bottom))}
  /* Same directional --edge-fade shadow as .col-right.open above (top/left/right — the dock's
     bottom genuinely is off the bottom of the screen), so the docked and deployed scores panels
     read as the same "floating above everything" surface at the same intensity. */
  .mobile-bottom-dock{box-shadow:0 -5px 16px var(--edge-fade),5px 0 16px var(--edge-fade),-5px 0 16px var(--edge-fade)}
  /* PEEK STRIP — always-visible top row of the dock (hidden only while the sheet itself is
     open). 3-column grid (not flex) so the centered label is centered against the FULL row
     width, not just the space left over after the chevron — a flex row with the chevron as a
     trailing item would visually off-center the middle content toward the left. touch-action:
     none since there's no inner horizontal-scrolling content anymore to carve out an exception
     for (see the removed mini ticker) — all touch movement here is the JS swipe-up-to-open
     gesture's alone. Background/border/radius/shadow all live on .mobile-bottom-dock itself now
     (the shared card this and the timer both sit inside), so this is just a flush, borderless
     row. */
  .mobile-scores-peek{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:10px 14px;cursor:pointer;touch-action:none;transition:opacity .18s ease,transform .18s ease}
  /* Delay ONLY on the hide-transition (this class is the destination state when the sheet
     OPENS, so its own transition value — not the base rule's — is what the browser uses for
     that direction): the peek stays fully visible for .26s first, long enough for the chevron's
     .28s rotation below to actually play out, THEN fades away over .16s. Without this delay the
     opacity fade and the rotation would run simultaneously and the flip would be lost in the
     wash before it's even halfway done. Closing (this class removed) still uses the base rule's
     un-delayed transition, so the strip reappears immediately rather than after a matching lag. */
  .mobile-scores-peek.msp-hidden{opacity:0;pointer-events:none;transform:translateY(8px);transition:opacity .16s ease .26s,transform .16s ease .26s}

  /* Mobile timer — same widget as the desktop copy (.qtimer base rule) but full-width, flush
     against the dock's own rounded card. A border-top divider (not its own box) is what
     visually separates it from the peek strip above, so the two read as one cohesive card —
     scores on top, timer below — rather than two stacked boxes. No drop shadow of its own
     (unlike .qtimer-desktop): the dock already carries the shadow for the whole card. Hidden
     entirely when the timer is turned off in Advanced Settings, via [data-timer-hidden] below. */
  /* This row's own OUTER height (border-top plus the padding below) is a hard ceiling, not just
     a starting point: growing it grows .mobile-bottom-dock along with it, eating into the game
     content above the dock — which the first pass at this got wrong, trading a taller dock for
     bigger controls. Padding trimmed from 8px to 4px top/bottom is what buys the room to grow
     everything below WITHOUT that trade: same 1px border-top plus 2x4px padding as the original
     frame, just less of it spent on empty margin and more on the controls themselves. */
  .qtimer-mobile{display:flex;border-top:1px solid var(--border);padding:4px 10px}
  /* Docked row had ~194px of unused WIDTH at rest (no steppers) and ~93px with them — measured
     empirically, not eyeballed — so there's no width trade-off here at all, only the height one
     resolved above. font-size bumped up from the original 1.3rem, but pulled back a notch from
     an initial 2.1rem pass that read a little large — 1.85rem plus .qtimer-display's own trimmed
     3px+3px padding plus the 4px+4px border every state (qt-warn/crit) already reserves stays
     comfortably under the frozen 54.5px row-height ceiling. */
  /* v21.17: digits 1.85 -> 2.1rem; vertical padding 3 -> 1px so the box (line-height 1) keeps its height. */
  .qtimer-mobile .qtimer-display{font-size:2.1rem;padding:1px 10px}
  /* Play/pause and reset glyphs fill more of their buttons (were ~1em / 1.1em, which floated small). */
  .qtimer-mobile .qtimer-btn.qtimer-toggle svg{width:1.45em;height:1.45em;min-width:1.45em;flex-shrink:0}
  .qtimer-mobile .qtimer-btn.qtimer-reset .icon-ui{width:1.45em;height:1.45em}
  .qtimer-mobile .qtimer-btn.qtimer-toggle .icon-emoji,.qtimer-mobile .qtimer-btn.qtimer-reset .icon-emoji{transform:scale(1.35)}
  /* Flat rem values here, not max(...,44px) — the usual touch-target floor elsewhere in the app
     (.standings-sort-btn) would push these past the frozen row height this whole rule exists to
     respect. 2.4rem (36px at this app's 15px root) — pulled back from an initial 2.75rem pass
     that read a little large — sits between the original 2rem and that first pass; their own
     svg/icon-emoji children are already sized in em, so they scale up for free with font-size
     alone, no separate rule needed. */
  .qtimer-mobile .qtimer-btn.qtimer-toggle,
  .qtimer-mobile .qtimer-btn.qtimer-reset{
    width:2.4rem;height:2.4rem;min-height:2.4rem;font-size:1.15rem;
  }
  .qtimer-mobile .qtimer-btn.qtimer-step{font-size:max(12px,.82rem);padding:5px 8px;min-height:2.4rem}
  /* v21.20: the deployed sheet's timer (.qtimer-desktop) uses the exact same row metrics as the docked
     one above, so the digits and buttons stay put when the dock deploys instead of shifting a few px.
     Side padding is 11px (not 10) because the dock has a 1px side border the sheet doesn't. */
  .qtimer-desktop{padding:4px 11px calc(10px + env(safe-area-inset-bottom))}
  .qtimer-desktop .qtimer-display{font-size:2.1rem;padding:1px 10px}
  .qtimer-desktop .qtimer-btn.qtimer-toggle svg{width:1.45em;height:1.45em;min-width:1.45em}
  .qtimer-desktop .qtimer-btn.qtimer-reset .icon-ui{width:1.45em;height:1.45em}
  .qtimer-desktop .qtimer-btn.qtimer-toggle .icon-emoji,.qtimer-desktop .qtimer-btn.qtimer-reset .icon-emoji{transform:scale(1.35)}
  .qtimer-desktop .qtimer-btn.qtimer-toggle,
  .qtimer-desktop .qtimer-btn.qtimer-reset{font-size:1.15rem}
  .qtimer-desktop .qtimer-btn.qtimer-step{font-size:max(12px,.82rem);padding:5px 8px;min-height:2.4rem;width:44px;height:44px}
  /* Column 1 is left empty on purpose — an unfilled 1fr grid track still reserves the same
     width as column 3's chevron, which is what keeps column 2 centered against the full strip
     rather than just the leftover space; it doesn't need visible content of its own to do that. */
  .msp-label{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;font-family:var(--font-display);font-size:max(12px,.95rem);font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--txt-cyan);white-space:nowrap}
  /* Matches .section-header .chevron's size (1.1rem) so every collapse/expand chevron in the
     app reads as the same size/scale of control, rather than this one dominating the row. */
  .msp-chevron{grid-column:3;justify-self:end;font-size:1.1rem;line-height:1;color:var(--text-muted);transition:transform .28s ease}
  /* Points up while collapsed (the sheet is below, waiting to rise) and flips to point down —
     back toward where it collapses to — once deployed. */
  .mobile-scores-peek[aria-expanded="true"] .msp-chevron{transform:rotate(180deg)}
}

/* SIDEBAR */
/* Grid (not flex+space-between) so the title is centered against the FULL header width, not
   just the space left over after the chevron — same 3-column trick used by .mobile-scores-peek
   (empty 1fr on the left balances the chevron's own 1fr on the right, no visible left-side
   content needed for the centering to work). */
.sidebar-header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:10px 14px;cursor:pointer;user-select:none;border-bottom:1px solid var(--border);flex-shrink:0;background:var(--bg-card-alt)}
.sidebar-header:hover{background:var(--bg-hover)}
.sidebar-header h3{grid-column:2;justify-self:center;font-family:var(--font-display);font-size:max(12px,.95rem);text-transform:uppercase;letter-spacing:1px;color:var(--txt-cyan)}
/* Matches .msp-chevron's size (1.1rem) so the arrow reads the same whether the sheet is
   docked (peek strip) or deployed (this header) — was .7rem, visibly smaller than every
   other collapse/expand chevron in the app. */
.sidebar-toggle{grid-column:3;justify-self:end;font-size:1.1rem;color:var(--text-muted);transition:transform .3s}
/* Base glyph (▲) points up while docked; rotating 180deg once deployed (.open) turns it into a
   down-pointing arrow — same up-when-docked/down-when-deployed convention as the peek strip's
   own chevron, just kept on this header instead of swapped for a plain ▼ + no rotation, so the
   flip is still an animated transition rather than an instant swap. */
.col-right.open .sidebar-toggle{transform:rotate(180deg)}
/* Desktop: drop the chevron. .col-right.open only repositions anything inside the
   max-width:768px block above — on a wide viewport .col-right is a static column, so toggling
   "open" here (the header's onclick="toggleSidebar()" is unconditional) rotated this arrow
   180deg for no visible reason at all, the one piece of UI in the app that looked interactive
   and did nothing. Same fix, same reasoning, as .standings-chevron's desktop treatment above:
   drop the icon, leave the header itself clickable. */
@media(min-width:769px){
  .sidebar-toggle{display:none}
}
.sidebar-body{flex:1;min-height:0;overscroll-behavior:contain;overflow-y:auto;display:flex;flex-direction:column;overflow-anchor:none}

.sort-controls{display:flex;gap:4px;padding:8px 10px;border-bottom:1px solid var(--border);flex-shrink:0}
.sort-btn{display:inline-flex;align-items:center;justify-content:center;gap:.3em;flex:1;min-width:0;font-family:var(--font-display);font-size:max(12px,.86rem);font-weight:700;padding:8px 4px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-input);color:var(--text-secondary);cursor:pointer;transition:var(--transition);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap;touch-action:manipulation}
.sort-btn:hover{background:var(--bg-hover);color:var(--text-primary)}
/* Shuffle carries no visible label (its name is there for screen readers only), so the icon runs
   a little larger to hold the same optical weight as "Entry"/"Asc"/"Desc" beside it. Dropping the
   word is what stopped this button being the widest of the four and squeezing the other three. */
.sort-btn .icon-ui{width:1.25em;height:1.25em}
.sort-btn .icon-emoji{transform:scale(1.25)}
.standings-sort-btn .icon-ui{width:1.32em;height:1.32em}
.standings-sort-btn .icon-emoji{transform:scale(1.5)}
.sort-btn.active{background:var(--accent-cyan-solid);color:var(--on-accent-cyan);border-color:var(--accent-cyan-solid);box-shadow:0 0 6px color-mix(in srgb,var(--accent-cyan) 30%,transparent)}
/* position/z-index + a downward --edge-fade cast the same "content scrolls in under a pinned bar"
   cue onto the top of .scores-list that .settings-panel-head casts in the Settings panel — same
   token, same intensity, on both mobile and desktop. The matching cue on the list's BOTTOM edge
   is the upward --edge-fade on .qtimer-desktop (which overlays that edge — see its rule above). */
.sort-mode-label{position:relative;z-index:1;padding:6px 12px 4px;font-size:max(12px,.7rem);color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;font-weight:600;border-bottom:1px solid var(--border);flex-shrink:0;box-shadow:0 7px 11px -1px var(--edge-fade)}

/* padding-bottom reserves room for .qtimer-desktop (see LAYOUT above), which overlays this
   list's bottom edge — without it the last row would be permanently stranded behind the timer
   with no way to scroll it into view, since .scores-list (not .sidebar-body) is the element
   that actually scrolls. --qtimer-h is kept in sync with the timer's real rendered height by a
   ResizeObserver in app.js. */
.scores-list{padding:8px 12px;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(8px + var(--qtimer-h,4.6rem))}
.score-row{display:flex;align-items:center;padding:var(--row-pad) 12px;border-bottom:1px solid var(--border);margin-left:-12px;margin-right:-12px}
.score-row:last-child{border-bottom:none}
.score-row:nth-child(even){background:var(--row-stripe)}
.sr-rank{font-family:var(--font-display);font-weight:800;font-size:1.15rem;width:2.2rem;height:2.2rem;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:8px;background:#e8e8e8;color:#000;border:1px solid #b0b0b0}
/* .score-row now carries this same rank class too (see buildScores in app.js), so the badge
   colors below are scoped to .sr-rank specifically — an unscoped .sr-rank-1 would otherwise also
   paint the whole row. #1 went through a fully-token-based --accent-gold/--on-accent-gold design
   for a few builds (bright fill, dark text+border, colorblind-mode aware) but that read as too
   saturated/neon next to #2/#3's own muted two-tone look — reverted to the same muted-fill +
   lighter-accent-border + theme-flipped-text formula #2/#3 already use below, at the cost of the
   automatic colorblind-mode swap that formula gave up. */
.sr-rank.sr-rank-1{background:#ffe066;color:#000;border:2px solid #c8900a}
.sr-rank.sr-rank-2{background:#d8d8dc;color:#000;border:2px solid #888898}
.sr-rank.sr-rank-3{background:#e8b98a;color:#000;border:2px solid #8b4510}
[data-theme="dark"] .sr-rank{background:#3a3a3a;color:#fff;border:1px solid #555}
/* Dark theme's own values, not just a copy of the light ones above: a much darker, muted
   gold-brown fill (not the pale #ffe066 light theme gets — pale would glow against this app's
   near-black dark theme instead of reading as muted) with white text and a genuinely lighter
   bright-gold border for definition against that darker fill, same shape as #2/#3's own
   dark-theme rows right below. Also fixes the specificity bug from the --accent-gold era: this
   and the plain [data-theme="dark"] .sr-rank rule above are equally specific (2 class-level
   selectors each — attribute selectors count same as classes), so this still needs to be
   declared after it to win the tie rather than falling back to the plain gray badge. */
[data-theme="dark"] .sr-rank.sr-rank-1{background:#6e5600;color:#fff;border:2px solid #ffd700}
[data-theme="dark"] .sr-rank.sr-rank-2{background:#55555f;color:#fff;border:2px solid #c8c8d0}
[data-theme="dark"] .sr-rank.sr-rank-3{background:#6b3d15;color:#fff;border:2px solid #d68a42}
.sr-name{flex:1;font-weight:600;font-size:max(12px,.85rem);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Subtle 1st/2nd/3rd podium tint across the whole row container — same idea as Final Results'
   .fr-gold/.fr-silver/.fr-bronze row wash. All three are plain fixed, muted tints, matching the
   same muted approach the #1/#2/#3 badges themselves now use (see .sr-rank.sr-rank-1's comment
   above) rather than a saturated color-mix() of the raw accent. These and
   .score-row:nth-child(even) above are all 2 class-level selectors (equal specificity), so
   declaring these after it in the file is what lets a podium row's tint win over the plain
   zebra stripe when that row is also even. */
/* The three podium washes stay literal rgba on purpose, and are the one set the tint sweep
   deliberately skipped. Gold, silver and bronze are not accents — they are the metals, the same
   in every theme and every colour-vision mode, because 1st/2nd/3rd is conveyed by the place
   number and the rank colour is decoration on top of it. Mixing them off --accent-gold would turn
   1st place magenta in blue-yellow mode for no gain. */
.score-row.sr-rank-1{background:rgba(200,175,90,.16)}
.score-row.sr-rank-2{background:rgba(200,202,215,.14)}
.score-row.sr-rank-3{background:rgba(210,130,55,.16)}
[data-theme="light"] .score-row.sr-rank-1{background:rgba(150,120,40,.20)}
[data-theme="light"] .score-row.sr-rank-2{background:rgba(140,140,155,.20)}
[data-theme="light"] .score-row.sr-rank-3{background:rgba(180,100,40,.20)}
.sr-score{font-family:var(--font-display);font-size:1.1rem;font-weight:700;color:var(--txt-cyan);margin-left:8px;flex-shrink:0}

/* SECTIONS */
/* --border-strong (not --border) so every top-level container (Event Details, Teams, Round N,
   Final Results, etc.) has an edge that's >=3:1 against --bg-primary in every theme — --border
   alone was only ~1.5-2:1 against the page background, i.e. not a real visual boundary. */
/* scroll-margin-top (also on .question-block/.special-section below) keeps whatever
   jumpToSection/jumpToFirstUnanswered (app.js) scrolls to clear of .header AND .mini-progress —
   both position:sticky, and on mobile (where the two stack: see .mini-progress's own comment
   further down) they'd otherwise sit right on top of the freshly-scrolled-to element's own top
   edge (its "X left" badge included), since scrollIntoView aligns against the scroll container's
   edge, not around sticky content docked at it. Reuses --header-h/--mini-progress-h, already
   tracked for the identical problem elsewhere, plus a little breathing room so it's not flush
   against either bar. On desktop .mini-progress's sticky context is .col-left's own internal
   scroll, not the page .header's — so --header-h isn't actually needed there — but adding it
   anyway only costs a little extra (harmless) breathing room above the target, in exchange for
   one rule that's correct on both layouts instead of a media-query split. */
.section{background:var(--bg-card);border:1px solid var(--border-strong);border-radius:var(--radius-lg);margin-bottom:10px;overflow:hidden;scroll-margin-top:calc(var(--header-h,80px) + var(--mini-progress-h,0px) + 12px)}
/* Subtle default background (distinct from .section-body's bg-card) so a clickable header
   reads as its own control at a glance, not just on hover. --bg-card-alt vs --text-primary is
   >=18:1 in both themes, so this never threatens the header text's own AA contrast. */
/* border-left is 6px from the start (transparent, matching .round-complete's own width below) —
   not the 3px it used to be, growing to 6px only once complete. That width JUMP shifted this
   header's own content by the same 3px the moment a round finished scoring; keeping the width
   constant and only ever swapping the COLOR means completing a round never moves anything. */
.section-header{display:flex;align-items:center;justify-content:flex-start;gap:8px;padding:12px 14px;cursor:pointer;user-select:none;transition:var(--transition);border-left:6px solid var(--mode-accent,transparent);background:var(--bg-card-alt)}
.section-header:hover{background:var(--bg-hover)}
.section-header h2{font-family:var(--font-display);font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:1px;display:flex;align-items:center;flex-wrap:wrap;gap:4px}
.section-header .chevron{transition:transform .3s;color:var(--text-muted);font-size:1.1rem;flex-shrink:0}
.section.collapsed .section-body{display:none}
.section.collapsed .chevron{transform:rotate(-90deg)}
/* flow-root keeps a first child's top margin inside the body, so the open/close slide measures all of it. */
.section-body{display:flow-root;padding:0 14px 14px}
.section.round-complete>.section-header{border-left-color:var(--accent-green)}

label{display:block;font-size:max(12px,.72rem);font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px;margin-bottom:3px}
input[type="text"],input[type="number"],input[type="date"]{width:100%;padding:7px 10px;background:var(--bg-input);border:1px solid var(--border-control);border-radius:var(--radius);color:var(--text-primary);font-family:var(--font-body);font-size:max(12px,.9rem);outline:none;transition:var(--transition)}
input:focus{border-color:var(--accent-cyan);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-cyan) 13%,transparent)}
/* color-scheme tells the browser which native-control palette to use for the date input's
   own calendar-picker icon and popup (so the icon isn't a near-invisible dark glyph on our
   dark theme's input background) — this is the standards-based fix, not a filter/invert hack. */
[data-theme="dark"] input[type="date"]{color-scheme:dark}
[data-theme="light"] input[type="date"]{color-scheme:light}
/* color-scheme on the root too (v22.48): native scrollbars, form controls and the light-dark()
   colors below follow the app's own Theme setting, not just the OS preference. */
:root,[data-theme="dark"]{color-scheme:dark}
[data-theme="light"]{color-scheme:light}
/* max-width is rem, not a flat px cap, on both this and .date-native-wrap below — same reasoning
   as the mobile bugs fixed elsewhere in this file: .date-display-text's font-size is also rem
   (below), driven by root font-size (Settings > Size, 12-30px), so at the larger end of that
   range a flat px cap would stay fixed while the pretty-printed date text ("Aug 20, 2026") it
   holds keeps growing — the overlay is position:absolute with only `left` set, so it sizes to
   its own content regardless of the wrapper's cap, and would bleed visibly past this field's
   right edge into Quiz ID beside it (only a 10px gap in .meta-grid's 2-column layout, which
   mobile only collapses to one column below the 600px container-query threshold — a wider phone
   or one in landscape stays 2-column). rem keeps the cap scaling in lockstep with the text
   instead. */
.date-native{cursor:pointer;width:auto;max-width:10.625rem}
/* The native input stays fully functional (click/keyboard/picker all still hit it) — only its
   own text is made transparent so our fixed-format span can show through in its place. The span
   has pointer-events:none so every click still lands on the input underneath it. */
.date-native-wrap{position:relative;display:inline-block;max-width:10.625rem}
.date-native-wrap .date-native{color:transparent}
/* right:6px (not left-only) gives this a definite width so overflow-hidden/text-overflow can
   actually apply to it — a backstop for the rare case (a long localized month name, an unusually
   wide font at the very top of the Size range) where the rem-scaled cap above still isn't quite
   enough; same ellipsis-on-overflow pattern .sr-name uses elsewhere in this file. */
.date-native-wrap .date-display-text{position:absolute;left:10px;right:6px;top:0;bottom:0;display:flex;align-items:center;pointer-events:none;font-family:var(--font-body);font-size:max(12px,.9rem);color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.date-native-wrap .date-display-text.is-placeholder{color:var(--text-muted)}
.date-native-wrap .date-native:disabled ~ .date-display-text{opacity:.65}
/* Same rem-not-px reasoning as .date-native-wrap above — a real <input> scrolls its own overflow
   internally rather than bleeding onto a neighbor, but a flat px cap still means this field
   doesn't visually grow alongside a Quiz ID label/value that is growing with it. */
.quiz-id-input{width:auto;max-width:8.125rem}
/* .65, not .5: a locked Event Details field still holds a value the host has to read, and at .5 black on the light theme's input grey fell to 3.8:1 (AA wants 4.5:1). */
input:disabled{opacity:.65;cursor:not-allowed}
input[list]{padding-right:26px;background-image:linear-gradient(45deg,transparent 50%,var(--text-muted) 50%),linear-gradient(135deg,var(--text-muted) 50%,transparent 50%);background-position:calc(100% - 16px) 55%,calc(100% - 11px) 55%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}
input[list]::-webkit-calendar-picker-indicator{opacity:0}
[role="button"]:focus-visible,button:focus-visible,a:focus-visible{outline:2px solid var(--accent-cyan);outline-offset:2px}
[role="button"]{outline:none}
.meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.meta-grid .full{grid-column:1/-1}
/* Required-before-scoring fields (Location) — same visual language as the
   team guess-missing state so both validation cues read consistently. */
.field.field-invalid>label{color:var(--txt-orange)}
.field.field-invalid input{border-color:var(--accent-orange);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-orange) 18%,transparent)}
/* Quiz ID is free-entry — it's never blocking, just hinted: orange when it doesn't match the
   usual format, green once it does. */
.field.field-warn>label{color:var(--txt-orange)}
.field.field-warn input{border-color:var(--accent-orange);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-orange) 18%,transparent)}
.field.field-good input{border-color:var(--accent-green);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-green) 18%,transparent)}
.guess-good{display:block;font-size:max(12px,.58rem);font-weight:700;color:var(--badge-green-fg);letter-spacing:.3px;margin-top:2px}

/* TEAM ENTRY */
/* align-items:start (not center): the name column's stacked label+input+checks is taller than
   the guess column's label+input, so a "center" row would offset the Guess label below Team N
   instead of level with it. */
/* --border-control (not the plain --border every other divider in this app uses) — same reasoning
   as its own definition up top: --border only measures ~2.2:1 (light) / ~1.4:1 (dark) against
   --bg-card, well under WCAG 1.4.11's 3:1 floor for a boundary that's carrying real information
   (here, "this is a separate team"). --border-control already exists precisely because ordinary
   --border/--border-strong don't reliably clear 3:1 on every surface — reusing it rather than
   inventing a one-off color for this one divider. */
.team-entry{display:grid;grid-template-columns:1fr 5.4rem auto;gap:8px;align-items:start;padding:10px 8px;border-bottom:1px solid var(--border-control)}
.team-entry.has-adj{grid-template-columns:1fr 5.4rem auto auto}
.team-entry{position:relative}
.team-entry:last-of-type{border-bottom:none}
/* Zebra stripe on the even team rows, same --row-stripe (Row Zebra Stripes setting) the score
   rows / round answers / standings already use, so the Teams list scans the same way. */
.team-entry:nth-child(even){background:var(--row-stripe)}
/* Bleed the row to the section body's 14px side padding so the stripe runs edge to edge; the extra
   padding keeps the content where it was. */
.team-entry{margin-inline:-14px;padding-inline:22px}
.team-name-cell{display:flex;flex-direction:column;gap:7px;min-width:0}
/* Same treatment as the Guess label beside it, because they are the same thing: a field label
   over an input, on one row. They had been diverging on five counts at once — display font vs
   body, weight 400 vs 600, letter-spacing 1px vs .5px, sentence case vs upper, --text-muted vs
   --text-secondary — which is what made the pair read as two unrelated bits of text. */
.team-number{font-family:var(--font-body);font-size:max(12px,.66rem);font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--text-secondary)}
.team-name-cell>input[type="text"]{width:100%}
.team-checks{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px}
.check-label{position:relative;display:inline-flex;align-items:center;gap:7px;font-size:max(12px,.85rem);font-weight:700;cursor:pointer;padding:6px 10px;border-radius:6px;border:1px solid var(--border-control);background:var(--bg-input);white-space:nowrap;transition:var(--transition);letter-spacing:.3px;margin-bottom:0!important;color:var(--text-muted)}
/* Native checkbox is kept for real keyboard/screen-reader semantics but rendered invisible —
   accent-color can't guarantee the checkmark glyph's own contrast (browser-chosen, unverifiable),
   so the visible box + checkmark below is fully custom-drawn and contrast-audited instead. */
.team-checks .check-label{flex:1 1 0;max-width:9.5rem;min-width:0;box-sizing:border-box;justify-content:flex-start;font-size:1.133rem;line-height:1;gap:6px;padding-left:8px;padding-right:6px;letter-spacing:0}
.lbl-short{display:none}
/* BON is the same size as CB, whatever the touch-screen small-label floor says. */
.team-checks .lbl-short{font-size:inherit}
/* Quiet chips: while unticked the chip is neutral (outline + text) and the colour lives only in the
   box itself; ticking fills the whole chip with its colour. */
.team-checks .check-label:not(.is-checked){border-color:var(--border-control);color:var(--text-secondary)}
/* CB and Bonus always share one row and shrink sideways, never stacking. Two stages, by the width of
   the checks row (container query, in rem so it follows the font-size setting): both full labels; then
   "BON" once "Bonus" would no longer fit beside CB. flex-basis 0 keeps the two chips equal width. */
.team-checks{container-type:inline-size;flex-wrap:nowrap}
@container (max-width:19rem){
  .lbl-full{display:none}
  .lbl-short{display:inline}
}
/* Narrow rows: tighten, and let the text follow the row's width, so the chips keep their size. */
@container (max-width:14.5rem) or (max-width:217px){
  .team-checks .check-label{gap:4px;padding-left:5px;padding-right:3px;font-size:min(1.133rem,7.4cqw)}
}


.check-input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;margin:0;cursor:pointer}
.check-box{width:22px;height:22px;flex-shrink:0;border-radius:5px;box-sizing:border-box;position:relative;background:transparent;transition:var(--transition)}
/* Outline-until-checked: unchecked is a bordered outline with no fill, checked is a
   solid fill — checked/unchecked is signaled by shape+border as well as color, so it
   isn't lost for users who can't perceive the fill color at all. */
.item-check .check-box{border:2px solid var(--item-border)}
.njcb-check .check-box{border:2px solid var(--njcb-border)}
/* Ticked, the box's border does NOT go to the fill colour. The chip around it takes that exact
   same fill (.item-check.is-checked below), so a box filled and bordered in it has nothing to
   separate it from the chip — the box disappears and the tick is left floating on a coloured
   pill. Bordering it in --check-icon-color instead, the tick's own colour, keeps a visible box
   around the mark in both themes. That colour is already audited against these two fills (it is
   what the tick is drawn in), so the outline inherits the same contrast rather than needing a
   value of its own. */
.item-check .check-input:checked+.check-box{background:var(--item-fill-checked);border-color:var(--check-icon-color)}
.njcb-check .check-input:checked+.check-box{background:var(--njcb-fill-checked);border-color:var(--check-icon-color)}
.item-check .check-input:checked+.check-box::after,.njcb-check .check-input:checked+.check-box::after{
  content:'';position:absolute;left:6px;top:2px;width:6px;height:11px;
  border:solid var(--check-icon-color);border-width:0 3px 3px 0;transform:rotate(45deg);
}
.check-input:focus-visible+.check-box{outline:2px solid var(--accent-cyan-solid);outline-offset:2px}
.item-check{color:var(--item-border);border-color:var(--item-border);background:var(--bg-input)}
.item-check.is-checked{background:var(--item-fill-checked);color:var(--check-icon-color);border-color:var(--item-fill-checked)}
.njcb-check{color:var(--njcb-border);border-color:var(--njcb-border);background:var(--bg-input)}
.njcb-check.is-checked{background:var(--njcb-fill-checked);color:var(--check-icon-color);border-color:var(--njcb-fill-checked)}
/* 7px, matching .team-name-cell's flex gap, so the two inputs on this row start at the same y.
   At the label's own 3px the guess input sat 4.5px above the name input — the actual thing that
   looked wrong here, and invisible in the markup because one side spaces with a gap and the
   other with a margin. */
/* No native up/down spinners on the guess field. type="number" is kept for the numeric keypad
   it brings up on a phone and for the min/max the field already declares, but the spinner
   buttons it also brings are the wrong control here: they are ~10px tall each at this size,
   they step by 1 through a 1-146 range, and on a row the host is tabbing through at speed the
   only thing they reliably do is catch a stray click and silently change a score that was
   already right. The craft prize steppers turn them off the same way (.stepper input.sw-input,
   further down) — this is that rule applied to the one other number input in the app. */
.team-guess-cell input[type="number"]{-moz-appearance:textfield;appearance:textfield}
.team-guess-cell input[type="number"]::-webkit-outer-spin-button,
.team-guess-cell input[type="number"]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.team-guess-cell>label{font-size:max(12px,.66rem);margin-bottom:7px;display:block;text-align:center}
.team-guess-cell input[type="number"]{text-align:center}
.team-guess-cell.guess-missing>label{color:var(--txt-orange)}
.team-guess-cell.guess-missing input{border-color:var(--accent-orange);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-orange) 18%,transparent)}
/* "Limit reached" cue for maxlength fields (see the delegated listener in app.js). Same
   orange, size and weight as .guess-warn above rather than a new visual language — this is
   the app's existing "something about this field needs your attention" voice, and the host
   has already learned it from the required-field and Quiz ID hints. Not blocking, though,
   so unlike .field-invalid the field keeps a plain border and only gains the ring; what was
   typed is valid, there is just no room for more of it. */
.team-guess-cell>.guess-warn{text-align:center;font-size:max(15px,1rem)}
.guess-warn .icon-ui{width:1.35em;height:1.35em}
#addTeamBtn .add-plus{font-size:1.8em;line-height:0;vertical-align:-.1em;margin-right:4px}
.guess-warn,.limit-note{display:block;font-size:max(12px,.58rem);font-weight:700;color:var(--txt-orange);letter-spacing:.3px;margin-top:2px}
input.at-limit,textarea.at-limit{border-color:var(--accent-orange);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-orange) 18%,transparent)}

/* PER-TEAM ADJ */
.adj-wrap{display:flex;flex-direction:column;align-items:center;gap:5px;align-self:center}
.remove-team{align-self:center}
.adj-chip{font-family:var(--font-display);font-size:max(12px,.72rem);font-weight:700;padding:5px 7px;border-radius:6px;border:1px solid var(--border-control);background:var(--bg-input);color:var(--text-muted);cursor:pointer;transition:var(--transition);white-space:nowrap;min-width:34px;text-align:center;line-height:1}
@media (hover:hover) and (pointer:fine){.adj-chip:hover{background:var(--bg-hover);border-color:var(--border-light);color:var(--text-primary)}}
.adj-chip.adj-active{color:var(--txt-orange);border-color:var(--accent-orange);background:color-mix(in srgb,var(--accent-orange) 10%,transparent)}
.adj-stepper button{width:1.5rem;height:1.5rem;border:1px solid var(--border-control);background:var(--bg-input);color:var(--text-primary);font-size:max(12px,.9rem);font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:var(--transition)}
.adj-stepper button:first-child{border-radius:5px 0 0 5px}
.adj-stepper button:last-child{border-radius:0 5px 5px 0}
.adj-stepper button:hover{background:var(--bg-hover)}
.adj-val{min-width:2rem;height:1.5rem;display:flex;align-items:center;justify-content:center;background:var(--bg-card);border-top:1px solid var(--border-light);border-bottom:1px solid var(--border-light);font-family:var(--font-display);font-weight:700;font-size:max(12px,.75rem)}
.adj-val.pos{color:var(--badge-green-fg)}
.adj-val.neg{color:var(--txt-red)}
.remove-team button{width:1.6rem;height:1.6rem;border-radius:50%;border:1px solid var(--accent-red);background:none;color:var(--txt-red);font-size:1rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:var(--transition)}
.remove-team{display:flex;gap:6px}
.remove-team .pause-team{width:2.1rem;border-radius:6px;border-color:var(--accent-gold);color:var(--text-secondary)}
.remove-team .pause-team.is-on{border-color:var(--accent-gold);color:var(--on-accent-gold);background:var(--accent-gold)}
.remove-team .pause-team svg line{stroke:currentColor;stroke-width:3;stroke-linecap:round}
.team-entry.is-paused .team-name-cell>input[type="text"],.team-entry.is-paused .team-checks{opacity:.75}
.remove-team button:hover{background:color-mix(in srgb,var(--accent-red) 15%,transparent)}
/* X_ICON_SVG (app.js) replaces a ✕ Unicode glyph here — the button already centers its content
   with flex, but the glyph's own font metrics never quite landed it in the visual middle. An
   SVG's geometry is centered on its own, regardless of font. */
.settings-x-btn svg line,.resume-banner-close svg line,.remove-team button svg line{stroke:currentColor;stroke-width:3;stroke-linecap:round}
/* Icon Style's Emoji mode swaps the thin two-stroke pictograph X above for the platform ❌ glyph
   (X_ICON_SVG_EMOJI, app.js) — a full-colour emoji at the same nominal font-size reads visibly
   bulkier than that thin SVG did against this button's small 1.6rem circle, so it gets scaled
   back down rather than inheriting the pictograph's 1em/1rem sizing as-is. */
.remove-team button .icon-emoji{transform:scale(.7)}

#addTeamBtn{margin-top:10px;width:100%;padding:8px;font-family:var(--font-display);text-transform:uppercase;letter-spacing:1px}

.round-label{display:inline-block;font-family:var(--font-display);font-size:max(12px,.66rem);padding:2px 7px;border-radius:4px;text-transform:uppercase;letter-spacing:1px}
/* Tints via color-mix off the accent tokens, not hardcoded rgba. As literal rgba(0,255,255,.13)
   and rgba(255,238,0,.13) these washes stayed cyan and gold in EVERY colour-vision mode — so in
   blue-yellow mode, which swaps cyan for green and gold for magenta, Round 1's "Wagers: 1, 2, 3,
   4" pill kept a blue background under green text, and the gold badges kept a yellow one. Mixing
   from the token means each tint follows whatever its accent resolves to.
   Only the two accents that a colour-vision mode actually swaps are mixed this way. rl-2 and rl-4
   stay literal: magenta and purple are untouched by both modes, so they have nothing to follow —
   and mixing rl-2 anyway made things worse, because the light theme's --accent-magenta (#bb0055)
   is far darker than the dark theme's (#ff44aa) that literal was picked against, so 13% of it
   over white produced a deeper pink that dropped the pill's own text to 4.41:1, under AA.
   rl-4 is PURPLE, not the orange it used to be: orange sat right next to rl-3's gold and the two
   Wagers pills read as the same colour at a glance. Purple is clear of every other round hue and
   of both colour-vision swaps. --txt-purple is theme-split (light #6d28c9 / dark #caa8ff); the
   wash stays a literal violet since purple, like magenta, isn't a token a mode ever remaps. */
.rl-1{background:color-mix(in srgb,var(--accent-cyan) 13%,transparent);color:var(--txt-cyan)}
.rl-2{background:rgba(255,68,170,.13);color:var(--txt-magenta)}
.rl-3{background:color-mix(in srgb,var(--accent-gold) 13%,transparent);color:var(--badge-gold-fg)}
.rl-4{background:rgba(150,90,245,.16);color:var(--txt-purple)}
/* cb2 (blue-yellow / tritanopia) remaps --accent-gold to magenta, which rl-3 was inheriting —
   landing it on the same pink as rl-2's magenta (the round-2/round-3 collision). In that one mode
   rl-3 takes a deep, cyan-leaning blue instead: a tritanope reads it apart from rl-1's bright
   green (much darker, and greens/blues that DO collapse for a tritanope still separate on
   lightness here), from rl-2's pink (long- vs short-wavelength), and from rl-4's lavender (darker
   and bluer, not violet). Text clears >=7:1 on both the wash and the card in both themes. */
[data-theme="dark"][data-cb="2"] .rl-3{background:rgba(60,110,235,.24);color:#8fb2f7}
[data-theme="light"][data-cb="2"] .rl-3{background:rgba(30,70,180,.15);color:#234690}
/* line-height:1 keeps the taller 1rem badge from adding extra height to its header row —
   without it, a header with a badge (e.g. Final Results' "ascending") ends up a few px taller
   than a plain header with none (e.g. Craft Prize Drawing). */
.round-badge{font-family:var(--font-body);font-size:1rem;line-height:1;font-weight:700;padding:1px 8px;border-radius:4px;border:1px solid currentColor}
.round-badge.rb-partial{background:color-mix(in srgb,var(--accent-gold) 13%,transparent);color:var(--badge-gold-fg)}
.round-badge.rb-done{background:color-mix(in srgb,var(--accent-green) 10%,transparent);color:var(--badge-green-fg)}
/* Icon Style's Emoji mode swaps ICON_DONE's drawn checkmark for ☑️ here (dark theme; ✔️ in
   light — see applyIconStyle) — at this badge's own tight 1px vertical padding, the emoji's own
   glyph box renders taller than the pill itself, poking past the rounded green border instead of
   sitting inside it the way the drawn pictograph (sized to exactly fill icon-mark's 1em box)
   already did. Scaled down to fit back inside the border rather than widening the badge to fit
   the glyph — the badge's height is shared with every other state (.rb-partial etc.), which
   don't have this problem and shouldn't grow to accommodate it. */
.round-badge.rb-done .icon-emoji,.q-badge.q-complete .icon-emoji{transform:scale(.72)}

/* QUESTION BLOCKS — collapsible */
/* border-left is 6px from the start (transparent) rather than growing from 3px once a question
   goes q-active/q-done/beer-round — a width change there shifted the header/team-answer content
   inside by that same few px right when a question finished, which read as "things moving" on
   mobile. Every state below now only ever swaps the border-left COLOR, never its width. */
.question-block{background:var(--bg-card-alt);border:1px solid var(--border-strong);border-left:6px solid transparent;border-radius:var(--radius);margin-bottom:8px;overflow:hidden;scroll-margin-top:calc(var(--header-h,80px) + var(--mini-progress-h,0px) + 12px)}
.question-block.q-active{border-left-color:var(--accent-cyan)}
/* No opacity dim on a finished question (it was .82): fading the whole card pulled the points, badges and Sort button inside it under AA 4.5:1 in the light theme. The green edge and the Done badge already say it's finished. */
.question-block.q-done{border-left-color:var(--accent-green)}
/* Beer Round wins over q-done green. Uses --beer-border on --beer-bg (not --accent-gold on the
   normal --bg-card-alt): the raw accent only clears 3:1 against a background this warm/dark —
   see the --beer-bg definitions above for why. */
.question-block.beer-round{background:var(--beer-bg)!important;border-left-color:var(--beer-border)!important;opacity:1!important}

/* Differentiate the Q1/Q2/Q5-Bonus header from the team-answer rows in the body below, which
   otherwise share the question-block's own --bg-card-alt and blend together. */
.q-header{display:flex;align-items:center;gap:6px;padding:8px 10px;user-select:none;transition:var(--transition);background:var(--bg-input)}
.q-header-left{display:flex;align-items:center;gap:6px;cursor:pointer;flex:1;min-width:0}
.q-header-left:hover{opacity:.8}
.question-title{font-family:var(--font-display);font-size:max(12px,.82rem);font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px;display:flex;align-items:center;gap:6px}
.q-chevron{font-size:max(12px,.85rem);color:var(--text-muted);transition:transform .25s;flex-shrink:0}
.q-header-right{display:flex;align-items:center;gap:4px;flex-shrink:0;margin-left:auto}
.question-block.q-collapsed .q-body{display:none}
.question-block.q-collapsed .q-chevron{transform:rotate(-90deg)}
.question-block.q-collapsed :is(.q-header-right,.q-stats-row){visibility:hidden}
.question-block.bq-collapsed .q-body{display:none}
.question-block.bq-collapsed .q-chevron{transform:rotate(-90deg)}
.question-block.bq-collapsed :is(.q-header-right,.q-stats-row){visibility:hidden}

/* Sort/Reset are always-on colored actions rather than neutral buttons, so their purpose reads
   at a glance on a phone-width row instead of relying on the (now single-word) label alone.
   Both color pairs are the same accent-solid/on-accent tokens used everywhere else in the app
   for solid-fill buttons (e.g. .btn-accent, .mark-all-btn.active before this) — those are
   already verified >=4.5:1 in every theme × color-vision combination, so reusing them here
   keeps this AA-compliant for free instead of introducing new colors to re-verify. */
/* inline-flex + center on BOTH axes. These used to be plain inline buttons holding a glyph and
   a label as inline content, so the glyph's vertical position came from its own font metrics and
   the label's from the line box — which is what left the icon riding high next to its own text.
   As flex items both are centred on the cross axis by align-items, and the pair is centred on the
   main axis by justify-content, so the icon is centred horizontally and vertically by layout
   rather than by whatever the glyph's metrics happened to be. gap replaces the leading space that
   used to be baked into the label text. */
/* The transition names its properties: with all of them, visibility animates too, and the buttons outlive their collapsed question by the length of the transition. */
.q-sort-btn,.q-alpha-btn{display:inline-flex;align-items:center;justify-content:center;gap:.34em;font-family:var(--font-body);font-size:max(12px,.7rem);font-weight:700;height:1.5rem;padding:0 8px;border-radius:6px;cursor:pointer;border:1px solid transparent;transition-property:background-color,border-color,color,box-shadow,filter,transform;transition-duration:.18s;transition-timing-function:ease;text-transform:none;letter-spacing:0;line-height:1.2;white-space:nowrap;touch-action:manipulation}
.settings-toggle-btn.active,.settings-btn.active{background:var(--accent-cyan-solid);color:var(--on-accent-cyan);border-color:var(--accent-cyan-solid)}
/* Sort buttons (unanswered-first and name): blank with a coloured outline + icon when off, solid
   fill with a contrasting icon when on. Name sort tells A-Z from Z-A by its arrow, not by fill. */
.q-sort-btn,.q-alpha-btn{background:transparent;color:var(--txt-cyan);border-color:var(--accent-cyan-solid)}
.q-sort-btn.active,.q-alpha-btn.active{background:var(--accent-cyan-solid);color:var(--on-accent-cyan)}
.q-sort-btn:hover,.q-alpha-btn:hover{filter:brightness(1.1)}
/* v21.42: Sort tells you when a re-sort would change the order. Nothing to move = quiet grey
   outline (even right after a sort); something would move = solid fill plus a notification dot
   (v21.43: dot only, no number). The dot is --badge-gold-fg (yellow in dark, deep amber in light,
   pink/magenta in Blue-Yellow mode) which is >=5.1:1 on every card/page surface in all six
   theme x Color Vision modes; its 2px --bg-card ring separates it from the button fill, which is
   a similar hue in some modes. A shape in a fixed corner, so it doesn't rely on color alone. */
.q-sort-btn,.team-sort-row .q-alpha-btn{position:relative}
.q-sort-btn:not(.can-resort){background:transparent;color:var(--text-secondary);border-color:var(--border-control)}
.q-sort-btn.can-resort{background:var(--accent-cyan-solid);color:var(--on-accent-cyan);border-color:var(--accent-cyan-solid)}
.resort-dot{position:absolute;top:-5px;right:-5px;width:11px;height:11px;box-sizing:border-box;border-radius:50%;background:var(--badge-gold-fg);border:2px solid var(--bg-card);pointer-events:none}
/* Light themes: --badge-gold-fg is a dull brown/maroon there (it's a text-contrast token), so the dot
   gets its own brighter pick: orange (3.1-3.6:1 on every light surface; stays distinct from the blue
   fill in Red-Green mode too) and a vivid magenta in Blue-Yellow mode (3.9-4.5:1). The ring still separates it from the fill. */
[data-theme="light"] .resort-dot{background:#ea580c}
[data-theme="light"][data-cb="2"] .resort-dot{background:#e5008a}
.q-alpha-btn .icon-ui{width:1.15em;height:1.15em}
.team-guess-btn{width:1.5rem;padding:0;border-radius:7px}
#sec-final h2 .icon-ui,#sec-craftprize h2 .icon-ui,#sec-export h2 .icon-ui{width:1.75em;height:1.75em;margin-right:2px}
#sec-final h2 .icon-emoji,#sec-craftprize h2 .icon-emoji,#sec-export h2 .icon-emoji{font-size:1.6em}
.team-guess-btn:disabled{opacity:.4;cursor:not-allowed;filter:none}
/* 1.15em, not 1em: at .7rem the label reads fine but the icon needs the extra to stay legible. */
.q-sort-btn .icon-ui{width:1.15em;height:1.15em}
.q-sort-btn .icon-emoji{transform:scale(1.15)}
.q-badge{font-family:var(--font-body);font-size:1rem;line-height:1;font-weight:700;padding:1px 9px;border-radius:4px;border:1px solid currentColor}
.q-badge.q-remaining{background:color-mix(in srgb,var(--accent-gold) 13%,transparent);color:var(--badge-gold-fg)}
.q-badge.q-complete{background:color-mix(in srgb,var(--accent-green) 10%,transparent);color:var(--badge-green-fg)}
/* Beer Round badge is always golden yellow — it previously reused .q-complete's green,
   which read as a pass/fail color rather than the "everyone nailed it" celebration it is. */
.q-badge.q-beer{background:color-mix(in srgb,var(--accent-gold) 13%,transparent);color:var(--badge-gold-fg)}

/* BEER ROUND banner */
.beer-banner{display:flex;align-items:center;gap:8px;padding:6px 10px 8px;background:color-mix(in srgb,var(--accent-gold) 7%,transparent);border-bottom:1px solid color-mix(in srgb,var(--accent-gold) 20%,transparent);animation:beerPop .5s ease-out}
@keyframes beerPop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.beer-banner-icon{font-size:1.3rem;animation:beerWobble 1.2s ease-in-out infinite alternate}
@keyframes beerWobble{from{transform:rotate(-8deg)}to{transform:rotate(8deg)}}
.beer-banner-text{font-family:var(--font-display);font-size:max(12px,.78rem);font-weight:700;color:var(--badge-gold-fg);text-transform:uppercase;letter-spacing:1.5px}
.beer-banner-sub{font-size:max(12px,.68rem);color:var(--text-muted);font-weight:400;text-transform:none;letter-spacing:0;display:block;margin-top:1px}

.q-body{padding:0 10px 8px}

/* PER-QUESTION CORRECT/INCORRECT STATS: plain text on their own full-width line under the question's
   title and Sort button, so they can't run into a badge. Their colours are set further down. */
.q-stats-row{display:flex;justify-content:flex-end;gap:1.1rem}
.q-stat{font-family:var(--font-body);font-size:max(12px,.76rem);font-weight:700;height:1.15rem;gap:.3em;line-height:1.2;white-space:nowrap;display:inline-flex;align-items:center}

/* TEAM ANSWER ROWS */
.team-answer{display:flex;align-items:center;gap:.35rem;padding:var(--row-pad) 10px;border-bottom:1px solid var(--border);flex-wrap:nowrap;margin-left:-10px;margin-right:-10px;min-height:3.2rem}
.team-answer:last-child{border-bottom:none}
.team-answer:nth-child(even){background:var(--row-stripe)}

.ta-name{font-weight:600;font-size:max(12px,.88rem);flex-shrink:0;width:11rem;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word;padding-left:4px;padding-right:8px;line-height:1.3}
/* No hover magnifier on these rows — see .ta-name-clickable::after below. Nothing else here
   controls the vertical position of the name: .team-answer is align-items:center, so a box whose
   height is exactly its own lines is centred by that alone, one line or two. What broke it was
   the magnifier, and it broke it in two ways, both desktop-only (the mobile rule further down
   already hid the icon, which is why none of this showed there):
     1. At font-size 1.25em it was the tallest thing on its line, so it set the line box height —
        every single-line name sat in a 21.4px line instead of a 17.2px one.
     2. Worse, it is a ~22px inline box that has to FIT on a line, so any name landing within
        about that distance of the column edge pushed it onto a second line of its own. The box
        then measured two lines tall while the name still occupied only the first, and
        align-items:center dutifully centred that two-line box — leaving the visible text 11px
        above the row's centre, hard against the top. That is the "sometimes top justified,
        sometimes centred" split: it turned purely on whether a given name left room for an
        invisible icon on its last line, so "Sherlock Homies" centred and "Two Heads, One Trophy"
        did not.
   padding-right is back to the 8px it always was, so names wrap exactly where they used to —
   in fact slightly later, since the icon is no longer eating ~22px off the last line. */

.team-answer.flash{animation:row-flash .85s ease-out}
@keyframes row-flash{0%{background:color-mix(in srgb,var(--accent-cyan) 22%,transparent)}100%{background:transparent}}
.team-answer:nth-child(even).flash{animation:row-flash-stripe .85s ease-out}
@keyframes row-flash-stripe{0%{background:color-mix(in srgb,var(--accent-cyan) 22%,transparent)}100%{background:var(--row-stripe)}}

/* BEER ROUND row gold flash */
.team-answer.beer-flash{animation:beer-row-flash 1.1s ease-out}
@keyframes beer-row-flash{0%{background:color-mix(in srgb,var(--accent-gold) 35%,transparent)}60%{background:color-mix(in srgb,var(--accent-gold) 12%,transparent)}100%{background:transparent}}
.team-answer:nth-child(even).beer-flash{animation:beer-row-flash-stripe 1.1s ease-out}
@keyframes beer-row-flash-stripe{0%{background:color-mix(in srgb,var(--accent-gold) 35%,transparent)}60%{background:color-mix(in srgb,var(--accent-gold) 12%,transparent)}100%{background:var(--row-stripe)}}

/* WAGER BUTTONS */
.ta-wagers{display:flex;gap:.2rem;flex-shrink:0;margin-left:auto}
.wager-btn{min-width:var(--wager-size);min-height:var(--wager-size);width:var(--wager-size);height:var(--wager-size);border:1px solid var(--border-control);border-radius:6px;background:var(--btn-idle-bg);color:var(--text-primary);font-family:var(--font-display);font-size:1.1rem;font-weight:700;cursor:pointer;transition:var(--transition);display:flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;touch-action:manipulation}
@media (hover:hover) and (pointer:fine){.wager-btn:hover:not(.used):not(.correct):not(.incorrect):not(.selected){background:var(--bg-hover);border-color:var(--accent-cyan)}}
.wager-btn.correct{background:var(--btn-correct-bg);border:2px solid var(--accent-green)}
.wager-btn.incorrect{background:var(--btn-incorrect-bg);border:2px solid var(--accent-red)}
/* Revolution Rivals place picker: same audited .wager-btn colours; each button is wider so it can hold "#1" plus its points. */
.place-btn{width:3.6rem;min-width:0;height:calc(var(--wager-size) * 1.1);min-height:0;padding:0;flex-direction:column;gap:1px;line-height:1.1;font-size:max(12px,.95rem);border-radius:8px}
.place-btn .place-pts{font-size:max(12px,.7rem);font-weight:700;opacity:.85;background:none;padding:0}
/* Selected: the Rivals mode accent, with ink picked per theme so the label keeps its contrast. */
.place-btn.selected{background:var(--place-sel,var(--mode-accent));border:1px solid var(--place-sel,var(--mode-accent));color:#000}
/* Normal vision uses amber (red read as "incorrect"); the colour-vision modes keep their own audited Rivals accents. */
:root:not([data-cb]){--place-sel:#ffb020}
[data-theme="light"]:not([data-cb]){--place-sel:#b45309}
[data-theme="light"] .place-btn.selected{color:#fff}
/* A wager already used in this round: faded to 22% with a fine diagonal slash. The fade is applied
   to the button's own colours, not with opacity, so the slash can be easier to see than the rest. */
.wager-btn.used{background:color-mix(in srgb,var(--btn-used-bg) 22%,transparent);color:color-mix(in srgb,var(--text-secondary) 22%,transparent);border-color:color-mix(in srgb,var(--border-control) 22%,transparent);position:relative;cursor:not-allowed}
.wager-btn.used::after{content:'';position:absolute;inset:5px;pointer-events:none;background:linear-gradient(to bottom right,transparent calc(50% - .5px),color-mix(in srgb,var(--text-muted) 45%,transparent) calc(50% - .5px),color-mix(in srgb,var(--text-muted) 45%,transparent) calc(50% + .5px),transparent calc(50% + .5px))}
@media (forced-colors:active){.wager-btn.used{text-decoration:line-through}.wager-btn.used::after{content:none}}

.wager-badge{position:absolute;top:-8px;right:-5px;width:1.3rem;height:1.3rem;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.15rem;font-weight:900;line-height:1;padding-bottom:1px;pointer-events:none}
/* .bg-correct's own square is drawn by CORRECT_BADGE_SVG (app.js), not this circle — it's a
   rounded square rather than the emoji-style circle .bg-incorrect below keeps, which is why it
   gets no background/padding-bottom of its own. rect/path are colored via --correct-badge-bg/
   --correct-badge-fg (see their definitions up top) rather than currentColor: a solid, vivid
   green square (not the dark --btn-correct-bg wash the button underneath already uses) with a
   white check reads as its own badge instead of blending into the button, and clears >=4.5:1 AA
   in every theme x color-vision-mode combination this app ships. */
.wager-badge.bg-correct{background:transparent;padding-bottom:0}
.remove-team button svg,.wager-badge.bg-correct svg{width:1em;height:1em;display:block}
.wager-badge.bg-correct svg rect{fill:var(--correct-badge-bg)}
.wager-badge.bg-correct svg path{fill:none;stroke:var(--correct-badge-fg);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.wager-badge.bg-incorrect{background:var(--danger-solid-bg);color:#fff;font-size:1.3rem;font-weight:900}
/* Icon Style's ⛔ in this badge specifically — not .bg-correct's ✅, which already sits centered
   without help, and not any other .icon-emoji context, which is why this is scoped this narrow.
   The badge's own circle stays the shared 1.3rem every other badge uses — only the glyph inside
   it grows, up to roughly the same ~90% fill .bg-correct's ✅ already sits at (scale(.87) against
   this rule's own bumped 1.3rem font-size), leaving a thin ring of the badge's own
   --danger-solid-bg red visible around it. That ring matters for colour vision specifically:
   this badge's red is one of this app's audited color-vision tokens, but the ⛔ glyph is a
   fixed-palette platform emoji no CSS token can retint, so the ring is the one part of this
   badge every color-vision mode can still actually adjust.
   .wager-badge's own padding-bottom:1px (the base rule above) was tuned for the old SVG line
   icon's own visual weight and doesn't apply to the emoji at all — overridden back to 0 here so
   flex centering alone places it, with no manual nudge left to fight that centering. */
.wager-badge.bg-incorrect{padding-bottom:0}
.wager-badge.bg-incorrect .icon-emoji{transform:scale(.87)}
/* X_ICON_SVG (app.js) replaces a ✕ Unicode glyph here — this circle already centered its content
   with flex, but the glyph's own font metrics never quite landed it in the visual middle, and by
   a different amount than the ✕ inside .bg-correct's differently-shaped sibling or the ones on
   other buttons entirely — reading as "inconsistent" between them even though it was the same
   character everywhere. An SVG's geometry is centered on its own, regardless of font, so every
   instance of this badge now lines up the same way. */
.wager-badge.bg-incorrect svg{width:.95em;height:.95em;display:block}
.icon-mark line,.wager-badge.bg-incorrect svg line{stroke:currentColor;stroke-width:4;stroke-linecap:round}

/* SCORE PILL */
/* width (not min-width): the placeholder em-dash ("—", shown before a team is scored) needs
   more room than any real value ("+5".."+20", "✓ 0") does at the same font/padding, so a
   min-width floor sized to the real values let the dash render WIDER than them — and since this
   pill sits inside a right-anchored cluster (.ta-wagers/.bonus-right, margin-left:auto) on
   narrow layouts, that width difference shifted the wager/choice buttons before it every time a
   team went from unscored to scored. A fixed width sized to the dash's own need instead keeps
   every state — placeholder included — exactly the same size, so nothing moves on first score. */
/* No width here (unlike the old rule) — .pts-zero + .ta-pts/.bonus-pts is a 2-class selector,
   which would outrank the container-query's plain .ta-pts/.bonus-pts override below (1 class)
   and pin the placeholder to the un-clamped 3.7rem while every scored state used the clamped
   value, reintroducing the exact same shift-on-first-score bug this pill was just fixed for.
   Width comes from .ta-pts/.bonus-pts alone now, so every state resolves it the same way. */

/* RESULT BUTTONS */
.ta-result{display:flex;gap:.2rem;flex-shrink:0}
.result-btn{min-width:2.6rem;min-height:2.6rem;border:1px solid var(--border-control);border-radius:6px;background:var(--btn-idle-bg);font-size:1.1rem;cursor:pointer;transition:var(--transition);display:flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;touch-action:manipulation;color:var(--text-secondary)}
/* Icon Style's ☑️/✖️ here specifically (ICON_MARK_CORRECT/ICON_MARK_INCORRECT) — the button's
   own icon, not the overlaid .wager-badge (selector is a direct child so it never touches that
   badge's own icon-emoji, which already sits centered on its own). Both glyphs' visible ink sits
   measurably below the flex-centered box a plain glyph occupies — getBoundingClientRect reports
   that box as already centered (margin:0 measures dx/dy 0,0), which is a red herring: it's the
   LAYOUT box, not where the glyph's ink actually paints inside it, and only a scaled-up screenshot
   of the real in-place button (not a relocated clone — cloning this specific button and moving it
   via position:fixed breaks the @container query below, silently resizing it, which is what
   produced a wrong calibration and had to be redone) shows the true gap. -.24em is that value at
   THIS rule's own 1.1rem — the @container override below repeats this at 1rem's own ratio rather
   than assuming one em value holds across both, since testing showed it doesn't scale evenly. */
.result-btn>.icon-emoji{margin-top:-.24em}
.result-btn:hover:not(.correct-sel):not(.incorrect-sel){background:var(--bg-hover)}
/* Same fill tokens as .wager-btn.correct/.incorrect (not a neutral --bg-card) so a selected
   ✓/✕ reads consistently with the colored wager buttons elsewhere in the same round instead of
   looking like a different, more muted control. */
.result-btn.correct-sel{background:var(--btn-correct-bg);border:2px solid var(--accent-green);color:var(--badge-green-fg)}
.result-btn.incorrect-sel{background:var(--btn-incorrect-bg);border:2px solid var(--accent-red);color:var(--txt-red)}

/* STANDINGS — deliberately mirrors .final-table's look (full-width, left-aligned name,
   right-aligned score, real <thead>) rather than a narrow centered block: same idea, same
   visual language, minus the Place column. */
.standings-block{background:var(--bg-card-alt);border:1px solid var(--border);border-radius:var(--radius);padding:10px;margin-bottom:8px}
/* Whole row (chevron + title) is the collapse toggle, like a question header's q-header-left. */
.standings-title-row{display:flex;align-items:center;gap:8px;cursor:pointer;user-select:none}
.standings-block .standings-title{font-family:var(--font-display);font-size:max(12px,.88rem);font-weight:600;color:var(--badge-gold-fg);text-transform:uppercase;letter-spacing:.5px}
/* Light theme only: --badge-gold-fg has to stay dark enough to hold 4.5:1 on white (#845e00),
   which reads as a dull brownish mustard rather than actual gold — a problem dark theme's own
   vivid #ffee00 gold never has, so dark theme keeps the shared token above untouched. Nothing
   about this title needs to BE gold specifically, so light mode gets the same teal already used
   one line down for the standings themselves (--txt-cyan), which reads clean at 5.6:1 on this
   block's own background instead. */
[data-theme="light"] .standings-block .standings-title{color:var(--txt-cyan)}
.standings-chevron{transition:transform .25s;flex-shrink:0}
.standings-block.collapsed .standings-collapsible{display:none}
.standings-block.collapsed .standings-chevron{transform:rotate(-90deg)}
/* Banter, sort buttons, and the table are all inside this wrapper so they collapse together. */
.standings-collapsible{margin-top:8px}
.standings-sort-btns{display:flex;gap:6px;align-items:center;margin-bottom:7px}
/* 32px, halfway between where these started and where v18.64 put them. They sit in the Before
   Halftime / Before Final Wager blocks, and at their original .65rem/3px they were about 20px —
   small enough to need a careful, deliberate tap at the one moment in the night the host is
   reading scores aloud rather than looking at the screen. 44px fixed that and overshot: two
   chunky pills above a quiet little standings table, pulling more attention than the scores they
   sit over. 32px is the compromise, and the cost is worth stating plainly — it is under the 44px
   both platform guidelines ask for, so this is a deliberate trade of guideline compliance for
   proportion rather than a claim to meet it. Still comfortably over the 24px WCAG 2.5.8 asks for
   at AA, and 60% bigger than what was there.
   max(2rem,32px) rather than a plain 2rem: the rem tracks Settings > Size so scaling the app up
   scales the button, but the app's root is 15px, so rem alone would land at 30px at the default
   and lower at the small end of the range. The px floor holds the bottom. Deliberately not
   narrowed further on desktop: this app is used on a phone or tablet at a venue far more than at
   a desk. */
.standings-sort-btn{display:inline-flex;align-items:center;justify-content:center;gap:.4em;font-family:var(--font-display);font-size:max(12px,.72rem);font-weight:700;min-height:max(2rem,32px);min-width:max(2rem,32px);padding:0 11px;border:1px solid var(--border-control);border-radius:var(--radius);background:var(--bg-input);color:var(--text-secondary);cursor:pointer;transition:var(--transition);text-transform:uppercase;letter-spacing:.3px;white-space:nowrap;touch-action:manipulation}
.standings-sort-btn:hover{background:var(--bg-hover);color:var(--text-primary)}
.standings-sort-btn.active{background:var(--badge-gold-fg);color:var(--on-badge);border-color:var(--badge-gold-fg)}
/* Light theme only — same dull-mustard problem and same fix as .standings-title just above:
   --badge-gold-fg has to stay dark enough to hold 4.5:1 as TEXT on white, which makes a poor
   background color choice on its own terms (a washed brown chip rather than an actual "active"
   accent), a problem dark theme's vivid gold doesn't have. --on-badge (white) still clears 6.4:1
   against this teal, so it's reused as-is rather than needing its own override too. */
[data-theme="light"] .standings-sort-btn.active{background:var(--txt-cyan);border-color:var(--txt-cyan)}
.standings-table{width:100%;border-collapse:collapse;font-size:max(12px,.86rem)}
.standings-table th,.standings-table td{padding:7px 8px;border-bottom:1px solid var(--border)}
.standings-table thead th{color:var(--text-muted);font-weight:600;font-size:max(12px,.7rem);text-transform:uppercase;letter-spacing:.04em;text-align:left}
.standings-table thead th:last-child{text-align:right}
.standings-table tbody tr:last-child td{border-bottom:none}
.standings-row{cursor:pointer;transition:var(--transition)}
.standings-row:nth-child(even){background:var(--row-stripe)}
.standings-name{text-align:left;font-weight:600}
.standings-pts{font-family:var(--font-display);font-size:1.1rem;font-weight:700;color:var(--txt-cyan);text-align:right}

/* BEER ROUND — Q5 special wagers (Round 2 halftime, Round 4 final) */
.special-section.beer-round{background:var(--beer-bg)!important;border-color:var(--beer-border)!important}
.special-section.beer-round h3{color:var(--badge-gold-fg)!important}
/* Opaque header band, so the gold stops at the header instead of running edge to edge.
   Round 4's Q5 was the most golden thing in the app: .special-section is one padded box with no
   separate header surface, so a Beer Round painted the title row, the badge row and the whole
   body in --beer-bg together. Round 3's Q5 is the same colour but reads as far less of it,
   because .question-block gives .q-header its own opaque --bg-input fill and only the body below
   it goes gold. This gives the special sections that same split.
   Negative margins because .special-section carries 12px of padding that .question-block does
   not — the band has to reach back out to the section's inner edge to be a band at all, and the
   padding is then restated on the band itself. The radius is the section's own 12px less its 2px
   border, so the band's top corners sit inside the border rather than crossing it. */
.special-section.beer-round .sw-header{
  background:var(--bg-input);margin:-12px -12px 0;padding:8px 12px;border-radius:10px 10px 0 0}
/* Collapsed there is no body under the band, so it takes the section's full inner radius and
   pulls the leftover strip of padding out from under itself too. */
.special-section.beer-round.sw-collapsed .sw-header{margin-bottom:-12px;border-radius:10px}

/* SPECIAL WAGER SECTIONS */
.special-section{background:var(--bg-card-alt);border:2px solid var(--accent-magenta);border-radius:var(--radius-lg);padding:12px;margin-bottom:8px;scroll-margin-top:calc(var(--header-h,80px) + var(--mini-progress-h,0px) + 12px)}
.special-section h3{font-family:var(--font-display);font-size:max(12px,.88rem);color:var(--txt-magenta);text-transform:uppercase;letter-spacing:1px;margin-bottom:8px}
.special-section.final-wager{border-color:var(--accent-orange)}
.special-section.final-wager h3{color:var(--txt-orange)}
.special-wager-row{display:flex;align-items:center;gap:.5rem;padding:var(--row-pad) 12px;border-bottom:1px solid var(--border);margin-left:-12px;margin-right:-12px;min-height:3.2rem}
.special-wager-row:last-child{border-bottom:none}
.special-wager-row:nth-child(even){background:var(--row-stripe)}

/* BONUS Q5 ROWS */
.bonus-row{display:flex;align-items:center;gap:.5rem;padding:var(--row-pad) 10px;border-bottom:1px solid var(--border);margin-left:-10px;margin-right:-10px;min-height:3.2rem}
.bonus-row:last-child{border-bottom:none}
.bonus-row:nth-child(even){background:var(--row-stripe)}
.bonus-right{display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0}
.adj-stepper,.stepper{display:flex;align-items:center;flex-shrink:0}
.stepper button{width:1.9rem;height:1.9rem;border:1px solid var(--border-control);background:var(--bg-card);color:var(--text-secondary);font-size:1.1rem;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:var(--transition)}
.stepper button:first-child{border-radius:6px 0 0 6px}
.stepper button:last-child{border-radius:0 6px 6px 0}
.stepper button:hover{background:var(--bg-hover);color:var(--text-primary)}
.stepper-val{width:2.2rem;height:1.9rem;display:flex;align-items:center;justify-content:center;background:var(--bg-card);border-top:1px solid var(--border-light);border-bottom:1px solid var(--border-light);font-family:var(--font-display);font-weight:700;font-size:1rem}
.sw-val{width:2.8rem;height:1.9rem;display:flex;align-items:center;justify-content:center;background:var(--bg-card);border-top:1px solid var(--border-light);border-bottom:1px solid var(--border-light);font-family:var(--font-display);font-weight:700;font-size:1rem;color:var(--text-primary)}
.sw-val.unset{color:var(--text-muted);font-size:max(12px,.85rem)}
/* Same fixed-width reasoning as .ta-pts above — see that comment. */
.ta-pts,.bonus-pts{font-family:var(--font-display);font-size:1.18rem;font-weight:800;width:3.7rem;text-align:center;flex-shrink:0;padding:6px 10px;border-radius:8px;line-height:1.05;letter-spacing:.3px}
.q-stat-correct,.pts-pos,.bonus-pts.pts-pos{color:var(--pts-pos-fg);background:var(--pts-pos-bg);border:1px solid var(--pts-pos-border)}
.q-stat-incorrect,.pts-neg,.pts-nil,.bonus-pts.pts-nil{color:var(--pts-neg-fg);background:var(--pts-neg-bg);border:1px solid var(--pts-neg-border)}
/* No width here — same reasoning as the generic .pts-zero rule above: it comes from .bonus-pts
   alone so every state (including this one) resolves the container-query override identically. */
.pts-zero,.bonus-pts.pts-zero{color:var(--text-muted);text-align:center;font-weight:700}
/* Points readouts are status text, not buttons: no fill or outline, so they don't look tappable. */
.ta-pts,.bonus-pts,.ta-pts.pts-pos,.ta-pts.pts-neg,.ta-pts.pts-nil,.bonus-pts.pts-pos,.bonus-pts.pts-neg,.bonus-pts.pts-nil{background:transparent;border-color:transparent;font-size:1rem;font-weight:700}
/* Light theme's --pts-*-fg is white (it sat on a solid fill), so the flat text uses the solid fill colour instead. */
[data-theme="light"] :is(.ta-pts,.bonus-pts).pts-pos{color:var(--pts-pos-bg)}
[data-theme="light"] :is(.ta-pts,.bonus-pts):is(.pts-neg,.pts-nil){color:var(--pts-neg-bg)}

/* EXPORT */
/* Centred to line up with the Clear Session button directly below it, which has been
   text-align:center all along — left-aligned, the section read as two rows that had
   nothing to do with each other. Applies at every width: the same reasoning holds once
   the three wrap onto separate lines on a phone. */
.export-group-title{margin:12px 0 0;text-align:center;font-family:var(--font-display);font-size:max(12px,.8rem);font-weight:700;text-transform:uppercase;letter-spacing:1px;color:var(--text-muted)}
.export-group-title+.export-bar{padding-top:6px}
.winner-copy{display:flex;flex-direction:column;gap:6px;max-width:22rem;margin:0 auto 8px}
.wc-btn{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:8px 10px}
.wc-label{font-family:var(--font-display);font-weight:800;font-size:max(12px,.75rem);text-transform:uppercase;letter-spacing:.3px;color:var(--accent-gold);min-width:4.6rem}
.wc-name{flex:1;font-weight:600;word-break:break-word}
.wc-copy{flex:none;font-weight:700;font-size:max(12px,.8rem);text-transform:uppercase;letter-spacing:.3px;padding:2px 10px;border:1px solid var(--border);border-radius:var(--radius)}
.wc-copy{display:inline-grid;text-align:center;white-space:nowrap}
.wc-copy>span{grid-area:1/1}
.wc-copy{transition:background-color .35s ease,color .35s ease,border-color .35s ease}
.wc-copy>span{transition:opacity .35s ease}
.wc-copy-done,.wc-copied .wc-copy-idle{opacity:0}
.wc-copied .wc-copy-done{opacity:1}
.wc-copy.wc-copied{background:var(--correct-badge-bg);color:var(--correct-badge-fg);border-color:var(--correct-badge-bg)}
.export-bar{display:flex;gap:16px;flex-wrap:wrap;justify-content:center;padding:10px 0}
/* XLSX / PDF export as square, icon-forward buttons — a big glyph stacked over a small label is
   a far bigger tap target on a phone (and click target on desktop) than a .78rem icon beside a
   short word. Reused verbatim by the Craft Prize sound-test bar (.cp-test-bar). font-size here
   sizes the glyph itself — .icon-ui is 1em, .icon-emoji inherits it. */
.export-sq{flex-direction:column;gap:3px;width:4.6rem;height:4.6rem;padding:6px 4px;font-size:1.9rem;line-height:1}
.export-sq .export-sq-label{font-family:var(--font-body);font-size:max(12px,.62rem);font-weight:700;letter-spacing:.5px}
.export-sq .icon-emoji{line-height:1}
/* JD Form is a square icon-forward button like XLSX/PDF now — the big Guy Fawkes mask
   stacked over a "JD Upload / Form" label. Wider than the 4.6rem XLSX/PDF squares because its
   label is longer, and its label line-height opens up for the wrap. */
.export-bar .export-sq{font-size:3.2rem;gap:0;padding:2px 4px 3px;line-height:1;width:auto;height:auto;min-width:4.6rem}
.export-bar .export-sq:not(.jd-upload-btn){font-size:2.5rem}
.export-sq.jd-upload-btn .export-sq-label{letter-spacing:.3px}
/* Phones and iPad portrait: each group (Download Scoresheet, Submit Results) is a row of two squares under its own heading. */
@media(max-width:600px),(pointer:coarse) and (orientation:portrait) and (max-width:1100px){
.export-bar{display:grid;grid-template-columns:repeat(2,clamp(5.5rem,28vw,6rem));justify-content:center;gap:12px 16px}
.export-bar .export-sq{width:100%;min-width:0;height:auto;aspect-ratio:1/1;justify-content:center;font-size:clamp(2.6rem,11vw,3rem)}
.export-bar .export-sq:not(.jd-upload-btn){font-size:clamp(2.6rem,11vw,3rem)}
.export-bar .export-sq .export-sq-label{font-size:max(12px,.9rem);font-weight:800}
.export-bar .jd-upload-btn .icon-fawkes{width:1.2em;height:1.2em}
.export-bar .photo-upload-btn .export-sq-label,.export-bar .jd-upload-btn .export-sq-label{white-space:normal;text-align:center;line-height:1.05}
.export-bar .jd-upload-btn .export-sq-label{font-size:max(12px,.78rem);letter-spacing:0;margin-top:-.1rem}
}
.export-prompt{display:none;background:var(--bg-card-alt);border:1px solid var(--accent-gold);border-radius:var(--radius);padding:10px;margin-top:8px}
.export-prompt.show{display:block}
.export-prompt-btns{display:flex;gap:16px;margin-top:10px}
.export-prompt-btns .btn{flex:1;min-height:44px;font-size:1rem}
.export-prompt-btns .btn.export-prompt-no{background:transparent;border:2px solid var(--accent-red);color:var(--txt-red);font-weight:700}
.export-photo-hint{font-size:max(12px,.78rem);margin:0 0 8px}
.export-photo-hint a{color:var(--accent-gold);text-decoration:underline}
.export-prompt p{margin-bottom:6px;color:var(--badge-gold-fg);font-weight:600;font-size:max(12px,.85rem)}
#fileLoadInput,#prefsLoadInput,#importLoadInput{display:none}



/* CLICKABLE TEAM NAME (opens audit) */
.ta-name-clickable{cursor:pointer}
.ta-name-clickable:hover{color:var(--txt-cyan);text-decoration:underline}
.ta-name-clickable::after{content:'';display:inline-block;width:1.15em;height:1.15em;vertical-align:-.2em;margin-left:4px;opacity:0;transition:opacity .15s;background:var(--tint-cap);-webkit-mask:var(--magnifier-mask) center/contain no-repeat;mask:var(--magnifier-mask) center/contain no-repeat}
/* The drawn magnifier above is the Pictograph one: a mask, so the 38% lens fill matches the other
   tinted pictographs and the colour follows the theme. Emoji style swaps the platform glyph back.
   \FE0F (VS16) forces full-color emoji presentation — without it some platforms fall back to a
   plain monochrome glyph. */
:root{--magnifier-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='7' stroke-width='2.6' fill='%23000' fill-opacity='.38'/%3E%3Cpath d='M6.6 9.4a3.6 3.6 0 0 1 2.8-2.8' stroke-width='1.6'/%3E%3Cpath d='M15.4 15.4 21 21' stroke-width='3.6'/%3E%3C/svg%3E")}
[data-icons="emoji"] .ta-name-clickable::after{content:'\1F50D\FE0F';width:auto;height:auto;vertical-align:baseline;font-size:1.25em;background:none;-webkit-mask:none;mask:none}
/* ...but not on the question rows' team names, where it cost more than it was worth. Reserving
   room for it (as padding, or inline as it used to be) makes names wrap earlier than they need
   to in an 11rem column, and NOT reserving room means it sits on top of the name it belongs to.
   Neither is worth paying for a second hint: .ta-name-clickable already turns --txt-cyan and
   underlines on hover, which is the same signal every other link in the app uses, and the mobile
   rule below has shipped without the icon all along. It stays on the standings and Final Results
   cells, which are single-line and have width to spare. */
.ta-name.ta-name-clickable::after{content:none}
.ta-name-clickable:hover::after{opacity:1}
/* Wide score column only: question-row names get the magnifier as a small badge laid OVER the end of
   the name box (absolutely positioned, so it takes no room and cannot change where names wrap or
   how they centre, which was the original reason for dropping it). The narrow layout is unchanged. */
@container scorecol (min-width:601px){
  .ta-name.ta-name-clickable{position:relative}
  .ta-name.ta-name-clickable::before,.ta-name.ta-name-clickable::after{content:'';position:absolute;top:50%;opacity:0;transition:opacity .15s;pointer-events:none}
  .ta-name.ta-name-clickable::before{right:2px;width:1.7em;height:1.7em;margin-top:-.85em;border-radius:50%;box-sizing:border-box;background:var(--bg-card);border:1px solid var(--hover-ring)}
  .ta-name.ta-name-clickable::after{right:calc(2px + .35em);width:1em;height:1em;margin:-.5em 0 0;font-size:inherit;background:var(--tint-cap);-webkit-mask:var(--magnifier-mask) center/contain no-repeat;mask:var(--magnifier-mask) center/contain no-repeat}
  .ta-name.ta-name-clickable:hover::before,.ta-name.ta-name-clickable:hover::after{opacity:1}
}

/* FULLY CLICKABLE ROWS (standings + final results) — the whole row is the audit target, not
   just the name text, so the magnifying glass needs to react to hovering anywhere in the row,
   not only the name. */
.standings-row,.final-table tbody tr{cursor:pointer;transition:var(--transition)}
/* Outline instead of a background swap: the row's fill stays put on hover, and the outline
   color (--accent-cyan-solid) is >=4.3:1 against every theme/color-vision surface it sits on
   here, unlike the old inset box-shadow (--border-light was only ~1.8–2.7:1). Standings-only —
   Final Results dropped the whole-row outline (it read as a distracting box around already-
   colorful medal/tiebreak rows) and relies on the magnifying glass alone as its hover cue. */
@media (hover:hover) and (pointer:fine){.standings-row:hover{outline:2px solid var(--accent-cyan-solid);outline-offset:-2px}}
.standings-row:hover .ta-name-clickable,.final-table tbody tr:hover .ta-name-clickable{color:var(--txt-cyan);text-decoration:underline}
.standings-row:hover .ta-name-clickable::after,.final-table tbody tr:hover .ta-name-clickable::after{opacity:1}

/* MANUAL ENTRY for special wagers (stepper + type) */
.stepper input.sw-input{width:2.8rem;height:1.9rem;text-align:center;background:var(--bg-card);border:none;border-top:1px solid var(--border-control);border-bottom:1px solid var(--border-control);border-radius:0;color:var(--text-primary);font-family:var(--font-display);font-weight:700;font-size:1rem;padding:0;outline:none;box-shadow:none;-moz-appearance:textfield;appearance:textfield}
.stepper input.sw-input::-webkit-outer-spin-button,.stepper input.sw-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.stepper input.sw-input::placeholder{color:var(--text-muted);font-weight:400}
.stepper input.sw-input:focus{background:var(--bg-hover);box-shadow:none}

/* R2/R4 BONUS WAGER entry: a single dropdown (1-10 / 1-20), replacing the old +/- stepper —
   one tap sets the wager, no separate typed field. Kept as its own .sw-select class (not a
   rename of .stepper/.sw-input) since those are also reused, unrelated, by the Craft Draw
   panel's "Exclude Top"/"Drumroll" fields above. text-align-last centers the CLOSED box's
   selected value — the only part of a native <select> that's reliably style-able; the open
   option list's own alignment is left to the browser/OS. */
.sw-select{height:1.9rem;border:1px solid var(--border-control);border-radius:6px;background:var(--bg-card);color:var(--text-primary);font-family:var(--font-display);font-weight:700;font-size:1rem;padding:0 4px;text-align:center;text-align-last:center;cursor:pointer;touch-action:manipulation;flex-shrink:0}
.sw-select:hover{background:var(--bg-hover)}
.sw-select:focus{background:var(--bg-hover);outline:2px solid var(--accent-cyan-solid);outline-offset:1px}

/* BONUS submitted / zero-correct state (R1 & R3) */
.stepper-val.unset{color:var(--text-muted);font-size:max(12px,.85rem)}
.bonus-pts.submitted-zero{color:var(--pts-neg-fg);background:var(--pts-neg-bg);border:1px solid var(--pts-neg-border);font-size:1.05rem;font-weight:800}
.bonus-zero{font-family:var(--font-display);font-size:max(12px,.72rem);font-weight:700;padding:0 8px;height:1.9rem;border:1px solid var(--accent-green);border-radius:6px;background:color-mix(in srgb,var(--accent-green) 8%,transparent);color:var(--badge-green-fg);cursor:pointer;transition:var(--transition);white-space:nowrap;flex-shrink:0;touch-action:manipulation}
.bonus-zero:hover{background:color-mix(in srgb,var(--accent-green) 18%,transparent)}
.bonus-clear{width:1.9rem;height:1.9rem;border:1px solid var(--border-control);border-radius:6px;background:var(--bg-input);color:var(--text-muted);cursor:pointer;font-size:max(12px,.95rem);display:flex;align-items:center;justify-content:center;transition:var(--transition);flex-shrink:0;touch-action:manipulation}
@media (hover:hover) and (pointer:fine){.bonus-clear:hover{background:color-mix(in srgb,var(--accent-red) 12%,transparent);color:var(--txt-red);border-color:var(--accent-red)}}

/* BONUS ONE-CLICK CHOICE (R1 & R3) — one tap sets 0-4 correct, tap again to unselect */
.bonus-choice{display:flex;gap:.18rem;flex-shrink:0}
.bonus-choice-btn{width:2.2rem;height:2.2rem;border:1px solid var(--border-control);border-radius:6px;background:var(--bg-card);color:var(--text-secondary);font-family:var(--font-display);font-weight:700;font-size:1rem;cursor:pointer;display:flex;align-items:center;justify-content:center;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:var(--transition);position:relative}
.bonus-choice-btn:hover:not(.correct):not(.incorrect){background:var(--bg-hover);color:var(--text-primary)}
.bonus-choice-btn.correct{background:var(--btn-correct-bg);border:2px solid var(--accent-green);color:var(--text-primary)}
.bonus-choice-btn.incorrect{background:var(--btn-incorrect-bg);border:2px solid var(--accent-red);color:var(--text-primary)}

.question-title.bonus-title{flex-direction:column;align-items:flex-start;gap:4px}
.bonus-title-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
/* Round 1/3 bonus title colors — reuses the same tokens the rl-1/rl-3 round badges already
   use elsewhere, verified >=8:1 contrast against --bg-card-alt in every theme x color-vision
   mode combination (dark, light, and both colorblind simulations). */
.bq-r1{color:var(--txt-cyan)}
.bq-r3{color:var(--badge-gold-fg)}
/* q-badge-lg used to bump the bonus-question badge above the base .q-badge size; now that
   every "Done"/status badge already uses the larger 1rem base size, only the padding bump
   is still meaningful — kept so existing markup referencing the class still resolves. */
.q-badge.q-badge-lg{padding:3px 10px}

/* SPECIAL WAGER collapse (R2 Bonus Wager / R4 Final Wager) — the collapse toggle and the
   Sort button are separate flex children (sw-header-left/q-header-right) so tapping
   a button doesn't also collapse the section. */
.sw-header{display:flex;align-items:center;gap:8px;user-select:none}
.sw-header-left{display:flex;align-items:center;gap:8px;cursor:pointer;flex:1;min-width:0}
.sw-header h3{margin-bottom:0!important}
/* "Q5" + its Done/Beer/remaining badge stay on their own top line, with the "BONUS WAGER
   (1-10/1-20)" range label always on a second line beneath — a fixed two-line layout at
   every width, rather than shrinking the font to force it onto one line (that made the text
   too small to read on a phone). Both lines inherit the h3's own font-size/color/weight, so
   neither line reads any smaller than the section title always has. */
.sw-title{display:flex;flex-direction:column;gap:2px;min-width:0}
.sw-title-row{display:flex;align-items:center;gap:8px}
.sw-header-left:hover{opacity:.85}
.sw-header .q-chevron{transition:transform .25s}
.special-section.sw-collapsed .q-chevron{transform:rotate(-90deg)}
.special-section.sw-collapsed .sw-body{display:none}
.special-section.sw-collapsed :is(.q-header-right,.q-stats-row){visibility:hidden}
.special-section .sw-body{margin-top:8px}

/* Beer round — full gold border so it reads at a glance (no size change) */
.question-block.beer-round{border-color:var(--beer-border)!important}

/* Craft Prize Drawing — same --beer-bg/--beer-border tokens as a Beer Round question block,
   applied to the whole section (not just the winner announcement) so the section itself
   reads as beer-branded at a glance. .section-header keeps its own opaque --bg-card-alt
   fill (same as a Beer Round question's own header), so only the body area picks up the
   golden tint underneath it. */
#sec-craftprize{background:var(--beer-bg);border-color:var(--beer-border)}

/* Scoreboard rows: a tap anywhere opens the row menu (Team Report, Craft Prize winner). */
.score-row[data-ti]{cursor:pointer;-webkit-tap-highlight-color:transparent}
.score-row.sr-menu-open{flex-wrap:wrap}
.sr-menu{flex-basis:100%;display:flex;flex-wrap:wrap;gap:6px;padding-top:8px;cursor:default}
.sr-menu-btn{flex:1 1 9rem;justify-content:center}
.sr-menu-note{flex-basis:100%;margin:0;font-size:max(12px,.75rem);color:var(--text-muted)}
.sr-name-clickable{cursor:pointer}
.sr-name-clickable:hover{color:var(--badge-gold-fg)}
.score-row.cb-prize{border:1px solid var(--badge-gold-fg);border-radius:8px;background:color-mix(in srgb,var(--accent-gold) 8%,transparent);margin-left:0;margin-right:0}
.cb-tag{font-family:var(--font-body);font-size:max(12px,.58rem);font-weight:700;color:var(--badge-gold-fg);background:color-mix(in srgb,var(--accent-gold) 14%,transparent);border:1px solid var(--badge-gold-fg);border-radius:4px;padding:1px 5px;margin-left:5px;white-space:nowrap;text-transform:uppercase;letter-spacing:.5px;vertical-align:middle}
/* .cb-tag can sit on a team row that is ALSO gold-tinted (.score-row.cb-prize), compounding
   the tint darker than badge-gold-fg was tuned for — bump brightness for that one case. */
[data-theme="dark"][data-cb="2"] .score-row.cb-prize .cb-tag{color:#ffb3ff}

/* CRAFT PRIZE RANDOMIZER */
.cp-config{display:flex;flex-wrap:wrap;justify-content:center;gap:16px;margin-bottom:8px}
/* .section-body has no top padding — every other section opens on something that brings its own
   leading space, and Craft Prize Drawing is the one that does not. Whatever it opens on lands
   flush against the bottom edge of the section header: the "Choose Craft Prize Winner" button
   before the flow is opened, and the EXCLUDE TOP / DRUMROLL (SEC) captions once it is. Applied
   to the first child rather than to either of them by name, so all three states this section
   renders — the button, the config row, and the "Add teams to run the craft prize drawing"
   note — clear the header by the same amount, and adding a fourth needs nothing here. Scoped to
   this section: the rest of the app's sections open on blocks that already stand off correctly,
   and a blanket rule would add space they have not asked for. 10px matches what .export-bar
   takes for the same job one section down. */
#sec-craftprize .section-body>:first-child{margin-top:10px}
.cp-field{display:flex;flex-direction:column;align-items:center;gap:5px}
.cp-field-label{font-size:max(12px,.8rem);color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:.3px;text-align:center}
.cp-field .stepper input.sw-input{width:3.6rem;font-size:1.75rem;line-height:1;font-weight:700;font-variant-numeric:tabular-nums}
/* v21.25: the Craft Prize Drumroll (sec) / Exclude Top +/- buttons were small and short; now roomier tap targets. */
.cp-field .stepper button{width:2.6rem;height:2.6rem;font-size:1.3rem}
.cp-field .stepper input.sw-input{height:2.6rem;min-height:0;box-sizing:border-box;padding-top:0;padding-bottom:0}
.cp-field .stepper button{min-height:0;box-sizing:border-box}
.cp-status{font-size:max(12px,.72rem);color:var(--text-muted);margin-bottom:2px}
.cp-excluded{margin:8px 0;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-input)}
.cp-excluded-title{font-size:max(12px,.8rem);font-weight:700;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.3px;margin-bottom:4px}
.cp-excluded-list{list-style:none;margin:0;padding:0}
.cp-excluded-list li{display:flex;align-items:baseline;gap:8px;padding:3px 0;font-size:1rem;color:var(--text-primary,inherit)}
.cp-excluded-rank{font-family:var(--font-display);font-weight:800;min-width:2.2rem;color:var(--accent-gold)}
.cp-excluded-name{font-weight:600;word-break:break-word}
[data-theme="light"] .cp-excluded-rank{color:var(--tint-theme-2)}
.cp-note{font-size:max(12px,.66rem);color:var(--text-muted);margin-bottom:8px;font-style:italic}
.cp-draw-btn{width:100%}
.cp-draw-btn:disabled{opacity:.5;cursor:not-allowed}
.cp-intro{font-size:max(12px,.78rem);color:var(--text-secondary);margin-bottom:6px;font-style:italic}
.cp-flash{font-family:var(--font-display);font-size:1.3rem;font-weight:800;text-align:center;padding:14px 8px;color:var(--badge-gold-fg);background:color-mix(in srgb,var(--accent-gold) 8%,transparent);border:2px dashed var(--accent-gold);border-radius:var(--radius);animation:cpPulse .22s ease-in-out infinite alternate}
@keyframes cpPulse{from{opacity:.75;transform:scale(.99)}to{opacity:1;transform:scale(1.01)}}
/* Drumroll countdown — lets the host glance at exactly how far into the drumroll they are
   while manually raising the volume and talking over it, rather than guessing. */
.cp-countdown{display:flex;align-items:center;gap:10px;margin-top:8px}
.cp-countdown-track{flex:1;height:10px;border-radius:6px;background:var(--bg-input);border:1px solid var(--border);overflow:hidden}
/* transform:scaleX(), not width — this animates every 100ms for the whole drumroll countdown
   (js/craft-prize.js's countdownTimer), and a width transition triggers layout on every single
   tick; scaleX runs on the compositor thread instead, which matters most exactly here, the one
   moment jank is most visible to a room full of people watching the bar fill. transform-origin
   pins the scale to the left edge so the bar SHRINKS leftward toward the seconds readout on the left (the default center
   origin would grow from the middle both ways instead) — same look as the old width-based bar,
   cheaper to animate. width:100% is the unscaled full-track size scaleX() then shrinks down
   from, taking over the role the JS-set inline width used to play. */
.cp-countdown-fill{height:100%;width:100%;transform-origin:left;background:var(--accent-cyan-solid);transition:transform .1s linear}
.cp-countdown-num{font-family:var(--font-display);font-size:1.15rem;font-weight:800;color:var(--txt-cyan);min-width:2.8rem;padding-left:.6rem;box-sizing:content-box;text-align:left;font-variant-numeric:tabular-nums}
.cp-manual-end-btn{width:100%;margin-top:8px}
/* Start Drumroll / Stop Drumroll / Play Horn as square, icon-forward buttons (the same
   .export-sq treatment as XLSX/PDF and the sound-test bar) so they're an easy phone tap. A hair
   wider/taller than the 4.6rem export squares to fit a two-line "Start / Drumroll" label. The
   compound selector out-specifics the older single-class .cp-draw-btn/.cp-manual-end-btn/
   .cp-horn-btn width and font-size rules; .cp-preview-btn's own .35 opacity still shows through
   (it isn't touched here). */
.cp-btn-row{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:10px}
.export-sq.cp-sq-btn{width:auto;min-width:var(--cp-sq-size);height:auto;min-height:var(--cp-sq-size);font-size:1.9rem;line-height:1.1;padding:8px 10px;margin-top:0;flex:0 0 auto}
/* Choose Craft Prize Winner: a full-width horizontal bar with a big mug on the left and a
   two-line label, instead of the square icon-over-label tile the other drumroll buttons use. */
.cp-btn-row .cp-wide-btn{width:auto;max-width:100%;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;min-height:3.6rem;padding:6px 18px;margin-top:0}
.cp-wide-btn .icon-ui{width:3.2rem;height:3.2rem}
.cp-wide-btn .icon-emoji{font-size:2.6rem;line-height:1}
.cp-wide-label{font-family:var(--font-body);font-size:1rem;font-weight:800;line-height:1.1;letter-spacing:.3px;text-align:left}
/* iPad portrait: the wide bars are too big, so they go back to compact square icon-over-label tiles. */
@media(pointer:coarse) and (orientation:portrait) and (min-width:601px) and (max-width:1100px){
.cp-btn-row .cp-wide-btn{flex-direction:column;gap:2px;width:5.5rem;height:5.5rem;min-height:0;padding:6px 4px}
.cp-wide-btn .icon-ui{width:2.4rem;height:2.4rem}
.cp-wide-btn .icon-emoji{font-size:2.1rem}
.cp-wide-label{font-size:max(12px,.8rem);text-align:center}
}
.cp-preview-btn{opacity:.35;cursor:not-allowed}
/* Trophy+name+"won!" are one flowing text span (not separate flex items) so a long team name
   wraps onto a second line on its own, with "won!" following right after it — the Clear
   button is the only other flex item, so it stays put on the first line instead of also
   wrapping to its own row. */
.cp-winner{font-size:max(12px,.9rem);margin:8px 0 6px;color:var(--text-primary);display:flex;align-items:center;flex-wrap:wrap;gap:10px}
/* flex:0 1 auto (not flex:1): the text takes only its own natural width so the Clear button
   sits right next to "won!" instead of being pushed out to the far right edge of the card at
   every viewport width. flex-wrap on .cp-winner above still lets the button drop to its own
   line if a long team name eats the whole row's width, so it never ends up stranded. */
.cp-winner-text{flex:0 1 auto;min-width:0}
.cp-horn-btn,.cp-clear-btn{font-size:max(12px,.9rem);line-height:1;padding:5px 9px;border-radius:var(--radius);flex-shrink:0}
/* "Clear" label text is desktop-only (icon-only "✕" on mobile keeps the button compact there);
   the closer positioning above, though, applies everywhere. */
.cp-clear-label{display:none}
@media(min-width:769px){
  .cp-clear-label{display:inline}
}
/* Icon-only Clear (X) is a 44x44 square so it meets touch-target guidelines. */
@media(max-width:768px){
.cp-clear-btn{width:44px;height:44px;min-width:44px;padding:0;display:inline-flex;align-items:center;justify-content:center}
}
/* Square, icon-forward test buttons matching the XLSX/PDF export buttons (.export-sq) — the
   Roll/Fade/Crash/Horn glyphs read at a glance and give a real tap target, where the old
   .btn-sm text buttons were a cramped .72rem row. The "Test Sounds" label sits on its own line
   above the button row. */
.cp-test-bar{display:flex;flex-direction:column;align-items:center;gap:6px;margin:6px 0;padding:8px;background:color-mix(in srgb,var(--text-primary) 3%,transparent);border-radius:var(--radius);border:1px solid var(--border)}
.cp-test-bar .cp-field-label{margin-right:0}
.cp-test-bar-btns{display:flex;justify-content:center;flex-wrap:wrap;gap:6px}
.cp-script-label{display:block;font-size:max(12px,.66rem);font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px}
.cp-script{width:100%;min-height:5.5rem;padding:8px;background:var(--bg-input);border:1px solid var(--border-control);border-radius:var(--radius);color:var(--text-primary);font-family:var(--font-body);font-size:max(12px,.85rem);line-height:1.4;resize:vertical}

/* TEAM REPORT MODAL (formerly "Score Audit") */
/* Bottom padding includes the safe-area inset so the scrollable content at the very bottom
   clears the Home Bar instead of sitting flush against the physical screen edge. The top has
   none: any top padding on this scrolling container pushes .audit-head's stuck position down
   by that same amount (sticky "top:0" locks to the padding edge, not the true viewport edge),
   leaving a gap above the header that the content scrolling underneath pokes through during
   scroll. The resting top gap instead comes from .audit-modal's own margin-top below, which
   doesn't affect where a descendant sticks. */
/* overscroll-behavior:contain: keeps a rubber-band bounce at the top/bottom of this scroller
   contained to itself instead of chaining into the page behind it, which is the other half of
   the "transparent while scrolling on mobile" fix alongside html's own background above. */
.audit-overlay{display:none;position:fixed;inset:0;z-index:500;background:rgba(0,0,0,.72);align-items:flex-start;justify-content:center;padding:0 10px calc(20px + env(safe-area-inset-bottom));overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.audit-overlay.show{display:flex}
/* max-width in rem, not px. One column only has to fit its widest row, and that row's parts are
   all rem-sized — so a fixed pixel cap would be luxuriously wide at the small end of Settings >
   Size and too tight at the large end, where the row would overflow. 32rem is the widest row plus
   comfortable slack at every step of the range. */
.audit-modal{background:var(--bg-card);border:1px solid var(--border-light);border-radius:var(--radius-lg);width:100%;max-width:32rem;box-shadow:var(--shadow);margin:20px auto 0;animation:dialogPop .22s cubic-bezier(.2,.9,.3,1.2)}
@keyframes auditPop{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
/* Themed confirm()/alert() replacement (appConfirm/appAlert, js/app.js) — centered, not
   flex-start like .audit-overlay above, since this is a short one-off message rather than
   content tall enough to need top-anchored scrolling. z-index above .audit-overlay's own 500:
   a confirm can legitimately fire from inside an already-open audit/settings context (Clear
   Session sits in Game Submission, reachable while other panels are open), and has to paint over
   whichever of those is currently up. */
.confirm-overlay{display:none;position:fixed;inset:0;z-index:800;background:rgba(0,0,0,.72);align-items:center;justify-content:center;padding:20px}
.confirm-overlay.show{display:flex}
.confirm-modal{background:var(--bg-card);border:1px solid var(--border-light);border-radius:var(--radius-lg);width:100%;max-width:22rem;box-shadow:var(--shadow);padding:20px;animation:dialogPop .22s cubic-bezier(.2,.9,.3,1.2)}
.confirm-message{font-family:var(--font-body);font-size:max(12px,.9rem);line-height:1.5;color:var(--text-primary);white-space:pre-line;margin:0 0 16px}
.confirm-actions{display:flex;justify-content:flex-end;gap:8px}
.import-modal{max-width:26rem;max-height:90vh;overflow:auto}
.import-title{font-weight:700;margin-bottom:10px}
.import-bulk{display:flex;gap:8px;margin-bottom:10px}
.import-list{display:flex;flex-direction:column;gap:4px;margin-bottom:14px}
.import-row{display:flex;align-items:flex-start;gap:10px}
.import-text{display:flex;flex-direction:column;min-width:0}
.import-name{font-weight:600}
.import-val{font-size:max(12px,.8rem);color:var(--text-secondary);overflow-wrap:anywhere}
.import-row input:disabled+.import-text{opacity:1}
.import-row input:disabled+.import-text .import-val{font-style:italic}
.import-warn{font-size:max(12px,.8rem);line-height:1.4;color:var(--text-primary);margin:0 0 14px}
#importOkBtn:disabled{opacity:.5;cursor:not-allowed}
/* alert() has nothing to cancel — appAlert hides Cancel outright rather than leaving a button
   that would just do the same thing OK does. */
.confirm-modal.confirm-alert #confirmCancelBtn{display:none}
/* transform:translateZ(0) forces this sticky element onto its own GPU compositing layer — iOS
   Safari has a long-standing bug where a position:sticky element inside a
   -webkit-overflow-scrolling:touch container can repaint a frame late during momentum scroll,
   flashing transparent for an instant. Promoting it to its own layer keeps it composited
   independently instead of waiting on the rest of the modal's repaint. */
/* padding-top carries the Dynamic Island clearance directly (same approach as .header above),
   instead of the removed .audit-overlay top padding — that way the header still clears the
   notch, but by growing its own box rather than by an ancestor's padding, so top:0 sticks it
   flush with no gap for content to show through underneath. */
.audit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:calc(14px + env(safe-area-inset-top)) 16px 14px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--bg-card);border-radius:var(--radius-lg) var(--radius-lg) 0 0;z-index:2;transform:translateZ(0);-webkit-transform:translateZ(0);backface-visibility:hidden;-webkit-backface-visibility:hidden}
/* Drop shadow under the header so it visibly separates from the audit body scrolling beneath it
   instead of relying on the 1px border alone — both share the same --bg-card background, so
   without this the header edge all but disappears once content is scrolled up under it. Dark
   mode needs a pale glow (a dark shadow is invisible against this app's near-black surfaces);
   light mode gets a plain downward shadow. */
[data-theme="dark"] .audit-head{box-shadow:0 6px 12px -4px rgba(255,255,255,.18)}
[data-theme="light"] .audit-head{box-shadow:0 6px 12px -4px rgba(0,0,0,.30)}
.audit-head h2{font-family:var(--font-display);font-size:1.05rem;color:var(--txt-cyan);text-transform:uppercase;letter-spacing:1px;line-height:1.2;word-break:break-word}
.audit-head h2{min-width:0;flex:1}
.aud-name-input{width:100%;font:inherit;color:inherit;text-transform:inherit;letter-spacing:inherit;background:transparent;border:1px solid transparent;border-bottom-color:var(--border-light);border-radius:4px;padding:2px 4px;margin-left:-4px}
@media (hover:hover) and (pointer:fine){.aud-name-input:hover{border-color:var(--accent-cyan-solid)}}
.aud-name-input:focus{border-color:var(--accent-cyan-solid)}
.aud-name-row{display:flex;align-items:center;gap:8px;min-width:0}
.aud-name{min-width:0;word-break:break-word}
.aud-edit-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:1.9rem;height:1.9rem;padding:0;background:transparent;border:1px solid var(--border-strong);border-radius:6px;color:var(--txt-cyan);cursor:pointer}
@media (hover:hover) and (pointer:fine){.aud-edit-btn:hover{border-color:var(--accent-cyan-solid)}}
.aud-edit-btn .icon-ui{width:1rem;height:1rem}
.team-sort-row{display:inline-flex;gap:6px;margin:0 0 0 auto;flex-shrink:0;cursor:default}
#sec-teams>.section-header{position:sticky;top:var(--qbar-top);z-index:50;border-bottom:1px solid var(--border-strong);padding-block:8px}
.audit-head .aud-eyebrow{display:block;font-family:var(--font-body);font-size:max(12px,.74rem);color:var(--text-secondary);text-transform:none;letter-spacing:0;font-weight:500;margin-bottom:3px}
.aud-name-row{flex-wrap:wrap}
.aud-name-row .paused-pill{margin-left:0}
.audit-head .aud-sub{display:flex;flex-wrap:wrap;align-items:center;gap:2px 0;font-family:var(--font-body);font-size:max(12px,.72rem);color:var(--text-muted);text-transform:none;letter-spacing:0;font-weight:400;margin-top:5px}
.aud-rank{color:var(--txt-cyan);font-weight:700}
.aud-rank-of{color:var(--text-muted);font-weight:400}
.aud-dot{margin:0 .6em;font-weight:700}
/* Icon-only now (see buildAudit in app.js) — used to read "✕ Close", but the X alone next to a
   modal titled "Team Report" already reads as close without needing the word spelled out too.
   A circle, not the rounded square it was: with the word gone this is a lone mark, and a round
   button reads as "dismiss this" the way a rounded rectangle — the same shape every other button
   in the app uses for an action with a label — does not. Explicit equal width/height rather than
   symmetric padding, since 50% on a box sized by its content is only round while the content
   happens to be square. Matches .resume-banner-close, the app's other icon-only dismiss. */
/* Border/icon red (same --accent-red/--txt-red pair as .remove-team button) now that it's just
   an X with no "Close" text next to it to carry the "this dismisses something" signal on its
   own — red reads as that affordance the way a plain neutral-gray X didn't as clearly. */
.audit-close{font-family:var(--font-body);font-size:max(12px,.85rem);border:1px solid var(--accent-red);background:var(--bg-input);color:var(--txt-red);border-radius:50%;width:2.1rem;height:2.1rem;padding:0;display:flex;align-items:center;justify-content:center;cursor:pointer;font-weight:700;flex-shrink:0;white-space:nowrap}
.audit-close:hover{background:color-mix(in srgb,var(--accent-red) 15%,transparent)}
.audit-body{padding:12px 14px 18px}
/* Mobile default: the two columns' markup is just two sequential <div>s (no grid), so column 1
   (Extras through Halftime Bonus) and column 2 (Round 3 through Final Wager) simply stack in
   that same order — visually identical to before columns existed. */
/* Single column, always — including desktop. The two-column split (and the hairline that divided
   it) is gone: it forced the modal to be at least 680px wide, since each column needs ~314px for
   its widest row plus the gap and padding, and at that width every full-width element in the
   report — the Extras block, Grand Total, the stat rows — had a few hundred pixels of dead space
   stretched through the middle of it. One column reads as a single chronological run of rounds
   and lets the modal be as narrow as its widest row. */
.aud-round{margin-bottom:12px;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.aud-round-h{display:flex;align-items:center;gap:8px;padding:7px 12px;background:var(--bg-card-alt);font-family:var(--font-display);font-size:max(12px,.8rem);font-weight:700;text-transform:uppercase;letter-spacing:.5px}
.aud-line{display:flex;align-items:center;gap:8px;padding:6px 12px;border-top:1px solid var(--border);font-size:max(12px,.85rem)}
.aud-line:nth-child(even){background:var(--row-stripe)}
.aud-q{font-family:var(--font-display);font-weight:700;width:2.3rem;flex-shrink:0;color:var(--text-secondary)}
.aud-wager{color:var(--text-secondary);font-size:max(12px,.78rem);width:5.2rem;flex-shrink:0}
/* nowrap: "correct" / "incorrect" / "4 of 4 correct" is one atomic result, and breaking it
   across two lines made a round's rows different heights and the column ragged. The room to keep
   it on one line comes from .aud-columns collapsing to a single column once the font is large
   enough that two won't fit (see the container query below); this just makes sure the text never
   breaks in the meantime. */
.aud-res{flex:1;font-size:max(12px,.8rem);font-weight:600;min-width:0;white-space:nowrap}
/* The wager cell is the one fixed-width thing here that can afford to give: it holds at most
   "wager 12". Letting it shrink below its 5.2rem when the row is tight buys .aud-res the space
   it needs before anything has to overflow. */
.aud-wager{min-width:0}
.aud-res.aud-correct{color:var(--badge-green-fg)}
.aud-res.aud-wrong{color:var(--txt-red)}
.aud-res.aud-none,.aud-res.aud-pending{color:var(--text-muted);font-weight:400;font-style:italic}
.aud-p{font-family:var(--font-display);font-weight:700;min-width:2.8rem;text-align:right;flex-shrink:0}
.aud-p.pos{color:var(--badge-green-fg)}
.aud-p.neg{color:var(--txt-red)}
.aud-p.zero,.aud-p.none{color:var(--text-muted)}
/* Subtotal and "total so far" stack as two right-aligned lines rather than sharing one. They're
   two different figures (this round's points, and the team's running total across all rounds), and
   on one line they read as a single run-on number; stacked, each gets its own label/value pair.
   Right-aligned (not centered) so both values land in the same column as the +N point values on
   every question line above them, making a round's per-question scores and the totals they add up
   to one continuous right-hand column. Grand Total below stays centered — it's a full-width band
   of its own with no column above it to line up with. */
.aud-subline{display:flex;flex-direction:column;align-items:flex-end;gap:2px;padding:7px 12px;border-top:1px solid var(--border-light);background:var(--bg-input);font-size:max(12px,.78rem);font-weight:700}
/* Each label/value pair on its own line, held together by a fixed gap rather than pushed to
   opposite edges — that gap is what keeps them reading as one pair instead of two unrelated ends
   of a bar. */
.aud-subline .asl-row{display:flex;align-items:center;gap:10px}
.aud-subline .lbl{color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px}
.aud-subline .run{font-family:var(--font-display);color:var(--txt-cyan);font-size:max(12px,.95rem)}
.aud-subline .sub{font-family:var(--font-display);color:var(--text-primary)}
/* justify-content:center (not the old space-between) + a fixed gap: space-between pushed the
   label to the box's left edge and the score to its right edge, however wide the audit panel
   happened to be — reading as two unrelated ends of a bar rather than one "label: value" pair.
   Centering them as a group with a moderate gap keeps them visually paired without butting
   them right up against each other. */
.aud-total{display:flex;align-items:center;justify-content:center;gap:20px;padding:13px 16px;background:color-mix(in srgb,var(--accent-cyan) 8%,transparent);border:1px solid var(--accent-cyan);border-radius:var(--radius);font-family:var(--font-display);font-weight:700;text-transform:uppercase;letter-spacing:1px}
.aud-total .val{font-size:1.5rem;color:var(--txt-cyan)}
/* Overall correct/incorrect breakdown across the 16 regular round questions, shown right under
   Grand Total — two side-by-side stat tiles rather than one line so each count and its
   percentage stay legible at the same sizes .aud-total already uses. */
.aud-stats{display:flex;margin-top:8px}
.aud-stat{flex:1;min-width:70px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:9px 8px;border-radius:var(--radius);background:var(--bg-card-alt);border:1px solid var(--border)}
.aud-stat-correct .aud-stat-n{color:var(--badge-green-fg)}
.aud-stat-wrong .aud-stat-n{color:var(--txt-red)}
/* Single-card, vertical-rule layout for stat rows that hold 2+ related figures (Adj.
   Score/Diff/Score Guess, multiple bonus deductions, correct/incorrect) — one bordered card
   with equal-width grid columns and a divider between cells instead of separate bordered tiles,
   so the numbers read as one connected breakdown rather than a scattered row of boxes. */
.aud-grid{display:grid;margin-top:8px;background:var(--bg-card-alt);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.aud-grid-2{grid-template-columns:repeat(2,1fr)}
.aud-grid-3{grid-template-columns:repeat(3,1fr)}
/* Mobile/narrow default: four equal columns filling the card, so the four figures sit at even
   intervals across it and each divider lands exactly on a quarter line. There's no dead space to
   worry about at this width — a phone-width audit panel is ~355px, so four equal columns come out
   at only ~79px each and the labels very nearly fill them. Desktop packs them in instead; see the
   min-width:769px rule below. */
.aud-grid-4{grid-template-columns:repeat(4,1fr)}
/* 4px of side padding rather than the 8px .aud-cell sets below: four-to-a-row on a phone is the
   only stat row tight enough for it to matter, and it buys "Score Guess" (the longest label here)
   enough width to stay on one line. */
.aud-grid-4 .aud-cell{padding-left:4px;padding-right:4px}
.aud-cell{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;padding:9px 8px;text-align:center}
/* Inset top/bottom so the divider doesn't touch the card's rounded corners. */
.aud-cell:not(:last-child)::after{content:"";position:absolute;top:14px;bottom:14px;right:0;width:1px;background:var(--border)}
/* Desktop: sized to their contents and centered as a group, rather than four equal quarters of
   the card. This row's labels are short and very uneven ("Diff" vs "Adj. Score"), and at the audit
   panel's full 680px equal columns leave ~110px of dead space between neighbours, so the four
   figures read as scattered across the card instead of one Diff Adj -> Adj. Score -> Diff ->
   Score Guess chain. The card itself still spans the full width, matching the 2-column stat rows
   above it; only the columns inside it pack in.
   `auto`, not `max-content`: max-content refuses to shrink, so at the top of Settings > Size's
   font range (where every label grows) the four columns outgrew the card and the end cells were
   silently clipped by .aud-grid's overflow:hidden. `auto` tracks pack to content width whenever
   there's room, but shrink and let a label wrap instead of getting cut off when there isn't.
   The side padding is what sets them apart once they're packed: 26px a side puts ~52px of clear
   space between neighbouring labels, with each divider centered in that gap, so they read as four
   distinct figures in one chain rather than four words crowded together. */
@media(min-width:769px){
  .aud-grid-4{grid-template-columns:repeat(4,auto);justify-content:center}
  .aud-grid-4 .aud-cell{padding-left:26px;padding-right:26px}
}
.aud-stat-n,.aud-cell .aud-stat-n{font-family:var(--font-display);font-weight:700;font-size:max(12px,.95rem)}
.aud-stat-pct,.aud-cell .aud-stat-pct{font-family:var(--font-body);font-size:max(12px,.72rem);color:var(--text-muted);font-weight:600}
.aud-cell.aud-stat-correct .aud-stat-n{color:var(--badge-green-fg)}
.aud-cell.aud-stat-wrong .aud-stat-n{color:var(--txt-red)}
.aud-note{font-size:max(12px,.72rem);color:var(--text-muted);margin-top:10px;line-height:1.4}

/* ── Scoring rows reflow based on the CONTENT COLUMN's own width, not the
      viewport. This catches narrow desktop windows (≈500px) where the sidebar
      sits at the bottom but the column is still too tight for one-line rows. ── */
@container scorecol (max-width:600px){
  /* team name on its own line, controls right-aligned on the line below */
  .team-answer,.bonus-row,.special-wager-row{flex-wrap:wrap;row-gap:.35rem;min-height:0}
  /* The name is only as wide as its text (it used to span the whole row, so the empty space above
     the right-aligned wager buttons opened the Team Report too). A zero-height 100%-wide spacer item
     forces the controls onto the next line exactly as before; its negative top margin cancels the extra row-gap. */
  .ta-name{flex:0 1 auto;width:auto;max-width:100%;order:1;min-width:0;overflow-wrap:break-word;font-size:max(12px,.82rem);padding-left:2px;padding-right:0;line-height:1.3}
  .team-answer::before,.bonus-row::before,.special-wager-row::before{content:"";flex:0 0 100%;height:0;margin-top:-.35rem;order:2}
  .team-answer>:not(.ta-name),.bonus-row>:not(.ta-name),.special-wager-row>:not(.ta-name){order:3}
  .ta-name-clickable::after{display:none}
  /* push the control cluster to the right edge of its own line */
  .team-answer>.ta-wagers,.bonus-row>.bonus-right,.special-wager-row>.sw-select{margin-left:auto}

  /* wager / result buttons: clamp so they can't balloon past the column */
  .wager-btn,.result-btn{min-width:clamp(2rem,9cqw,var(--wager-size));min-height:clamp(2rem,9cqw,var(--wager-size));width:clamp(2rem,9cqw,var(--wager-size));height:clamp(2rem,9cqw,var(--wager-size));font-size:1rem}
  /* Re-tuned for this rule's own 1rem, not inherited from the -.24em above — checked separately
     at this narrower size (screenshot, not box math; see that rule's own comment) rather than
     assumed to scale evenly from the wide-desktop value, since it doesn't. */
  /* Rivals place tiles keep their own size (the clamp above would squash them to a 2rem square). */
  .place-btn{width:clamp(3rem,15cqw,3.6rem);min-width:0;height:calc(var(--wager-size) * 1.1);min-height:0;font-size:max(12px,.95rem)}
  .result-btn>.icon-emoji{margin-top:-.13em}
  .bonus-choice-btn{width:clamp(1.7rem,7.5cqw,2.2rem);height:clamp(1.7rem,7.5cqw,2.2rem);font-size:max(12px,.92rem)}

  /* score pill — width (not min-width), same reasoning as the base rule: a floor sized to the
     real scored values let the "—" placeholder render wider than them, shifting the buttons
     before it. Bumped up from clamp(2.6rem,13cqw,3.4rem) to comfortably fit the dash too. */
  .ta-pts,.bonus-pts{width:clamp(2.9rem,14cqw,3.7rem);font-size:1rem;padding:4px 6px}

  /* bonus steppers (sw-val / sw-input) */
  .sw-val{width:clamp(2rem,9cqw,2.6rem);min-width:0}
  .stepper input.sw-input{width:clamp(2rem,9cqw,2.6rem);min-width:0}
  .stepper button{width:clamp(1.6rem,7cqw,1.9rem);height:clamp(1.6rem,7cqw,1.9rem)}
  .stepper-val{width:clamp(1.8rem,8cqw,2.2rem);min-width:0}

  /* R2/R4 wager dropdown */
  .sw-select{width:clamp(3.4rem,15cqw,4.4rem);min-width:0;font-size:clamp(max(12px,.82rem),3.6cqw,1rem)}

  /* team-setup grid */
  /* v21.35: Date + Quiz ID share one row (both are short fields); everything else stays full width. */
  /* Equal, shrinkable columns: iOS date inputs report a wide intrinsic min-width, which with a max-content column made the Date box spill over Quiz ID on a real iPhone. */
  .meta-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .meta-grid>.field{grid-column:1/-1;min-width:0}
  .meta-grid>.field:has(>.date-native-wrap),.meta-grid>.field:has(>.quiz-id-input){grid-column:auto}
  .meta-grid .quiz-id-input{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
  /* v21.37: iOS Safari's date input (inline-flex, UA min-width, native chrome) ignored width:100% and still overlapped Quiz ID. The wrapper is sized only by its grid column and the input is absolutely filled into it, so the input's intrinsic width can't leak into layout; appearance:none drops Safari's own sizing. */
  .meta-grid .date-native-wrap{display:block;position:relative;width:100%;max-width:100%;min-width:0;min-height:44px}
  .meta-grid .date-native{position:absolute;inset:0;width:100%;height:100%;min-width:0;max-width:100%;box-sizing:border-box;-webkit-appearance:none;appearance:none}
  .team-entry{grid-template-columns:1fr 4.3rem auto;gap:5px}
  .team-entry.has-adj{grid-template-columns:1fr 4.3rem auto auto}
  .check-label{font-size:max(12px,.72rem);padding:5px 8px;gap:5px}
  .check-box{width:20px;height:20px}

  /* Q1-4 / Q5 Bonus / Q5 Wager headers: title + badge + two Sort/Reset buttons don't fit on
     one line at phone widths — the desktop-sized 1rem "Done"/"Beer Round!" badge alone was
     squeezing the title down to a handful of px. Wrap the button cluster onto its own row
     so it gets the full row width instead of fighting the title for space. The button cluster
     wrapping to its own row already frees up enough width that nothing here needs to shrink
     below the badge's own size — one shared .8rem (not three separate step-downs) keeps the
     badge and the Sort/Reset buttons reading as one control cluster at every FONT_SIZES step,
     down to the 12px floor. */
  /* One row: label + badge on the left, the icon-only Sort button on the right (the header pins while
     scrolling, so it has to stay short). */
  .q-header,.sw-header{flex-wrap:nowrap}
  .q-header-right{flex-basis:auto;flex-wrap:nowrap;column-gap:10px;justify-content:flex-end;margin-left:auto}
  .q-header-left,.sw-header-left{min-width:0}
  /* v21.38: A-Z/Z-A pictograph 2.7em (was 1.7em) so it reads clearly in the Teams header's ~41px button. */
  .q-alpha-btn .icon-ui{width:2.7em;height:2.7em}
  .q-badge,.round-badge{font-size:max(12px,.8rem)}
  /* The Sort button drops its text label and shrinks to an icon-only square here, leaving the width
     to the badge. Its aria-label and title keep it accessible with the label hidden. */
  .btn-label{display:none}
  /* Icon is the button's whole visible content now that its label is hidden, so it gets its
     own larger font-size (not the .78rem sized for the old icon+text pairing) to actually
     read at a glance instead of looking lost in the middle of a same-sized tap target. */
  /* This size only scales the A-Z picture (the label is hidden here), so it has no 12px floor. */
  .q-alpha-btn{width:auto;min-width:clamp(2.3rem,9.5cqw,2.7rem);height:clamp(2.3rem,9.5cqw,2.7rem);padding:0 6px;font-size:.7rem}
  .q-sort-btn{font-size:1.1rem;line-height:1;padding:0;width:clamp(2.3rem,9.5cqw,2.7rem);height:clamp(2.3rem,9.5cqw,2.7rem);display:inline-flex;align-items:center;justify-content:center}
}

@media(max-width:480px){
  /* ── standings rows (sidebar) ── */
  .standings-name{min-width:0}
  .standings-pts{min-width:clamp(2rem,9vw,2.5rem)}

  /* ── team report modal rows (body-level overlay) ── */
  .aud-wager{width:4.2rem;font-size:max(12px,.72rem);min-width:0}
  .aud-res{font-size:max(12px,.74rem);min-width:0}
  /* A tighter gap, so "4 of 4 correct" at the 12px floor still fits a 320px phone. */
  .aud-line{gap:6px}
  .aud-q{min-width:0;width:2rem}
  .aud-p{min-width:clamp(2rem,8vw,2.8rem)}

  /* ── header toolbar ── */
  .toolbar{min-width:0;gap:4px}
  .toolbar>button,.btn{min-width:0}
  .logo{font-size:1.1rem;letter-spacing:1px}

  /* ── sort buttons (sidebar) ── */
  .sort-btn{font-size:max(12px,.74rem);padding:7px 2px}
}

/* Final results table */
.final-table{width:100%;border-collapse:collapse;font-size:max(12px,.86rem);margin-top:4px}
.final-table th,.final-table td{padding:7px 8px;border-bottom:1px solid var(--border);text-align:center}
.final-table thead th{color:var(--text-muted);font-weight:600;font-size:max(12px,.7rem);text-transform:uppercase;letter-spacing:.04em}
.final-table td.fr-name{text-align:left;color:var(--text-primary)}
.final-table td.fr-place{color:var(--text-secondary);font-weight:700;white-space:nowrap}
.final-table td.fr-score{font-family:var(--font-display);font-size:1.1rem;font-weight:700;color:var(--txt-cyan)}
/* Guess/Diff sit close together (tight inner padding) with a vertical rule between them,
   rather than being spread out to match the other columns' full padding. */
.final-table th.fr-guess-h,.final-table td.fr-guess{padding-right:4px}
.final-table th.fr-diff-h,.final-table td.fr-diff{padding-left:4px;border-left:1px solid var(--border)}
/* Monospace: every digit is the same width, so the Guess/Diff numbers (and the mobile G/D
   labels next to them) line up consistently instead of drifting with proportional-font kerning. */
.final-table td.fr-guess,.final-table td.fr-diff{color:var(--text-secondary);font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.final-table tbody tr:last-child td{border-bottom:none}
.final-table tbody tr:nth-child(even):not(.fr-tie):not(.fr-gold):not(.fr-silver):not(.fr-bronze){background:var(--row-stripe)}
.final-table tr.fr-tie{background:color-mix(in srgb,var(--accent-gold) 13%,transparent)}
.final-table tr.fr-tie td{border-bottom-color:var(--accent-gold)}
/* Light theme used to match the timer pause button's solid --accent-gold/--on-accent-gold fill
   exactly (full-strength gold, black-or-white text depending on cb mode) — legible, but next to
   the rest of this table it read as too bold/saturated for what's just a "these two scores
   matched" flag. color-mix() lightens the same --accent-gold token toward white instead (a pale
   wash, paler than the plain translucent yellow above reads as on a light card, which is why that
   one was avoided for light theme in the first place) — still tied to whatever --accent-gold
   currently resolves to (tritanopia's pink substitute included), no separate [data-cb] copy
   needed. Text drops the accompanying --on-accent-gold (tuned for a FULL-strength fill, where a
   dark magenta under tritanopia needs white) for plain --text-primary instead: every pale mix is
   light regardless of which hue it started from, so black already clears AA against all of them. */
[data-theme="light"] .final-table tr.fr-tie{background:color-mix(in srgb,var(--accent-gold) 40%,white);color:var(--text-primary)}
/* .fr-tiebadge flags a SCORE-only tie (place numbers themselves are always distinct now — see
   finalResultsRows()) so the host can still see at a glance where a tied score existed and how
   the guess tiebreak resolved it: the closer guess gets the green "win" variant, the rest of
   that tied group gets the plain gold "tie" badge. Sized up from the original .62rem/1px 7px so
   it reads clearly rather than disappearing next to the team name. */
/* border uses --bg-card (the base surface under every row background, tie/gold/silver/bronze
   wash included) rather than a fixed color, so the badge always gets a visible cutout ring no
   matter which row background it's sitting on — same "punch a border in the page's own base
   color" trick as .qtimer-btn.qtimer-pause above, for the same reason: a gold pill was
   disappearing into a same-hued background behind it (there, the warning pulse; here, a tied
   row's own yellow, and worse still on a #1-place row now that .fr-gold sits under it too). */
.fr-tiebadge{display:inline-block;font-size:max(12px,.74rem);padding:2px 9px;border-radius:999px;background:var(--badge-gold-fg);color:var(--on-badge);border:2px solid var(--bg-card);margin-left:6px;vertical-align:middle;font-weight:700}
/* Same pause-button match as the row background above, applied to the plain "tie" chip too.
   Declared BEFORE .fr-win below (same specificity, so source order decides) — the "closer"
   .fr-win variant must still win and stay green, a different signal from "the current yellow". */
[data-theme="light"] .fr-tiebadge{background:var(--accent-gold);color:var(--on-accent-gold)}
.fr-tiebadge.fr-win{background:var(--badge-green-fg)}
/* Light theme's --badge-green-fg (#0a500a) is a dark green tuned for use as TEXT on light
   surfaces elsewhere (aud-correct, mp-label, etc.) — as a solid pill background behind the
   black text the light rule above already applies to every .fr-tiebadge, it only clears
   ~2.2:1, well under the 4.5:1 AA floor for normal text. Reuses the same green/white pairing
   already vetted for positive point deltas (--pts-pos-bg/--pts-pos-fg, colorblind-aware via its
   own [data-cb] overrides) instead of inventing a new color. */
[data-theme="light"] .fr-tiebadge.fr-win{background:var(--pts-pos-bg);color:var(--pts-pos-fg)}
.fr-diff-win{color:var(--badge-green-fg)!important;font-weight:800!important}
.fr-note{font-size:max(12px,.72rem);color:var(--text-muted);margin-top:9px;line-height:1.45}
/* Event Details' "Locked once scoring starts" note (see metaLocked in app.js) is now always
   rendered, not conditionally included — same fix, same reasoning, as .mini-progress.mp-pending
   above: omitting it outright until the first score landed meant Teams/Round 1/everything below
   Event Details jumped down the moment it popped in. visibility:hidden reserves its real height
   the whole time and drops it from tab order/hit-testing on its own while pending. */
.fr-note.fr-note-pending{visibility:hidden}
/* Links inside a note (e.g. Event Details' "Unlock to fix it") had no color rule of their own,
   so they fell back to the browser default blue/purple — on dark's near-black background
   that read as low-contrast, and visited-purple in particular clears nowhere near AA. --txt-cyan
   is the same AAA(7:1) text-safe token already used for clickable text elsewhere (e.g.
   .ta-name-clickable), defined for every theme/color-vision combination, so this link is
   guaranteed AA in all of them without a color pick of its own. */
.fr-note a{color:var(--txt-cyan);text-decoration:underline}
.fr-note a:hover{filter:brightness(.85)}
/* Collapsed by default so the tie-break/Diff explanation doesn't eat vertical space every time
   Final Results is open — <details>/<summary> gets keyboard support and toggling for free. */
.fr-details{margin-top:9px}
.fr-details summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;font-size:max(12px,.72rem);font-weight:700;color:var(--text-muted);padding:4px 8px;border:1px solid var(--border);border-radius:var(--radius);transition:var(--transition)}
.fr-details summary::-webkit-details-marker{display:none}
.fr-details summary:hover{background:var(--bg-hover);color:var(--text-primary)}
.fr-details[open] summary{margin-bottom:6px}
.fr-details .fr-note:first-of-type{margin-top:0}

/* ── Final results podium medals (1st/2nd/3rd) ──
   The 4px accent bar is baked into the row background gradient so it renders
   identically whether the row is a table-row (desktop) or a grid card (mobile). */
.final-table tr.fr-gold,
.final-table tr.fr-silver,
.final-table tr.fr-bronze{position:relative}
/* default / dark theme (white text) */
.final-table tr.fr-gold  {background:linear-gradient(90deg,#ffd43b 0 4px,rgba(255,215,0,.22) 4px,rgba(255,215,0,.10) 100%)}
.final-table tr.fr-silver{background:linear-gradient(90deg,#cdd0dc 0 4px,rgba(200,202,215,.20) 4px,rgba(200,202,215,.09) 100%)}
.final-table tr.fr-bronze{background:linear-gradient(90deg,#e0904c 0 4px,rgba(210,130,55,.24) 4px,rgba(210,130,55,.11) 100%)}
.final-table tr.fr-gold   .fr-place{color:#ffe066}
.final-table tr.fr-silver .fr-place{color:#e3e6f0}
.final-table tr.fr-bronze .fr-place{color:#f0a868}
/* explicit high-contrast dark: brighter tints + borders */
[data-theme="dark"] .final-table tr.fr-gold  {background:linear-gradient(90deg,#ffe000 0 4px,rgba(255,224,0,.28) 4px,rgba(255,224,0,.13) 100%)}
[data-theme="dark"] .final-table tr.fr-silver{background:linear-gradient(90deg,#dde0ec 0 4px,rgba(215,218,232,.26) 4px,rgba(215,218,232,.12) 100%)}
[data-theme="dark"] .final-table tr.fr-bronze{background:linear-gradient(90deg,#f0a050 0 4px,rgba(232,140,60,.28) 4px,rgba(232,140,60,.13) 100%)}
[data-theme="dark"] .final-table tr.fr-gold   .fr-place{color:#ffe840}
[data-theme="dark"] .final-table tr.fr-silver .fr-place{color:#f0f2fa}
[data-theme="dark"] .final-table tr.fr-bronze .fr-place{color:#ffb76d}
/* light theme (dark text): heavier tints so the medal reads, text stays legible */
[data-theme="light"] .final-table tr.fr-gold  {background:linear-gradient(90deg,#c8900a 0 4px,rgba(255,205,0,.42) 4px,rgba(255,216,80,.26) 100%)}
[data-theme="light"] .final-table tr.fr-silver{background:linear-gradient(90deg,#6f6f80 0 4px,rgba(150,150,165,.44) 4px,rgba(178,178,192,.28) 100%)}
[data-theme="light"] .final-table tr.fr-bronze{background:linear-gradient(90deg,#9c5a20 0 4px,rgba(200,115,40,.40) 4px,rgba(212,134,62,.26) 100%)}
[data-theme="light"] .final-table tr.fr-gold   .fr-place{color:#664800}
[data-theme="light"] .final-table tr.fr-silver .fr-place{color:#3d3d4b}
[data-theme="light"] .final-table tr.fr-bronze .fr-place{color:#5c3010}
/* keep the score/diff text high-contrast on the medal rows in every theme */
.final-table tr.fr-gold .fr-score,.final-table tr.fr-silver .fr-score,.final-table tr.fr-bronze .fr-score{color:var(--text-primary)}
/* Dark theme only: match the score number's color on medal rows back to the same aqua
   --txt-cyan every other row's .fr-score already uses, instead of the --text-primary override
   above. The dark-theme medal washes are translucent over this app's near-black --bg-card (see
   the gradients above — even their most opaque end is well under full alpha), so cyan still
   reads at high contrast here same as it does anywhere else in this app on that background;
   light theme's much more opaque, heavier-tinted washes are the case that override was actually
   protecting, so that one still keeps --text-primary. */
[data-theme="dark"] .final-table tr.fr-gold .fr-score,[data-theme="dark"] .final-table tr.fr-silver .fr-score,[data-theme="dark"] .final-table tr.fr-bronze .fr-score{color:var(--txt-cyan)}

/* ── Final results mobile layout: stack overflow cells onto a second row ──
   Uses the scorecol container query so it follows the score column's real
   width (full-width on phones, wide on desktop) rather than the viewport.
   Threshold deliberately much narrower than the 600px used elsewhere in this file (e.g. the
   team-answer/bonus-row breakpoint above): Score/Guess/Diff stay as normal single-row table
   columns across ordinary phone widths, only dropping to the stacked 2-row layout once the
   column genuinely can't fit them anymore. */
@container scorecol (max-width:340px){
  /* Headers stay visible, laid out with the same 3-column + wrapped-4th-row grid as the
     tbody rows below, so "Place/Team/Score" sit over their own stacked columns. Guess/Diff
     get no header of their own — each value now labels itself inline (see fr-guess/fr-diff
     ::before below), so a header for them would just repeat what's already on the number. */
  .final-table thead{display:block}
  .final-table thead tr{display:grid;grid-template-columns:2.75rem minmax(0,1fr) 3.2rem;column-gap:10px;padding:6px 11px;border-bottom:1px solid var(--border)}
  .final-table thead th{padding:0;border-bottom:none}
  .final-table thead th:nth-child(1){grid-column:1;grid-row:1;text-align:left}
  .final-table thead th:nth-child(2){grid-column:2;grid-row:1;text-align:left}
  .final-table thead th:nth-child(3){grid-column:3;grid-row:1;text-align:right}
  .final-table thead th:nth-child(4),.final-table thead th:nth-child(5){display:none}
  .final-table,.final-table tbody{display:block;width:100%}
  .final-table tr{
    display:grid;
    /* place gets a fixed track (not auto) — each <tr> is its own independent grid, so an
       "auto" column sizes to that ONE row's own content, and "1st" vs "10th" end up with
       different column widths and misaligned team names. A fixed width is shared by every
       row's grid uniformly, so the team-name column always starts at the same x position. */
    grid-template-columns:2.75rem minmax(0,1fr) 3.2rem;
    column-gap:10px;row-gap:3px;
    align-items:center;
    padding:9px 11px;
    border-bottom:1px solid var(--border);
  }
  .final-table tbody tr:last-child{border-bottom:none}
  .final-table td{display:block;border-bottom:none;padding:0;text-align:left}
  /* row 1: place · team · score. Row 2: Guess/Diff as a close-together pair with a divider,
     each one prefixed with its own mini-label (via ::before) so the number reads on its own
     without needing to look back up at a header. */
  .final-table td.fr-place{grid-column:1;grid-row:1;font-size:1rem}
  .final-table td.fr-name {grid-column:2;grid-row:1;font-size:max(12px,.95rem);white-space:normal;overflow-wrap:break-word;line-height:1.25}
  .final-table td.fr-score{grid-column:3;grid-row:1;text-align:right;font-size:1.1rem}
  /* Negative margin pulls Guess in against the grid's column-gap (which row 1's Team/Score
     still needs) so the G/D pair reads as one close-together unit instead of two numbers
     spaced as far apart as Team and Score are. The divider lives on the ::before itself
     (not the td's own border) so it sits right next to "D", not at the fixed column's left
     edge — a border on the td would leave a gap that grows or shrinks with the diff value's
     own digit count, since the td is wider than short values like "+4" need. */
  .final-table td.fr-guess{grid-column:2/3;grid-row:2;text-align:right;white-space:nowrap;font-size:max(12px,.78rem);color:var(--text-secondary);padding-right:4px;margin-right:-10px}
  .final-table td.fr-diff{grid-column:3/4;grid-row:2;text-align:right;white-space:nowrap;font-size:max(12px,.78rem);color:var(--text-secondary)}
  .final-table td.fr-guess::before,.final-table td.fr-diff::before{color:var(--text-muted);font-weight:700}
  .final-table td.fr-guess::before{content:"G "}
  .final-table td.fr-diff::before{content:"D ";border-left:1px solid var(--border);padding-left:4px;margin-left:2px}
  /* tie badge: let it wrap under the name instead of pushing width */
  .final-table td.fr-name .fr-tiebadge{margin-left:0;margin-top:3px}
}

/* ── HOST BANTER ─────────────────────────────────────────────────
   Fixed-height text area reserves room for 2-3 lines so refreshing a
   line never shifts surrounding layout; the refresh button is flex-
   shrink:0 with a fixed touch-size so it stays put as text changes. */
.banter{display:flex;align-items:flex-start;gap:8px;background:var(--bg-card-alt);border:1px solid var(--border);border-left:3px solid var(--accent-magenta);border-radius:var(--radius);padding:8px 10px;margin-bottom:8px}
.banter-main{flex:1;min-width:0}
.banter-text{font-size:max(12px,.9rem);line-height:1.35;color:var(--text-primary);min-height:3.6rem;display:flex;align-items:center}
.banter-sm .banter-text{min-height:2.45rem;font-size:max(12px,.85rem)}
.banter-refresh{flex-shrink:0;width:2.6rem;height:2.6rem;min-width:2.6rem;border:1px solid var(--border-control);border-radius:8px;background:var(--bg-input);color:var(--txt-cyan);font-size:1.2rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;touch-action:manipulation;transition:var(--transition)}
@media (hover:hover) and (pointer:fine){.banter-refresh:hover{background:var(--bg-hover);border-color:var(--accent-cyan)}}
.banter-refresh:active{transform:scale(.94)}
.banter-refresh .icon-ui{width:1.15em;height:1.15em}
.banter-refresh .icon-emoji{transform:scale(1.15)}
.banter-group{margin-bottom:6px}
.banter-group:last-child{margin-bottom:0}

/* thank-the-staff prompt, sits under the halftime wager — orange rule instead of the banter
   magenta so it reads as a to-do rather than another line to riff on */
.staff-thanks{margin:10px 0 8px}
.staff-thanks .banter{border-left-color:var(--accent-orange);margin-bottom:6px}
/* .banter-text is a flex row (it vertically centres one short line); this line carries inline
   markup for the names, which flex would blow apart into separate columns — so lay it out as
   normal text instead. */
.staff-thanks .banter-text{display:block}
.staff-thanks-names{color:var(--txt-orange);font-weight:700}
.staff-thanks-missing{color:var(--text-muted)}
.staff-thanks-edit{display:block}
.banter-cat,.staff-thanks-edit-label{display:block;font-family:var(--font-display);font-size:max(12px,.6rem);font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--text-muted);margin-bottom:3px}

/* round header: wagers label forced onto its own row (h2 is flex-wrap) */
/* round header: forced line break, then wager label sized to its text (not full width) */
.round-break{flex-basis:100%;height:0}
.round-wager-label{font-size:max(12px,.82rem);padding:3px 10px;margin-top:5px}

/* session-info: restaurant staff free-text box */
.meta-textarea{width:100%;padding:7px 10px;background:var(--bg-input);border:1px solid var(--border-control);border-radius:var(--radius);color:var(--text-primary);font-family:var(--font-body);font-size:max(12px,.9rem);line-height:1.35;outline:none;resize:vertical;min-height:2.6rem;transition:var(--transition)}
.meta-textarea:focus{border-color:var(--accent-cyan);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-cyan) 13%,transparent)}

/* settings: version label + Claude disclaimer */
.settings-meta{display:flex;flex-direction:column;gap:2px;grid-column:1/-1;margin-top:4px}
.settings-version{font-family:var(--font-display);font-size:max(12px,.66rem);font-weight:600;color:var(--text-muted);letter-spacing:.5px}
.settings-disclaimer{font-size:max(12px,.62rem);line-height:1.3;color:var(--text-muted)}

.settings-about{font-size:max(12px,.66rem);color:var(--text-muted)}
.settings-about summary{cursor:pointer;font-weight:600;letter-spacing:.5px}
.settings-about .about-older{margin-top:2px}
.settings-about .about-older summary{font-weight:500;letter-spacing:0}
.settings-about summary{list-style:none;gap:5px}
.settings-about summary::-webkit-details-marker{display:none}
.settings-about summary::before{content:"\25B8";font-size:1.1em;line-height:1;display:inline-block;transition:transform .2s}
.settings-about details[open]>summary::before,.settings-about[open]>summary::before{transform:rotate(90deg)}
.settings-about ul{margin:2px 0 4px;padding-left:1.1rem}

/* WCAG 2.2 target size (2.5.8): every interactive target is at least 24x24 CSS px. The name links
   and collapse headers are text rows only ~16px tall; padding adds the missing height and the
   matching negative margin keeps the layout exactly where it was. */
.q-header-left,.standings-title-row,.cv-select-btn{min-height:24px}
.ta-name-clickable,.sr-name-clickable{padding-block:5px;margin-block:-5px}

/* TOUCH TARGETS (tablet + phone): on touch-first devices every control gets at least a 44x44 CSS px
   hit area (Apple HIG / WCAG 2.5.5 AAA; the 24px floor above still covers mouse layouts). The
   dropdowns, Settings buttons and text/number fields were 26-33px tall. Tiny glyph buttons that
   can't grow without breaking the dense score rows (.pause-team) keep their drawn size and extend
   the tappable area with an invisible ::after instead. */
@media (pointer:coarse),(max-width:1024px){
  .toolbar>button,button.qtimer-btn,.check-label,.fr-details summary,.fr-note a,
  .theme-select,.cv-select-btn,.settings-btn,.settings-advanced-toggle,.settings-x-btn,
  .settings-toggle-btn,.sort-btn,.btn,.qtimer-btn,.quiz-id-input,.date-native,.sw-select,
  input[type="text"],input[type="number"],input[type="date"],textarea{min-height:44px}
  .toolbar>button,.settings-btn,.settings-x-btn,.settings-toggle-btn,.sort-btn,button.qtimer-btn,.cv-select-btn,.fr-details summary{min-width:44px}
  .fr-details summary,.fr-note a{display:inline-flex;align-items:center}
  /* v21.21: the Settings close circle stays its drawn size (it was stretched to 44px and made the header tall); an invisible ::after keeps the 44px tap area. */
  .settings-x-btn{min-width:0;min-height:0;position:relative}
  .settings-x-btn::after{content:"";position:absolute;inset:-9px}
  .check-label{box-sizing:border-box}
  .qtimer-btn.qtimer-toggle,.qtimer-btn.qtimer-reset,.qtimer-mobile .qtimer-btn.qtimer-toggle,
  .qtimer-mobile .qtimer-btn.qtimer-reset,.qtimer-mobile .qtimer-btn.qtimer-step{width:44px;height:44px;min-height:44px}
  .qtimer-btn.qtimer-step{min-height:44px;min-width:44px}
  .settings-toggle-btn{min-height:44px;min-width:44px}
  .settings-toggle-btn .icon-ui{width:1.9em;height:1.9em}
  .settings-toggle-btn .icon-emoji{transform:scale(1.9)}
  .theme-select{font-size:max(12px,.85rem);padding-right:28px}
  .cv-select-btn{font-size:max(12px,.85rem)}
  .cv-select-menu li{min-height:44px;align-items:flex-start;justify-content:center}
  .mobile-scores-peek,.mini-progress,.settings-about summary,.sidebar-header,.section-header,.q-header{min-height:44px}
  .settings-about summary,.settings-footer a,a.footer-link{display:inline-flex;align-items:center;min-height:44px}
  .ta-name-clickable,.sr-name-clickable{padding-block:14px;margin-block:-14px}
  /* The scoring-row name sits right above (or beside) the wager buttons, so its invisible tap padding
     must not reach into them: a tap that lands a little high on a wager button was opening the Team
     Report. Rows keep the 24px WCAG 2.5.8 floor from the base rule; only the name-only lists keep 44px. */
  .ta-name.ta-name-clickable{padding-block:5px;margin-block:-5px}
  .pause-team,.remove-team button{position:relative}
  .pause-team::after,.remove-team button::after{content:"";position:absolute;inset:-12px}
}

/* TEAMS ROW, EVERY WIDTH: Delete on the left, Pause on the right, both centred on the row, so the two are as far
   apart as it allows. Every cell is placed by column because Delete comes last in the markup. */
.team-entry{grid-template-columns:auto minmax(0,1fr) 5.4rem auto;margin-inline:-14px;padding-inline:12px}
.team-entry.has-adj{grid-template-columns:auto minmax(0,1fr) 5.4rem auto auto}
.team-entry>*{grid-row:1}
.team-entry>.team-name-cell{grid-column:2}
.team-entry>.team-guess-cell{grid-column:3}
.team-entry>.adj-wrap{grid-column:4}
.team-entry>.remove-team:not(.remove-team-corner){grid-column:4;align-self:center}
.team-entry.has-adj>.remove-team:not(.remove-team-corner){grid-column:5}
.team-entry>.remove-team-corner{grid-column:1;align-self:center;justify-self:center}

/* PHONE TEAMS LIST. This sits after the touch-target block above so it wins over its 44px minimum. */
@media(max-width:768px){
  /* Quiet bonus chips: drawn 32px tall so they don't compete with the team name. The ::after keeps a 44px tap area. */
  .team-checks .check-label{min-height:32px;padding:0 4px;gap:4px;font-size:max(12px,min(.833rem,6.2cqw));font-weight:600}
  .team-checks .check-label::after{content:"";position:absolute;inset:-7px 0}
  .team-checks .check-box{width:15px;height:15px;border-radius:4px}
  .team-checks .check-input:checked+.check-box::after{left:4px;top:1px;width:4px;height:8px;border-width:0 2px 2px 0}
  .team-checks .lbl-full{display:inline}
  .team-checks .lbl-short{display:none}
  /* Narrower side padding and guess column make room for the Delete column. */
  .team-entry{grid-template-columns:28px minmax(0,1fr) 3.6rem auto;padding-inline:8px}
  .team-entry.has-adj{grid-template-columns:28px minmax(0,1fr) 3.6rem auto auto}
  .team-guess-cell input{padding-inline:2px}
  .team-checks{column-gap:6px}
  /* Delete stays 28px at most so it fits its column at large text sizes. */
  .team-entry .remove-team-corner button{width:min(1.8rem,28px);height:min(1.8rem,28px)}
  /* Tap areas reach toward the card edge and stop at the neighbouring field. */
  .team-entry .remove-team-corner button::after{inset:-9px -5px -9px -9px}
  .team-entry .remove-team .pause-team::after{inset:-11px -5px}
}

/* The phone chips' text stops shrinking at 12px, so their last two fallbacks are in px: "BON" where
   "Bonus" no longer fits beside CB, then tighter chips with smaller boxes. They never stack. */
@media(max-width:768px){
  @container (max-width:170px){
    .team-checks .lbl-full{display:none}
    .team-checks .lbl-short{display:inline}
  }
  @container (max-width:150px){
    .team-checks{column-gap:4px}
    .team-checks .check-label{gap:2px;padding:0 1px}
    .team-checks .check-box{width:13px;height:13px}
    .team-checks .check-input:checked+.check-box::after{left:3px;top:0}
  }
}

/* QUESTION SORT ROW: A-Z / Sort / Reset pin under .mini-progress while a question's team list
   scrolls. position:sticky needs every ancestor up to the scroll pane to be free of
   overflow:hidden, so .section/.question-block use overflow:clip (same rounded-corner clipping,
   no scroll container). --qbar-top: just under .mini-progress inside .col-left's own scroll pane
   on desktop; under the page .header as well on phones. */
:root{--qbar-top:var(--mini-progress-h,0px)}
.section,.question-block{overflow:clip}
@media(max-width:768px){:root{--qbar-top:calc(var(--header-h,64px) + var(--mini-progress-h,0px))}}
/* The question header itself pins (title, "N left" badge, bonus description and the A-Z / Sort /
   Reset buttons), so it scrolls up into the sticky spot rather than being duplicated. It already
   spans the card edge to edge, as wide as the team answer rows. */
.q-header{position:sticky;top:var(--qbar-top);z-index:50;border-bottom:1px solid var(--border-strong)}
/* Special wager cards pad 12px, so their header band reaches back out to the card's inner edge. */
.special-section .sw-header{position:sticky;top:var(--qbar-top);z-index:50;background:var(--bg-input);margin:-12px -12px 0;padding:8px 12px;border-radius:10px 10px 0 0;border-bottom:1px solid var(--border-strong)}
.special-section.sw-collapsed .sw-header{margin-bottom:-12px;border-radius:10px;border-bottom:0}

/* PAUSED TEAMS in the score tables.
   Dimming is --text-muted (AA-audited), not opacity. */
.standings-table tr.row-paused td,.final-table tbody tr.row-paused td,.row-paused td .ta-name-clickable{color:var(--text-muted)}
.row-paused .fr-score,.row-paused .standings-pts{font-weight:600}
.paused-pill{display:inline-flex;align-items:center;gap:4px;margin-left:6px;padding:1px 7px;border:1px solid var(--border-strong);border-radius:999px;font-size:max(12px,.68rem);font-weight:700;letter-spacing:.3px;text-transform:uppercase;color:var(--text-secondary);background:var(--bg-input);vertical-align:middle;white-space:nowrap}
.paused-pill .icon-ui{width:.8rem;height:.8rem}

/* PHONE SCORES SHEET: the slide-up ranking reaches up to just under the page header (was 75% of the
   screen) to show more rows, and its sort buttons fill their 44px+ height with bigger text/icons. */
@media(max-width:768px){
  /* 44px sort buttons: a full-size tap target. */
  .sort-controls{padding:4px 10px}
  .sort-btn{font-size:max(12px,.9rem);padding:4px 4px;min-height:44px}
  .sort-btn .icon-ui{width:1.2em;height:1.2em}
  .sort-btn .icon-emoji{transform:scale(1.2)}
  /* Scroll containment: the sheet's own scroller keeps the gesture (no chaining to the page), and
     while the sheet is open the page behind it is locked, so touches that start on the sheet's
     non-scrolling parts (grab handle, sort row, header, backdrop) can't scroll the page either. */
  .col-right{overscroll-behavior:contain}
  html.sheet-open,html.sheet-open body{overflow:hidden;overscroll-behavior:none}
  .sidebar-backdrop,.sort-controls,.sort-mode-label{touch-action:none}
  .qtimer-btn .icon-ui{width:1.5em;height:1.5em}
}

/* v21.17: play/pause and reset are always the same rectangle (3rem wide, at least 44px tall), docked or deployed, at every
   width and pointer type. Comes last so it beats the 44px square touch-target rules above. */
.qtimer-btn.qtimer-toggle,.qtimer-btn.qtimer-reset,
.qtimer-desktop .qtimer-btn.qtimer-toggle,.qtimer-desktop .qtimer-btn.qtimer-reset,
.qtimer-mobile .qtimer-btn.qtimer-toggle,.qtimer-mobile .qtimer-btn.qtimer-reset{width:3rem;min-width:3rem;height:max(44px,2.5rem);min-height:max(44px,2.5rem)}

/* Host tools (js/host-tools.js): shortcuts list + score progression chart modal */
.ht-modal{padding:14px 16px 16px}
.ht-modal-wide{max-width:46rem}
.ht-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.ht-head h2{font-size:1.05rem}
.ht-keys{width:100%;border-collapse:collapse;font-size:max(12px,.85rem)}
.ht-keys th,.ht-keys td{padding:6px 4px;text-align:left;border-bottom:1px solid var(--border-light)}
.ht-keys th{width:6.5rem;white-space:nowrap}
.ht-keys kbd{font-family:var(--font-body);font-weight:700;font-size:max(12px,.78rem);padding:2px 7px;border:1px solid var(--border-control);border-radius:4px;background:var(--bg-input);color:var(--text-primary)}
.ht-canvas{display:block;width:100%;height:auto;border-radius:var(--radius);border:1px solid var(--border-light)}
.ht-presets{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:12px 0 8px}
.ht-sub{font-size:max(12px,.78rem);font-weight:700;color:var(--text-secondary);margin-right:4px}
.ht-chips{display:flex;flex-wrap:wrap;gap:6px;max-height:9.5rem;overflow-y:auto}
.ht-chip{display:inline-flex;align-items:center;gap:6px;font-size:max(12px,.78rem);padding:4px 9px;border:1px solid var(--border-control);border-radius:999px;background:var(--bg-card-alt);color:var(--text-primary);cursor:pointer}
.ht-chip.on{background:var(--bg-hover)}
.ht-chip input{accent-color:currentColor}
.ht-dot{width:10px;height:10px;border-radius:50%;flex:none}
.ht-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.ht-actions [hidden]{display:none}
.ht-backups{list-style:none;margin:8px 0 0;padding:0}
.ht-backups li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--border-light)}
.ht-b-info{display:flex;flex-direction:column;gap:2px;font-size:max(12px,.82rem)}
.ht-b-info span{color:var(--text-secondary);font-size:max(12px,.75rem)}

/* v21.35: iOS Safari auto-zooms the page when a focused field's font-size is under 16px (inputs were
   13.5-14.4px on phones/tablets), leaving the layout shifted and zoomed after typing. Keep the look
   the same everywhere except touch devices, where fields use 16px. */
@media (pointer:coarse),(max-width:1024px){
  input[type="text"],input[type="number"],input[type="date"],input[type="search"],input:not([type]),
  textarea,select,.date-native,.quiz-id-input,.meta-textarea{font-size:max(16px,1em)}
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  /* The mobile .theme-select rule (.85rem) is a class selector and out-ranks the element selectors above. */
  .theme-select{font-size:16px}
  /* Text floor: labels, table headers and footer notes were 9-10.8px; nothing readable drops under 11.5px. */
  label,.team-number,thead th,.team-guess-cell>label,.round-label,.cp-field-label,.cp-script-label,
  .export-sq-label,.fr-guess-h,.fr-diff-h,.lbl-short,summary,.size-label,.settings-version,
  .settings-about .about-ver,.aud-rank-of,.aud-meta,.aud-wager,.aud-stat-pct,.fr-note{font-size:max(12px,.72rem)}
  .check-label,.standings-table thead th,.final-table thead th,.settings-about,.settings-about summary,
  .fr-details summary,.cv-select-arrow,.aud-dot,.aud-eyebrow,.aud-res,.fr-tiebadge,.aud-stat-pct,.aud-dot+*{font-size:max(12px,.72rem)}
  /* Team report close/edit buttons keep their drawn size; an invisible ::after extends the tap area to 44px. */
  .audit-close,.aud-edit-btn{position:relative}
  .audit-close::after,.aud-edit-btn::after{content:"";position:absolute;inset:-7px}
}

/* v22.22: iPad landscape (touch, wider than the phone layout) kept the compact 1.5rem desktop per-question
   buttons, which were too short and small to tap. Give them the same tap-sized height and larger icon as phones. */
@media (pointer:coarse) and (min-width:769px){
  .q-sort-btn,.q-alpha-btn{height:2.5rem;font-size:max(12px,.9rem)}
  .q-sort-btn{min-width:2.5rem;padding:0 12px}
  .q-alpha-btn{min-width:2.5rem;padding:0 10px}
  .q-sort-btn .icon-ui,.q-alpha-btn .icon-ui{width:1.4em;height:1.4em}
  .q-sort-btn .icon-emoji{transform:scale(1.4)}
}

/* v21.42: group headings inside Advanced Settings. */
.settings-group-label{margin:14px 0 2px;padding-top:12px;border-top:1px solid var(--border-light);font-family:var(--font-display);font-size:max(12px,.7rem);font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted)}
.settings-group-label:first-child{margin-top:4px;padding-top:0;border-top:0}

/* Light theme icon legibility (v22.7). Pause, Reset and the close X were all drawn as thin or faded
   outlines that washed out on the pale-blue/white surfaces. Pause: deep-amber 2px outline instead
   of the 1.8:1 gold hairline. Reset: the idle (disabled) button no longer drops to 40% opacity;
   it is a solid slate-on-pale chip instead. Close X: 2px red ring on white with a heavier X. */
[data-theme="light"] .settings-x-btn,[data-theme="light"] .resume-banner-close,[data-theme="light"] .audit-close,[data-theme="light"] .remove-team button{border-width:2px;background:#fff;color:#8a0000}
[data-theme="light"] .settings-x-btn:hover,[data-theme="light"] .resume-banner-close:hover,[data-theme="light"] .audit-close:hover,[data-theme="light"] .remove-team button:hover{background:#ffd9d9}
[data-theme="light"] .settings-x-btn svg line,[data-theme="light"] .resume-banner-close svg line,[data-theme="light"] .audit-close svg line,[data-theme="light"] .remove-team button svg line{stroke-width:3.8}
[data-theme="light"] .remove-team .pause-team{border-color:#9a6200;color:#7a4b00;background:#fff}
[data-theme="light"] .remove-team .pause-team:hover{background:#fff3d6}
[data-theme="light"] .remove-team .pause-team.is-on,[data-theme="light"] .remove-team .pause-team.is-on:hover{border-color:#7a4b00;background:var(--accent-gold);color:#000}
[data-theme="light"] .remove-team .pause-team svg line{stroke-width:3.4}
[data-theme="light"] .qtimer-btn.qtimer-reset:disabled{opacity:1;background:#eef2f9;border:2px solid #7d90ad;color:#5d6f8b}
[data-theme="light"] .qtimer-btn.qtimer-reset .icon-ui-reset{stroke-width:3.2}

/* ---- v22.48 additions ---------------------------------------------------------------- */
/* Scoring-order guard: a question whose predecessor has no response yet is dimmed (the buttons
   stay tappable so a tap can explain itself with a toast; see questionLocked() in scoring.js). */
.question-block.q-locked .team-answer,.question-block.q-locked .bonus-choice,.special-section.q-locked .special-wager-row>:not(.ta-name){opacity:.5}
.question-block.q-locked .bonus-title span,.special-section.q-locked .sw-title span:not(.q-badge){color:var(--text-secondary)}
.special-section.q-locked h3{color:var(--text-secondary)}
.q-badge.q-locked-badge{background:transparent;color:var(--text-muted)}
.app-toast{position:fixed;left:50%;bottom:calc(16px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(12px);width:max-content;max-width:min(92vw,28rem);padding:10px 16px 14px;border-radius:var(--radius);background:var(--bg-card-alt);color:var(--text-primary);border:2px solid var(--accent-gold);box-shadow:var(--shadow-lg);font-size:max(12px,.9rem);font-weight:600;text-align:center;white-space:pre-line;overflow:hidden;opacity:0;pointer-events:none;z-index:900;transition:opacity .2s,transform .2s}
.app-toast-bar{position:absolute;left:0;bottom:0;height:5px;width:100%;background:var(--accent-gold);transform-origin:left center;transform:scaleX(0)}
.app-toast-bar.run{animation:toastShrink var(--toast-ms,5000ms) linear forwards}
@keyframes toastShrink{from{transform:scaleX(1)}to{transform:scaleX(0)}}
.app-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* Finish game checklist (Game Submission) */
.finish-card{margin-top:10px;padding:10px 12px;background:var(--bg-card-alt);border:1px solid var(--border-strong);border-radius:var(--radius)}
.finish-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px;font-size:max(12px,.9rem)}
.finish-count{color:var(--text-muted);font-size:max(12px,.8rem)}
.finish-list{list-style:none;margin:0;padding:0}
.finish-item{display:flex;align-items:flex-start;gap:10px;padding:8px 0}
.finish-item+.finish-item{border-top:1px solid var(--border)}
.finish-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.finish-warn{margin:0;font-size:max(12px,.78rem);color:var(--accent-gold)}
.finish-box{flex:none;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border:2px solid var(--border-control);border-radius:50%;font-weight:700;line-height:1}
.finish-text{flex:1;min-width:0;font-size:max(12px,.9rem);font-weight:600}
.finish-hint{display:block;font-size:max(12px,.75rem);font-weight:400;color:var(--text-muted)}
.finish-body .winner-copy{margin:0;max-width:22rem;width:100%}
.finish-rect{border:2px solid var(--accent-gold);box-sizing:border-box;overflow:hidden;height:auto;white-space:normal;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:14px;width:100%;max-width:22rem;min-height:4.6rem;padding:8px 16px;text-align:left;text-decoration:none;font-size:3.4rem;line-height:1}
.finish-rect .icon-ui,.finish-rect .icon-emoji{flex:none;font-size:3.4rem;width:1em;height:1em;line-height:1}
.finish-rect .icon-fawkes{width:1.35em;height:1.35em}
.finish-rect .icon-save{--icon-tint:var(--tint-flask)}
.finish-rect-label .lb-line{display:block}
.finish-body .wc-label.wc-num{font-size:max(12px,.95rem)}
[data-theme="light"] .finish-body .wc-label{color:var(--tint-theme-2)}
.finish-rect-text{flex:1 1 0;display:flex;flex-direction:column;gap:2px;min-width:0;font-family:var(--font-body)}
.finish-rect-label{font-size:1rem;font-weight:800;line-height:1.15;white-space:normal;overflow-wrap:anywhere}
.finish-rect-sub{font-size:max(12px,.78rem);font-weight:600;line-height:1.2;white-space:normal}
.finish-body .wc-btn{height:auto;min-height:44px;white-space:normal;overflow:visible;flex-wrap:wrap;min-width:0}
.finish-body .wc-label{flex:none;width:4rem;min-width:0;text-align:center;line-height:1.1}
.finish-body .wc-name{min-width:0;overflow-wrap:anywhere;word-break:normal;text-align:left}

.btn.flash-copied,.btn.flash-copied:hover{background:var(--correct-badge-bg);color:var(--correct-badge-fg);border-color:var(--correct-badge-bg);animation:flashPop .32s ease-out}
.btn.flash-copied.flash-out{animation:flashOut .26s ease-in forwards}
@keyframes flashPop{0%{transform:scale(.94)}55%{transform:scale(1.04)}100%{transform:scale(1)}}
@keyframes flashOut{to{opacity:0;transform:scale(.96)}}
.btn.flash-in{animation:flashIn .22s ease-out}
@keyframes flashIn{from{opacity:0}to{opacity:1}}

/* Reduced motion: honor the OS setting for every animation and transition. Short and simple
   beats surgical here; essential state changes still happen, they just don't move. */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
  .app-toast-bar.run{animation-duration:var(--toast-ms,5000ms)!important}
}

/* More contrast (OS setting): firmer borders, full-strength secondary text. */
@media(prefers-contrast:more){
  :root{--border-control:currentcolor}
  .wager-btn,.btn,.settings-btn,.finish-box,.q-badge{border-width:2px;border-style:solid}
  .finish-hint,.finish-count,.q-badge.q-locked-badge{color:var(--text-primary)}
  .question-block.q-locked .team-answer,.question-block.q-locked .bonus-choice,.special-section.q-locked .special-wager-row>:not(.ta-name){opacity:.75}
}

/* Windows High Contrast / forced colors: let the system palette win, but keep states that rely
   on a fill (selected wager, done tick, focus) visible through borders and system colors. */
@media(forced-colors:active){
  .wager-btn,.btn,.settings-btn,.q-badge,.finish-box,.export-sq{border:2px solid ButtonText}
  .wager-btn.correct,.wager-btn.selected,.finish-item.done .finish-box{border-color:Highlight;background:Highlight;color:HighlightText;forced-color-adjust:none}
  .wager-btn.incorrect{border-style:dashed}
  .app-toast{border-color:CanvasText}
  :focus-visible{outline:3px solid Highlight;outline-offset:2px}
}
/* Developer Tools (hidden Advanced Settings group): one wrapped row of fixture buttons per game mode */
.dev-fixture-mode{padding:6px 0}
.dev-fixture-btns{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
#devToolsGroup[hidden]{display:none}

/* Wide score column (v22.92): the per-question and Teams-header sort buttons become labelled rounded buttons.
   At 24px tall and .7rem they were hard to hit with a mouse. 40px tall, 14px text, icon plus word
   (Unanswered / A-Z / No guess). The narrow-column rule above (max-width:600px) hides .btn-label
   and keeps the compact icon squares, so phones are unchanged. */
@container scorecol (min-width:601px){
  .q-sort-btn,.q-alpha-btn{height:40px;font-size:max(12px,.9rem);gap:.5em;padding:0 16px;border-radius:9px}
  .q-alpha-btn.team-guess-btn{width:auto;padding:0 16px;border-radius:9px}
  .q-sort-btn .icon-ui,.q-alpha-btn .icon-ui{width:1.3em;height:1.3em}
  .q-sort-btn .icon-emoji{transform:scale(1.3)}
  .team-sort-row{gap:8px}
}

/* Mouse hover and press feedback (v22.93). Before this, most hovers were a background shift of
   about 8 levels (#1c1c1c -> #242424 in dark, #dfe9f8 -> #d2e1f6 in light) that a mouse user
   could not see, and a handful of clickable things had no hover at all. Hover now also changes
   the border to the accent colour and adds a 1px ring, and the fill moves further. Gated on a
   real hovering pointer so a tap on a phone does not leave a stuck hover state; :active press
   feedback applies everywhere. Placed last so it wins over the earlier per-control :hover rules. */
:root,[data-theme="dark"]{--hover-fill:#333;--hover-ring:var(--accent-cyan-solid)}
[data-theme="light"]{--hover-fill:#c2d6f1;--hover-ring:var(--accent-cyan-solid)}
@media (hover:hover) and (pointer:fine){
  /* Ring + accent border on every button-like control (not disabled or already-used wagers). */
  :is(.toolbar>button,.btn,.settings-btn,.settings-toggle-btn,.settings-advanced-toggle,.sort-btn,.standings-sort-btn,.adj-chip,.qtimer-btn,.cv-select-btn,.theme-select,.banter-refresh,.stepper button,.adj-stepper button,.sw-select,.result-btn,.wager-btn,.bonus-choice-btn,.bonus-zero,.bonus-clear,.q-sort-btn,.q-alpha-btn,.export-sq,.cp-sq-btn,.cp-wide-btn,.cp-draw-btn,.cp-manual-end-btn,.cp-horn-btn,.cp-clear-btn,.finish-rect,.wc-btn,.aud-edit-btn,.tutorial-callout-next,.tutorial-callout-back):hover:not(:disabled):not(.used){
    border-color:var(--hover-ring);box-shadow:0 0 0 1px var(--hover-ring)}
  /* Stronger fill on the neutral ones. Solid-fill states (active/selected/correct...) and the
     coloured controls keep their own fill and show the ring only. */
  :is(.toolbar>button,.btn:not(.btn-accent):not(.btn-danger),.settings-btn,.settings-toggle-btn,.settings-advanced-toggle,.sort-btn,.standings-sort-btn,.adj-chip,.qtimer-btn,.cv-select-btn,.theme-select,.banter-refresh,.stepper button,.adj-stepper button,.sw-select,.result-btn,.wager-btn,.bonus-choice-btn,.export-sq,.cp-sq-btn,.cp-wide-btn,.cp-draw-btn,.cp-manual-end-btn,.cp-horn-btn,.cp-clear-btn,.finish-rect,.wc-btn,.aud-edit-btn):hover:not(:disabled):not(.used):not(.active):not(.selected):not(.correct):not(.incorrect):not(.correct-sel):not(.incorrect-sel):not(.qtimer-pause):not(.qtimer-reset-active){
    background-color:var(--hover-fill)}
  /* Previously hover-less clickables. */
  .check-label:hover{border-color:var(--hover-ring);box-shadow:0 0 0 1px var(--hover-ring)}
  .check-label:not(.is-checked):hover{background:var(--hover-fill)}
  .ht-chip:hover{border-color:var(--hover-ring);box-shadow:0 0 0 1px var(--hover-ring);background:var(--hover-fill)}
  .mobile-scores-peek:hover,.standings-title-row:hover{background:var(--bg-hover)}
  .standings-title-row:hover .standings-title{color:var(--txt-cyan);text-decoration:underline}
  .settings-about summary:hover{color:var(--txt-cyan);text-decoration:underline}
  .update-help-link:hover,.tutorial-callout-skip:hover{text-decoration-thickness:2px}
  .section-header:hover,.sidebar-header:hover,.mini-progress:hover{background:var(--hover-fill)}
  .q-header-left:hover,.sw-header-left:hover{opacity:1}
  .q-header:has(.q-header-left:hover),.q-header:has(.sw-header-left:hover){background:var(--hover-fill)}
}
/* Pressed: sink 1px and darken, on every button-like control. */
:is(.toolbar>button,.btn,.settings-btn,.settings-toggle-btn,.settings-advanced-toggle,.sort-btn,.standings-sort-btn,.adj-chip,.qtimer-btn,.cv-select-btn,.banter-refresh,.stepper button,.adj-stepper button,.result-btn,.wager-btn,.bonus-choice-btn,.bonus-zero,.bonus-clear,.q-sort-btn,.q-alpha-btn,.export-sq,.cp-sq-btn,.cp-wide-btn,.cp-draw-btn,.cp-manual-end-btn,.cp-horn-btn,.cp-clear-btn,.finish-rect,.wc-btn,.aud-edit-btn,.settings-x-btn,.audit-close,.resume-banner-close,.remove-team button,.tutorial-callout-next,.tutorial-callout-back):active:not(:disabled):not(.used){
  transform:translateY(1px);filter:brightness(.88);box-shadow:none}

/* v22.94: follow-up to the hover block above. */
@media (hover:hover) and (pointer:fine){
  /* Big tile buttons lift a little on hover; :active below presses them back down. */
  :is(.export-sq,.cp-sq-btn,.cp-wide-btn,.finish-rect,.wc-btn):hover:not(:disabled):not(.cp-preview-btn){
    transform:translateY(-2px);box-shadow:0 0 0 1px var(--hover-ring),0 4px 10px rgba(0,0,0,.35)}
  /* Question / special-wager headers: accent edge on the left plus the fill set above. */
  .q-header:has(.q-header-left:hover),.q-header:has(.sw-header-left:hover){box-shadow:inset 3px 0 0 var(--hover-ring)}
  /* Selected / answered states keep their colour but still react, so they read as changeable. */
  :is(.wager-btn,.place-btn,.result-btn,.bonus-choice-btn,.q-sort-btn,.q-alpha-btn,.settings-btn,.settings-toggle-btn,.sort-btn,.standings-sort-btn):is(.selected,.correct,.incorrect,.correct-sel,.incorrect-sel,.active):hover:not(:disabled){
    filter:brightness(1.18)}
  [data-theme="light"] :is(.wager-btn,.place-btn,.result-btn,.bonus-choice-btn,.q-sort-btn,.q-alpha-btn,.settings-btn,.settings-toggle-btn,.sort-btn,.standings-sort-btn):is(.selected,.correct,.incorrect,.correct-sel,.incorrect-sel,.active):hover:not(:disabled){
    filter:brightness(.88)}
  /* Scoreboard rows, which open the row menu. */
  .score-row:has(.sr-name-clickable):hover{outline:2px solid var(--hover-ring);outline-offset:-2px;cursor:pointer}
  .sr-name-clickable:hover{text-decoration:underline}
}
/* Pressing a lifted tile sinks it past rest. */
:is(.export-sq,.cp-sq-btn,.cp-wide-btn,.finish-rect,.wc-btn):active:not(:disabled){transform:translateY(1px)}
/* Disabled / unavailable controls never look hoverable, whatever the earlier rules say. */
button:disabled,.cp-preview-btn{cursor:not-allowed}
:is(.btn,.settings-btn,.qtimer-btn,.cp-draw-btn,.cp-manual-end-btn,.cp-preview-btn):is(:disabled,.cp-preview-btn):hover{
  background:var(--bg-card);border-color:var(--border-control);box-shadow:none;transform:none;filter:none}
:is(.q-sort-btn,.q-alpha-btn,.team-guess-btn,.btn-accent,.btn-danger,.qtimer-pause):disabled:hover{filter:none;box-shadow:none;transform:none}
:is(button,[role="button"]):disabled:active{transform:none;filter:none}

/* Pause / Delete team (and the other round red X buttons) had only a faint tint on hover.
   They keep their own colour: red for Delete/close, gold for Pause. Ring + a firmer fill. */
@media (hover:hover) and (pointer:fine){
  :is(.remove-team button:not(.pause-team),.settings-x-btn,.audit-close,.resume-banner-close):hover{
    background:color-mix(in srgb,var(--accent-red) 32%,var(--bg-card));border-color:var(--accent-red);box-shadow:0 0 0 2px var(--accent-red);color:var(--txt-red)}
  .remove-team .pause-team:not(.is-on):hover{
    background:color-mix(in srgb,var(--accent-gold) 30%,var(--bg-card));border-color:var(--accent-gold);box-shadow:0 0 0 2px var(--accent-gold);color:var(--text-primary)}
  .remove-team .pause-team.is-on:hover{box-shadow:0 0 0 2px var(--accent-gold);filter:brightness(1.12)}
  [data-theme="light"] .remove-team button:not(.pause-team):hover,[data-theme="light"] :is(.settings-x-btn,.audit-close,.resume-banner-close):hover{background:#ffb8b8;color:#8a0000}
  [data-theme="light"] .remove-team .pause-team:not(.is-on):hover{background:#ffe2a0;color:#4a2e00}
  [data-theme="light"] .remove-team .pause-team.is-on:hover{filter:brightness(.9)}
}

/* MOUSE / TRACKPAD LAYOUTS. Comes last so it wins over the compact desktop sizes and over the
   (max-width:1024px) touch rules, which also match a half-screen browser window. */
@media (hover:hover) and (pointer:fine){
  /* Follow a team's name across to its buttons. */
  .team-answer:hover,.bonus-row:hover,.special-wager-row:hover{background:var(--bg-hover)}
  /* Text floor: nothing readable drops under 12px. */
  label,.team-number,thead th,.team-guess-cell>label,.guess-warn,.sort-mode-label,.round-label,
  .cp-field-label,.cp-script-label,.export-sq-label,.fr-guess-h,.fr-diff-h,.fr-tiebadge,summary,
  .size-label,.settings-version,.settings-about,.settings-about summary,.settings-about .about-ver,
  .fr-details summary,.fr-note,.cv-select-arrow,.aud-rank-of,.aud-meta,.aud-wager,.aud-stat-pct,
  .aud-dot,.aud-eyebrow,.aud-res,.standings-table thead th,.final-table thead th,
  .banter-cat,.staff-thanks-edit-label,.standings-sort-btn{font-size:max(12px,.75rem)}
  .toolbar>button,.btn,.check-label{font-size:max(12px,.8rem)}
  /* Delete and Pause: at least 32px. */
  .remove-team button{width:max(32px,2rem);height:max(32px,2rem)}
  .remove-team .pause-team{width:max(40px,2.5rem)}
}
/* A narrow scoring column in a desktop window (beside another app): keep score buttons a
   comfortable click size instead of shrinking them as far as the phone rules do. */
@media (pointer:fine){
  @container scorecol (max-width:600px){
    .wager-btn:not(.place-btn),.result-btn{width:clamp(2.4rem,11cqw,var(--wager-size));min-width:clamp(2.4rem,11cqw,var(--wager-size));height:clamp(2.4rem,11cqw,var(--wager-size));min-height:clamp(2.4rem,11cqw,var(--wager-size))}
    .bonus-choice-btn{width:clamp(2.2rem,9cqw,2.4rem);height:clamp(2.2rem,9cqw,2.4rem)}
  }
}

/* KEYBOARD SCORING: the row that score keys act on (js/host-tools.js). */
.team-answer,.bonus-row,.special-wager-row{scroll-margin-top:calc(var(--qbar-top,0px) + 6rem);scroll-margin-bottom:1rem}
.team-answer.kb-row,.bonus-row.kb-row,.special-wager-row.kb-row{outline:3px solid var(--accent-cyan-solid);outline-offset:-3px;background:var(--bg-hover)}
.ht-keys-sub{font-size:max(12px,.85rem);margin:14px 0 4px}

/* ONE-LINE TEAM NAMES: where a scoring row has room, the name column fits the longest team name
   (--name-col, measured by fitNameColumn() in js/app.js), so names stay on one line. In each row the
   points end where the header's Sort button ends, so the score buttons sit near the name and
   not at the far right. If the buttons need the space, the name shrinks and wraps as before.
   The right padding on the name keeps the hover Team Report icon off the end of it. */
.name-probe{position:absolute;left:-9999px;top:0;width:max-content;visibility:hidden;white-space:nowrap;font-weight:600;font-size:max(12px,.88rem);line-height:1.3;padding:0 2.2em 0 4px}
@container scorecol (min-width:601px){
  /* --score-col has a floor so a game of short names still leaves room for the header's title.
     --sort-w is the room after the title: the header's Sort button and the rows' points end there. */
  .team-answer,.bonus-row,.special-wager-row,.q-header,.sw-header,.standings-block{--score-col:max(var(--name-col,11rem),13rem);--sort-w:calc(19.85rem + 8px)}
  :is(.team-answer,.bonus-row,.special-wager-row)>.ta-name{width:var(--score-col);flex-shrink:1;min-width:6rem;padding-right:2.2em}
  /* The row itself stays full width (stripes, hover); its right padding moves the end of the
     controls to the Sort button's edge. The first control keeps margin-left:auto, so it all slides. */
  :is(.team-answer,.bonus-row,.special-wager-row){padding-right:max(10px,calc(100% + 4px - var(--title-w,var(--score-col)) - var(--sort-w)))}
  .special-wager-row>.sw-select{margin-left:auto}
  /* The title area only takes space the buttons leave (a zero flex-basis), so they stay on one row
     whenever the title can narrow enough; only then do they wrap, the two percentages together. */
  .q-header-left,.sw-header-left{flex:1 1 0;max-width:var(--score-col);min-width:min-content}
  /* The button area runs to that edge and holds the Sort button at its right, over the points. */
  .q-header-right{margin-left:0;flex:0 1 var(--sort-w);min-width:max-content;justify-content:flex-end}
  .q-header-right>.q-sort-btn{min-width:5.75rem}
  /* Larger A-Z / Z-A picture; the No guess button keeps its own. */
  .q-alpha-btn:not(.team-guess-btn) .icon-ui{width:1.75em;height:1.75em}
  /* Scores before a wager: the score column sits where the rows' points are, under the Sort button. The
     first column has the width; the score column takes the rest and holds its number at the left. */
  .standings-table th:first-child,.standings-table td.standings-name{width:calc(var(--title-w,var(--score-col)) + var(--sort-w) - 3.7rem + 3px)}
  .standings-table thead th:last-child,.standings-table td.standings-pts{text-align:left}
  .standings-table .st-score{display:inline-block;min-width:3.7rem;text-align:center}
  /* Question, Q5 wager and pre-wager score boxes (and the text boxes between them) are only as wide
     as their contents need, which follows the longest team name. Round cards stay full width. */
  .section-body{--fit:calc(max(var(--name-col,11rem),13rem) + 19.85rem + 8px + 2.9rem)}
  .section-body>:is(.question-block,.special-section,.standings-block,.banter,.staff-thanks){max-width:var(--fit)}
  .q-header-left .q-badge{white-space:nowrap}
}
/* A header with percentages wraps them onto a second line. */
:is(.q-header,.sw-header):has(.q-stats-row){flex-wrap:wrap;row-gap:2px}
.q-stats-row{flex:0 0 100%}
.q-stats-row .q-stat-correct{color:var(--pts-pos-fg);background:none;border:0}
.q-stats-row .q-stat-incorrect{color:var(--pts-neg-fg);background:none;border:0}
/* Light theme's pill text is white, so plain text takes a darker shade of the pill colour. */
[data-theme="light"] .q-stats-row .q-stat-correct{color:color-mix(in srgb,var(--pts-pos-bg) 78%,#000)}
[data-theme="light"] .q-stats-row .q-stat-incorrect{color:color-mix(in srgb,var(--pts-neg-bg) 78%,#000)}
/* Wide column: the percentages end at the same edge as the Sort button. The row's basis is the
   title plus the button area and the gap between them. */
@container scorecol (min-width:601px){
  .q-stats-row{flex:0 1 calc(var(--title-w,var(--score-col)) + var(--sort-w) + 6px)}
}
/* Badges stay on one line at every width; the Sort button alone leaves them the room. */
.q-badge,.sw-title-sub,.bonus-title-sub{white-space:nowrap}
@container scorecol (max-width:360px){
  .q-stats-row{gap:.6rem}
}
/* Q5 wager dropdown, at every width: as tall as the correct / incorrect buttons, wider, with a larger
   number. The arrow is a background image, so the hover and focus rules here set only the colour. */
.special-wager-row>.sw-select{appearance:none;-webkit-appearance:none;width:4.2rem;height:2.6rem;padding:0 1.2rem 0 .2rem;font-size:1.25rem;background:var(--btn-idle-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23bbbbbb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 2l4 4 4-4'/%3E%3C/svg%3E") no-repeat right .55rem center/.8rem .53rem}
[data-theme="light"] .special-wager-row>.sw-select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 2l4 4 4-4'/%3E%3C/svg%3E")}
/* Phones: the dropdown and each row's points box are as tall as the buttons beside them (the smaller
   0-4 buttons on bonus rows). The points box is also wider, with a larger number. */
@container scorecol (max-width:600px){
  .special-wager-row>.sw-select{height:clamp(2rem,9cqw,var(--wager-size));min-height:0}
  :is(.team-answer,.bonus-row,.special-wager-row) :is(.ta-pts,.bonus-pts){height:clamp(2rem,9cqw,var(--wager-size));width:clamp(3.2rem,16cqw,4.1rem);box-sizing:border-box;display:flex;align-items:center;justify-content:center;padding:0;font-size:1.3rem}
  .bonus-row .bonus-pts{height:clamp(1.7rem,7.5cqw,2.2rem)}
}
@media (pointer:fine){
  @container scorecol (max-width:600px){
    .special-wager-row>.sw-select,:is(.team-answer,.special-wager-row) .ta-pts{height:clamp(2.4rem,11cqw,var(--wager-size))}
    .bonus-row .bonus-pts{height:clamp(2.2rem,9cqw,2.4rem)}
  }
}
@media (forced-colors:active){.special-wager-row>.sw-select{appearance:auto;-webkit-appearance:auto}}
/* A used wager keeps its faded look on hover; this outranks the shared button hover rules. */
.wager-btn.wager-btn.used:hover:not(.selected){background:color-mix(in srgb,var(--btn-used-bg) 22%,transparent);border-color:color-mix(in srgb,var(--border-control) 22%,transparent);box-shadow:none;transform:none;filter:none}

/* SCORE RACE: a third panel, right of the scoreboard, only on very wide windows. The legend sits
   under the chart so the chart gets the panel's whole width. Drawn by renderScoreRace() in
   js/host-tools.js; the five line colours are checked for colour-blind separation. */
:root{--race-1:#338ced;--race-2:#e76624;--race-3:#00a888;--race-4:#d28e05;--race-5:#e24d8b;--race-rest:#8a8a8a}
[data-theme="light"]{--race-1:#257de0;--race-2:#f47230;--race-3:#00b894;--race-4:#f2a600;--race-5:#ee7fac;--race-rest:#7a7a7a}
.race-panel{display:none}
@media (min-width:2100px){
  .race-panel{display:flex;flex-direction:column;gap:8px;flex:0 0 clamp(520px,calc(100vw - 1600px),900px);height:100%;overflow-y:auto;padding:14px 18px;border-left:1px solid var(--border-strong);background:var(--bg-card-alt)}
}
.race-title{font-family:var(--font-display);font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--txt-cyan)}
.race-sub,.race-note{font-size:max(12px,.8rem);color:var(--text-muted)}
/* The drawing is taken out of the flow, so redrawing it can't resize the box being measured. */
.race-chart{position:relative;flex:1 1 0;min-height:300px;max-height:760px}
.race-chart svg{position:absolute;inset:0;overflow:visible}
.race-chart text{font-family:var(--font-body);font-size:max(12px,.75rem);fill:var(--text-muted)}
.race-chart .race-end{font-weight:700;fill:var(--text-primary)}
.race-grid{stroke:var(--border)}
.race-legend{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(17rem,1fr));gap:4px 14px}
.race-legend button{display:flex;align-items:center;gap:8px;width:100%;min-height:32px;padding:3px 6px;border:0;border-radius:6px;background:transparent;color:var(--text-primary);font:600 max(12px,.85rem) var(--font-body);text-align:left;cursor:pointer}
.race-legend button:hover,.race-legend button.race-on{background:var(--bg-hover)}
/* The pointed-at team stands out in the chart and the legend; the other chart lines fade. */
.race-chart .race-hit{pointer-events:stroke}
.race-chart g[data-race]:hover,.race-chart g.race-on{cursor:default}
.race-chart svg:has(g.race-on) g[data-race]:not(.race-on){opacity:.2}
.race-chart g.race-on .race-line{stroke-width:4.5;stroke-opacity:1}
.race-chart g.race-on .race-line[stroke="var(--race-rest)"]{stroke:var(--text-primary)}
.race-legend button.race-on{box-shadow:inset 0 0 0 2px var(--accent-cyan-solid)}
.race-key{flex:none;width:12px;height:12px;border-radius:3px}
.race-rank{flex:none;min-width:1.2em;color:var(--text-muted)}
.race-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.race-pts{flex:none;font-family:var(--font-display);font-weight:700;font-variant-numeric:tabular-nums}
/* DARK POINTS: flat text in the true green and red shades, not the pale tints the old filled boxes used. */
[data-theme="dark"] :is(.ta-pts,.bonus-pts).pts-pos{color:#4ee04e}
[data-theme="dark"] :is(.ta-pts,.bonus-pts):is(.pts-neg,.pts-nil,.submitted-zero){color:#ff6b6b}

/* DELETE TEAM: a quiet grey trash can with no outline that fades to red when pointed at, focused or pressed.
   Last in the file so it wins over the shared round-X button styles in both themes. */
.team-entry .remove-team.remove-team-corner button,[data-theme="light"] .team-entry .remove-team.remove-team-corner button{border:0;background:none;color:var(--text-muted);transition:color .25s ease,background-color .25s ease}
.remove-team-corner button svg{width:1.3em;height:1.3em}
.team-entry .remove-team.remove-team-corner button:is(:focus-visible,:active),[data-theme="light"] .team-entry .remove-team.remove-team-corner button:is(:focus-visible,:active){color:var(--txt-red)}
@media (hover:hover) and (pointer:fine){
  .team-entry .remove-team.remove-team-corner button:hover,[data-theme="light"] .team-entry .remove-team.remove-team-corner button:hover{color:var(--txt-red);background:none;box-shadow:none;filter:none}
  /* An emoji can't be recoloured, so Emoji icon style gets a faint red circle instead. */
  .team-entry .remove-team.remove-team-corner button:has(.icon-emoji):hover{background:color-mix(in srgb,var(--accent-red) 22%,transparent)}
}

/* TOUCH SCORING (phones): 40px score buttons with 6px gaps. The points box and Q5 dropdown match. */
@media (pointer:coarse){
  @container scorecol (max-width:600px){
    .wager-btn:not(.place-btn),.result-btn{width:clamp(40px,11cqw,var(--wager-size));min-width:clamp(40px,11cqw,var(--wager-size));height:clamp(40px,11cqw,var(--wager-size));min-height:clamp(40px,11cqw,var(--wager-size))}
    .ta-wagers:not(:has(.place-btn)){gap:6px}
    .bonus-choice-btn{width:clamp(30px,11cqw,40px);height:clamp(30px,11cqw,40px)}
    .special-wager-row>.sw-select,:is(.team-answer,.special-wager-row) .ta-pts{height:clamp(40px,11cqw,var(--wager-size))}
  }
}
/* Smallest phones: slimmer points box, gaps and Rivals place tiles, so a row's buttons stay on one line. */
@container scorecol (max-width:340px){
  .team-answer .place-btn{width:2.7rem}
  .team-answer>.ta-wagers:not(:has(.place-btn)){gap:4px}
  .team-answer>.ta-pts{width:2.9rem}
}
/* Narrow scoring rows: larger team names, with less space above and below so rows stay compact. */
@container scorecol (max-width:600px){
  :is(.team-answer,.bonus-row,.special-wager-row)>.ta-name{font-size:max(15px,1rem);line-height:1.2}
  .team-answer,.bonus-row,.special-wager-row{padding-block:calc(var(--row-pad) * .6)}
}

/* TABLETS: where the score sidebar narrows the column, each row stays on one line and a long name
   is cut off with an ellipsis (tap it for the Team Report, which shows it in full). */
@media (pointer:coarse) and (min-width:769px){
  @container scorecol (max-width:600px){
    .team-answer,.bonus-row,.special-wager-row{flex-wrap:nowrap}
    .team-answer::before,.bonus-row::before,.special-wager-row::before{content:none}
    :is(.team-answer,.bonus-row,.special-wager-row)>.ta-name{flex:1 1 0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  }
}
@media (pointer:coarse) and (min-width:601px){
  /* Wide column: question and wager cards sit in the middle of their round card. */
  @container scorecol (min-width:601px){
    .section-body>:is(.question-block,.special-section,.standings-block,.banter,.staff-thanks){margin-inline:auto}
  }
  /* Teams list: CB and Bonus sit on the same line as the name. */
  @container scorecol (min-width:600px){
    .team-name-cell{display:grid;grid-template-columns:minmax(0,1fr) 15rem;column-gap:8px;row-gap:7px;align-content:start}
    .team-name-cell>.team-number{grid-column:1/-1}
    .team-name-cell>.team-checks{align-self:stretch;column-gap:6px}
    .team-name-cell .check-label{padding:0 6px;gap:5px;font-size:max(12px,.9rem)}
    .team-name-cell .check-box{width:18px;height:18px}
    .team-name-cell .check-input:checked+.check-box::after{left:5px;top:2px;width:4px;height:9px;border-width:0 2px 2px 0}
    .team-name-cell .lbl-full{display:inline}
    .team-name-cell .lbl-short{display:none}
    /* Delete and Pause line up with the 44px fields, below the labels. */
    .team-entry>.remove-team:not(.remove-team-corner),.team-entry>.remove-team-corner{align-self:end;min-height:44px;display:flex;align-items:center}
  }
  /* Event Details: Host Name and Location share a row, which fills the gap beside Host Name. */
  @container scorecol (min-width:481px){
    .meta-grid>.field.full:has(>input[aria-label="Location"]){grid-column:auto}
  }
  /* Event Details: two columns once there is room, even beside the score sidebar. */
  @container scorecol (min-width:481px) and (max-width:600px){
    .meta-grid>.field{grid-column:auto}
    .meta-grid>.field.full:not(:has(>input[aria-label="Location"])){grid-column:1/-1}
  }
}

/* GAME CONFIRMATION on touch and narrow screens: smaller step icons and shorter buttons. */
@media (pointer:coarse),(max-width:1024px){
  .finish-rect{min-height:3.6rem;gap:12px;padding:6px 14px}
  .finish-rect .icon-ui,.finish-rect .icon-emoji{font-size:2.2rem}
}

/* SHORT SCREENS: the Settings footer scrolls with the list instead of staying pinned over it. */
@media (max-height:760px){
  #settingsPanel .settings-panel-foot{position:static;box-shadow:none}
}
@media (max-width:600px) and (max-height:760px){
  #settingsPanel.settings-visible{overflow-y:auto}
  #settingsPanel .settings-panel-head{position:sticky;top:-10px}
  #settingsPanel .settings-panel-body{flex:none;overflow:visible}
  #settingsPanel .settings-panel-foot{flex-shrink:0}
}

/* LANDSCAPE PHONES: slimmer header, sidebar header and timer, so more scores show. */
@media (orientation:landscape) and (max-height:500px){
  .header{padding-top:calc(2px + env(safe-area-inset-top));padding-bottom:2px}
  .col-right .sidebar-header{min-height:0;padding-block:5px}
  .col-right .sort-controls{padding-block:3px}
  .col-right .sort-mode-label{display:none}
  .col-right .qtimer-desktop{flex-wrap:wrap;gap:6px;padding:2px 8px calc(4px + env(safe-area-inset-bottom))}
  .col-right .qtimer-desktop .qtimer-display{font-size:1.5rem;padding:0 2px;border-width:2px}
}
