/* Jamwoop brand tokens (brand/source/build.py; see docs/design/brand.md). */
:root {
  --navy: #081638;
  --navy-raised: #12245a;
  --yellow: #ffc629;
  --ivory: #fff9ee;
  --teal: #00c9c9;
  --tangerine: #ff7029;
  --muted: #b9c2dd;
  --radius: 16px;
  --radius-lg: 24px;
  /* Depth, light and glass (used sparingly; text always sits on a solid enough surface). */
  --glass: rgba(18, 36, 90, 0.58);
  --glass-solid: rgba(18, 36, 90, 0.9);
  --glass-border: rgba(255, 249, 238, 0.12);
  --glass-highlight: inset 0 1px 0 rgba(255, 249, 238, 0.07);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--navy);
  color: var(--ivory);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}

[hidden] {
  display: none !important;
}

.status {
  position: fixed;
  inset: 0 0 auto;
  padding: 8px 16px;
  background: var(--tangerine);
  color: var(--navy);
  font-weight: 700;
  text-align: center;
}

.wordmark {
  display: block;
  height: auto;
}

.player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  animation: pop-in 300ms ease-out;
}

.player.offline,
.player.away {
  opacity: 0.55;
}

.player.me {
  outline: 2px solid var(--yellow);
}

.tag {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--teal);
  color: var(--navy);
  font-size: 0.75em;
  font-weight: 700;
}

.player.settled {
  animation: none;
}

@keyframes pop-in {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player {
    animation: none;
  }
}

/* The TV: readable from the sofa. */
.tv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 4vw;
  padding: 5vh 5vw;
  min-height: 100vh;
  font-size: clamp(16px, 1.6vw, 40px);
  /* JW-HOST-08: the bottom band the join badge and the play-again controls sit in: the badge's height (a 5.6em QR
     code, border-box, 12px padding and a 1px border, measured) plus its 2vh margin and a 16px gap. */
  --tv-bottom-band: calc(5.6em + 26px + 2vh + 16px);
}

.tv .wordmark {
  width: min(32vw, 640px);
  margin-bottom: 4vh;
}

.tv .join-card {
  display: flex;
  flex-direction: column;
  gap: 2vh;
}

.tv .qr {
  width: min(24vw, 420px);
  aspect-ratio: 1;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--ivory);
}

.tv .code {
  font-size: 3.2em;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--yellow);
}

.tv .link {
  color: var(--muted);
  word-break: break-all;
}

.tv .players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11em, 1fr));
  gap: 12px;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv h2 {
  margin: 0 0 2vh;
  color: var(--teal);
}

.tv .message {
  grid-column: 1 / -1;
  text-align: center;
  align-self: center;
}

/* The phone: one column, big targets. */
.phone {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.phone .wordmark {
  width: 70%;
  margin: 8px auto 24px;
}

.phone #join,
.phone section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.phone label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.phone input[type="text"] {
  padding: 14px 16px;
  border: 2px solid var(--navy-raised);
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--navy);
  font-size: 1.2rem;
}

.phone input[type="text"]:focus {
  outline: 3px solid var(--yellow);
}

.phone button {
  padding: 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
}

.phone .toggle {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.phone .toggle input {
  width: 28px;
  height: 28px;
  accent-color: var(--teal);
}

.phone .error {
  min-height: 1.4em;
  color: var(--tangerine);
  font-weight: 600;
}

.phone .note {
  color: var(--muted);
}

.phone .players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Shared layout helpers. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.phone select,
.phone input[type="password"],
.phone input[type="number"],
.phone .prompt input {
  padding: 14px 16px;
  border: 2px solid var(--navy-raised);
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--navy);
  font-size: 1.2rem;
}

.phone fieldset {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 2px solid var(--navy-raised);
  border-radius: var(--radius);
}

.phone legend {
  padding: 0 6px;
  font-weight: 700;
}

.phone .toggle input[type="radio"] {
  width: 24px;
  height: 24px;
  accent-color: var(--teal);
}

.phone .prompt {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.phone .prompt-text {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.phone button:disabled {
  opacity: 0.5;
}

.tv h2 + .qr {
  margin-top: 0;
}

/* The show on the TV. */
.tv .show {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 4vw;
}

.tv .stage {
  display: flex;
  flex-direction: column;
  gap: 2vh;
}

.tv .stage p {
  margin: 0;
}

.tv .stage-title {
  margin: 0;
  font-size: 2.4em;
  line-height: 1.15;
}

.tv .eyebrow {
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tv .options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.4em;
}

.tv .options li {
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.tv .options b {
  color: var(--yellow);
}

.tv .meta,
.tv .hint {
  color: var(--muted);
}

.tv .countdown {
  color: var(--yellow);
  font-size: 1.6em;
  font-weight: 800;
}

.tv .answer,
.tv .big {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--yellow);
}

.tv .jam {
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.4em;
  font-weight: 800;
}

/* Jambo Remembers (D-11): Jambo's callout caption, on a solid panel so it reads over any stage. */
.tv .callout {
  margin-top: 0.6em;
  padding: 12px 18px;
  border-radius: var(--radius);
  border-left: 6px solid var(--teal);
  background: var(--glass-solid);
  color: var(--ivory);
  font-size: 1.2em;
  font-weight: 700;
}

.tv .awards,
.tv .reveal,
.tv .vaults,
.tv .scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv .reveal li,
.tv .vaults li {
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: 1.2em;
}

.tv .caught {
  background: var(--tangerine) !important;
  color: var(--navy);
  font-weight: 700;
}

.tv .vaults .champion {
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.6em;
  font-weight: 800;
}

.tv .scoreboard h2 {
  margin-bottom: 0;
}

/* JW-HOST-09 (interim): while a rule card is in play the scoreboard ends at the join badge's top edge, so the card and
   the Jam Jar stay whole; in rooms already beyond the column's capacity the score list gives way first. Without a rule
   card the scoreboard is laid out as before (F-20261130-f99a). The permanent answer is JW-HOST-11. */
.tv .scoreboard.with-rule-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 5vh - var(--tv-bottom-band) + 16px);
}

.tv .scoreboard.with-rule-card .scores {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tv .scoreboard .rule-card,
.tv .scoreboard #jam-jar {
  flex-shrink: 0;
}

/* Flex margins don't collapse: the last line keeps no bottom margin, so the bound costs no space. */
.tv .scoreboard.with-rule-card #jam-jar {
  margin-bottom: 0;
}

.tv .scoreboard.with-rule-card .rule-card {
  margin: 8px 0;
}

.tv .scoreboard .rule-card {
  font-size: 0.8em;
}

.tv .scoreboard.with-rule-card h2 + .note {
  display: none;
}

.tv .scoreboard.with-rule-card .score {
  padding: 5px 12px;
}

.tv .scoreboard.with-rule-card .rule-card {
  padding: 8px 12px;
}

.tv .score {
  display: grid;
  grid-template-columns: 2em 1fr auto;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.tv .score .rank {
  color: var(--yellow);
  font-weight: 800;
}

.tv .score .points {
  color: var(--muted);
}

/* Playing on the phone. */
.phone .option {
  background: var(--navy-raised);
  color: var(--ivory);
  text-align: left;
  border: 2px solid transparent;
}

.phone .option.chosen {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--navy);
}

.phone .option.quiet {
  background: transparent;
  border-color: var(--navy-raised);
}

.phone .big-note {
  margin: 24px 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.phone .countdown {
  color: var(--yellow);
  font-weight: 800;
}

/* The join panel the TV keeps in the corner during the show. */
.tv .join-badge {
  position: fixed;
  right: 2vw;
  bottom: 2vh;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: 0.8em;
}

.tv .badge-qr {
  width: 7em;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 8px;
  background: var(--ivory);
}

.tv .badge-label {
  color: var(--teal);
  font-weight: 700;
}

.tv .badge-code {
  color: var(--yellow);
  font-size: 2em;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tv .badge-link {
  color: var(--muted);
}

.phone .host-hint {
  margin-top: 32px;
  text-align: center;
}

.phone .host-hint a {
  color: var(--yellow);
  font-weight: 700;
}

/* The TV start screen: what a host types when they can't scan. */
.tv .setup-codes {
  display: flex;
  gap: 4vw;
}

.tv .setup-codes .code {
  font-size: 2.4em;
}

.phone .host-hint details {
  margin-top: 16px;
  text-align: left;
}

.phone .host-hint summary {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-weight: 700;
  cursor: pointer;
}

.phone .host-hint form {
  margin-top: 14px;
}

/* The start screen fits on one screen: a smaller host QR code leaves room for the codes. */
.tv #start .wordmark {
  width: min(24vw, 480px);
  margin-bottom: 1vh;
}

.tv #start .qr {
  width: min(20vw, 36vh);
}

.tv #start .note {
  color: var(--muted);
}

.tv #start {
  grid-column: 1 / -1;
  gap: 1.5vh;
}

/* After the awards: start a new show. */
/* GDD 3 stage 11: Rematch, Quick Rematch, or a brand-new room. */
.tv .play-again {
  position: fixed;
  left: 5vw;
  bottom: 3vh;
  display: flex;
  gap: 12px;
}

.tv .play-again .new-show {
  padding: 10px 22px;
  font-size: 1em;
  white-space: nowrap;
}

.tv .new-show.quiet {
  background: var(--navy-raised);
  color: var(--ivory);
}

.tv .new-show {
  padding: 16px 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.2em;
  font-weight: 800;
  cursor: pointer;
}

.phone .button-link {
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

/* Teams (GDD 4). */
.tv .team-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2vw;
}

.tv .team-card {
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: 1.3em;
}

.tv .team-card h2 {
  margin: 0 0 8px;
  color: var(--yellow);
}

/* Survey Showdown (GDD 6). */
.tv .survey-teams {
  display: flex;
  gap: 16px;
}

.tv .survey-team {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border: 3px solid transparent;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.tv .survey-team.control {
  border-color: var(--yellow);
}

.tv .survey-team.acting {
  background: var(--teal);
  color: var(--navy);
}

.tv .strikes {
  color: var(--tangerine);
  font-weight: 800;
  letter-spacing: 0.2em;
}

.tv .survey-team.acting .strikes {
  color: var(--navy);
}

.tv .board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.25em;
}

.tv .tile {
  display: grid;
  grid-template-columns: 1.6em 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 2.4em;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--navy-raised);
}

.tv .tile.revealed {
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
}

.tv .tile.flipped {
  background: var(--navy-raised);
  color: var(--muted);
}

.tv .tile.fresh {
  animation: flip-in 400ms ease-out;
}

.tv .tile.frozen {
  background: #3a4a7a;
  color: var(--muted);
  text-decoration: line-through;
}

.tv .tile-number {
  color: var(--teal);
  font-weight: 800;
}

.tv .tile.revealed .tile-number {
  color: var(--navy);
}

.tv .tile-value {
  font-weight: 800;
}

.tv .bank {
  margin: 0;
  color: var(--yellow);
  font-size: 1.4em;
  font-weight: 800;
}

.tv .hit {
  color: var(--yellow);
  font-size: 1.3em;
  font-weight: 800;
}

.tv .strike {
  color: var(--tangerine);
  font-size: 1.3em;
  font-weight: 800;
}

@keyframes flip-in {
  from {
    transform: rotateX(90deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv .tile.fresh {
    animation: none;
  }
}

.phone .buzz {
  padding: 48px 16px;
  background: var(--tangerine);
  font-size: 2rem;
}

/* Guess It and Carol Clash (GDD 5): the picture or clue, big. */
.tv .picture {
  display: grid;
  place-items: center;
  height: 24vh;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ivory);
  font-size: 17vh;
  line-height: 1;
}

.tv .uncover {
  display: inline-block;
  animation-name: uncover;
  animation-timing-function: linear;
  animation-fill-mode: both;
}

@keyframes uncover {
  /* Big and soft at first, but always a recognisable shape. */
  from {
    transform: scale(1.8);
    filter: blur(9px);
  }
  to {
    transform: scale(1);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* No zooming: the picture only sharpens. */
  @keyframes uncover {
    from {
      filter: blur(12px);
    }
    to {
      filter: blur(0);
    }
  }
}

/* Twists (GDD 9). */
.tv .rule-card {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--tangerine);
  color: var(--navy);
  font-weight: 700;
}

.tv .reveal .done {
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
}

.phone .mission {
  padding: 10px 14px;
  border: 2px dashed var(--teal);
  border-radius: var(--radius);
}

/* Paused (GDD 12): timers have stopped. */
.paused-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  padding: 12px 16px;
  background: var(--teal);
  color: var(--navy);
  font-size: 1.2em;
  font-weight: 800;
  text-align: center;
}

/* Jambo's Desk on the host phone (GDD 4). */
.phone .desk {
  margin-top: 24px;
}

.phone .desk > summary {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-weight: 800;
  cursor: pointer;
}

.phone .desk h2 {
  margin: 12px 0 0;
  color: var(--teal);
  font-size: 1.1rem;
}

.phone .desk-player {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.phone .desk-player summary {
  font-weight: 700;
  cursor: pointer;
}

.phone .desk-player[open] {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone .desk-answer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone .desk-answer p {
  flex: 1;
  margin: 0;
}

.phone button.quiet {
  background: transparent;
  border: 2px solid var(--navy-raised);
  color: var(--ivory);
}

/* ---------------------------------------------------------------- UI refinements */

/* A bar that empties as time runs out. */
.timer-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--navy-raised);
}

.timer-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tangerine), var(--yellow));
  transform-origin: left;
  animation-name: drain;
  animation-timing-function: linear;
  animation-fill-mode: both;
}

@keyframes drain {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* The TV: bigger type for the sofa. */
.tv .stage {
  gap: 2.4vh;
}

.tv .stage-title {
  font-size: 2.7em;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tv .options {
  font-size: 1.6em;
}

.tv .options li {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 2.6em;
  padding: 14px 22px;
}

.tv .options b {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--navy);
  color: var(--yellow);
  font-size: 0.8em;
}

.tv .options.revealed li {
  opacity: 0.4;
}

.tv .options.revealed li.right {
  opacity: 1;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
}

.tv .jambo {
  width: min(14vw, 26vh);
  height: auto;
}

/* The scoreboard: the total big, pocket and vault small. */
.tv .score {
  grid-template-columns: 1.6em 1fr auto;
  align-items: center;
}

.tv .score .who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tv .score .name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv .score .split {
  color: var(--muted);
  font-size: 0.75em;
}

.tv .score .total {
  color: var(--yellow);
  font-size: 1.2em;
  font-weight: 800;
}

.tv .scoreboard .note {
  font-size: 0.75em;
}

/* Phones: who you are and your score, at the top. */
.phone .me-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 4px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-weight: 700;
  text-align: center;
}

.phone .option {
  display: flex;
  align-items: center;
  gap: 12px;
}

.phone .option .letter {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: var(--navy);
  color: var(--yellow);
}

.phone .option.chosen .letter {
  background: var(--navy);
}

.phone .option.move {
  border-color: var(--teal);
}

/* The host's Desk: compact switches. */
.phone .desk .toggle {
  padding: 8px 12px;
  font-weight: 600;
}

.phone .desk .toggle input {
  width: 22px;
  height: 22px;
}

.tv .scores.compact {
  gap: 4px;
}

.tv .scores.compact .score {
  padding: 4px 12px;
}

.tv .scores.compact .split {
  display: none;
}

/* GDD 6 Live Host: the board, for the host's eyes only. */
.phone .host-board {
  margin-top: 16px;
  padding: 14px;
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
}

.phone .host-board h2 {
  margin: 0 0 8px;
  color: var(--yellow);
  font-size: 1rem;
}

.phone .host-tiles {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.phone .host-tiles li {
  padding: 4px 0;
  color: var(--muted);
}

.phone .host-tiles li.found {
  color: var(--ivory);
  font-weight: 700;
}

/* GDD 4 Co-Host: the co-host's controls on their own phone. */
.phone .cohost {
  margin-bottom: 12px;
  padding: 12px;
  border: 2px solid var(--teal);
  border-radius: var(--radius);
}

.phone .cohost-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* GDD 10: sound and Jambo's voice on the TV, after a click. */
.sound-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 11;
  padding: 8px 14px;
  border: 2px solid var(--navy-raised);
  border-radius: 999px;
  background: var(--navy);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  opacity: 0.75;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  opacity: 1;
}

/* ================================================================ Jamwoop design language
   The stage: midnight navy lit softly from above (golden) and below (teal), glass panels with a
   fine highlight, golden calls to action. Applied to the join page first, then the lobby, the
   game, the host page and the TV. */

body.stage-light,
body:has(.tv) {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(255, 198, 41, 0.14), transparent 62%),
    radial-gradient(ellipse 80% 60% at 100% 110%, rgba(0, 201, 201, 0.1), transparent 60%),
    var(--navy);
  background-attachment: fixed;
}

.glass {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass);
  box-shadow: var(--shadow), var(--glass-highlight);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-solid);
  }
}

/* Jambo's live wordmark: the logo itself, with eyes that move. */
.brand {
  display: flex;
  justify-content: center;
  width: min(76%, 320px);
  margin: 0 auto 14px;
}

.brand .wordmark,
.brand .wordmark-live {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  filter: drop-shadow(0 10px 28px rgba(255, 198, 41, 0.16));
}

.jz-moves {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 260ms var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .jz-moves {
    transition: none;
  }
}

/* ---------------------------------------------------------------- the join page */

.phone {
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.join {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px 22px;
}

.join-title {
  margin: 0;
  font-size: clamp(1.8rem, 7.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.join-lede {
  margin: 0;
  color: var(--muted);
}

.connection {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 249, 238, 0.06);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.connection::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
  animation: pulse 1.2s ease-in-out infinite;
}

.connection[data-state="online"]::before {
  background: var(--teal);
  animation: none;
}

.connection[data-state="offline"] {
  color: var(--tangerine);
}

.connection[data-state="offline"]::before {
  background: var(--tangerine);
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.phone .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phone .field-label {
  display: block;
  font-weight: 700;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.field-error,
.form-error {
  margin: 0;
  color: var(--tangerine);
  font-weight: 600;
}

.form-error:empty {
  display: none;
}

/* The room code: one real input (paste, keyboard and screen readers all work), drawn as 6 boxes. */
.code-boxes {
  position: relative;
}

/* input.code-input outranks the general text-input style. */
.phone input.code-input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  cursor: text;
}

.phone input.code-input:focus {
  outline: none;
}

.code-input::selection {
  background: transparent;
}

.code-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(5px, 1.8vw, 9px);
}

.code-cells span {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--ivory);
  box-shadow: inset 0 -3px 0 rgba(8, 22, 56, 0.12);
  color: var(--navy);
  font-size: clamp(1.4rem, 7.5vw, 2rem);
  font-weight: 800;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}

.code-cells span.filled {
  transform: translateY(-1px);
}

.code-cells span.active {
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 198, 41, 0.3), inset 0 -3px 0 rgba(8, 22, 56, 0.12);
}

/* A blinking caret in the empty box being typed into. */
.code-cells span.active:empty::after {
  width: 2px;
  height: 45%;
  background: var(--navy);
  content: "";
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.code-boxes.complete span {
  background: #fff3cc;
}

.code-boxes.invalid span {
  border-color: var(--tangerine);
  animation: nudge 280ms var(--ease);
}

@keyframes nudge {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.phone input.name-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--ivory);
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 600;
}

.phone input.name-input::placeholder {
  color: #8a93ad;
  font-weight: 500;
}

.phone input.name-input:focus {
  border-color: var(--yellow);
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 198, 41, 0.3);
}

.phone [aria-invalid="true"].name-input {
  border-color: var(--tangerine);
}

.room-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 249, 238, 0.05);
}

.room-chip strong {
  color: var(--yellow);
  letter-spacing: 0.12em;
}

.room-chip a,
.host-link a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The call to action: golden, lit from above, pressed down when tapped. */
.phone .cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffd860, var(--yellow) 60%, #f2b400);
  box-shadow: 0 12px 28px rgba(255, 198, 41, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: var(--navy);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), opacity 120ms;
}

.phone .cta:active:not(:disabled) {
  box-shadow: 0 6px 16px rgba(255, 198, 41, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(2px);
}

.phone .cta:disabled {
  box-shadow: none;
  opacity: 0.6;
}

.phone .cta:focus-visible,
.host-link a:focus-visible,
.room-chip a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.cta-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(8, 22, 56, 0.25);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.cta.loading .cta-spinner {
  display: inline-block;
}

.cta-spinner.big {
  display: inline-block;
  align-self: center;
  width: 36px;
  height: 36px;
  border-color: rgba(255, 249, 238, 0.2);
  border-top-color: var(--yellow);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta-spinner,
  .connection::before,
  .code-cells span.active:empty::after {
    animation-duration: 2.4s;
  }

  .code-boxes.invalid span {
    animation: none;
  }
}

.host-link {
  margin: 18px 0 0;
  font-size: 0.9rem;
  text-align: center;
}

.rejoining {
  align-items: center;
  text-align: center;
}

.code-plain {
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- the same language in the game */

/* Phones: glass panels and golden primary buttons. */
.phone .prompt,
.phone .me-bar,
.phone .cohost,
.phone fieldset,
.phone .toggle,
.phone .desk > summary,
.phone .desk-player,
.phone .host-board,
.phone .players li,
.phone .mission {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-highlight);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.phone button:not(.option):not(.quiet):not(.code-input) {
  background: linear-gradient(180deg, #ffd860, var(--yellow) 60%, #f2b400);
  box-shadow: 0 8px 20px rgba(255, 198, 41, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.phone .option {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--glass-highlight);
}

.phone .option.chosen {
  border-color: var(--yellow);
  background: var(--yellow);
}

.phone button:focus-visible,
.phone a:focus-visible,
.phone input:focus-visible,
.phone select:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* The TV: the same panels, readable from the sofa. */
.tv .score,
.tv .join-badge,
.tv .options li,
.tv .team-card,
.tv .survey-team,
.tv .reveal li,
.tv .vaults li,
.tv .tile,
.tv .player {
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
}

.tv .join-badge {
  background: var(--glass);
  box-shadow: var(--shadow), var(--glass-highlight);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tv .stage-title {
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.tv .tv-brand {
  width: min(32vw, 640px);
  margin: 0 0 4vh;
}

/* Checkboxes in the brand: a rounded box that fills teal with a tick. */
.phone input[type="checkbox"] {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 2px solid var(--muted);
  border-radius: 8px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.phone input[type="checkbox"]:checked {
  border-color: var(--teal);
  background: var(--teal);
}

.phone input[type="checkbox"]:checked::after {
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
  content: "✓";
}

/* Headings sit close to what they introduce. */
.phone h1 {
  margin: 10px 0 8px;
}

.phone section > p:first-child,
.phone #controls > p {
  margin-top: 0;
}

/* An error line takes no room until there is something to say. */
.phone .error:empty {
  min-height: 0;
  margin: 0;
}

.phone .join-title {
  margin: 0;
}

/* Short phones (iPhone SE and friends): a smaller logo and tighter card, so Let's play stays in view. */
@media (max-height: 640px) {
  .brand {
    width: min(60%, 240px);
    margin-bottom: 8px;
  }

  .join {
    gap: 10px;
    padding: 16px 16px 18px;
  }

  .join-form {
    gap: 12px;
  }

  .field-help {
    display: none;
  }
}

/* Section 14 decision 4: the juniors' assist chips, two to a row. */
.phone .assist-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.phone .option.assist {
  justify-content: center;
  padding: 12px 8px;
  font-size: 1rem;
  text-align: center;
}

/* GDD 10 "Huh?": the rule, privately, next to your score. */
.phone .me-row {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.phone .me-row .me-bar {
  position: static;
  flex: 1;
  margin: 0;
}

.phone button.huh.quiet {
  flex: none;
  width: 46px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass);
  box-shadow: var(--glass-highlight);
  color: var(--yellow);
  font-size: 1.3rem;
  font-weight: 900;
}

.phone .huh-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  padding: 14px 16px;
}

.phone .huh-panel p {
  margin: 0;
}

/* GDD 12 Hall of Fame in the TV lobby. */
.tv .fame {
  margin-top: 3vh;
  padding: 16px 20px;
}

.tv .fame h2 {
  margin: 0 0 8px;
  color: var(--yellow);
}

.tv .fame-list {
  margin: 0;
  padding-left: 1.2em;
}

.tv .fame-list li {
  padding: 2px 0;
}

/* Picture rounds: the picture takes room, so the answers sit tighter and still fit a laptop screen. */
.tv .options.compact {
  gap: 10px;
  font-size: 1.35em;
}

.tv .options.compact li {
  min-height: 2em;
  padding: 8px 18px;
  line-height: 1.2;
}

.tv .picture + .options.compact {
  margin-top: 4px;
}

/* Award cards (GDD 3 stage 10): one card at a time, then the champion. */
.tv .award-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.tv .award-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  animation: award-in 500ms ease-out both;
}

.tv .award-card.nobody .award-winner,
.tv .award-card.nobody .award-line {
  opacity: 0.7;
}

.tv .award-icon {
  font-size: 1.6em;
  line-height: 1;
}

.tv .award-name {
  color: var(--yellow);
}

.tv .award-winner {
  font-size: 1.25em;
  font-weight: 800;
}

.tv .award-line {
  font-size: 0.85em;
}

.tv .award-champion,
.tv .award-after,
.award-reveal {
  animation: award-in 600ms ease-out both;
}

@keyframes award-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

/* JW-HOST-08: the final awards fit above the bottom band, so no line runs under the play-again controls or the
   join badge. Unusually many prophecy lines are clipped above the band rather than drawn under it. */
.tv .show.final-awards .stage {
  max-height: calc(100vh - 5vh - var(--tv-bottom-band));
  overflow: hidden;
  gap: 1.4vh;
}

.tv .show.final-awards .award-cards {
  gap: 8px;
  margin: 0;
}

.tv .show.final-awards .award-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  align-items: center;
  column-gap: 8px;
  padding: 6px 12px;
}

.tv .show.final-awards .award-icon {
  font-size: 1.2em;
}

.tv .show.final-awards .award-winner,
.tv .show.final-awards .award-line {
  grid-column: 1 / -1;
}

.tv .show.final-awards .award-line {
  font-size: 0.75em;
}

.tv .show.final-awards .award-champion {
  font-size: 1.8em;
}

.tv .show.final-awards .award-after {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tv .show.final-awards .award-after li {
  padding: 6px 12px;
  font-size: 0.85em;
}

@media (prefers-reduced-motion: reduce) {
  .tv .award-card,
  .tv .award-champion,
  .tv .award-after,
  .award-reveal {
    animation: none;
  }
}

/* The phone's own awards (GDD 3 stage 10: "Your awards and mission result"). */
.my-award {
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-weight: 700;
}

.my-award.champion {
  color: var(--yellow);
}

/* Who's Most Likely (GDD 5): the votes stack up next to each player. */
.tv .votes .vote-stack {
  margin-left: 12px;
  color: var(--yellow);
  letter-spacing: 2px;
}

/* On the highlighted (majority) row the stack must stay visible. */
.tv .votes .done .vote-stack {
  color: var(--navy);
}

/*
 * Creative delivery package 3: game assets in place of interface emoji (only with the game_assets feature on; the
 * server marks the page). Sized in em so they follow the text around them; vertical-align keeps them on the text's
 * line without making the line taller.
 */
.jw-icon {
  display: inline-block;
  line-height: 0;
  vertical-align: -0.2em;
}

.jw-icon svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
}

.jw-icon--md svg {
  width: 1.4em;
  height: 1.4em;
}

.jw-icon--lg svg {
  width: 1.6em;
  height: 1.6em;
}

.jw-icon--md,
.jw-icon--lg {
  vertical-align: -0.3em;
}

/* An unused strike slot. */
.jw-icon--empty {
  opacity: 0.3;
}

.jw-strikes {
  display: inline-flex;
  gap: 0.15em;
  vertical-align: -0.2em;
}

/* Medals on the award cards: the card's icon slot already sets a large size. */
.tv .award-icon .jw-icon svg {
  width: 1.25em;
  height: 1.25em;
}

/* The phone's move and gift buttons: the icon reads at arm's length. */
.phone .option .jw-icon--md svg {
  width: 1.75em;
  height: 1.75em;
}

.phone .option .jw-icon--md {
  margin-right: 0.15em;
  vertical-align: middle;
}

/*
 * The Jam Jar's fill must read from the sofa, so the jar is drawn larger than the note's text; its negative margins keep
 * the line no taller than the text, so no score row gives way to it (JW-HOST-09, measured with a rule card in play).
 */
.tv #jam-jar .jw-icon svg {
  width: 2em;
  height: 2em;
}

.tv #jam-jar .jw-icon {
  margin: -0.6em 0 -0.4em;
  vertical-align: -0.55em;
}

/*
 * Creative delivery package 6 (JW-HOST-11): the leaderboard beat. Every player's rank, name and total, in one to three
 * columns by room size (Figma 41:1969, 23:747), only with the leaderboard_beat feature on. Sized in the 1080p canvas
 * unit, so a 720p TV and browser zoom show the same layout; the smallest type is 28 px at 1080p (LEADERBOARD_FLOOR).
 */
.tv .show {
  --lb-u: min(100vw / 1920, 100vh / 1080);
}

.tv .show.leaderboard-beat {
  grid-template-columns: minmax(0, 1fr);
}

.tv .show.leaderboard-beat .scoreboard {
  display: none;
}

/* The board ends above the join badge's band, so no row sits under the badge. */
.tv .lb {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 5vh - var(--tv-bottom-band));
  min-height: 0;
}

.tv .lb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 calc(32 * var(--lb-u));
}

.tv .lb-kicker {
  margin: 0;
  color: var(--teal);
  font-size: calc(32 * var(--lb-u));
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tv .lb-title {
  margin: calc(4 * var(--lb-u)) 0 calc(16 * var(--lb-u));
  font-size: calc(72 * var(--lb-u));
  font-weight: 800;
  line-height: 1.05;
}

.tv .lb-rows {
  display: grid;
  flex: 1 1 auto;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--lb-rows), minmax(0, 1fr));
  grid-auto-columns: minmax(0, 1fr);
  gap: calc(10 * var(--lb-u)) calc(28 * var(--lb-u));
  min-height: 0;
  /* Few players: rows stay a comfortable height instead of filling the screen. */
  max-height: calc(var(--lb-rows) * 112 * var(--lb-u));
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv .lb--cols-1 .lb-rows {
  max-width: calc(1180 * var(--lb-u));
}

.tv .lb-row {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 0.45em;
  min-height: 0;
  padding: 0 0.6em;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--navy-raised);
  line-height: 1.1;
}

.tv .lb--cols-1 .lb-row {
  font-size: calc(48 * var(--lb-u));
}

.tv .lb--cols-2 .lb-row {
  font-size: calc(40 * var(--lb-u));
}

.tv .lb--cols-3 .lb-row {
  font-size: calc(32 * var(--lb-u));
}

.tv .lb-row--leader {
  border-color: var(--yellow);
}

.tv .lb-row--champion {
  background: var(--yellow);
  color: var(--navy);
}

.tv .lb-rank,
.tv .lb-total {
  color: var(--yellow);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tv .lb-row--champion .lb-rank,
.tv .lb-row--champion .lb-total {
  color: var(--navy);
}

/* Names in full: the engine allows 12 characters; an unusually wide name wraps rather than being cut. */
.tv .lb-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* A name too wide for its column: at the floor, tighter, on two lines at most (fitBoardNames in tv.ts). */
.tv .lb-name.lb-name--fit {
  font-size: calc(28 * var(--lb-u));
  line-height: 0.92;
  letter-spacing: -0.01em;
}

/* Fixed tracks, so totals line up whether or not a row carries a rank change (a protected score column). */
.tv .lb-rank {
  grid-column: 1;
}

.tv .lb-name {
  grid-column: 2;
}

.tv .lb-change {
  grid-column: 3;
}

.tv .lb-total {
  grid-column: 4;
  text-align: right;
}

/* Rank changes: shape and number as well as colour. */
.tv .lb-change {
  font-size: 0.75em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tv .lb-change--up {
  color: var(--teal);
}

.tv .lb-change--down {
  color: var(--tangerine);
}

.tv .lb-row--champion .lb-change {
  color: var(--navy);
}

.tv .lb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tv .lb-next {
  margin: 0;
  color: var(--muted);
  font-size: calc(30 * var(--lb-u));
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* The vault opening: rows appear in the server's opening order, all within the stage's time. */
.tv .lb-row--reveal {
  animation: pop-in 400ms both;
  animation-delay: calc(var(--lb-step) * var(--lb-pace));
}

@media (prefers-reduced-motion: reduce) {
  .tv .lb-row--reveal {
    animation: none;
  }
}

/* 17–30 players: a smaller title and tighter gaps leave each of the ten rows room for a two-line name at the floor. */
.tv .lb--cols-3 .lb-title {
  margin-bottom: calc(12 * var(--lb-u));
  font-size: calc(52 * var(--lb-u));
}

.tv .lb--cols-3 .lb-rows {
  row-gap: calc(6 * var(--lb-u));
}

/*
 * Creative delivery package 8a (JW-HOST-10): the awards as a sequence of pages (Figma 38:1606), only with the
 * awards_sequence feature on. Each page sits above the join badge and the play-again controls (the bottom band), in the
 * 1080p canvas unit (--lb-u), never below 28 px at 1080p.
 */
.tv .show.aw-sequence {
  grid-template-columns: minmax(0, 1fr);
}

.tv .show.aw-sequence .scoreboard {
  display: none;
}

.tv .aw-page {
  display: flex;
  flex-direction: column;
  gap: calc(16 * var(--lb-u));
  height: calc(100vh - 5vh - var(--tv-bottom-band));
  min-height: 0;
  animation: aw-page-in 400ms both;
}

@keyframes aw-page-in {
  from {
    opacity: 0;
    transform: translateY(calc(16 * var(--lb-u)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv .aw-page {
    animation: none;
  }
}

.tv .aw-kicker {
  margin: 0;
  color: var(--teal);
  font-size: calc(32 * var(--lb-u));
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tv .aw-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(14 * var(--lb-u));
  min-height: 0;
  text-align: center;
}

.tv .aw-footer {
  margin: 0;
  color: var(--muted);
  font-size: calc(28 * var(--lb-u));
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* One award at a time: the medal, the award, every winner, their line. */
.tv .aw-medal {
  font-size: calc(220 * var(--lb-u));
  line-height: 1;
}

.tv .aw-medal .jw-icon,
.tv .aw-medal .jw-icon svg {
  display: block;
  width: 1em;
  height: 1em;
}

.tv .aw-title {
  margin: 0;
  color: var(--yellow);
  font-size: calc(104 * var(--lb-u));
  font-weight: 800;
  line-height: 1.05;
}

.tv .aw-winners {
  max-width: calc(1600 * var(--lb-u));
  margin: 0;
  font-size: calc(60 * var(--lb-u));
  font-weight: 800;
  line-height: 1.15;
}

.tv .aw-winners--some {
  font-size: calc(46 * var(--lb-u));
}

/* A shared award with many winners: a smaller medal leaves room for every name. */
.tv .aw-winners--many {
  font-size: calc(34 * var(--lb-u));
}

.tv .aw-page--award:has(.aw-winners--many) .aw-medal {
  font-size: calc(140 * var(--lb-u));
}

.tv .aw-page--award:has(.aw-winners--many) .aw-title {
  font-size: calc(76 * var(--lb-u));
}

.tv .aw-line {
  margin: 0;
  font-size: calc(36 * var(--lb-u));
}

/* Highlights. */
.tv .aw-list {
  display: flex;
  flex-direction: column;
  gap: calc(20 * var(--lb-u));
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: calc(48 * var(--lb-u));
  font-weight: 700;
}

/* Every mission result: the leaderboard's grid, the mission under each name. */
.tv .aw-page .lb {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  text-align: left;
}

.tv .aw-mission {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  row-gap: 0;
}

.tv .aw-mission .lb-name {
  grid-column: 1;
  grid-row: 1;
}

.tv .aw-mission-name {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
  font-size: max(0.8em, calc(28 * var(--lb-u)));
  font-weight: 700;
}

.tv .aw-mission .lb-total {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--muted);
}

.tv .aw-mission--done .lb-total {
  color: var(--teal);
}

/* Prophecy results: the question, then two columns of names and answers. */
.tv .aw-question {
  margin: 0;
  font-size: calc(52 * var(--lb-u));
  font-weight: 800;
  line-height: 1.1;
}

.tv .aw-prophecy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(12 * var(--lb-u)) calc(28 * var(--lb-u));
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.tv .aw-prophecy li {
  padding: calc(10 * var(--lb-u)) calc(20 * var(--lb-u));
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: calc(32 * var(--lb-u));
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tv .aw-who {
  display: block;
  color: var(--yellow);
}

/* The finale stays: the champion and a recap of every award, above the play-again controls. */
.tv .aw-title--finale {
  font-size: calc(84 * var(--lb-u));
}

.tv .aw-medal--inline {
  display: inline-block;
  font-size: 1em;
  vertical-align: -0.12em;
}

.tv .aw-finale {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(12 * var(--lb-u)) calc(28 * var(--lb-u));
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.tv .aw-finale li {
  display: flex;
  flex-direction: column;
  padding: calc(10 * var(--lb-u)) calc(20 * var(--lb-u));
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: calc(32 * var(--lb-u));
}

.tv .aw-recap-award {
  color: var(--yellow);
  font-weight: 800;
}

/* 17–30 mission results: two lines per row (name, mission) at or just above the floor, with tighter gaps. */
.tv .aw-mission {
  line-height: 1;
}

.tv .aw-missions.lb--cols-3 .lb-row {
  font-size: calc(30 * var(--lb-u));
}

.tv .aw-missions .lb-rows {
  row-gap: calc(4 * var(--lb-u));
}

.tv .aw-page--missions {
  gap: calc(10 * var(--lb-u));
}

/*
 * Creative delivery package 4 (JW-DES-06): the question and the seven-beat answer reveal (Figma 23:496, 37:1076),
 * only with the question_reveal feature on. Sizes in the 1080p canvas unit and type from tokens.css. Each beat's
 * entrance is an animation delayed to its time from the server's shownAt (--qa-at-N, set by the TV), with the motion
 * tokens' durations: under reduced motion the tokens are 0 ms, so every beat cuts at the same moment, in the same order.
 * Every slot is reserved from the first beat, so nothing moves into another element's space.
 */
.tv .show.qa-stage {
  grid-template-columns: minmax(0, 1fr);
}

.tv .show.qa-stage .scoreboard {
  display: none;
}

.tv .qa {
  --qa-u: var(--jw-tv-unit);
  display: flex;
  flex-direction: column;
  gap: calc(28 * var(--qa-u));
  align-self: stretch;
  min-width: 0;
  color: var(--jw-text-primary);
  font-family: var(--jw-font-interface);
  text-align: start;
}

.tv .qa-kicker {
  margin: 0;
}

.tv .qa .jw-kicker {
  padding: calc(10 * var(--qa-u)) calc(20 * var(--qa-u));
  font-size: var(--jw-size-tv-label-min);
}

.tv .qa-question {
  margin: 0;
  font-family: var(--jw-font-display);
  font-size: var(--jw-size-tv-question);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.tv .qa-question--long {
  font-size: var(--jw-size-tv-title);
  line-height: 1.12;
}

.tv .qa-question--longest {
  font-size: var(--jw-size-tv-answer);
  line-height: 1.15;
}

.tv .qa-tiles {
  display: grid;
  gap: calc(28 * var(--qa-u)) calc(32 * var(--qa-u));
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv .qa-tiles--grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tv .qa-tiles--one {
  grid-template-columns: minmax(0, 1fr);
}

/* The answer tile (Figma "TV/Answer tile" 19:512, 19:526): never shorter than 132, text wraps instead of shrinking. */
.tv .qa-tile {
  display: flex;
  align-items: center;
  gap: calc(24 * var(--qa-u));
  box-sizing: border-box;
  min-width: 0;
  min-height: calc(132 * var(--qa-u));
  padding: calc(12 * var(--qa-u)) calc(36 * var(--qa-u)) calc(12 * var(--qa-u)) calc(28 * var(--qa-u));
  border: calc(4 * var(--qa-u)) solid transparent;
  border-radius: calc(24 * var(--qa-u));
  background: var(--jw-surface-card);
  font-size: var(--jw-size-tv-answer);
  font-weight: 700;
  line-height: 1.15;
}

.tv .qa-tiles--long .qa-tile {
  font-size: var(--jw-size-tv-body);
  line-height: 1.2;
}

.tv .qa-tile--plain {
  padding-left: calc(36 * var(--qa-u));
}

.tv .qa-letter {
  display: grid;
  flex: none;
  place-items: center;
  width: calc(76 * var(--qa-u));
  height: calc(76 * var(--qa-u));
  border-radius: 50%;
  background: var(--jw-accent-action);
  color: var(--jw-text-on-accent);
  font-family: var(--jw-font-numeric);
  font-size: var(--jw-numeric-score-size);
  font-weight: 800;
  line-height: 1;
}

.tv .qa-answer {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tv .qa-tick {
  display: grid;
  flex: none;
  width: calc(64 * var(--qa-u));
  height: calc(64 * var(--qa-u));
}

.tv .qa-tick svg {
  width: 100%;
  height: 100%;
}

/* Beat 1: the answers lock (Figma 37:1077): a yellow edge on the stronger card. */
.tv .qa--reveal .qa-tile {
  border-color: var(--jw-accent-action);
  background: var(--jw-surface-card-strong);
}

/* Beat 3: the server's answer lights green with a tick (shape as well as colour); the others dim but stay readable. */
.tv .qa--reveal .qa-tile--correct {
  animation: qa-correct var(--jw-duration-reveal) var(--jw-ease-standard) var(--qa-at-3) both;
}

.tv .qa--reveal .qa-tile--correct .qa-letter {
  animation: qa-letter-correct var(--jw-duration-reveal) var(--jw-ease-standard) var(--qa-at-3) both;
}

.tv .qa--reveal .qa-tile--correct .qa-tick,
.tv .qa--reveal .qa-tiles--one .qa-answer {
  animation: qa-in var(--jw-duration-reveal) var(--jw-ease-enter) var(--qa-at-3) both;
}

.tv .qa--reveal .qa-tile--dimmed {
  animation: qa-dimmed var(--jw-duration-reveal) var(--jw-ease-standard) var(--qa-at-3) both;
}

.tv .qa--reveal .qa-tile--dimmed .qa-letter {
  animation: qa-letter-dimmed var(--jw-duration-reveal) var(--jw-ease-standard) var(--qa-at-3) both;
}

/* The reveal band (Figma 36:1294): reserved in every beat and on the question screen; at least two lines of body. */
.tv .qa-band {
  display: grid;
  grid-template-areas: "left right";
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
  align-items: center;
  gap: calc(32 * var(--qa-u));
  height: max(calc(136 * var(--qa-u)), calc(2.5 * var(--jw-size-tv-body) + 32 * var(--qa-u)));
  font-size: var(--jw-size-tv-body);
  font-weight: 500;
  line-height: 1.25;
}

.tv .qa-band--question {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  text-align: start;
  gap: calc(16 * var(--qa-u));
}

.tv .qa-band--question .meta {
  color: var(--jw-text-secondary);
  font-size: var(--jw-size-tv-body);
}

.tv .qa-band--question .countdown {
  color: var(--jw-accent-score);
  font-family: var(--jw-font-numeric);
  font-size: var(--jw-numeric-score-size);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tv .qa-who,
.tv .qa-think {
  grid-area: left;
  justify-self: start;
  max-width: 100%;
}

.tv .qa-who {
  display: flex;
  align-items: center;
  gap: calc(16 * var(--qa-u));
  box-sizing: border-box;
  min-width: 0;
  padding: calc(16 * var(--qa-u)) calc(28 * var(--qa-u)) calc(16 * var(--qa-u)) calc(24 * var(--qa-u));
  border-radius: calc(24 * var(--qa-u));
  background: var(--jw-surface-card);
}

.tv .qa-tokens {
  display: flex;
  flex: none;
  gap: calc(8 * var(--qa-u));
}

.tv .qa-token {
  box-sizing: border-box;
  width: calc(64 * var(--qa-u));
  height: calc(64 * var(--qa-u));
  border: calc(3 * var(--qa-u)) solid var(--jw-text-primary);
  font-size: var(--jw-size-tv-label-min);
}

.tv .qa-words {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tv .qa-points {
  color: var(--jw-accent-score);
  font-family: var(--jw-font-numeric);
  font-size: var(--jw-numeric-score-size);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.tv .qa-up-to {
  font-family: var(--jw-font-interface);
  font-size: var(--jw-size-tv-body);
  font-weight: 700;
}

.tv .qa-extra {
  color: var(--jw-text-secondary);
}

/* Jambo's bubble (Figma "TV/Jambo caption" 23:531): beat 2 thinks, beat 6 reacts. */
.tv .qa-think,
.tv .qa-jambo {
  display: flex;
  align-items: center;
  gap: calc(20 * var(--qa-u));
  box-sizing: border-box;
  min-width: 0;
  padding: calc(12 * var(--qa-u)) calc(36 * var(--qa-u)) calc(12 * var(--qa-u)) calc(12 * var(--qa-u));
  border-radius: calc(60 * var(--qa-u));
  background: var(--jw-surface-inverse);
  color: var(--jw-text-on-accent);
}

.tv .qa-jambo {
  grid-area: right;
  justify-self: end;
  max-width: calc(760 * var(--qa-u));
}

.tv .qa-jambo-face {
  display: grid;
  flex: none;
  width: calc(96 * var(--qa-u));
  height: calc(103 * var(--qa-u));
}

.tv .qa-jambo-face svg {
  width: 100%;
  height: 100%;
}

.tv .qa-caption {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tv .qa--reveal .qa-think {
  animation:
    qa-in var(--jw-duration-reveal) var(--jw-ease-enter) var(--qa-at-2) both,
    qa-out var(--jw-duration-fast) var(--jw-ease-exit) var(--qa-at-3) forwards;
}

.tv .qa--reveal .qa-who {
  animation: qa-in var(--jw-duration-reveal) var(--jw-ease-enter) var(--qa-at-4) both;
}

.tv .qa--reveal .qa-points,
.tv .qa--reveal .qa-extra {
  animation: qa-fade var(--jw-duration-reveal) var(--jw-ease-enter) var(--qa-at-5) both;
}

.tv .qa--reveal .qa-jambo {
  animation: qa-in var(--jw-duration-reveal) var(--jw-ease-enter) var(--qa-at-6) both;
}

/* Beat 7, only when the show moves on by itself: the hand-off to what comes next. */
.tv .qa--auto > .qa-kicker,
.tv .qa--auto > .qa-question,
.tv .qa--auto > .qa-tiles,
.tv .qa--auto > .qa-band {
  animation: qa-hand-off var(--jw-duration-base) var(--jw-ease-exit) var(--qa-at-7) forwards;
}

.tv .qa-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes qa-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes qa-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes qa-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes qa-hand-off {
  to {
    opacity: 0.35;
  }
}

@keyframes qa-correct {
  from {
    border-color: var(--jw-accent-action);
    background-color: var(--jw-surface-card-strong);
    color: var(--jw-text-primary);
  }
  to {
    border-color: var(--jw-state-correct);
    background-color: var(--jw-state-correct);
    color: var(--jw-text-on-accent);
  }
}

@keyframes qa-letter-correct {
  from {
    background-color: var(--jw-accent-action);
    color: var(--jw-text-on-accent);
  }
  to {
    background-color: var(--jw-text-on-accent);
    color: var(--jw-state-correct);
  }
}

/* Dimmed: the words keep text/secondary (9.1:1 on the card, audit A16); only the letter badge fades. */
@keyframes qa-dimmed {
  from {
    border-color: var(--jw-accent-action);
    background-color: var(--jw-surface-card-strong);
    color: var(--jw-text-primary);
  }
  to {
    border-color: transparent;
    background-color: var(--jw-surface-card);
    color: var(--jw-text-secondary);
  }
}

@keyframes qa-letter-dimmed {
  to {
    opacity: 0.5;
  }
}

/*
 * Stage A (JW-DES-07): the TV stage, only with the tv_stage feature on. The older TV screens are sized in em, vw and
 * vh, apart from a few caps that stopped them growing past 1080p; each cap now grows with the 1080p canvas unit, so a
 * TV browser that reports 3840x2160 shows the same composition as 1080p. Identical at 1920x1080 and below.
 */
body[data-tv-stage="on"] {
  --tv-stage-unit: min(100vw / 1920, 100vh / 1080);
}

/*
 * The older screens' type follows the canvas unit (the smaller of width/1920 and height/1080), not the width alone:
 * identical at 16:9 (30.72 px at 1080p is the old 1.6vw), and it fits screens wider than 16:9 (21:9) and the 960x540
 * many TV browsers report. A 12 px floor for tiny windows.
 */
body[data-tv-stage="on"] .tv {
  font-size: max(12px, calc(30.72 * var(--tv-stage-unit)));
  /* The band the join badge and play-again controls sit in scales with the badge (identical at 1080p). */
  --tv-bottom-band: calc(5.6em + 26 * var(--tv-stage-unit) + 2vh + 16 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .wordmark,
body[data-tv-stage="on"] .tv .tv-brand {
  width: min(32vw, max(640px, calc(640 * var(--tv-stage-unit))));
}

body[data-tv-stage="on"] .tv #start .wordmark {
  width: min(24vw, max(480px, calc(480 * var(--tv-stage-unit))));
}

body[data-tv-stage="on"] .tv .qr {
  width: min(24vw, max(420px, calc(420 * var(--tv-stage-unit))));
}

body[data-tv-stage="on"] .tv .timer-bar {
  height: max(10px, calc(10 * var(--tv-stage-unit)));
}

/* The full-screen control sits beside Sound; both scale with the canvas on a 4K browser. */
body[data-tv-stage="on"] .sound-toggle {
  font-size: max(16px, calc(16 * var(--tv-stage-unit)));
}

.fullscreen-toggle {
  right: auto;
  left: 12px;
}



/*
 * Typography Option C on every screen (owner, 2026-11-30; brand_type): the approved roles through the package 1
 * semantic tokens only. Bricolage Grotesque (display) for headings, moment and round titles, questions and the phone's
 * headline, JAM!, leaderboard and award headings, and the named moves and moments; Inter (interface) for everything
 * else; Inter with tabular figures (numeric) for counts, totals and ranks. The wordmark stays an image (Mentis Bold).
 */
body[data-brand-type="on"] {
  font-family: var(--jw-font-interface);
}

/* Form controls don't inherit the page's font in browsers; they take the interface face too. */
body[data-brand-type="on"] button,
body[data-brand-type="on"] input,
body[data-brand-type="on"] select,
body[data-brand-type="on"] textarea {
  font-family: var(--jw-font-interface);
}

body[data-brand-type="on"] h1,
body[data-brand-type="on"] h2,
body[data-brand-type="on"] .stage-title,
body[data-brand-type="on"] .prompt-text,
body[data-brand-type="on"] .join-title,
body[data-brand-type="on"] .jam,
body[data-brand-type="on"] .award-name,
body[data-brand-type="on"] .lb-title,
body[data-brand-type="on"] .aw-title,
body[data-brand-type="on"] .jw-term,
body[data-brand-type="on"] .qa-extra--jam {
  font-family: var(--jw-font-display);
}

body[data-brand-type="on"] .jw-term,
body[data-brand-type="on"] .qa-extra--jam {
  font-weight: 800;
}

body[data-brand-type="on"] .countdown,
body[data-brand-type="on"] .total,
body[data-brand-type="on"] .rank,
body[data-brand-type="on"] .lb-rank,
body[data-brand-type="on"] .lb-total,
body[data-brand-type="on"] .tile-value,
body[data-brand-type="on"] .tile-number {
  font-family: var(--jw-font-numeric);
  font-variant-numeric: tabular-nums;
}

/*
 * The TV fits the screen and never scrolls (owner, 2026-11-30; tv_stage). Every screen was measured to fit first
 * (960x540 to 3840x2160, 4:3 to 21:9, a 30-player lobby with the Hall of Fame), so hiding the scroll bar cuts nothing.
 */
body[data-tv-stage="on"] {
  overflow: hidden;
}

/*
 * The older screens' fixed paddings, gaps and margins on the canvas too (generated from their rules): identical at
 * 1080p, proportionally smaller on a 960x540 TV browser and larger at 4K, so every screen keeps its composition.
 */
body[data-tv-stage="on"] .tv .qr {
  padding: calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .players {
  gap: calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .options {
  gap: calc(16 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .options li {
  padding: calc(18 * var(--tv-stage-unit)) calc(22 * var(--tv-stage-unit));
  gap: calc(14 * var(--tv-stage-unit));
  padding: calc(14 * var(--tv-stage-unit)) calc(22 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .jam {
  padding: calc(12 * var(--tv-stage-unit)) calc(18 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .callout {
  padding: calc(12 * var(--tv-stage-unit)) calc(18 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .awards,
body[data-tv-stage="on"] .tv .reveal,
body[data-tv-stage="on"] .tv .vaults,
body[data-tv-stage="on"] .tv .scores {
  gap: calc(8 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .reveal li,
body[data-tv-stage="on"] .tv .vaults li {
  padding: calc(10 * var(--tv-stage-unit)) calc(16 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .scoreboard.with-rule-card .rule-card {
  margin: calc(8 * var(--tv-stage-unit)) 0;
  padding: calc(8 * var(--tv-stage-unit)) calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .scoreboard.with-rule-card .score {
  padding: calc(5 * var(--tv-stage-unit)) calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .score {
  gap: calc(8 * var(--tv-stage-unit));
  padding: calc(8 * var(--tv-stage-unit)) calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .join-badge {
  gap: calc(14 * var(--tv-stage-unit));
  padding: calc(12 * var(--tv-stage-unit)) calc(16 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .badge-qr {
  padding: calc(4 * var(--tv-stage-unit));
  border-radius: calc(8 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .play-again {
  gap: calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .play-again .new-show {
  padding: calc(10 * var(--tv-stage-unit)) calc(22 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .new-show {
  padding: calc(16 * var(--tv-stage-unit)) calc(32 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .team-card {
  padding: calc(18 * var(--tv-stage-unit)) calc(22 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .team-card h2 {
  margin: 0 0 calc(8 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .survey-teams {
  gap: calc(16 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .survey-team {
  gap: calc(12 * var(--tv-stage-unit));
  padding: calc(8 * var(--tv-stage-unit)) calc(16 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .board {
  gap: calc(10 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .tile {
  gap: calc(10 * var(--tv-stage-unit));
  padding: calc(8 * var(--tv-stage-unit)) calc(14 * var(--tv-stage-unit));
  border-radius: calc(10 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .rule-card {
  padding: calc(10 * var(--tv-stage-unit)) calc(14 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .scores.compact {
  gap: calc(4 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .scores.compact .score {
  padding: calc(4 * var(--tv-stage-unit)) calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .fame {
  padding: calc(16 * var(--tv-stage-unit)) calc(20 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .fame h2 {
  margin: 0 0 calc(8 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .fame-list li {
  padding: calc(2 * var(--tv-stage-unit)) 0;
}

body[data-tv-stage="on"] .tv .options.compact {
  gap: calc(10 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .options.compact li {
  padding: calc(8 * var(--tv-stage-unit)) calc(18 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .picture + .options.compact {
  margin-top: calc(4 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .award-cards {
  gap: calc(10 * var(--tv-stage-unit));
  margin: 0 0 calc(10 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .award-card {
  gap: calc(2 * var(--tv-stage-unit));
  padding: calc(10 * var(--tv-stage-unit)) calc(14 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .show.final-awards .award-cards {
  gap: calc(8 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .show.final-awards .award-card {
  column-gap: calc(8 * var(--tv-stage-unit));
  padding: calc(6 * var(--tv-stage-unit)) calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .show.final-awards .award-after {
  gap: calc(8 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .show.final-awards .award-after li {
  padding: calc(6 * var(--tv-stage-unit)) calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .votes .vote-stack {
  margin-left: calc(12 * var(--tv-stage-unit));
}

/* The lobby: the wordmark and join code sized on the canvas, so the column fits beside a full room. */
body[data-tv-stage="on"] .tv #lobby .tv-brand,
body[data-tv-stage="on"] .tv #lobby .wordmark {
  width: calc(440 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv #lobby .tv-brand {
  margin-bottom: calc(16 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv #lobby .qr {
  width: calc(360 * var(--tv-stage-unit));
}

/* The player list: more, denser columns as the room fills. */
body[data-tv-stage="on"] .tv .players {
  gap: calc(12 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .players[data-density="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-tv-stage="on"] .tv .players[data-density="4c"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(8 * var(--tv-stage-unit));
}

body[data-tv-stage="on"] .tv .players[data-density="4c"] .player {
  padding: calc(4 * var(--tv-stage-unit)) calc(10 * var(--tv-stage-unit));
  font-size: 0.82em;
}

body[data-tv-stage="on"] .tv .players .player {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The Hall of Fame: compact (its top 3 and the record heist) so it sits beside a full room. */
body[data-tv-stage="on"] .tv .fame {
  margin-top: calc(20 * var(--tv-stage-unit));
  padding: calc(12 * var(--tv-stage-unit)) calc(18 * var(--tv-stage-unit));
  font-size: 0.82em;
}


/* Sonic S1: the phone's own sound settings (jambo_voice). */
.phone button.huh.quiet.audio-open {
  font-size: 1.1rem;
}

.phone .audio-panel .toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sonic S1: the audio audition studio (/audition). */
body.audition {
  margin: 0;
  background: var(--jw-stage-background);
  color: var(--jw-text-primary);
  font-family: var(--jw-font-interface);
}

.au {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.au h2,
.au-title {
  font-family: var(--jw-font-display);
}

.au-title {
  margin: 12px 0 8px;
  font-size: 2.2rem;
  line-height: 1.1;
}

.au-lede {
  color: var(--jw-text-secondary);
}

.au-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 24px 0;
}

.au-group {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--jw-surface-card-strong);
  border-radius: var(--jw-radius-pill);
}

.au-group button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--jw-text-secondary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.au-group button[aria-pressed="true"] {
  background: var(--jw-accent-action);
  color: var(--jw-text-on-accent);
}

.au-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--jw-surface-card-strong);
  border-radius: var(--jw-radius-md);
}

.au-stage {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.au-screen {
  position: relative;
  min-height: 120px;
  padding: 36px 18px 18px;
  border: 2px solid var(--jw-surface-card-strong);
  border-radius: var(--jw-radius-lg);
  background: var(--jw-surface-card);
}

.au-phone {
  border-radius: 32px;
}

.au-screen-label {
  position: absolute;
  top: 10px;
  left: 16px;
  color: var(--jw-text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.au-screen.au-on {
  animation: au-pulse var(--jw-duration-celebration) var(--jw-ease-standard);
}

@keyframes au-pulse {
  from {
    border-color: var(--jw-accent-action);
  }
  to {
    border-color: var(--jw-surface-card-strong);
  }
}

.au-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.au-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--jw-surface-card-strong);
  border-radius: var(--jw-radius-md);
  background: var(--jw-surface-card);
  color: var(--jw-text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.au-card span {
  color: var(--jw-text-secondary);
  font-size: 0.9rem;
}

.au-effect {
  cursor: default;
}

.au-lines ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.au-lines li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--jw-surface-card);
}

.au-line-play {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--jw-surface-card-strong);
  color: var(--jw-accent-action);
  cursor: pointer;
}

.au-status {
  color: var(--jw-text-secondary);
  font-size: 0.85rem;
}

.au-status--ok {
  color: var(--jw-state-correct);
  font-weight: 700;
}

.au summary {
  margin: 12px 0;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .au-stage {
    grid-template-columns: 1fr;
  }
}
