/* Loud & Clear: game day. A photoreal arena fills the screen; the child is the announcer on the mic.
   Navy broadcast panels, white pieces, one team colour per game. */
@font-face { font-family: 'Jost'; src: url('/fonts/jost-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-800-italic.woff2') format('woff2'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-900-italic.woff2') format('woff2'); font-weight: 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('/fonts/andika-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('/fonts/andika-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Yellowtail'; src: url('/fonts/yellowtail-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ink: #0a1226;
  --navy: #0d1830;
  --team: #ff7a1a;
  --team-on: #0a1226;
  --plate-wide: url('/img/arena-wide.webp');
  --plate-play: url('/img/arena-ice.webp');
  --paper: #ffffff;
  --red: #e3241b;
  --tile: #1c2b52;
  --line: #33456f;
  --steel: #c9d4ec;
  --well: #060c1e;
  --sun: #ffc41f;
  --ground: #0a1226;
  --on: #ffffff;
  --on-soft: color-mix(in oklab, var(--on) 88%, var(--ground));
  --on-faint: color-mix(in oklab, var(--on) 28%, var(--ground));
  --edge: #d6d1e4;
  --f-ui: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --f-board: 'Barlow Condensed', 'Arial Narrow', 'Jost', sans-serif;
  --f-read: 'Andika', 'Comic Sans MS', 'Segoe UI', sans-serif;
  --f-logo: 'Yellowtail', 'Brush Script MT', cursive;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(0.9rem, 2.6vw, 2rem);
  --lift: 0 2px 0 rgba(4, 8, 20, 0.2), 0 14px 26px -10px rgba(2, 5, 14, 0.75);
  --panel: #0b1430;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--f-ui); font-weight: 500; font-size: 1.0625rem; line-height: 1.45;
  color: var(--on); background: var(--ground);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
::selection { background: var(--ink); color: var(--paper); }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--on); outline-offset: 3px; }
h1, h2, h3, p, ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
.ico { width: 1.5em; height: 1.5em; flex: none; }

.app {
  position: relative; isolation: isolate;
  height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  color: var(--on);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
/* the arena: a wide establishing shot on the schedule, rink/court level during play */
.app::before, .app::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.app::before { background: var(--ground) var(--plate-wide) center / cover no-repeat; transition: opacity 0.4s; }
.app::after { background: linear-gradient(180deg, rgba(8, 14, 32, 0.62), rgba(8, 14, 32, 0.34) 38%, rgba(8, 14, 32, 0.78)); }
[data-screen='show']::before, [data-screen='signoff']::before, [data-screen='album']::before { background-image: var(--plate-play); }
[data-screen='show']::after, [data-screen='signoff']::after { background: radial-gradient(120% 90% at 50% 40%, rgba(8, 14, 32, 0.58), rgba(6, 10, 24, 0.88)); }
[data-screen='album']::after { background: rgba(7, 12, 28, 0.88); }

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: clamp(0.6rem, 1.6vw, 1rem) var(--pad); min-height: 4.25rem;
}
.logo { text-shadow: 0 2px 10px rgba(2, 5, 14, 0.6); font-family: var(--f-logo); font-size: clamp(1.7rem, 1.1rem + 2vw, 2.5rem); line-height: 1; letter-spacing: 0.01em; white-space: nowrap; padding: 0.1em 0.15em 0.1em 0; }
.logo i { font-style: normal; opacity: 0.75; }
.bar-tools { display: flex; gap: 0.5rem; }
.tool {
  position: relative; width: 3.75rem; height: 3.75rem; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  box-shadow: var(--lift);
  transition: transform 0.25s var(--ease);
}
.tool:active { transform: scale(0.94); }
.tool[aria-pressed='false'] { background: var(--panel); color: var(--on); box-shadow: inset 0 0 0 2.5px var(--on); }
.tool-count {
  position: absolute; top: -0.2rem; right: -0.25rem; min-width: 1.45rem; height: 1.45rem; padding: 0 0.3rem;
  border-radius: 1rem; background: var(--ink); color: var(--paper);
  font-size: 0.8rem; font-weight: 700; line-height: 1.45rem; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--paper);
}
.hold-ring { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; }
.hold-ring circle { fill: none; stroke: var(--on); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 126; stroke-dashoffset: 126; }
.tool-hold.is-holding .hold-ring circle { transition: stroke-dashoffset 0.9s linear; stroke-dashoffset: 0; }
.bar-title { font-family: var(--f-board); font-style: italic; text-transform: uppercase; font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); font-weight: 800; letter-spacing: 0.01em; margin-right: auto; }
.bar-station { font-family: var(--f-board); font-style: italic; text-transform: uppercase; font-weight: 800; font-size: 1.4rem; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; padding: 0.1rem 0.7rem; background: var(--team); color: var(--team-on); transform: skewX(-8deg); }

/* ---------- stage + deck shells ---------- */
.stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 0 var(--pad); }
.deck { padding: 0 var(--pad) max(var(--pad), env(safe-area-inset-bottom)); }
.app.is-in .stage > *, .app.is-in .deck > * { animation: rise 0.5s var(--ease) both; }
.app.is-in .deck > * { animation-delay: 0.06s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- the dial ---------- */
[data-screen='dial'] .stage {
  grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center; gap: clamp(1rem, 3.5vh, 2.25rem);
  text-align: center; padding-bottom: clamp(0.75rem, 2vh, 1.5rem);
}
.tuned { display: grid; justify-items: center; gap: clamp(0.5rem, 1.6vh, 1.1rem); min-width: 0; }
.freq {
  display: inline-flex; align-items: baseline; gap: 0.12em; padding: 0.02em 0.3em 0.06em 0.26em;
  font-family: var(--f-board); font-style: italic; font-weight: 900; line-height: 0.86;
  font-size: clamp(5rem, min(27vw, 25vh), 13rem);
  background: var(--team); color: var(--team-on); transform: skewX(-8deg);
  box-shadow: 0 18px 30px -14px rgba(2, 5, 14, 0.8);
}
.freq-num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.freq-fm { font-weight: 800; font-size: 0.36em; text-transform: uppercase; letter-spacing: 0.02em; }
.tuned-meta { display: grid; gap: 0.15rem; justify-items: inherit; padding: 0.7rem 1.2rem 0.9rem; background: var(--panel); box-shadow: var(--lift); }
.station-title { font-family: var(--f-board); font-weight: 800; font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem); line-height: 1; letter-spacing: 0.005em; text-wrap: balance; }
.station-grade { font-family: var(--f-board); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem); color: var(--steel); }
.station-words { display: flex; flex-wrap: wrap; justify-content: inherit; gap: 0.2em 1.1em; margin-top: 0.45rem; font-family: var(--f-read); font-weight: 700; font-size: clamp(1.35rem, 1rem + 1.4vw, 2rem); line-height: 1.2; }
.go { display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 4vw, 2.5rem); }
.signal { width: clamp(7.5rem, 22vw, 11rem); }

.onair-btn {
  position: relative; width: clamp(8.25rem, 22vmin, 11rem); aspect-ratio: 1; border-radius: 50%; flex: none;
  display: grid; place-content: center; justify-items: center; gap: 0.3rem;
  background: var(--red); color: var(--paper);
  box-shadow: 0 0 0 0.6rem var(--paper), 0 0.6rem 0 0.6rem rgba(2, 5, 14, 0.16), 0 1.6rem 2rem -0.4rem rgba(2, 5, 14, 0.5);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.onair-btn .ico { width: 2.6rem; height: 2.6rem; stroke-width: 2; }
.onair-btn span { font-family: var(--f-board); font-style: italic; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; }
.onair-btn:hover { transform: translateY(-2px); }
.onair-btn:active { transform: translateY(0.3rem); box-shadow: 0 0 0 0.6rem var(--paper), 0 0.2rem 0 0.6rem rgba(2, 5, 14, 0.16), 0 0.8rem 1.2rem -0.4rem rgba(2, 5, 14, 0.5); }
.onair-btn:focus-visible { outline-offset: 0.9rem; }

@media (min-width: 820px) and (min-aspect-ratio: 5/4) {
  [data-screen='dial'] .stage { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); text-align: left; justify-items: start; padding-inline: clamp(2rem, 6vw, 6rem); }
  [data-screen='dial'] .tuned { justify-items: start; }
  [data-screen='dial'] .go { flex-direction: column; justify-self: center; gap: clamp(1.25rem, 4vh, 2.5rem); }
  [data-screen='dial'] .signal { width: clamp(9rem, 15vw, 13rem); }
  [data-screen='dial'] .freq { font-size: clamp(5rem, min(15vw, 30vh), 13rem); }
}

/* schedule board: an opaque navy panel with one fixture tile per game */
[data-screen='dial'] .deck { padding: 0; }
.glass {
  display: flex; align-items: stretch; gap: 0.25rem;
  height: clamp(8rem, 23vh, 11.5rem);
  padding: 0 clamp(0.25rem, 1.2vw, 1rem) env(safe-area-inset-bottom);
  background: var(--navy); color: var(--paper);
  border-top: 4px solid var(--team);
  box-shadow: 0 -12px 30px -14px rgba(2, 5, 14, 0.8);
}
.glass-step { width: clamp(3.25rem, 7vw, 4.25rem); flex: none; display: grid; place-items: center; color: var(--paper); transition: opacity 0.2s, transform 0.2s var(--ease); }
.glass-step .ico { width: 2.1rem; height: 2.1rem; stroke-width: 2.6; }
.glass-step:disabled { opacity: 0.25; }
.glass-step:active:not(:disabled) { transform: scale(0.88); }
.glass-step:focus-visible, .scale:focus-visible { outline-color: var(--paper); outline-offset: -6px; }
.scale { position: relative; flex: 1; min-width: 0; cursor: ew-resize; touch-action: none; }
.bands, .marks { position: absolute; left: 0; right: 0; pointer-events: none; }
.bands { top: 13%; height: 1.3rem; }
.band {
  position: absolute; top: 0; text-align: center; white-space: nowrap; overflow: hidden;
  font-family: var(--f-board); font-weight: 700; font-size: clamp(0.85rem, 0.7rem + 0.5vw, 1.05rem); letter-spacing: 0.12em; line-height: 1.2rem;
  color: var(--steel); border-bottom: 2px solid var(--line);
  transform: scaleX(0.92);
}
.marks { top: 43%; height: 40%; }
.mark {
  position: absolute; top: 0; bottom: 0; width: clamp(1.1rem, 4.7vw, 4rem); display: grid; place-items: center;
  transform: translateX(-50%) skewX(-8deg);
  background: var(--tile); color: var(--steel);
  font-family: var(--f-board); font-style: italic; font-weight: 800; font-size: clamp(1rem, 0.7rem + 1.3vw, 1.9rem); line-height: 1; font-variant-numeric: tabular-nums;
  transition: background-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.mark.is-on { z-index: 1; background: var(--team); color: var(--team-on); transform: translateX(-50%) skewX(-8deg) scale(1.24); box-shadow: 0 0 0 2px var(--paper), 0 10px 16px -8px rgba(2, 5, 14, 0.8); }
.needle, .nums, .ticks { display: none; }

/* ---------- meter ---------- */
.meter { width: 100%; background: var(--paper); color: var(--ink); border-radius: 0.9rem; padding: 0.45rem 0.45rem 0; box-shadow: var(--lift); overflow: hidden; }
.meter svg { display: block; width: 100%; height: auto; overflow: hidden; }
.meter-arc { fill: none; stroke: var(--ink); stroke-width: 3; }
.meter-hot { fill: none; stroke: var(--red); stroke-width: 7; }
.meter-ticks line { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.meter-label { font: 800 14px var(--f-board); letter-spacing: 0.16em; fill: var(--ink); }
.meter-needle { transform-origin: 100px 140px; transform-box: view-box; }
.meter-needle line { stroke: var(--red); stroke-width: 3.5; stroke-linecap: round; }
.meter.is-off { visibility: hidden; }

/* ---------- show ---------- */
[data-screen='show'] .bar { justify-content: flex-start; }
.rundown { list-style: none; display: flex; justify-content: center; flex: 1 1 0; gap: clamp(3px, 0.8vw, 7px); margin: 0; padding: 0 0.5rem; min-width: 0; }
.rundown li { flex: 1 1 0; min-width: 3px; max-width: 2.1rem; height: 0.7rem; transform: skewX(-8deg); background: var(--line); transition: background-color 0.3s; }
.rundown li.is-done { background: var(--on); }
.rundown li.is-now { background: var(--team); box-shadow: 0 0 0 2px var(--on); }
.bug { flex: none; display: flex; align-items: stretch; margin-right: 0.6rem; font-family: var(--f-board); font-style: italic; line-height: 1; transform: skewX(-8deg); box-shadow: var(--lift); }
.bug i { display: grid; place-items: center; padding: 0 0.55rem; background: var(--panel); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
.bug b { display: grid; place-items: center; min-width: 2.4rem; padding: 0.3rem 0.5rem; background: var(--team); color: var(--team-on); font-weight: 900; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.bug b.is-up { animation: scoreup 0.6s var(--ease); }
@keyframes scoreup { 30% { transform: scale(1.5); } }
.replay { margin-left: 0.1rem; }
.lamp {
  flex: none; padding: 0.3rem; border-radius: 0.6rem; background: var(--ink);
  box-shadow: var(--lift);
}
.lamp span {
  display: block; padding: 0.4rem 0.65rem 0.36rem; border-radius: 0.35rem;
  font-family: var(--f-board); font-weight: 800; font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.2rem); letter-spacing: 0.14em; line-height: 1; white-space: nowrap;
  background: #3a1012; color: #7d3a36;
  transition: background-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.lamp[data-state='on'] span, .lamp[data-state='wait'] span { background: #ff3626; color: #fff; box-shadow: 0 0 22px 4px rgba(255, 60, 40, 0.75), inset 0 0 10px rgba(255, 220, 200, 0.55); }
.lamp[data-state='wait'] span { animation: blink 0.7s steps(2, jump-none) infinite; }
@keyframes blink { 50% { background: #7a1c16; color: #f3b1a6; box-shadow: none; } }

[data-screen='show'] .stage { align-content: center; }
[data-screen='show'] .deck { min-height: clamp(9.5rem, 27vh, 14rem); display: flex; align-items: center; justify-content: center; gap: 1rem; }
.act { position: relative; width: 100%; display: grid; justify-items: center; align-content: center; gap: clamp(0.9rem, 3vh, 1.75rem); }
.stage .act > * { opacity: 0; transform: translateY(16px) scale(0.98); }
.stage.is-in .act > * { opacity: 1; transform: none; transition: opacity 0.35s var(--ease), transform 0.5s var(--ease); }

/* pieces */
.piece { touch-action: none; position: relative; z-index: 1; will-change: transform; }
.piece.is-dragging { z-index: 30; transition: none; cursor: grabbing; filter: drop-shadow(0 18px 14px rgba(2, 5, 14, 0.35)); }
.piece.is-picked { transform: translateY(-10px) scale(1.06); z-index: 5; }
.piece.is-picked::after { content: ''; position: absolute; inset: -7px; border-radius: inherit; border: 3px solid var(--on); pointer-events: none; }
.piece.is-nope, .spot.is-nope, .cap.is-nope { animation: nope 0.42s var(--ease); }
@keyframes nope { 20% { translate: -9px 0; } 45% { translate: 8px 0; } 70% { translate: -4px 0; } }
.has-pick .spot:not(.is-full) { cursor: pointer; }

.cap {
  --c: var(--cap, 4.75rem);
  width: var(--c); height: var(--c); flex: none; display: grid; place-items: center;
  border-radius: calc(var(--c) * 0.22);
  background: var(--paper); color: var(--ink);
  --rim: var(--edge);
  padding-bottom: calc(var(--c) * 0.085);
  box-shadow: inset 0 calc(var(--c) * -0.085) 0 var(--rim), 0 10px 16px -8px rgba(2, 5, 14, 0.7);
  font-family: var(--f-read); font-weight: 700; font-size: calc(var(--c) * 0.56); line-height: 1;
  transition: transform 0.25s var(--ease);
  cursor: grab;
}
.cap span { transform: translateY(-2%); letter-spacing: 0.01em; }
.cap-vowel { background: var(--sun); color: var(--ink); --rim: #c98f00; }
.cap[data-g][data-g]:where([data-g$='e'], [data-g$='h'], [data-g$='k'], [data-g$='g'], [data-g$='l'], [data-g$='s'], [data-g$='z'], [data-g$='f'], [data-g$='a'], [data-g$='y'], [data-g$='r'], [data-g$='o'], [data-g$='i'], [data-g$='u'], [data-g$='w']) span { letter-spacing: 0; }
.wordcard {
  min-height: 4rem; padding: 0.3em 0.75em 0.36em; display: inline-grid; place-items: center;
  border-radius: 0.85rem; background: var(--paper); color: var(--ink);
  box-shadow: inset 0 -5px 0 var(--edge), 0 10px 16px -8px rgba(2, 5, 14, 0.7);
  font-family: var(--f-read); font-weight: 700; font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.75rem); line-height: 1.15; white-space: nowrap;
  transition: transform 0.25s var(--ease);
  cursor: grab;
}
.wordcard.is-dealt { animation: deal 0.45s var(--ease) both; }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(-4deg); } }

.tray { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(0.5rem, 1.6vw, 0.9rem); --cap: clamp(3.6rem, min(calc((100vw - 3rem) / min(var(--n, 5), 5) - 0.75rem), 13vh), 5.5rem); transition: opacity 0.4s; }
.tray.is-spent { opacity: 0; pointer-events: none; }
.tray-one { min-height: 4.6rem; }
.tray-words { gap: clamp(0.6rem, 2vw, 1.1rem); }
.pile { display: flex; align-items: center; padding-left: 1.2rem; }
.pile i { display: block; width: 1.7rem; height: 2.3rem; margin-left: -1.15rem; border-radius: 4px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--edge), 0 3px 6px rgba(2, 5, 14, 0.5); }
.pile i:nth-child(odd) { rotate: -5deg; }
.pile i:nth-child(even) { rotate: 4deg; }

/* spots */
.spot { position: relative; }
.spot.is-over { background: color-mix(in oklab, var(--on) 22%, transparent); }
.spot.is-hint { animation: hint 1.1s var(--ease) 2; }
@keyframes hint { 40% { box-shadow: inset 0 0 0 4px var(--paper); background: color-mix(in oklab, var(--paper) 45%, var(--well)); } }

/* build */
.boxes { display: flex; justify-content: center; gap: clamp(0.35rem, 1.2vw, 0.7rem); --cap: clamp(2.6rem, min(calc((100vw - 4.6rem) / var(--n, 3) - 1.3rem), 17vh), 7rem); transition: gap 0.5s var(--ease); }
.box {
  width: calc(var(--cap) + 14px); height: calc(var(--cap) + 14px); display: grid; place-items: center; flex: none;
  border-radius: 6px; background: var(--well); box-shadow: inset 0 0 0 2px var(--line);
  transition: background-color 0.2s, box-shadow 0.2s, width 0.5s var(--ease);
}
.box.is-full { background: transparent; box-shadow: none; }
.cue-build { padding: clamp(0.6rem, 1.8vw, 1rem); background: var(--panel); border-top: 6px solid var(--team); box-shadow: var(--lift); }
.cue-build.is-word { background: transparent; border-top-color: transparent; box-shadow: none; transition: background-color 0.4s, border-color 0.4s; }
.box .cap { cursor: default; }
.cue.is-word .boxes { gap: 0; }
.cue.is-word .box { width: var(--cap); }
.cue.is-word .cap { border-radius: 0; box-shadow: inset 0 calc(var(--c) * -0.085) 0 var(--rim); }
.cue.is-word .box:first-child .cap { border-radius: calc(var(--c) * 0.22) 0 0 calc(var(--c) * 0.22); }
.cue.is-word .box:last-child .cap { border-radius: 0 calc(var(--c) * 0.22) calc(var(--c) * 0.22) 0; }
.cue.is-word .cap-vowel { background: var(--paper); color: var(--ink); --rim: var(--edge); transition: background-color 0.5s, color 0.5s; }
.cue-build.is-word { filter: drop-shadow(0 14px 14px rgba(2, 5, 14, 0.35)); }

/* read */
.cue-word {
  display: flex; justify-content: center; align-items: baseline; max-width: 100%;
  padding: 0.12em 0.42em 0.2em; border-radius: clamp(1rem, 3vw, 1.75rem);
  background: var(--paper); color: var(--ink); box-shadow: var(--lift);
  font-family: var(--f-read); font-weight: 700; line-height: 1.15;
  font-size: clamp(2.4rem, min(calc((100vw - 3rem) / (var(--len, 4) * 0.7 + 1.15)), 26vh), 11rem);
  transition: transform 0.5s var(--ease);
}
.g { font: inherit; color: inherit; padding: 0 0.035em; transition: color 0.2s; }
.g.is-touched { animation: touch 0.55s var(--ease); }
@keyframes touch { 30% { color: var(--red); transform: translateY(-0.07em); } }
.cue-word.is-heard { animation: heard 0.7s var(--ease); }
@keyframes heard { 35% { transform: scale(1.06) rotate(-1.2deg); } }
.act-read .meter { width: clamp(9rem, 30vw, 14rem); }
.talk { display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 4vw, 2rem); }
.mic-btn {
  position: relative; width: clamp(6.5rem, 17vmin, 8.5rem); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); color: var(--paper);
  box-shadow: 0 0 0 0.5rem var(--paper), 0 0.5rem 0 0.5rem rgba(2, 5, 14, 0.16), 0 1.3rem 1.6rem -0.4rem rgba(2, 5, 14, 0.5);
  transition: transform 0.2s var(--ease), background-color 0.2s, opacity 0.2s;
}
.mic-btn .ico { width: 3rem; height: 3rem; stroke-width: 2; }
.mic-btn:active { transform: translateY(0.25rem); }
.mic-btn:disabled { background: #8d2a25; opacity: 0.75; }
.mic-btn:focus-visible { outline-offset: 0.8rem; }
.mic-btn::after { content: ''; position: absolute; inset: -0.5rem; border-radius: 50%; border: 3px solid var(--paper); opacity: 0; pointer-events: none; }
.mic-btn.is-ready::after { animation: beckon 1.8s var(--ease) infinite; }
.mic-btn.is-live::after { animation: beckon 0.9s linear infinite; border-color: var(--paper); }
.mic-btn.is-live { background: #ff3626; }
@keyframes beckon { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.45); } }
.round-btn {
  width: clamp(4.75rem, 13vmin, 6rem); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); box-shadow: var(--lift), 0 5px 0 var(--edge);
  transition: transform 0.2s var(--ease);
}
.round-btn .ico { width: 2.3rem; height: 2.3rem; }
.round-btn:active { transform: translateY(4px); }
.self-answers { display: flex; gap: inherit; }
.self-answers[hidden] { display: none; }
.btn-yes { background: var(--ink); color: var(--paper); box-shadow: var(--lift), 0 5px 0 var(--well); }

/* match */
.match-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.6rem, 2.5vw, 1.75rem); width: min(100%, 54rem, 100vh); }
.match-slot { display: grid; gap: 0.6rem; justify-items: center; }
.match-slot:nth-child(1) .postcard { rotate: -2deg; }
.match-slot:nth-child(3) .postcard { rotate: 1.6deg; }
.match-drop { width: 100%; min-height: 4.6rem; display: grid; place-items: center; border-radius: 6px; background: var(--well); box-shadow: inset 0 0 0 2px var(--line); transition: border-color 0.3s, background-color 0.2s; }
.match-slot.is-full .match-drop { background: transparent; box-shadow: none; }
.match-slot { border-radius: 1rem; cursor: pointer; }
.match-slot.is-full { cursor: default; }
.tool:disabled { opacity: 0.45; }
.match-drop .wordcard { cursor: default; font-size: clamp(1.3rem, 0.8rem + 2.4vw, 2.4rem); min-height: 3.4rem; }

/* postcards */
.postcard { margin: 0; width: 100%; background: var(--paper); color: var(--ink); padding: clamp(0.35rem, 0.3rem + 0.6vw, 0.7rem); border-radius: 0.5rem; box-shadow: var(--lift); text-align: center; font: inherit; }
.postcard-art { position: relative; aspect-ratio: 1; border-radius: 0.25rem; background: #ece9f3; }
.postcard-art img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; -webkit-user-drag: none; }
.postcard-blank { width: 100%; height: 100%; display: grid; place-items: center; border-radius: inherit; background: var(--navy); color: var(--paper); font-family: var(--f-read); font-weight: 700; font-size: clamp(1.1rem, 0.8rem + 1.4vw, 1.7rem); }
.postcard { container-type: inline-size; }
.postmark {
  position: absolute; top: -7%; left: -7%; min-width: 26%; aspect-ratio: 1; padding: 0 4%;
  display: grid; place-items: center; transform: skewX(-8deg);
  background: var(--ink); color: var(--paper); box-shadow: 0 0 0 2px var(--paper);
  font-family: var(--f-board); font-style: italic; line-height: 1;
}
.postmark b { font-size: clamp(0.8rem, 15cqw, 2rem); font-weight: 900; font-variant-numeric: tabular-nums; }
.postcard-word { display: block; padding-top: 0.2em; font-family: var(--f-read); font-weight: 700; font-size: clamp(1.1rem, 0.8rem + 1.4vw, 1.7rem); line-height: 1.25; }
.postcard-arrive { position: absolute; z-index: 20; top: 50%; left: 50%; width: clamp(10rem, 34vh, 17rem); opacity: 1 !important; translate: -50% -50%; transform: none !important; animation: arrive 0.9s var(--ease) both; }
@keyframes arrive { from { opacity: 0; translate: -50% 80%; rotate: 14deg; scale: 0.7; } to { rotate: -3deg; } }

/* sort */
.bins { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: clamp(0.6rem, 2.5vw, 1.5rem); width: min(100%, 52rem); }
.bin {
  min-height: clamp(11rem, 38vh, 20rem); display: grid; grid-template-rows: auto 1fr; gap: 0.6rem; padding: 0 0 0.6rem;
  cursor: pointer; background: var(--panel); box-shadow: var(--lift);
  transition: background-color 0.2s;
}
.bin-label { text-align: center; padding: 0.02em 0.4em 0.1em; background: var(--team); color: var(--team-on); font-family: var(--f-read); font-weight: 700; font-size: clamp(1.5rem, 1rem + 2.4vw, 2.5rem); line-height: 1.3; }
.bin-stack { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 0.45rem; }
.bin-stack .wordcard { cursor: default; font-size: clamp(1.05rem, 0.7rem + 1.7vw, 1.75rem); min-height: 2.6rem; padding-inline: 0.55em; box-shadow: inset 0 -3px 0 var(--edge), 0 6px 10px -6px rgba(2, 5, 14, 0.7); }

/* sentence */
.slots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(0.45rem, 1.6vw, 0.9rem); font-family: var(--f-read); font-weight: 700; font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.75rem); }
.cue-sentence { display: flex; align-items: stretch; max-width: 100%; background: var(--panel); box-shadow: var(--lift); }
.cue-sentence::before { content: ''; flex: none; width: clamp(0.8rem, 2vw, 1.5rem); background: var(--team); }
.cue-sentence .slots { padding: clamp(0.6rem, 1.8vw, 1rem); }
.slot-end { display: inline-flex; align-items: center; gap: 0.1em; white-space: nowrap; }
.slot { background: var(--well); box-shadow: inset 0 0 0 2px var(--line); min-width: calc(var(--ch, 3) * 0.62em + 1.5em); min-height: calc(1.15em + 0.66em + 5px + 6px); display: grid; place-items: center; border-radius: 6px; transition: background-color 0.2s, box-shadow 0.2s; }
.slot.is-full { background: transparent; box-shadow: none; }
.slot .wordcard { cursor: default; font-size: 1em; }
.endmark { font-size: 1.3em; line-height: 1; }
.cue-sentence.is-word .slots { gap: 0.3rem; }

/* find */
.find-row { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(0.7rem, 3vw, 1.5rem); }
.find-row.is-in .cap { animation: deal 0.45s var(--ease) both; }
.find-row .cap:nth-child(2) { animation-delay: 0.05s; }
.find-row .cap:nth-child(3) { animation-delay: 0.1s; }
.find-row .cap:nth-child(4) { animation-delay: 0.15s; }
.cap-big { --cap: clamp(4.5rem, min(20vw, 22vh), 9rem); cursor: pointer; }
.cap.is-right { transform: translateY(-12px) scale(1.1); }

/* rings: the word going out on the air */
.rings { position: fixed; z-index: 40; width: 0; height: 0; pointer-events: none; color: var(--paper); }
.rings i { position: absolute; left: 50%; top: 50%; width: 9rem; height: 9rem; margin: -4.5rem; border-radius: 50%; border: 4px solid currentColor; opacity: 0; animation: ring 1.2s var(--ease) both; }
.rings i:nth-child(2) { animation-delay: 0.14s; }
.rings i:nth-child(3) { animation-delay: 0.28s; }
@keyframes ring { from { opacity: 0.95; transform: scale(0.5); } to { opacity: 0; transform: scale(4.2); } }
.ghost-hand { position: fixed; z-index: 60; left: 0; top: 0; pointer-events: none; filter: drop-shadow(0 8px 8px rgba(2, 5, 14, 0.4)); }

/* ---------- sign-off ---------- */
.signoff { display: grid; justify-items: center; gap: clamp(1rem, 3.5vh, 2rem); width: 100%; }
.signoff-title { display: flex; align-items: stretch; font-family: var(--f-board); font-style: italic; font-weight: 900; text-transform: uppercase; font-size: clamp(2.6rem, 1.4rem + 5.5vw, 5.25rem); line-height: 1; text-align: center; transform: skewX(-8deg); box-shadow: var(--lift); }
.signoff-title { background: var(--panel); padding-left: 0.35em; gap: 0.3em; align-items: center; }
.signoff-title b { display: grid; place-items: center; min-width: 1.5em; padding: 0.08em 0.3em 0.12em; background: var(--team); color: var(--team-on); font-variant-numeric: tabular-nums; }
.mail { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 0.4rem; width: 100%; padding: 0.5rem 0.75rem; }
.mail .postcard { width: clamp(4.6rem, min(calc(88vw / (var(--n) * 0.8 + 0.3)), 26vh), 12rem); flex: none; margin-inline: clamp(-1.2rem, -2vw, -0.4rem); rotate: calc((var(--i) - (var(--n) - 1) / 2) * 4deg); animation: mailin 0.7s var(--ease) both; animation-delay: calc(0.25s + var(--i) * 0.12s); cursor: pointer; }
@keyframes mailin { from { opacity: 0; translate: 0 60px; scale: 0.8; } }
.signal-big { width: clamp(9rem, 28vw, 13rem); }
.signoff-actions { display: flex; align-items: center; justify-content: center; gap: clamp(1.5rem, 6vw, 3.5rem); padding: 1rem 0 0.75rem; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 4rem; padding: 0 1.5rem 0 1.2rem; border-radius: 2rem;
  background: var(--paper); color: var(--ink); font-family: var(--f-board); font-style: italic; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 800; font-size: 1.4rem;
  box-shadow: var(--lift), 0 5px 0 var(--edge); transition: transform 0.2s var(--ease);
}
.pill-btn:active { transform: translateY(4px); }

/* ---------- album ---------- */
[data-screen='album'] .stage { display: block; place-items: normal; overflow-y: auto; padding-bottom: 2rem; scrollbar-width: thin; scrollbar-color: var(--on) transparent; -webkit-overflow-scrolling: touch; }
.album { display: grid; gap: clamp(1.5rem, 4vh, 2.5rem); max-width: 64rem; margin: 0 auto; padding-top: 0.5rem; }
.album-group h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem; font-family: var(--f-board); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 800; margin-bottom: 0.8rem; }
.album-group h2 small { font-family: var(--f-ui); font-size: 0.95rem; font-weight: 600; color: var(--steel); margin-left: auto; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; min-width: 1.7em; text-align: center; padding: 0.02em 0.4em 0.06em; background: var(--chip); color: var(--chip-on); transform: skewX(-8deg); font-family: var(--f-board); font-style: italic; font-weight: 900; font-size: 1.05em; font-variant-numeric: tabular-nums; }
.album-group { scroll-margin-top: 0.9rem; }
.album-group.is-empty h2 { margin-bottom: 0; color: var(--steel); }
.album-group.is-empty .chip { opacity: 0.55; }
.album { gap: clamp(0.9rem, 2.4vh, 1.5rem); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(6.5rem, 20vw, 9.5rem), 1fr)); gap: clamp(0.7rem, 2vw, 1.25rem); }
.album-grid .postcard { cursor: pointer; transition: transform 0.25s var(--ease); }
.album-grid .postcard:nth-child(3n + 1) { rotate: -1.5deg; }
.album-grid .postcard:nth-child(3n) { rotate: 1.2deg; }
.album-grid .postcard:active { transform: scale(0.96); }
.postcard-empty { background: transparent; box-shadow: none; border: 2.5px dashed var(--on-faint); }
.postcard-empty .postcard-art { background: transparent; }
.postcard-empty::after { content: ''; display: block; height: calc(1.25em + 0.2em); font-size: clamp(1.1rem, 0.8rem + 1.4vw, 1.7rem); }

/* ---------- grown-ups sheet ---------- */
.sheet {
  width: min(46rem, calc(100vw - 1.5rem)); max-height: min(92dvh, 56rem); padding: 0; border: 0; border-radius: 1.25rem;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(10, 8, 20, 0.7);
  font-size: 1rem; user-select: text; -webkit-user-select: text; overflow: hidden;
}
.sheet[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: rise 0.4s var(--ease); }
.sheet::backdrop { background: rgba(10, 18, 38, 0.6); }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem 0.75rem 1.5rem; border-bottom: 1.5px solid #e7e4ef; }
.sheet h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.sheet .tool { box-shadow: none; background: #f1eff6; width: 3rem; height: 3rem; }
.sheet :focus-visible { outline-color: var(--ink); }
.sheet-body { overflow-y: auto; padding: 0.5rem 1.5rem 1.75rem; scrollbar-width: thin; scrollbar-color: #b9b4cc transparent; }
.sheet section { padding-top: 1.5rem; }
.sheet h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.sheet p { max-width: 68ch; margin-bottom: 0.6rem; }
.sheet .note { color: #524c6b; font-size: 0.95rem; }
.switch { display: flex; align-items: center; gap: 0.8rem; font-weight: 600; margin: 0.4rem 0 0.7rem; cursor: pointer; min-height: 2.75rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 3.4rem; height: 2rem; border-radius: 1rem; background: #c9c5d8; flex: none; transition: background-color 0.2s; }
.switch-track::after { content: ''; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(2, 5, 14, 0.35); transition: transform 0.25s var(--ease); }
.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track::after { transform: translateX(1.4rem); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--ink); outline-offset: 3px; }
.table-wrap { overflow-x: auto; margin: 0.5rem 0 1rem; }
.progress { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.progress th, .progress td { text-align: left; vertical-align: top; padding: 0.7rem 0.75rem 0.7rem 0; border-top: 1.5px solid #e7e4ef; font-weight: 500; }
.progress th { font-weight: 700; }
.progress th .chip { margin-right: 0.6rem; }
.progress small { display: block; font-weight: 500; font-size: 0.875rem; color: #524c6b; margin-top: 0.15rem; }
.link-btn { font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 2px; min-height: 2.75rem; padding: 0 0.25rem; white-space: nowrap; }
.link-btn.danger { color: #b3160f; }

/* ---------- off air / caption ---------- */
.offair { display: grid; gap: 1rem; justify-items: center; text-align: center; max-width: 34rem; }
.offair h1 { font-family: var(--f-board); font-style: italic; text-transform: uppercase; font-size: clamp(2.4rem, 1.4rem + 4vw, 4rem); font-weight: 900; line-height: 1; text-wrap: balance; }
.offair { padding: 1.5rem 2rem; background: var(--panel); }
.caption {
  position: fixed; z-index: 50; left: 50%; bottom: max(0.75rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(40rem, calc(100vw - 1.5rem)); margin: 0; padding: 0.55rem 1rem; border-radius: 0.9rem;
  background: var(--ink); color: var(--paper); font-size: 1rem; font-weight: 500; text-align: center; pointer-events: none;
  box-shadow: 0 10px 24px -10px rgba(10, 8, 20, 0.7);
}
[data-screen='dial'] ~ .caption { bottom: calc(clamp(8.5rem, 25vh, 12.5rem) + 0.75rem); }
.noscript { padding: 2rem; font-weight: 700; }

/* ---------- small and short screens ---------- */
@media (max-height: 560px) {
  .bar { min-height: 3.5rem; padding-block: 0.4rem; }
  .tool { width: 3rem; height: 3rem; }
  .glass { height: 6.5rem; }
  .freq { font-size: clamp(4rem, 26vh, 8rem); }
  .station-words { display: none; }
  [data-screen='show'] .deck { min-height: 7rem; }
  .bin { min-height: 8rem; }
  .act-read { grid-template-columns: auto auto; align-items: center; justify-content: center; }
}
@media (max-width: 430px) {
  .mark { width: 5.1vw; font-size: 0.82rem; letter-spacing: -0.02em; }
  .marks { top: 46%; height: 34%; }
  .glass-step { width: 2.75rem; }
  .bar { gap: 0.4rem; padding-inline: 0.7rem; }
  .bar-tools { gap: 0.35rem; }
  .tool { width: 3.25rem; height: 3.25rem; }
  .logo { font-size: 1.3rem; }
  .bar-tools { gap: 0.3rem; }
  .bug i { display: none; }
  .rundown { padding: 0 0.25rem; }
  .lamp span { padding-inline: 0.5rem; letter-spacing: 0.1em; }
  .bins { gap: 0.5rem; }
}

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