/*
 * Rugbillion
 * Layout: a pitch-side big screen. The field strip is the hero; everything
 * else is scoreboard type on chalk-and-turf (day game) or floodlit night
 * (night game). Green and gold carry the identity; tier colours match the
 * share-card squares.
 */
/*
 * Fonts, served from public/fonts (latin and latin-ext subsets; SIL Open Font
 * License, see fonts/OFL.txt). Our own files, so nothing from another server holds
 * up the first paint, and swap shows the text at once in the fallback faces.
 */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/barlow-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/barlow-400-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-500-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-500-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-600-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-700-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-condensed-500-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-condensed-500-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-600-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-700-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 800 900; font-display: swap; src: url(../fonts/big-shoulders-display-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 800 900; font-display: swap; src: url(../fonts/big-shoulders-display-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #edf2ea;
  --surface: #f8fbf5;
  --surface-2: #e2eadf;
  --ink: #0f2419;
  --ink-2: #44594c;
  --line: #c3d1c5;
  --turf: #2f7c4c;
  --turf-2: #2a7044;
  --turf-ingoal: #276540;
  --chalk: #ffffff;
  --accent: #0d673a;
  --accent-ink: #ffffff;
  --accent-soft: #d5e8da;
  --gold: #e4a91f;
  --gold-ink: #1d1503;
  --danger: #b2352c;
  --focus: #1c64c8;
  --ball: #c8742c;
  --ball-seam: #fff7ea;

  --t0: #8a958e; --t0-ink: #ffffff;
  --t1: #d3dad5; --t1-ink: #14261b;
  --t2: #3478c0; --t2-ink: #ffffff;
  --t3: #2a9a5e; --t3-ink: #ffffff;
  --t4: #e3c13c; --t4-ink: #1f1a05;
  --t5: #ec8733; --t5-ink: #1f1104;
  --t6: #da4a3d; --t6-ink: #ffffff;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-label: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(15, 36, 25, 0.05), 0 14px 30px -18px rgba(15, 36, 25, 0.45);
  --max: 760px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07120c;
    --surface: #0d1d14;
    --surface-2: #13281b;
    --ink: #e7f1e9;
    --ink-2: #a2b8a9;
    --line: #23392b;
    --turf: #1f5c39;
    --turf-2: #1b5233;
    --turf-ingoal: #174a2d;
    --chalk: #e9f4ec;
    --accent: #f0c24a;
    --accent-ink: #1a1404;
    --accent-soft: #2a2a12;
    --gold: #f0c24a;
    --gold-ink: #1a1404;
    --danger: #f07a6e;
    --focus: #7fb4ff;
    --ball: #d4843c;
    --ball-seam: #fff7ea;
    --t0: #6d7a72; --t0-ink: #ffffff;
    --t1: #cfd8d2; --t1-ink: #14261b;
    --t2: #4a8fd6; --t2-ink: #ffffff;
    --t3: #33ab6b; --t3-ink: #06140c;
    --t4: #e9c947; --t4-ink: #1f1a05;
    --t5: #f0913f; --t5-ink: #1f1104;
    --t6: #e8584a; --t6-ink: #ffffff;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 36px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07120c;
  --surface: #0d1d14;
  --surface-2: #13281b;
  --ink: #e7f1e9;
  --ink-2: #a2b8a9;
  --line: #23392b;
  --turf: #1f5c39;
  --turf-2: #1b5233;
  --turf-ingoal: #174a2d;
  --chalk: #e9f4ec;
  --accent: #f0c24a;
  --accent-ink: #1a1404;
  --accent-soft: #2a2a12;
  --gold: #f0c24a;
  --gold-ink: #1a1404;
  --danger: #f07a6e;
  --focus: #7fb4ff;
  --ball: #d4843c;
  --ball-seam: #fff7ea;
  --t0: #6d7a72; --t0-ink: #ffffff;
  --t1: #cfd8d2; --t1-ink: #14261b;
  --t2: #4a8fd6; --t2-ink: #ffffff;
  --t3: #33ab6b; --t3-ink: #06140c;
  --t4: #e9c947; --t4-ink: #1f1a05;
  --t5: #f0913f; --t5-ink: #1f1104;
  --t6: #e8584a; --t6-ink: #ffffff;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 36px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
/* manipulation: no double-tap zoom, so a quick second tap is a tap (pinch zoom still works). */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  /* No moment's transform (a pop, a shake) can make the page wider than the screen and let it pan sideways. */
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* With viewport-fit=cover the page can scroll up under a phone's status bar: keep a solid strip there. */
body::before {
  content: "";
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  pointer-events: none;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--accent); }
:root:not([data-theme="light"]) a { text-underline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
a, button, input, select, textarea, summary, label { touch-action: manipulation; }
button, .btn, .nav-link, .back-link, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.app {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}
main:focus, h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
.view { display: flex; flex-direction: column; gap: 20px; }

.eyebrow {
  margin: 0;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: default; }
/* Held for a moment after it appears (touch.js settle: [data-settle], aria-disabled), so a double
   tap's second tap can't press it. It looks as usual, and keeps the keyboard focus. */
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-quiet { background: transparent; }
/* Hover only where there's a mouse: on a phone it would stick after the tap. */
@media (hover: hover) {
  .btn:hover { border-color: var(--ink-2); }
  .btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
  .icon-btn:hover { border-color: var(--ink-2); }
}
/* Pressed: plain to see under a thumb. */
.btn:active:not(:disabled), .icon-btn:active, .seg button:active, .back-link:active, .nav-link:active {
  transform: scale(0.97); filter: brightness(0.92);
}
.reduce-motion .btn:active, .reduce-motion .icon-btn:active, .reduce-motion .seg button:active,
.reduce-motion .back-link:active, .reduce-motion .nav-link:active { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .btn:active, .icon-btn:active, .seg button:active, .back-link:active, .nav-link:active { transform: none; }
}
.btn-danger { color: var(--danger); }
.btn-danger.btn:not(.btn-quiet) { border-color: var(--danger); }
.btn-big { min-height: 54px; font-size: 21px; padding: 0 28px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
}
.icon-btn svg, .back-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- home ---------- */

.masthead { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(46px, 11vw, 76px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}
.wordmark::after {
  content: "";
  display: block;
  height: 6px;
  width: 64%;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--accent) 0 60%, var(--gold) 60% 100%);
  border-radius: 3px;
}
.masthead-nav { display: flex; gap: 0 8px; flex-wrap: wrap; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px;
}
@media (hover: hover) {
  .nav-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
}
.tagline { margin: 6px 0 0; color: var(--ink-2); max-width: 46ch; text-wrap: pretty; }

.today-strip { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.today-countdown { margin: 0; font-family: var(--font-label); font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.section-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .section-cards { grid-template-columns: repeat(3, 1fr); } }

.section-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-band {
  position: relative;
  height: 92px;
  background: var(--turf);
  overflow: hidden;
}
.card-band svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-band .band-name {
  position: absolute; left: 14px; bottom: 6px;
  font-family: var(--font-display); font-weight: 900; font-size: 46px; line-height: 1;
  color: #ffffff; text-transform: uppercase; letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; flex: 1; }
.card-sub { margin: 0; font-family: var(--font-label); font-weight: 600; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.card-text { margin: 0; color: var(--ink); font-size: 16px; text-wrap: pretty; }
.card-status { margin: 0; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card-status strong { color: var(--ink); }
.card-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 auto; }
.tackle-bars {
  display: inline-flex; align-items: flex-end; gap: 3px; height: 30px;
  vertical-align: middle; padding: 0 2px 2px; margin-left: 2px;
  border-bottom: 2px solid var(--line, rgba(127, 127, 127, .35));
}
.tackle-bars .tb {
  width: 9px; height: calc(4px + var(--lv, 0) * 4px);
  background: var(--tc, var(--t0)); border-radius: 2px 2px 0 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.tackle-bars .tb.t0 { opacity: .55; }

.home-extra { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .home-extra { grid-template-columns: 1fr 1fr; } }
.extra-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.extra-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; text-transform: uppercase; }
.extra-text { margin: 0; color: var(--ink-2); font-size: 16px; }
.extra-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.extra-actions .btn { font-size: 16px; min-height: 44px; padding: 0 14px; }

.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ladder li { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 10px; font-size: 15px; }
.ladder .sq { width: 16px; height: 16px; border-radius: 4px; }
.ladder .lname { font-weight: 600; }
.ladder .lm { font-family: var(--font-label); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ladder-wide li { grid-template-columns: 16px minmax(0, 9em) 1fr auto; }
.ladder-wide .lwho { color: var(--ink-2); }

.site-foot { border-top: 1px solid var(--line); padding-top: 14px; color: var(--ink-2); font-size: 14px; }
.site-foot p { margin: 0 0 6px; max-width: 70ch; }

/* ---------- tier colours ---------- */
.t0 { --tc: var(--t0); --tci: var(--t0-ink); }
.t1 { --tc: var(--t1); --tci: var(--t1-ink); }
.t2 { --tc: var(--t2); --tci: var(--t2-ink); }
.t3 { --tc: var(--t3); --tci: var(--t3-ink); }
.t4 { --tc: var(--t4); --tci: var(--t4-ink); }
.t5 { --tc: var(--t5); --tci: var(--t5-ink); }
.t6 { --tc: var(--t6); --tci: var(--t6-ink); }
.sq { background: var(--tc); }
.tier-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--tc, var(--t0)); color: var(--tci, #fff);
  font-family: var(--font-label); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- play ---------- */

.play-bar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; }
.play-title { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.play-section { font-family: var(--font-display); font-weight: 900; font-size: 30px; text-transform: uppercase; }
.play-set { font-family: var(--font-label); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.play-count {
  font-family: var(--font-label); font-weight: 700; font-size: 17px; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--surface-2); padding: 6px 12px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums;
}

.field-panel { display: flex; flex-direction: column; gap: 6px; }
.field-host { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); line-height: 0; }
.field-svg { display: block; width: 100%; height: auto; }
.field-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.metres-total { font-family: var(--font-display); font-weight: 900; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.tries-total { font-family: var(--font-label); font-weight: 700; font-size: 17px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }

.f-turf { fill: var(--turf); }
.f-stripe { fill: var(--turf-2); }
.f-ingoal { fill: var(--turf-ingoal); }
.f-line { stroke: var(--chalk); stroke-width: 2; opacity: 0.85; }
.f-line.f-half { stroke-width: 3; opacity: 1; }
.f-line.f-dash { stroke-dasharray: 8 8; opacity: 0.75; }
.f-try { stroke: var(--chalk); stroke-width: 5; }
.f-border { fill: none; stroke: var(--chalk); stroke-width: 2; opacity: 0.7; }
.f-num { fill: var(--chalk); font-family: var(--font-label); font-weight: 700; font-size: 30px; opacity: 0.8; }
.f-trytext { fill: var(--chalk); font-family: var(--font-display); font-weight: 900; font-size: 34px; opacity: 0.35; letter-spacing: 0.08em; writing-mode: vertical-rl; dominant-baseline: middle; }
.f-gain { fill: var(--tc, var(--gold)); opacity: 0.9; transition: x 0.7s ease, width 0.7s ease; }
.f-ball { transition: none; }
.f-ball.is-moving { transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.f-ball-body { fill: var(--ball); stroke: rgba(0, 0, 0, 0.35); stroke-width: 1.5; }
.f-ball-seam { stroke: var(--ball-seam); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.f-ball-inner { transform: rotate(-12deg); }
.field-svg.is-try .f-ingoal-far { fill: var(--gold); transition: fill 0.2s ease; }
.field-svg.is-try .f-trytext { opacity: 1; fill: var(--gold-ink); }

.kickoff {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.kickoff-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(32px, 7vw, 44px); line-height: 1; text-transform: uppercase; text-wrap: balance; }
.kickoff-text { margin: 0; color: var(--ink-2); max-width: 60ch; }

.turn { --gap: 14px; display: flex; flex-direction: column; gap: var(--gap); }
/* Where touch.js scrolls them to with the keyboard up: the clock at the top, the answer box at the bottom. */
.clock { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; scroll-margin-top: 8px; }
.answer-form { scroll-margin-bottom: 8px; }
.clock-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.clock-fill { height: 100%; width: 100%; background: var(--accent); border-radius: 999px; transform-origin: left center; }
.clock.is-low .clock-fill { background: var(--danger); }
.clock.is-paused .clock-fill { background: var(--t2); }
.clock-text { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }

.prompt-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.prompt-code {
  margin: 0; align-self: flex-start;
  font-family: var(--font-label); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px;
}
.prompt-text {
  margin: 0;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(30px, 6.4vw, 44px); line-height: 1.02;
  text-wrap: balance;
}
.prompt-text:focus { outline: none; }
.prompt-hint { margin: 0; color: var(--ink-2); font-size: 16px; }
.prompt-hint:empty { display: none; }

.answer-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.answer-input, .text-input {
  min-width: 0; width: 100%;
  min-height: 54px; padding: 0 16px;
  font-size: 20px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.text-input { min-height: 46px; font-size: 17px; }
.answer-input:focus, .text-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.answer-form .btn { min-height: 54px; }

.feedback { min-height: 1.5em; font-size: 16px; color: var(--ink-2); }
.feedback.is-bad { color: var(--danger); }
.feedback.is-hint { color: var(--ink); }
.feedback.is-hint strong { font-weight: 700; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices .btn { font-size: 16px; min-height: 44px; }
.turn-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.turn-actions .btn { font-size: 16px; min-height: 44px; }
/* The host's "End this prompt" sits at the far end from Pass, so one can't be pressed for the other. */
.turn-actions .end-prompt { order: -1; margin-right: auto; }

/* Phones: the message goes between the prompt and the answer box, where the eyes are,
   and the answer box sits lowest, next to the keyboard. */
@media (max-width: 600px), (pointer: coarse) {
  .turn > .feedback, .room-question > .feedback { order: 1; }
  /* No message yet: no empty line between the prompt and the answer box (it stays a live region). */
  .turn > .feedback:empty, .room-question > .feedback:empty { min-height: 0; margin-top: calc(-1 * var(--gap)); }
  .turn > .answer-form, .room-question > .answer-form { order: 2; }
  .turn > .choices, .room-question > .choices { order: 3; }
  .turn > .turn-actions, .room-question > .turn-actions { order: 4; }
}

.reveal {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  animation: rise 0.35s ease both;
}
@keyframes rise { from { opacity: 0.4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.reveal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reveal-metres { font-family: var(--font-display); font-weight: 900; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.reveal-answer { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 6vw, 38px); line-height: 1.05; text-wrap: balance; }
.reveal-answer:focus { outline: none; }
.reveal-answer .how { display: block; font-family: var(--font-body); font-weight: 500; font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.reveal-blurb, .reveal-note { margin: 0; color: var(--ink-2); }
.reveal-note:empty { display: none; }
.reveal-note { border-left: 3px solid var(--gold); padding-left: 10px; color: var(--ink); }
.reveal-cuts h3, .answer-groups h4 {
  margin: 0 0 6px; font-family: var(--font-label); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.cut-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cut-list li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 15px; }
.cut-list .sq { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.reveal-all summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.answer-groups { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.answer-groups .cut-list li.is-yours { outline: 2px solid var(--ink); }
.answer-info { color: var(--ink-2); font-size: 13px; }

/* ---------- results ---------- */

.sub-bar { display: flex; align-items: center; gap: 14px; min-height: 44px; flex-wrap: wrap; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-label); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; padding: 10px 10px 10px 2px; min-height: 44px; border-radius: 999px;
}
@media (hover: hover) {
  .back-link:hover { color: var(--accent); }
}
.sub-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 40px; line-height: 1; text-transform: uppercase; }
.sub-intro { margin: 0; color: var(--ink-2); max-width: 62ch; }

.score-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.score-hero > * { grid-column: 1; }
.score-big { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(76px, 20vw, 132px); line-height: 0.85; font-variant-numeric: tabular-nums; }
.score-unit { font-size: 0.42em; margin-left: 6px; color: var(--ink-2); }
.score-tries { margin: 0; font-family: var(--font-label); font-weight: 700; font-size: 22px; letter-spacing: 0.05em; text-transform: uppercase; }

.gain-chart { display: flex; flex-direction: column; gap: 6px; }
.gain-track { position: relative; height: 34px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; display: flex; }
.gain-seg { height: 100%; background: var(--tc); border-right: 2px solid var(--surface); min-width: 0; }
.gain-tick { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--ink); opacity: 0.55; }
.gain-axis { position: relative; height: 18px; font-family: var(--font-label); font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.05em; text-transform: uppercase; }
.gain-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.gain-axis span.is-end { transform: translateX(-100%); }

.res-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.res-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
.res-item .sq { width: 14px; height: 14px; border-radius: 4px; grid-row: span 2; align-self: start; margin-top: 4px; }
.res-q { font-size: 15px; color: var(--ink-2); min-width: 0; }
.res-a { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.res-m { font-family: var(--font-display); font-weight: 900; font-size: 24px; grid-row: span 2; font-variant-numeric: tabular-nums; }

.share-box { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; }
.share-text { margin: 0; white-space: pre-wrap; font-family: var(--font-body); font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.share-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-status { color: var(--ink-2); font-size: 15px; }
/* The last resort when nothing can copy for us: the text, selected, to press and hold. */
.share-spare {
  width: 100%; min-height: 6.5em; resize: vertical; padding: 10px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.4;
}
.res-next { display: flex; flex-direction: column; gap: 10px; }
.res-next-row { display: flex; flex-wrap: wrap; gap: 8px; }
.res-next .countdown { color: var(--ink-2); font-variant-numeric: tabular-nums; margin: 0; }

/* ---------- stats & archive ---------- */

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface);
  font-family: var(--font-label); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-v { font-family: var(--font-display); font-weight: 900; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-k { font-family: var(--font-label); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.stats-h { margin: 8px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; text-transform: uppercase; }
.dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dist li { display: grid; grid-template-columns: minmax(0, 8.5em) 1fr 3ch; align-items: center; gap: 10px; font-size: 15px; }
.dist .bar { height: 14px; border-radius: 4px; background: var(--tc); min-width: 2px; }
.dist .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cabinet { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cabinet li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.cabinet .sq { width: 12px; height: 12px; border-radius: 3px; grid-row: span 2; }
.cabinet .ca { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.cabinet .cq { color: var(--ink-2); font-size: 14px; min-width: 0; }
.empty { color: var(--ink-2); margin: 0; }

.archive-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.archive-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; flex-wrap: wrap; }
.archive-day { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.archive-day strong { font-family: var(--font-label); font-size: 18px; letter-spacing: 0.03em; }
.archive-day span { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.archive-item .btn { min-height: 44px; min-width: 64px; font-size: 16px; padding: 0 14px; }

/* ---------- settings ---------- */

.prefs { display: flex; flex-direction: column; gap: 16px; }
.pref-group { margin: 0; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pref-group legend { font-family: var(--font-display); font-weight: 800; font-size: 24px; text-transform: uppercase; padding: 0 6px; }
.pref-help { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 64ch; }
.radio-row { display: flex; flex-wrap: wrap; gap: 0 18px; }
.radio-row label, .check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.radio-row input, .check input { width: 20px; height: 20px; accent-color: var(--accent); }
.field-label { font-weight: 600; }
.key-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.key-row .text-input { flex: 1 1 240px; }
.key-row .btn { font-size: 16px; min-height: 44px; }
.pref-status { margin: 0; min-height: 1.4em; font-size: 15px; color: var(--ink-2); }
.pref-status.is-bad { color: var(--danger); }
.confirm { border: 1.5px solid var(--danger); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.confirm p { margin: 0; }
.export-box { width: 100%; min-height: 160px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); padding: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- how to play ---------- */

.how { display: flex; flex-direction: column; gap: 14px; }
.how-lead { margin: 0; font-size: 19px; max-width: 60ch; }
.how-steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 10px; max-width: 64ch; }
.how-h { margin: 10px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 28px; text-transform: uppercase; }
.how-sections { margin: 0; display: grid; grid-template-columns: minmax(0, 6em) 1fr; gap: 8px 14px; }
.how-sections dt { font-family: var(--font-display); font-weight: 900; font-size: 24px; text-transform: uppercase; line-height: 1.1; }
.how-sections dd { margin: 0; color: var(--ink-2); }

.bank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bank-item { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.bank-title { margin: 0; font-size: 15px; color: var(--ink-2); }
.bank-title strong { color: var(--ink); font-size: 16px; }
.bank-sources { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- account, Plus, legal ---------- */

.nav-account { color: var(--accent); }
.plus-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--gold); color: var(--gold-ink);
  font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; vertical-align: 2px;
}
.themed { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.themed .text-input { flex: 1 1 200px; }
.btn-plus { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.archive-note { color: var(--ink-2); font-size: 15px; padding: 2px 2px 6px; }
.foot-links a { color: var(--ink-2); }

.banner {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--ink); border: 1.5px solid var(--accent);
}
.group-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; text-transform: uppercase; }
.account-email { margin: 0; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.plus-state { margin: 0; color: var(--ink-2); }

/* rooms.js names the winner with these. */
.plus-title {
  margin: 0; font-family: var(--font-display); font-weight: 900;
  font-size: clamp(40px, 9vw, 64px); line-height: 0.95; text-transform: uppercase; text-wrap: balance;
}
.plus-price { margin: 0; font-family: var(--font-label); font-weight: 700; font-size: 22px; letter-spacing: 0.03em; }
.plus-free { margin: 0; color: var(--ink-2); }
.fine-print { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 64ch; }

/* ---------- Account: forms ---------- */

.acct-box { gap: 12px; }
.acct-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.acct-form .field-label { margin-top: 4px; }
.acct-form > .btn-wide { margin-top: 8px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.tabs [role="tab"] {
  min-height: 44px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; padding: 0 10px;
  font-family: var(--font-label); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2);
}
@media (max-width: 360px) { .tabs [role="tab"] { font-size: 15px; letter-spacing: 0.01em; padding: 0 4px; } }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 rgba(15, 36, 25, 0.08), 0 0 0 1.5px var(--line); }
.pw-row { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.pw-row .text-input { flex: 1 1 auto; min-width: 0; width: 100%; }
.pw-toggle { flex: none; min-width: 64px; min-height: 46px; padding: 0 12px; font-size: 16px; }
.text-input[aria-invalid="true"] { border-color: var(--danger); }
.btn-wide { width: 100%; min-height: 48px; font-size: 18px; }
.btn-link {
  align-self: flex-start; min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
/* Inside a line of text, still a 44 px target (review F9). */
.pref-status .btn-link, .email-typo .btn-link, .pro-note .btn-link { min-height: 44px; min-width: 44px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.ts-box:empty { display: none; }
.ts-box { min-height: 0; }
.is-warn { color: var(--ink); border-left: 3px solid var(--gold); padding-left: 10px; }
.forgot-sent { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1.5px solid var(--accent); }
.forgot-sent p { margin: 0; overflow-wrap: anywhere; }
.acct-notes { display: flex; flex-direction: column; gap: 6px; }
.acct-notes p { margin: 0; color: var(--ink); border-left: 3px solid var(--gold); padding-left: 10px; overflow-wrap: anywhere; }
.pw-change { border-top: 1px solid var(--line); }
.pw-change summary, .pro-faq summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; list-style: none; }
.pw-change summary::-webkit-details-marker, .pro-faq summary::-webkit-details-marker { display: none; }
.pw-change summary::after, .pro-faq summary::after { content: "+"; flex: none; font-family: var(--font-label); font-weight: 700; font-size: 24px; line-height: 1; color: var(--accent); }
.pw-change[open] summary::after, .pro-faq details[open] summary::after { content: "\2212"; }
.pw-change[open] summary { margin-bottom: 6px; }
.pw-change form { padding-bottom: 12px; }
.acct-buttons { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.acct-buttons .btn { font-size: 16px; }
#account-actions:empty { display: none; }
/* Empty live regions take no room (they stay in the page, so their first message is announced). */
.acct-box .pref-status:empty { min-height: 0; margin-top: -8px; }
/* A toast sits above the Pro page's sticky button. */
@media (max-width: 699px) { .pro-sticky-on .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
/* The keyboard covers the bottom of an iPhone's page without shrinking it: room to scroll the form up. */
.kb-up .view-account {
  padding-bottom: calc(100vh - var(--vv-height, 100vh));
  padding-bottom: calc(100lvh - var(--vv-height, 100lvh));
}

/* ---------- the Pro page ---------- */

.pro-hero {
  text-align: center; display: grid; justify-items: center; gap: 8px; padding: 20px 16px 24px;
  background: var(--surface); border: 1.5px solid var(--line); border-top: 6px solid var(--gold); border-radius: 14px;
}
.rb-96 { width: 96px; height: 96px; }
.pro-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 9vw, 52px); line-height: .95; text-transform: uppercase; text-wrap: balance; }
.pro-title span { color: var(--accent); display: block; }
.pro-price { margin: 0; font-family: var(--font-label); font-size: 20px; line-height: 1.25; text-wrap: balance; }
.pro-price strong { font-size: 30px; color: var(--accent); }
.pro-pie { margin: 0; color: var(--ink-2); }
.pro-cta { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.pro-cta .btn-wide { min-height: 52px; font-size: 19px; }
.pro-cta .pro-member { margin: 0; font-size: 18px; }
.pro-cta .pro-note { margin: 0; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.pro-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.pro-row .btn { flex: 1 1 140px; }
.pro-hero .pref-status:empty { display: none; }
.pro-h { margin: 8px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 28px; text-transform: uppercase; }
.pro-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pro-features li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; padding: 14px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px;
}
.pro-features svg { grid-row: span 2; width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.pro-features strong { font-family: var(--font-label); font-size: 19px; letter-spacing: 0.02em; }
.pro-features span { color: var(--ink-2); font-size: 16px; }
@media (min-width: 700px) { .pro-features { grid-template-columns: 1fr 1fr; } }
.pro-faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.pro-faq details { border-bottom: 1px solid var(--line); }
.pro-faq p { margin: 0 0 12px; color: var(--ink-2); }
.pro-sticky {
  position: fixed; inset: auto 0 0 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg); border-top: 1.5px solid var(--line); transform: translateY(110%); visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}
.pro-sticky .btn { min-height: 52px; font-size: 19px; }
.pro-sticky.is-on { transform: none; visibility: visible; transition: transform .2s ease; }
.view-plus.has-sticky { padding-bottom: 84px; }
@media (prefers-reduced-motion: reduce) { .pro-sticky { transition: none; } }
.reduce-motion .pro-sticky { transition: none; }
@media (min-width: 700px) { .pro-sticky { display: none; } .view-plus.has-sticky { padding-bottom: 0; } }

/* After today's three sets: Pro as a card, never a dialog. */
.pro-nudge {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line); border-left: 6px solid var(--gold); border-radius: var(--radius-sm); padding: 12px 14px;
}
.pro-nudge-text { margin: 0; }
.pro-nudge .key-row { grid-column: 1 / -1; }

/* The offer and the thank-you. */
.upsell .rb-sprite { justify-self: start; }
.upsell-body .key-row .btn { flex: 1 1 auto; }
.pro-thanks .thanks-body { align-items: center; text-align: center; }
.pro-thanks .rb-sprite { align-self: center; }
.thanks-title { font-size: 44px; }
.pro-pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pro-pills li { padding: 3px 12px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-family: var(--font-label); font-weight: 700; font-size: 16px; letter-spacing: 0.03em; }
.pro-thanks .key-row { justify-content: center; width: 100%; }
.upsell { max-height: calc(100dvh - 32px); overflow: auto; }

.legal { display: flex; flex-direction: column; gap: 10px; max-width: 70ch; }
.legal h2 { margin: 12px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; text-transform: uppercase; }
.legal p, .legal ul { margin: 0; }
.legal ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

.upsell {
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  width: min(440px, calc(100vw - 32px));
}
.upsell::backdrop { background: rgba(7, 18, 12, 0.55); }
.upsell-body { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.upsell-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 34px; line-height: 1; text-transform: uppercase; }
.upsell-reason { margin: 0; }
.upsell-price { margin: 0; color: var(--ink-2); font-size: 15px; }

/* Report a bug: the form (in the dialog's column) and the quiet links that open it. */
.report-body .field-label { margin-top: 2px; }
.report-message { min-height: 128px; padding: 10px 14px; line-height: 1.4; resize: vertical; }
.report-count { margin-top: -4px; text-align: right; font-size: 14px; }
.report-count:empty { display: none; }
.field-optional { font-weight: 400; color: var(--ink-2); }
.report-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; margin: 0; visibility: hidden; }
.reveal-report, .res-report { margin: 0; text-align: center; }
.reveal-report .btn-link, .res-report .btn-link { color: var(--ink-2); font-weight: 500; font-size: 15px; }
.foot-links .foot-report { min-height: 44px; padding: 0 4px; color: var(--ink-2); font-weight: inherit; font-size: inherit; vertical-align: middle; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: min(520px, calc(100vw - 32px)); z-index: 40;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: 15px; overflow-wrap: anywhere;
}
/* With the keyboard up the bottom of the page is under it (iOS doesn't move fixed things),
   so toasts show at the top of what's visible (touch.js keeps --vv-top current). */
.kb-up .toast { bottom: auto; top: calc(var(--vv-top, 0px) + 12px + env(safe-area-inset-top, 0px)); }
/* While typing (app.js puts it beside the answer box, clear of the prompt) it's one compact line. */
.kb-up .toast { padding: 8px 12px; font-size: 14px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- rooms (multiplayer) ---------- */

 /* The rooms page: Quick join, then the public rooms list (beside it on a wide screen), then code and hosting. */
.rooms-layout {
  display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "name" "quick" "public" "code" "host";
}
.rooms-name { grid-area: name; }
.quick-card { grid-area: quick; }
.public-rooms { grid-area: public; }
.join-card { grid-area: code; }
.host-card { grid-area: host; }
@media (min-width: 720px) {
  .rooms-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "name name" "quick quick" "public public" "code host"; }
}
@media (min-width: 1000px) {
  /* Only with the list showing (the preview has none). */
  .app:has(#view-rooms:not([hidden]) #public-rooms:not([hidden])) { max-width: 1120px; }
  .rooms-layout:has(> #public-rooms:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, 0.9fr); align-items: start;
    grid-template-areas: "name name public" "quick quick public" "code host public";
  }
  .public-rooms { position: sticky; top: 12px; }
}
.quick-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.quick-live, .public-count {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-label); font-weight: 700;
  font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2);
}
.quick-live { color: var(--accent); }
.quick-live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--t3); animation: live-blink 1.4s ease-in-out infinite; }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .quick-live::before { animation: none; } }
.reduce-motion .quick-live::before { animation: none; }
/* Public rooms: one row each, the Join button on the right. */
.public-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.public-list:empty { display: none; }
.public-room {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
.public-room.is-playing { opacity: 0.8; }
.pr-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.pr-line { grid-column: 1; margin: 0; color: var(--ink-2); font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.pr-status { grid-column: 1; margin: 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.public-room:not(.is-playing) .pr-status { color: var(--accent); }
.pr-join { grid-column: 2; grid-row: 1 / span 3; min-height: 44px; font-size: 16px; padding: 0 16px; }
.section-chip {
  display: inline-block; font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink);
}
.section-chip.is-nrl { background: #d5e8da; color: #0d4a2a; }
.section-chip.is-rugby { background: #dbe7f6; color: #1d4f86; }
.section-chip.is-both { background: #f7e7b8; color: #5a4103; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .section-chip.is-nrl { background: #173a24; color: #a6dcb8; }
  :root:not([data-theme="light"]) .section-chip.is-rugby { background: #152c47; color: #acc9ee; }
  :root:not([data-theme="light"]) .section-chip.is-both { background: #3a300f; color: #f0d68a; }
}
:root[data-theme="dark"] .section-chip.is-nrl { background: #173a24; color: #a6dcb8; }
:root[data-theme="dark"] .section-chip.is-rugby { background: #152c47; color: #acc9ee; }
:root[data-theme="dark"] .section-chip.is-both { background: #3a300f; color: #f0d68a; }
.public-note { margin: 0; color: var(--ink-2); font-size: 14px; }
/* Ready-ups in the lobby, and a quick match's countdown. */
.rp-ready {
  font-family: var(--font-label); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.rp-ready.is-ready { background: var(--accent-soft); color: var(--accent); }
.quick-lobby { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
/* The ring is the time left (--p, 1 to 0, set by rooms.js tickRing), drawn as a conic gradient with a hole. */
.quick-ring {
  --p: 1; --ring: var(--accent);
  position: relative; flex: none; width: 148px; height: 148px; border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--p) * 1turn), var(--surface-2) 0);
}
.quick-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.quick-ring.is-set { --ring: var(--gold); }
.quick-ring.is-waiting { --ring: var(--accent-soft); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-label { font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.ring-value { font-family: var(--font-display); font-weight: 900; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.quick-lobby-text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.quick-lobby-head { margin: 0; font-weight: 700; font-size: 20px; line-height: 1.25; }
.ready-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ready-count { font-family: var(--font-label); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.btn.is-ready { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
/* Quick join, searching: the pixel player runs inside a pulsing ring while we look. */
.quick-search { display: flex; align-items: center; gap: 14px; min-width: 0; }
.quick-search-text { min-width: 0; }
.quick-search-title { margin: 0; font-family: var(--font-label); font-weight: 700; font-size: 20px; line-height: 1.2; }
.quick-search-sub { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.quick-search-sub:empty { display: none; }
.quick-radar { position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); }
.quick-radar::before, .quick-radar::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0;
}
.quick-card.is-searching .quick-radar::before { animation: quick-ping 1.8s ease-out infinite; }
.quick-card.is-searching .quick-radar::after { animation: quick-ping 1.8s ease-out 0.9s infinite; }
.quick-card.is-found .quick-radar { background: var(--gold); }
@keyframes quick-ping { 0% { transform: scale(0.75); opacity: 0.8; } 100% { transform: scale(1.45); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .quick-card.is-searching .quick-radar::before, .quick-card.is-searching .quick-radar::after { animation: none; opacity: 0.5; } }
.reduce-motion .quick-card.is-searching .quick-radar::before, .reduce-motion .quick-card.is-searching .quick-radar::after { animation: none; opacity: 0.5; }
.host-form { display: flex; flex-direction: column; gap: 10px; }
.host-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.host-row > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--font-display); font-weight: 800; font-size: 24px; max-width: 9em; }
.mates-card .extra-actions .btn { min-width: 7em; }

/* "Open in another tab" and "Lost the connection": the room waits for a button press. */
.banner.has-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.banner-btn { min-height: 44px; font-size: 16px; padding: 0 16px; }
.room-stage[inert], .room-players[inert] { opacity: 0.5; }

.room-stage { display: flex; flex-direction: column; gap: 14px; }
.room-panel { --gap: 12px; display: flex; flex-direction: column; gap: var(--gap); }
.room-code {
  margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(64px, 18vw, 104px);
  line-height: 0.9; letter-spacing: 0.12em; color: var(--accent);
}
.room-wait { margin: 0; color: var(--ink-2); }
.lobby-setting { display: flex; flex-direction: column; gap: 6px; }

.room-board { display: flex; flex-direction: column; gap: 8px; }
.room-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.room-player {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 12px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px;
}
.room-player.is-you { border-color: var(--accent); }
.room-player.is-away { opacity: 0.55; }
.rp-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.rp-host { font-family: var(--font-label); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); font-size: 14px; }
.rp-tick { font-family: var(--font-label); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.rp-tick.is-done { color: var(--accent); }
.rp-score { font-family: var(--font-display); font-weight: 900; font-size: 22px; font-variant-numeric: tabular-nums; }
.rp-kick { grid-column: 1 / -1; justify-self: start; min-height: 44px; font-size: 15px; }

.room-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.room-result {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line); border-left: 6px solid var(--tc); border-radius: var(--radius-sm); padding: 8px 12px;
}
.rr-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.rr-answer { grid-column: 1; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.room-result .tier-chip { grid-column: 2; grid-row: 1; justify-self: end; font-size: 14px; padding: 2px 10px; }
.rr-metres { grid-column: 2; grid-row: 2; justify-self: end; font-family: var(--font-display); font-weight: 900; font-size: 22px; font-variant-numeric: tabular-nums; }
.rr-bonus { grid-column: 1 / -1; font-family: var(--font-label); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold); justify-self: start; padding: 1px 8px; border-radius: 999px; }
.room-result.is-you { border-color: var(--accent); border-left-color: var(--tc); }

/* The host's Next prompt / Full time stays in reach at the bottom of the screen
   through a long reveal (the reveal's own clock is only 9 seconds). */
.room-next {
  position: sticky; bottom: 0; z-index: 2;
  padding: 14px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, transparent, var(--bg) 14px);
}
.room-next .btn { flex: 1 1 auto; }
.room-last summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.room-last[open] summary { margin-bottom: 8px; }

.room-standings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.room-standings li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.room-standings li.is-you { border-color: var(--accent); }
.room-standings li:first-child { border-color: var(--gold); border-width: 2.5px; }
.rs-rank { font-family: var(--font-display); font-weight: 900; font-size: 26px; color: var(--ink-2); }
.rs-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.rs-score { font-family: var(--font-label); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- celebration (fx.js, sprite.js) ---------- */

/* The mute button sits at the end of the play bar and the room bar. */
.play-bar { grid-template-columns: 44px minmax(0, 1fr) auto 44px; }
.fx-mute[aria-pressed="true"] .fx-mute-waves, .fx-mute[aria-pressed="false"] .fx-mute-x { display: none; }
@media (max-width: 420px) { .play-bar { gap: 8px; } }
/* A room's title ("Room 4FFE") is long: on a phone the prompt count goes under it, so it stays on one line.
   And the bar is two rows at most: the short settings in the lobby, the prompt count in a game. */
.sub-short { display: none; }
@media (max-width: 400px) {
  .view-room .play-bar { grid-template-columns: 44px minmax(0, 1fr) 44px; row-gap: 6px; }
  .view-room .play-bar > .icon-btn { grid-row: 1 / span 2; }
  #room-leave { grid-column: 1; }
  #room-mute { grid-column: 3; }
  .view-room .play-count { grid-column: 2; grid-row: 2; justify-self: start; }
  .view-room .sub-long { display: none; }
  .view-room .sub-short { display: inline; }
  .view-room[data-phase="lobby"] #room-count { display: none; }
  .view-room[data-phase]:not([data-phase="lobby"]) #room-sub { display: none; }
}
/* "Locked in: ...", the tier as a chip on its own line, "Waiting for the others": the chip is
   what pops, from its left end, so it never reaches past the screen's edge. */
.feedback .fb-tier { display: block; width: fit-content; margin: 4px 0; transform-origin: left center; }

/* Pops, scaled by tier with --pop. Transform and opacity only. */
.fx-pop { animation: fx-pop 380ms cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: var(--fx-delay, 0ms); }
.fx-pop-big { animation: fx-pop-big 520ms cubic-bezier(.2, .9, .3, 1.2) both; transform-origin: left bottom; }
@keyframes fx-pop { 0% { transform: scale(.6); opacity: 0; } 40% { transform: scale(var(--pop, 1.08)); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes fx-pop-big { 0% { transform: scale(.85); opacity: .3; } 45% { transform: scale(1.04); opacity: 1; } 100% { transform: none; opacity: 1; } }
/* A Breakaway or a Try of the Year: one ring round the reveal, never a flash. */
.reveal { position: relative; }
.reveal.fx-rare::after { content: ""; position: absolute; inset: -3px; border-radius: calc(var(--radius) + 3px); border: 3px solid var(--tc); opacity: 0; pointer-events: none; animation: fx-ring 900ms ease-out 1; }
@keyframes fx-ring { 0% { opacity: 0; transform: scale(.98); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.03); } }
.play-count.fx-knock { color: var(--danger); --pop: 1.08; animation: fx-pop 380ms ease-out; }
.clock-text.fx-pulse { animation: fx-pulse 300ms ease-out; }
@keyframes fx-pulse { 0%, 100% { transform: none; } 40% { transform: scale(1.18); } }
.answer-form.is-shake { animation: shake 0.28s ease-out; }
@keyframes shake { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }

/* The TRY banner, over the field strip. */
.field-host { position: relative; }
.try-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; line-height: 1; white-space: nowrap; max-width: calc(100% - 16px);
  font-family: var(--font-display); font-weight: 900; font-size: clamp(30px, 9vw, 52px); letter-spacing: .04em; text-transform: uppercase;
  background: var(--gold); color: var(--gold-ink); padding: 6px 16px 4px; border-radius: 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
  animation: fx-banner 1600ms cubic-bezier(.2, .9, .3, 1.2) both; }
.try-banner.is-year { font-size: clamp(22px, 6.4vw, 40px); border-bottom: 5px solid var(--t6); }
.try-banner small { display: block; font-family: var(--font-label); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-align: center; }
@keyframes fx-banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 20%, 85% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); } }
.f-runner, .rb-sprite svg { shape-rendering: crispEdges; }
.f-speed-line { fill: var(--chalk); opacity: 0; transition: opacity .2s ease; }
.f-ball.is-sprint .f-speed-line { opacity: .6; }
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; image-rendering: pixelated; }

/* The pixel player. Sizes are whole multiples of 16 px, so his pixels stay square. */
.rb-sprite { display: inline-block; flex: none; width: 32px; height: 32px; line-height: 0; }
.rb-sprite svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rb-48 { width: 48px; height: 48px; } .rb-64 { width: 64px; height: 64px; }
.rb-fb { opacity: 0; }
.rb-sprite[data-anim] .rb-fa { animation: rb-swap-a var(--rb-cycle, 1040ms) steps(1, end) var(--rb-delay, 0ms) var(--rb-loops, 1); }
.rb-sprite[data-anim] .rb-fb { animation: rb-swap-b var(--rb-cycle, 1040ms) steps(1, end) var(--rb-delay, 0ms) var(--rb-loops, 1); }
@keyframes rb-swap-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes rb-swap-b { 0% { opacity: 0; } 50% { opacity: 1; } }
.px-outline { fill: var(--px-outline, #14261b); } .px-skin { fill: var(--px-skin, #d9a066); } .px-skin-shade { fill: var(--px-skin-shade, #b5773f); } .px-hair { fill: var(--px-hair, #3a2414); }
.px-jersey { fill: var(--px-jersey, #e4a91f); } .px-jersey-shade { fill: var(--px-jersey-shade, #b8840f); } .px-trim { fill: var(--px-trim, #0d673a); }
.px-shorts { fill: var(--px-shorts, #f3f0e6); } .px-shorts-shade { fill: var(--px-shorts-shade, #c9c3b1); } .px-socks { fill: var(--px-socks, #e4a91f); }
.px-socks-shade { fill: var(--px-socks-shade, #b8840f); } .px-boots { fill: var(--px-boots, #1d1d1f); }
.px-ball { fill: var(--ball); } .px-ball-shade { fill: #94521f; } .px-seam { fill: var(--ball-seam); }
/* Night game: on the dark cards a dark outline (and his hair and boots) disappear, so the
   outline turns chalk and a faint floodlight sits behind him. Kits are untouched. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rb-sprite { --px-outline: #cfe3d4; background: radial-gradient(closest-side, rgba(233, 244, 236, .16), rgba(233, 244, 236, 0)); border-radius: 50%; }
}
:root[data-theme="dark"] .rb-sprite { --px-outline: #cfe3d4; background: radial-gradient(closest-side, rgba(233, 244, 236, .16), rgba(233, 244, 236, 0)); border-radius: 50%; }
.card-band .rb-home { position: absolute; right: 18px; bottom: 6px; }
.card-band .rb-home:not(.rb-home-pair):nth-last-child(2) { right: 64px; }
.rb-mirror svg { transform: scaleX(-1); }
.rb-home.fx-run-in { animation: rb-run-in 900ms cubic-bezier(.3, .6, .4, 1) both; }
@keyframes rb-run-in { from { transform: translateX(var(--run-from, -240px)); } to { transform: none; } }
/* The player has his own column beside the metres, under the eyebrow, so a long
   eyebrow ("... · New best!") is never drawn over on a narrow phone. */
.score-hero > .eyebrow { grid-column: 1 / -1; }
.score-hero > .rb-res { grid-column: 2; grid-row: 2 / span 2; }
.res-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.res-badge { font-family: var(--font-label); font-weight: 700; font-size: 16px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; }
.res-badge.is-best { background: var(--gold); color: var(--gold-ink); }
.res-badge.is-streak { background: var(--accent-soft); color: var(--ink); }

/* Rooms: an avatar on every row, and the reveal and standings land from the bottom up. */
.room-player { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.room-player .rp-kick { grid-column: 2 / -1; }
.room-result { grid-template-columns: auto minmax(0, 1fr) auto; }
.room-result .rb-sprite { grid-row: 1 / span 2; }
.rr-name, .rr-answer { grid-column: 2; }
.room-result .tier-chip { grid-column: 3; grid-row: 1; }
.rr-metres { grid-column: 3; grid-row: 2; }
.rr-bonus { grid-column: 2 / -1; }
.room-standings li { grid-template-columns: 2.2em auto minmax(0, 1fr) auto; }
.fx-in { animation: fx-in 260ms ease-out both; animation-delay: var(--fx-delay, 0ms); }
@keyframes fx-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fx-win { --pop: 1.06; animation: fx-pop 520ms cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: var(--fx-delay, 0ms); }
.gain-seg.fx-grow { transform-origin: left center; animation: fx-grow 240ms cubic-bezier(.2, .8, .3, 1) both; animation-delay: var(--fx-delay, 0ms); }
@keyframes fx-grow { from { transform: scaleX(0); } to { transform: none; } }

/* Reduced motion: none of it. (.rb-f too: the rule below would leave a delayed frame hidden.) */
@media (prefers-reduced-motion: reduce) {
  .fx-pop, .fx-pop-big, .fx-in, .fx-win, .fx-grow, .fx-pulse, .fx-knock, .fx-run-in, .try-banner, .reveal.fx-rare::after, .rb-f { animation: none !important; }
}
.reduce-motion .fx-pop, .reduce-motion .fx-pop-big, .reduce-motion .fx-in, .reduce-motion .fx-win, .reduce-motion .fx-grow, .reduce-motion .fx-pulse,
.reduce-motion .fx-knock, .reduce-motion .fx-run-in, .reduce-motion .try-banner, .reduce-motion .reveal.fx-rare::after, .reduce-motion .rb-f { animation: none !important; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important;
}

/* ---------- phones ---------- */

@media (max-width: 420px) {
  body { font-size: 16px; }
  /* Call it stays beside the answer box: one row, so the box sits higher on the screen. */
  .answer-form .btn { padding: 0 14px; }
  .play-section { font-size: 26px; }
  .play-count { font-size: 15px; padding: 5px 10px; }
  .metres-total { font-size: 30px; }
  /* A little tighter, so a long prompt, the answer box and Pass fit a small phone's screen. */
  .view-play { gap: 14px; }
  .field-panel { gap: 2px; }
  .prompt-card { padding: 14px 16px 16px; }
}
@media (max-width: 380px) {
  .prompt-text { font-size: clamp(26px, 6vw, 44px); }
  .play-bar { gap: 10px; }
  .play-section { font-size: 23px; }
  .play-count { font-size: 14px; padding: 4px 9px; }
  .field-meta .metres-total { font-size: 27px; }
}

/* The on-screen keyboard is up (html.kb-up, from touch.js): the clock, the prompt and the
   answer box have to share what's left. The field strip steps aside until the answer's in. */
.kb-up .view-play .field-panel { display: none; }
/* An iPhone's keyboard covers the page without shrinking it: room below the game, so
   touch.js can scroll the answer box up above the keyboard however short the page is. */
.kb-up .view-play, .kb-up .view-room {
  padding-bottom: calc(100vh - var(--vv-height, 100vh));
  padding-bottom: calc(100lvh - var(--vv-height, 100lvh));
}
.kb-up .turn, .kb-up .room-question { --gap: 8px; }
.kb-up .prompt-card { padding: 10px 14px 12px; gap: 4px; }
.kb-up .prompt-text { font-size: clamp(22px, 5.6vw, 30px); }
.kb-up .prompt-hint { font-size: 15px; }
.kb-up .clock-text { font-size: 24px; }
.kb-up .answer-input, .kb-up .answer-form .btn { min-height: 48px; }
@media (max-width: 400px) {
  .kb-up .prompt-code { display: none; }   /* the prompt itself says enough while typing */
}

/* Landscape phones: the field strip shrinks to a band beside the metres, and the turn
   splits in two, the prompt on the left, the clock and answer box on the right.
   (min-width: a portrait phone whose page the keyboard has squashed isn't landscape.) */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 540px) {
  .app { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .view { gap: 10px; }
  .field-panel { flex-direction: row; align-items: center; gap: 16px; }
  .field-host { flex: 0 0 auto; height: 56px; }
  .field-svg { width: auto; height: 100%; }
  .field-meta { flex-direction: column; align-items: flex-start; gap: 0; }
  .metres-total, .field-meta .metres-total { font-size: 28px; }
  .wordmark { font-size: 46px; }
  .prompt-card { padding: 12px 16px 14px; gap: 6px; }
  .prompt-text { font-size: clamp(24px, 3.6vw, 34px); }
  .kickoff { padding: 14px 18px; gap: 8px; }
  .kickoff-title { font-size: 30px; }
  .turn, .room-question {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto 1fr; column-gap: 16px; row-gap: 8px; align-items: start;
  }
  .turn > *, .room-question > * { grid-column: 2; }
  .turn > .prompt-card, .room-question > .prompt-card { grid-column: 1; grid-row: 1 / -1; }
  .turn > .clock, .room-question > .clock { grid-row: 1; }
  .turn > .feedback, .room-question > .feedback { grid-row: 2; }
  .turn > .answer-form, .room-question > .answer-form { grid-row: 3; }
  .turn > .choices, .room-question > .choices { grid-row: 4; }
  .turn > .turn-actions, .room-question > .turn-actions { grid-row: 5; }
  .kb-up .turn, .kb-up .room-question { row-gap: 6px; }
  .turn > .feedback:empty, .room-question > .feedback:empty { margin-top: 0; }
  .kb-up .prompt-text { font-size: clamp(20px, 3.2vw, 26px); }
}
