/* Roomful Words' game pieces: the letter boxes and the A-Z keyboard (js/words-ui.js), the daily puzzle (js/words-daily.js),
   and the live game's TV, phone and results screens. Loaded after site.css and gamenight.css. Letters that have
   appeared, letters a player typed and empty boxes differ by fill and weight as well as color. */

/* ---------- The letter boxes ---------- */
.rw-boxes { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.rw-boxes li {
  display: grid; place-items: center; width: 2.6rem; height: 3rem; border-radius: 10px; box-sizing: border-box;
  border: 3px solid rgba(255, 246, 229, 0.35); background: var(--deep); font-weight: 900; font-size: 1.6rem; line-height: 1;
}
.rw-boxes li.blank { border-style: dashed; }   /* "blank", never "empty" or "answer": site.css styles those */
.rw-boxes li.shown { background: var(--paper); color: var(--ink); border-color: var(--paper); }
/* Only a letter that has just appeared pops (boxes(..., {fresh})); the ones already showing stay still and in line. */
.rw-boxes li.pop { animation: rw-pop 0.35s ease-out; }
.rw-boxes li.typed { border-color: var(--accent); color: var(--accent); }
/* At the answer, the letters nobody saw yet ("filled", never "answer": site.css styles .answer as a Trivia answer button). */
.rw-boxes li.filled { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.rw-boxes.big li { width: clamp(2.2rem, 9vw, 4.2rem); height: clamp(2.6rem, 10.5vw, 4.8rem); font-size: clamp(1.4rem, 6vw, 2.8rem); }
.rw-boxes.big.long li { width: clamp(1.8rem, 7.4vw, 3.8rem); height: clamp(2.2rem, 9vw, 4.4rem); font-size: clamp(1.15rem, 5vw, 2.4rem); }
@keyframes rw-pop { from { transform: scale(0.6); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .rw-boxes li.pop { animation: none; } }
.shake { animation: rw-shake 0.4s; }
@keyframes rw-shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* ---------- The keyboard ---------- */
.rw-keyboard { display: grid; gap: 6px; margin: 14px auto 0; max-width: 34rem; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.rw-keyrow { display: flex; justify-content: center; gap: 5px; }
.rw-key {
  flex: 1 1 0; min-width: 0; max-width: 3.2rem; min-height: 48px; padding: 0; border: 0; border-radius: 9px;
  background: var(--paper); color: var(--ink); font: inherit; font-weight: 850; font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 3px 0 var(--deep);
}
.rw-key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--deep); }
.rw-key:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rw-key.wide { flex: 1.6 1 0; max-width: 5rem; font-size: 1rem; }
.rw-key.go { background: var(--mint); color: var(--ink); }
.rw-key.back { background: var(--paper-dim); }
@media (max-width: 380px) { .rw-keyrow { gap: 3px; } .rw-key { font-size: 1.05rem; border-radius: 7px; } }

/* ---------- The daily puzzle ---------- */
.rw-daily { margin: 18px 0 26px; padding: 18px 16px 20px; border-radius: 20px; background: var(--night); border: 2px solid rgba(255, 246, 229, 0.16); text-align: center; max-width: 40em; }
.rw-kicker { margin: 0; color: var(--paper-dim); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; }
.rw-clue { font-size: clamp(1.15rem, 4.5vw, 1.6rem); font-weight: 750; margin: 10px 0 0; text-wrap: balance; }
.rw-emoji { margin-right: 8px; }
.rw-status { min-height: 1.5em; margin: 4px 0 0; font-weight: 700; color: var(--accent); }
.rw-big { font-size: clamp(2rem, 8vw, 3rem); font-weight: 900; margin: 8px 0 0; }
.rw-big-note { font-size: 1.25rem; font-weight: 750; }
.rw-fact { color: var(--paper-dim); max-width: 32em; margin: 8px auto 0; }
.rw-streak { font-weight: 750; }
.rw-daily .cta-row { justify-content: center; }

/* ---------- The live game: host setup, the TV, phones, results. App screens, no ads. Team names carry a shape
   (● ▲ ◆ ■ ★ ⬟), so a team is never told apart by color alone. Classes only: the CSP allows no inline styles. ---------- */
.rw-screen .crumbs { margin-bottom: 4px; }
.rw-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(15em, 1fr)); gap: 12px 22px; max-width: 54em; margin: 18px 0; }
.rw-setup .field { display: grid; gap: 6px; align-content: start; }
.rw-setup .field label { font-weight: 650; }
.rw-setup .field .note { margin: 0; font-size: 0.9rem; }
.rw-setup .checks, .rw-setup .rw-voice, .rw-setup .estimate, .rw-setup .actions, .rw-setup .error { grid-column: 1 / -1; }
.rw-setup .checks { display: grid; gap: 8px; }
.rw-setup label.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.rw-setup label.check input { width: 1.3em; height: 1.3em; flex: none; }
.rw-setup .estimate { margin: 0; font-weight: 700; color: var(--accent); }
.rw-setup .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.rw-setup .error { margin: 0; }
.rw-setup .error:empty { display: none; }
.rw-voice[hidden] { display: none; }
.rw-voice .voice-picker { display: grid; gap: 6px; max-width: 30em; padding: 12px 14px; border-radius: 14px; background: var(--night); }
.rw-voice .voice-row { display: flex; gap: 8px; }
.rw-voice .voice-row select { flex: 1; min-width: 0; }
.rw-voice .voice-note { margin: 0; font-size: 0.88rem; }

/* TV: the lobby */
.rw-lobby { display: grid; grid-template-columns: minmax(260px, 0.9fr) 1.1fr; gap: 36px; align-items: start; margin-top: 8px; }
.rw-join-box { background: var(--night); border: 2px solid rgba(255, 246, 229, 0.14); border-radius: 20px; padding: 22px; text-align: center; }
.rw-join-box .kicker { margin: 0; font-size: 0.85rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.rw-lobby-side h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); margin-bottom: 6px; }
.rw-summary { color: var(--paper-dim); font-weight: 650; margin: 0 0 6px; }
.rw-players { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.rw-players li { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); color: var(--ink); border: 2px solid var(--deep); border-radius: 999px; padding: 4px 6px 4px 14px; font-weight: 700; min-height: 40px; }
.rw-players li.away { opacity: 0.55; }
.rw-players .kick { appearance: none; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.3rem; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.rw-players .kick:hover, .rw-players .kick:focus-visible { background: rgba(20, 24, 58, 0.12); }
.rw-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(11em, 1fr)); gap: 12px; margin: 10px 0 14px; }
.rw-team { background: var(--night); border: 3px solid rgba(255, 246, 229, 0.16); border-radius: 16px; padding: 10px 12px; }
.rw-team h3 { margin: 0 0 4px; font-size: 1.25rem; }
.rw-team .rw-players { margin: 6px 0 0; }
.rw-team.team-0 { border-color: #5aa9ff; } .rw-team.team-1 { border-color: var(--tangerine); } .rw-team.team-2 { border-color: var(--mint); }
.rw-team.team-3 { border-color: var(--bubblegum); } .rw-team.team-4 { border-color: #b98cff; } .rw-team.team-5 { border-color: var(--lemon); }
.team-mark { font-weight: 900; }
.team-mark.team-0 { color: #8cc3ff; } .team-mark.team-1 { color: var(--tangerine); } .team-mark.team-2 { color: var(--mint); }
.team-mark.team-3 { color: var(--bubblegum); } .team-mark.team-4 { color: #c9a6ff; } .team-mark.team-5 { color: var(--lemon); }
.rw-lobby-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }

/* TV: the game (readable across a living room or classroom). v1.36: the word gets the whole width, with the scores in a
   strip under it, and the letter boxes shrink to keep the word on one row and the screen inside the window (a laptop's
   browser as well as a TV). */
.page.rw-tv-page { max-width: 1500px; }
.rw-tv .tv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: clamp(1rem, 1.6vw, 1.4rem); }
.rw-tv .tv-top .code-tiles { font-size: 1.3em; }
.rw-tv .tv-meta { margin: 0; color: var(--paper-dim); font-weight: 650; }
.rw-tv .tv-count { margin: 0 0 0 auto; color: var(--paper); font-weight: 800; }
.rw-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 12px 0; }
.rw-main { text-align: center; background: var(--night); border: 2px solid rgba(255, 246, 229, 0.14); border-radius: 24px; padding: clamp(12px, 2.4vh, 22px) clamp(12px, 2vw, 28px); display: grid; align-content: center; gap: clamp(4px, 1.2vh, 10px); }
.rw-tv .rw-kicker { font-size: clamp(1rem, 1.8vw, 1.5rem); color: var(--accent); }
.rw-clue.big { font-size: clamp(1.4rem, min(3.6vw, 6.5vh), 3.2rem); margin: 4px 0; }
.rw-tv .rw-boxes.big { flex-wrap: nowrap; gap: clamp(4px, 0.7vw, 10px); margin: clamp(6px, 1.6vh, 14px) 0; }
.rw-tv .rw-boxes.big li { flex: 0 1 min(6.4rem, 13vh); width: auto; height: auto; min-width: 0; aspect-ratio: 6 / 7; border-radius: 14px; font-size: clamp(1.2rem, min(4.6vw, 7.5vh), 4.6rem); }
.rw-tv .rw-boxes.big.long li { flex-basis: min(5.6rem, 12vh); border-radius: 12px; font-size: clamp(1.1rem, min(3.8vw, 6.5vh), 3.8rem); }
@supports (container-type: inline-size) {
  .rw-tv .rw-boxes.big li { container-type: inline-size; }
  .rw-tv .rw-boxes.big li span { font-size: 64cqi; }
}
.rw-timer { margin: 0; font-weight: 800; font-size: clamp(1.2rem, 2.4vw, 2rem); color: var(--paper-dim); }
.rw-timer.last { color: var(--tangerine); }
.rw-paused { font-weight: 850; color: var(--accent); font-size: clamp(1.6rem, 3.4vw, 2.6rem); margin: 0; }
.rw-fact.big { font-size: clamp(1.1rem, 2vw, 1.6rem); }
.rw-sub { margin: 0; color: var(--paper-dim); font-size: clamp(1.05rem, 2vw, 1.6rem); font-weight: 650; }
.rw-award { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 8px; }
.rw-award .rw-sub { flex-basis: 100%; }
.rw-award .team-btn { min-width: 8em; }
.rw-solved { list-style: none; padding: 0; margin: 4px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; max-width: 46em; }
.rw-solved li { padding: 6px 12px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 750; }
.rw-solved .team-mark { filter: brightness(0.75); }
.rw-solved .pts { font-weight: 900; }
.rw-board { background: var(--night); border: 2px solid rgba(255, 246, 229, 0.14); border-radius: 20px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.rw-board h2 { margin: 0; font-size: 1.3rem; }
.rw-board .rw-sub { margin: 0; font-size: 1rem; }
.rw-board .rw-scores { flex: 1 1 100%; order: 1; grid-template-columns: repeat(auto-fill, minmax(12em, 1fr)); }
.rw-board .note { order: 2; margin: 0; }
.rw-tv.phase-ended .rw-board { display: none; }   /* the final standings are in the main box */
.rw-scores { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rw-scores li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 10px; border-radius: 12px; background: var(--deep); font-weight: 700; font-size: clamp(1rem, 1.6vw, 1.3rem); }
.rw-scores li.solved { background: var(--paper); color: var(--ink); }
.rw-scores li.solved .team-mark { filter: brightness(0.75); }
.rw-scores li.away { opacity: 0.55; }
.rw-scores .tick { font-weight: 900; }
.rw-scores .score { margin-left: auto; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right; }
.rw-scores .members { flex-basis: 100%; font-weight: 600; font-size: 0.8em; opacity: 0.85; }
.rw-scores .kick { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }

/* Phones */
.page.rw-play-page { padding-left: 10px; padding-right: 10px; }
.rw-play-page .rw-screen { max-width: 560px; margin: 0 auto; text-align: center; }
.rw-phone-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--night); font-weight: 750; text-align: left; }
.rw-phone-top .score { font-variant-numeric: tabular-nums; color: var(--accent); }
.rw-play-page .rw-clue { font-size: clamp(1.15rem, 5vw, 1.5rem); }
.rw-big.good { color: var(--mint); }
.rw-team-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.rw-team-pick p { grid-column: 1 / -1; margin: 0; font-weight: 700; }
.rw-team-pick .btn { width: 100%; }
.rw-team-pick .btn[aria-pressed="true"] { background: var(--accent); color: var(--ink); }
.rw-play-page .rw-keyboard { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); padding: 8px 0 0; background: var(--cobalt); }

/* Results */
.rw-final { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; max-width: 34em; }
.rw-play-page .rw-final { margin: 10px auto; }
.rw-final li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--night); font-weight: 750; font-size: 1.2rem; text-align: left; }
.rw-final li.top { background: var(--accent); color: var(--ink); }
.rw-final .place { min-width: 1.6em; }
.rw-final .score { margin-left: auto; font-weight: 900; font-variant-numeric: tabular-nums; }
.rw-results { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.rw-results > li { background: var(--night); border-radius: 14px; padding: 10px 14px; }
.rw-results p { margin: 2px 0; }
.rw-results .rw-solved { justify-content: flex-start; margin: 6px 0 0; }
.rw-res-word { display: flex; gap: 8px; align-items: baseline; font-size: 1.25rem; }
.rw-res-word .n { color: var(--paper-dim); min-width: 1.8em; }

@media (max-width: 760px) {
  .rw-lobby { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- v2.0 (P5a): the phone-hosted game in the design system (site.css rf- classes) ---------- */
/* Setup, on the host's phone */
.page.gn .rw-setup-title { flex: 1; font-size: 28px; white-space: nowrap; }
.rw-setup.rf-stack { display: flex; max-width: none; margin: 0; }
.rw-sets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rw-set {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: 10px 12px;
  border: var(--rf-line) solid var(--rf-outline); border-radius: 18px; background: var(--rf-white); color: var(--rf-ink); box-shadow: var(--rf-press-sm);
  cursor: pointer; font-weight: 800; line-height: 1.15;
}
.rw-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rw-set:has(input:checked) { background: var(--rf-tile, var(--rf-primary)); outline: 3px solid var(--rf-link-cream); outline-offset: 2px; }
.rw-set:has(input:focus-visible) { outline: 3px solid var(--rf-focus, var(--rf-link-cream)); outline-offset: 3px; }
.rw-set-name { font-size: 15px; overflow-wrap: anywhere; }
.rw-set-count { font-size: 13px; font-weight: 700; color: var(--rf-muted-cream); }
.rw-set:has(input:checked) .rw-set-count { color: var(--rf-ink); }
.rw-switch { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 800; cursor: pointer; }
.rw-switch input { width: 26px; height: 26px; flex: none; accent-color: var(--rf-blue); }
.rw-setup .voice-picker { display: grid; gap: 8px; padding: 12px; border: 2px solid var(--rf-line-cream); border-radius: 18px; background: var(--rf-white); color: var(--rf-ink); }
.rw-setup .voice-picker[hidden] { display: none; }
.rw-setup .voice-row { display: flex; gap: 8px; min-width: 0; }
.rw-setup .voice-row select { flex: 1; min-width: 0; min-height: 48px; border: var(--rf-line) solid var(--rf-outline); border-radius: 14px; padding: 0 10px; font: inherit; font-weight: 700; background: var(--rf-white); color: var(--rf-ink); }
.rw-setup .voice-picker label.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.rw-setup .voice-note { margin: 0; font-size: 14px; color: var(--rf-muted-cream); }
.rw-tvcard { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: var(--rf-ink); }
.rw-tvcard-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--rf-night); color: var(--rf-white); }
.rw-tvcard-text { display: flex; flex-direction: column; min-width: 0; font-size: 15px; }
.rw-tvcard-text span { color: var(--rf-link-cream); font-weight: 700; overflow-wrap: anywhere; }

/* Join */
.rw-join-screen { text-align: left; }
.rw-join-title { margin: 0; font-size: 44px; line-height: 1; }
.rw-join .rf-code-input { text-transform: uppercase; }
.rw-join .rf-label { color: var(--rf-muted-room); }

/* The phone: top bar, the word, the keyboard in the thumb zone */
.rw-play, .rw-end, .rw-results-page { text-align: left; }
.rw-me { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 17px; }
.rw-me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-me-team { font-size: 15px; font-weight: 700; color: var(--rf-muted-room); }
.rw-host-pill .rf-icon { width: 16px; height: 16px; }
.rw-play .rw-clue { font-size: 24px; font-weight: 800; text-align: center; margin: 0; }
.rw-thumb { position: sticky; bottom: max(8px, env(safe-area-inset-bottom, 0px)); z-index: 5; display: flex; flex-direction: column; gap: 4px; background: var(--rf-blue); padding-top: 6px; }
.rw-thumb .rw-boxes { margin: 0; }
.rw-thumb .rw-keyboard { position: static; margin: 0; padding: 0; background: transparent; }
.rw-thumb .rw-status { text-align: center; color: var(--rf-primary); }
.rw-key { min-height: 52px; border: 2px solid var(--rf-outline); background: var(--rf-cream); color: var(--rf-ink); box-shadow: 0 3px 0 var(--rf-outline); font-weight: 800; }
.rw-key.go { background: var(--rf-primary); }
.rw-key.back { background: var(--rf-white); }
.rw-play .rw-boxes li { border-color: var(--rf-muted-room); background: var(--rf-night); color: var(--rf-white); }
.rw-play .rw-boxes li.typed { border-color: var(--rf-primary); color: var(--rf-primary); }
.rw-play .rw-boxes li.shown, .rw-tv .rw-boxes li.shown { background: var(--rf-cream); color: var(--rf-ink); border-color: var(--rf-cream); }
.rw-play .rw-boxes li.filled, .rw-tv .rw-boxes li.filled { background: var(--rf-primary); color: var(--rf-ink); border-color: var(--rf-primary); }
.rw-got { margin-top: 24px; }
.rw-points, .rw-center { display: flex; justify-content: center; margin: 0; text-align: center; }
.rw-play .rw-fact { color: var(--rf-muted-room); text-align: center; }
.rw-hello { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-top: 12px; }
.rw-summary { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-weight: 700; color: var(--rf-muted-room); text-align: center; }
.rw-summary .rf-icon { width: 20px; height: 20px; flex: none; }
.rw-invite { display: flex; flex-direction: column; gap: 14px; }
.rw-tvs { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--rf-muted-room); font-weight: 700; }
.rw-teams-v2 { display: grid; gap: 12px; }
.rw-team-v2 { display: flex; flex-direction: column; gap: 6px; }
.rw-team-pick .rf-btn[aria-pressed="true"] { outline: 3px solid var(--rf-white); outline-offset: 2px; }
.rw-award .rw-team-btn { min-height: 64px; }
.rw-wait-host { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 56px; border: 2px dashed var(--rf-line-cream); border-radius: 18px; }
.rw-end .rf-winner { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 16px 32px; text-align: center; }
.rw-presenter { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.rw-presenter > .rf-hostbar { margin: 10px 16px 0; font-size: 16px; }
.rw-presenter > .rf-tv-stage { min-height: 0; flex: 1; }
.rw-results-page .rw-final li { background: var(--rf-white); color: var(--rf-ink); }
.rw-results-page .rw-final li.top { background: var(--rf-primary); }
.rw-results-page .rw-results > li { background: var(--rf-white); color: var(--rf-ink); border: 2px solid var(--rf-line-cream); }
.rw-results-page .rw-sub, .rw-results-page .rw-fact { color: var(--rf-muted-cream); }

/* The TV (js/words-live.js): letters appear here, and the race */
.rw-tv .rf-codepill { font-size: var(--rf-fs-label); }
.rw-tv-join { flex: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 3vw, 96px); }
.rw-tv-code { display: flex; flex-direction: column; gap: 24px; }
.rw-tv-code .rf-code > span { font-size: var(--rf-fs-code, 120px); }
.rw-tv .rf-qr--lg { justify-self: end; }
.rw-tv-foot { min-height: 80px; }
.rw-tv-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: 24px; }
.rw-tv-split { flex: 1; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(24px, 2.5vw, 72px); align-items: start; }
.rw-tv-word { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(16px, 2vh, 32px); min-height: 60vh; padding: clamp(24px, 2vw, 56px);
  border-radius: 36px; background: var(--rf-blue); text-align: center; }
.rw-tv .rw-clue.big { font-size: var(--rf-fs-title); font-weight: 800; margin: 0; }
.rw-tv .rw-boxes.big li { border: 4px solid var(--rf-muted-room); background: var(--rf-night); color: var(--rf-white); }
.rw-tv .rw-boxes.big li.blank { border-style: dashed; }
.rw-tv-timer { margin: 0; font-size: var(--rf-fs-body); font-weight: 800; color: var(--rf-muted-room); min-height: 1.2em; }
.rw-tv-timer.is-last { color: var(--rf-orange); }
.rw-tv .rw-fact { color: var(--rf-muted-room); font-size: var(--rf-fs-body); margin: 0; }
.rw-tv .rw-solved li { font-size: var(--rf-fs-small); }
.rw-tv-side { display: flex; flex-direction: column; gap: 16px; }
.rw-race { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rw-race-row { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto 1.2em; align-items: center; gap: 12px; font-size: clamp(16px, 1.6vw, 40px); font-weight: 800; }
.rf-tv .rw-race-row { font-size: var(--rf-fs-small); }
.rw-race-row.is-away { opacity: 0.6; }
.rw-race-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-race-track { height: 0.7em; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.rw-race-bar { --rf-p: 0; display: block; height: 100%; width: calc(var(--rf-p) * 100%); min-width: 0.7em; border-radius: 999px; background: var(--rf-tile, var(--rf-primary)); transition: width 0.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .rw-race-bar { transition: none; } }
.rw-race-score { font-variant-numeric: tabular-nums; }
.rw-race-tick { color: var(--rf-green); }
.rw-race-tick .rf-icon { width: 1em; height: 1em; stroke-width: 3; }
.rw-race-row.is-solved .rw-race-name { color: var(--rf-green); }
.rw-tv-winner { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 40px; border-radius: 36px; text-align: center; }
.rw-tv-winner .rw-race { width: 100%; }
.rw-paused .rf-icon { width: 1em; height: 1em; }
@media (max-width: 759px) {
  .rw-tv-join, .rw-tv-split { grid-template-columns: 1fr; }
  .rw-tv .rf-qr--lg { justify-self: center; }
  .rw-tv-word { min-height: 0; }
}
.rw-tv-word .rw-boxes.big { width: 100%; justify-content: center; }
.rw-tv-word .rw-boxes.big li { flex: 0 1 min(8rem, 14vh); }
.rw-tv .rw-boxes.big li.shown { background: var(--rf-cream); color: var(--rf-ink); border-color: var(--rf-cream); border-style: solid; }
.rw-tv .rw-boxes.big li.filled { background: var(--rf-primary); color: var(--rf-ink); border-color: var(--rf-primary); border-style: solid; }
@media (max-width: 759px) {
  .rw-tv-word .rw-boxes.big li { flex: 0 1 2.6rem; font-size: 1.4rem; }
  .rw-presenter .rf-tv-stage { padding: 12px 16px; gap: 14px; }
}
.rw-tv-word .rw-boxes.big { flex-wrap: nowrap; }
.rw-tv-word .rw-boxes.big li { min-width: 0; }

/* Thumb-first on phones (P9, the viewport matrix): the daily's Start stays on screen on a short phone (360x640). */
@media (max-width: 767px) {
  .rw-daily-start .btn.go { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
}
/* v2.2 (QA-B): the live game's A-Z keyboard on a narrow phone (WordsUI.keyboard fit), every key at least 44 px square */
.rw-keyboard--abc .rw-keyrow { gap: 4px; }
.rw-keyboard--abc .rw-key, .rw-keyboard--abc .rw-key.wide { flex: 1 1 0; min-width: 44px; max-width: 3.4rem; min-height: 52px; }
.rw-keyboard--abc .rw-key.wide { font-size: 1rem; }
@media (max-width: 380px) { .rw-keyboard--abc .rw-keyrow { gap: 2px; } }
/* v2.2 (QA-B H1): the host reads the word aloud when no TV is paired */
.rw-reader-card { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.rw-reader-card .rf-title, .rw-reader-card .rf-body { margin: 0; }
.rw-reader-word { margin: 4px 0 0; font-size: 40px; font-weight: 900; letter-spacing: .04em; overflow-wrap: anywhere; }

/* ---------- v2.8: the Letter Grid race (js/words-grid.js) ----------
   The cells are the Letter Grid daily's (.g-cell in daily.css), copied with the race's own prefix: a shape in each cell's
   corner, so no cell is told apart by color alone; the word being traced is cobalt with white letters, its last letter ink. */
.rwg-play { text-align: left; gap: 10px; }
.rwg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rwg-timer { margin: 0; font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rwg-timer.is-last, .rwg-tv-timer.is-last { color: var(--rf-orange); }
.rwg-count { margin: 0; font-weight: 800; color: var(--rf-muted-room); }
.rwg-grid { display: grid; gap: 8px; width: 100%; max-width: 420px; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.rwg-grid.is-play { touch-action: none; }
.rwg-grid.rwg-4 { grid-template-columns: repeat(4, 1fr); }
.rwg-grid.rwg-3 { grid-template-columns: repeat(3, 1fr); max-width: 330px; }
.rwg-cell { position: relative; aspect-ratio: 1; min-width: 44px; min-height: 44px; border-radius: 18px; border: 3px solid var(--rf-ink); background: var(--rf-white);
  box-shadow: 0 4px 0 var(--rf-ink); font: inherit; font-size: clamp(28px, 9vw, 44px); font-weight: 800; color: var(--rf-ink); padding: 0;
  display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.rwg-grid.is-play .rwg-cell { cursor: pointer; touch-action: none; }
.rwg-cell::after { content: ''; position: absolute; top: 7px; right: 7px; width: 12px; height: 12px; background: var(--rf-yellow); border: 2px solid var(--rf-ink); }
.rwg-cell.rwg-c0::after { clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; background: var(--rf-orange); }
.rwg-cell.rwg-c1::after { border-radius: 50%; background: var(--rf-green); }
.rwg-cell.rwg-c2::after { transform: rotate(45deg); width: 10px; height: 10px; background: var(--rf-pink); }
.rwg-cell.rwg-c3::after { border-radius: 2px; background: var(--rf-teal); }
.rwg-cell.on { background: var(--rf-blue); color: var(--rf-white); border-color: var(--rf-white); }
.rwg-cell.last { background: var(--rf-ink); }
.rwg-cell:focus-visible { outline: 4px solid var(--rf-primary); outline-offset: 2px; }
.rwg-word { min-height: 44px; margin: 0; text-align: center; font-size: 34px; font-weight: 900; letter-spacing: 0.08em; }
.rwg-status { min-height: 24px; margin: 0; text-align: center; font-size: 18px; font-weight: 800; color: var(--rf-primary); }
.rwg-actions { display: flex; gap: 10px; }
.rwg-actions .rf-btn { flex: 1 1 0; min-height: 52px; }
.rwg-hint { margin: 0; text-align: center; color: var(--rf-muted-room); }
.rwg-found { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rwg-found li { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 10px; border-radius: 12px; background: var(--rf-white); color: var(--rf-ink);
  border: 2px solid var(--rf-ink); font-weight: 800; }
.rwg-found li.is-shared { border-style: dashed; }
.rwg-pts { font-size: 13px; color: var(--rf-muted-cream); }
/* the results: on the cream final screen, the results page and the TV alike */
.rwg-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.rwg-results li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 10px 14px; border-radius: 16px; background: var(--rf-white); color: var(--rf-ink); border: 2px solid var(--rf-line-cream); text-align: left; }
.rwg-results li.top { background: var(--rf-primary); border-color: var(--rf-ink); }
.rwg-results li.is-me { outline: 3px solid var(--rf-ink); outline-offset: -1px; }
.rwg-place { grid-row: span 2; font-weight: 900; font-size: 1.2em; }
.rwg-who { display: flex; flex-direction: column; min-width: 0; }
.rwg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwg-best { font-size: 0.85em; font-weight: 700; color: var(--rf-muted-cream); overflow-wrap: anywhere; }
.rwg-results li.top .rwg-best { color: var(--rf-ink); }
.rwg-points { font-weight: 900; text-align: right; }
.rwg-words { grid-column: 3; font-size: 0.85em; font-weight: 700; text-align: right; color: var(--rf-muted-cream); }
.rwg-results li.top .rwg-words { color: var(--rf-ink); }
.rwg-rule { margin: 0; text-align: center; }
.rwg-mine { display: flex; flex-direction: column; gap: 8px; }
.rwg-end .rwg-results { margin-top: 4px; }
/* the TV: the grid big enough to read across a room, the clock, a count per player (never the words) */
.rwg-tv-split { flex: 1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 2.5vw, 72px); align-items: start; }
.rwg-tv-main { display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2vh, 32px); padding: clamp(16px, 2vw, 48px); border-radius: 36px; background: var(--rf-blue); }
.rwg-tv .rwg-grid { max-width: min(64vh, 760px); gap: clamp(8px, 1.2vh, 20px); }
.rwg-tv .rwg-cell { font-size: clamp(36px, 8vh, 120px); border-radius: clamp(18px, 2vh, 32px); }
.rwg-tv-timer { margin: 0; font-size: clamp(36px, 7vh, 110px); font-weight: 900; font-variant-numeric: tabular-nums; }
.rwg-tv-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rwg-tv-side .rwg-grid { max-width: 280px; }
.rwg-tv-side .rwg-cell { font-size: 32px; border-radius: 14px; }
.rwg-tv-side .rwg-cell::after { top: 4px; right: 4px; width: 8px; height: 8px; }
.rwg-tv-side .rwg-cell.rwg-c2::after { width: 7px; height: 7px; }
.rwg-tv-final .rf-qr-box { width: clamp(180px, 15vw, 360px); height: clamp(180px, 15vw, 360px); }
.rwg-counts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rwg-counts li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: clamp(18px, 1.8vw, 44px); font-weight: 800; }
.rwg-counts li.is-away { opacity: 0.6; }
.rwg-count-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwg-count-n { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.rwg-tv-total { margin: 0; font-size: var(--rf-fs-small); }
.rwg-tv-winner { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 32px; border-radius: 36px; text-align: center; }
.rwg-tv-final .rwg-results li { font-size: clamp(18px, 1.6vw, 40px); }
.rw-grid-intro { margin: 0; }
@media (max-width: 759px) {
  .rwg-tv-split { grid-template-columns: 1fr; }
  .rwg-tv .rwg-cell { font-size: clamp(28px, 9vw, 44px); }
}
@media (max-width: 380px) { .rwg-grid { gap: 6px; } .rwg-cell { border-radius: 14px; } }

/* ---------- v2.23: the big screen (js/words-live.js frame(), js/words-letters.js) ----------
   Every Words game screen on a TV, a PC or the host's TV view fills the window with no scrolling: the bar, the word in
   the main area, the scores beside it. --rw-fit (WordsLive.fit) shrinks it a step at a time when a long clue or a big
   room would spill. The tiles are sized from the main area's width (container units) so a 12-letter word spans it and a
   3-letter word is as big as the height allows. Tiles showing, blank and filled in at the answer differ by fill and
   border style as well as color; letters tried carry a tick or a cross. */
.rwb {
  --rw-fit: 1; height: 100vh; height: 100dvh; min-height: 0; box-sizing: border-box; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, clamp(260px, 26vw, 960px)); grid-template-rows: auto minmax(0, 1fr);
  gap: calc(clamp(14px, 2.2vh, 56px) * var(--rw-fit)) clamp(20px, 2.4vw, 80px); align-items: stretch;
}
.rwb > .rf-tv-bar { grid-column: 1 / -1; min-width: 0; }
.rwb.rwb--solo { grid-template-columns: minmax(0, 1fr); }
.rwb-main { grid-column: 1; min-width: 0; min-height: 0; overflow: hidden; container-type: inline-size; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(clamp(10px, 2.4vh, 56px) * var(--rw-fit)); text-align: center; padding: calc(clamp(12px, 2vh, 48px) * var(--rw-fit)) clamp(12px, 1.6vw, 48px);
  border-radius: clamp(20px, 2vw, 48px); background: var(--rf-blue); }
.rwb-side { grid-column: 2; min-width: 0; min-height: 0; overflow: hidden; container-type: inline-size; display: flex; flex-direction: column; gap: calc(clamp(10px, 1.6vh, 36px) * var(--rw-fit)); }
.rwb .rf-tv-bar .rwb-setname { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: clamp(52px, 3.125vw, 90px); }
.rwb-kicker { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6em; margin: 0; font-size: calc(var(--rf-fs-small) * var(--rw-fit)); font-weight: 800; }
.rwb-kicker .rwb-cat { background: var(--rf-cream); color: var(--rf-ink); font-size: 1em; min-height: 0; padding: 0.25em 0.8em; }
.rwb-round-no { color: var(--rf-muted-room); }
.rwb .rw-clue.big { font-size: calc(var(--rf-fs-title) * var(--rw-fit)); line-height: 1.12; max-width: 92%; }
.rwb .rw-fact { font-size: calc(var(--rf-fs-body) * var(--rw-fit)); max-width: 46em; }
.rwb .rw-solved li { font-size: calc(var(--rf-fs-small) * var(--rw-fit)); }

/* the tiles */
.rwb-tiles { --len: 5; --gap: clamp(6px, 1.1cqi, 28px); list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; justify-content: center; gap: var(--gap); width: 100%;
  --tile: min(calc((100cqi - (max(var(--len), 5) - 1) * var(--gap)) / max(var(--len), 5)), calc(26vh * var(--rw-fit))); }
.rwb-tiles li { flex: none; width: var(--tile); aspect-ratio: 5 / 6; box-sizing: border-box; display: grid; place-items: center; border-radius: calc(var(--tile) * 0.14);
  border: max(3px, calc(var(--tile) * 0.045)) dashed var(--rf-muted-room); background: var(--rf-night); color: var(--rf-white); font-weight: 900; line-height: 1; }
.rwb-tiles li span { font-size: calc(var(--tile) * 0.64); }
.rwb-tiles li.open { background: var(--rf-cream); color: var(--rf-ink); border-color: var(--rf-cream); border-style: solid; box-shadow: 0 calc(var(--tile) * 0.05) 0 var(--rf-ink); }
.rwb-tiles li.filled { background: var(--rf-primary); color: var(--rf-ink); border-color: var(--rf-ink); border-style: solid; }
.rwb-tiles li.pop { animation: rwb-turn 0.5s ease-out; }
@keyframes rwb-turn { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
.rwb-tiles--phone { --tile: min(calc((100cqi - (max(var(--len), 5) - 1) * var(--gap)) / max(var(--len), 5)), 64px); --gap: 5px; margin: 4px 0; }
.rwl-play { container-type: inline-size; }

/* the round's clock: a bar that empties, and the seconds */
.rwb-clock { display: flex; align-items: center; gap: 0.8em; width: min(100%, 70cqi); font-size: calc(var(--rf-fs-body) * var(--rw-fit)); font-weight: 900; }
.rwb-clock-track { flex: 1; height: 0.5em; min-height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.rwb-clock-fill { --rf-p: 1; display: block; height: 100%; width: calc(var(--rf-p) * 100%); border-radius: 999px; background: var(--rf-primary); transition: width 0.25s linear; }
.rwb-clock-label { min-width: 4.5em; text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rwb-clock.is-low .rwb-clock-fill { background: var(--rf-orange); }
.rwb-clock.is-low .rwb-clock-label::before { content: '⏱ '; }
.rwb-clock.is-compact { width: 100%; font-size: 18px; }
.rw-tv-timer { font-size: calc(var(--rf-fs-body) * var(--rw-fit)); }

/* the letters tried: in the word (cream, ✓) and not in the word (struck through, ✕) */
.rwb-tried { display: flex; flex-direction: column; gap: 0.4em; width: 100%; font-size: calc(var(--rf-fs-small) * var(--rw-fit)); }
.rwb-tried-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.3em 0.6em; }
.rwb-tried-label { font-weight: 800; color: var(--rf-muted-room); }
.rwb-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3em; }
.rwb-chip { display: inline-flex; align-items: center; gap: 0.15em; padding: 0.05em 0.45em; border-radius: 0.4em; font-weight: 900; border: 2px solid var(--rf-cream); }
.rwb-chip.is-in { background: var(--rf-cream); color: var(--rf-ink); }
.rwb-chip.is-out { background: transparent; color: var(--rf-muted-room); border-style: dashed; }
.rwb-chip.is-out .rwb-chip-l { text-decoration: line-through; text-decoration-thickness: 0.12em; }
.rwb-chip-mark { font-size: 0.75em; }
.rwb-none { color: var(--rf-muted-room); font-weight: 700; }
.rwb-tried.is-compact { font-size: 15px; }
.rwb-note { margin: 0; min-height: 1.2em; font-size: calc(var(--rf-fs-body) * var(--rw-fit)); font-weight: 800; color: var(--rf-muted-room); }
.rwb-turn { margin: 0; font-size: calc(var(--rf-fs-body) * var(--rw-fit)); font-weight: 900; padding: 0.2em 0.8em; border-radius: 999px; background: var(--rf-cream); color: var(--rf-ink); }

/* a round's result, once it has closed */
.rwb-round { width: 100%; }
.rwb-res-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5em; font-size: calc(var(--rf-fs-small) * var(--rw-fit)); }
.rwb-res { display: inline-flex; align-items: baseline; gap: 0.45em; padding: 0.25em 0.7em; border-radius: 0.6em; background: var(--rf-cream); color: var(--rf-ink); font-weight: 800; }
.rwb-res.is-out { background: transparent; color: var(--rf-white); border: 2px dashed var(--rf-muted-room); }
.rwb-res-l { font-weight: 900; font-size: 1.25em; }
.rwb-res.is-out .rwb-res-l { text-decoration: line-through; }
.rwb-res-by { font-weight: 700; opacity: 0.85; }

/* the scoreboard beside the word */
.rwb-board { display: flex; flex-direction: column; gap: 0.5em; min-height: 0; font-size: min(calc(var(--rf-fs-small) * var(--rw-fit)), 7.5cqi); }
.rwb-scores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3em; }
.rwb-score { display: grid; grid-template-columns: 1.1em minmax(0, 1fr) 1.2em auto 2.6em; align-items: center; gap: 0.4em; padding: 0.2em 0.5em; border-radius: 0.5em; background: rgba(255, 255, 255, 0.07); font-weight: 800; }
.rwb-score.is-away { opacity: 0.55; }
.rwb-score.is-turn { outline: 3px solid var(--rf-cream); }
.rwb-score-place { color: var(--rf-muted-room); font-variant-numeric: tabular-nums; }
.rwb-score-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwb-score-name .rf-shape { width: 0.8em; height: 0.8em; vertical-align: -0.05em; }
.rwb-score-sub { display: block; font-size: 0.7em; font-weight: 700; color: var(--rf-muted-room); overflow: hidden; text-overflow: ellipsis; }
.rwb-score-tick { color: var(--rf-green); font-weight: 900; text-align: center; font-size: 0.9em; }
.rwb-score-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 900; }
.rwb-delta { font-size: 0.8em; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.rwb-delta.is-up { color: var(--rf-green); animation: rwb-rise 0.6s ease-out; }
.rwb-delta.is-down { color: var(--rf-orange); }
@keyframes rwb-rise { from { transform: translateY(0.6em); opacity: 0; } to { transform: none; opacity: 1; } }
.rwb-more, .rwb-picked { margin: 0; color: var(--rf-muted-room); font-weight: 800; }
.rwb-side .rw-race-row { font-size: calc(var(--rf-fs-small) * var(--rw-fit)); }

/* the lobby and the final screen in the same frame */
.rwb-lobby { height: 100vh; height: 100dvh; box-sizing: border-box; }
.rwb-final .rwb-main { justify-content: flex-start; }
.rwb-final .rw-final { width: min(100%, 34em); font-size: calc(var(--rf-fs-small) * var(--rw-fit)); }
.rwb-final .rw-final li { font-size: 1em; }
.rwb-final .rwb-side { align-items: center; justify-content: center; }
.rwb-final .rf-qr-box { width: min(100%, 36vh); height: auto; aspect-ratio: 1; }
.rwb-final .rf-qr-box canvas { width: 100%; height: auto; }

/* the host's TV view on a phone page, and a wide screen that is also a player: no phone column */
.rw-play-page .rw-screen.is-tv, .rw-play-page .rw-screen.is-wide { max-width: none; margin: 0; }
.rw-presenter > .rwb, .rw-presenter > .rf-tv-stage { flex: 1; height: auto; min-height: 0; }
.rw-presenter { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.rw-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 27vw); height: 100vh; height: 100dvh; overflow: hidden; }
.rw-wide-board { min-width: 0; min-height: 0; overflow: hidden; }
.rw-wide-board > .rf-tv-stage { height: 100%; min-height: 0; }
.rw-wide-me { min-width: 0; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; background: var(--rf-blue); border-left: 3px solid rgba(255, 255, 255, 0.12); }
.rw-wide-me { display: flex; flex-direction: column; }
.rw-wide-me > .rf-screen { max-width: none; flex: 1; min-height: 0; }
.rw-wide-hint { margin: 6px 0 0; color: var(--rf-muted-room); font-size: 14px; font-weight: 700; text-align: center; }
/* the board on the left already shows the word, the clock and the letters tried: the right column keeps the keys */
.rw-wide-board > .rwb { grid-template-columns: minmax(0, 1fr) minmax(0, clamp(220px, 30%, 720px)); padding: clamp(16px, 2vw, 64px); }
.rw-wide-me .rwl-play > .rw-clue, .rw-wide-me .rwl-play > .rwb-tiles, .rw-wide-me .rwl-play > .rwb-tried, .rw-wide-me .rwl-play > .rwb-clock,
.rw-wide-me .rwl-play > .rwb-round { display: none; }

/* Letter by Letter on a phone: the A-Z keys (tried ones crossed out or ticked), Solve, the locked pick */
.rwl-where { text-align: center; }
.rwl-thumb { display: flex; flex-direction: column; gap: 8px; }
.rwl-keys { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.rwl-key { position: relative; min-height: 52px; min-width: 0; border: 2px solid var(--rf-outline); border-radius: 10px; background: var(--rf-cream); color: var(--rf-ink); box-shadow: 0 3px 0 var(--rf-outline);
  font: inherit; font-size: 20px; font-weight: 900; cursor: pointer; padding: 0; }
.rwl-key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rf-outline); }
.rwl-key:focus-visible { outline: 3px solid var(--rf-primary); outline-offset: 2px; }
.rwl-key[disabled] { cursor: default; box-shadow: none; transform: none; }
.rwl-key.is-out { background: transparent; color: var(--rf-muted-room); border-style: dashed; border-color: var(--rf-muted-room); }
.rwl-key.is-out > span:first-child { text-decoration: line-through; }
.rwl-key.is-in { background: var(--rf-night); color: var(--rf-white); border-color: var(--rf-night); }
.rwl-key-mark { position: absolute; top: 2px; right: 4px; font-size: 11px; }
.rwl-solve-btn { margin-top: 4px; }
.rwl-solving .rw-boxes { margin: 0 0 8px; }
.rwl-solve-row { display: grid; grid-template-columns: auto 1fr 1.4fr; gap: 8px; margin-top: 8px; }
.rwl-solve-note { margin: 6px 0 0; text-align: center; }
.rwl-locked { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }
.rwl-mine { margin: 0; font-size: 22px; font-weight: 800; text-align: center; }
.rwl-mine-l { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; margin-left: 4px; border-radius: 8px; background: var(--rf-cream); color: var(--rf-ink); }
.rwl-status { text-align: center; min-height: 1.3em; }
.rwl-play .rwb-round .rwb-res-list { font-size: 16px; }
.rwl-play .rwb-res { background: var(--rf-cream); }
.rwl-call .rwl-keys { margin: 4px 0; }
.rwl-answer { padding: 8px 12px; border-radius: 12px; background: var(--rf-night); }
.rwl-answer summary { cursor: pointer; font-weight: 800; }
.rwl-answer-word { margin: 6px 0 0; font-size: 28px; font-weight: 900; letter-spacing: 0.08em; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .rwb-tiles li.pop, .rwb-delta.is-up { animation: none; }
  .rwb-clock-fill { transition: none; }
}
/* Below a big screen (a phone's TV view, a small window) the frame stacks and may scroll, as before. */
@media (max-width: 759px) {
  .rwb, .rwb-lobby { height: auto; min-height: 100dvh; overflow: visible; grid-template-columns: minmax(0, 1fr); }
  .rwb-side { grid-column: 1; }
  .rw-presenter { height: auto; overflow: visible; }
}
@media (max-width: 1023px) {
  .rw-wide { display: block; height: auto; }
}

/* v2.23: the setup's Categories, School words' grades and Difficulty (Trivia's category buttons, .tg-cat in trivia-game.css) */
.rw-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.rw-cat {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: var(--rf-line) solid var(--rf-ink);
  border-radius: var(--rf-r-pill); background: var(--rf-white); color: var(--rf-ink); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.rw-cat .rf-icon { width: 20px; height: 20px; }
.rw-cat[aria-pressed="true"] { background: var(--rf-yellow); font-weight: 800; }
.rw-cat[aria-pressed="true"]::before { content: '✓'; font-weight: 900; }
.rw-cat:focus-visible { outline: 3px solid var(--rf-focus, var(--rf-ink)); outline-offset: 2px; }
.rw-grades[hidden] { display: none; }
.rw-grade-chips .rw-cat { min-width: 48px; justify-content: center; padding: 0 10px; }
.rw-grade-chips .rw-grade[aria-pressed="true"]::before { content: none; }
.rw-grade-chips .rw-grade[aria-pressed="true"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.rw-count-note { margin: 0; font-weight: 700; }
.rw-game-note { margin: -4px 0 0; }

/* v2.23: the Letter Grid race in the big-screen frame: the grid as big as the main area's height allows */
.rwb.rwg-tv .rwg-tv-main { justify-content: center; }
.rwb.rwg-tv .rwg-grid { width: min(100%, calc(62vh * var(--rw-fit))); max-width: none; }
.rwb.rwg-tv .rwg-cell { font-size: calc(min(9vh, 7cqi) * var(--rw-fit)); }
.rwb.rwg-tv .rwg-tv-timer { font-size: calc(clamp(36px, 7vh, 140px) * var(--rw-fit)); }
.rwb.rwg-tv .rwg-counts li { font-size: min(calc(var(--rf-fs-small) * var(--rw-fit)), 7.5cqi); }
.rwb.rwg-tv-final .rwg-tv-side .rwg-grid { width: min(100%, 26vh); }
.rwb.rwg-tv-final .rf-qr-box { width: min(100%, 24vh); height: auto; aspect-ratio: 1; }
.rwb.rwg-tv-final .rf-qr-box canvas { width: 100%; height: auto; }
.rwb.rwg-tv-final .rwb-main { justify-content: flex-start; overflow: hidden; }
.rwb-final .rw-final-wrap { width: min(100%, 34em); display: flex; flex-direction: column; gap: 0.4em; }
.rwb-final .rw-final-wrap .rw-final { width: 100%; }
