/* Neon Glass — glassmorphism/neon-esports counterpart to the original
   Midnight Blueprint palette. Same token names and roles (surfaces sit
   ABOVE the page; --accent needs dark text on top — see --on-accent), just
   a deeper near-black base, cyan-tinted glass borders, and a saturated
   cyan accent in place of the original pastel blue. Applies everywhere —
   every screen shares these tokens, not just the TV Grid View.

   Themes (R33): the host picks one of six. A theme is a block of tokens on
   [data-theme="…"], which works on any element, so the Theme page can show a
   card wearing its own theme. The page's theme is <html data-theme="…"> (set by
   theme.js before first paint). "classic" is the original palette, shown as
   "Neon". A token whose value uses var() of another themed token is written out
   in every block (or lives in the shared rule below), or a nested card would
   show the page's value. */
:root, [data-theme] {
  /* A square that won a quarter is yellow in every theme, so it never looks like the red
     "not paid" ring (decision 028). --winner stays the theme's own color for everything else. */
  --q-win-rgb: 255, 214, 10;
  --q-win: rgb(var(--q-win-rgb));
  --on-q-win: #111;
  --accent2: var(--good);
  --teamA: #ff6b6b;
  --teamA-alt: #ffb3b3;
  --teamB: #4dabf7;
  --teamB-alt: #a5d8ff;
  /* Radius scale. --radius is the everyday alias. */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 20px; --r-pill: 999px;
  --radius: var(--r-sm);
  /* Unpaid squares (ring, $ tag, legend): crimson in every theme, apart from the error red. */
  --unpaid: #d6303f;
  /* Font-size scale. Fluid TV and Party View sizes stay as clamp(). */
  --fs-3xs: 0.6rem; --fs-2xs: 0.7rem; --fs-xs: 0.8rem; --fs-sm: 0.875rem; --fs-md: 1rem;
  --fs-lg: 1.15rem; --fs-xl: 1.3rem; --fs-2xl: 1.6rem; --fs-3xl: 2.1rem; --fs-4xl: 2.6rem;
  /* Theme-independent colors. --plate stays white so QR scanners work. */
  --plate: #fff;
  --text-strong: #fff;
  --glass-fill: rgba(255,255,255,0.04);
  --glass-line: rgba(255,255,255,0.07);
  --silver: #cfd2d4; --silver-rgb: 207, 210, 212;
  --bronze: #d08a55; --bronze-rgb: 208, 138, 85;
  --track-off: #4a5a6a;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 14px rgb(0 0 0 / 30%), 0 0 24px rgba(var(--accent-rgb), 0.06);
  --shadow-pop: 0 10px 30px rgb(0 0 0 / 50%);
  /* The blur behind every popup (see "Popup backdrop" below). */
  --blur-backdrop: 6px;
  /* Exo 2 everywhere except the topbar title, which uses Orbitron directly.
     --serif is kept only so existing rules don't need renaming; it now
     points at the same sans stack. */
  --sans: 'Exo 2', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
:root { font-size: 16px; }

/* Neon (classic): the original palette. Its buttons are solid cyan. */
:root, [data-theme="classic"] {
  --bg: #06070d;
  --chrome-bg: #050609;
  --panel: #12171f;
  --panel2: #171f2b;
  --panel3: #202a38;
  --border: rgba(0, 229, 255, 0.18);
  --border-strong: rgba(0, 229, 255, 0.34);
  --text: #edf2f6;
  --muted: #b3c1cd;
  --accent: #00e5ff;
  --accent-hi: #6df1ff;
  --accent-soft: rgba(0, 229, 255, 0.12);
  --accent-rgb: 0, 229, 255;
  --on-accent: #06070d;
  --glow2-rgb: 255, 46, 136;
  --winner-rgb: 255, 46, 136;
  --winner: rgb(var(--winner-rgb));
  --on-winner: #fff;
  --on-glow2: #fff;
  --brand: #2ecc71;
  --brand-rgb: 46, 204, 113;
  --btn-fill: #00e5ff;
  --btn-fill-hover: #6df1ff;
  --btn-edge: #00e5ff;
  --btn-text: #06070d;
  --btn-danger: #ef4444;
  --btn-danger-hover: #f87171;
  --btn-danger-edge: #ef4444;
  --btn-danger-text: #06070d;
  --danger: #ef4444;
  --danger-soft: #33120f;
  --danger-border: #7a2320;
  --good: #93c9aa;
  --good-soft: #1e2b23;
  --good-rgb: 147, 201, 170;
  --live: #2ecc71;
  --live-rgb: 46, 204, 113;
  --warn: #e6b271;
  --warn-soft: #2b2317;
  --part: #f4d35e;
  --part-soft: #2e280f;
  --bad-text: #ff8a80;
  --chip-fg: #ffc24d;
  --chip-bg: rgba(255, 194, 77, 0.13);
  --cell-empty: #192230;
  --chrome-fg: #b3c1cd;
  --chrome-dim: #8b9aa8;
  --on-chrome: #f4f7fa;
  --nc-mix: 100%;
}

/* The five other themes share these. Their buttons are opaque. */
[data-theme="cyan"], [data-theme="blue"], [data-theme="slate"], [data-theme="indigo"], [data-theme="emerald"] {
  --good: #7ee2ab;
  --good-soft: #12291f;
  --good-rgb: 126, 226, 171;
  --live: #7ee2ab;
  --live-rgb: 126, 226, 171;
  --part: #f6d365;
  --part-soft: #2d2710;
  --warn: #f6d365;
  --warn-soft: #2d2710;
  --danger: #e5575c;
  --danger-soft: #33161a;
  --danger-border: #7a2c31;
  --bad-text: #ff9b93;
  --btn-danger: #6b2329;
  --btn-danger-hover: #822b32;
  --btn-danger-edge: #e5575c;
  --btn-danger-text: #fff;
  --btn-text: #fff;
  --nc-mix: 62%;
}

/* Deep Cyan */
[data-theme="cyan"] {
  --bg: #070b14;
  --chrome-bg: #060912;
  --panel: #0f1726;
  --panel2: #172238;
  --panel3: #1e2c48;
  --cell-empty: #172238;
  --border: #22314b;
  --border-strong: #36496a;
  --text: #eaf1fb;
  --muted: #a9b8cf;
  --accent: #4cc9f0;
  --accent-hi: #84daf5;
  --accent-soft: rgba(76, 201, 240, 0.14);
  --accent-rgb: 76, 201, 240;
  --on-accent: #05080e;
  --on-glow2: #05080e;
  --glow2-rgb: 76, 201, 240;
  --winner-rgb: 76, 201, 240;
  --winner: rgb(var(--winner-rgb));
  --on-winner: #05080e;
  --brand: #4cc9f0;
  --brand-rgb: 76, 201, 240;
  --btn-fill: #14507a;
  --btn-fill-hover: #196499;
  --btn-edge: #4cc9f0;
  --chip-fg: #4cc9f0;
  --chip-bg: #172238;
  --chrome-fg: #a9b8cf;
  --chrome-dim: #8394ad;
  --on-chrome: #eaf1fb;
}

/* Stadium Blue */
[data-theme="blue"] {
  --bg: #080c18;
  --chrome-bg: #070a14;
  --panel: #10172a;
  --panel2: #19223b;
  --panel3: #202b4b;
  --cell-empty: #19223b;
  --border: #26324f;
  --border-strong: #3b4a70;
  --text: #edf1fb;
  --muted: #aeb9d3;
  --accent: #7cb0ff;
  --accent-hi: #b9d5ff;
  --accent-soft: rgba(124, 176, 255, 0.14);
  --accent-rgb: 124, 176, 255;
  --on-accent: #060811;
  --on-glow2: #060811;
  --glow2-rgb: 124, 176, 255;
  --winner-rgb: 124, 176, 255;
  --winner: rgb(var(--winner-rgb));
  --on-winner: #060811;
  --brand: #7cb0ff;
  --brand-rgb: 124, 176, 255;
  --btn-fill: #2457c5;
  --btn-fill-hover: #3368da;
  --btn-edge: #7cb0ff;
  --chip-fg: #7cb0ff;
  --chip-bg: #19223b;
  --chrome-fg: #aeb9d3;
  --chrome-dim: #8893b0;
  --on-chrome: #edf1fb;
}

/* Ice Slate */
[data-theme="slate"] {
  --bg: #0d1015;
  --chrome-bg: #0a0d11;
  --panel: #161b22;
  --panel2: #202731;
  --panel3: #29323f;
  --cell-empty: #202731;
  --border: #2c3541;
  --border-strong: #465260;
  --text: #eef2f6;
  --muted: #aab4c0;
  --accent: #a8d4ff;
  --accent-hi: #cce6ff;
  --accent-soft: rgba(168, 212, 255, 0.14);
  --accent-rgb: 168, 212, 255;
  --on-accent: #090b0f;
  --on-glow2: #090b0f;
  --glow2-rgb: 168, 212, 255;
  --winner-rgb: 168, 212, 255;
  --winner: rgb(var(--winner-rgb));
  --on-winner: #090b0f;
  --brand: #a8d4ff;
  --brand-rgb: 168, 212, 255;
  --btn-fill: #34506b;
  --btn-fill-hover: #406283;
  --btn-edge: #a8d4ff;
  --chip-fg: #a8d4ff;
  --chip-bg: #202731;
  --chrome-fg: #aab4c0;
  --chrome-dim: #8792a0;
  --on-chrome: #eef2f6;
}

/* Indigo Night */
[data-theme="indigo"] {
  --bg: #0b0a17;
  --chrome-bg: #090813;
  --panel: #151428;
  --panel2: #1f1e3a;
  --panel3: #272649;
  --cell-empty: #1f1e3a;
  --border: #302e55;
  --border-strong: #49467a;
  --text: #f0f0fa;
  --muted: #b6b5d3;
  --accent: #a9adff;
  --accent-hi: #ccceff;
  --accent-soft: rgba(169, 173, 255, 0.14);
  --accent-rgb: 169, 173, 255;
  --on-accent: #080710;
  --on-glow2: #080710;
  --glow2-rgb: 169, 173, 255;
  --winner-rgb: 169, 173, 255;
  --winner: rgb(var(--winner-rgb));
  --on-winner: #080710;
  --brand: #a9adff;
  --brand-rgb: 169, 173, 255;
  --btn-fill: #4142b4;
  --btn-fill-hover: #5757c2;
  --btn-edge: #a9adff;
  --chip-fg: #a9adff;
  --chip-bg: #1f1e3a;
  --chrome-fg: #b6b5d3;
  --chrome-dim: #9392b3;
  --on-chrome: #f0f0fa;
}

/* Emerald Field */
[data-theme="emerald"] {
  --bg: #06100e;
  --chrome-bg: #050d0b;
  --panel: #0e1a18;
  --panel2: #162624;
  --panel3: #1e3532;
  --cell-empty: #162624;
  --border: #223b36;
  --border-strong: #365850;
  --text: #ebf5f2;
  --muted: #a7bdb7;
  --accent: #3ddbb0;
  --accent-hi: #71e5c5;
  --accent-soft: rgba(61, 219, 176, 0.14);
  --accent-rgb: 61, 219, 176;
  --on-accent: #040b0a;
  --on-glow2: #040b0a;
  --glow2-rgb: 61, 219, 176;
  --winner-rgb: 61, 219, 176;
  --winner: rgb(var(--winner-rgb));
  --on-winner: #040b0a;
  --brand: #3ddbb0;
  --brand-rgb: 61, 219, 176;
  --btn-fill: #0f6b57;
  --btn-fill-hover: #127a60;
  --btn-edge: #3ddbb0;
  --chip-fg: #3ddbb0;
  --chip-bg: #162624;
  --chrome-fg: #a7bdb7;
  --chrome-dim: #82988f;
  --on-chrome: #ebf5f2;
}

* { box-sizing: border-box; }

/* The page draws under an iPhone's notch and home bar (viewport-fit=cover); the Home Screen app
   starts below the status bar (its "black" bar style). Whatever sits at an edge keeps clear of them with these;
   they are 0 everywhere else, and on browsers without env(). */
:root { --sat: 0px; --sar: 0px; --sab: 0px; --sal: 0px; }
@supports (padding: env(safe-area-inset-top, 0px)) {
  :root {
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
/* The window is the only scroller. When body scrolled too, an iPhone could be left part-way down
   the outer one with the top of the screen out of reach. (clip, unlike hidden, makes no scroller.) */
html { height: 100%; overflow-x: hidden; }
body { min-height: 100%; overflow-x: clip; }
/* Scrollbars wear the theme everywhere: the page and every overflow:auto box (lists, sheets,
   dialogs, side panes). scrollbar-color inherits, so this one rule covers them all, and each
   [data-theme] swaps the tokens. Chrome, Edge and Firefox use the standard properties (and then
   ignore the ::-webkit rules); Safari uses the ::-webkit rules. */
html { scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border: 3px solid transparent; border-radius: var(--r-sm); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
/* Same ambient glow the TV Grid View uses, now behind every screen — two
   soft, fixed radial blobs well below the content so they read as
   atmosphere, not a background image. */
body {
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(var(--accent-rgb), 0.08), transparent 60%),
    radial-gradient(ellipse 900px 600px at 100% 110%, rgba(var(--glow2-rgb), 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: var(--sal);
  padding-right: var(--sar);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  border-top: var(--sat) solid transparent; /* the bar's own color runs up under a notch or status bar, where the page draws under one */
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--chrome-bg);
  color: var(--on-chrome);
  border-bottom: 1px solid var(--glass-line);
  flex-wrap: wrap;
  gap: 10px;
}

.topbar h1 {
  margin: 0;
  font-family: 'Orbitron', var(--serif);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--on-chrome);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon { color: var(--accent); flex-shrink: 0; }
/* Home: the same size and place (20 px in, top left) on every screen that has it. */
.topbar .home-btn { width: 44px; height: 44px; flex: none; }
/* The house is drawn larger than its 20 px default so it weighs the same as the menu's three bars;
   the 44 px button, and so the bar, stays the same size. */
.topbar .home-btn svg { width: 26px; height: 26px; flex: none; }
/* The house breathes: a slow swell and an accent glow, on the brand pill's 2.4 s beat. */
.topbar .home-btn svg { animation: home-icon-pulse 2.4s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes home-icon-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(var(--accent-rgb), 0)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.85)); }
}
@media (prefers-reduced-motion: reduce) {
  .topbar .home-btn svg { animation: none; filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.6)); }
}
/* The page header (New game, Theme; Edit game's .eg-head matches): round Back at the left, the
   title beside it, a pill or actions at the right. */
.topbar.page-topbar { flex-wrap: nowrap; justify-content: flex-start; min-height: 64px; padding: 10px 14px; }
.topbar.page-topbar h1 { flex: 1; min-width: 0; font-family: var(--serif); font-size: var(--fs-xl); }
button.icon-btn.page-back { width: 44px; height: 44px; flex: none; border-radius: 50%; }
/* Where a tall title would center it lower, it stays up with the rest. */
.pick-topbar .home-btn { align-self: start; margin-top: 2px; }

.topbar h1.brand-pill {
  padding: 8px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--brand);
  background: var(--chrome-bg);
  animation: brand-pill-glow 2.4s ease-in-out infinite;
}
@keyframes brand-pill-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(var(--brand-rgb), 0); }
  50% { box-shadow: 0 0 14px rgba(var(--brand-rgb), 0.55); }
}

.vs-sep { color: var(--muted); font-weight: 600; text-transform: lowercase; }
.header-year { color: var(--muted); font-weight: 500; }

.gameday-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar .nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main {
  flex: 1;
  padding: 28px 28px 60px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

h2 { margin-top: 0; font-family: var(--serif); font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-family: var(--serif); font-size: var(--fs-lg); color: var(--text); font-weight: 600; letter-spacing: -0.005em; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 20px;
}
.card h3:first-child { margin-top: 0; }

/* The setup form is one narrow column: centered, not stretched across a laptop. */
.main > .card:has(#league-group) { max-width: 720px; margin-left: auto; margin-right: auto; }

.archive-wrap { margin-top: 4px; }
.archive-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.archive-toggle:hover { color: var(--text); }
.archive-arrow { display: inline-block; transition: transform 0.15s ease; }
.archive-toggle.open .archive-arrow { transform: rotate(90deg); }
/* Shared style for every delete/remove action in the app — muted and
   outlined by default so it doesn't compete for attention next to the
   solid --accent buttons, only turning red to confirm its intent once the
   host is actually about to use it. */
button.ghost.btn-delete {
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--radius);
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel);
}
button.ghost.btn-delete:hover, button.ghost.btn-delete:focus-visible {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}
.status-setup { background: var(--warn-soft); color: var(--warn); }
.status-started { background: var(--danger-soft); color: var(--danger); animation: status-glow 2.4s ease-in-out infinite; }
.status-finished { background: var(--good-soft); color: var(--good); }
/* Locked-but-not-kicked-off-yet: same pill/glow treatment as "In Progress",
   swapped to amber so the room can tell "grid is set" apart from "game is
   actually live" at a glance. */
.status-kickoff-pending { background: var(--warn-soft); color: var(--warn); animation: status-glow 2.4s ease-in-out infinite; }
@keyframes status-glow {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  50% { box-shadow: 0 0 10px 1px currentColor; }
}

button, .btn {
  font: inherit;
  background: var(--btn-fill);
  color: var(--btn-text);
  border: 1px solid var(--btn-edge);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
  letter-spacing: 0.1px;
}
button:hover, .btn:hover { background: var(--btn-fill-hover); border-color: var(--accent); }
button:active, .btn:active { filter: brightness(0.97); }
button.secondary {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
}
button.secondary:hover { background: var(--panel3); border-color: var(--border-strong); }
button.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
button.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
/* The one close control for a dialog: an X pinned to its top-right corner (addCloseX in ui.js). */
.has-dialog-x { position: relative; }
.has-dialog-x > .dialog-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; }
.has-dialog-x > h3:first-child, .has-dialog-x > :first-child h3 { padding-right: 48px; }
button.danger { background: var(--btn-danger); border-color: var(--btn-danger-edge); color: var(--btn-danger-text); }
button.danger:hover { background: var(--btn-danger-hover); border-color: var(--danger); }
/* The claim-squares action stays visually distinct from ordinary confirm
   buttons and the red lock/remove actions — an outlined "good" accent rather
   than a glow, to match the document-like restraint of the rest of the UI. */
button.pick {
  background: var(--good-soft);
  color: var(--good);
  border: 1px solid var(--good);
}
button.pick:hover { background: rgba(var(--good-rgb), 0.35); color: var(--btn-text); }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.small { padding: 7px 12px; font-size: var(--fs-sm); border-radius: var(--radius); }
button.full-width { width: 100%; text-align: center; }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

label { display: block; margin: 14px 0 6px; font-weight: 500; color: var(--muted); font-size: var(--fs-sm); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: var(--fs-md);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
/* iOS Safari gives a native date input an intrinsic width that ignores width: 100%, so it ran
   past the edge of the panel on an iPhone. Dropping the native look lets it fit; the value is
   pinned left and the box keeps a text field's height when empty. */
input[type=date], input[type=datetime-local] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
  box-sizing: border-box; min-height: calc(1.2em + 24px);
}
input[type=date]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; }
input.code-input { font-size: var(--fs-xl); letter-spacing: 0.08em; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

input[type=color] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.checkbox-label input[type=checkbox] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Above the button that finishes a sign-in: the next-season box and the Terms notice. */
.signin-consent { margin-top: 14px; }
.signin-consent .checkbox-label { min-height: 44px; margin: 0; font-weight: 600; }
.signin-consent .checkbox-label input { flex: none; margin: 0; }
.signin-consent .signin-terms { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.signin-consent .signin-terms a { color: var(--text); text-decoration: underline; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }

.radio-group, .toggle-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.radio-group.centered { justify-content: center; }
.pill {
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.pill:hover { border-color: var(--accent); }
.pill.active {
  background: var(--btn-fill);
  color: var(--btn-text);
  border-color: var(--accent);
}

.pct-row { display: flex; gap: 10px; align-items: center; }
.pct-total {
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius);
  margin-top: 10px;
  display: inline-block;
}
.pct-total.ok { background: var(--good-soft); color: var(--good); }
.pct-total.bad { background: var(--danger-soft); color: var(--danger); }

.error-msg {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-weight: 600;
}

.actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* --- Step 2: Picking --- */
.pot-edited-tag { color: var(--accent-hi); font-size: var(--fs-2xs); font-weight: 600; }

.pick-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
/* Game day: the board comes first in the page, so it leads when the columns stack (900 px and
   under), but the score panel sits on the left beside it, as it does on wide screens. This must be
   a class, not an inline style — an inline style outranks the breakpoint below and pushed the
   score inputs off-screen on an iPad in portrait. */
.pick-layout.board-first {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}
.pick-layout.board-first > .gd-results { order: -1; }
/* Beside the panel (901–1023 px) the board column is too narrow for 58 px squares: let them
   shrink to fit, and stay square, rather than cut off the last columns. */
.main:not(.gd-phone) > .pick-layout.board-first:not(.gd-wide) .board-table { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.main:not(.gd-phone) > .pick-layout.board-first:not(.gd-wide) .cell { min-height: 0; aspect-ratio: 1; min-width: 0; overflow: hidden; }
@media (max-width: 900px) {
  .pick-layout,
  .pick-layout.board-first { grid-template-columns: minmax(0, 1fr); }
  .pick-layout.board-first > .gd-results { order: 0; }
}

.cell[role=button] { cursor: pointer; }
.cell[role=button]:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 1; }
.cell.empty-pick[role=button] { min-width: 44px; min-height: 44px; }
.paste-card textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-md);
  resize: vertical;
}
.paste-card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.paste-status, .paste-msg { margin-top: 8px; font-size: var(--fs-sm); min-height: 1.2em; }
.paste-ok { color: var(--muted); }
.paste-bad { color: var(--danger); }
.paste-msg { color: var(--accent-hi); font-weight: 600; }
.fill-player { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.fill-player:last-child { border-bottom: none; }
.fill-player-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
button.fill-player-info {
  flex: 1; min-width: 0; min-height: 44px; padding: 0; text-align: left;
  background: transparent; border: 0; box-shadow: none; color: var(--text); font-weight: 400;
}
button.fill-player-info:hover .player-name { color: var(--accent-hi); }
.fill-player-info .player-name { display: block; overflow-wrap: anywhere; font-size: var(--fs-md); font-weight: 600; }
.fill-player-info .player-sub { display: block; font-size: var(--fs-xs); }
.fill-player-info.is-part .player-sub { color: var(--part); }
.players-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.players-head h3 { margin: 0; }
.players-n { color: var(--muted); font-size: var(--fs-sm); }
.players-empty { color: var(--muted); font-size: var(--fs-md); line-height: 1.45; margin: 16px 0; }
/* All / Owes money (playersCard). Owes money wears the Still owed color. */
.pc-filter { display: flex; gap: 3px; padding: 3px; margin-bottom: 10px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); }
.pc-filter button { flex: 1; min-height: 36px; padding: 4px 8px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: var(--fs-md); font-weight: 700; }
.pc-filter button b { display: inline-block; min-width: 22px; margin-left: 6px; padding: 0 7px; border-radius: var(--r-pill); background: rgba(255,255,255,0.12); font-size: var(--fs-xs); line-height: 20px; }
.pc-filter button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.pc-filter button[data-f="owes"][aria-pressed="true"] { background: var(--warn); color: var(--warn-soft); }
.pc-filter button[aria-pressed="true"] b { background: rgba(0,0,0,0.18); }
.pc-filter button:not([aria-pressed="true"]):hover { color: var(--text); }
.fill-player-due { flex: none; min-width: 44px; text-align: right; font-size: var(--fs-md); font-weight: 700; color: var(--warn); font-variant-numeric: tabular-nums; }
.players-owefoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px 2px; color: var(--muted); font-size: var(--fs-sm); }
.players-owefoot b { color: var(--warn); }
.players-allpaid { padding: 28px 8px; text-align: center; color: var(--muted); font-size: var(--fs-md); }
.players-allpaid b { display: block; margin-bottom: 4px; color: var(--good); font-size: var(--fs-lg); }
button.link-btn { min-height: 0; padding: 2px 4px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: inherit; }
button.link-btn:hover { text-decoration: underline; }
.money-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.money-box { display: flex; flex-direction: column; padding: 8px 12px; border-radius: var(--r-md); background: var(--panel2); }
.money-box .lbl, .board-stat .lbl { font-size: var(--fs-xs); color: var(--muted); }
.money-box .val, .board-stat .val { font-size: var(--fs-xl); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.money-box .val.is-good { color: var(--good); }
.money-box .val.is-owed, .board-stat .val.is-owed { color: var(--warn); }
.players-foot { margin-top: 12px; }
.players-foot button { width: 100%; min-height: 44px; }
button.paid-pill { min-width: 86px; min-height: 44px; border-radius: var(--r-pill); padding: 6px 8px; font-size: var(--fs-sm); flex-shrink: 0; }
button.paid-pill.is-paid { background: var(--good-soft); color: var(--good); border-color: var(--good); }
button.paid-pill.is-part { background: var(--part-soft); color: var(--part); border-color: var(--part); }
button.paid-pill.is-unpaid { background: var(--danger-soft); color: var(--bad-text); border-color: var(--danger); }
button.paid-pill:hover { filter: brightness(1.2); }

.manual-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-hi);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Board grid (shared step2 preview + step3) --- */
.board-wrap {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.board-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}
.board-inner {
  display: inline-block;
  min-width: 100%;
}
/* Both axis labels are now colored badges (see .team-badge) — the team's own
   color is the badge's background rather than text color, so a dark brand
   color like navy or purple never becomes unreadable on this dark theme. */
.teamB-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: var(--fs-xl);
  letter-spacing: 1px;
}
.teamA-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: var(--radius);
}
.teamA-label .team-logo { flex-shrink: 0; transform: rotate(-90deg); }
.teamA-label-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 800;
  font-size: var(--fs-xl);
  text-align: center;
  letter-spacing: 1px;
}
/* A light backdrop behind each team's logo so it reads against any badge
   color, since logos aren't guaranteed to have their own contrast. */
.teamA-label .team-logo, .teamB-label .team-logo {
  background: color-mix(in srgb, var(--plate) 85%, transparent);
  border-radius: var(--r-sm);
  padding: 3px;
}

/* The one consistent way a team name appears anywhere in the app: a pill in
   the team's own color with a logo and an auto-picked readable text color
   (computed in ui.js) — see teamBadge(). Background/text color come from
   inline style per instance since they vary per team, not per class. */
.team-badge {
  /* An outlined pill (decision 029): no fill, a 2 px ring in the team color (--outline, ui.js
     teamOutline) and the name in white. The ring is drawn from the middle of the logo rightward, so
     its left end is hidden behind the logo and nothing stands outside the pill to be clipped. --d is
     the logo's disc, sized by the caller and never smaller than the name needs. */
  --d: max(var(--disc, 26px), 1.6em);
  position: relative;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--d);
  gap: max(8px, 0.53em);
  padding: 0 max(8px, 0.53em) 0 0;
  border-radius: var(--r-pill);
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.team-badge::before {
  content: '';
  position: absolute;
  inset: 0 0 0 calc(var(--d) / 2);
  border: 2px solid var(--outline, var(--muted));
  border-left: 0;
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  pointer-events: none;
}
/* No logo shown: the ring closes around the whole pill. */
.team-badge.mode-nologo::before { left: 0; border-left: 2px solid var(--outline, var(--muted)); border-radius: var(--r-pill); }
.team-badge .team-logo {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  box-sizing: border-box;
  width: var(--d);
  height: var(--d);
  margin: 0;
  padding: calc(var(--d) * 0.07);
  border-radius: 50%;
  background: #f1f4f6;
}
/* Most team fonts come in one weight. Without this the browser fakes the badge's bold by smearing
   the letters, which reads as blurry; a font that has a real bold still uses it. --caps centers
   the capitals (ui.js TEAM_CAPS). */
.team-badge-name { position: relative; z-index: 1; top: var(--caps, 0); white-space: nowrap; font-synthesis: none; }
.team-badge-sm { font-size: var(--fs-xs); }
.team-badge.mode-nologo, .mirror-header .live-center .team-badge { padding-left: max(8px, 0.53em); }
@media (max-width: 480px) {
  .team-badge-sm { gap: 6px; padding-right: 6px; }
  .team-badge-sm.mode-nologo, .mirror-header .live-center .team-badge-sm { padding-left: 6px; }
}

/* Space-driven fallback: fitTeamBadges() (ui.js) measures each .badge-fit
   container and adds mode-abbr / mode-nologo to its badges when the full
   name (or the abbreviation) doesn't fit. min-width:0 lets a flex-item
   container (e.g. the topbar h1) actually shrink below its nowrap content's
   natural width instead of just overflowing unnoticed; overflow:hidden makes
   that shrinkage — and therefore the mismatch fitTeamBadges checks for —
   visible to scrollWidth/clientWidth. Both are no-ops on non-flex-item
   containers that already size correctly. */
.badge-fit { min-width: 0; overflow: hidden; }
.brand-dollar { color: var(--brand); }
.team-badge .badge-abbr { display: none; }
.team-badge.mode-abbr .badge-full { display: none; }
.team-badge.mode-abbr .badge-abbr { display: inline; }
.team-badge.mode-nologo .team-logo { display: none; }
/* 2x2 grid: teamB's bar over the numbered columns (top-right), teamA's bar
   beside the numbered rows (bottom-left) starting flush with the top of the
   grid's own corner cell rather than stretched up alongside teamB's bar. The
   top-left cell is intentionally empty. */
.board-grid-outer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}
.teamB-label { grid-column: 2; grid-row: 1; }
.teamA-label { grid-column: 1; grid-row: 2; }
.board-grid-outer .board-scroll { grid-column: 2; grid-row: 2; }
/* Live score banner, fed by the server's ESPN poll or, in Simulation Mode, a
   locally-invented game (see server-livescore.js). Sits above the grid on
   both the board screen and the TV view — the same markup renders at
   whatever size its container calls for. */
.live-score-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 14px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 700;
}
/* Pinned to the far left; .live-center takes the rest of the bar's width and
   centers the score within it. */
.live-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.live-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bad, #e5484d);
  flex-shrink: 0;
  animation: live-pulse 3.2s ease-in-out infinite;
}
.live-label {
  color: var(--bad, #e5484d);
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 1px;
  animation: live-pulse 3.2s ease-in-out infinite;
}
/* Simulation Mode uses the warn color throughout so it never reads as a real
   score feed at a glance. */
.live-score-bar.simulation .live-dot { background: var(--warn); }
.live-score-bar.simulation .live-label { color: var(--warn); }
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.live-score-digits { font-size: var(--fs-lg); font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; }
/* On a phone the flag and the "updated" note take their own lines, so the score has room. */
@media (max-width: 480px) {
  .gd-phone .live-score-bar { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .gd-phone .live-center { flex: 1 0 100%; flex-wrap: wrap; gap: 4px 8px; }
  .gd-phone .live-center .badge-full { display: none; }
  .gd-phone .live-center .badge-abbr { display: inline; }
  .gd-phone .live-updated { flex: 1 0 100%; text-align: center; }
}
/* The TV header shows the live bar in place of the old "Total Pot" line, so
   it should read as plain header text rather than a floating card; the same
   bar above the grid is now redundant there, so it's hidden. */
.tv-header .live-score-bar {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 0;
  font-size: var(--fs-xl);
}
body.tv-fullscreen .tv-header .live-score-bar { font-size: var(--fs-2xl); }
.tv-header .live-score-digits { font-size: 1.15em; }
.tv-header .live-period { font-size: 0.75em; }
.tv-board-wrap > .live-score-bar { display: none; }
.live-period { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.tv-board-wrap .live-score-bar { font-size: clamp(1rem, 1.6vw, 1.6rem); padding: 10px 18px; }
.tv-board-wrap .live-score-digits { font-size: 1.3em; }

.board-table {
  display: grid;
  grid-template-columns: repeat(11, minmax(58px, 1fr));
  gap: 1px;
  background: var(--border);
  padding: 1px;
  border-radius: var(--radius);
}
.cell {
  background: var(--panel);
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
  padding: 2px;
  position: relative;
  overflow: hidden;
  word-break: break-word;
  transition: background 0.12s ease, transform 0.08s ease;
}
.cell.head {
  background: var(--chrome-bg);
  color: var(--chrome-fg);
  font-size: var(--fs-lg);
  font-weight: 800;
}
.cell.head.corner { background: transparent; }
.cell.head.x, .cell.head.y { color: var(--accent); }
/* Placeholder dash shown before axis numbers are assigned — plain white,
   no color/shadow treatment, so it doesn't read as an actual drawn number. */
.cell.head.pending { color: var(--text-strong); text-shadow: none; }
/* Animated number draw (R46): axis cells hold "?" until their digit lands; the title floats over
   the grid and never changes the layout. */
.board-grid-outer { position: relative; }
.cell.head.drawing { color: var(--muted); opacity: 0.7; }
.cell.head.landed { animation: draw-land 0.35s ease-out; }
@keyframes draw-land { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.draw-title {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 5;
  padding: 0.3rem 0.9rem; border-radius: var(--r-pill); pointer-events: none; white-space: nowrap;
  background: var(--panel); color: var(--accent); border: 1px solid var(--accent);
  font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow-pop);
}
.tv-screen .draw-title, .glass-board .draw-title { font-size: clamp(1rem, 1.6vw, 1.8rem); }
@media (prefers-reduced-motion: reduce) { .cell.head.landed { animation: none; } }
.cell.filled { background: var(--panel2); color: var(--text); cursor: default; }
.cell.empty-pick { cursor: pointer; color: var(--muted); transition: box-shadow 0.12s ease, background 0.12s ease; }
.cell.empty-pick:hover { box-shadow: inset 0 0 0 2px var(--pick-color, var(--accent2)), 0 0 8px var(--pick-color, var(--accent2)); }
.cell.selected, .cell.empty-pick.selected:hover { background: var(--pick-color, var(--accent2)); color: var(--on-accent); box-shadow: none; }
.cell.pushed { background: rgba(51, 18, 15, 0.75); color: var(--danger); }
/* Certificate frame: a yellow rule, a sliver of the cell's own background, then a soft
   band — reads as "this square was awarded something" without covering a corner or
   animating. --fill is the square's own background where a board tints it. */
.cell.winner {
  color: var(--text);
  box-shadow:
    inset 0 0 0 2px var(--q-win),
    inset 0 0 0 4px var(--fill, var(--panel2)),
    inset 0 0 0 6px rgba(var(--q-win-rgb), 0.5);
}
.cell .badges {
  position: absolute;
  top: 2px;
  right: 3px;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cell .badge {
  font-size: var(--fs-3xs);
  background: rgba(0,0,0,0.55);
  color: var(--text-strong);
  padding: 1px 4px;
  border-radius: var(--r-xs);
  font-weight: 800;
}
/* Winning-quarter badges pick up the frame's color rather than the default
   black pill, tying the corner label back to the border around the cell. */
.cell.winner .badge { background: var(--q-win); color: var(--on-q-win); }
/* Phone-width quarter corners (shown under 480 px, below): Q1 top-left, Q2 top-right,
   Q3 bottom-left, Final bottom-right, 10 px each. A pushed quarter's corner is red. */
.cell .qcorners { display: none; }
.qc { position: absolute; width: 0; height: 0; --qc: var(--q-win); }
.qc.is-push { --qc: var(--danger); }
.qc.q1 { top: var(--qc-o, 0); left: var(--qc-o, 0); border-top: var(--qc-l, 10px) solid var(--qc); border-right: var(--qc-l, 10px) solid transparent; }
.qc.q2 { top: var(--qc-o, 0); right: var(--qc-o, 0); border-top: var(--qc-l, 10px) solid var(--qc); border-left: var(--qc-l, 10px) solid transparent; }
.qc.q3 { bottom: var(--qc-o, 0); left: var(--qc-o, 0); border-bottom: var(--qc-l, 10px) solid var(--qc); border-right: var(--qc-l, 10px) solid transparent; }
.qc.q4 { bottom: var(--qc-o, 0); right: var(--qc-o, 0); border-bottom: var(--qc-l, 10px) solid var(--qc); border-left: var(--qc-l, 10px) solid transparent; }
/* Not paid: corners shrink to 9 px and sit inside the dashed red ring. */
.cell.is-unpaid .qcorners { --qc-l: 9px; --qc-o: 3px; }
.cell .name-txt { padding-top: 8px; font-size: var(--fs-xs); line-height: 1.1; font-weight: 400; }
/* A player's color arrives as --nc. In every theme but Neon it is softened toward the text color
   (--nc-mix) so a saturated color doesn't fight the theme. With no --nc the name just inherits. */
.name-txt { color: var(--nc, inherit); }
.fill-player-dot { background: var(--nc, transparent); }
@supports (color: color-mix(in srgb, red, blue)) {
  .name-txt { color: color-mix(in srgb, var(--nc) var(--nc-mix), var(--text)); }
  .fill-player-dot { background: color-mix(in srgb, var(--nc) var(--nc-mix), var(--text)); }
}

/* Unpaid squares: a dashed ring in the theme's red plus a small $ tag, so they differ
   from a winner by shape as well as color. Won and not paid: the red stays at the edge
   and the yellow frame steps inside it. */
.cell.is-unpaid { outline: 2px dashed var(--unpaid); outline-offset: -2px; }
.cell.is-unpaid::before {
  content: '$'; content: '$' / '';
  position: absolute; left: 3px; bottom: 3px;
  padding: 2px 4px; border-radius: var(--r-xs);
  background: var(--unpaid); color: #fff;
  font-size: var(--fs-3xs); font-weight: 800; line-height: 1;
  pointer-events: none;
}
.cell.is-unpaid.winner {
  box-shadow:
    inset 0 0 0 3px var(--fill, var(--panel2)),
    inset 0 0 0 5px var(--q-win),
    inset 0 0 0 7px var(--fill, var(--panel2)),
    inset 0 0 0 8px rgba(var(--q-win-rgb), 0.5);
}

/* TV-only "where the game is heading" overlay (see compute.js
   computeLiveHighlight): a radar-ping ring on a pseudo-element, so it never
   fights the .winner cell's own inset winner frame or badges for the
   box-shadow/innerHTML a cell already has from an earlier quarter. Needs
   overflow visible + a raised z-index so the ping can bloom past the cell's
   own edge instead of being clipped by it. */
.cell.live-winner,
.cell.live-near {
  overflow: visible;
  z-index: 2;
}
.cell.live-winner::after,
.cell.live-near::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-xs);
  pointer-events: none;
}
.cell.live-winner::after { animation: tv-live-ping-winner 2.4s ease-out infinite; }
.cell.live-near::after { animation: tv-live-ping-near 3.2s ease-out infinite; }
.cell.live-winner .name-txt { animation: tv-live-winner-font 2.4s ease-in-out infinite; }

/* The square leading right now pulses in the theme's accent: never red (not paid) or
   yellow (already won). */
@keyframes tv-live-ping-winner {
  0% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 0 rgba(var(--accent-rgb), 0.55); }
  70% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 10px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 10px rgba(var(--accent-rgb), 0); }
}
@keyframes tv-live-ping-near {
  0% { box-shadow: inset 0 0 0 1px rgba(141, 189, 232, 0.55), 0 0 0 0 rgba(141, 189, 232, 0.4); }
  70% { box-shadow: inset 0 0 0 1px rgba(141, 189, 232, 0.55), 0 0 0 7px rgba(141, 189, 232, 0); }
  100% { box-shadow: inset 0 0 0 1px rgba(141, 189, 232, 0.55), 0 0 0 7px rgba(141, 189, 232, 0); }
}
/* The team without the ball (ESPN possession): its near squares ping fainter and slower. */
.cell.live-dim::after { animation: tv-live-ping-dim 4.2s ease-out infinite; }
@keyframes tv-live-ping-dim {
  0% { box-shadow: inset 0 0 0 1px rgba(141, 189, 232, 0.22), 0 0 0 0 rgba(141, 189, 232, 0.16); }
  70% { box-shadow: inset 0 0 0 1px rgba(141, 189, 232, 0.22), 0 0 0 5px rgba(141, 189, 232, 0); }
  100% { box-shadow: inset 0 0 0 1px rgba(141, 189, 232, 0.22), 0 0 0 5px rgba(141, 189, 232, 0); }
}
@keyframes tv-live-winner-font {
  0%, 100% { font-size: 0.78rem; }
  45% { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cell.live-winner::after,
  .cell.live-near::after,
  .cell.live-winner .name-txt {
    animation: none;
  }
}

.board-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.board-legend .legend-chip {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: var(--r-xs);
  background: var(--panel2);
  border: 2px dashed var(--unpaid);
  box-sizing: border-box;
}
/* The full board's key (SBS.board.legend): one entry per mark, wrapping on narrow screens. */
.board-legend:has(.lg) { flex-wrap: wrap; gap: 6px 16px; }
.board-legend .lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.board-legend .legend-chip.is-won { border: 2px solid var(--q-win); }
.board-legend .legend-chip.is-corner { position: relative; overflow: hidden; border: 1px solid var(--border); }
.board-legend .legend-chip.is-corner::before { content: ''; position: absolute; width: 0; height: 0; --qc: var(--q-win); }
.board-legend .legend-chip.is-push::before { --qc: var(--danger); }
.board-legend .legend-chip.c1::before { top: 0; left: 0; border-top: 8px solid var(--qc); border-right: 8px solid transparent; }
.board-legend .legend-chip.c2::before { top: 0; right: 0; border-top: 8px solid var(--qc); border-left: 8px solid transparent; }
.board-legend .legend-chip.c3::before { bottom: 0; left: 0; border-bottom: 8px solid var(--qc); border-right: 8px solid transparent; }
.board-legend .legend-chip.c4::before { bottom: 0; right: 0; border-bottom: 8px solid var(--qc); border-left: 8px solid transparent; }
/* Corners are drawn only on the phone-width Game Day grid (below), so their key shows only there. */
.board-legend .lg-corner { display: none; }

/* Payout tracking (R21): host-only, never on the TV or player views. */
.who-to-pay { margin-top: 16px; }
.who-to-pay[hidden] { display: none; }
.who-to-pay h3 { margin: 0 0 4px; }
.who-head { margin: 0 0 8px; font-weight: 700; }
.who-settle { color: var(--warn); margin-left: 6px; }
.who-list { list-style: none; margin: 0; padding: 0; }
.who-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.who-list li.done { color: var(--muted); }
.who-name { overflow-wrap: anywhere; min-width: 0; }
.who-amt { white-space: nowrap; font-weight: 700; }
.who-note { color: var(--muted); font-size: var(--fs-sm); margin: 8px 0 0; }

.legend-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  font-weight: 700;
}
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.footer-note {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 30px;
  text-align: center;
}

.footer-links { margin-top: 0; }
.footer-links a { display: inline-block; min-width: 44px; line-height: 44px; color: var(--muted); }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--accent); }

.hidden { display: none !important; }

.games-picker-msg { color: var(--muted); font-size: var(--fs-sm); margin: 10px 0 0; }

@media (min-width: 1400px) {
  .cell { min-height: 78px; font-size: var(--fs-md); }
  .cell .name-txt { font-size: var(--fs-sm); }
}

/* --- Team logos / color preview --- */
.team-logo {
  width: var(--logo-size, 28px);
  height: var(--logo-size, 28px);
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}
.legend-team { display: inline-flex; align-items: center; gap: 6px; }
.team-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 26px;
}
.team-preview .swatch {
  width: 18px;
  height: 18px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  display: inline-block;
}
.team-preview .match-txt { font-size: var(--fs-sm); font-weight: 600; color: var(--good); }
.team-preview .match-txt.muted { color: var(--muted); font-weight: 500; }

/* --- TV / Grid-Only View (optimized for 1080p) ---
   Drops to --chrome-bg rather than the page's --bg — a shade darker still,
   for a television read from across the room under living-room glare. */
.tv-screen {
  --bg: var(--chrome-bg);
  position: fixed;
  inset: 0;
  background: var(--bg);
  border: 0 solid transparent;
  border-width: var(--sat) var(--sar) var(--sab) var(--sal);
  color: var(--text);
  display: flex;
  flex-direction: column;
  padding: 18px 28px 22px;
  overflow: hidden;
}
.tv-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.tv-meta {
  display: flex;
  justify-content: center;
  gap: 22px;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--accent);
}
.tv-picking-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}
.tv-picking-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 22px;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}
.tv-picking-val {
  color: var(--good);
}
.tv-picking-val-warn {
  color: var(--danger);
}
.tv-picking-pill {
  padding: 10px 28px;
  border-radius: var(--r-pill);
  border: 1px solid var(--brand);
  background: var(--chrome-bg);
  animation: brand-pill-glow 2.4s ease-in-out infinite;
}
.tv-kickoff-countdown {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 8px 26px;
  border-radius: var(--r-pill);
  border: 1px solid var(--accent);
  background: var(--chrome-bg);
  align-self: center;
}
.tv-kickoff-label {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tv-kickoff-clock {
  font-size: var(--fs-2xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
body.tv-fullscreen .tv-kickoff-clock { font-size: var(--fs-3xl); }
/* R43: one line, so the board gives up as little height as it can. */
.tv-change-line {
  flex: 0 0 auto;
  align-self: center;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 8px 26px;
  border-radius: var(--r-pill);
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-xl);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Controls have their own row above the header and quarter strip, so they never cover a chip,
   and fade out after a few idle seconds (the row keeps its room, so nothing jumps). Any tap or
   mouse move revives them. */
.tv-controls {
  order: -1;
  align-self: flex-end;
  flex: 0 0 auto;
  position: relative;
  margin: -10px -8px 8px 0;
  display: flex;
  gap: 10px;
  z-index: 10;
  transition: opacity 0.4s ease;
}
.tv-btn {
  opacity: 0.4;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  padding: 8px 14px;
}
.tv-btn:hover { opacity: 1; }
.tv-screen.chrome-hidden .tv-controls { opacity: 0; pointer-events: none; }
.tv-screen.chrome-hidden { cursor: none; }

/* Compact, read-only quarterly summary above the board — a single thin row
   (abbreviations + score + status, no logos, no inputs) so it costs the
   board almost no vertical space. */
.tv-quarters {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.tv-qchip {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px 10px 4px;
}
.tvq-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-2xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tvq-label { font-weight: 800; font-size: 1.6em; }
.tvq-amt { color: var(--accent); font-weight: 700; font-size: 1.6em; }
.tvq-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.5vw, 1.35rem);
  margin: 0;
}
.tvq-score .team-badge { font-size: 0.62em; }
.tvq-digits { white-space: nowrap; }
.tvq-status {
  font-size: var(--fs-2xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
/* Winner names are read across a room: 13 px at least, 16 px from 1024 px wide. */
.tv-screen .tvq-status { font-size: var(--fs-xs); }
@media (min-width: 1024px) { .tv-screen .tvq-status { font-size: var(--fs-md); } }
.tv-qchip.win .tvq-status { color: var(--good); font-weight: 700; }
.tv-qchip.push .tvq-status { color: var(--warn); font-weight: 700; white-space: normal; }
/* Phone portrait: the push note shows its short form ("Push → Q3") on one line. */
.tvq-short { display: none; }
@media (max-width: 479px) {
  .tv-screen .tvq-long { display: none; }
  .tv-screen .tvq-short { display: inline; white-space: nowrap; }
}
body.tv-fullscreen .tv-quarters { margin-bottom: 6px; }

/* --- EXPERIMENTAL: Neon glassmorphism theme for the TV Grid View's grid
   ONLY — header, live score bar, quarter strip, controls and background
   stay exactly as shipped. Scoped under .tv-screen (only ever rendered by
   the TV route) so nothing outside it is touched.
   R35: wide Game Day and wide picking wear the same grid. Their board card has .glass-board,
   so each rule that makes the look is grouped with it; the sizes are the screen's own (end of file). */
.tv-screen .board-grid-outer,
.glass-board .board-grid-outer {
  background: var(--glass-fill);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--r-xl);
  padding: 14px;
  box-shadow: 0 0 60px rgba(var(--accent-rgb), 0.12), 0 30px 70px rgba(0,0,0,0.5);
}
.tv-screen .board-table,
.glass-board .board-table { background: transparent; gap: 3px; padding: 0; }
.tv-screen .cell,
.glass-board .cell {
  background: var(--glass-fill);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-sm);
}
.tv-screen .cell.head,
.glass-board .cell.head {
  background: transparent;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}
.tv-screen .cell.head.pending,
.glass-board .cell.head.pending { color: #eaf6ff; text-shadow: none; }
.tv-screen .cell.filled,
.glass-board .cell.filled { background: var(--glass-fill); }
.tv-screen .cell.winner,
.glass-board .cell.winner {
  background: rgba(var(--q-win-rgb), 0.14);
  box-shadow: 0 0 0 1.5px var(--q-win), 0 0 18px rgba(var(--q-win-rgb), 0.55), inset 0 0 10px rgba(var(--q-win-rgb), 0.3);
  animation: tv-neon-winner-glow 2.2s ease-in-out infinite;
}
@keyframes tv-neon-winner-glow {
  0%, 100% { box-shadow: 0 0 0 1.5px var(--q-win), 0 0 18px rgba(var(--q-win-rgb), 0.55), inset 0 0 10px rgba(var(--q-win-rgb), 0.3); }
  50% { box-shadow: 0 0 0 1.5px var(--q-win), 0 0 30px rgba(var(--q-win-rgb), 0.9), inset 0 0 14px rgba(var(--q-win-rgb), 0.5); }
}
.tv-screen .cell.winner .badge,
.glass-board .cell.winner .badge { background: var(--q-win); color: var(--on-q-win); }
/* Team-color gradient fade (set inline by board.js's badgeStyle()) stays
   underneath — a light translucent dark wash (inset box-shadow, painted
   above the background but below the label's own text/logo) takes it down
   a notch, plus a neon edge glow layered on top. Kept light rather than a
   full 25% dim: an already-dark team color (e.g. navy) crushes to
   near-invisible against the dark TV background at a heavier dim. */
.tv-screen .teamA-label,
.tv-screen .teamB-label,
.glass-board .teamA-label,
.glass-board .teamB-label {
  box-shadow: inset 0 0 0 999px rgba(6,7,13,0.12), 0 0 16px rgba(var(--accent-rgb), 0.35);
}
/* Lighter weight than the app-wide default (800) — at that weight, white
   text over the neon-dimmed gradient was hard to make out. A soft dark
   shadow behind the letters keeps contrast up despite the lighter weight. */
.tv-screen .teamA-label-text,
.tv-screen .teamB-label,
.glass-board .teamA-label-text,
.glass-board .teamB-label {
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
/* Quarter-result pills (Q1/Q2/Q3/Final) — same over-bold complaint as the
   team labels above; lighten the label, amount, and score text together. */
.tv-screen .tvq-label,
.tv-screen .tvq-amt,
.tv-screen .tvq-score {
  font-weight: 500;
}
/* The team pill names inside those chips read blurry: .team-badge sets its
   own font-weight (700), which wins over the rule just above, and the pill
   was sized down (0.62em) to make room for a full team name shrinking to
   fit. Force the icon+abbreviation form instead (already in the markup,
   just hidden by default) and give it back some size/weight now that it
   doesn't need to shrink to fit a long name. */
.tv-screen .tvq-score .team-badge {
  font-weight: 500;
  font-size: 0.85em;
}
.tv-screen .tvq-score .badge-full { display: none; }
.tv-screen .tvq-score .badge-abbr { display: inline; }

/* Axis team panels (teamA's vertical bar along the rows, teamB's
   horizontal bar along the columns) 25% thinner: the shared board.js
   markup sizes both from padding + a 32px logo + the label text, none of
   which is reachable except through CSS here, so all three are scaled to
   75% together (logo needs !important — its size is an inline style set
   per-render by teamLogoTag()). teamA's *horizontal* padding is its
   thickness (the bar runs vertically); teamB's *vertical* padding is its
   thickness (the bar runs horizontally) — only that dimension is touched
   on each, so neither bar's length shrinks, only its depth. */
.tv-screen .teamA-label { padding: 14px 4.5px; }
.tv-screen .teamB-label { padding: 4.5px 14px; }
.tv-screen .teamA-label-text,
.tv-screen .teamB-label {
  font-size: var(--fs-md);
}
.tv-screen .teamA-label .team-logo,
.tv-screen .teamB-label .team-logo {
  --logo-size: 24px !important;
}
/* The TV board actually renders through .tv-board-wrap, whose own
   responsive rules (further down this file) size the label text/logo off
   viewport width and outrank the plain .tv-screen rules just above on
   specificity — so the 75% scaling has to be repeated here, against those
   exact selectors, or it's invisible in the real TV view. */
.tv-screen .tv-board-wrap .teamA-label-text,
.tv-screen .tv-board-wrap .teamB-label span {
  font-size: clamp(0.975rem, 1.95vw, 2.1rem);
}
.tv-screen .tv-board-wrap .team-logo {
  --logo-size: clamp(24px, 3.375vw, 48px) !important;
}

/* Score-change axis ripple — five staggered rings pulse on the axis
   number matching each team's new last-digit score (see bumpAxisCells()
   in screen-gameday.js), then remove themselves. Capped at the cell's
   own size rather than overshooting past its edge: each ring starts at
   full cell size, shrinks, grows back out to full cell size, then fades
   away at that size — the number itself never moves, only the ring
   breathing in place around it. */
.tv-screen .cell.head { position: relative; overflow: visible; }
.tv-screen .score-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--r-sm);
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  animation: tv-score-ripple 1.6s ease-in-out;
}
.tv-screen .score-ring.r2 { animation-delay: 0.6s; }
.tv-screen .score-ring.r3 { animation-delay: 1.2s; }
.tv-screen .score-ring.r4 { animation-delay: 1.8s; }
.tv-screen .score-ring.r5 { animation-delay: 2.4s; }
@keyframes tv-score-ripple {
  0% { transform: scale(1); opacity: 0.9; }
  40% { transform: scale(0.5); opacity: 0.9; }
  70% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0; }
}

/* Quarter-end celebration overlay — plays over the whole TV screen (board
   included) for a minute whenever a quarter resolves with a winner, however
   the score got there (live API poll, host typing, or phone entry). */
.tv-celebration {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}
.tv-celebration-piece {
  position: absolute;
  top: -6%;
  animation-name: tv-cel-money-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes tv-cel-money-fall {
  0% { transform: translate(0, 0) rotate(var(--rot)); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate(var(--drift), 115vh) rotate(calc(var(--rot) + var(--spin))); opacity: 0; }
}
.tv-celebration-card {
  position: relative;
  z-index: 2;
  text-align: center;
  background: rgba(7, 10, 13, 0.88);
  border: 1px solid #c3c6c8;
  border-radius: var(--r-xl);
  padding: 20px 44px 30px;
  animation: tv-cel-pop-in 0.5s ease-out;
}
@keyframes tv-cel-pop-in {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
.tv-celebration-trophy {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 125px;
  animation: tv-cel-trophy-bob 2.4s ease-in-out infinite;
}
.tv-celebration-trophy svg { width: 100%; height: 100%; }
@keyframes tv-cel-trophy-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.tv-celebration-sparkle {
  position: absolute;
  color: #f4f6f7;
  line-height: 1;
  text-shadow: 0 0 6px rgb(255 255 255 / 90%);
  animation-name: tv-cel-sparkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes tv-cel-sparkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(25deg); }
}
.tv-celebration-quarter {
  color: #c3c6c8;
  font-size: var(--fs-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}
.tv-celebration-name {
  color: var(--text);
  font-size: var(--fs-4xl);
  font-weight: 800;
  margin: 6px 0;
}
.tv-celebration-amount {
  color: var(--good);
  font-size: 1.8rem; /* off-scale: hero number */
  font-weight: 800;
}

/* TV-only notice while the Final score is in but its winning square is
   empty — stays up for as long as `needsDraw` is true and disappears the
   instant the host runs "Randomly Draw Winner" (which flips needsDraw false
   and hands off to the countdown/spin reveal below). Translucent so the grid
   stays visible underneath, unlike the reveal overlay. */
.tv-needsdraw-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 10, 0.72);
  pointer-events: none;
  padding: 20px;
}
.tv-needsdraw-card {
  text-align: center;
  background: rgba(10, 13, 16, 0.9);
  border: 1px solid rgba(var(--winner-rgb), 0.4);
  border-radius: var(--r-xl);
  padding: 26px 46px;
  animation: tv-cel-pop-in 0.5s ease-out;
  max-width: 560px;
}
.tv-needsdraw-icon { font-size: var(--fs-4xl); margin-bottom: 6px; }
.tv-needsdraw-title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 900;
  color: var(--winner);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.tv-needsdraw-body {
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  color: #d7dade;
}

/* "Randomly Draw Winner" reveal — a countdown then a two-wheel slot-machine
   spin, shown full-screen on whichever window(s) notice the draw (the board
   that triggered it, and/or the TV grid on its next poll). Opaque so nothing
   about the already-resolved winner underneath leaks through mid-sequence,
   and above every other overlay (including the TV celebration) since only
   one of these ever needs to be on screen at a time. */
.draw-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070a;
  padding: 20px;
}
.draw-reveal-card {
  text-align: center;
  color: #f4f6f7;
}
.draw-reveal-label {
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9aa0a6;
  margin-bottom: 10px;
}
.draw-countdown-num {
  font-size: clamp(7rem, 24vw, 15rem);
  font-weight: 900;
  line-height: 1;
  color: var(--winner);
  text-shadow: 0 0 50px rgba(var(--winner-rgb), 0.55);
  animation: draw-countdown-pop 1s ease-out;
}
@keyframes draw-countdown-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.draw-wheels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 36px);
  margin-top: 10px;
}
.draw-wheel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.draw-wheel-num {
  width: clamp(90px, 16vw, 170px);
  height: clamp(120px, 22vw, 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(4rem, 12vw, 8.5rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  border-radius: var(--r-lg);
  /* Tinted per-team via --wheel-primary/--wheel-secondary set inline on each
     reel (see playDrawReveal in screen-gameday.js) — the two team colors
     bracket the gradient so the reel reads as that team's the whole time
     it's spinning, with a dark band through the middle so digits stay legible. */
  background: linear-gradient(160deg, var(--wheel-secondary, #1a1d20), #0c0e10 55%, var(--wheel-secondary, #1a1d20));
  border: 4px solid var(--wheel-primary, #6b7076);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.5);
  color: #f4f6f7;
}
.draw-wheel-num.spinning { animation: draw-wheel-blur 0.12s linear infinite; filter: blur(1.5px); }
@keyframes draw-wheel-blur {
  0% { transform: translateY(-6px); }
  50% { transform: translateY(6px); }
  100% { transform: translateY(-6px); }
}
.draw-wheel-num.landed {
  animation: draw-wheel-land 0.4s ease-out;
  filter: none;
  border-color: var(--wheel-primary, var(--winner));
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.6), 0 0 6px var(--wheel-primary, var(--winner)), 0 0 30px var(--wheel-primary, var(--winner));
}
@keyframes draw-wheel-land {
  0% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.draw-wheel-sep { font-size: clamp(2rem, 6vw, 4rem); color: #6b7076; font-weight: 800; }
.draw-reveal-nums {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  color: var(--winner);
  margin: 8px 0;
}
.draw-reveal-name {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
  .draw-countdown-num { animation: none; }
  .draw-wheel-num.spinning { animation: none; filter: none; }
  .draw-wheel-num.landed { animation: none; }
}

/* Game-end summary — replaces the board entirely once the Final celebration
   card closes, and stays up (unlike the celebration) until the host exits
   the TV view. Sits one layer below the celebration z-index since the two
   never actually overlap in time. */
.tv-final-summary {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(14px, 3vw, 34px) clamp(14px, 4vw, 40px);
  overflow: hidden;
  background: radial-gradient(ellipse at 50% -10%, var(--panel) 0%, var(--bg) 60%);
  pointer-events: none;
}
.tvfs-head {
  flex: 0 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: clamp(6px, 1vw, 10px);
}
.tvfs-champion-trophy {
  position: relative;
  width: clamp(46px, 6vw, 64px);
  height: clamp(72px, 9.5vw, 98px);
  margin: 0 auto 6px;
  animation: tv-cel-trophy-bob 2.6s ease-in-out infinite;
}
.tvfs-champion-trophy svg { width: 100%; height: 100%; position: relative; }
.tvfs-eyebrow {
  font-size: clamp(0.65rem, 1.1vw, 0.78rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--winner);
  font-weight: 800;
  margin-bottom: 6px;
}
.tvfs-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}
.tvfs-score-digits {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text);
}
.tvfs-sub {
  color: var(--muted);
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
}
.tvfs-pot { color: var(--winner); font-weight: 700; }

.tvfs-board {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1vw, 10px);
  flex: 1 1 auto;
  justify-content: flex-start;
  margin-top: clamp(4px, 1vw, 12px);
  min-height: 0;
  overflow-y: auto;
}
/* Every row is the same fixed size no matter how many quarters a player
   won — a 1-quarter winner's row just carries more empty space than a
   4-quarter winner's, rather than the list looking uneven. */
.tvfs-row {
  display: grid;
  grid-template-columns: clamp(34px, 5vw, 46px) 1fr auto;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  min-height: clamp(64px, 9vw, 92px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0 clamp(12px, 2vw, 20px);
}
.tvfs-row.rank-1 {
  background: linear-gradient(135deg, rgba(var(--winner-rgb), 0.16), var(--panel) 55%);
  border-color: rgba(var(--winner-rgb), 0.55);
  box-shadow: 0 0 0 1px rgba(var(--winner-rgb), 0.2);
}
.tvfs-row.rank-2 { border-color: rgba(var(--silver-rgb), 0.35); }
.tvfs-row.rank-3 { border-color: rgba(var(--bronze-rgb), 0.4); }

.tvfs-rank {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  color: var(--muted);
  text-align: center;
}
.tvfs-row.rank-1 .tvfs-rank { color: var(--winner); }
.tvfs-row.rank-2 .tvfs-rank { color: var(--silver); }
.tvfs-row.rank-3 .tvfs-rank { color: var(--bronze); }

.tvfs-main { min-width: 0; }
.tvfs-name {
  font-weight: 700;
  font-size: clamp(0.92rem, 1.8vw, 1.18rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tvfs-row.rank-1 .tvfs-name { color: var(--text-strong); }

.tvfs-trophies {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.tvfs-qtrophy {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(var(--winner-rgb), 0.12);
  border: 1px solid rgba(var(--winner-rgb), 0.35);
  border-radius: var(--r-xl);
  padding: 2px 8px 2px 6px;
  font-size: clamp(0.6rem, 1.1vw, 0.7rem);
  font-weight: 800;
  color: var(--winner);
  letter-spacing: 0.02em;
}
.tvfs-qtrophy svg { display: block; }
.tvfs-drawn { font-weight: 700; opacity: 0.75; }

.tvfs-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tvfs-amount-val {
  font-weight: 800;
  font-size: clamp(1rem, 2.1vw, 1.5rem);
  color: var(--text);
}
.tvfs-row.rank-1 .tvfs-amount-val { color: var(--winner); }
.tvfs-amount-lbl {
  font-size: var(--fs-3xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
  .tvfs-champion-trophy, .tvfs-champion-trophy .tv-celebration-sparkle { animation: none; }
}

/* Real fullscreen: reclaim the padding so the grid runs edge to edge, and give
   the board the room the header was using. */
body.tv-fullscreen .tv-screen { padding: 10px 14px 14px; }
body.tv-fullscreen .tv-controls { margin: -4px 0 6px; }
body.tv-fullscreen .tv-header { margin-bottom: 6px; }
body.tv-fullscreen .tv-meta { font-size: var(--fs-2xl); }

/* Give the grid every spare pixel on a 16:9 screen. */
@media (min-aspect-ratio: 3/2) {
  .tv-board-wrap .cell { font-size: clamp(1rem, 1.9vw, 2rem); }
  .tv-board-wrap .cell.head { font-size: clamp(1.5rem, 2.7vw, 3rem); }
  .tv-board-wrap .cell .name-txt { font-size: clamp(0.95rem, 1.75vw, 1.85rem); }
}

/* Holds the board and, before the lock, the players list beside it (outside .tv-board-wrap,
   which renderFullBoard wipes and rebuilds wholesale on every board change). */
.tv-board-outer {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.tv-board-wrap {
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.tv-board-wrap .board-grid-outer { width: 100%; height: 100%; }
.tv-board-wrap .board-scroll { overflow: visible; padding-bottom: 0; }
/* The table's own blank corner cell: match the surrounding cells' panel
   background (not the darker screen background) and paint over the 1px
   grid-gap seam on its two visible edges (right/bottom — the other two sit
   flush against the table's own edge already) so no border line survives
   around it. Left blank: on the live board it's the bottom-right slice of
   the bigger .tv-corner-qr-big rectangle sitting on top of it. */
.tv-board-wrap .cell.head.corner {
  background: var(--panel);
  border-radius: 0;
  box-shadow: 1px 0 0 var(--panel), 0 1px 0 var(--panel);
}
/* The live board's scan-to-view-your-squares QR (screen-gameday.js, positionCornerQrBig).
   Sized and placed in JS to cover the outer team-label grid's blank top-left corner and the
   table's blank corner cell below it, so it never covers game info. */
.tv-corner-qr-big {
  position: absolute;
  z-index: 3;
  background: var(--panel);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.35);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6%;
}
.tv-corner-qr-big svg {
  width: 100%;
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  border-radius: var(--r-xs);
}
.tv-corner-qr-label {
  flex: 0 0 auto;
  width: 100%;
  overflow: hidden;
  color: var(--accent);
  font-size: clamp(13px, 0.9vw, 15px);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}
.tv-corner-qr-label span {
  display: inline-block;
  white-space: nowrap;
}
.tv-board-wrap .board-table {
  height: 100%;
  grid-template-rows: repeat(11, 1fr);
  grid-template-columns: repeat(11, 1fr);
}
.tv-board-wrap .cell {
  min-height: 0;
  font-size: clamp(0.9rem, 1.7vw, 1.7rem);
}
.tv-board-wrap .cell.head {
  font-size: clamp(1.3rem, 2.4vw, 2.6rem);
}
.tv-board-wrap .cell .badge { font-size: clamp(0.55rem, 0.9vw, 0.9rem); }
.tv-board-wrap .cell .name-txt { font-size: clamp(0.85rem, 1.6vw, 1.6rem); padding-top: 6%; }
.tv-board-wrap .teamA-label-text,
.tv-board-wrap .teamB-label span {
  font-size: clamp(1.3rem, 2.6vw, 2.8rem);
}
.tv-board-wrap .team-logo {
  --logo-size: clamp(32px, 4.5vw, 64px) !important;
}

/* --- Player names and lines (players list, player view) --- */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 4px;
}
.player-info { flex: 1 1 140px; min-width: 120px; }
.player-name { font-weight: 700; font-size: var(--fs-md); }
.player-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }

.phone-link-list { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0; }
.phone-qr-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* White plate behind the code: scanners need the light quiet zone, which the
   dark theme would otherwise swallow. */
.phone-qr {
  flex: none;
  background: var(--plate);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  line-height: 0;
}
.phone-qr svg { display: block; }
.phone-link {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: var(--fs-md);
  color: var(--accent);
  user-select: all;
  word-break: break-all;
  text-align: center;
  max-width: 100%;
}

/* --- Player companion view (#player-YYYY) ---------------------------------
   Read-only screen a grid player lands on after scanning the QR code: their
   squares and quarter winners so far. Sized and spaced for readability at a
   glance — this is meant to be legible on a phone held at arm's length by
   someone who isn't going to squint at 12px text, so sizes here run larger
   and looser than the rest of the app. */
body.player-mode { background: var(--bg); }
body.player-mode #app { padding: 0; }

.player-screen {
  width: 100%;
  box-sizing: border-box;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(100px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.5;
}

.player-header {
  position: sticky;
  top: 0;
  border-top: var(--sat) solid transparent;
  z-index: 5;
  background: var(--bg);
  padding: 12px 2px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.player-title-row { display: flex; align-items: center; gap: 12px; }
.player-title { font-size: var(--fs-2xl); font-weight: 800; flex: 1; line-height: 1.25; }
.player-invite-btn { width: 100%; min-height: 48px; }
.player-invite-btn[hidden] { display: none; }
.player-host-link { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); text-decoration: underline; }
.player-host-link[hidden] { display: none; }
.invite-dialog { max-width: 420px; width: 100%; max-height: calc(100dvh - 32px); overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: var(--shadow-pop); }
.invite-dialog h3, .invite-dialog p { margin: 0; }
.invite-dialog p { color: var(--muted); }
.invite-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.invite-actions button { width: 100%; min-height: 48px; }

.player-ticker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
}
.pt-team { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.pt-pts { font-size: var(--fs-3xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.pt-mid { text-align: center; padding: 0 10px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.pt-status { font-size: var(--fs-md); font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: 0.4px; }
/* Same glowing pill treatment as the Home screen's game-card "In Progress"
   badge (see .status-started / @keyframes status-glow), reused here since
   this element sits outside a .game-card. */
.pt-status.is-live {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--danger-soft);
  animation: status-glow 2.4s ease-in-out infinite;
}
.player-ticker-pending {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
  font-size: var(--fs-lg);
  text-align: center;
}

.player-select {
  flex: 1;
  min-width: 160px;
  min-height: 52px;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: var(--fs-xl);
  font-weight: 600;
}

.player-card { padding: 18px; }
.player-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.player-card-title { font-size: var(--fs-md); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.player-card-sub { font-size: var(--fs-md); color: var(--accent); font-weight: 600; }
.player-muted { color: var(--muted); font-size: var(--fs-lg); margin: 0; }

.player-total-card { padding: 12px 18px; text-align: center; }
.player-total-label { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 4px; }
.player-total-value { font-size: var(--fs-xl); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.player-total-value.has-winnings {
  position: relative;
  display: inline-block;
  color: var(--good);
}
/* A couple of twinkling ✦ marks flanking the amount — just enough sparkle to
   catch the eye without turning the number into a distraction. */
.player-total-value.has-winnings::before,
.player-total-value.has-winnings::after {
  content: '✦';
  position: absolute;
  color: var(--good);
  font-size: var(--fs-sm);
  animation: total-won-sparkle 1.6s ease-in-out infinite;
}
.player-total-value.has-winnings::before { left: -20px; top: -2px; animation-delay: 0s; }
.player-total-value.has-winnings::after { right: -20px; bottom: -2px; animation-delay: 0.8s; }
@keyframes total-won-sparkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

.player-square-list { display: flex; flex-direction: column; gap: 10px; }
.player-square-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.psi-coord { font-weight: 800; font-size: var(--fs-xl); color: var(--text); }
.psi-tag { font-size: var(--fs-sm); font-weight: 700; padding: 6px 12px; border-radius: var(--r-sm); text-transform: uppercase; white-space: nowrap; }
.status-winning { background: var(--good-soft); color: var(--good); }
.status-threat { background: var(--warn-soft); color: var(--warn); }
.status-dormant { background: var(--panel3); color: var(--muted); }

/* "TM1 # | # TM2" coordinate readout — team abbreviations stay the default
   text color; the two digits (the actual score that matters) get the accent
   color so they're the part that jumps out. */
.coord-team { color: inherit; }
.coord-num { color: var(--accent); }
.coord-sep { color: var(--muted); font-weight: 400; margin: 0 4px; }

.player-history { display: flex; flex-direction: column; }
.player-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-lg);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.player-history-row:last-child { border-bottom: none; padding-bottom: 0; }
.ph-q { font-weight: 700; color: var(--muted); min-width: 50px; }
.ph-score { font-size: var(--fs-md); background: var(--panel2); padding: 4px 9px; border-radius: var(--r-xs); color: var(--accent); font-variant-numeric: tabular-nums; }
.ph-winner { flex: 1; text-align: right; font-weight: 600; }
.ph-winner.ph-mine { color: var(--good); font-weight: 800; }
.ph-winner.ph-pending { color: var(--muted); font-weight: 500; }
.ph-winner.ph-push { color: var(--warn); font-weight: 500; }
.ph-drawn { font-weight: 500; opacity: 0.75; font-size: 0.85em; }

/* ---- The score pad (score-panel.js, decision 025) ---- */
.score-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.score-panel[hidden], .score-panel [hidden] { display: none; }
.sp-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--panel2); border-radius: var(--radius); font-size: var(--fs-sm); line-height: 1.3; }
.sp-note.is-warn { background: var(--warn-soft); border: 1px solid var(--warn); }
.sp-note .sp-btn { flex: none; }
/* Live scoring banner: Active (green), Paused (amber), Down (red). The mark carries the state too, not color alone. */
.sp-live { padding: 10px 14px; border: 1px solid var(--border); }
.sp-live-text { min-width: 0; }
.sp-live-title { font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; white-space: nowrap; }
.sp-live-sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.sp-live-word { display: inline-flex; align-items: center; gap: 5px; margin-left: 2px; padding: 2px 9px 2px 7px; border-radius: 999px; vertical-align: 2px; font-size: var(--fs-sm); color: var(--sp-live-c); background: color-mix(in srgb, var(--sp-live-c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--sp-live-c) 55%, transparent); box-shadow: 0 0 8px color-mix(in srgb, var(--sp-live-c) 35%, transparent); text-shadow: 0 0 6px color-mix(in srgb, var(--sp-live-c) 45%, transparent); }
.sp-live-mark { flex: none; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--sp-live-c); box-shadow: 0 0 6px color-mix(in srgb, var(--sp-live-c) 55%, transparent); }
.sp-live.is-active { --sp-live-c: var(--live); }
.sp-live.is-down { --sp-live-c: var(--bad-text); background: var(--danger-soft); border-color: var(--danger-border); }
.sp-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.sp-title h3 { margin: 0; font-size: var(--fs-xl); flex: none; }
.sp-winning { min-width: 0; text-align: right; font-size: var(--fs-sm); color: var(--muted); line-height: 1.25; display: flex; flex-direction: column; }
.sp-winning strong { color: var(--good); font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sp-team { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sp-head { display: flex; min-width: 0; max-width: 100%; }
.sp-head > * { margin: 0 auto; } /* not centered by the box: an overflow must show to be fitted */
.sp-num {
  min-height: 64px; padding: 0 4px; background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--radius); box-shadow: none;
  color: var(--text); font-size: 2.8rem; /* off-scale: hero number */ line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
button.sp-num:hover { background: var(--accent-soft); }
.sp-num.is-static { border-style: solid; border-color: var(--border); }
.sp-plays { display: flex; flex-direction: column; gap: 8px; }
.sp-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font-size: var(--fs-md);
  font-weight: 700;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.sp-btn:hover:not(:disabled) { background: var(--accent-soft); }
.sp-btn:disabled { opacity: 0.45; cursor: default; }
.sp-btn:focus-visible, .sp-num:focus-visible, .sp-fix:focus-visible, .sp-link:focus-visible, .sp-sheet input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sp-play { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; }
.sp-play-label { min-width: 0; font-size: var(--fs-md); font-weight: 600; line-height: 1.15; }
.sp-pts { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-lg); font-weight: 800; color: var(--accent); }
.sp-play.is-lit { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sp-last { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 4px 12px; background: var(--panel2); border-radius: var(--radius); }
.sp-status { min-width: 0; font-size: var(--fs-sm); line-height: 1.25; overflow-wrap: anywhere; }
.sp-undo { flex: none; display: inline-flex; align-items: center; gap: 6px; background: transparent; }
.sp-primary { background: var(--btn-fill); color: var(--btn-text); border-color: var(--btn-edge); }
.sp-primary:hover:not(:disabled) { background: var(--btn-fill-hover); border-color: var(--accent); }
.sp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-actions:empty { display: none; }
.sp-end { flex: 1 1 100%; min-height: 52px; font-size: var(--fs-lg); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.sp-link { min-height: 44px; padding: 0 6px; background: none; border: 0; box-shadow: none; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; margin-left: auto; }
button.sp-link:hover { color: var(--text); }
.sp-quarters { list-style: none; margin: 0; padding: 0; }
.sp-quarters li { display: grid; grid-template-columns: 3rem 4rem minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; border-top: 1px solid var(--border); }
.sp-quarters li.sp-drawrow { grid-template-columns: minmax(0, 1fr); padding: 8px 0; color: var(--danger); }
.sp-q { font-weight: 700; color: var(--muted); }
.sp-val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-who.is-push { color: var(--warn); white-space: normal; }
button.sp-fix { min-height: 44px; min-width: 44px; padding: 0 6px; background: none; border: 0; box-shadow: none; color: var(--accent); font-size: var(--fs-md); font-weight: 700; }
button.sp-fix:hover { background: var(--panel2); }
.sp-sheet { width: 100%; max-width: 420px; margin: 5vh 0 0; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--border-strong, var(--border)); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 14px; box-sizing: border-box; }
.sp-sheet:focus { outline: none; }
.sp-sheet h3 { margin: 0; font-size: var(--fs-xl); }
.sp-sheet p { margin: 0; }
.sp-sheet-score { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-md); font-weight: 700; overflow-wrap: anywhere; }
.sp-sheet-score strong { font-size: var(--fs-3xl); line-height: 1; font-variant-numeric: tabular-nums; }
.sp-dash { color: var(--muted); }
.sp-sheet-note { padding: 12px; border-radius: var(--r-md); background: var(--good-soft); color: var(--good); text-align: center; font-size: var(--fs-lg); font-weight: 700; overflow-wrap: anywhere; }
.sp-sheet-note.is-push { background: var(--warn-soft); color: var(--warn); }
.sp-sheet-warn { padding: 8px 12px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn); }
.sp-sheet-small { color: var(--muted); font-size: var(--fs-md); line-height: 1.35; }
.sp-sheet-live { color: var(--text); min-height: 2.6em; }
.sp-sheet-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.sp-sheet-form .sp-link { margin: 0; align-self: flex-start; }
.sp-sheet-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sp-sheet-nums label { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.sp-sheet-nums input { width: 100%; height: 64px; box-sizing: border-box; text-align: center; font-size: var(--fs-3xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.sp-sheet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sp-sheet-actions .sp-btn { min-height: 52px; }
.live-score-bar.manual .live-dot { background: var(--accent); }
.live-score-bar.manual .live-label { color: var(--accent); }
.live-score-bar.offline .live-dot { background: var(--warn); animation: none; }
.live-score-bar.offline .live-label { color: var(--warn); }
.live-updated { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.tv-header .live-updated { font-size: 0.6em; }
.pill.disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Phone Game Day (R20): tabs, labeled actions, feed-down banner ---- */
.gd-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
button.gd-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 6px 10px; font-size: var(--fs-sm);
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
}
button.gd-action:hover { background: var(--panel3); border-color: var(--border-strong); }
button.gd-action svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.gd-tabs { display: flex; gap: 4px; margin: 4px 0 12px; border-bottom: 1px solid var(--border); }
button.gd-tab {
  flex: 1; min-height: 44px; background: transparent; color: var(--muted);
  border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-weight: 700;
}
@media (hover: hover) { button.gd-tab:hover { background: var(--panel2); color: var(--text); } }
button.gd-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
/* The live strip above Game Day's tabs (phone) or atop its side panel (wide). */
.gd-live-strip { margin: 0 0 12px; }
.gd-live-strip[hidden], .gd-phone .pick-layout > [hidden] { display: none; }
.gd-phone .pick-layout { display: block; }
/* An upright tablet uses the phone layout, scaled up so it fills the screen like a big phone. */
.main.gd-phone.gd-big:not(.gd-ph) { zoom: 1.3; } /* not a phone: it has the iPad's parts at its own size */
.gd-phone .card { padding: 10px; }
/* The 10x10 grid and its axis numbers fit a 360 px viewport: no minimum cell width. */
.gd-phone .board-table { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.gd-phone .cell { min-height: 0; aspect-ratio: 1; font-size: var(--fs-2xs); padding: 0; }
.gd-phone .cell.head { font-size: var(--fs-xs); }
.gd-phone .cell .name-txt { font-size: 0.5rem; padding-top: 6px; line-height: 1; overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; }
.gd-phone .cell .badge { font-size: 0.45rem; padding: 0 2px; }
.gd-phone .cell .badges { top: 0; right: 1px; }

/* ---- Game Day on an upright iPad (gameday-ipad.js) ---- */
/* Home and the menu sit in the top corners; the matchup, score and status fill the middle. */
/* One line, both ways up: no status tag (the Quarter tile carries a live dot), so the screen below
   gets the height. */
.topbar.gd-topbar-tablet.gd-topbar-ipad { align-items: center; padding: 6px 16px; min-height: 0; }
.gd-topbar-ipad > .home-btn, .gd-topbar-ipad > .nav, .gd-topbar-ipad .gd-head { align-self: center; }
.gdi-match { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
/* Equal outer columns keep the dash on the bar's center line; gameday-ipad.js gives both pills the
   wider one's width and both numbers the wider score's width. */
.gdi-match { align-self: stretch; }
.gdi-scoreline { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; min-width: 0; }
.gdi-team { min-width: 0; display: flex; font-size: var(--fs-lg); }
.gdi-team.is-a { justify-content: flex-end; }
.gdi-team.is-b { justify-content: flex-start; }
.gdi-scoreline .team-badge { font-size: var(--fs-lg); justify-content: center; }
.gdi-scoreline .team-badge-name { flex: 1 1 auto; text-align: center; }
button.gdi-pts {
  width: calc(var(--gdi-digits, 2) * 1ch + 8px); min-width: 0; min-height: 0; padding: 0 4px; background: none; border: 0; border-radius: var(--r-sm); text-align: center;
  font-size: var(--fs-3xl); font-weight: 700; line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums;
}
button.gdi-pts:not(:disabled):hover { background: var(--panel2); }
button.gdi-pts:disabled { opacity: 1; cursor: default; }
button.gdi-pts.is-trail { color: var(--muted); }
.gdi-dash { font-size: var(--fs-xl); color: var(--muted); }
/* A score that just changed, from the feed or a tap. */
.gdi-bump { animation: gdi-bump 0.7s ease-out; }
@keyframes gdi-bump { 0% { color: var(--q-win); transform: scale(1.4); text-shadow: 0 0 14px rgba(var(--q-win-rgb), 0.7); } 100% { transform: scale(1); } }
@keyframes gdi-blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .gdi-bump { animation: none; } }
/* The Score tab while the host keeps score: the pad and the Quarters list fit the screen. Two plays
   to a row, End and "Make this the final score" side by side, tighter quarter rows. */
.main.gd-phone.gd-big { padding-top: 8px; padding-bottom: 12px; }
/* A line between the two teams' plays, so a tap does not land on the other team's button. */
.gd-big .sp-teams { gap: 0; }
.gd-big .sp-team:first-child { padding-right: 10px; }
.gd-big .sp-team + .sp-team { padding-left: 10px; border-left: 2px solid var(--border-strong); }
.gd-big .score-panel { gap: 8px; }
.gd-big .sp-last .sp-btn { min-height: 36px; }
.gd-big .sp-plays { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gd-big .sp-team { gap: 6px; }
.gd-big .sp-play { min-height: 44px; padding: 0 10px; }
.gd-big .sp-play-label { font-size: var(--fs-sm); }
.gd-big .sp-last { padding-top: 2px; padding-bottom: 2px; }
.gd-big .sp-actions { flex-wrap: nowrap; }
.gd-big .sp-end { flex: 1 1 auto; min-height: 46px; }
.gd-big button.sp-link { white-space: nowrap; }
.gd-big .gd-results .score-panel { padding-bottom: 8px; }
.gd-big .gd-quarters { padding-top: 6px; }
.gd-big .gd-q { min-height: 40px; }
.gd-big button.gd-pay { min-height: 36px; }
.gd-big .gd-q-note { padding-bottom: 6px; }
/* The four tiles: a second line under each value. */
.gdi-tile .sub { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-height: 1.2em; }
.gdi-tile .lbl { text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fs-3xs); }
.gdi-tile.is-pot .val { color: var(--live); }
.gdi-tile.is-unpaid:not(.warn) .val { color: var(--live); }
.gdi-tile.is-unpaid.warn { background: color-mix(in srgb, var(--danger) 8%, var(--panel)); }
.gdi-tile.is-mode { --c: var(--accent); }
.gdi-tile.is-mode[data-kind="good"] { --c: var(--live); }
.gdi-tile.is-mode[data-kind="warn"] { --c: var(--warn); }
.gdi-tile.is-mode[data-kind="bad"] { --c: var(--bad-text); }
.gdi-tile.is-mode[data-kind="sim"] { --c: #b388ff; }
.gdi-tile.is-mode[data-kind="bad"] .sub { color: var(--c); }
.gdi-dot { display: inline-block; width: 0.45em; height: 0.45em; border-radius: 50%; margin-right: 0.3em; vertical-align: 0.12em; background: var(--c); box-shadow: 0 0 6px var(--c); }
/* The info strip under the tiles: always there, colored by what it says. */
.gdi-info { --c: var(--accent); display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 10%, var(--panel)); font-size: var(--fs-sm); line-height: 1.35; }
.gdi-info.is-good { --c: var(--live); }
.gdi-info.is-warn { --c: var(--warn); }
.gdi-info.is-bad { --c: var(--bad-text); background: var(--danger-soft); border-color: var(--danger-border); }
.gdi-info.is-sim { --c: #b388ff; }
.gdi-info-dot { flex: none; width: 9px; height: 9px; margin-top: 0.4em; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.gdi-info.is-good .gdi-info-dot, .gdi-info.is-bad .gdi-info-dot { animation: gdi-blink 1.8s ease-in-out infinite; }
.gdi-info-text { min-width: 0; color: var(--muted); }
.gdi-info-text b { color: var(--text-strong); margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .gdi-info-dot { animation: none !important; } }


/* ---- Join code card, share button (R22) ---- */
.join-code { font-size: clamp(2rem, 11vw, 3rem); font-weight: 800; letter-spacing: 0.18em; padding-left: 0.18em; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.join-url { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.join-note { min-height: 1.2em; font-size: var(--fs-sm); color: var(--good); overflow-wrap: anywhere; }

.player-scored-by { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }

/* TV, before the lock: every player and their square count beside the filling board. Up to
   30 names show without scrolling: two columns past 15, and screen-gameday.js shrinks the type. */
.tv-players-panel {
  flex: 0 0 auto;
  width: clamp(220px, 19vw, 400px);
  margin-left: 22px;
  box-sizing: border-box;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}
.tv-players-panel.is-two-col { width: clamp(300px, 27vw, 560px); }
.tv-players-panel[hidden] { display: none; }
.tv-players-qr { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid rgba(var(--accent-rgb), 0.2); }
.tv-players-qr svg { width: min(100%, 24vh); height: auto; display: block; border-radius: var(--r-xs); }
.tv-players-scan { font-size: clamp(1rem, 1.4vw, 1.8rem); font-weight: 700; color: var(--accent); text-align: center; }
.tv-players-title { flex: 0 0 auto; font-size: clamp(1rem, 1.4vw, 1.8rem); font-weight: 700; color: var(--accent); text-align: center; }
.tv-players-list {
  flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; list-style: none; overflow: hidden;
  display: grid; grid-auto-rows: max-content; align-content: start; column-gap: 1.2em; row-gap: 0.25em;
}
.tv-players-panel.is-two-col .tv-players-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; }
.tv-player { display: flex; align-items: center; gap: 0.45em; min-width: 0; line-height: 1.2; }
.tv-player-dot { flex: none; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--nc, var(--muted)); }
.tv-player-name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--nc, var(--text)); font-weight: 600; }
.tv-player-count { flex: none; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.tv-players-empty { color: var(--muted); text-align: center; font-size: clamp(0.9rem, 1.2vw, 1.4rem); }
/* The picking header: status first, then labeled figures. */
.tv-picking-pill { flex-wrap: wrap; align-items: center; column-gap: 1.4em; row-gap: 4px; font-size: clamp(1.15rem, 1.45vw, 2.1rem); }
.tv-stat { display: inline-flex; align-items: baseline; gap: 0.4em; white-space: nowrap; }
.tv-stat-label { color: var(--accent); }
.tv-stat-val { color: var(--good); }
.tv-stat-val.is-owed { color: var(--unpaid, var(--danger)); }
.tv-stat-status { align-items: center; color: var(--text-strong); }
.tv-status-dot { width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); animation: tv-status-pulse 2s ease-in-out infinite; }
@keyframes tv-status-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tv-status-dot { animation: none; } }
/* TV grid names: a two-word name wraps at its space; board.js fitNames shrinks one that still won't fit. */
.tv-screen .tv-board-wrap .cell .name-txt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-break: normal; overflow-wrap: normal; line-height: 1.05; text-align: center; }

/* TV pairing (R23): the /tv screen, and the host's Connect box. */
.tvp-screen {
  min-height: 100vh; box-sizing: border-box; padding: 4vh 5vw;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 2.5vh; background: var(--bg); color: var(--text);
}
.tvp-title { margin: 0; font-size: clamp(1.6rem, 4vw, 4.5rem); font-weight: 800; color: var(--accent); }
.tvp-steps { margin: 0; max-width: 40ch; font-size: clamp(1rem, 1.9vw, 2.2rem); color: var(--muted); line-height: 1.35; }
.tvp-steps strong { color: var(--text); }
.tvp-code {
  font-size: clamp(3rem, 15vw, 16rem); font-weight: 800; line-height: 1; letter-spacing: 0.12em; padding-left: 0.12em;
  color: var(--text-strong); text-shadow: 0 0 24px rgba(var(--accent-rgb), 0.45); max-width: 100%;
}
.tvp-status { margin: 0; font-size: clamp(0.95rem, 1.5vw, 1.8rem); color: var(--muted); }
.tvp-unpair {
  position: fixed; right: 12px; bottom: 4px; background: none; border: 0; padding: 6px 8px; min-height: 44px; min-width: 44px;
  color: var(--muted); font-size: var(--fs-sm); text-decoration: underline; cursor: pointer; opacity: 0.7;
}
.tvp-unpair:hover, .tvp-unpair:focus-visible { opacity: 1; color: var(--text); }

.room-card { max-width: 480px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-pop); box-sizing: border-box; }
.room-title { margin-top: 0; }
.room-opt { padding: 12px 0; border-top: 1px solid var(--border); }
.room-opt h4 { margin: 0 0 6px; font-size: var(--fs-md); color: var(--accent); }
.room-opt p { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.room-url { color: var(--text); overflow-wrap: anywhere; }
.room-label { display: block; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; }
.room-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.room-code {
  width: 9ch; box-sizing: content-box; font-size: var(--fs-xl); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; text-align: center;
}
.room-status { min-height: 1.3em; margin: 8px 0 0; }
.room-status.room-error { color: var(--danger); }

/* Helpers (R37): the host's panel (dialog and wide Game Day tab) */
.helpers-card { max-width: 480px; width: 100%; margin: 0 auto; max-height: 92vh; overflow-y: auto; box-sizing: border-box; }
.helpers-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.helpers-head h3 { margin: 0; flex: 1; min-width: 0; font-size: var(--fs-xl); overflow-wrap: anywhere; }
.helpers-head .icon-btn { flex: none; min-width: 44px; min-height: 44px; }
.helpers-tab { padding: 12px; }
.helpers-panel { display: flex; flex-direction: column; gap: 12px; }
.helpers-panel h4 { margin: 4px 0 0; font-size: var(--fs-lg); }
.helpers-panel [hidden], .helpers-head [hidden], .helpers-head[hidden] { display: none; }
.helpers-text { margin: 0; color: var(--muted); line-height: 1.4; }
.helpers-status { margin: 0; font-weight: 600; line-height: 1.4; }
.helpers-status:empty { display: none; }
.helpers-status.is-error { color: var(--danger); }
.helpers-status.is-ok { color: var(--live); }
.helpers-list { display: flex; flex-direction: column; gap: 10px; }
.helpers-list:empty { display: none; }
.helpers-changes { border-top: 1px solid var(--border); padding-top: 8px; }
/* A <details>, collapsed by default: the summary stands in for the old heading, with a chevron. */
.helpers-changes > summary { cursor: pointer; list-style: none; font-weight: 700; padding: 4px 0; display: flex; align-items: center; gap: 6px; }
.helpers-changes > summary::-webkit-details-marker { display: none; }
.helpers-changes > summary::before { content: '\25B8'; color: var(--muted); transition: transform 0.15s ease; }
.helpers-changes[open] > summary::before { transform: rotate(90deg); }
.helpers-changes[open] > summary { margin-bottom: 8px; }
.helpers-changes ul { list-style: none; margin: 0; padding: 0; }
.helpers-changes li { padding: 8px 0; border-bottom: 1px solid var(--border); line-height: 1.35; overflow-wrap: anywhere; }
.helpers-changes li:last-child { border-bottom: 0; }
.helpers-change-meta { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.helpers-change-meta time { flex: none; color: var(--muted); }
.helpers-item { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 14px; }
.helpers-item-head, .helpers-job { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.helpers-job-row { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.helpers-job-row .helpers-job { flex: 1 1 11rem; min-width: 0; justify-content: center; gap: 12px; }
.helpers-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.helpers-who strong { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.helpers-who span { font-size: var(--fs-sm); color: var(--muted); }
.helpers-who .is-on { color: var(--live); }
.helpers-job { min-height: 46px; border-top: 1px solid var(--border); margin-top: 6px; }
button.helpers-link { background: transparent; border: 0; box-shadow: none; color: var(--accent); min-height: 44px; padding: 0 4px; font-weight: 700; }
button.helpers-link.is-danger { color: var(--danger); }
button.helpers-switch { flex: none; width: 60px; min-height: 44px; padding: 0; background: transparent; border: 0; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.helpers-switch span { width: 52px; height: 30px; box-sizing: border-box; padding: 3px; border-radius: var(--r-pill); background: var(--track-off); display: flex; }
.helpers-switch span::after { content: ''; width: 24px; height: 24px; border-radius: 50%; background: var(--plate); }
.helpers-switch[aria-checked="true"] span { background: #1f8a4d; justify-content: flex-end; }
button.helpers-add, button.helpers-text-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; }
.helpers-other { display: flex; flex-direction: column; gap: 6px; }
.helpers-other input { min-height: 46px; font-size: var(--fs-md); }
.helpers-jobs { display: flex; flex-direction: column; gap: 8px; }
button.helpers-choice { display: flex; align-items: flex-start; gap: 14px; padding: 14px; text-align: left; background: transparent; border: 2px solid var(--border); box-shadow: none; border-radius: var(--r-lg); color: var(--text); font-weight: 500; line-height: 1.35; }
button.helpers-choice[aria-checked="true"] { border-color: var(--accent); }
.helpers-tick { flex: none; width: 26px; height: 26px; box-sizing: border-box; border: 2px solid var(--muted); border-radius: var(--r-sm); }
.helpers-choice[aria-checked="true"] .helpers-tick { background: var(--accent); border-color: var(--accent); position: relative; }
.helpers-choice[aria-checked="true"] .helpers-tick::after { content: ''; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px; border: solid var(--on-accent); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.helpers-code-title { text-align: center; }
.helpers-qr { display: flex; justify-content: center; }
.helpers-qr:empty { display: none; }
.helpers-qr svg { display: block; width: 220px; max-width: 100%; height: auto; padding: 10px; background: var(--plate); border-radius: var(--r-md); box-sizing: content-box; }
.helpers-actions { display: flex; flex-direction: column; gap: 8px; }
.helpers-actions button { min-height: 50px; }

@media (max-height: 820px) { .helpers-tab .helpers-qr svg { width: 180px; } }

/* Helpers (R37): the phone, in Player View */
.helper-pane[hidden], .helper-note[hidden] { display: none; }
.helper-pane { min-width: 0; }
.helper-line { margin-top: 6px; text-align: center; color: var(--muted); font-size: var(--fs-md); overflow-wrap: anywhere; }
.helper-note { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); line-height: 1.4; }
.helper-wait { text-align: center; }
.helper-wait h2, .helper-welcome h2 { margin: 0 0 10px; font-size: var(--fs-xl); line-height: 1.2; text-wrap: balance; }
.helper-welcome { display: flex; flex-direction: column; gap: 12px; }
.helper-welcome > p { margin: 0; }
.helper-duty { display: flex; flex-direction: column; line-height: 1.35; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); }
.helper-duty span { color: var(--muted); }
.helper-mine { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }

/* Player View tabs (R44) */
.player-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 6px; max-width: 560px; margin: 0 auto; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); box-sizing: border-box; background: var(--bg); border-top: 1px solid var(--border); }
.player-tabs[hidden], .player-pane[hidden] { display: none; }
button.player-tab { flex: 1; min-width: 0; min-height: 56px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: transparent; border: 0; box-shadow: none; border-radius: var(--r-lg); color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
button.player-tab[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.player-pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.player-pane button, .player-pane input { scroll-margin-bottom: 150px; }
.ph-slot { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ph-slot:empty, .ph-note:empty, .ph-updated:empty { display: none; }
.ph-note { margin: 0; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--r-lg); font-weight: 700; overflow-wrap: anywhere; }
.ph-changes { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--r-lg); }
.ph-changes h2 { margin: 0; font-size: var(--fs-lg); font-weight: 800; color: var(--warn); }
.ph-changes ul { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ph-changes li { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-md); line-height: 1.35; }
.ph-changes li span { min-width: 0; overflow-wrap: anywhere; }
.ph-changes time { flex: none; color: var(--muted); }
.ph-countdown { display: flex; flex-direction: column; gap: 4px; }
.ph-countdown strong { color: var(--text); font-size: var(--fs-xl); }
.ph-who { display: flex; flex-direction: column; gap: 10px; }
.ph-who h2 { margin: 0; font-size: var(--fs-xl); overflow-wrap: anywhere; }
.ph-who button, button.ph-link, button.ph-more { min-height: 48px; }
button.ph-skip { background: transparent; border: 0; box-shadow: none; color: var(--muted); text-decoration: underline; }
.ph-who-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-lg); }
.ph-who-line span { min-width: 0; overflow-wrap: anywhere; }
.ph-who-line button { flex: none; }
.ph-search { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 700; }
.ph-search[hidden] { display: none; }
.ph-search input { width: 100%; min-height: 48px; box-sizing: border-box; padding: 10px 12px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); color-scheme: dark; font-family: inherit; font-size: var(--fs-md); }
.ph-names { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; padding: 2px; }
button.ph-name { display: flex; flex: none; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; line-height: 1.3; }
.ph-name span { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.ph-won, .ph-owed { margin: 12px 0 0; font-size: var(--fs-md); line-height: 1.4; }
.ph-won { display: flex; justify-content: space-between; gap: 10px; }
.ph-won strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.ph-won strong.has-winnings { color: var(--good); }
button.ph-more { width: 100%; margin-top: 12px; }
.ph-updated { margin: 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

/* Squares manager (R38): the Players tab */
.pm-tab, .pm-body, .pm-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pm-tab .money-boxes { margin: 0; }
button.pm-add { width: 100%; min-height: 50px; }
.pm-picks, .pm-person { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); }
.pm-picks { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; }
.pm-body[hidden] { display: none; }
.pm-picks-text, .pm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; overflow-wrap: anywhere; }
.pm-picks-text span, .pm-info span { color: var(--muted); font-size: var(--fs-sm); }
button.pm-limit { min-height: 44px; padding: 0 14px; flex: none; }
.pm-note { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); line-height: 1.4; }
.pm-filter.choice-strip > button { flex: 1 1 0; }
.pm-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 14px; min-height: 48px; }
button.pm-info { min-height: 48px; padding: 2px 0; align-items: flex-start; justify-content: center; text-align: left; background: transparent; border: 0; box-shadow: none; color: var(--text); font-weight: 400; }
.pm-info strong { font-weight: 700; }
.pm-you { margin-left: 8px; color: var(--accent); font-size: var(--fs-sm); font-style: normal; text-transform: uppercase; }
.pm-person.is-me { border-color: var(--accent); }
.pm-squares { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pm-squares li { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-md); font-weight: 700; }
.pm-panel { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 12px; }
.pm-panel button { min-height: 46px; }
.pm-panel p { margin: 0; }
.pm-status { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 14px; border: 1px solid var(--accent); border-radius: var(--r-lg); background: var(--panel2); box-shadow: var(--shadow-pop); overflow-wrap: anywhere; }
.pm-status[hidden], .pm-form[hidden], .pm-form > [hidden] { display: none; }
button.pm-undo { min-height: 44px; flex: none; }
.pm-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pm-form > button { min-height: 48px; }
.pm-name { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin: 0; }
.pm-name input { width: 100%; min-height: 48px; box-sizing: border-box; font-size: var(--fs-md); }
.pm-who { margin: 0; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.pm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pm-actions button { min-height: 48px; }

/* Guest picks (R28): the guest's panel on the player page and the host's controls. */
.guest-panel { display: flex; flex-direction: column; gap: 12px; }
.guest-panel [hidden] { display: none; }
.gp-start { display: flex; flex-direction: column; gap: 10px; }
.gp-start-btn, .gp-action { width: 100%; min-height: 48px; }
.gp-live { display: flex; flex-direction: column; gap: 10px; }
.gp-name label, .gp-auto label { display: block; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.gp-name input, .gp-auto input { width: 100%; box-sizing: border-box; min-height: 44px; font-size: var(--fs-md); }
.gp-as, .gp-cap, .gp-warn, .gp-status { margin: 0; overflow-wrap: anywhere; }
.gp-warn { margin-top: 6px; color: var(--warn); font-weight: 600; }
.gp-warn:empty { display: none; }
.gp-cap { font-weight: 700; color: var(--accent); }
.gp-status { min-height: 1.3em; color: var(--accent-hi); }
.gp-board { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; width: 100%; max-width: 380px; margin: 4px auto 0; }
.gp-cell {
  aspect-ratio: 1; min-width: 0; min-height: 0; padding: 0; margin: 0; box-sizing: border-box;
  font-size: 0.5rem; font-weight: 600; line-height: 1; letter-spacing: 0; border-radius: var(--r-xs);
  background: transparent; color: var(--text); border: 1px solid var(--border);
  overflow: hidden; text-overflow: clip; white-space: nowrap;
}
.gp-cell:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.gp-cell.is-other { background: var(--panel3); border-color: var(--border-strong); color: var(--muted); opacity: 1; cursor: default; }
.gp-cell.is-mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hi); }
.gp-cell.is-sel { background: var(--accent); border-color: var(--accent); }
.gp-cell.is-rel { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }
.gp-cell:disabled { cursor: default; }
.gp-cell.is-open:disabled { opacity: 0.5; }
.gp-actions { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 5; padding: 8px; border: 1px solid var(--accent); border-radius: var(--r-lg); background: var(--panel2); box-shadow: var(--shadow-pop); }
.gp-actions[hidden] { display: none; }
.gp-auto-row { display: flex; gap: 8px; }
.gp-auto-row input { flex: 1; min-width: 0; }
.gp-auto-btn { flex: 0 0 auto; min-height: 44px; }
@media (min-width: 600px) { .gp-actions { flex-direction: row; } .gp-action { width: auto; min-width: 200px; } }

.cell.is-tappable { cursor: pointer; }
.cell.is-tappable:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.square-dialog .player-sub { margin: 0 0 8px; }
.player-guest-line { color: var(--accent-hi); }

/* ---- Game Day on a laptop or iPad (R25 part b) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center;
  font: 700 0.8rem/1.5 var(--mono, ui-monospace, Consolas, monospace);
  color: var(--text); background: var(--panel2); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: var(--r-xs);
}
.present-card .present-status, .room-present .present-status { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.present-actions { margin-top: 0; }
.present-actions button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.present-actions button svg { flex: none; }

/* ---- Mirror mode for one phone (R26, screen-mirror.js) ----
   The TV board on a phone whose screen is mirrored to the room. Landscape: board left, score
   header and quarters in a narrow column on the right. Portrait (R29): see the end of this file. */
.mirror-screen { padding: 6px 8px; }
.mirror-main { flex: 1 1 auto; min-height: 0; display: flex; gap: 8px; }
.mirror-main[hidden] { display: none; }
.mirror-board { flex: 1 1 auto; min-width: 0; }
.mirror-side { flex: 0 0 clamp(170px, 26vw, 240px); display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
/* Names: never broken inside a word, sized by board.js fitNames. The current winner stands out by weight and the
   ping around its square; the TV's growing-text effect would undo the fitted size. */
.mirror-screen .tv-board-wrap .board-table { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.mirror-screen .cell .name-txt { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; word-break: normal; }
.mirror-screen .cell { padding: 0 1px; }
.mirror-screen .cell.live-winner .name-txt { animation: none; font-weight: 800; }
.mirror-header { margin-bottom: 0; }
.mirror-header .tv-meta { font-size: var(--fs-sm); gap: 8px; }
.mirror-quarters { grid-template-columns: 1fr; gap: 4px; margin-bottom: 0; flex: 1 1 auto; min-height: 0; align-content: start; }
.mirror-quarters .tv-qchip { padding: 0 8px 1px; }
.mirror-quarters .tvq-top { font-size: var(--fs-3xs); }
.mirror-quarters .tvq-score { font-size: var(--fs-sm); }
.mirror-exit {
  align-self: flex-end; flex: 0 0 auto;
  min-height: 44px; min-width: 44px; padding: 1px 10px; font-size: var(--fs-xs);
  opacity: 0.5; background: var(--panel2); color: var(--text); border: 1px solid var(--border);
}
.mirror-exit:focus-visible { opacity: 1; outline: 3px solid var(--accent); }
.mirror-note {
  display: flex; position: absolute; inset: 0; z-index: 8; background: var(--bg);
  flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; font-size: var(--fs-lg);
}
.mirror-tip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 3px 6px; font-size: var(--fs-2xs); line-height: 1.25;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.mirror-tip-ok { min-height: 44px; min-width: 44px; padding: 0 10px; font-size: var(--fs-xs); white-space: nowrap; flex: none; }
.mirror-strip {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 13; max-height: 62vh; overflow-y: auto;
  padding: 0 var(--sar) var(--sab) var(--sal);
  background: var(--panel); border-top: 1px solid var(--border-strong, var(--border)); box-shadow: var(--shadow-pop);
}
.mirror-strip[hidden] { display: none; }
/* The score buttons and the Auto-Lock tip share the bottom edge: the tip waits until they go. */
.mirror-screen.strip-open .sleep-tip { display: none; }
.mirror-strip .score-panel { border: 0; border-radius: 0; gap: 6px; padding: 6px 8px; }
.mirror-strip .sp-title { display: none; }
.mirror-strip .sp-note { padding: 4px 10px; }
.mirror-strip .sp-num { min-height: 48px; font-size: var(--fs-3xl); }
.mirror-strip .sp-team, .mirror-strip .sp-plays { gap: 6px; }
.mirror-strip .sp-play { min-height: 44px; }
/* Sideways: the score beside the plays, two by two, and Undo and End on one line. */
@media (orientation: landscape) {
  .mirror-strip .sp-team { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 4px 8px; }
  .mirror-strip .sp-head { grid-column: 1; }
  .mirror-strip .sp-num { grid-column: 1; min-height: 44px; }
  .mirror-strip .sp-plays { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .mirror-strip .sp-play { padding: 0 8px; }
  .mirror-strip .score-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mirror-strip .sp-note, .mirror-strip .sp-teams { grid-column: 1 / -1; }
  .mirror-strip .sp-end { flex: 1 1 auto; min-height: 44px; font-size: var(--fs-md); }
  .mirror-strip .sp-actions { flex-wrap: nowrap; }
  .mirror-strip .sp-link { white-space: nowrap; }
}
.mirror-header .tv-meta { flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; width: 100%; }
.mirror-header .live-score-bar { font-size: var(--fs-sm); flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.mirror-header .live-label { font-size: var(--fs-2xs); }
.mirror-header .live-center { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mirror-header .live-score-digits { white-space: nowrap; }
.mirror-header .badge-full { display: none; }
.mirror-header .badge-abbr { display: inline; }
.mirror-header .live-score-bar { width: 100%; min-width: 0; box-sizing: border-box; }
.mirror-header .live-center { max-width: 100%; justify-content: center; }
.mirror-header .live-center .team-logo { display: none; }
.mirror-header .live-updated, .mirror-header .live-period { display: none; }

/* ---- Game Day top bar (R29) ----
   Home, the matchup on one line, then Party View and Connect. From 1024 px (not a phone) the meta
   line sits beside the matchup and the join chip and "On the TV" pill show. */
.topbar.gd-topbar { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; padding: 8px 20px; min-height: 64px; box-sizing: border-box; }
.gd-head { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gd-match { margin: 0; font-size: var(--fs-lg); font-weight: 800; letter-spacing: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; min-width: 0; }
.gd-match > * { flex: none; }
.gd-match .team-badge { font-size: var(--fs-md); }
.gd-meta { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-topbar .nav { flex: none; flex-wrap: nowrap; gap: 8px; }
button.gd-bar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: var(--r-xl); font-size: var(--fs-md); font-weight: 700;
  background: transparent; color: var(--text); border: 1px solid var(--border-strong, var(--border));
}
button.gd-bar-btn:hover { background: var(--panel2); }
button.gd-bar-btn.gd-connect { color: var(--accent-hi, var(--accent)); background: rgba(var(--accent-rgb), 0.12); }
button.gd-bar-btn.gd-icon-only { width: 44px; padding: 0; }
button.gd-bar-btn svg { width: 20px; height: 20px; flex: none; }
.gd-chip-wrap, .gd-onair { display: none; }
@media (min-width: 1024px) {
  .gd-topbar:not(.gd-topbar-phone) .gd-head { flex-direction: row; align-items: baseline; gap: 14px; }
  .gd-topbar:not(.gd-topbar-phone) .gd-match { flex: 0 1 auto; font-size: var(--fs-xl); }
  .gd-topbar:not(.gd-topbar-phone) .gd-meta { flex: 0 100 auto; min-width: 0; font-size: var(--fs-sm); }
  .gd-chip-wrap { display: block; position: relative; }
  button.gd-onair:not([hidden]) { display: inline-flex; }
}
button.gd-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-xl);
  background: var(--panel); color: var(--text); border: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600;
}
.gd-chip-label { color: var(--muted); }
.gd-chip-code { font-weight: 800; letter-spacing: 0.2em; color: var(--accent-hi, var(--accent)); }
.gd-chip svg { width: 16px; height: 16px; color: var(--muted); }
.gd-chip-note { position: absolute; top: calc(100% + 4px); right: 0; z-index: 60; font-size: var(--fs-xs); color: var(--good); background: var(--panel); border-radius: var(--r-sm); padding: 0 6px; white-space: nowrap; }
.gd-chip-note:empty { display: none; }
button.gd-onair {
  align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-xl); font-size: var(--fs-sm); font-weight: 600;
  background: rgba(var(--good-rgb), 0.15); color: var(--good); border: 1px solid rgba(var(--good-rgb), 0.6);
}
.gd-onair-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.gd-topbar-phone { position: relative; padding: 6px 8px; min-height: 60px; }
.gd-topbar-phone .gd-match { font-size: var(--fs-md); }
.gd-topbar-phone .gd-match .team-badge { font-size: var(--fs-sm); }
.gd-topbar-phone button.gd-bar-btn.gd-connect { padding: 0 12px; }
/* Game Day on a phone: the matchup alone, centered (no room for the description). */
.gd-topbar-phone:not(.pick-topbar) .gd-meta { display: none; }
.gd-topbar-phone:not(.pick-topbar) .gd-match { justify-content: center; }
/* Game Day on a phone: Home, the matchup centered on the screen, the menu. Equal side columns keep
   the matchup at the true center. */
.topbar.gd-topbar-phone:not(.pick-topbar) { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
.gd-topbar-phone:not(.pick-topbar) .gd-head { align-items: center; }
.gd-topbar-phone:not(.pick-topbar) .gd-match { max-width: 100%; }
.gd-topbar-phone:not(.pick-topbar) .nav { justify-content: flex-end; }
/* Both teams fit a small phone's top bar once Connect is its icon. */
@media (max-width: 480px) {
  .gd-topbar-phone button.gd-bar-btn.gd-connect { width: 44px; padding: 0; }
  .gd-topbar-phone .gd-connect span { display: none; }
  .gd-topbar-phone .gd-match { gap: 5px; }
  .gd-topbar-phone .gd-match .vs-sep { font-size: var(--fs-xs); }
}
/* A tablet (Game Day and picking): the phone's bar at tablet size. Home, the matchup at the true
   center with no description, one menu. */
.topbar.gd-topbar-tablet { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 12px; padding: 6px 16px; min-height: 64px; }
.gd-topbar-tablet .gd-meta { display: none; }
.gd-topbar-tablet .gd-head { align-items: center; justify-content: center; }
.gd-topbar-tablet .gd-match { max-width: 100%; justify-content: center; font-size: var(--fs-xl); }
.gd-topbar-tablet .gd-match .team-badge { font-size: var(--fs-md); }
.gd-topbar-tablet .nav { justify-content: flex-end; }

/* ---- Picking screen (redesign of R25) ----
   Two columns from 1024 px (one panel with Add squares and Players tabs, then the board), one
   below that (that panel, the board, then player picks and the lock). A phone, or a window under
   700 px, has three tabs under what is sold: Squares, Grid (it fits the width) and Players. In
   the wide layout the board sets the height: its cell comes from both the width and the height, so the grid shows
   whole, and the panel beside it is as tall as it is and scrolls inside. */
.main.pick-main { max-width: 1800px; padding: 16px 24px calc(16px + var(--sab)); }
.pick-fill { display: flex; flex-direction: column; gap: 16px; max-width: 760px; margin: 0 auto; }
.pick-fill > .card { margin: 0; border-radius: var(--r-md); }
.pick-fill .gd-tab[hidden], .pick-fill > [hidden], .pick-sec[hidden], .one-pane[hidden], .room-opt[hidden] { display: none; }
.pick-sec h3 { margin: 0 0 4px; }
.pick-sec > p { margin: 0 0 12px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.pick-side, .pick-foot.card { padding: 0; }
.pick-side .pick-sec, .pick-foot .pick-sec { padding: 16px 18px 18px; }
.pick-tabs { margin: 0; padding: 4px 12px 0; }
.players-sec .players-head { display: none; } /* the tab says it */
.players-sec .money-box { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 6px 12px; }
.players-sec .money-box .val { font-size: var(--fs-lg); }
.add-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-bottom: 8px; }
.pick-sec .add-head h3 { margin: 0; }
.add-head .paste-open { flex: none; width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.add-head .paste-open svg { width: 22px; height: 22px; }
.pick-sec > p.added-note { margin: 0 0 8px; color: var(--accent-hi); font-weight: 600; }
.added-note:empty { display: none; }
.pick-fields { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; }
.pick-form label, .paste-card label { margin-top: 0; }
.pick-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 8px 12px; border-radius: var(--r-md); background: var(--panel2); color: var(--muted); }
.pick-total:empty { display: none; }
/* Player View's Live tab before the lock: what it will show. */
.live-soon h3 { margin: 0 0 8px; font-size: var(--fs-lg); }
.live-soon p { margin: 0 0 10px; color: var(--text); line-height: 1.45; }
.live-soon ul { margin: 0 0 12px; padding-left: 20px; line-height: 1.5; }
.live-soon li { margin-bottom: 4px; }
.live-soon .live-soon-note { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.pick-math { display: block; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pick-total strong { font-size: var(--fs-xl); line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.add-sec.is-claiming .pick-total, .claim-slot .pick-total { display: none; }
.pick-form .checkbox-label { min-height: 44px; margin: 6px 0; font-weight: 600; font-size: var(--fs-md); }
button.add-btn, button.lock-btn { min-height: 48px; padding-left: 6px; padding-right: 6px; font-size: var(--fs-md); font-weight: 800; white-space: nowrap; }
.tap-hint { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.full-note { margin: 0; text-align: left; }
.add-sec.is-full .add-head, .add-sec.is-full .one-pane,
.add-sec.is-claiming .add-head, .add-sec.is-claiming .added-note, .add-sec.is-claiming .pick-fields, .add-sec.is-claiming .add-btn, .add-sec.is-claiming .tap-hint { display: none; }
.add-sec .manual-banner { flex-direction: column; align-items: stretch; gap: 2px; margin: 0 0 4px; }
.manual-banner .manual-for { font-size: var(--fs-sm); color: var(--muted); }
.manual-banner .manual-name { font-size: var(--fs-2xl); font-weight: 800; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.manual-banner .manual-count { font-size: var(--fs-md); font-weight: 600; }
.manual-banner .manual-paid { font-size: var(--fs-md); }
.manual-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.manual-actions button { min-height: 48px; }
.manual-actions [data-act="auto"] { flex: 1 0 100%; }
.manual-actions [data-act="done"] { flex: 1; }
.picks-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picks-row h3 { font-size: var(--fs-md); }
.picks-info { min-width: 0; }
.picks-info p { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.picks-row button { min-height: 44px; flex: none; }
.lock-sec { border-top: 1px solid var(--border); }
/* Locking is final, so the button is translucent red in every state and at every size
   (Steve, 2026-11-28). */
button.lock-btn, .lock-sec.is-ready button.lock-btn {
  background: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text-strong);
  border-color: color-mix(in srgb, var(--danger) 70%, transparent); box-shadow: none;
}
button.lock-btn:hover, .lock-sec.is-ready button.lock-btn:hover {
  background: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--text-strong); border-color: var(--danger);
}

.board-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.board-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 6px 4px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); text-align: center; }
.board-stat .lbl { white-space: nowrap; }
.board-stat.is-pot .val { color: var(--accent); }
/* Game Day's tiles: the pot is typed into, and what is unpaid opens the Players tab. */
label.board-stat { margin: 0; }
.board-stat .pot-line { display: flex; align-items: baseline; justify-content: center; max-width: 100%; }
.board-stat input.val-input {
  width: 4ch; height: 1.15em; min-width: 0; min-height: 0; padding: 0;margin: 0; background: transparent; border: 0; border-bottom: 1px dashed var(--border-strong);
  border-radius: 0; box-shadow: none; color: var(--accent); font: inherit; line-height: inherit; text-align: left; -moz-appearance: textfield; appearance: textfield;
}
.board-stat input.val-input::-webkit-outer-spin-button, .board-stat input.val-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.board-stat input.val-input:focus { border-bottom-color: var(--accent); box-shadow: none; }
.board-stat.clickable { cursor: pointer; }
.board-stat.clickable:hover { border-color: var(--accent); }
.board-stat.is-unpaid.warn { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.board-stat.is-unpaid.warn .val { color: var(--danger); }
.pick-fill .board-card { padding: 14px; }
.pick-fill .board-legend { justify-content: space-between; gap: 16px; margin-top: 12px; font-weight: 500; }
.legend-unpaid { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pick-fill .board-grid-outer { gap: 4px; }
.pick-fill:not(:where(.is-wide)) .teamA-label, .pick-fill:not(:where(.is-wide)) .teamB-label { border-radius: var(--r-sm); background: var(--team) padding-box !important; }
.pick-fill:not(:where(.is-wide)) .teamA-label, .pick-fill:not(:where(.is-wide)) .teamB-label { box-shadow: inset 0 0 0 1px var(--edge, transparent); }
.pick-fill:not(:where(.is-wide)) .teamB-label { border-left: 3px solid transparent; }
.pick-fill:not(:where(.is-wide)) .teamA-label { border-top: 3px solid transparent; }
.pick-fill:not(:where(.is-wide)) .teamB-label { padding: 3px 10px; font-size: var(--fs-md); }
.pick-fill:not(:where(.is-wide)) .teamA-label { padding: 10px 3px; }
.pick-fill:not(:where(.is-wide)) .teamA-label-text { font-size: var(--fs-md); }
.pick-fill:not(:where(.is-wide)) .cell:not(:where(.head)) { background: var(--cell-empty); box-shadow: inset 0 0 0 1px var(--glass-line); }
.pick-fill:not(:where(.is-wide)) .cell.filled { box-shadow: inset 0 0 0 1px var(--border-strong); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .pick-fill:not(:where(.is-wide)) .cell.filled { background: color-mix(in srgb, var(--who, var(--panel3)) 16%, var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--who, var(--accent)) 38%, transparent); }
}
.pick-fill .cell .name-txt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; word-break: normal; font-weight: 600; }
.pick-fill .cell.empty-pick:hover { box-shadow: inset 0 0 0 2px var(--pick-color, var(--accent)); }
.pick-fill .cell.empty-pick:not(.selected)[role=button]:hover::after { content: "+"; font-size: var(--fs-xl); font-weight: 600; color: var(--pick-color, var(--accent)); }
.pick-fill .cell.selected, .pick-fill .cell.empty-pick.selected:hover { background: var(--pick-color, var(--accent)); box-shadow: none; }
.pick-fill .cell.selected::after { content: "\2713"; font-size: var(--fs-lg); font-weight: 800; color: var(--on-accent); }
.pick-fill .cell.is-tappable:hover { box-shadow: inset 0 0 0 2px var(--accent); }
/* The grid look above is the narrow one; from 1024 px (.is-wide) the board wears the Party View grid
   (.glass-board, R35). */
/* Players has its panel to itself: no player picks, no lock. */
.pick-side > .players-sec:not([hidden]) + .pick-foot { display: none; }
button.grid-btn { display: none; min-height: 48px; margin-top: 8px; font-size: var(--fs-md); font-weight: 700; }

/* ---- The phone's three tabs ---- */
.pick-fill.is-tabbed { gap: 10px; max-width: 560px; }
.is-tabbed .board-head { gap: 6px; margin: 0; }
.is-tabbed .board-stat .val, .gd-phone .board-stat .val { font-size: var(--fs-lg); }
.gd-phone .board-head { gap: 6px; margin: 0 0 10px; }
.is-tabbed > .pick-tabs { margin: 0; padding: 0; }
.is-tabbed > .pick-tabs .gd-tab { min-height: 48px; padding: 0 4px; white-space: nowrap; }
.is-tabbed > .board-card { padding: 10px 8px; }
.is-tabbed .pick-side > .pick-foot { border-top: 1px solid var(--border); }
.is-tabbed .add-sec:not(.is-claiming) .grid-btn { display: block; }
.is-tabbed .add-sec .tap-hint:not(.full-note) { display: none; }
.claim-note { display: none; margin: 0; color: var(--muted); }
.is-tabbed .add-sec.is-claiming .claim-note { display: block; }
.is-tabbed .claim-slot.is-claiming { margin-bottom: 10px; }
.is-tabbed .claim-slot .manual-banner:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline; margin: 0; padding: 8px 12px; }
.is-tabbed .claim-slot .manual-for { display: none; }
.is-tabbed .claim-slot .manual-name { font-size: var(--fs-lg); }
.is-tabbed .claim-slot .manual-count, .is-tabbed .claim-slot .manual-paid { font-size: var(--fs-sm); }
.is-tabbed .claim-slot .manual-paid { grid-column: 1 / -1; }
.is-tabbed .claim-slot .pick-fields { display: none; }
.is-tabbed .claim-slot .checkbox-label { margin: 0; }
.is-tabbed .claim-slot .error-msg { margin: 8px 0 0; }
/* The whole grid fits the width, as on Game Day; a wrong tap is undone by tapping again. */
.is-tabbed .board-scroll { overflow: visible; padding-bottom: 0; }
.is-tabbed .board-grid-outer { gap: 2px; }
.is-tabbed .board-table { grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 2px; }
.is-tabbed .cell, .is-tabbed .cell.empty-pick[role=button] { min-width: 0; min-height: 0; aspect-ratio: 1; padding: 0 1px; border-radius: var(--r-xs); }
.is-tabbed .cell.head { font-size: var(--fs-xs); }
.is-tabbed .cell .name-txt { padding-top: 0; font-size: var(--fs-3xs); }
.is-tabbed .cell.selected::after { font-size: var(--fs-sm); }
.is-tabbed .teamB-label { padding: 1px 8px; font-size: var(--fs-sm); }
.is-tabbed .teamA-label { padding: 6px 1px; }
.is-tabbed .teamA-label-text { font-size: var(--fs-sm); }
.is-tabbed .teamA-label .team-logo, .is-tabbed .teamB-label .team-logo { --logo-size: 16px !important; padding: 1px; }
@media (max-width: 699px) {
  .main.pick-main { padding: 10px 10px calc(16px + var(--sab)); }
}

@media (min-width: 1024px) {
  /* The page fits the window (#app.fit-screen, below): the panel on the left, the board on the
     right, and the grid stretches to what is left. */
  #app.fit-screen .main.pick-main { flex: 1 1 0; min-height: 0; display: flex; padding: 12px 24px; }
  .pick-fill.is-wide {
    --side-w: clamp(330px, 31vw, 440px);
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: grid;
    max-width: none;
    margin: 0;
    gap: 18px;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    align-items: stretch;
  }
  .pick-fill.is-wide > .card { min-width: 0; }
  .pick-fill.is-wide > .pick-side { display: flex; flex-direction: column; height: 0; min-height: 100%; }
  .pick-side, .pick-fill .fill-players { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
  .pick-fill.is-wide .pick-side { overflow-y: auto; }
  .pick-fill.is-wide .pick-side > .pick-sec { flex: 0 0 auto; }
  /* The lock closes the panel at the same line as the board. */
  .pick-fill.is-wide .pick-foot { flex: 1 0 auto; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
  .pick-fill.is-wide .lock-sec { margin-top: auto; }
  /* Players has the whole panel: what is owed, and the list (it scrolls). */
  .pick-fill.is-wide .pick-side > .players-sec { flex: 1 1 0; min-height: 0; padding: 12px 18px; display: flex; flex-direction: column; }
  .pick-fill.is-wide .pick-side > .players-sec[hidden] { display: none; }
  .pick-fill.is-wide .players-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .pick-fill.is-wide .fill-players { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-right: 4px; border-top: 1px solid var(--border); }
  /* The board has no card of its own: what is sold above, the glass frame, the legend below. */
  .pick-fill.is-wide > .board-card { display: flex; flex-direction: column; min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; }
}
/* A short laptop window: tighter, so the panel and the grid still fit. */
@media (min-width: 1024px) and (max-height: 800px) {
  .main.pick-main { padding: 8px 24px; }
  .topbar.pick-topbar:not(.gd-topbar-phone) { min-height: 64px; padding: 4px 20px; }
  .pick-topbar:not(.gd-topbar-phone) .gd-head { gap: 0; }
  .pick-topbar:not(.gd-topbar-phone) .home-btn { margin-top: 6px; }
  .board-head { margin-bottom: 8px; }
  .board-stat { padding: 2px 4px; }
  .board-stat .val { font-size: var(--fs-lg); }
  .add-head { margin-bottom: 4px; }
  .pick-fill .board-legend { margin-top: 8px; }
  .pick-fill .teamB-label { padding: 0 10px; }
  .pick-side .pick-sec, .pick-foot .pick-sec { padding: 10px 16px 12px; }
  .players-sec .money-boxes { margin-bottom: 8px; }
  .players-foot { margin-top: 8px; }
  .pick-form .checkbox-label { margin: 0; }
  button.add-btn, button.lock-btn { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
  .tap-hint { margin-top: 4px; }
  .pick-total { margin-top: 6px; padding: 3px 12px; }
  .pick-total strong { font-size: var(--fs-lg); }
  .pick-sec > p:not(.tap-hint) { margin-bottom: 8px; font-size: var(--fs-sm); line-height: 1.35; }
}
/* A mouse needs less than a finger, so a short laptop window still shows the whole grid. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  /* One short line per player, so 20 or more fit. */
  .pick-fill.is-wide .fill-player { padding: 4px 0; }
  .pick-fill.is-wide button.fill-player-info { display: flex; align-items: center; gap: 8px; min-height: 34px; }
  .pick-fill.is-wide .fill-player-info .player-name { flex: none; font-size: var(--fs-lg); }
  .pick-fill.is-wide .fill-player-info .player-sub { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-sm); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pick-fill.is-wide button.paid-pill { min-height: 32px; min-width: 82px; padding: 2px 8px; font-size: var(--fs-sm); }
}

/* The picking screen's top bar: the same Home, matchup and Connect as Game Day, with the matchup
   in the exact center whatever is on either side. */
/* On a phone the matchup stands alone, centered in the bar, as on Game Day: no date line under it. */
.pick-topbar.gd-topbar-phone .gd-meta { display: none; }
.pick-topbar.gd-topbar-phone .gd-head { justify-content: center; }
.topbar.pick-topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; }
.pick-topbar .home-btn { justify-self: start; }
.pick-topbar .gd-head { align-items: center; text-align: center; gap: 3px; }
.pick-topbar .gd-match { max-width: 100%; justify-content: center; }
.pick-topbar .gd-meta { max-width: 100%; }
.pick-topbar .nav { justify-content: flex-end; }
.pick-topbar button.gd-bar-btn.gd-connect { width: 44px; padding: 0; }
.pick-topbar .gd-connect span { display: none; }
@media (min-width: 1024px) {
  .pick-topbar:not(.gd-topbar-phone) .gd-head { flex-direction: column; align-items: center; gap: 3px; }
  .pick-topbar:not(.gd-topbar-phone) button.gd-bar-btn.gd-connect { width: auto; padding: 0 16px; }
  .pick-topbar:not(.gd-topbar-phone) .gd-connect span { display: inline; }
}

/* ---- Small dialogs: payment, player picks ---- */
.pick-dialog { width: 100%; max-width: 420px; margin: 0; border-radius: var(--r-lg); border-color: var(--border-strong); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 14px; }
.pick-dialog h3 { margin: 0; font-size: var(--fs-xl); }
.pick-dialog-sub { margin: -10px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.dialog-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.dialog-row label { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.dialog-row small { display: block; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.dialog-row input[type=checkbox] { width: 24px; height: 24px; flex: none; accent-color: var(--accent); }
.dialog-row input[type=number] { width: 96px; flex: none; }
button.danger-line { min-height: 46px; background: transparent; color: var(--bad-text); border-color: var(--danger-border); box-shadow: none; }
button.danger-line:hover { background: var(--danger-soft); color: var(--bad-text); border-color: var(--danger); }
.pick-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick-dialog-actions button { min-height: 48px; }
.pick-dialog .money-boxes { margin: 0; }
.pay-dialog { max-width: 380px; }
.pay-name-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding-right: 40px; /* clear of the close X */ }
.pay-name-row h3 { min-width: 0; overflow-wrap: anywhere; }
.pay-name-row .icon-btn { flex: none; width: 36px; height: 36px; }
.pay-name-input { flex: 1; min-width: 0; font-size: var(--fs-lg); }
button.pay-remove { background: transparent; border: 0; box-shadow: none; color: var(--bad-text); font-size: var(--fs-sm); font-weight: 600; min-height: 40px; padding: 4px; border-top: 1px solid var(--border); border-radius: 0; }
button.pay-remove:hover { background: var(--danger-soft); color: var(--bad-text); }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.pay-step { display: flex; align-items: center; gap: 8px; }
.pay-step button { width: 44px; height: 44px; padding: 0; font-size: var(--fs-xl); }
.pay-count { min-width: 64px; text-align: center; font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
button.pay-full { background: transparent; color: var(--good); border-color: var(--good); box-shadow: none; }
button.pay-full:hover { background: var(--good-soft); color: var(--good); border-color: var(--good); }

/* ---- Connect (R29): a bottom sheet on a phone, a popover on a wide screen ---- */
.connect-layer { position: fixed; inset: 0; z-index: 100; }
.connect-layer-sheet { background: rgba(0, 0, 0, 0.55); }
.connect-card { box-sizing: border-box; box-shadow: var(--shadow-pop); overflow-y: auto; }
.connect-sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; max-width: none; width: 100%; max-height: calc(100% - 16px - var(--sat)); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 8px 16px calc(20px + var(--sab)); }
.connect-pop { position: absolute; width: 400px; max-width: calc(100vw - 16px); }
/* Centered (Connect from Home on a wide screen): dimmed and blurred like the other dialogs. */
.connect-layer-center { background: rgba(0, 0, 0, 0.55); display: flex; padding: 24px 16px; box-sizing: border-box; overflow-y: auto; }
.connect-center { margin: auto; width: 440px; max-width: 100%; max-height: none; overflow: visible; }
.connect-grab { width: 40px; height: 5px; border-radius: var(--r-xs); background: var(--border-strong, var(--border)); margin: 0 auto 6px; }
.connect-head { display: flex; align-items: center; justify-content: space-between; }
.connect-head .room-title { margin: 0; font-size: var(--fs-xl); }
.connect-x { min-width: 44px; min-height: 44px; }
.connect-code-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.connect-label { font-size: var(--fs-xs); color: var(--muted); }
.connect-code { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: 0.18em; color: var(--accent-hi, var(--accent)); line-height: 1.1; }
.connect-url { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; text-align: right; }
.connect-card .room-row button { min-height: 44px; }
.connect-qr, .qr-print { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* Scan-to-view window: Done, Print and Open it here stay on one row on a phone. */
@media (max-width: 480px) {
  .qr-layer .actions { gap: 8px; flex-wrap: nowrap; }
  .qr-layer .actions button { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
}
.connect-note { margin: 6px 0 0; color: var(--good); }
.room-mirror h5 { margin: 12px 0 4px; font-size: var(--fs-md); }
.room-mirror[hidden], .room-present[hidden] { display: none; }
.room-present, .room-mirror { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }

/* ---- Printed sign (R29): only the sign prints, black on white, one Letter page ---- */
.print-sign { display: none; }
@media print {
  @page { size: letter; margin: 0.5in; }
  body > *:not(.print-sign) { display: none !important; }
  html, body { background: #fff !important; }
  .print-sign {
    display: flex !important; flex-direction: column; align-items: center; text-align: center; gap: 14px;
    min-height: 9.8in; box-sizing: border-box; padding: 0.3in 0.4in; background: #fff; color: #111418;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .print-sign .ps-brand { font-size: 16px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: #3d4752; }
  .print-sign .ps-title { margin: 0; font-size: 60px; line-height: 1.05; font-weight: 800; color: #111418; }
  .print-sign .ps-match { font-size: 24px; font-weight: 600; color: #3d4752; }
  .print-sign .ps-qr svg { width: 3.6in; height: 3.6in; border: 2px solid #111418; border-radius: 12px; padding: 0.1in; box-sizing: content-box; }
  .print-sign .ps-how { margin: 0; font-size: 21px; line-height: 1.45; max-width: 6in; }
  .print-sign .ps-code-box { display: flex; align-items: center; gap: 18px; padding: 12px 22px; border: 2px solid #111418; border-radius: 12px; }
  .print-sign .ps-code-help { font-size: 17px; color: #3d4752; text-align: left; line-height: 1.3; }
  .print-sign .ps-code-help b { color: #111418; }
  .print-sign .ps-code { font-size: 50px; font-weight: 800; letter-spacing: 8px; }
  .print-sign .ps-foot { margin-top: auto; font-size: 16px; color: #3d4752; }
}

/* ---- Auto-Lock tip (R29): Party View on a touch device that cannot keep the screen awake ---- */
.sleep-tip {
  position: fixed; left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); bottom: calc(8px + var(--sab)); z-index: 14; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--r-md); color: var(--text); font-size: var(--fs-sm); line-height: 1.3;
}
.sleep-tip span { flex: 1; }
.sleep-tip-ok { min-width: 44px; min-height: 44px; padding: 0 10px; background: transparent; border: 1px solid var(--warn); color: var(--warn); font-weight: 700; }
@media (orientation: portrait) { .mirror-screen .sleep-tip { position: static; flex: 0 0 auto; } }

/* ---- Party View on a phone held upright (R29, screen-mirror.js) ----
   Exit, the score header, "Winning now", the board fitted to the width, the quarters 2 x 2 and a
   hint to turn sideways. The side column dissolves so its parts can be ordered with the board. */
.mirror-pscore, .mirror-winning, .mirror-hint { display: none; }
@media (orientation: portrait) {
  .mirror-screen { padding: 8px; gap: 8px; }
  .mirror-main { flex-direction: column; gap: 8px; }
  .mirror-side { display: contents; }
  .mirror-exit { order: 0; align-self: flex-end; opacity: 0.8; margin-bottom: -4px; }
  .mirror-header { display: none; }
  .mirror-pscore {
    order: 1; display: flex; align-items: center; justify-content: center; gap: 12px; flex: 0 0 auto;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px;
  }
  .mirror-pscore .team-logo { width: 34px; height: 34px; object-fit: contain; }
  .mirror-pnum { font-size: var(--fs-3xl); font-weight: 800; line-height: 1; }
  .mirror-pmid { display: flex; flex-direction: column; align-items: center; font-size: var(--fs-xs); font-weight: 700; color: var(--accent-hi, var(--accent)); }
  .mirror-pteams { color: var(--muted); font-weight: 600; }
  .mirror-winning {
    order: 2; display: block; flex: 0 0 auto; text-align: center; padding: 6px; font-weight: 700;
    background: rgba(var(--accent-rgb), 0.12); border: 1px solid rgba(var(--accent-rgb), 0.34); border-radius: var(--r-md);
  }
  .mirror-winning[hidden] { display: none; }
  .mirror-board { order: 3; flex: 1 1 0; min-height: 0; width: 100%; }
  /* Upright every pixel of width goes to the names; the squares are tall enough for two words. */
  .mirror-screen .board-grid-outer { padding: 5px; gap: 3px; border-radius: var(--r-lg); }
  .mirror-screen .tv-board-wrap .board-table { gap: 2px; }
  .mirror-screen .tv-board-wrap .teamA-label { padding: 8px 1px; }
  .mirror-screen .tv-board-wrap .teamA-label-text { font-size: var(--fs-md); }
  .mirror-screen .tv-board-wrap .teamA-label .team-logo { --logo-size: 20px !important; }
  .mirror-screen .cell .name-txt { white-space: normal; }
  .mirror-quarters { order: 4; flex: 0 0 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mirror-quarters .tv-qchip { padding: 2px 8px 3px; }
  .mirror-quarters .tvq-top { font-size: var(--fs-xs); }
  .mirror-quarters .tvq-score { font-size: var(--fs-xs); }
  .mirror-tip:not(.is-home) { display: none; }
  .mirror-tip.is-home { order: 99; }
  .mirror-hint { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; font-size: var(--fs-xs); color: var(--muted); }
}

/* ---- Home (R30): sections of compact cards; Account in the top bar, New game under it ---- */
.home-topbar { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
.home-topbar h1 { min-width: 0; font-size: var(--fs-lg); white-space: nowrap; }
.home-topbar .nav { flex-wrap: nowrap; gap: 8px; flex: none; }
button.home-new {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 6px; margin-top: 12px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-xl); font-size: var(--fs-md); font-weight: 700;
}
@media (min-width: 720px) { button.home-new { display: inline-flex; width: auto; } }
button.home-new svg { stroke-width: 2.5; }
button.home-acct {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 44px; min-width: 44px; padding: 0 8px; border-radius: var(--r-xl);
  background: transparent; color: var(--chrome-fg); border: 1px solid transparent; font-weight: 600; font-size: var(--fs-sm);
}
button.home-acct:hover { background: var(--panel2); border-color: var(--border); color: var(--text); }
.home-acct-email { display: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) {
  .home-topbar h1 .header-icon { display: none; }
  .home-topbar h1 { font-size: var(--fs-md); }
  .home-topbar h1.brand-pill { padding: 6px 10px; }
  button.home-acct > svg:last-child { display: none; }
}
@media (min-width: 720px) {
  .home-topbar { padding: 12px 28px; }
  .home-topbar h1 { font-size: var(--fs-xl); }
  .home-acct-email { display: inline; }
}

.main.home-main { max-width: 1260px; padding: 6px 12px 40px; }
@media (min-width: 720px) { .main.home-main { padding: 12px 28px 48px; } }
.home-sec {
  margin: 18px 2px 10px; font-family: var(--sans); font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.home-empty { color: var(--muted); margin: 24px 2px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 720px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1280px) { .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.home-grid.collapsed { display: none; }
.archive-wrap { margin-top: 18px; }
.archive-toggle { min-height: 44px; }

.home-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); text-align: center;
}
.home-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-lg);
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.home-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip-live { color: var(--live); background: rgba(var(--live-rgb), 0.14); }
.chip-soon { color: var(--accent-hi); background: rgba(var(--accent-rgb), 0.12); }
.chip-pick { color: var(--chip-fg); background: var(--chip-bg); }
.chip-final { color: var(--muted); background: rgba(179, 193, 205, 0.12); }
.chip-live .home-chip-dot { animation: home-pulse 2s ease-in-out infinite; }
@keyframes home-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .chip-live .home-chip-dot { animation: none; } }
button.home-more {
  flex: none; width: 52px; min-height: 48px; padding: 0; border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-left: 1px solid var(--border); color: var(--muted);
}
button.home-more:hover { background: var(--accent-soft); color: var(--text); }
/* The TV browser's tiles still show the matchup as team pills. */
.home-match { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: var(--fs-lg); }
.home-badge { font-size: var(--fs-md); font-weight: 800; flex: none; }
.home-match .vs-sep { flex: none; font-size: var(--fs-sm); }
/* Scoreboard (home card): team | status and date | team. Each team gets a third, so long names wrap. */
.sb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 16px 12px 12px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.sb-team .team-logo { width: var(--logo-size); height: var(--logo-size); object-fit: contain; }
.sb-name { font-size: var(--fs-md); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb-mid { display: flex; flex-direction: column; align-items: center; min-width: 92px; padding-top: 6px; }
.sb-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; background: none; }
.sb-status.chip-pick { color: var(--accent-hi, var(--accent)); }
.sb-big { font-size: var(--fs-xl); font-weight: 800; line-height: 1.2; margin-top: 3px; white-space: nowrap; }
.sb-small { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
/* Small phones: a little more room for each name, so "Buccaneers" stays one word. */
@media (max-width: 360px) {
  .sb-row { padding: 14px 8px 10px; gap: 4px; }
  .sb-mid { min-width: 76px; }
  .sb-name { font-size: 14px; }
  .sb-big { font-size: var(--fs-lg); }
}
.home-desc { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 16px 12px; margin-top: -4px; }
/* Footer: the main action and Party View, two equal halves split by a line. */
.home-actions { display: flex; margin-top: auto; border-top: 1px solid var(--border); }
button.home-primary, button.home-party {
  flex: 1; min-width: 0; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 8px; border: 0; border-radius: 0; background: transparent; font-size: var(--fs-md); font-weight: 700; white-space: nowrap;
}
button.home-primary { flex: 1.4; color: var(--accent-hi, var(--accent)); }
button.home-primary svg { stroke-width: 2.5; }
button.home-party { color: var(--text); border-left: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; }
button.home-primary:hover, button.home-party:hover { background: var(--accent-soft); }

/* The card menu and the account menu: Connect's sheet and popover, with a list of rows inside. */
.card.home-menu { margin: 0; padding: 8px; }
.connect-sheet.home-menu { padding: 8px 12px calc(20px + var(--sab)); }
.connect-pop.home-menu-pop { width: 300px; }
.home-menu-head { padding: 4px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.home-menu-title { font-size: var(--fs-lg); font-weight: 800; }
.home-menu-subtitle { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.home-menu-list { display: flex; flex-direction: column; gap: 2px; }
.home-menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
button.home-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 10px; text-align: left;
  background: transparent; color: var(--text); border: 0; border-radius: var(--r-md); font-size: var(--fs-md); font-weight: 600;
}
button.home-menu-item:hover, button.home-menu-item:focus-visible { background: var(--panel2); }
button.home-menu-item svg { flex: none; color: var(--muted); }
.home-menu-text { display: flex; flex-direction: column; min-width: 0; }
.home-menu-sub { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
button.home-menu-item[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
button.home-menu-item.danger-item, button.home-menu-item.danger-item svg { color: var(--danger); }

/* ---- Home on a TV browser: tiles a remote can reach ---- */
.main.tv-home { max-width: none; padding: 4vw 5vw 3vw; }
.tv-home .tv-home-title { margin: 0 0 2.5vw; font-family: var(--sans); font-size: clamp(1.6rem, 2.7vw, 3.25rem); font-weight: 700; }
.tv-home .tv-home-hint { margin: 2vw 0 0; font-size: clamp(1rem, 1.45vw, 1.75rem); color: var(--muted); }
.tv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4vw; padding: 1vw; margin: -1vw; }
@media (min-width: 1600px) { .tv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
button.tv-tile {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 1vw;
  min-height: 15vw; min-width: 0; padding: 1.7vw 1.9vw; text-align: left;
  background: var(--panel); color: var(--text); border: 2px solid var(--border); border-radius: var(--r-xl);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
button.tv-tile:hover { background: var(--panel); border-color: var(--border); }
button.tv-tile:focus, button.tv-tile:focus-visible {
  outline: none; border: 5px solid var(--accent); padding: calc(1.7vw - 3px) calc(1.9vw - 3px); transform: scale(1.03);
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.25), 0 0 40px rgba(var(--accent-rgb), 0.35);
}
.tv-tile .home-chip { font-size: clamp(0.95rem, 1.35vw, 1.65rem); padding: 0.35em 0.9em; border-radius: var(--r-pill); gap: 0.6em; }
.tv-tile .home-chip-dot { width: 0.55em; height: 0.55em; }
.tv-tile .home-match { width: 100%; gap: 0.8vw; }
.tv-tile .home-badge { font-size: clamp(1.4rem, 2.1vw, 2.6rem); }
.tv-tile .home-match .vs-sep { font-size: clamp(1rem, 1.4vw, 1.75rem); }
.tv-tile-desc { font-size: clamp(1rem, 1.35vw, 1.65rem); color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-tile-cta { display: inline-flex; align-items: center; gap: 0.6vw; font-size: clamp(1rem, 1.35vw, 1.65rem); font-weight: 700; color: var(--muted); }
.tv-tile-cta svg { width: 1.6em; height: 1.6em; }
button.tv-tile:focus .tv-tile-cta, button.tv-tile:focus-visible .tv-tile-cta { color: var(--accent-hi); }
button.tv-tile-pair { margin-top: 2vw; font-size: clamp(1.1rem, 1.6vw, 2rem); padding: 0.6em 1.4em; }
button.tv-tile-pair:focus { outline: 5px solid var(--accent); outline-offset: 4px; }
.home-topbar.tv-topbar { padding: 1.2vw 5vw; }
.home-topbar.tv-topbar h1 { font-size: clamp(1.4rem, 2.3vw, 2.75rem); }

/* Dialogs (ui.js overlayEl): centered when they fit; a taller one starts at its top and scrolls.
   Centering alone put the top of a tall dialog off the screen, out of reach. */
.sbs-overlay > * { margin: auto !important; }

/* Popups hold the page still: while a dialog or a menu sheet is open the page behind cannot
   scroll, so a swipe on a popup's title or edge does nothing instead of moving the page. A list
   inside a popup keeps its scroll to itself when it reaches the end. Screen only: printing the sign
   from the QR window must still lay out every page. */
@media screen {
  html:has(.sbs-overlay, .connect-layer), html:has(.sbs-overlay, .connect-layer) body { overflow: hidden; }
}
.sbs-overlay, .connect-layer, .sbs-overlay *, .connect-layer * { overscroll-behavior: contain; }

/* Popup backdrop: every popup blurs the page behind it, on top of its own dim. The dialogs
   (overlayEl), the Connect bottom sheet, and the TV's quarter celebration. The draw reveal and the
   game-end summary are opaque, so they have nothing to blur. With reduced transparency: dim only. */
.sbs-overlay, .connect-layer-sheet, .connect-layer-center, .tv-celebration {
  -webkit-backdrop-filter: blur(var(--blur-backdrop));
  backdrop-filter: blur(var(--blur-backdrop));
}
@media (prefers-reduced-transparency: reduce) {
  .sbs-overlay, .connect-layer-sheet, .connect-layer-center, .tv-celebration { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---- Theme page (R33) ----
   Each card wears its own theme (data-theme on the label), so the tokens below resolve to that
   card's palette, not the page's. */
.theme-main { max-width: 1200px; }
.theme-intro { margin: 0 0 18px; color: var(--muted); font-size: var(--fs-md); line-height: 1.45; text-align: center; }
.theme-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 720px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
label.theme-card {
  position: relative; display: block; margin: 0; min-height: 44px; cursor: pointer;
  background: var(--panel); color: var(--text); font-size: var(--fs-md); font-weight: 400;
  border: 2px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
label.theme-card:hover { border-color: var(--border-strong); }
label.theme-card.is-chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-card); }
.theme-radio:focus-visible + .theme-face { outline: 3px solid var(--accent); outline-offset: 5px; border-radius: var(--r-md); }
.theme-radio { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.theme-face { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 16px; }
.theme-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.theme-name { font-size: var(--fs-lg); font-weight: 700; }
.theme-check {
  display: none; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
}
.theme-check svg { width: 16px; height: 16px; }
label.theme-card.is-chosen .theme-check { display: inline-flex; }
.theme-desc { color: var(--muted); font-size: var(--fs-sm); }
.theme-mini {
  display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
}
.theme-mini-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.theme-mini-teams { justify-content: flex-start; flex-wrap: nowrap; }
.theme-mini-teams .team-badge { flex: 0 1 auto; min-width: 0; }
.theme-btn {
  display: inline-block; padding: 5px 14px; border-radius: var(--radius); font-size: var(--fs-sm); font-weight: 600;
  background: var(--btn-fill); color: var(--btn-text); border: 1px solid var(--btn-edge);
}
.theme-mini-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.theme-mini-cell {
  display: flex; align-items: center; justify-content: center; min-width: 0; height: 26px; border-radius: var(--r-xs);
  background: var(--cell-empty); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.theme-mini-cell.is-filled { background: var(--panel); box-shadow: inset 0 0 0 1px var(--border-strong); }
.theme-mini-cell .name-txt { font-size: var(--fs-2xs); font-weight: 600; line-height: 1; }
.theme-pill { padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; border: 1px solid; }
.theme-pill.is-paid { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.theme-pill.is-part { background: var(--part-soft); color: var(--part); border-color: var(--part); }
.theme-pill.is-unpaid { background: var(--danger-soft); color: var(--bad-text); border-color: var(--danger); }
.theme-status { min-height: 1.5em; margin: 16px 0 0; text-align: center; color: var(--muted); font-size: var(--fs-md); }
.theme-status.is-error { color: var(--bad-text); }
@media (max-width: 719px) { .theme-main.main { padding-left: 16px; padding-right: 16px; } }

/* ---- R35: wide Game Day and the Party View grid on the host screens ----
   .glass-board is the board card on wide Game Day (.gd-wide) and wide picking (.pick-fill.is-wide).
   The look (glass frame, glowing numbers, fading team bars, the winner's pulse) is shared with
   .tv-screen above; what follows is only the size: the grid fills the room it is given, squares
   stretch (they are not square), and the sizes follow the window's height like Party View's do.
   Measured on Party View at 1366x768: bar 55 px, logo 46, bar text 26.6, numbers 32.8, names 21.9;
   the smaller grid here scales those down (44 px bar at 768, 58 px at 1080). */
.glass-board {
  --g-bar: clamp(38px, calc(10px + 4.5vh), 60px);
  --g-bar-font: clamp(20px, calc(8px + 2.2vh), 34px);
  --g-logo: calc(var(--g-bar) * 0.82);
  --g-head: clamp(20px, calc(2px + 3.5vh), 42px);
  --g-name: clamp(12px, calc(1px + 2.2vh), 26px);
}
.glass-board #board-holder, .glass-board .gd-board-holder { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; }
.glass-board .board-grid-outer { flex: 1 1 auto; min-width: 0; gap: 0; }
.glass-board .board-scroll { overflow: visible; padding-bottom: 0; min-width: 0; min-height: 0; }
.glass-board .board-table {
  height: 100%;
  width: auto;
  margin: 0;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(0, 1fr));
}
.glass-board .cell,
.glass-board .cell.empty-pick[role=button] { min-width: 0; min-height: 0; padding: 0 2px; }
.glass-board .cell.head { font-size: var(--g-head); font-weight: 800; }
.glass-board .cell.head.corner { background: transparent; border: 0; }
.glass-board .cell .name-txt {
  padding-top: 0; font-size: var(--g-name); font-weight: 400; line-height: 1.1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; word-break: normal;
}
.glass-board .cell .badge { font-size: clamp(0.6rem, 1.5vh, 0.85rem); }
/* The team bars: the row team's stays vertical, flush to the row numbers; logo and name centered. */
.glass-board .teamB-label { height: var(--g-bar); padding: 0 14px; font-size: var(--g-bar-font); border: 0; }
.glass-board .teamA-label { width: var(--g-bar); padding: 14px 0; border: 0; }
.glass-board .teamA-label-text { font-size: var(--g-bar-font); }
.glass-board .teamB-label > span { font-size: var(--g-bar-font); }
.glass-board .teamA-label .team-logo,
.glass-board .teamB-label .team-logo { --logo-size: var(--g-logo) !important; padding: 3px; }
.glass-board .teamB-label, .glass-board .teamA-label { border-radius: var(--r-sm); }
/* Host screens show the shared dashed red ring on a square not paid for (the legend's swatch matches). */
.glass-board .legend-chip { background: transparent; box-shadow: none; border: 2px dashed var(--unpaid); width: 12px; height: 12px; border-radius: var(--r-xs); box-sizing: border-box; }
/* Picking: the hover plus sign, the pick color and the check keep working on the glass squares. */
.glass-board .cell.empty-pick:hover { box-shadow: inset 0 0 0 2px var(--pick-color, var(--accent)); }
.glass-board .cell.selected, .glass-board .cell.empty-pick.selected:hover { background: var(--pick-color, var(--accent)); box-shadow: none; }
.glass-board .cell.is-tappable:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.glass-board .cell.empty-pick:not(.selected)[role=button]:hover::after { font-size: calc(var(--g-name) * 1.4); }
@media (prefers-reduced-motion: reduce) { .glass-board .cell.winner { animation: none; } }

@media (min-width: 1024px) {
  /* The page is the window: the top bar, then a row that takes the rest. Below 600 px of height it
     scrolls again rather than crush the grid. */
  #app.fit-screen { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .main.gd-main { flex: 1 1 0; min-height: 0; display: flex; padding: 12px 24px; max-width: 1800px; }
  .pick-layout.gd-wide {
    --side-w: clamp(340px, 30vw, 440px);
    flex: 1 1 auto; min-width: 0; min-height: 0;
    display: grid; gap: 18px; align-items: stretch;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
  }
  .gd-wide > .gd-side, .gd-wide .gd-board { margin: 0; }
  .gd-wide .live-score-bar { display: none; } /* the status shows above the grid (.gd-src) */

  /* The top bar: Home, the matchup centered (as on the picking screen), then the rest. */
  .topbar.gd-topbar-center:not(.gd-topbar-phone) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-head { flex-direction: column; align-items: center; gap: 3px; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-match { max-width: 100%; justify-content: center; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-meta { max-width: 100%; }
  .gd-topbar-center:not(.gd-topbar-phone) .home-btn { justify-self: start; }
  .gd-topbar-center:not(.gd-topbar-phone) .nav { justify-content: flex-end; min-width: 0; }
  .gd-topbar-center:not(.gd-topbar-phone) .nav > * { flex: none; }

  /* The panel: tabs on top, one pane below it. Only the pane's content scrolls. */
  .gd-side { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 0; overflow: hidden; }
  .gd-side > .gd-tabs { margin: 0; padding: 0 12px; flex: none; }
  /* Four tabs (Score, Live, Players, Helpers) share a 340 px panel on an iPad in landscape: slim
     padding so none is cut off. */
  .gd-side .gd-tab { min-height: 48px; min-width: 0; padding: 0 6px; white-space: nowrap; }
  .gd-pane { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
  .gd-pane[hidden] { display: none; }
  .gd-side .score-panel { background: none; border: 0; border-radius: 0; padding: 0; gap: 10px; flex: none; }
  .gd-side .sp-num { min-height: 56px; font-size: var(--fs-3xl); }
  .gd-side .sp-team, .gd-side .sp-plays { gap: 6px; }
  .gd-side .sp-play { min-height: 44px; padding: 0 10px; }
  .gd-side .sp-play-label { font-size: var(--fs-sm); }
  .gd-side .sp-end { min-height: 48px; font-size: var(--fs-md); }

  .gd-pane { container-type: inline-size; }

  /* Players: the numbers, then then the list (the only thing that scrolls). */
  .gd-pane.players-sec { overflow: hidden; }
  .gd-side .players-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; }
  .gd-side .fill-players { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-right: 4px; border-top: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

  /* The stage: score, sold, pot and price above the glass frame, the legend below it. */
  .gd-stage { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
  .gd-stage > .gd-board { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding: 0; background: none; border: 0; box-shadow: none; }
  .gd-stage-head { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; min-height: 44px; }
  .gd-now { flex: 1 0 auto; max-width: 100%; min-width: 0; display: flex; align-items: baseline; gap: 10px; font-size: var(--fs-lg); font-weight: 700; white-space: nowrap; }
  .gd-nm { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
  .gd-nm-abbr { display: none; }
  .gd-stage-head.is-short .gd-nm-full { display: none; }
  .gd-stage-head.is-short .gd-nm-abbr { display: inline; }
  .gd-pts { flex: none; font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; }
  .gd-dash { color: var(--muted); flex: none; }
  .gd-when { flex: none; color: var(--accent); font-size: var(--fs-md); font-weight: 800; }
  .gd-src { flex: none; align-self: center; padding: 1px 9px; border-radius: var(--r-pill); border: 1px solid currentColor; font-size: var(--fs-2xs); font-weight: 800; letter-spacing: 0.06em; }
  .gd-src.is-live { color: var(--good); }
  .gd-src.is-sim, .gd-src.is-manual { color: var(--accent); }
  .gd-src.is-off { color: var(--warn); }
  .gd-stat { flex: none; display: flex; align-items: center; gap: 6px; min-height: 44px; margin: 0; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
  .gd-stat .val { font-size: var(--fs-lg); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
  .gd-pot { cursor: text; }
  .gd-pot-in { display: inline-flex; align-items: baseline; color: var(--accent); font-size: var(--fs-lg); font-weight: 800; }
  .gd-pot-in input.val-input {
    width: 4ch; min-height: 0; padding: 0; margin: 0; background: transparent; border: 0; border-bottom: 1px solid transparent;
    border-radius: 0; box-shadow: none; color: var(--accent); font: inherit; text-align: left; -moz-appearance: textfield; appearance: textfield;
  }
  .gd-pot-in input.val-input::-webkit-outer-spin-button, .gd-pot-in input.val-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .gd-pot:hover input.val-input, .gd-pot-in input.val-input:focus { border-bottom-color: var(--accent); }
  .gd-pot-edit { display: inline-flex; color: var(--muted); }
  .gd-pot-edit svg { width: 14px; height: 14px; }
  .gd-stage .board-legend { flex: none; margin-top: 0; font-weight: 500; }

  /* Wide picking: the same room for the grid, no card around it. */
  .pick-fill.is-wide .board-head { flex: none; margin-bottom: 8px; }
  .pick-fill.is-wide .board-legend { flex: none; margin-top: 8px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .gd-stage-head { gap: 4px 12px; }
  .gd-now { gap: 6px; }
  .gd-stat { gap: 4px; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-party { width: 44px; padding: 0; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-party span { display: none; }
  .gd-topbar-center:not(.gd-topbar-phone) button.gd-onair { padding: 0 10px; font-size: var(--fs-xs); }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .gd-side .sp-play { min-height: 38px; }
  .gd-side .fill-player { padding: 4px 0; }
  .gd-side button.fill-player-info { display: flex; align-items: center; gap: 8px; min-height: 34px; }
  .gd-side .fill-player-info .player-name { flex: none; font-size: var(--fs-lg); }
  .gd-side .fill-player-info .player-sub { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-sm); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gd-side button.paid-pill { min-height: 32px; min-width: 82px; padding: 2px 8px; font-size: var(--fs-sm); }
}
/* A short laptop window: the top bar tightens, as the picking screen's does. */
@media (min-width: 1024px) and (max-height: 800px) {
  .topbar.gd-topbar-center:not(.gd-topbar-phone) { min-height: 64px; padding-top: 4px; padding-bottom: 4px; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-head { gap: 0; }
}
/* Game Day: one line per quarter, with the payouts (every width). */
.gd-results { container-type: inline-size; }
.gd-results .score-panel { background: none; border: 0; border-radius: 0; padding: 0 0 12px; }
.gd-quarters { display: flex; flex-direction: column; border-top: 1px solid var(--border); padding-top: 10px; flex: none; }
.gd-qhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 4px; }
.gd-qhead h3 { margin: 0; font-size: var(--fs-md); }
.gd-qeach { color: var(--muted); font-size: var(--fs-sm); }
.gd-qlist { list-style: none; margin: 0; padding: 0; }
.gd-q { display: grid; grid-template-columns: 3rem 4rem minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; min-height: 52px; border-top: 1px solid var(--border); }
.gd-q-lbl { font-weight: 800; color: var(--muted); }
.gd-q-score { font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-q-who { min-width: 0; display: flex; flex-direction: column; }
.gd-q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gd-q-amt { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-q-who.is-dim .gd-q-name { color: var(--muted); font-weight: 500; }
.gd-q-who.is-push .gd-q-name { color: var(--warn); white-space: normal; }
button.gd-pay { min-height: 44px; padding: 0 12px; border-radius: var(--r-xl); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; box-shadow: none; }
button.gd-pay.is-owed { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
button.gd-pay.is-paid { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.gd-q-note { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 0 0 10px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.35; }
.gd-q-note.is-push { color: var(--warn); }
.gd-q-note.is-settle { margin-bottom: 10px; padding: 8px 10px; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--r-md); color: var(--warn); }
.gd-q-msg { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
/* A narrow panel: Mark paid out moves under the score, so the winner's name keeps its room. */
@container (max-width: 350px) {
  .gd-q { grid-template-columns: 2.6rem 3.6rem minmax(0, 1fr) auto; }
  .gd-q-fix-slot { grid-column: 4; grid-row: 1; }
  .gd-q-pay { grid-column: 2 / 4; grid-row: 2; justify-self: start; }
  .gd-q-pay:not(:empty) { padding-bottom: 6px; }
}
/* A very short window scrolls the page instead of crushing the grid. */
@media (min-width: 1024px) and (max-height: 599px) {
  #app.fit-screen { height: auto; overflow: visible; }
  .main.gd-main, #app.fit-screen .main.pick-main { min-height: 560px; }
}

/* ==========================================================================
   Phone grids: thin light lines
   Host picking (.is-tabbed), Game Day on a phone (.gd-phone), and the guest's pick board
   grid share one look: a flat sheet, one 1 px light line between squares, no rounded corners. The
   line is the table's own background showing through a 1 px gap, so every square's fill is opaque.
   ========================================================================== */
.is-tabbed, .gd-phone, .gp-board {
  --g-line: #75808b;
  --g-taken: var(--panel3);
  --g-mine: var(--panel3);
  --g-hover: var(--panel3);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .is-tabbed, .gd-phone, .gp-board {
    --g-line: color-mix(in srgb, var(--muted) 62%, var(--panel));
    --g-taken: color-mix(in srgb, var(--muted) 24%, var(--panel));
    --g-mine: color-mix(in srgb, var(--accent) 34%, var(--panel));
    --g-hover: color-mix(in srgb, var(--accent) 16%, var(--panel2));
  }
}
.pick-fill.is-tabbed .board-table, .gd-phone .board-table {
  gap: 1px; padding: 0; background: var(--g-line); border: 1px solid var(--g-line); border-radius: var(--r-xs); overflow: hidden;
}
/* An upright iPad's grid: softer lines, so the names and highlights lead. The board narrows to
   fit the screen (fitBoardHeight), centered. */
/* Near-black seams: the 1 px gap lands on 1-2 screen pixels under the iPad's 1.3 zoom, and a light
   line there read as thick, uneven bars between colored squares. A dark one reads as a clean seam. */
.gd-big .board-table { --g-line: color-mix(in srgb, var(--panel) 30%, #000); }
.gd-big .gd-board-holder { margin-inline: auto; }
/* The rows split a square board evenly and each square fills its row, rather than each square sizing
   its row by aspect-ratio: Safari can lay that out with rows taller than the squares after the tab
   was hidden, and the dark line color then shows as wide bands between rows. */
.gd-big .board-table { aspect-ratio: 1; grid-template-rows: repeat(11, minmax(0, 1fr)); }
.gd-big .board-table .cell { aspect-ratio: auto; min-height: 0; height: auto; }
/* The grid's markers keep one color in every theme, so they mean the same thing whatever the
   scheme: yellow won a quarter (--q-win), red dashes not paid (--unpaid below), green glow winning
   now, blue corner brackets one score away, orange arrow a push. */
.gd-big, .board-legend { --gdi-now-rgb: 46, 204, 113; --gdi-near: rgb(141, 189, 232); --gdi-push: #ff9f43; }
/* A square one score away: blue corner brackets, still (only the winning square moves). */
.gd-big .cell.live-near { overflow: hidden; }
.gd-big .cell.live-near::after, .board-legend .legend-chip.is-near::after {
  content: ''; position: absolute; inset: 2px; border-radius: 0; animation: none; box-shadow: none; pointer-events: none;
  --b: var(--gdi-near); --l: 9px; --w: 1px;
  background:
    linear-gradient(var(--b), var(--b)) top left / var(--l) var(--w) no-repeat,
    linear-gradient(var(--b), var(--b)) top left / var(--w) var(--l) no-repeat,
    linear-gradient(var(--b), var(--b)) top right / var(--l) var(--w) no-repeat,
    linear-gradient(var(--b), var(--b)) top right / var(--w) var(--l) no-repeat,
    linear-gradient(var(--b), var(--b)) bottom left / var(--l) var(--w) no-repeat,
    linear-gradient(var(--b), var(--b)) bottom left / var(--w) var(--l) no-repeat,
    linear-gradient(var(--b), var(--b)) bottom right / var(--l) var(--w) no-repeat,
    linear-gradient(var(--b), var(--b)) bottom right / var(--w) var(--l) no-repeat;
}
.gd-big .cell.live-dim::after { opacity: 0.5; }
.board-legend .legend-chip.is-near { position: relative; border: 0; background: transparent; }
.board-legend .legend-chip.is-near::after { inset: 0; --l: 5px; }
.gd-big .board-legend { justify-content: center; }
/* The square winning now: a green frame that glows and pulses inward; the name stays still. */
.gd-big .cell.live-winner { overflow: hidden; }
.gd-big .cell.live-winner::after { border-radius: 0; animation: gdi-win-in 1.8s ease-in-out infinite; }
.gd-big .cell.live-winner .name-txt { animation: none; font-weight: 800; }
.board-legend .legend-chip.is-live { border: 2px solid rgb(var(--gdi-now-rgb)); background: transparent; animation: gdi-win-in 1.8s ease-in-out infinite; }
@keyframes gdi-win-in {
  0%, 100% { box-shadow: inset 0 0 0 2px rgb(var(--gdi-now-rgb)), inset 0 0 3px 2px rgba(var(--gdi-now-rgb), 0.35); }
  50% { box-shadow: inset 0 0 0 2px rgb(var(--gdi-now-rgb)), inset 0 0 9px 5px rgba(var(--gdi-now-rgb), 0.7); }
}
@media (prefers-reduced-motion: reduce) { .gd-big .cell.live-winner::after, .board-legend .legend-chip.is-live { animation: none; box-shadow: inset 0 0 0 2px rgb(var(--gdi-now-rgb)); } }
.pick-fill.is-tabbed > :not(.gd-big) .cell, .pick-fill.is-tabbed > :not(.gd-big) .cell.empty-pick[role=button], .gd-phone .cell { background: var(--panel2); border-radius: 0; box-shadow: none; }
.pick-fill.is-tabbed > :not(.gd-big) .cell.head, .gd-phone .cell.head { background: var(--panel3); color: var(--text); text-shadow: none; }
.pick-fill.is-tabbed > :not(.gd-big) .cell.head.corner, .gd-phone .cell.head.corner { background: var(--panel); }
.pick-fill.is-tabbed > :not(.gd-big) .cell.filled, .gd-phone .cell.filled { background: var(--panel3); box-shadow: none; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .pick-fill.is-tabbed > :not(.gd-big) .cell.filled, .gd-phone .cell.filled { --fill: color-mix(in srgb, var(--who, var(--muted)) 24%, var(--panel)); background: var(--fill); }
  .is-tabbed .cell .name-txt, .gd-phone .cell .name-txt { color: color-mix(in srgb, var(--nc, var(--text)) 60%, var(--text-strong)); }
}
/* Picking's "?" is the drawn numbers' square, only quieter. */
.pick-fill .board-table .cell.head.pending { color: var(--muted); text-shadow: none; }
.gd-phone .cell.pushed { background: #2b1515; }
.pick-fill.is-tabbed .cell.empty-pick:hover, .pick-fill.is-tabbed .cell.is-tappable:hover { box-shadow: inset 0 0 0 2px var(--pick-color, var(--accent)); }
.pick-fill.is-tabbed .cell.empty-pick[role=button].selected { background: var(--pick-color, var(--accent)); box-shadow: none; }
.gd-phone .cell.winner, .gd-phone .cell.filled.winner { box-shadow: inset 0 0 0 2px var(--q-win); }
.gd-phone .cell.filled.is-unpaid.winner { box-shadow: inset 0 0 0 3px var(--fill, var(--panel2)), inset 0 0 0 5px var(--q-win); }
.gd-phone .cell .name-txt { padding-top: 0; font-size: var(--fs-3xs); line-height: 1.1; font-weight: 600; }
.gd-phone .cell.winner .name-txt, .gd-phone .cell.pushed .name-txt { padding-top: 8px; }
.gd-phone .legend-chip { background: transparent; box-shadow: none; border: 2px dashed var(--unpaid); box-sizing: border-box; }
/* Game Day's team bars are solid, as on the picking board. */
.gd-phone .board-grid-outer { gap: 2px; }
.gd-phone .board-scroll { overflow: visible; padding-bottom: 0; }
.gd-phone .teamA-label, .gd-phone .teamB-label { border-radius: var(--r-sm); background: var(--team) padding-box !important; box-shadow: inset 0 0 0 1px var(--edge, transparent); }
.gd-phone .teamB-label { padding: 1px 8px; font-size: var(--fs-sm); }
.gd-phone .teamA-label { padding: 6px 1px; }
.gd-phone .teamA-label-text { font-size: var(--fs-sm); }
.gd-phone .teamA-label .team-logo, .gd-phone .teamB-label .team-logo { --logo-size: 16px !important; padding: 1px; }
@media (max-width: 699px) {
  .main.gd-phone { padding: 10px 10px calc(16px + var(--sab)); }
  .gd-phone .card { padding: 10px 8px; }
}

.gp-board { gap: 1px; background: var(--g-line); border: 1px solid var(--g-line); border-radius: var(--r-xs); overflow: hidden; }
.gp-cell { border: 0; border-radius: 0; background: var(--panel2); }
.gp-cell:hover:not(:disabled) { background: var(--g-hover); }
.gp-cell.is-other { background: var(--g-taken); }
.gp-cell.is-mine, .gp-cell.is-mine:hover:not(:disabled) { background: var(--g-mine); color: var(--text-strong); }
.gp-cell.is-sel, .gp-cell.is-sel:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.gp-cell.is-sel::after { content: "\2713"; font-size: var(--fs-sm); font-weight: 800; }
.gp-cell.is-rel, .gp-cell.is-rel:hover:not(:disabled) { background: var(--danger-soft); color: var(--text); box-shadow: inset 0 0 0 2px var(--danger); }
.gp-cell:disabled, .gp-cell.is-open:disabled { opacity: 1; }
.gp-cell.is-open:disabled { background: var(--panel); }
.gp-cell:focus-visible { outline: 3px solid var(--accent-hi); outline-offset: -3px; }


/* ---- A guest's read-only board (R44, screen-mirror.js) ---- */
.mirror-screen.is-guest .cell[data-i] { cursor: pointer; }
.mirror-screen.is-guest .cell.is-yours { outline: 3px solid var(--text); outline-offset: -3px; z-index: 1; }
.mirror-screen.is-guest .cell[data-i]:focus-visible { outline: 3px dashed var(--accent); outline-offset: -1px; z-index: 2; }
.mirror-label { position: fixed; left: 0; top: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; max-width: calc(100vw - 8px); padding: 6px 12px; box-sizing: border-box; background: var(--panel); color: var(--text); border: 1px solid var(--accent); border-radius: var(--r-md); box-shadow: var(--shadow-pop); pointer-events: none; visibility: hidden; white-space: nowrap; }
.mirror-label.is-on { visibility: visible; }
.mirror-label span { color: var(--muted); font-size: var(--fs-xs); }

/* ---- Player View: Live tab, rules sheet and the You won banner (R44) ---- */
.pl-row.is-mine { border: 1px solid var(--good); }
/* Live tab: what lands on a near square ("WSH +3 field goal"). */
.pl-needs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 4px; font-size: var(--fs-sm); color: var(--muted); }
.pl-need strong { color: var(--accent); font-weight: 800; }
.pl-need-team { color: var(--text); font-weight: 700; }
.pl-row .psi-coord { white-space: nowrap; flex: none; }
.pl-need-or { font-size: var(--fs-xs, 0.75rem); opacity: 0.8; }
.pl-who { min-width: 0; overflow-wrap: anywhere; }
.pl-you { color: var(--good); font-weight: 800; font-size: var(--fs-sm); }
.pl-pays { margin: 12px 0 0; line-height: 1.4; }
/* Live tab: why a group of near squares is likely (who has the ball, a try to come). */
.pl-note { margin: 0 0 10px; line-height: 1.4; color: var(--muted); }
.pl-far .player-square-item { opacity: 0.75; }
.ph-rules { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.ph-rules p { margin: 0 0 10px; line-height: 1.45; }
.ph-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 0 0 12px; }
.ph-split dt { color: var(--muted); }
.ph-split dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-host-pays { font-weight: 700; }
.win-banners { display: flex; flex-direction: column; gap: 8px; }
.win-banners:empty, .win-banners[hidden] { display: none; }
.win-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 2px solid var(--good); border-radius: var(--r-lg); background: var(--panel); }
.win-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.win-text strong { color: var(--good); font-size: var(--fs-lg); }
button.win-dismiss { flex: none; min-height: 44px; }
button.win-slim { width: 100%; min-height: 44px; background: var(--panel); color: var(--good); border: 1px solid var(--good); font-weight: 700; }


/* ---- Edit game (R41, screen-edit.js) ---- */
.eg { display: flex; flex-direction: column; width: 100%; max-width: 600px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; font-size: var(--fs-md); }
.eg-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: calc(10px + var(--sat)) 14px 10px; background: var(--bg); border-bottom: 1px solid var(--border); }
.eg-head h1 { flex: 1; margin: 0; font-size: var(--fs-xl); }
.eg-chip { flex: none; padding: 5px 12px; border-radius: var(--r-lg); background: var(--panel2); font-weight: 800; font-size: var(--fs-sm); }
.eg-chip.is-locked { background: var(--warn-soft); color: var(--warn); }
.eg-chip.is-underWay { background: var(--danger-soft); color: var(--danger); }
.eg-chip.is-over { background: var(--good-soft); color: var(--good); }
.eg-body { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.eg-note { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--panel2); line-height: 1.4; }
.eg-note.is-underWay { background: var(--warn-soft); }
.eg-sec { flex: none; display: flex; flex-direction: column; gap: 14px; padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); }
.eg-sec h2 { margin: 0; font-size: var(--fs-md); color: var(--accent-hi); }
.eg .eg-field, .eg-sheet .eg-field { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.eg .eg-field input, .eg-sheet .eg-field input { width: 100%; min-width: 0; box-sizing: border-box; min-height: 48px; }
.eg .checkbox-label { min-height: 44px; margin: 0; }
.eg-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.eg-two > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.eg-four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.eg-four input { padding-left: 8px; padding-right: 4px; }
.eg-pays { font-weight: 600; font-variant-numeric: tabular-nums; }
.eg-total { font-weight: 700; color: var(--good); }
.eg-total.is-bad { color: var(--danger); }
button.eg-pill { flex: 1 0 auto; min-height: 44px; padding: 0 16px; border-radius: var(--r-xl); background: transparent; color: var(--text); border: 1px solid var(--border-strong); font-weight: 700; }
button.eg-choice[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
/* A choice strip: one look for every one-of-several choice in the app (Steve, 2026-11-28, look F):
   Edit game, the new-game form, the Players filter and the admin range picker. The strip draws
   the outer border and clips; each segment draws its left and top divider and is pulled 1 px out
   under that border, so the first of each row hides its divider and the rest show a line between
   options (a later sibling paints over an earlier one, so a right-edge divider would be covered).
   Segments are 34 px, shorter than 48 px buttons and fields, so a choice does not read as an
   action. The picked segment is a translucent accent fill ringed in the accent at 70%; the ring is
   an inset outline so it covers that segment's own dividers and stays on after focus. */
.choice-strip { display: flex; flex-wrap: wrap; gap: 0; padding: 0; border: 1px solid var(--border-strong); border-radius: 0; overflow: hidden; }
.choice-strip > button, .choice-strip > .pill {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); font-weight: 700; text-align: center;
  border: 0; border-radius: 0; box-shadow: none; margin: -1px 0 0 -1px;
  border-left: 1px solid var(--border-strong); border-top: 1px solid var(--border-strong);
  background: var(--panel2); color: var(--muted);
}
.choice-strip > button:hover, .choice-strip > .pill:hover { background: var(--accent-soft); color: var(--text); border-color: var(--border-strong); }
.choice-strip > button:focus-visible, .choice-strip > .pill:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-hi); }
.choice-strip > [aria-pressed="true"], .choice-strip > .pill.active {
  background: rgba(var(--accent-rgb), 0.3); color: var(--text-strong);
  outline: 2px solid rgba(var(--accent-rgb), 0.7); outline-offset: -2px;
}
.choice-strip > .pill.disabled { background: var(--panel2); color: var(--muted); }
/* A list of names (who is helping; which of two same-named players) is the strip as a two-column
   grid, every name the same width. The last chip on a row of its own spans both columns, so with
   an even number of players "Someone else" is a full-width row and with an odd number it sits
   beside the last name (Steve, 2026-11-28). The list scrolls past 40% of the screen. */
.helpers-people.choice-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 40vh; overflow-y: auto; }
.helpers-people.choice-strip > button { min-width: 0; padding: 6px 10px; overflow-wrap: anywhere; }
.helpers-people.choice-strip > button:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* Where the list is at least 330px wide (the Game Day side panel on a laptop or PC) it is three
   columns, about 113px each at 1366, enough for any 10-letter name. The last chip fills what is left
   of the last row, 2 or 3 cells; with one cell left it takes a full row of its own, since
   "Someone else" would be squeezed in a single cell (Steve, 2026-11-28). */
:has(> .helpers-people.choice-strip) { container-type: inline-size; }
@container (min-width: 330px) {
  .helpers-people.choice-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .helpers-people.choice-strip > button:last-child:nth-child(3n+1),
  .helpers-people.choice-strip > button:last-child:nth-child(3n) { grid-column: 1 / -1; }
  .helpers-people.choice-strip > button:last-child:nth-child(3n+2) { grid-column: span 2; }
}
.choice-strip[hidden] { display: none; }
.eg-summary { display: flex; align-items: center; gap: 12px; }
.eg-summary > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.eg-summary button.eg-pill { flex: none; }
.eg-lbl { font-size: var(--fs-md); font-weight: 700; }
.eg-val { font-size: var(--fs-md); font-weight: 600; }
.eg-sub { font-size: var(--fs-md); font-weight: 500; color: var(--muted); }
.eg-why { display: flex; gap: 8px; margin: 0; font-size: var(--fs-md); line-height: 1.35; color: var(--warn); }
.eg-why svg { flex: none; }
.eg-hint { margin: 0; font-size: var(--fs-md); font-weight: 500; line-height: 1.4; color: var(--muted); }
.eg-text { margin: 0; line-height: 1.4; }
.eg-fixed { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; }
.eg-fixed dt { font-size: var(--fs-md); color: var(--muted); }
.eg-fixed dd { margin: 0; font-size: var(--fs-lg); font-weight: 700; overflow-wrap: anywhere; }
.eg-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px calc(16px + var(--sab)); background: var(--bg); border-top: 1px solid var(--border); }
.eg-error, .eg-message { margin: 0; font-size: var(--fs-md); font-weight: 700; line-height: 1.35; }
.eg-error { color: var(--danger); }
.eg-message { color: var(--good); }
button.eg-primary { flex: none; min-height: 54px; font-size: var(--fs-lg); font-weight: 800; }
button.eg-secondary { flex: none; min-height: 50px; }
button.eg-unlock { width: 100%; margin-top: 4px; }
.eg-sheet { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.eg-sheet h3, .eg-sheet p { margin: 0; line-height: 1.4; }
.eg-change { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); overflow-wrap: anywhere; }
.eg-arrow { color: var(--muted); }
.eg-fromto strong { color: var(--accent); }
.eg-warn { color: var(--warn); line-height: 1.4; }
.eg-marks, .eg-games { display: flex; flex-direction: column; gap: 8px; }
button.eg-choice { display: flex; flex-direction: column; gap: 3px; min-height: 48px; padding: 10px 14px; text-align: left; background: var(--bg); color: var(--text); border: 2px solid var(--border-strong); border-radius: var(--r-md); font-weight: 600; line-height: 1.35; }
.eg-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
button.eg-side { align-items: center; text-align: center; min-height: 76px; overflow-wrap: anywhere; }
button.eg-side strong { font-size: var(--fs-lg); }
/* Edit game as a popup (screen-edit.js openPopup): a centered dialog from 768 px, a full-screen sheet
   below. The head and foot stay put; only the body scrolls. */
html.eg-lock { overflow: hidden; }
/* A window like every other dialog (.card, .sp-sheet): the panel color with the strong border, not the
   page background. Its sections sit one step up, and the note one more. */
.eg.eg-popup { flex: none; width: 100%; max-width: 720px; min-height: 0; height: auto; max-height: 90vh; max-height: 90dvh; overflow: hidden; background: var(--panel); border: 1px solid var(--border-strong, var(--border)); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.eg-popup:focus { outline: none; }
.eg-popup .eg-head { position: static; padding-top: 10px; flex: none; background: var(--panel); }
.eg-popup .eg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.eg-popup .eg-foot { position: static; flex: none; padding-bottom: 14px; background: var(--panel); }
.eg-popup .eg-sec { background: var(--panel2); }
.eg-popup .eg-note { background: var(--panel3); }
@media (max-width: 767px) {
  .eg-overlay { padding: 0 !important; }
  .eg.eg-popup { max-width: none; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .eg-popup .eg-head { padding-top: calc(10px + var(--sat)); }
  .eg-popup .eg-foot { padding-bottom: calc(14px + var(--sab)); }
}
button.gd-bar-btn.gd-edit[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
/* The picking screen's bar: Edit game, then (not a phone) Party View, and Connect on the right. */
.topbar.pick-topbar { grid-template-columns: 44px minmax(0, 1fr) auto; }
.pick-topbar .nav { flex-wrap: nowrap; gap: 8px; }
.pick-topbar.gd-topbar-phone .nav { gap: 4px; }
@media (min-width: 1024px) and (max-width: 1599px) {
  /* Icons only for Edit game and Party View, so the join chip stays clear of the matchup. */
  .gd-topbar-center:not(.gd-topbar-phone) button.gd-edit, .gd-topbar-center:not(.gd-topbar-phone) .gd-party { width: 44px; padding: 0; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-edit span, .gd-topbar-center:not(.gd-topbar-phone) .gd-party span { display: none; }
}
@media (min-width: 1024px) {
  .topbar.pick-topbar:not(.gd-topbar-phone) { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
}
@media (min-width: 1024px) and (max-width: 1599px) {
  .pick-topbar:not(.gd-topbar-phone) button.gd-edit, .pick-topbar:not(.gd-topbar-phone) .gd-party { width: 44px; padding: 0; }
  .pick-topbar:not(.gd-topbar-phone) .gd-edit span, .pick-topbar:not(.gd-topbar-phone) .gd-party span { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .pick-topbar:not(.gd-topbar-phone) button.gd-bar-btn.gd-connect { width: 44px; padding: 0; }
  .pick-topbar:not(.gd-topbar-phone) .gd-connect span { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .gd-topbar-center:not(.gd-topbar-phone) button.gd-bar-btn.gd-connect { width: 44px; padding: 0; }
  .gd-topbar-center:not(.gd-topbar-phone) .gd-connect span { display: none; }
}

/* ---- Phone-width boards (under 480 px) ----
   Squares are about 27 px, so a name shows as two initials and a quarter badge as a corner
   triangle. The full name and the badge text stay for screen readers; a tap names the square. */
.cell .nm-init { display: none; }
@media (max-width: 479px) {
  .tv-screen .tv-board-wrap .board-table { grid-template-columns: repeat(11, minmax(0, 1fr)); }
  .tv-screen .tv-board-wrap .cell:not(.head) { padding: 0 1px; }
  .tv-screen .cell.live-winner .name-txt { animation: none; font-weight: 800; }
  /* The corner is narrower than the QR caption: it sits just above the box, in the panel's ring. */
  .tv-screen .tv-corner-qr-label { position: absolute; left: 0; bottom: 100%; width: auto; }
  .gd-phone .board-table .cell .name-txt,
  .pick-fill.is-tabbed .board-table .cell .name-txt,
  .tv-screen .tv-board-wrap .cell .name-txt { padding: 0; font-size: var(--fs-2xs); font-weight: 500; line-height: 1; text-align: center; white-space: nowrap; overflow: visible; }
  .gd-phone .cell .nm-full, .pick-fill.is-tabbed .cell .nm-full, .tv-screen .cell .nm-full,
  .gd-phone .cell .badge, .tv-screen .tv-board-wrap .cell .badge { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .gd-phone .cell .nm-init, .pick-fill.is-tabbed .cell .nm-init, .tv-screen .cell .nm-init { display: inline; }
  .gd-phone .cell .badges, .tv-screen .tv-board-wrap .cell .badges { top: 0; right: 0; width: 0; height: 0; gap: 0; }
  .gd-phone .cell .qcorners, .tv-screen .tv-board-wrap .cell .qcorners { display: block; position: absolute; inset: 0; pointer-events: none; }
  /* No room for the $ tag in a 27 px square, and the corners use all four: the dashed ring says it. */
  .gd-phone .cell.is-unpaid::before, .pick-fill.is-tabbed .cell.is-unpaid::before { display: none; }
  /* The corners above are drawn here, so the legend keys them. */
  .gd-phone .board-legend .lg-corner { display: inline-flex; }
}

/* A phone on its side keeps full names, but in a square about 24 px tall a badge cannot be read:
   it becomes the same corner triangle, its text kept for screen readers. */
@media (min-width: 480px) and (max-height: 479px) {
  .mirror-screen .tv-board-wrap .cell .badge { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mirror-screen .tv-board-wrap .cell .badges { top: 0; right: 0; width: 0; height: 0; gap: 0; }
  .mirror-screen .tv-board-wrap .cell .qcorners { display: block; position: absolute; inset: 0; pointer-events: none; }
  .mirror-screen .tv-board-wrap .cell.winner .name-txt,
  .mirror-screen .tv-board-wrap .cell.pushed .name-txt { font-size: var(--fs-2xs); line-height: 1; white-space: nowrap; }
}

/* ---- The admin usage page (R45b, screen-admin.js) ---- */
.adm-main { max-width: 1200px; }
.adm-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.adm-fresh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button.adm-refresh { min-height: 44px; }
.adm-updated { color: var(--muted); font-size: var(--fs-sm); }
.adm-status { min-height: 1.5em; margin: 10px 0; color: var(--muted); font-size: var(--fs-sm); }
.adm-status.is-error { color: var(--bad-text); }
.adm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.adm-grid > .card { position: relative; min-width: 0; margin: 0; padding: 20px; overflow-wrap: anywhere; }
.adm-card h2 { margin: 0 0 14px; font-size: var(--fs-xl); }
.adm-card h3 { margin: 18px 0 8px; font-size: var(--fs-md); }
.adm-card .adm-service > h3 { margin-top: 0; }
@media (min-width: 900px) {
  .adm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-full { grid-column: 1 / -1; }
}
.adm-empty, .adm-note { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.adm-tiles, .adm-bars, .adm-games, .adm-hosts { list-style: none; margin: 0; padding: 0; }
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.adm-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--panel2); border-radius: var(--r-md); }
.adm-tile-label, .adm-tile-sub { color: var(--muted); font-size: var(--fs-xs); }
.adm-tile-value { font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; }
.adm-bar { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr) minmax(5.5em, auto); align-items: center; gap: 10px; padding: 4px 0; font-size: var(--fs-sm); }
.adm-bar-track { height: 10px; background: var(--panel3); border-radius: var(--r-pill); overflow: hidden; }
.adm-bar-fill { display: block; height: 100%; background: var(--accent); }
.adm-bar-value { text-align: right; }
.adm-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 0; }
.adm-facts[hidden] { display: none; }
.adm-facts dt { color: var(--muted); font-size: var(--fs-xs); }
.adm-facts dd { margin: 2px 0 0; font-size: var(--fs-md); font-weight: 600; }
.adm-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.adm-table th, .adm-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); text-align: right; font-weight: 400; vertical-align: top; }
.adm-table thead th { color: var(--muted); font-size: var(--fs-xs); }
.adm-table th:first-child { text-align: left; padding-left: 0; }
.adm-table tr.is-over th, .adm-table tr.is-over td { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.adm-chart + .adm-chart { margin-top: 14px; }
.adm-chart-head { margin: 0 0 6px; font-size: var(--fs-sm); }
.adm-chart-svg { display: block; width: 100%; height: 80px; border-bottom: 1px solid var(--border-strong); fill: var(--accent); }
.adm-chart-boards { fill: var(--good); }
.adm-axis { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); }
.adm-game-head { display: none; }
.adm-games > li { border-top: 1px solid var(--border); }
button.adm-game { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; width: 100%; min-height: 44px; padding: 10px 6px; text-align: left; background: transparent; color: var(--text); border: 0; border-radius: var(--r-xs); box-shadow: none; font-weight: 400; font-size: var(--fs-sm); }
button.adm-game:hover, button.adm-game[aria-expanded="true"] { background: var(--accent-soft); }
.adm-game-name { grid-column: 1 / -1; font-weight: 700; }
.adm-game-name::after { content: " ▸"; color: var(--accent); }
button.adm-game[aria-expanded="true"] .adm-game-name::after { content: " ▾"; }
.adm-game-date { grid-column: 1 / -1; color: var(--muted); }
.adm-game-label { display: block; color: var(--muted); font-size: var(--fs-xs); }
.adm-facts.adm-stages { margin: 0; padding: 10px 6px 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .adm-game-head, button.adm-game { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 8px; }
  .adm-game-head { padding: 0 6px 6px; color: var(--muted); font-size: var(--fs-xs); }
  .adm-game-name, .adm-game-date { grid-column: auto; }
  .adm-game-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.adm-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 4px 0; border-top: 1px solid var(--border); }
.adm-top .adm-note { margin: 0; }
button.adm-email { max-width: 100%; min-height: 44px; padding: 8px 6px; text-align: left; overflow-wrap: anywhere; background: transparent; color: var(--accent); border: 1px solid transparent; box-shadow: none; font-size: var(--fs-sm); }
button.adm-email:hover, button.adm-email[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.adm-recent { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 4px 16px; padding: 8px 0; border-top: 1px solid var(--border); }
.adm-facts.adm-recent-facts { justify-self: stretch; margin: 0; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.adm-recent-facts dd { font-size: var(--fs-sm); }
@media (min-width: 900px) { .adm-recent { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); align-items: center; } }
.adm-services { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) { .adm-services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
a.adm-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 700; }
.adm-refusal { max-width: 480px; margin: 40px auto; text-align: center; }
.adm-refusal-text { margin: 0 0 8px; font-size: var(--fs-lg); }
.adm-skel span { display: block; height: 14px; margin: 10px 0; background: var(--panel3); border-radius: var(--r-xs); }
.adm-skel span:nth-child(2) { width: 80%; }
.adm-skel span:nth-child(3) { width: 55%; }

/* R45c: "Where did you hear about us?" sheet and the admin "something else" line. */
.heard-choices { display: flex; flex-direction: column; gap: 2px; }
.heard-choice { min-height: 44px; margin: 0; font-weight: 600; font-size: var(--fs-md); }
.heard-choice input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.heard-sheet input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.heard-other { width: 100%; box-sizing: border-box; min-height: 44px; }
.heard-other[hidden] { display: none; }
.heard-actions { margin: 0; }
.adm-other { margin: 0 0 8px; overflow-wrap: anywhere; font-size: var(--fs-md); }

/* ==========================================================================
   Pinch-to-zoom on the phone grids (R47, pinch-zoom.js). The viewport clips the scaled grid and
   keeps the grid's layout size; the Fit pill sits outside the transformed grid. Added only on a
   phone, so no other layout meets these rules.
   ========================================================================== */
.pz-viewport { position: relative; overflow: hidden; }
.pz-content { transform-origin: 0 0; }
.pz-fit {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: auto; min-height: 0;
  padding: 4px 12px; font-size: var(--fs-xs); border-radius: 999px; box-shadow: var(--shadow-pop);
}
.pz-fit[hidden] { display: none; }

/* ---- An upright iPad's Game Day grid: easier to read ----
   Bigger bold names (fitNames still shrinks a long one to fit), richer player colors, darker empty
   squares so claimed ones stand out, a small unpaid tag in the corner, and axis digits in the
   theme's accent on darker header squares. */
.gd-big .cell .name-txt {
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.05; padding: 0 2px;
  color: color-mix(in srgb, var(--who, var(--text)) 15%, var(--text-strong));
  text-shadow: 0 1px 2px rgb(0 0 0 / 55%);
}
/* A won quarter is a gold Q tag in the top right corner; the name stays centered. */
/* Up to four tags (Q1, Q2, Q3, Final) fit in one row across the top of the square. */
.gd-big .cell .badges { top: 2px; left: 1px; right: 1px; flex-wrap: nowrap; justify-content: center; align-items: flex-start; gap: 1px; }
.gd-big .cell .badge { flex: none; display: inline-flex; align-items: center; height: 8px; font-size: 0.42rem; padding: 0 1px; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.gd-big .cell .badge svg { width: 6px; height: 6px; vertical-align: -0.5px; }
/* All four tags: a step smaller, so the row still fits the square. */
.gd-big .cell .badges:has(.badge:nth-child(4)) { gap: 0.5px; }
.gd-big .cell .badges:has(.badge:nth-child(4)) .badge { font-size: 0.34rem; padding: 0 0.5px; }
.gd-big .cell .badges:has(.badge:nth-child(4)) .badge svg { width: 5px; height: 5px; }
.gd-big .cell.winner .name-txt { padding-top: 0; }
/* A push: "Q2" and an arrow written in the square, in the fixed push orange. */
.gd-big .cell.pushed { flex-wrap: wrap; align-content: center; gap: 0 3px; background: color-mix(in srgb, var(--gdi-push) 8%, color-mix(in srgb, var(--panel) 55%, #000)); }
.gd-big .cell.pushed .badges { position: static; order: -1; }
.gd-big .cell.pushed .badge { background: none; color: var(--gdi-push); padding: 0; font-size: var(--fs-3xs); line-height: 1.05; }
.gd-big .cell.pushed .name-txt { padding-top: 0; color: var(--gdi-push); font-size: var(--fs-3xs); text-shadow: none; }
/* The word PUSH becomes Tabler "corner-down-right" (MIT, outline) in push orange: the money rolls on
   to the next quarter. The word stays for screen readers. */
.gd-big .cell.pushed { flex-direction: column; flex-wrap: nowrap; justify-content: center; gap: 1px; }
.gd-big .cell.pushed .name-txt > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gd-big .cell.pushed .name-txt::after {
  content: ''; display: block; width: 20px; height: 20px; margin: 0 auto; background: var(--gdi-push);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6v6a3 3 0 0 0 3 3h10l-4 -4m0 8l4 -4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6v6a3 3 0 0 0 3 3h10l-4 -4m0 8l4 -4'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* The square frames: unpaid 1 px dashed; quarter win and winning now 2 px; all full color. */
.gd-big { --unpaid: #ff3347; } /* a brighter red than the default, for the ring and its key */
.gd-big .cell.is-unpaid { outline: 1px dashed var(--unpaid); outline-offset: -1px; }
.gd-big .cell.winner, .gd-big .cell.filled.winner { box-shadow: inset 0 0 0 2px var(--q-win); }
.gd-big .cell.filled.is-unpaid.winner { box-shadow: inset 0 0 0 1px var(--fill, var(--panel2)), inset 0 0 0 3px var(--q-win); }
.gd-big .board-legend .legend-chip.is-won, .gd-big .board-legend .legend-chip.is-live { border-width: 2px; }
.gd-big .board-legend .lg-unpaid .legend-chip { border-width: 1px; }
.gd-big .cell.is-unpaid::before { left: 2px; bottom: 2px; padding: 1px 2px; font-size: 0.45rem; }
.gd-big .cell.filled { --fill: color-mix(in srgb, var(--who, var(--muted)) 42%, var(--panel)); background: var(--fill); }
.gd-big .cell:not(.head):not(.filled):not(.pushed) { background: color-mix(in srgb, var(--panel) 65%, #000); }
.gd-big .cell.head { background: color-mix(in srgb, var(--panel) 55%, #000); color: var(--accent); font-size: var(--fs-md); font-weight: 800; text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.45); }
.gd-big .cell.head.corner { background: var(--panel); }
/* An upright iPad's Players tab: bigger names. */
/* The squares-and-owed line sits after the name, a step smaller. */
.gd-big button.fill-player-info { display: flex; align-items: center; align-content: center; flex-wrap: wrap; gap: 2px 14px; }
.gd-big .fill-player { align-items: center; }
.gd-big .fill-player-info .player-name { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; }
.gd-big .fill-player-info .player-sub { font-size: var(--fs-md); margin-top: 0; }
.gd-big .fill-player-dot { width: 12px; height: 12px; }
.gd-big .fill-player-due { font-size: var(--fs-lg); }

/* ---- Game Day on a sideways iPad (mock: docs/working/mockups/gameday-ipad-landscape.html) ----
   The upright pieces in two columns: tiles 2 x 2, the info strip, the tabs and the open pane on the
   left (only the pane scrolls), the grid on the right. The side stays 400 px on every iPad; a larger
   one gives the extra room to the grid. No zoom: the side panel needs its CSS pixels. */
.main.gd-phone.gd-big.gd-ipad-side { zoom: 1; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: none; margin: 0; padding: 12px 14px; }
.gd-ipad-side > .pick-layout { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: 400px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: 14px; }
.gd-ipad-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.gd-ipad-col > .board-head { flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.gd-ipad-col > .gdi-info, .gd-ipad-col > .gd-tabs { flex: none; margin: 0; }
.gd-ipad-panes { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.gd-ipad-panes > .card { margin: 0; }
.gd-ipad-side .gd-ipad-board { margin: 0; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.gd-ipad-board .gd-board-holder { flex: none; width: 100%; }
.gd-ipad-board .board-legend { flex: none; }
/* Each play is about 90 px wide here: its name above its points, so neither is cut off. */
.gd-ipad-side .sp-team:first-child { padding-right: 8px; }
.gd-ipad-side .sp-team + .sp-team { padding-left: 8px; }
.gd-ipad-side .sp-play { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 50px; padding: 3px 8px; }
.gd-ipad-side .sp-play-label { font-size: var(--fs-xs); }
/* Upright gets its size from a 1.3 zoom; sideways sets the larger sizes itself. The grid's names and
   digits grow with the screen (fitNames still shrinks a long name). */
.gd-ipad-side .gdi-tile { padding: 8px 6px; }
.gd-ipad-side .gdi-tile .val { font-size: var(--fs-2xl); }
.gd-ipad-side .gdi-tile .sub { font-size: var(--fs-xs); }
.gd-ipad-side .gdi-tile .lbl { font-size: var(--fs-2xs); }
.gd-ipad-side .gd-tab { font-size: var(--fs-lg); }
.gd-ipad-board .cell .name-txt { font-size: clamp(0.85rem, 1.25vw, 1.15rem); }
.gd-ipad-board .cell.head { font-size: clamp(1.1rem, 1.7vw, 1.5rem); }
.gd-ipad-board .cell .badge { font-size: 0.55rem; height: 11px; }
.gd-ipad-board .board-legend { font-size: var(--fs-sm); }
/* The Quarter tile's pulsing live dot, in place of a status tag in the header (it already says
   Halftime and Final). */
.gdi-tile.is-quarter.is-live .val::before {
  content: ''; display: inline-block; width: 0.42em; height: 0.42em; margin-right: 0.3em; vertical-align: 0.14em; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 6px var(--live); animation: gdi-blink 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .gdi-tile.is-quarter.is-live .val::before { animation: none; } }

/* ---- An upright iPad's grid, full screen (the Board tab's corner button) ----
   The board card covers the screen; the rest of the page stays underneath. The page's 1.3 zoom is
   dropped meanwhile so the card measures in screen pixels; names and digits size from the screen. */
button.gd-full-btn { position: absolute; top: 10px; left: 10px; z-index: 2; width: 36px; height: 36px; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: var(--r-md); background: var(--panel2); color: var(--accent); border: 1px solid var(--border-strong); box-shadow: none; }
.gd-full-btn svg { width: 20px; height: 20px; }
/* The global button:hover fill (which a tap leaves on, on an iPad) would paint it solid: its own
   colors hold in every state. */
button.gd-full-btn:hover, button.gd-full-btn:active, button.gd-full-btn:focus { background: var(--panel2); color: var(--accent); border-color: var(--border-strong); filter: none; }
@media (hover: hover) { button.gd-full-btn:hover { background: var(--panel3); } }
button.gd-full-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gd-big .card.has-full-btn { position: relative; }
body.gd-board-open { overflow: hidden; }
body.gd-board-open .main.gd-phone.gd-big { zoom: 1; }
.gd-big .card.gd-board-full {
  position: fixed; inset: 0; z-index: 900; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
}
.gd-board-full .gd-full-btn { top: max(14px, env(safe-area-inset-top, 0px)); left: max(14px, env(safe-area-inset-left, 0px)); width: 44px; height: 44px; }
.gd-board-full .gd-full-btn svg { width: 24px; height: 24px; }
.gd-board-full .gd-board-holder { flex: none; width: 100%; }
.gd-board-full .board-legend { flex: none; font-size: var(--fs-md); }
.gd-big .gd-board-full .cell .name-txt { font-size: clamp(0.8rem, 2.1vmin, 1.4rem); }
.gd-big .gd-board-full .cell.head { font-size: clamp(1rem, 3.4vmin, 2.2rem); }
.gd-big .gd-board-full .cell .badge { font-size: 0.6rem; height: 12px; padding: 0 2px; }
/* Above the full-screen grid: the score line and the quarter, with the live dot while the game is on. */
.gd-full-head { display: none; }
.gd-board-full .gd-full-head { display: flex; flex: none; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 14px; padding-inline: 56px; }
.gd-board-full .gd-full-head .gdi-match { width: 100%; }
.gd-board-full .gd-full-head button.gdi-pts { font-size: var(--fs-4xl); }
.gd-board-full .gd-full-head .gdi-scoreline .team-badge, .gd-board-full .gd-full-head .gdi-team { font-size: var(--fs-xl); }
.gd-full-q { display: flex; align-items: baseline; gap: 10px; color: var(--muted); font-size: var(--fs-lg); font-weight: 600; }
.gd-full-q b { color: var(--text-strong); font-size: var(--fs-2xl); font-weight: 800; }
.gd-full-q.is-live b::before {
  content: ''; display: inline-block; width: 0.42em; height: 0.42em; margin-right: 0.35em; vertical-align: 0.14em; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 6px var(--live); animation: gdi-blink 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .gd-full-q.is-live b::before { animation: none; } }
/* Sideways, full screen: the grid takes the screen's height (its width set by fitFull as
   --gd-full-w) and the score and quarter stack in the room to its left. */
.gd-ipad-side .gd-ipad-board.gd-board-full {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--gd-full-w, 65%); grid-template-rows: auto auto;
  align-content: center; column-gap: 24px; row-gap: 8px;
}
.gd-ipad-board.gd-board-full .gd-full-head { grid-column: 1; grid-row: 1 / 3; align-self: center; margin: 0; padding: 0; gap: 18px; }
.gd-ipad-board.gd-board-full .gd-board-holder { grid-column: 2; grid-row: 1; }
.gd-ipad-board.gd-board-full .board-legend { grid-column: 2; grid-row: 2; margin: 0; }
/* A scoreboard: each team's pill with its own score beside it, one row per team (no dash). */
.gd-ipad-board.gd-board-full .gdi-scoreline { grid-template-columns: auto auto; justify-content: space-between; grid-template-areas: "ta pa" "tb pb"; align-items: center; column-gap: 14px; row-gap: 10px; }
.gd-ipad-board.gd-board-full .gdi-scoreline > .gdi-team.is-a { grid-area: ta; justify-content: flex-start; }
.gd-ipad-board.gd-board-full .gdi-scoreline > :nth-child(2) { grid-area: pa; }
.gd-ipad-board.gd-board-full .gdi-scoreline > :nth-child(3) { display: none; }
.gd-ipad-board.gd-board-full .gdi-scoreline > :nth-child(4) { grid-area: pb; }
.gd-ipad-board.gd-board-full .gdi-scoreline > .gdi-team.is-b { grid-area: tb; justify-content: flex-start; }
.gd-ipad-board.gd-board-full .gd-full-head button.gdi-pts { font-size: 2.8rem; text-align: right; }
/* Each pill is as wide as its own name (not the header's shared width), a step smaller than the
   header's; a name too wide for the column widens the score line, and fitTeamBadges then shows the
   short names. */
.gd-ipad-board.gd-board-full .gd-full-head .gdi-scoreline .gdi-team, .gd-ipad-board.gd-board-full .gd-full-head .gdi-scoreline .team-badge { font-size: var(--fs-lg); }
.gd-ipad-board.gd-board-full .gdi-scoreline .team-badge { min-width: 0 !important; max-width: none; justify-content: flex-start; }
/* Sideways the grid fills its width; fitWide sets its aspect ratio (--gd-ar), so squares can be
   wider than tall and long names fit. */
.gd-big .gd-ipad-board .board-table { aspect-ratio: var(--gd-ar, 1); }
/* Sideways, full screen: the column beside the grid also shows who is winning now, each quarter's
   result and payout (a check once paid out), and the info strip's message. */
.gd-full-extra { display: none; }
.gd-ipad-board.gd-board-full .gd-full-extra { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 4px; }
.gd-full-win { padding: 8px 12px; border-radius: var(--r-md); border: 1px solid rgba(46, 204, 113, 0.5); background: rgba(46, 204, 113, 0.08); text-align: center; }
.gd-full-win[hidden] { display: none; }
.gd-full-win span { display: block; color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.gd-full-win b { display: block; color: var(--text-strong); font-size: var(--fs-2xl); font-weight: 800; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-full-win em { font-style: normal; color: var(--live); font-weight: 700; }
.gd-full-qs { list-style: none; margin: 0; padding: 0; font-size: var(--fs-md); }
.gd-full-qs li { display: grid; grid-template-columns: 3.2rem 3.6rem minmax(0, 1fr) auto; gap: 6px; align-items: baseline; padding: 5px 2px; border-top: 1px solid var(--border); }
.gd-full-qs li:first-child { border-top: 0; }
.gd-full-qs .q { font-weight: 800; color: var(--muted); }
.gd-full-qs .s { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-full-qs .w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gd-full-qs .a { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.gd-full-qs li.is-push .w { color: var(--warn); }
.gd-full-qs li.is-dim .w { color: var(--muted); font-weight: 500; }
.gd-full-extra .gdi-info { margin: 0; font-size: var(--fs-sm); text-align: left; }

/* ---- Game Day on a phone (mock: docs/working/mockups/gameday-phone.html) ----
   The iPad's parts (.gd-big) at phone size (.gd-ph, no zoom): upright as the upright iPad, sideways in
   the sideways iPad's two columns with a narrower side panel. */
#app.gd-fit { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
#app.gd-fit .main { flex: 1 1 0; min-height: 0; }
.topbar.gd-topbar-phone.gd-topbar-ipad { min-height: 0; padding: 4px 8px; align-items: center; }
.gd-topbar-phone.gd-topbar-ipad .gdi-scoreline { gap: 8px; }
.gd-topbar-phone.gd-topbar-ipad button.gdi-pts { font-size: var(--fs-2xl); }
.main.gd-ph { padding-left: 8px; padding-right: 8px; }
/* A small phone (an iPhone SE is 320 px upright): the header's score, the tiles' values and the
   tabs a step smaller, so all four tabs and both teams fit. */
@media (max-width: 360px) {
  .topbar.gd-topbar-phone.gd-topbar-ipad { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .gd-topbar-phone.gd-topbar-ipad .gdi-scoreline { gap: 4px; }
  .gd-topbar-phone.gd-topbar-ipad button.gdi-pts { font-size: var(--fs-xl); }
  .gd-ph .gdi-tile .val { font-size: 0.82rem; }
  .gd-ph .gd-tabs .gd-tab { font-size: var(--fs-sm); padding: 0 2px; }
}
.gd-ph .gdi-tile { padding: 5px 3px; }
.gd-ph .gdi-tile .val { font-size: var(--fs-md); white-space: nowrap; }
.gd-ph .gdi-tile .sub { font-size: var(--fs-3xs); }
.gd-ph .gdi-info { font-size: var(--fs-xs); padding: 6px 9px; gap: 8px; }
.gd-ph .gdi-info-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gd-ph button.gd-full-btn { width: 32px; height: 32px; top: 6px; left: 6px; }
.gd-ph button.gd-full-btn svg { width: 17px; height: 17px; }
/* Sideways: the side panel is 300 px (260 on a small phone); the tiles are one row of values. */
.main.gd-phone.gd-big.gd-ph.gd-ipad-side { padding: 6px 8px; }
.gd-ph.gd-ipad-side > .pick-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 8px; }
@media (max-width: 700px) { .gd-ph.gd-ipad-side > .pick-layout { grid-template-columns: 260px minmax(0, 1fr); } }
.gd-ph .gd-ipad-col { gap: 6px; }
.gd-ph .gd-ipad-col > .board-head { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.gd-ph.gd-ipad-side .gdi-tile { min-height: 0; padding: 3px 2px; }
.gd-ph.gd-ipad-side .gdi-tile .val { font-size: var(--fs-sm); }
.gd-ph.gd-ipad-side .gdi-tile .sub { display: none; }
.gd-ph.gd-ipad-side .gdi-tile .lbl { font-size: 0.5rem; }
.gd-ph.gd-ipad-side .gd-tab { font-size: var(--fs-sm); min-height: 34px; }
.gd-ph.gd-ipad-side .card { padding: 8px; }
/* Each play is a row, its name left and its points right (two across don't fit a phone). */
.gd-ph .sp-plays { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.gd-ph .sp-play { flex-direction: row; justify-content: space-between; align-items: center; min-height: 38px; padding: 0 10px; }
.gd-ph .sp-play-label { font-size: var(--fs-xs); white-space: nowrap; }
.gd-ph.gd-ipad-side .sp-play { min-height: 32px; padding: 0 8px; }
.gd-ph.gd-ipad-side .sp-play-label { font-size: var(--fs-2xs); }
.gd-ph.gd-ipad-side .gd-ipad-board { padding: 4px 6px; }
.gd-big .gd-ph .gd-ipad-board .board-table, .gd-ph .gd-ipad-board .board-table { gap: 1px; }
.gd-big.gd-ph .gd-ipad-board .cell .name-txt { font-size: var(--fs-2xs); }
.gd-big.gd-ph .gd-ipad-board .cell.head { font-size: var(--fs-sm); }
.gd-ph .gd-ipad-board .board-legend { font-size: var(--fs-3xs); gap: 2px 10px; }
.gd-ph.gd-ipad-side button.gd-full-btn { top: 4px; left: 4px; }
/* Sideways a phone's squares are too short for the $ tag over the name: the red dashed ring alone
   marks a square not paid (the key says so). */
.gd-big.gd-ph.gd-ipad-side .cell.is-unpaid::before { display: none; }
/* Full screen. Upright: the score and quarter above the grid, who is winning and the quarters under
   it. Sideways: a 210 px column for the score, without the info strip. */
.gd-ph .card.gd-board-full { padding: 10px; }
.gd-ph:not(.gd-ipad-side) .card.gd-board-full { justify-content: flex-start; overflow-y: auto; padding-top: 56px; }
.gd-ph .gd-board-full .gd-full-head { padding-inline: 44px; margin-bottom: 8px; gap: 4px; }
.gd-ph .gd-board-full .gd-full-head button.gdi-pts { font-size: var(--fs-3xl); }
.gd-ph .gd-board-full .gd-full-head .gdi-scoreline .gdi-team, .gd-ph .gd-board-full .gd-full-head .gdi-scoreline .team-badge { font-size: var(--fs-md); }
.gd-ph .gd-full-q { font-size: var(--fs-sm); }
.gd-ph .gd-full-q b { font-size: var(--fs-xl); }
.gd-ph .gd-board-full button.gd-full-btn { width: 40px; height: 40px; top: max(10px, env(safe-area-inset-top, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); }
.gd-ph .gd-board-full > .gd-full-extra { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.gd-ph .gd-full-win { padding: 5px 10px; }
.gd-ph .gd-full-win b { font-size: var(--fs-lg); }
.gd-ph .gd-full-qs { font-size: var(--fs-sm); }
.gd-ph .gd-full-qs li { padding: 3px 2px; grid-template-columns: 2.6rem 3.2rem minmax(0, 1fr) auto; }
.gd-ph .gd-full-extra .gdi-info { font-size: var(--fs-2xs); }
.gd-ph.gd-ipad-side .gd-ipad-board.gd-board-full { column-gap: 12px; padding: 8px 10px; }
.gd-ph.gd-ipad-side .gd-board-full .gd-full-head { padding: 0; gap: 8px; margin-top: 40px; }
.gd-ph.gd-ipad-side .gd-board-full .gd-full-head button.gdi-pts { font-size: var(--fs-2xl); }
.gd-ph.gd-ipad-side .gd-board-full .gd-full-head .gdi-scoreline .gdi-team, .gd-ph.gd-ipad-side .gd-board-full .gd-full-head .gdi-scoreline .team-badge { font-size: var(--fs-sm); }
.gd-ph.gd-ipad-side .gd-full-extra { gap: 6px; }
.gd-ph.gd-ipad-side .gd-full-extra .gdi-info { display: none; }
.gd-ph.gd-ipad-side .gd-full-qs { font-size: var(--fs-xs); }
.gd-ph.gd-ipad-side .gd-full-win b { font-size: var(--fs-md); }

/* ---- Picking on a phone or an iPad: Game Day's grid ----
   The board card itself carries .gd-phone.gd-big (and .gd-ipad-board on an iPad), so the grid
   rules above apply to its squares. These cover what those rules reach only from a parent element,
   and what picking adds: a square picked for someone. */
.pick-grid-wrap { position: relative; width: 100%; margin-inline: auto; }
.board-card.gd-big .board-table { aspect-ratio: var(--gd-ar, 1); }
.pick-fill .board-card.gd-big .cell.selected:not(.head) { background: var(--pick-color, var(--accent)); }
/* An upright iPad: Game Day's sizes there come from its 1.3 zoom, which the picking page doesn't have. */
.pick-fill:not(.is-wide) .board-card.gd-ipad-board .cell .name-txt { font-size: 1.05rem; }
.pick-fill:not(.is-wide) .board-card.gd-ipad-board .cell.head { font-size: 1.3rem; }
/* A sideways iPad: the grid fills the board's column (fitGrid), with no page scrolling. */
@media (min-width: 1024px) {
  .pick-fill.is-wide > .board-card.gd-big { height: 0; min-height: 100%; overflow: hidden; }
  .pick-fill.is-wide > .board-card.gd-big .pick-grid-wrap { flex: none; }
}

/* ==========================================================================
   One square style on every grid (style D2.3c, chosen 2026-12-01)
   Picking, Game Day, Party View / the TV and mirror mode all draw their squares this way: hairline
   seams, neutral squares, a faint 8% wash of the player's color behind a regular-weight name in
   that color, and a thin red dashed border on a square not paid (no $ tag). Each screen keeps its
   own sizes, team bars and highlights (won a quarter, winning now, one score away, a push).
   #app outranks the screens' own grid rules, so this block is the one place the look lives.
   ========================================================================== */
#app {
  --sq-cell: var(--panel);
  --sq-line: color-mix(in srgb, var(--muted) 20%, var(--panel));
  --sq-head: color-mix(in srgb, var(--panel) 60%, #000);
}
#app .board-table { gap: 1px; padding: 0; background: var(--sq-line); border: 1px solid var(--sq-line); }
#app .board-table .cell { background: var(--sq-cell); border: 0; border-radius: 0; box-shadow: none; text-shadow: none; }
#app .board-table .cell.head, #app .board-table .cell.head.corner { background: var(--sq-head); color: var(--accent); text-shadow: none; }
#app .board-table .cell.head.pending, #app .board-table .cell.head.drawing { color: var(--muted); }
#app .board-table .cell.filled { background: color-mix(in srgb, var(--who, var(--muted)) 8%, var(--sq-cell)); }
#app .board-table .cell .name-txt { color: color-mix(in srgb, var(--who, var(--text)) 85%, var(--text-strong)); font-weight: 500; text-shadow: none; }
#app .board-table .cell.live-winner .name-txt { font-weight: 700; }
/* Not paid: a thin red dashed border, no $ tag. */
#app .board-table .cell.is-unpaid { outline: 1px dashed var(--unpaid); outline-offset: -1px; }
#app .board-table .cell.is-unpaid::before { content: none; }
/* Won a quarter: a gold frame (the dashes step inside it when not paid). A push: a faint orange wash. */
#app .board-table .cell.winner { background: color-mix(in srgb, var(--q-win) 8%, var(--sq-cell)); box-shadow: inset 0 0 0 2px var(--q-win); animation: none; }
#app .board-table .cell.is-unpaid.winner { outline-offset: -3px; }
#app .board-table .cell.pushed { background: color-mix(in srgb, #ff9f43 10%, var(--sq-cell)); }
/* Picking: the pick color, and the ring a tap target shows on hover. */
#app .board-table .cell.selected { background: var(--pick-color, var(--accent)); }
#app .board-table .cell.empty-pick:not(.selected):hover { box-shadow: inset 0 0 0 2px var(--pick-color, var(--accent)); }
#app .board-table .cell.is-tappable:hover { box-shadow: inset 0 0 0 2px var(--accent); }
/* No color-mix() (older smart-TV browsers): a value built on it fails and the name turns white.
   Plain colors instead: names in the player's own color, squares and seams in theme colors. */
@supports not (color: color-mix(in srgb, red, blue)) {
  #app { --sq-line: var(--border); --sq-head: var(--panel3); }
  #app .board-table .cell.filled, #app .board-table .cell.winner, #app .board-table .cell.pushed { background: var(--sq-cell); }
  #app .board-table .cell .name-txt { color: var(--who, var(--text)); }
}
/* Every key's "not paid" swatch matches. */
#app .lg-unpaid .legend-chip, #app .legend-unpaid .legend-chip, #app .glass-board .legend-chip:not([class*=" is-"]) { background: transparent; box-shadow: none; border: 1px dashed var(--unpaid); border-radius: 0; }
/* The guest's pick board and the squares manager (no names there): the same seams and open squares. */
#app .gp-board { gap: 1px; background: var(--sq-line); border: 1px solid var(--sq-line); }
#app .gp-cell.is-open { background: var(--sq-cell); }

/* ---- Every iPhone grid marks a won quarter with corner chips ----
   Upright phones already do (the under-480 px block above). Here: Game Day on a phone either way up
   (.gd-ph, its full screen too), and Party View or mirror on a phone on its side (a screen under
   480 px tall). The Q1/Q2/Q3/Final text stays for screen readers. */
.gd-ph .board-table .cell .badge { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gd-ph .board-table .cell .badges { position: absolute; top: 0; right: 0; width: 0; height: 0; gap: 0; }
.gd-ph .board-table .cell .qcorners { display: block; position: absolute; inset: 0; pointer-events: none; }
.gd-ph .board-legend .lg-corner { display: inline-flex; }
@media (max-height: 479px) {
  /* Squares about 17 px tall: smaller chips, so two of them leave room for the name. */
  .gd-ph .board-table .cell .qcorners, .tv-screen .tv-board-wrap .cell .qcorners, .mirror-screen .tv-board-wrap .cell .qcorners { --qc-l: 7px; --qc-o: 0px; }
  .tv-screen .tv-board-wrap .cell .badge { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tv-screen .tv-board-wrap .cell .badges { top: 0; right: 0; width: 0; height: 0; gap: 0; }
  .tv-screen .tv-board-wrap .cell .qcorners { display: block; position: absolute; inset: 0; pointer-events: none; }
}

/* ---- Grid keys stay within two lines ----
   Picking: the hint takes the first line and "Not paid yet" wraps under it when they don't fit side
   by side. Game Day on an iPhone: nine entries in a smaller key, "Won" for "Won a quarter". */
.pick-fill .board-legend { flex-wrap: wrap; row-gap: 4px; }
.board-legend .lg-short { display: none; }
.gd-ph .board-legend .lg-won .lg-long { display: none; }
.gd-ph .board-legend .lg-won .lg-short { display: inline; }
.gd-ph .board-legend:has(.lg) { font-size: var(--fs-xs); gap: 4px 10px; justify-content: center; }
.gd-ph .board-legend .lg { gap: 4px; }
.gd-ph .board-legend .legend-chip { width: 11px; height: 11px; }
/* An iPhone SE (or a small phone on its side): a step smaller again, and "Not paid". */
@media (max-width: 379px), (max-height: 379px) {
  .gd-ph .board-legend:has(.lg) { font-size: var(--fs-2xs); gap: 3px 8px; }
  .gd-ph .board-legend .lg-unpaid .lg-long { display: none; }
  .gd-ph .board-legend .lg-unpaid .lg-short { display: inline; }
}
