/* Family Game Night. Look from docs/design/*.dc.html: calm light background,
   white cards, navy text, Baloo 2, one fixed colour per player. Sizes follow
   the 1280x800 mockups and shrink on phones. */

@font-face {
  font-family: 'Baloo 2';
  src: url('fonts/baloo2-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #F3F6FB;
  --card: #FFFFFF;
  --ink: var(--w-ink);
  --muted: var(--w-ink-soft);
  --soft: #EEF1FA;
  --line: #DCE1EF;
  --dash: #B8C0DB;
  --yellow: var(--w-sun);
  --blue: #3BA9E0;
  --good: var(--w-good);
  --bad: var(--w-oops);        /* a miss: soft orange, never red */
  --shadow: 0 6px 20px rgba(31, 37, 71, 0.08);
  --gutter: clamp(16px, 4.5vw, 64px);
  /* Colour tokens. */
  --navy: var(--w-ink);     /* text on bright colours: player colours, the yellow button */
  --on-ink: #FFFFFF;        /* text on an --ink background */
  --tile: #FFFFFF;          /* small white tiles and frames */
  --danger: #B3261E;
  --danger-line: #F6C5C2;
  --border: #39406A;        /* the strong outline of a game card */
  --board: var(--w-ink);         /* the frame around the games board */
  --board-bg: #E6ECF8;
  --board-shadow: 0 18px 50px rgba(31, 37, 71, 0.22);
  --stage: #E8F0FF;         /* the recessed box that shows how a game plays */
  --stage-line: #B9C6E8;
  --silhouette: brightness(0);
  --glow: none;
  /* The districts: the kit's colours (assets/world.css). */
  --sec-guessing: var(--w-guessing);
  --sec-movement: var(--w-movement);
  --sec-learning: var(--w-learning);
  --sec-group: var(--w-group);
  font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
  color: var(--ink);
  background: var(--bg);
}


/* Easy-Read: a plain, open font with more space between letters and words.
   System fonts only, so nothing extra is downloaded. */
:root[data-easy-read] {
  font-family: 'Atkinson Hyperlegible', 'Lexend', Verdana, Tahoma, sans-serif;
  letter-spacing: 0.02em;
  word-spacing: 0.1em;
}
:root[data-easy-read] .blurb, :root[data-easy-read] .note, :root[data-easy-read] .sub { line-height: 1.5; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
/* A game, not a page to read: a long press or a quick double tap must not
   select a heading or zoom the screen (both seen on Android mid-game).
   Pinch zoom stays. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
button, a, [role="button"], .tile, .shop { touch-action: manipulation; }
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
/* By touch (app.js sets html[data-input]): no focus ring on what a finger presses;
   keys and the TV remote bring it back. Text fields keep theirs. */
html[data-input='touch'] :is(button, a, [role='button'], [role='tab'], .town-place):focus-visible { outline: none !important; }
/* Hover looks only where there is a real pointer: on a phone or tablet the
   last tap leaves :hover on whatever was under the finger, and the next
   screen's card there looked picked already (docs/ROADMAP.md, rule N3).
   Every :hover rule sits in @media (hover: hover). */
img { display: block; }

.screen {
  min-height: 100vh;
  padding: clamp(16px, 5vw, 56px) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vw, 28px);
  max-width: 1600px;
  margin: 0 auto;
}
.screen.play { padding: clamp(12px, 2.5vw, 32px) clamp(16px, 3vw, 40px); gap: clamp(12px, 1.6vw, 20px); }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head-text { display: flex; flex-direction: column; gap: 4px; }
h1 { margin: 0; font-size: clamp(32px, 4.4vw, 56px); font-weight: 800; line-height: 1.1; }
h2 { margin: 0; font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; }
.sub { margin: 0; font-size: clamp(18px, 1.8vw, 22px); color: var(--muted); }
.note { margin: 0; font-size: 18px; color: var(--muted); line-height: 1.5; }
.grow { flex-grow: 1; }

.card { background: var(--card); box-shadow: var(--shadow); border-radius: var(--w-radius); }

.avatar {
  --size: 84px;
  width: var(--size); height: var(--size); flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--size) * 0.45); font-weight: 800; color: var(--navy);
}
/* The animal friend on the player's colour. */
.avatar { position: relative; overflow: visible; }
.avatar > .avatar-pic { width: 92%; height: 92%; object-fit: contain; border-radius: 50%; pointer-events: none; }
.pill { background: var(--soft); border-radius: 999px; padding: 4px 16px; font-size: 18px; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 32px; border-radius: var(--w-radius-s); border: 0;
  font-size: clamp(20px, 1.9vw, 24px); font-weight: 800; text-decoration: none;
}
.btn.primary { background: var(--yellow); color: var(--navy); }
.btn.dark { background: var(--ink); color: var(--on-ink); }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink); font-weight: 600; }
.btn.small { min-height: 48px; padding: 0 20px; font-size: 19px; border-radius: var(--w-radius-s); }
.btn.danger { background: transparent; border: 2px solid var(--danger-line); color: var(--danger); font-weight: 600; }
.icon-btn {
  width: 52px; height: 52px; border-radius: var(--w-radius-s); border: 0; background: var(--card); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.segmented { display: flex; background: var(--soft); border-radius: var(--w-radius-s); padding: 4px; gap: 4px; }
.segmented button {
  flex: 1; min-height: 44px; padding: 0 22px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 19px; font-weight: 600;
}
.segmented button[aria-pressed='true'], .segmented button[aria-selected='true'] { background: var(--ink); color: var(--on-ink); font-weight: 800; }

.error { margin: 0; color: var(--danger); font-size: 18px; font-weight: 600; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--on-ink); padding: 12px 24px; border-radius: var(--w-radius-s); font-size: 20px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); z-index: 10; pointer-events: none;
}

.fullscreen {
  position: fixed; top: 8px; right: 8px; z-index: 15; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--dash); background: var(--card); color: var(--ink); opacity: 0.85; cursor: pointer;
}
.fullscreen:focus-visible { opacity: 1; }
@media (hover: hover) { .fullscreen:hover { opacity: 1; } }
.music-toggle {
  position: fixed; top: 8px; right: 60px; z-index: 15; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0; font-size: 20px; line-height: 1;
  border: 1px solid var(--dash); background: var(--card); color: var(--ink); opacity: 0.85; cursor: pointer;
}
.music-toggle:focus-visible { opacity: 1; }
/* In the corner rail and the bars they match .corner-btn (56px; smaller and
   bigger below). */
.corner > .fullscreen, .corner > .music-toggle, .play-tools > .fullscreen, .bar-tools > .fullscreen, .bar-tools > .music-toggle { width: 56px; height: 56px; }
@media (hover: hover) { .music-toggle:hover { opacity: 1; } }
.music-toggle.off { color: var(--dash); }
.music-toggle.alone { right: 8px; }

/* Clear of a phone's notch and home bar (viewport-fit=cover). */
.version { position: fixed; right: calc(10px + env(safe-area-inset-right)); bottom: calc(6px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--dash); pointer-events: none; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer.end { justify-content: flex-end; }

/* Family */
.family { display: flex; gap: 32px; flex-grow: 1; align-items: stretch; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; flex-grow: 1; align-content: start; }
.member {
  border: 3px solid transparent; padding: 20px; min-height: 220px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.member[aria-pressed='true'] { border-color: var(--ink); }
.member .name { font-size: 28px; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.member .meta { font-size: 18px; color: var(--muted); }
.add-member {
  background: transparent; border: 3px dashed var(--dash); border-radius: var(--w-radius); min-height: 220px; color: var(--muted);
  font-size: 24px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.add-member.full { text-align: center; padding: 16px; opacity: 0.8; font-size: clamp(16px, 2.2vh, 20px); }
.member-form { width: 380px; flex-shrink: 0; border-radius: var(--w-radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 18px; color: var(--muted); }
.field input, .field select {
  height: 56px; border-radius: var(--w-radius-s); border: 2px solid var(--line); background: var(--bg); font-size: 22px; padding: 0 16px; width: 100%;
}
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 64px; height: 64px; border-radius: 50%; border: 3px solid transparent; }
.swatch[aria-pressed='true'] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--card) inset; }
.form-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* Tonight */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 22px; flex-grow: 1; }
.person {
  position: relative; border: 4px solid transparent; border-radius: var(--w-radius); padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 300px;
}
.person.away { opacity: 0.55; box-shadow: none; }
.person-tap {
  background: none; border: 0; padding: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.person .name { font-size: 30px; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; text-align: center; }
.check {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.person .bottom { margin-top: auto; width: 100%; }
.person .segmented button { padding: 0 8px; min-width: 0; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 28px; flex-wrap: wrap; }
.bar-info { display: flex; gap: clamp(16px, 3vw, 36px); align-items: center; font-size: 22px; flex-wrap: wrap; }
.bar-info .muted { color: var(--muted); }
.mode-hint { font-size: 17px; color: var(--muted); }

/* Teams */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; flex-grow: 1; }
.team { border-radius: var(--w-radius); overflow: hidden; display: flex; flex-direction: column; }
.team-head { padding: 18px 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.team-head h2 { font-size: clamp(26px, 2.7vw, 34px); }
/* The name keeps a line of its own; the player count wraps below it on a narrow card. */
.team-head { flex-wrap: wrap; row-gap: 4px; }
.team-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 150px; }
.team-name h2 { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 600px) { .team-name h2 { font-size: 20px; } .team-rename { width: 40px; height: 40px; font-size: 18px; } }
.team-rename {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255, 255, 255, 0.85); color: var(--w-ink); font-size: 20px; line-height: 1; cursor: pointer;
}
.team-name-input {
  flex: 1 1 100px; min-width: 0; height: 48px; padding: 0 12px; border: 3px solid var(--w-ink); border-radius: var(--w-radius-s);
  background: #FFFFFF; color: var(--w-ink); font: inherit; font-size: clamp(20px, 2.4vw, 28px); font-weight: 800;
}
.team-head span { font-size: 20px; font-weight: 600; }
.team-body { padding: 20px 28px; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.team-row {
  display: flex; align-items: center; gap: 18px; width: 100%; padding: 4px 6px; margin: -4px -6px;
  border: 0; border-radius: var(--w-radius-s); background: transparent; color: inherit; font: inherit; text-align: left;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
@media (hover: hover) { .team-row:hover { background: var(--soft); } }
.team-row.dragging { opacity: 0.3; }
/* The copy that follows the finger while a player is dragged. */
.team-ghost {
  position: fixed; z-index: 30; margin: 0; width: max-content; max-width: 90vw; padding-right: 18px; pointer-events: none; cursor: grabbing;
  background: var(--card); box-shadow: var(--shadow); transform: rotate(-2deg) scale(1.04);
}
.card.team.drop-target { outline: 4px dashed var(--ink); outline-offset: 4px; }
.drag-hint { font-weight: 700; }
.team-row .name { font-size: 28px; font-weight: 800; flex-grow: 1; }
.strength { padding: 0 28px 22px; display: flex; flex-direction: column; gap: 6px; font-size: 17px; color: var(--muted); }
.meter { height: 14px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.meter > div { height: 100%; border-radius: 999px; }

/* Games list */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.game-card { border: 0; text-align: left; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.game-art { aspect-ratio: 16 / 9; background: var(--soft); display: flex; align-items: center; justify-content: center; padding: 3%; }
.game-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 6px; }
.game-body .title { font-size: 28px; font-weight: 800; line-height: 1.1; }
.game-body .blurb { font-size: 18px; color: var(--muted); }
.section-tag { align-self: flex-start; }

/* Every game's pieces on the night stage */
.night-turn { font-size: clamp(24px, 2.6vw, 32px); }
.night .prompt { color: var(--ink); font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; }
.night .tile, .night .feature, .night .memory { border: var(--piece-line); box-shadow: var(--piece-shadow); border-radius: var(--w-radius-s); }
.night .tile:disabled { box-shadow: 0 2px 0 var(--border); }
.night .tile:focus-visible { outline-color: var(--n-gold); }
@media (hover: hover) { .night .tile:not(:disabled):hover { outline-color: var(--n-gold); } }
.night .tile.correct { outline-color: var(--n-yes); }
.night .tile.wrong { outline-color: var(--n-no); }
.night .feedback { color: var(--navy); border: var(--piece-line); box-shadow: var(--piece-shadow); }
.night .feedback.good { background: var(--n-yes); }
.night .feedback.bad { background: var(--n-no); }
.night .explain, .night .clues { background: var(--card); color: var(--ink); border: var(--piece-line); box-shadow: var(--piece-shadow); }
.night .explain { border-left-width: 10px; border-left-color: var(--n-gold); }
.night .clue .n { background: var(--n-gold); color: var(--n-night); }
.night .clue.waiting { color: var(--n-dim); }
.night .clue.waiting .n { background: var(--card); box-shadow: inset 0 0 0 2px var(--n-line); color: var(--n-dim); }
.night .study-count, .night .mem-note { color: var(--ink); }
.night .info { color: var(--n-dim); }
.night .pill { background: color-mix(in srgb, var(--n-gold) 35%, var(--card)); color: var(--ink); border: 2px solid var(--border); }
.night .mem-card {
  border: var(--piece-line); box-shadow: 0 4px 0 var(--border);
  background: repeating-linear-gradient(45deg, var(--board-sec) 0 12px, color-mix(in srgb, var(--board-sec) 82%, #000000) 12px 24px);
}
/* The number sits on a white disc, so it reads on any card colour. */
.night .mem-back {
  display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; font-size: clamp(22px, min(3vw, 4.4vh), 44px);
  background: var(--card); color: var(--ink); border: 3px solid var(--border); text-shadow: none;
}
/* The white frame printed on the back of a playing card. */
.night .mem-card:not(.up) { position: relative; }
.night .mem-card:not(.up)::before {
  content: ''; position: absolute; inset: 6px; border-radius: 12px; pointer-events: none;
  border: 2px solid color-mix(in srgb, #FFFFFF 70%, transparent);
}
.night .mem-card.up { background: #FFFFFF; box-shadow: 0 2px 0 var(--border); }
.night .mem-card.matched { box-shadow: 0 0 0 5px var(--owner); border-color: var(--owner); }
.night-ready { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 24px; }
.night-ready .avatar { --size: 140px; box-shadow: 0 0 0 4px var(--border), 0 0 0 12px var(--card), 0 0 0 15px var(--border), 0 10px 0 15px var(--board-sec); }
.night-ready .night-go { align-self: center; }

/* Zoom: a camera viewfinder beside the choices (stacked on a narrow screen) */
.zoom-stage { flex: 1 1 0; min-height: 0; display: grid; gap: clamp(10px, 1.6vw, 22px); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.zoom-side { min-height: 0; display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 14px); }
.night .zoom-stage .feature.zoom-frame { flex: none; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: clamp(8px, 1.4vh, 14px); }
.zoom-window {
  position: relative; flex: 1 1 0; min-height: 0; max-width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--w-radius);
  background: #FFFFFF; border: 4px solid var(--border); box-shadow: 0 0 0 6px var(--board-sec, var(--sec-guessing)), 0 0 0 9px var(--border);
}
.night .zoom-stage .feature.zoom-frame { gap: 18px; padding: 16px; }
/* The frame's edge sits over the zoomed picture. */
.zoom-window::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 3px rgba(23, 26, 69, 0.85) inset; pointer-events: none; }
.zoom-window img, .night .zoom-window img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.zoom-shot { animation: zoom-jump 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.15) var(--delay, 0s) both; }
.revealed .zoom-shot { animation: zoom-jump 0.9s cubic-bezier(0.3, 1.4, 0.5, 1) var(--delay, 0s) both; }
@keyframes zoom-jump { from { transform: scale(var(--prev)); filter: blur(3px); } 60% { filter: blur(0); } to { transform: scale(var(--to)); } }
.zoom-corner { position: absolute; width: 14%; height: 14%; border: 0 solid var(--n-gold, #FFC94A); pointer-events: none; }
.zoom-corner.tl { top: 5%; left: 5%; border-top-width: 5px; border-left-width: 5px; border-top-left-radius: 10px; }
.zoom-corner.tr { top: 5%; right: 5%; border-top-width: 5px; border-right-width: 5px; border-top-right-radius: 10px; }
.zoom-corner.bl { bottom: 5%; left: 5%; border-bottom-width: 5px; border-left-width: 5px; border-bottom-left-radius: 10px; }
.zoom-corner.br { bottom: 5%; right: 5%; border-bottom-width: 5px; border-right-width: 5px; border-bottom-right-radius: 10px; }
.zoom-rec {
  position: absolute; top: 7%; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; background: rgba(23, 26, 69, 0.75); color: #FFFFFF; font-size: clamp(16px, 1.4vw, 16px); font-weight: 800; letter-spacing: 0.12em;
}
.zoom-rec::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #FF4D4D; animation: zoom-blink 1s steps(2) infinite; }
@keyframes zoom-blink { 50% { opacity: 0; } }
.zoom-points {
  position: absolute; right: 6%; bottom: 7%; display: flex; flex-direction: column; align-items: center; line-height: 1;
  padding: 8px 14px; border-radius: var(--w-radius-s); background: var(--n-gold, #FFC94A); color: #171A45; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  animation: zoom-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.zoom-points b { font-size: clamp(30px, 4.4vw, 56px); font-weight: 900; }
.zoom-points span { font-size: clamp(16px, 1.2vw, 15px); font-weight: 800; text-transform: uppercase; }
@keyframes zoom-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.zoom-caption {
  position: absolute; left: 0; right: 0; bottom: 7%; width: fit-content; max-width: 90%; margin: 0 auto; padding: 8px 22px; border-radius: 999px; text-align: center;
  background: #171A45; color: var(--n-gold, #FFC94A); font-size: clamp(24px, 3.4vw, 44px); font-weight: 900;
  animation: zoom-pop 0.6s 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.zoom-dots { display: flex; gap: 10px; justify-content: center; }
.zoom-dot { width: clamp(12px, 1.4vw, 18px); height: clamp(12px, 1.4vw, 18px); border-radius: 50%; background: rgba(23, 26, 69, 0.2); transition: background 0.3s, transform 0.3s; }
.zoom-dot.done { background: rgba(23, 26, 69, 0.55); }
.zoom-dot.now { background: var(--n-gold, #FFC94A); transform: scale(1.35); box-shadow: 0 0 0 3px #171A45; }
.night .zoom-choices { flex: 1 1 0; grid-template-columns: repeat(var(--side), minmax(0, 1fr)); }
.zoom-choices .tile.tried { opacity: 0.45; position: relative; }
.zoom-choices .tile.tried::after {
  content: ''; position: absolute; inset: 18%; pointer-events: none;
  background: linear-gradient(45deg, transparent 46%, var(--n-no, #FF6B6B) 46% 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, var(--n-no, #FF6B6B) 46% 54%, transparent 54%);
}
/* When a round ends: a slim bar floating over the bottom of the game, so the
   board keeps its full size beneath it. */
.round-pop {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 12px 16px;
  pointer-events: none;
}
.round-popup {
  pointer-events: auto; width: min(820px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: center; gap: 12px; padding: 12px; border-radius: var(--w-radius); box-shadow: 0 12px 40px rgba(23, 26, 69, 0.35);
  animation: round-rise 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.round-popup > :not(.actions) { flex: 1 1 260px; min-width: 0; }
@keyframes round-rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
/* While a round is played: the host's buttons, in the header beside the title. */
.play-host { order: 1; margin-left: auto; min-width: 0; display: flex; justify-content: flex-end; }
.play-head:has(.play-host) > .play-tools { order: 9; margin-left: 0; }
.play-host .host-bar { padding: 6px; gap: 8px; flex-wrap: nowrap; border-radius: var(--w-radius-s); box-shadow: none; border: 2px solid var(--line); }
.play-host .host-bar .info { flex-grow: 0; white-space: normal; padding: 0 8px; }
.play-host .host-bar .btn { min-height: 48px; font-size: 18px; padding: 0 18px; }
@media (max-width: 900px) and (orientation: portrait) {
  .screen.play > .play-head:has(.play-host) { flex-wrap: wrap; row-gap: 10px; }
  .play-head:has(.play-host) > .play-title { flex: 1 1 0; }
  .play-host { order: 3; flex-basis: 100%; }
}
.round-popup .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; }
.round-popup .info { font-size: 18px; color: var(--muted); }
/* A phone on its side has little height: a tighter bar. */
@media (orientation: landscape) and (max-height: 600px) {
  .round-pop { padding: 6px 10px; }
  .round-popup { padding: 8px; gap: 8px; }
}
.zoom-steal-pop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(23, 26, 69, 0.72);
}
.zoom-steal {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; width: min(720px, 100%); max-height: 100%; overflow: auto;
  padding: clamp(18px, 3vh, 32px) clamp(16px, 3vw, 36px); border-radius: var(--w-radius); color: #FFFFFF;
  background: var(--n-night, #171A45); box-shadow: 0 0 0 4px var(--n-gold, #FFC94A) inset, 0 0 60px rgba(255, 201, 74, 0.35);
  animation: zoom-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.zoom-steal-title { font-size: clamp(40px, 6vw, 80px); font-weight: 900; color: var(--n-gold, #FFC94A); letter-spacing: 0.04em; }
.zoom-steal-note { font-size: clamp(18px, 2.2vw, 28px); font-weight: 700; }
.zoom-stealers { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.zoom-stealer {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; border: 0; border-radius: var(--w-radius-s);
  background: transparent; color: inherit; font: inherit; font-size: clamp(16px, 1.8vw, 22px); font-weight: 800; cursor: pointer; outline: 3px solid transparent;
}
@media (hover: hover) { .zoom-stealer:hover { background: rgba(255, 255, 255, 0.1); } }
.zoom-stealer:focus-visible { outline-color: var(--n-gold, #FFC94A); }
.zoom-steal-strip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border: 0; border-radius: var(--w-radius-s); cursor: pointer;
  background: rgba(255, 201, 74, 0.14); box-shadow: 0 0 0 3px var(--n-gold, #FFC94A) inset; color: inherit; font: inherit;
}
.zoom-steal-strip b { font-size: clamp(18px, 2.2vw, 28px); font-weight: 900; color: var(--n-gold, #FFC94A); }
.zoom-steal-strip span { font-size: clamp(16px, 1.4vw, 17px); font-weight: 700; opacity: 0.8; }
.zoom-steal-strip:focus-visible { outline: 3px solid #FFFFFF; }
@media (max-width: 760px), (orientation: portrait) {
  /* The close-up is the game: it gets most of the height, the choices the rest. */
  .zoom-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.8fr) minmax(0, 1fr); gap: 8px; }
  .night .zoom-stage .feature.zoom-frame { gap: 6px; padding: 6px; }
  .night .zoom-choices { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
}

/* Who Am I? */
.clues { list-style: none; margin: 0; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.clue { display: flex; align-items: center; gap: 14px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; }
.clue .n {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 50%; background: var(--yellow); font-size: 20px;
}
.clue.waiting { color: var(--muted); }
.clue.waiting .n { background: var(--soft); }

/* Memory Pairs */
.mem-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mem-note { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; }
.mem-grid { display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.mem-card {
  aspect-ratio: 1; border: 0; border-radius: var(--w-radius-s); padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #3B4AA8 0 10px, #3444A0 10px 20px); box-shadow: 0 4px 0 #26307A;
  transition: transform 0.15s;
}
.mem-card:disabled { opacity: 1; }
@media (hover: hover) { .mem-card:not(:disabled):hover { transform: translateY(-3px); } }
.mem-back { color: var(--yellow); font-size: clamp(30px, 4vw, 56px); font-weight: 900; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.mem-card.up { background: #FFFFFF; box-shadow: 0 0 0 3px var(--soft); cursor: default; }
.mem-card.matched { box-shadow: 0 0 0 5px var(--owner); }
.mem-card img { width: 90%; height: 90%; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .zoom-shot, .zoom-points, .zoom-caption, .zoom-steal, .round-popup { animation: none; } .mem-card { transition: none; } }

/* The board every game plays on (docs/design/GameBoard-plan.md): the game's
   box opened on the table. The rim is the colour of the game's shelf
   ([data-section] sets --sec), the surface a light print of it, and the
   pieces on it are cardboard: an ink outline and a hard printed shadow that
   goes when a piece is pressed. Twenty Questions adds its own pieces.
   The --n-* names are older than the board; every game's stage uses them. */
.night {
  --board-sec: var(--sec, var(--sec-guessing));
  --felt: color-mix(in srgb, var(--board-sec) 13%, var(--card));
  --n-night: var(--navy); --n-gold: var(--yellow); --n-yes: var(--good); --n-no: var(--bad);
  --n-line: color-mix(in srgb, var(--border) 26%, transparent);
  --n-dim: color-mix(in srgb, var(--muted) 78%, var(--ink)); /* muted, a touch darker: it sits on the tinted felt */
  --n-glass: color-mix(in srgb, var(--card) 70%, transparent);
  --n-mark: color-mix(in srgb, var(--board-sec) 55%, var(--ink)); /* the game's colour as text, 4.5:1 on the felt */
  --piece-line: 3px solid var(--border); --piece-shadow: 0 5px 0 var(--border);
  position: relative; display: flex; flex-direction: column; gap: 20px; padding: clamp(18px, 2.4vw, 30px);
  border: 10px solid var(--board-sec); border-radius: var(--w-radius); color: var(--ink); overflow: hidden;
  background: var(--felt);
  flex-grow: 1; min-width: 0;
  box-shadow: 0 8px 0 var(--border);
}
/* A piece is pressed: it sinks onto the board. */
.night-go:not(:disabled):active, .night .tile:not(:disabled):active, .tq-card:active, .tq-person:active,
.tq-chip:active, .tq-use:active, .tq-vault:active, .tq-back-btn:active {
  transform: translateY(4px); box-shadow: 0 1px 0 var(--border);
}
.night button { font-family: inherit; color: inherit; cursor: pointer; }
.night-kicker { display: block; font-size: 17px; font-weight: 700; color: var(--n-mark); }
.night-big { display: block; font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; line-height: 1.1; }
.tq-board-title { font-size: 18px; font-weight: 700; color: var(--n-dim); }

.night-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.night-player { display: flex; align-items: center; gap: 14px; }
.night-player .avatar { box-shadow: 0 0 0 3px var(--border); }
.night-name { display: block; font-size: 30px; font-weight: 800; line-height: 1; }
.tq-progress { display: flex; align-items: center; gap: 14px; }
.tq-dots {
  --peg: clamp(12px, 1.7vw, 22px);
  display: grid; grid-template-columns: repeat(20, var(--peg)); gap: calc(var(--peg) / 4); padding: 7px 10px;
  border-radius: 999px; background: var(--board-sec); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}
.tq-dot {
  width: var(--peg); height: var(--peg); border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.25);
  font-size: calc(var(--peg) * 0.55); font-weight: 800; line-height: 1; color: color-mix(in srgb, var(--navy) 80%, #000000);
}
.tq-dot.yes { background: var(--n-yes); box-shadow: 0 2px 0 var(--border); }
.tq-dot.no { background: var(--n-no); box-shadow: 0 2px 0 var(--border); }
.tq-dot.now { background: var(--n-gold); box-shadow: 0 0 0 3px var(--card); }
/* How far the game has got: a tag in the game's colour. */
.night-meta {
  padding: 2px 16px; border-radius: 999px; background: var(--board-sec); color: var(--plank-ink, #FFFFFF);
  font-size: 20px; font-weight: 800; white-space: nowrap;
}
.tq-progress .night-meta { padding: 0; background: none; color: var(--ink); }

.tq-callout { display: flex; flex-direction: column; gap: 10px; }
.tq-eyes {
  align-self: flex-start; padding: 8px 18px; border-radius: 999px; background: color-mix(in srgb, var(--n-gold) 35%, var(--card));
  color: var(--ink); font-size: 22px; font-weight: 700;
}
.tq-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.tq-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px 16px;
  border: var(--piece-line); border-radius: var(--w-radius); background: #FFFFFF; color: var(--navy) !important;
  box-shadow: var(--piece-shadow); font-size: clamp(20px, 2vw, 26px); font-weight: 700; transition: transform 0.15s;
}
.tq-card:nth-child(1) { transform: rotate(-3deg); }
.tq-card:nth-child(3) { transform: rotate(3deg); }
.tq-card:focus-visible { transform: translateY(-6px) rotate(0); outline: 4px solid var(--n-gold); outline-offset: 3px; }
@media (hover: hover) { .tq-card:hover { transform: translateY(-6px) rotate(0); outline: 4px solid var(--n-gold); outline-offset: 3px; } }
.tq-card img { width: min(80%, 190px); aspect-ratio: 1; object-fit: contain; }
.tq-card.back {
  justify-content: center;
  background: repeating-linear-gradient(45deg, var(--board-sec) 0 14px, color-mix(in srgb, var(--board-sec) 82%, #000000) 14px 28px);
}
.tq-card-mark { font-size: clamp(48px, 8vw, 96px); font-weight: 800; color: var(--n-gold); line-height: 1; text-shadow: 0 4px 0 var(--border); }
.tq-card.flipped { animation: tq-flip 0.5s ease-out; }
/* A picture new to the game: a gold glow and a star badge on top. */
.tq-card { position: relative; }
/* (Scoped like the table's cards, .night[data-table] .tq-card, which clear the shadow, so the glow shows.) */
.tq-card.new, .night[data-table] .tq-card.new { outline: 4px solid var(--w-sun); outline-offset: 3px; box-shadow: 0 0 28px 8px color-mix(in srgb, var(--w-sun) 75%, transparent); }
.tq-new { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap; pointer-events: none; }
.tq-new .w-badge { font-size: var(--w-text-s); }

/* The Detective challenge: its switch above the boxes, the stage badge and the golden last card. */
.tq-packs-top { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(8px, 1.4vw, 18px); }
.tq-packs-top .tq-detective { flex: 1 1 340px; }
.tq-detective {
  display: flex; align-items: center; gap: clamp(10px, 1.4vw, 18px); min-height: var(--w-tap); padding: 8px clamp(12px, 1.6vw, 22px);
  border: var(--w-line) solid var(--w-board-edge); border-radius: var(--w-radius-s); background: var(--w-board); color: var(--w-ink);
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge); font: inherit; text-align: start;
}
.tq-detective:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--w-board-edge); }
.tq-detective:focus-visible { outline: 4px solid var(--w-sun); outline-offset: 3px; }
.tq-detective.on { border-color: var(--w-sun); background: color-mix(in srgb, var(--w-sun) 22%, var(--w-board)); box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge); }
.tq-detective-icon { font-size: clamp(30px, 3vw, 44px); line-height: 1; }
.tq-detective-words { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.tq-detective-words b { font-size: var(--w-text); }
.tq-detective-words small { font-size: var(--w-text-s); color: var(--w-ink-soft); font-weight: 700; }
.tq-detective-switch { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--w-board-edge); }
.tq-detective.on .tq-detective-switch { background: var(--w-sun); }
.tq-detective-switch .w-icon { width: 60%; height: 60%; }
.tq-stage .w-badge { font-size: var(--w-text-s); }
.tq-stage.gold .w-badge { --w-fill: var(--w-sun); animation: scene-glow 2s ease-in-out infinite; }
/* (Scoped like the table's cards, .night[data-table] .tq-card, so it wins.) */
.night[data-table] .tq-card.gold { border: 6px solid var(--w-sun-edge); background: color-mix(in srgb, var(--w-sun) 30%, var(--w-board));
  box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge), 0 0 34px 10px color-mix(in srgb, var(--w-sun) 70%, transparent); }
@media (max-height: 520px) {
  .tq-detective { padding-block: 2px; }
  .tq-detective-words small { display: none; }
  .tq-detective-icon { font-size: 28px; }
  .tq-packs { gap: 8px; }
  .tq-packs-top .night-big { font-size: clamp(20px, 6vh, 26px); }
  .tq-pack { gap: 4px; padding: 6px 6px 8px; }
  .tq-pack-grid { grid-auto-columns: clamp(104px, 27vh, 132px); }
}
@media (prefers-reduced-motion: reduce) { .tq-stage.gold .w-badge { animation: none; } }

/* The boxes of pictures before the first round (twentyQuestions.js packChooser). */
.tq-packs { display: flex; flex-direction: column; gap: clamp(10px, 1.6vw, 20px); width: 100%; box-sizing: border-box;
  /* The host stands at the board's bottom left (.ready-host): the boxes keep beside him. */
  padding-left: clamp(84px, 24vh, 260px); }
/* A phone held sideways: one row of boxes that scrolls sideways. */
@media (max-height: 520px) {
  .tq-packs { padding-left: clamp(64px, 20vh, 110px); }
  .tq-pack-grid { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: clamp(112px, 30vh, 150px); overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
  .tq-pack { scroll-snap-align: start; }
}
.tq-pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(112px, 8.6vw, 170px), 1fr)); gap: clamp(10px, 1.2vw, 18px); }
.tq-pack {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: var(--w-tap); padding: 10px 8px 12px;
  border: var(--w-line) solid var(--w-board-edge); border-radius: var(--w-radius-s); background: var(--w-board); color: var(--w-ink);
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge); font: inherit; font-weight: 800; transition: transform 0.15s;
}
button.tq-pack:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--w-board-edge); }
button.tq-pack:focus-visible { outline: 4px solid var(--w-sun); outline-offset: 3px; }
@media (hover: hover) { button.tq-pack:hover { transform: translateY(-4px); } }
.tq-pack.last { border-color: var(--w-sun); box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge); }
.tq-pack-pic { position: relative; width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: #FFFFFF; }

.tq-pack .tq-pack-pic.tq-pack-fan { display: flex; align-items: center; justify-content: center; padding: 0 4%; box-sizing: border-box; }
.tq-pack-fan img.fan { position: static; inset: auto; flex: 1 1 0; min-width: 0; width: 33%; height: auto; aspect-ratio: 1; object-fit: contain; }
.tq-pack-fan img.fan:nth-child(1) { transform: rotate(-8deg); }
.tq-pack-fan img.fan:nth-child(3) { transform: rotate(8deg); }
.tq-pack-tag { position: absolute; top: 4px; right: 6px; font-size: clamp(20px, 2vw, 30px); line-height: 1; }
.tq-pack-name { font-size: var(--w-text-s); line-height: 1.1; text-align: center; }
.tq-pack .w-badge { font-size: var(--w-text-s); }
.tq-pack.locked { opacity: 0.85; }
.tq-pack.locked .tq-pack-pic { background: var(--w-board-edge); }
.tq-pack-emoji { font-size: clamp(40px, 5vw, 72px); filter: grayscale(1) brightness(0.4); }
.tq-pack.locked .scene-lock { color: var(--w-ink); }
.tq-pack.locked .scene-lock .w-icon { width: 30%; height: 30%; }
.tq-pack.locked .w-badge { --w-fill: var(--w-board-edge); }
.tq-center { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.tq-vault {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 170px; aspect-ratio: 3 / 4; border: var(--piece-line); border-radius: var(--w-radius-s); box-shadow: var(--piece-shadow);
  background: repeating-linear-gradient(135deg, var(--card) 0 14px, color-mix(in srgb, var(--board-sec) 14%, var(--card)) 14px 28px);
}
.tq-vault.big { width: 220px; }
.tq-vault.open { background: #FFFFFF; color: var(--navy) !important; }
.tq-vault img { width: 78%; aspect-ratio: 1; object-fit: contain; }
/* The wax seal on the secret card. */
.tq-lock {
  display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; font-size: 48px; line-height: 1;
  background: var(--n-no); border: var(--piece-line); box-shadow: inset 0 0 0 0.12em rgba(255, 255, 255, 0.25); transform: rotate(-8deg);
}
.tq-vault.big .tq-lock { font-size: 64px; }
.tq-vault-label { font-size: 16px; font-weight: 700; color: var(--n-dim); text-align: center; padding: 0 8px; line-height: 1.2; }
.tq-vault.open .tq-vault-label { color: var(--navy); }
.tq-rules { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; }
.tq-rules p { margin: 0; padding: 12px 16px; border-radius: var(--w-radius-s); background: var(--n-glass); border: 2px solid var(--n-line); font-size: 20px; }
.night-go {
  align-self: flex-start; padding: 16px 30px; border: var(--piece-line, 3px solid var(--border)); border-radius: var(--w-radius-s); background: var(--n-gold, var(--yellow));
  color: var(--navy) !important; font-size: 24px !important; font-weight: 800;
  box-shadow: var(--piece-shadow, 0 5px 0 var(--border));
}

.tq-ask { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; }
.tq-side { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tq-side .tq-vault { width: 150px; }
.tq-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tq-ask, .tq-side, .tq-answer > * { min-width: 0; }
.tq-question { padding: 16px 20px; border-radius: var(--w-radius-s); background: var(--card); border: var(--piece-line); box-shadow: var(--piece-shadow); }
.tq-q { display: block; font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; }
.tq-ideas { display: flex; flex-direction: column; gap: 8px; }
.tq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tq-chip {
  padding: 8px 14px; border-radius: 999px; border: 2px solid var(--border); background: var(--card);
  box-shadow: 0 3px 0 var(--border); font-size: 17px !important; font-weight: 600;
}
.tq-chip.on { background: var(--n-gold); color: var(--navy) !important; }
.tq-chip.done { opacity: 0.5; text-decoration: line-through; box-shadow: none; }
.tq-answer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tq-yes, .tq-no {
  display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 104px; border: var(--piece-line);
  border-radius: var(--w-radius); box-shadow: var(--piece-shadow); color: var(--navy) !important; font-size: 36px !important; font-weight: 800;
}
.tq-yes { background: var(--n-yes); }
.tq-no { background: var(--n-no); }
.tq-yes:active, .tq-no:active { transform: translateY(5px); box-shadow: none; }
.tq-mark {
  display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35); font-size: 30px;
}

.tq-hints {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px;
  border-radius: var(--w-radius-s); border: 2px dashed var(--border); background: var(--n-glass); text-align: center;
}
.tq-hints-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.tq-slots { display: flex; gap: 5px; }
.tq-slot {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--card); box-shadow: inset 0 0 0 2px var(--n-line); font-size: 16px; font-weight: 800; color: var(--n-dim);
}
/* (padding and grow undo the old .ready screen rule) */
.tq-slot.ready { padding: 0; flex-grow: 0; background: var(--n-gold); color: var(--navy); box-shadow: 0 0 0 2px var(--border); }
.tq-slot.used { background: var(--n-gold); color: var(--navy); }
.tq-hint-wait { margin: 0; font-size: 17px; color: var(--n-dim); }
.tq-use { padding: 10px 18px; border: 2px solid var(--border); border-radius: var(--w-radius-s); background: var(--n-gold); color: var(--navy) !important; box-shadow: 0 3px 0 var(--border); font-size: 18px !important; font-weight: 800; }

.tq-board { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 3px dotted var(--n-line); }
.tq-clues { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 2px 6px; }
.tq-clue {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; font-size: 17px; font-weight: 700;
  background: var(--card); border: 2px solid var(--border); box-shadow: 0 3px 0 var(--border);
}
.tq-clue.yes b { color: color-mix(in srgb, var(--n-yes) 65%, var(--ink)); }
.tq-clue.no b { color: color-mix(in srgb, var(--n-no) 70%, var(--ink)); }
.tq-clue:nth-child(odd) { transform: rotate(-1.5deg); }
.tq-clue:nth-child(even) { transform: rotate(1.2deg); }

.tq-people { display: flex; flex-wrap: wrap; gap: 18px; }
.tq-person {
  display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 150px; padding: 20px;
  border: var(--piece-line); border-radius: var(--w-radius); background: var(--card); box-shadow: var(--piece-shadow); font-size: 24px !important; font-weight: 800;
}
.tq-person:focus-visible { background: color-mix(in srgb, var(--n-gold) 30%, var(--card)); }
@media (hover: hover) { .tq-person:hover { background: color-mix(in srgb, var(--n-gold) 30%, var(--card)); } }
.tq-back-btn { align-self: flex-start; padding: 10px 18px; border: 2px solid var(--border); border-radius: var(--w-radius-s); background: var(--card); box-shadow: 0 3px 0 var(--border); font-size: 18px !important; font-weight: 700; }

.tq-reveal { display: flex; align-items: center; gap: clamp(20px, 4vw, 48px); flex-wrap: wrap; }
.tq-flip {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; width: 240px;
  border-radius: var(--w-radius); background: #FFFFFF; color: var(--navy); font-size: 26px; font-weight: 800;
  border: var(--piece-line); box-shadow: 0 0 0 6px var(--n-gold), 0 12px 0 6px var(--border);
  animation: tq-flip 0.6s ease-out;
}
.tq-flip img { width: 100%; aspect-ratio: 1; object-fit: contain; }
@keyframes tq-flip { from { transform: perspective(800px) rotateY(90deg); } to { transform: perspective(800px) rotateY(0); } }
.tq-result { flex: 1 1 300px; display: flex; flex-direction: column; gap: 10px; }
.tq-stats { font-size: 20px; color: var(--n-dim); }
.tq-points {
  align-self: flex-start; padding: 6px 18px; border-radius: 999px; background: var(--n-yes); color: var(--navy);
  border: 2px solid var(--border); font-size: 24px; font-weight: 800;
}

@media (max-width: 760px) {
  .tq-ask { grid-template-columns: 1fr; }
  .tq-side { flex-direction: row; align-items: stretch; }
  .tq-side .tq-vault { width: 120px; flex-shrink: 0; }
  .tq-side .tq-hints { flex: 1 1 0; min-width: 0; width: auto; }
  .tq { padding: 16px; }
  .tq-answer { gap: 10px; }
  .tq-cards { grid-template-columns: 1fr 1fr 1fr; }
  .tq-yes, .tq-no { min-height: 84px; font-size: 28px !important; }
  .tq-dots { --peg: 15px; grid-template-columns: repeat(10, var(--peg)); gap: 4px; border-radius: var(--w-radius-s); }
}
@media (prefers-reduced-motion: reduce) { .tq-flip, .tq-card.flipped { animation: none; } .tq-card { transition: none; } }

/* Play */
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.play-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.play-title .names { display: flex; flex-direction: column; min-width: 0; }
.play-title .game { font-size: clamp(24px, 2.5vw, 32px); font-weight: 800; line-height: 1.1; }
.play-title .round { font-size: 18px; color: var(--muted); }
/* The table around the board: the quit button is a piece too, the host's bar a plain card. */
.play-head .icon-btn { border: 3px solid var(--border); box-shadow: 0 4px 0 var(--border); }
.play-head .icon-btn:active { transform: translateY(4px); box-shadow: none; }
.ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; border: 0; background: none; padding: 0; }
.ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: var(--navy); } /* the face is white */
.play-main { display: flex; gap: 24px; flex-grow: 1; min-height: 0; }
.stage { display: flex; flex-direction: column; gap: 16px; flex-grow: 1; min-width: 0; }
.turn { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border: 3px solid transparent; }
.turn .who { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; flex-grow: 1; line-height: 1.15; }
.prompt { margin: 0; font-size: clamp(19px, 1.8vw, 22px); color: var(--muted); }
.choices { display: grid; gap: 16px; flex-grow: 1; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.tile {
  background: var(--card); box-shadow: var(--shadow); border-radius: var(--w-radius); border: 0; padding: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px;
  outline: 5px solid transparent; outline-offset: -5px; transition: transform 0.12s ease;
}
.tile:not(:disabled):active { transform: scale(0.97); }
.tile:disabled { opacity: 1; cursor: default; }
.tile img { width: min(80%, 200px); aspect-ratio: 1; object-fit: contain; }
.tile .label { font-size: clamp(20px, 2vw, 26px); font-weight: 600; }
.tile .number { font-size: clamp(48px, 7vw, 88px); font-weight: 800; line-height: 1; }
.tile.correct { outline-color: var(--good); }
.tile.wrong { outline-color: var(--bad); }
.tile.dim { opacity: 0.4; }
.feature {
  display: flex; align-items: center; justify-content: center; padding: 16px; min-height: 0;
}
.feature img { width: min(100%, 300px); max-height: 34vh; aspect-ratio: 1; object-fit: contain; }
.silhouette { filter: brightness(0); }
.memory { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); padding: 16px; flex-grow: 1; align-content: center; }
.memory img { width: 100%; max-width: 160px; aspect-ratio: 1; object-fit: contain; margin: 0 auto; }
.memory.small { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); flex-grow: 0; }
.memory.small img { max-width: 90px; }
.study-count { font-size: clamp(26px, 3vw, 36px); font-weight: 800; text-align: center; }
.study-bar { display: flex; align-items: center; justify-content: center; gap: 8px 18px; flex-wrap: wrap; }
.ready { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 32px; }
.ready .avatar { --size: 140px; }
.ready .who { font-size: clamp(32px, 4vw, 48px); font-weight: 800; }
.feedback {
  display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: var(--w-radius-s); padding: 12px;
  font-size: clamp(20px, 2.2vw, 28px); font-weight: 800; color: #FFFFFF; text-align: center;
}
.feedback.good { background: var(--good); }
.feedback.bad { background: var(--ink); }
.explain { padding: 14px 20px; display: flex; flex-direction: column; gap: 4px; border-left: 6px solid var(--yellow); }
.explain p { margin: 0; font-size: clamp(18px, 1.8vw, 22px); line-height: 1.4; }
.explain p:last-child { font-weight: 700; }
.score-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--w-radius-s); }
.score-row.now { background: var(--soft); }
.score-row .name { font-size: 22px; font-weight: 600; flex-grow: 1; min-width: 0; overflow-wrap: anywhere; }
.score-row .pts { font-size: 28px; font-weight: 800; }
.host-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.host-bar .info { font-size: 19px; color: var(--muted); flex-grow: 1; }
.host-bar .btn { min-height: 56px; font-size: 21px; padding: 0 26px; border-radius: var(--w-radius-s); }
.plus { background: var(--good); color: var(--navy); }

/* Results */
.results { flex-grow: 1; display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.trophy { font-size: clamp(64px, 9vw, 110px); line-height: 1; }
.winners { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.winners .avatar { --size: 110px; box-shadow: 0 0 0 6px var(--card), 0 0 0 10px var(--yellow); }
.standings { width: min(560px, 100%); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.standings .score-row .name { text-align: left; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
/* The scores, podium and buttons sit above the falling confetti so every number stays readable. */
.results h1, .results .sub, .results .standings, .results .podium, .results .footer { position: relative; z-index: 1; }
/* The two sides of the results: one column, unless a phone is held sideways. */
.results-side { display: contents; }
@media (orientation: landscape) and (max-height: 600px) {
  .results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; column-gap: clamp(12px, 3vw, 32px); }
  .results-side { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.6vh, 16px); min-width: 0; }
  .results-side .trophy { font-size: clamp(32px, 9vh, 64px); }
  /* The table beside it gives the points: the podium may be smaller. */
  .results-side .podium { zoom: 0.7; }
  .results .results-next { grid-column: 1 / -1; align-self: end; }
  .results.one-side { grid-template-columns: minmax(0, 1fr); }
  .results-side > .results-host .w-host-pic { width: clamp(64px, 18vh, 120px); }
  .results-side .results-prop { width: clamp(48px, 13vh, 96px); }
  .results-side h1 { font-size: clamp(26px, 7vh, 40px); }
  .results-side .scene-news .scene-tile { width: clamp(96px, 24vh, 150px); }
  .results-side .winners .avatar { --size: clamp(44px, 12vh, 84px); box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--yellow); }
  .results-side .winners { gap: 10px; }
  .results-side > .sub { font-size: clamp(14px, 3.6vh, 18px); }
  .results-side .shelf-news { padding: 6px 14px; }
  /* The corner buttons run along the top in the TV layout: the right side
     starts below them. */
  html[data-tv] .results-side + .results-side { padding-top: clamp(56px, 14vh, 90px); }
}
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (max-width: 900px) {
  .family, .play-main { flex-direction: column; }
  .member-form { width: 100%; }
  .member, .add-member { min-height: 170px; }
  .person { min-height: 0; }
}
@media (max-width: 520px) {
  .members { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .member .name, .person .name { font-size: 22px; }
  .avatar { --size: 64px; }
  .btn { padding: 0 20px; }
  .bar { padding: 14px 16px; }
  .tile { min-height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .tile { transition: none; }
}

/* ==========================================================================
   One screen, no scrolling. Every screen is exactly the window's height: the
   head and the buttons keep their size and one area in the middle takes
   what is left, with pictures sized to fit it. Sizes shrink with the
   window's height (vh) as well as its width, so short screens fit too.
   ========================================================================== */
html, body { height: 100%; }
body { overflow: hidden; }
#app { height: 100%; }
.screen {
  height: 100vh; height: 100dvh; min-height: 0;
  padding: clamp(10px, 3vh, 48px) var(--gutter);
  gap: clamp(8px, 2vh, 24px);
  overflow: hidden;
}
.screen > * { flex-shrink: 0; }
/* Typing on a phone (app.js): the screen keeps its height from before the
   keyboard came up and the page scrolls to the field, instead of squashing. */
html.typing body { overflow-y: auto; }
html.typing .screen { height: var(--typing-height, 100dvh); }
h1 { font-size: clamp(24px, min(4.4vw, 6vh), 56px); }
h2 { font-size: clamp(19px, min(2.4vw, 3.4vh), 30px); }
.sub { font-size: clamp(18px, min(1.8vw, 2.6vh), 22px); }
.btn { min-height: clamp(48px, 7vh, 60px); font-size: clamp(18px, min(1.9vw, 2.8vh), 24px); }
.btn.small { min-height: clamp(44px, 5.6vh, 48px); font-size: clamp(18px, 2.2vh, 19px); }
.note { font-size: 18px; }

/* Family */
.family { flex: 1 1 0; min-height: 0; }
/* Cards share the height but stop at a size their content fills, so they don't stretch over empty space. */
.members { min-height: 0; grid-auto-rows: minmax(0, 220px); align-content: start; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.member, .add-member { min-height: 0; padding: clamp(8px, 1.6vh, 20px); gap: clamp(2px, 0.8vh, 8px); overflow: hidden; }
.member .avatar { width: clamp(40px, 9vh, 84px); height: clamp(40px, 9vh, 84px); font-size: clamp(18px, 4vh, 38px); }
.member .name { font-size: clamp(18px, 3.4vh, 28px); }
.member .meta { font-size: clamp(16px, 2vh, 18px); }
.add-member { font-size: clamp(17px, 2.8vh, 24px); }
.add-member svg { width: clamp(32px, 6vh, 56px); height: auto; }
.member-form { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(14px, 2.6vh, 28px); gap: clamp(8px, 1.6vh, 18px); }
/* At any size the form can be taller than its panel (the animals, the colours, three buttons
   when editing): it scrolls, and its buttons stay in sight at the bottom. */
.w-skin .member-form .form-actions { position: sticky; bottom: calc(-1 * clamp(14px, 2.6vh, 28px)); padding: 8px 0 clamp(14px, 2.6vh, 28px); background: var(--w-board); z-index: 1; }
.field input, .field select { height: clamp(48px, 6.4vh, 56px); font-size: clamp(18px, 2.6vh, 22px); }
.field label, .field .label { font-size: 18px; }
.sheet-close { display: none; }

/* Tonight */
.people { flex: 1 1 0; min-height: 0; grid-auto-rows: minmax(0, 290px); align-content: start; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: clamp(10px, 2vh, 22px); }
.person { min-height: 0; padding: clamp(8px, 2vh, 22px) 12px; gap: clamp(4px, 1vh, 10px); overflow: hidden; }
.person .avatar { width: clamp(44px, 11vh, 100px); height: clamp(44px, 11vh, 100px); font-size: clamp(20px, 5vh, 45px); }
.person .name { font-size: clamp(18px, 3.4vh, 30px); }
.person-tap { gap: clamp(4px, 1vh, 10px); }
.bar { padding: clamp(10px, 1.8vh, 18px) clamp(14px, 2vw, 28px); gap: 12px 20px; }
.bar-info { font-size: clamp(16px, 2.6vh, 22px); gap: 8px clamp(14px, 3vw, 36px); }

/* Teams */
.team-grid { flex: 1 1 0; min-height: 0; gap: clamp(12px, 2.4vh, 32px); }
.team { min-height: 0; }
.team-head { padding: clamp(8px, 1.8vh, 18px) clamp(14px, 2vw, 28px); }
.team-body { padding: clamp(8px, 1.8vh, 20px) clamp(14px, 2vw, 28px); gap: clamp(6px, 1.4vh, 14px); min-height: 0; overflow: hidden; }
.team-row .avatar { width: clamp(34px, 7vh, 68px); height: clamp(34px, 7vh, 68px); font-size: clamp(16px, 3.2vh, 30px); }
.team-row .name { font-size: clamp(18px, 3.2vh, 28px); }
.strength { padding: 0 clamp(14px, 2vw, 28px) clamp(10px, 2vh, 22px); }

/* Games list */
.game-grid { flex: 1 1 0; min-height: 0; grid-auto-rows: minmax(0, 1fr); gap: clamp(10px, 2vh, 24px); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-card { min-height: 0; }
.game-art { aspect-ratio: auto; flex: 1 1 0; min-height: 0; padding: 4% 6%; }
.game-body { padding: clamp(8px, 1.6vh, 18px) clamp(12px, 1.6vw, 22px); gap: 2px; flex-shrink: 0; }
.game-body .title { font-size: clamp(18px, min(2vw, 3.4vh), 28px); }
.game-body .blurb { font-size: clamp(16px, 2vh, 18px); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-body .section-tag { font-size: clamp(16px, 1.9vh, 17px); padding: 2px 12px; }

/* Results */
/* Fit the window when it can; scroll rather than hide a score row when it can't. */
.results { flex: 1 1 0; min-height: 0; gap: clamp(8px, 2vh, 24px); overflow-y: auto; }
.trophy { font-size: clamp(40px, 10vh, 110px); }
.winners .avatar { width: clamp(60px, 13vh, 110px); height: clamp(60px, 13vh, 110px); font-size: clamp(26px, 6vh, 50px); }
.standings { flex: 0 0 auto; padding: clamp(4px, 1vh, 12px); }
.standings .score-row { padding: clamp(3px, 0.8vh, 8px) 10px; }
.standings .score-row .avatar { width: clamp(30px, 5.4vh, 44px); height: clamp(30px, 5.4vh, 44px); }
.standings .score-row .name { font-size: clamp(16px, 2.8vh, 22px); }
.standings .score-row .pts { font-size: clamp(18px, 3.2vh, 28px); }

/* Play: head, then the game, then the bar, in exactly the window. */
.screen.play { padding: clamp(8px, 2vh, 32px) clamp(12px, 2.6vw, 40px); gap: clamp(8px, 1.4vh, 20px); }
.screen.play > .play-main { flex: 1 1 0; min-height: 0; }
.play-title .game { font-size: clamp(19px, min(2.5vw, 3.6vh), 32px); }
.play-title .round { font-size: clamp(16px, 2.6vh, 18px); }
.icon-btn { width: clamp(40px, 6.4vh, 52px); height: clamp(40px, 6.4vh, 52px); }
.ring { width: clamp(48px, 8vh, 72px); height: clamp(48px, 8vh, 72px); }
.ring svg { width: 100%; height: 100%; }
.ring span { font-size: clamp(18px, 3.4vh, 28px); }
.stage { min-height: 0; }
/* A paused round: the game is hidden under a cover with the host and one
   Resume button, so nobody answers or peeks until it goes on. */
.stage { position: relative; }
.play-paused {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: clamp(16px, 3vw, 48px);
  border-radius: var(--w-radius); background: var(--w-board);
}
.play-paused .w-host-pic { width: clamp(96px, 22vh, 220px); }
.stage > .night { min-height: 0; overflow: hidden; }
.night { padding: clamp(10px, 2.4vh, 30px); gap: clamp(6px, 1.6vh, 20px); border-width: clamp(5px, 1.2vh, 10px); }
.night > * { flex-shrink: 0; }
.night-player .avatar { width: clamp(36px, 7.4vh, 64px); height: clamp(36px, 7.4vh, 64px); font-size: clamp(16px, 3.4vh, 29px); }
.night-name { font-size: clamp(20px, 3.6vh, 30px); }
.night-kicker { font-size: clamp(16px, 2vh, 17px); }
.night-big { font-size: clamp(22px, min(3.4vw, 4.8vh), 42px); }
.night .prompt { font-size: clamp(17px, min(2.4vw, 3.2vh), 30px); }
.night-go { padding: clamp(10px, 1.8vh, 16px) clamp(20px, 2.4vw, 30px); font-size: clamp(18px, 3vh, 24px) !important; }
.night-ready { min-height: 0; gap: clamp(10px, 2.4vh, 22px); }
.night-ready .avatar { width: clamp(70px, 17vh, 140px); height: clamp(70px, 17vh, 140px); font-size: clamp(30px, 7.5vh, 63px); }
/* The box lid: the player's name reads as big as the face, the level tag is a proper label. */
.night-ready .night-big { font-size: clamp(28px, min(4.4vw, 5.6vh), 48px); text-wrap: balance; }
.night-ready .pill { padding: 3px 16px; font-size: clamp(16px, 2.4vh, 20px); font-weight: 700; }

/* Picture rounds: the big picture and the choices share the height. */
.night .feature { flex: 3 1 0; min-height: 0; padding: clamp(6px, 1.4vh, 16px); overflow: hidden; }
.night .feature img { height: 100%; width: 100%; max-height: none; aspect-ratio: auto; object-fit: contain; }
.night .choices { flex: 5 1 0; min-height: 0; grid-auto-rows: minmax(0, 1fr); gap: clamp(8px, 1.6vh, 16px); }
.night .feature + .choices, .night .memory.small + .choices { flex-grow: 5; }
.tile { min-height: 0; padding: clamp(4px, 1vh, 12px); gap: clamp(2px, 0.6vh, 8px); overflow: hidden; }
.tile img { flex: 1 1 0; min-height: 0; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.tile .label { font-size: clamp(16px, min(2vw, 2.6vh), 26px); line-height: 1.1; }
.tile .number { font-size: clamp(36px, min(7vw, 9vh), 88px); }
.feedback { padding: clamp(6px, 1.2vh, 12px); font-size: clamp(16px, min(2.2vw, 3vh), 28px); }
.explain { padding: clamp(8px, 1.4vh, 14px) clamp(12px, 1.6vw, 20px); }
.explain p { font-size: clamp(16px, min(1.8vw, 2.4vh), 22px); line-height: 1.3; }
.night .memory { flex: 1 1 0; min-height: 0; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); align-content: stretch; padding: clamp(6px, 1.4vh, 16px); }
.night .memory img { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; object-fit: contain; }
.night .memory.small { flex: 2 1 0; }
.study-count { font-size: clamp(20px, 3.6vh, 36px); }
.clues { padding: clamp(8px, 1.4vh, 16px) clamp(12px, 1.6vw, 20px); gap: clamp(4px, 1vh, 10px); }
.clue { font-size: clamp(16px, min(2.4vw, 3.2vh), 30px); gap: 10px; }
.clue .n { width: clamp(26px, 4.4vh, 40px); height: clamp(26px, 4.4vh, 40px); font-size: clamp(16px, 2.2vh, 20px); }
.mem-grid { flex: 1 1 0; min-height: 0; grid-template-rows: repeat(var(--rows, 3), minmax(0, 1fr)); gap: clamp(6px, 1.2vh, 12px); }
.mem-card { aspect-ratio: auto; min-height: 0; height: 100%; padding: 4px; }
.mem-card img { width: 100%; height: 100%; min-height: 0; }
.mem-note { font-size: clamp(17px, min(2.4vw, 3.2vh), 30px); }

/* Score rows (results) and the bar */
.score-row { padding: clamp(3px, 0.8vh, 8px) 10px; }
.score-row .avatar { width: clamp(30px, 5.4vh, 44px); height: clamp(30px, 5.4vh, 44px); font-size: clamp(16px, 2.4vh, 20px); }
.score-row .name { font-size: clamp(16px, 2.6vh, 22px); }
.score-row .pts { font-size: clamp(20px, 3.4vh, 28px); }
.host-bar { padding: clamp(6px, 1.2vh, 14px) clamp(12px, 1.6vw, 18px); gap: 10px; flex-wrap: nowrap; }
.host-bar .info { font-size: clamp(16px, 2.2vh, 19px); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-bar .btn { min-height: clamp(42px, 6.4vh, 56px); font-size: clamp(16px, 2.6vh, 21px); padding: 0 clamp(14px, 2vw, 26px); flex-shrink: 0; }

/* Twenty Questions, fitted */
.tq-cards { flex: 1 1 0; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
.tq-card { min-height: 0; padding: clamp(6px, 1.4vh, 18px) 10px; gap: 4px; font-size: clamp(16px, min(2vw, 2.8vh), 26px); }
.tq-card img { flex: 1 1 0; min-height: 0; width: 100%; height: auto; aspect-ratio: auto; }
.tq-eyes { font-size: clamp(16px, 2.6vh, 22px); padding: 4px 14px; }
.tq-center { flex: 1 1 0; min-height: 0; gap: clamp(12px, 2vw, 28px); flex-wrap: nowrap; }
.tq-vault.big { width: auto; height: 100%; max-height: 300px; }
.tq-rules { gap: clamp(4px, 1vh, 10px); }
.tq-rules p { font-size: clamp(16px, 2.4vh, 20px); padding: clamp(6px, 1.2vh, 12px) 14px; }
.tq-lock, .tq-vault.big .tq-lock { font-size: clamp(20px, 4.6vh, 44px); }
.tq-ask { flex: 1 1 0; min-height: 0; grid-template-columns: clamp(150px, 18vw, 240px) minmax(0, 1fr); gap: clamp(10px, 1.6vw, 22px); }
.tq-side { min-height: 0; gap: clamp(6px, 1.4vh, 16px); }
.tq-side .tq-vault { width: auto; height: clamp(90px, 22vh, 200px); flex-shrink: 0; }
.tq-hints { min-height: 0; flex: 1 1 0; overflow: hidden; padding: clamp(6px, 1.2vh, 14px); gap: clamp(4px, 1vh, 10px); }
.tq-main { min-height: 0; gap: clamp(6px, 1.4vh, 16px); }
.tq-question { padding: clamp(8px, 1.4vh, 16px) clamp(12px, 1.6vw, 20px); }
.tq-q { font-size: clamp(18px, min(2.6vw, 3.4vh), 32px); }
.tq-chips { gap: 6px; }
.tq-chip { padding: clamp(4px, 0.8vh, 8px) 12px; font-size: clamp(16px, 2.1vh, 17px) !important; }
.tq-yes, .tq-no { min-height: clamp(52px, 11vh, 104px); font-size: clamp(22px, 4.4vh, 36px) !important; }
.tq-mark { width: clamp(34px, 6vh, 54px); height: clamp(34px, 6vh, 54px); font-size: clamp(18px, 3.4vh, 30px); }
.tq-board { padding-top: clamp(6px, 1.4vh, 16px); gap: 6px; }
.tq-clues { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.tq-clue { flex-shrink: 0; font-size: clamp(16px, 2vh, 17px); padding: 4px 10px; white-space: nowrap; }
.tq-head { gap: 10px; }
.tq-people { flex: 1 1 0; min-height: 0; align-content: center; }
.tq-person { padding: clamp(10px, 2vh, 20px); font-size: clamp(17px, 2.8vh, 24px) !important; }
.tq-person .avatar { width: clamp(54px, 11vh, 84px); height: clamp(54px, 11vh, 84px); font-size: clamp(24px, 5vh, 38px); }
.tq-reveal { flex: 1 1 0; min-height: 0; flex-wrap: nowrap; }
.tq-flip { width: auto; height: 100%; max-height: 360px; min-height: 0; aspect-ratio: 4 / 5; padding: clamp(8px, 1.6vh, 18px); font-size: clamp(17px, 3vh, 26px); }
.tq-flip img { flex: 1 1 0; min-height: 0; width: 100%; aspect-ratio: auto; }
.tq-stats { font-size: clamp(16px, 2.4vh, 20px); }
.tq-points { font-size: clamp(17px, 3vh, 24px); }

/* Tablets and phones: the stage stacks over the bar. */
@media (max-width: 900px) {
  .play-main { flex-direction: column; gap: clamp(6px, 1.2vh, 12px); }
  .stage { flex: 1 1 0; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .family { flex-direction: row; }
  .member-form { width: 320px; }
}

@media (max-width: 600px) {
  .head { align-items: center; gap: 8px; }
  .head .sub { display: none; }
  .head-text .sub { display: block; font-size: 16px; }
  .footer { gap: 8px; }
  .footer .btn { flex: 1 1 auto; padding: 0 14px; }
  /* Family: a compact list; the form opens as a sheet. */
  .family { flex-direction: column; }
  .members { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; grid-auto-rows: minmax(0, 150px); }
  .member, .add-member { border-radius: var(--w-radius-s); }
  .member .meta { display: none; }
  .member .pill { font-size: 16px; padding: 1px 8px; }
  .member-form { display: none; }
  .family.form-open .member-form {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; width: 100%;
    border-radius: 24px 24px 0 0; max-height: 92dvh; box-shadow: 0 -10px 40px rgba(31, 37, 71, 0.25);
  }
  .family.form-open::before { content: ''; position: fixed; inset: 0; background: rgba(23, 26, 69, 0.45); z-index: 19; }
  .sheet-close {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 12px; right: 12px;
    width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); font-size: 18px;
  }
  .member-form { position: relative; }
  /* Tonight */
  .people { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .person { border-radius: var(--w-radius-s); padding: 8px 6px; }
  .person .check { width: 24px; height: 24px; top: 6px; right: 6px; }
  .person .check svg { width: 14px; height: 14px; }
  .person .pill { font-size: 16px; padding: 1px 8px; }
  .person .segmented button, .person .btn.small { font-size: 16px; min-height: 44px; padding: 0 4px; }
  .bar { flex-direction: column; align-items: stretch; }
  .bar-info { justify-content: space-between; }
  .bar-info .muted:last-child { display: none; }
  .mode-hint { font-size: 16px; }
  /* Teams */
  .team-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .team-row { gap: 4px 8px; flex-wrap: wrap; }
  /* The balance stays visible on a phone: a small level pill under each name, a thin strength bar. */
  .team-row .pill { font-size: 16px; padding: 1px 8px; margin-left: auto; }
  .strength { padding: 0 12px 12px; }
  .strength > span { display: none; }
  .strength .meter { height: 8px; }
  /* Games list: picture and name only. */
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .game-body .blurb, .game-body .section-tag { display: none; }
  .game-body { padding: 6px 10px 8px; }
  /* Play */
  .host-bar .info { display: none; }
  .host-bar { justify-content: flex-end; }
  .night-meta { display: none; }
  .tile .label { display: none; }
  .night .choices[style*="--cols: 1"] { --cols: 2 !important; }
  /* Twenty Questions on a phone */
  .tq-dots { --peg: 14px; grid-template-columns: repeat(10, var(--peg)); gap: 3px; padding: 5px 7px; border-radius: 12px; }
  .tq-center { flex-direction: column; align-items: stretch; }
  .tq-vault.big { height: auto; flex: 1 1 0; min-height: 0; width: 100%; aspect-ratio: auto; }
  .tq-rules p { font-size: 16px; }
  /* The ask step stacks: question, ideas, Yes/No, then the vault and hint
     share what height is left, then "someone guessed it". */
  .tq-ask { display: flex; flex-direction: column; gap: 8px; }
  .tq-main { display: contents; }
  .tq-question { order: 1; }
  .tq-ideas { order: 2; }
  .tq-answer { order: 3; }
  .tq-side { order: 4; flex: 1 1 0; min-height: 0; flex-direction: row; align-items: stretch; gap: 8px; }
  .tq-main > .night-go { order: 5; align-self: stretch; }
  .tq-side .tq-vault { height: auto; width: 30%; flex-shrink: 0; gap: 2px; border-width: 2px; }
  .tq-side .tq-lock { font-size: clamp(16px, 3.4vh, 30px); }
  .tq-vault-label { font-size: 11px; }
  .tq-side .tq-hints { flex: 1 1 0; min-width: 0; }
  .tq-use { padding: 6px 12px; font-size: 16px !important; }
  .tq-slot { width: 20px; height: 20px; font-size: 11px; }
  .tq-yes, .tq-no { min-height: clamp(48px, 8vh, 84px); }
  .tq-question { padding: 8px 12px; }
  .tq-q { font-size: clamp(16px, 2.6vh, 22px); }
  .night-go { font-size: clamp(16px, 2.6vh, 22px) !important; padding: 10px 16px; }
  .tq-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tq-chip { flex-shrink: 0; }
  .tq-ideas .night-kicker, .tq-ideas > .tq-board-title { display: none; }
  .tq-reveal { flex-direction: column; align-items: stretch; gap: 10px; }
  .tq-flip { height: auto; flex: 1 1 0; width: auto; aspect-ratio: auto; max-height: none; }
  .tq-people { gap: 8px; }
  .tq-person { min-width: 0; flex: 1 1 40%; }
}

/* Short screens (a laptop with browser bars, a phone on its side). */
@media (max-height: 560px) {
  .head .sub, .head-text .sub { display: none; }
  .game-body .blurb, .game-body .section-tag { display: none; }
  .night-kicker { display: none; }
  .tq-rules { display: none; }
  .tq-ideas { display: none; }
}

/* Twenty Questions on screens that are not tall: the idea chips sit in one
   row you can swipe sideways, so they never push the buttons down. */
@media (max-height: 900px) {
  .tq-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tq-chip { flex-shrink: 0; }
}
@media (max-width: 600px) and (max-height: 780px) {
  .tq-vault-label { display: none; }
}
@media (max-width: 600px) {
  .tq-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px; }
  .tq-person { min-width: 0; padding: 8px 4px; gap: 4px; font-size: 16px !important; }
  .tq-person .avatar { width: clamp(40px, 7vh, 64px); height: clamp(40px, 7vh, 64px); font-size: 20px; }
}
@media (max-width: 600px) and (max-height: 780px) {
  .tq-side .tq-hints { padding: 4px 6px; gap: 2px; }
  .tq-side .tq-hints-top .tq-board-title { display: none; }
  .tq-side .tq-hints-top { justify-content: center; }
  .tq-hint-wait { font-size: 16px; }
}

/* Text on the white tiles stays dark on the night stage (number rounds). */
.night .tile, .night .memory, .night .feature { color: var(--ink); }
@media (max-width: 900px) {
  .members { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .members { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Twenty Questions: the locked card and the reveal card keep a card shape. */
  .tq-center { align-items: center; }
  .tq-vault.big { flex: 0 0 auto; height: clamp(90px, 22vh, 220px); width: auto; aspect-ratio: 3 / 4; }
  .tq-rules { flex: 0 1 auto; align-self: stretch; }
  .tq-reveal { align-items: center; }
  .tq-flip { flex: 0 0 auto; height: clamp(150px, 34vh, 320px); width: auto; aspect-ratio: 4 / 5; }
  .tq-result { flex: 0 1 auto; align-self: stretch; }
}
@media (max-width: 600px) and (max-height: 780px) {
  .tq-flip { height: clamp(110px, 26vh, 240px); }
  .tq-reveal ~ .tq-board { display: none; }
  .tq-reveal { gap: 6px; }
}
@media (max-width: 600px) {
  .tq-flip { height: clamp(110px, 26vh, 240px); }
  .tq-reveal ~ .tq-board { display: none; }
  .tq-reveal { gap: 6px; justify-content: center; }
  .tq-result { gap: 4px; }
}

/* Twenty Questions hints: clues in words, every one given stays listed. */
.tq-hints { align-items: stretch; text-align: left; }
.tq-hint-list {
  margin: 0; padding: 0 0 0 1.4em; display: flex; flex-direction: column; gap: clamp(2px, 0.6vh, 6px);
  min-height: 0; overflow: hidden; font-size: clamp(16px, 2.3vh, 19px); font-weight: 700; line-height: 1.25;
}
.tq-hint-list li::marker { color: var(--n-mark); }
.tq-hint-list li:last-child { color: var(--n-mark); }
.tq-hint-wait { text-align: center; }
.tq-use { align-self: center; }
@media (max-width: 600px) {
  .tq-hint-list { font-size: 16px; gap: 1px; }
}
.tq-hint-list { overflow: visible; }
@media (max-width: 600px) {
  .tq-side .tq-vault { width: 22%; }
  .tq-side .tq-vault .tq-vault-label { display: none; }
  .tq-side .tq-hints { padding: 4px 8px; gap: 2px; }
  .tq-side .tq-hints-top .tq-board-title { display: none; }
  .tq-side .tq-hints-top { justify-content: flex-start; }
  .tq-slot { width: 16px; height: 16px; font-size: 10px; }
  .tq-hint-list { font-size: clamp(12.5px, 1.9vh, 16px); line-height: 1.2; gap: 0; }
  .tq-question { padding: 6px 10px; }
  .tq-q { font-size: clamp(16px, 2.2vh, 18px); }
  .tq-question .night-kicker { font-size: 10px; }
}
/* The board on a phone: a thinner rim and smaller pegs, so every step keeps
   its height for the pieces. */
@media (max-width: 600px) {
  .night { border-width: 5px; border-radius: var(--w-radius); box-shadow: 0 5px 0 var(--border); }
  .tq-dots { --peg: 10px; gap: 2px; padding: 4px 5px; border-radius: 9px; }
  .tq .night-head { gap: 10px; }
  .tq-eyes { font-size: 16px; padding: 3px 12px; }
  .tq-reveal { gap: 16px; }
  .tq-flip { font-size: 18px; line-height: 1.1; text-align: center; box-shadow: 0 0 0 4px var(--n-gold), 0 7px 0 4px var(--border); }
}

/* Player and family cards size their contents to the card itself, so the
   level and role buttons always stay inside, whatever the screen. */
.person, .member { container-type: size; }
.person .avatar, .person .person-tap .avatar {
  width: min(100px, 58cqw, 34cqh); height: min(100px, 58cqw, 34cqh); font-size: min(45px, 26cqw, 15cqh);
}
.person .name { font-size: clamp(18px, min(13cqw, 11cqh), 30px); }
/* A small card (a player, a family member): the aura hugs the avatar (as in
   the Trophy Hall), framed avatars keep room for their rings, and the name is
   drawn above both, so nothing covers it. */
.person .avatar[class*=' aura-']::before, .person .avatar[class*=' aura-']::after,
.member .avatar[class*=' aura-']::before, .member .avatar[class*=' aura-']::after { inset: -14%; }
.person .name, .member .name { position: relative; z-index: 1; }
.person .avatar[class*=' frame-'], .member .avatar[class*=' frame-'] { margin-bottom: 14px; }   /* its rings reach past it */
.person .pill { font-size: clamp(18px, min(8cqw, 6.5cqh), 19px); padding: 1px clamp(6px, 4cqw, 16px); }
/* Picking a level: the four levels show which one it is, so the level badge gives them its room. */
.person:has(.level-pick) .pill { display: none; }
.person .bottom { flex-shrink: 0; }
.person .level-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; }
.person .level-pick button {
  min-height: 44px; padding: 0 2px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
  font-size: clamp(16px, min(7cqw, 6cqh), 17px); font-weight: 600; min-width: 0; overflow-wrap: anywhere;
}
.person .level-pick button[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.person .segmented button, .person .btn.small { min-height: clamp(44px, 14cqh, 52px); font-size: clamp(16px, min(8cqw, 6.5cqh), 19px); }
.person { gap: clamp(2px, 2.5cqh, 10px); padding: clamp(6px, 4cqh, 22px) 8px; }
.person-tap { gap: clamp(2px, 2cqh, 10px); flex-shrink: 1; min-height: 0; }
.member .avatar { width: min(84px, 50cqw, 40cqh); height: min(84px, 50cqw, 40cqh); font-size: min(38px, 22cqw, 18cqh); }
.member .name { font-size: clamp(18px, min(13cqw, 13cqh), 28px); }
.member .pill { font-size: clamp(18px, min(8cqw, 8cqh), 19px); }
@container (max-height: 170px) {
  .member .meta { display: none; }
}
@container (max-height: 120px) {
  .person .pill { display: none; }
}

/* Guess My Number */
.gn-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gn-say { font-size: clamp(22px, min(3.4vw, 4.6vh), 44px); font-weight: 800; color: var(--n-mark); }
.gn-range { display: flex; align-items: center; gap: 12px; color: var(--n-dim); font-size: clamp(16px, 2.2vh, 19px); font-weight: 600; }
.gn-tries { display: flex; gap: 5px; }
.gn-try { width: clamp(12px, 1.8vh, 16px); height: clamp(12px, 1.8vh, 16px); border-radius: 50%; background: var(--n-gold); }
.gn-try.used { background: var(--n-line); }
.gn-history { display: flex; flex-wrap: wrap; gap: 6px; }
.gn-chip { padding: 2px 12px; border-radius: 999px; font-weight: 800; font-size: clamp(16px, 2.2vh, 19px); background: var(--n-glass); color: var(--ink); }
.gn-chip.right { background: var(--n-yes); }
.gn-grid {
  flex: 1 1 0; min-height: 0; display: grid; gap: clamp(6px, 1.2vh, 12px);
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr);
}
.gn-num, .gn-key {
  border: 2px solid var(--border); border-radius: var(--w-radius-s); background: #FFFFFF; color: var(--navy) !important; font-weight: 800;
  font-size: clamp(20px, min(3.4vw, 4.6vh), 44px); min-height: 0; box-shadow: 0 4px 0 var(--border);
}
.gn-num:not(:disabled):active, .gn-key:not(:disabled):active { transform: translateY(4px); box-shadow: none; }
.gn-num.out { opacity: 0.3; }
.gn-num.tried { background: var(--n-line); border-color: transparent; color: var(--n-dim) !important; box-shadow: none; opacity: 1; }
.gn-num.right { background: var(--n-yes); color: var(--navy) !important; opacity: 1; }
.gn-keypad { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: clamp(6px, 1.2vh, 12px); align-items: center; }
.gn-display {
  min-width: min(100%, 320px); text-align: center; padding: clamp(4px, 1vh, 10px) 20px; border-radius: var(--w-radius-s);
  background: var(--card); border: 3px solid var(--border); box-shadow: inset 0 3px 0 var(--n-line); font-size: clamp(28px, 5.4vh, 54px); font-weight: 800;
}
.gn-keys { flex: 1 1 0; min-height: 0; width: min(100%, 420px); display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(0, 1fr); gap: clamp(6px, 1.2vh, 10px); }
.gn-key.go { background: var(--n-gold); font-size: clamp(18px, 3vh, 28px); }
/* The board: what is known, then the numbers. Stacked, it spaces as the card does. */
.gn-board, .gn-info { display: flex; flex-direction: column; gap: clamp(6px, 1.6vh, 20px); min-width: 0; }
.gn-board { flex: 1 1 0; min-height: 0; }
/* A phone on its side: stacked, the guesses would crush the keypad into
   strips, so the keypad takes the right side at full height, its display
   beside the keys. */
@media (orientation: landscape) and (max-height: 600px) {
  .gn-board { flex-direction: row; gap: clamp(10px, 2vw, 24px); }
  .gn-info { flex: 1 1 0; min-height: 0; overflow-y: auto; }
  .gn-info .gn-line { padding-top: 18px; }
  .gn-board > .gn-grid { flex: 1.2 1 0; }
  .gn-keypad { flex: 1.2 1 0; min-width: 0; flex-direction: row; align-items: stretch; }
  .gn-keypad .gn-display { align-self: center; min-width: 0; width: clamp(96px, 14vw, 160px); padding: 8px; font-size: clamp(24px, 7vh, 44px); }
  .gn-keys { width: auto; flex: 1 1 0; }
}

/* A note under a game's main row (Story Dice) */
.sw-note { margin: 0; text-align: center; color: var(--n-dim); font-size: clamp(16px, 3vh, 22px); min-height: 1.3em; }
.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
.gn-key, .gn-num { padding: 0; }
@media (max-width: 600px) {
  .gn-status { flex-direction: column; align-items: flex-start; gap: 4px; }
  .gn-range { width: 100%; justify-content: space-between; }
}
.gn-between { white-space: nowrap; }
.gn-range { flex-wrap: wrap; }

/* Money Count: coins drawn by the app */
.coin {
  --c1: #E9EEF7; --c2: #A9B4C8; --edge: #8892A8;
  width: calc(var(--coin, 72px) * var(--s, 1)); aspect-ratio: 1; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; border: 0; padding: 0;
  background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2) 70%);
  box-shadow: inset 0 0 0 calc(var(--coin, 72px) * 0.07) var(--edge), 0 4px 8px rgba(0, 0, 0, 0.3);
  color: #2B2F45; font-weight: 800; font-size: calc(var(--coin, 72px) * var(--s, 1) * 0.38);
}
.coin span { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.coin.copper { --c1: #F3C29B; --c2: #C47B45; --edge: #9C5A2E; }
.coin.gold { --c1: #FFF0A8; --c2: #E3AE2D; --edge: #B5861A; }
button.coin:not(:disabled):active { transform: scale(0.94); }
.mc-pile { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: clamp(6px, 1vw, 12px); --coin: clamp(48px, 10vh, 96px); flex: 1 1 0; min-height: 0; }
.mc-choices { flex: 0 1 clamp(80px, 22vh, 180px); }
.mc-sum { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.mc-tag { padding: 4px 16px; border-radius: 999px; background: var(--card); border: 2px solid var(--border); font-size: clamp(16px, 2.8vh, 24px); font-weight: 800; }
.mc-tag.paid { background: rgba(255, 201, 74, 0.3); color: var(--ink); border-color: var(--n-gold); }
.mc-tag.over { background: rgba(255, 107, 107, 0.25); border-color: var(--n-no); }
.mc-tray {
  flex: 1 1 0; min-height: 0; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 8px;
  padding: 10px; border-radius: var(--w-radius-s); border: 2px dashed var(--border); background: var(--n-glass); --coin: clamp(42px, 8vh, 80px); overflow: hidden;
}
.mc-empty { color: var(--n-dim); font-size: clamp(16px, 2.4vh, 20px); }
.mc-bank { display: flex; justify-content: center; gap: clamp(8px, 1.6vw, 18px); flex-wrap: wrap; --coin: clamp(54px, 11vh, 100px); }

/* Coins fill their pile: the size comes from the pile and how many coins it holds. */
.mc-pile, .mc-tray { container-type: size; }
.mc-pile .coin, .mc-tray .coin {
  --coin: min(100px, calc(100cqw / var(--cols, 4) - 14px), calc(100cqh / var(--rows, 1) - 14px));
}
.night .mc-pile { flex: 3 1 0; gap: 8px; }
.night .mc-choices { flex: 0 0 auto; height: clamp(64px, 15vh, 140px); }
.mc-choices .tile .number { font-size: clamp(28px, min(5vw, 7vh), 72px); }
.mc-tray { flex: 2 1 0; }
.mc-bank { --coin: clamp(46px, min(14vw, 10vh), 96px); }
@media (max-width: 600px) {
  .night .mc-choices { height: clamp(110px, 22vh, 180px); --cols: 2 !important; }
}

/* Pick a game: Game Street (src/ui/street.js). The street fills the screen
   under the title and scrolls left and right; everything on it is sized in
   cqh (shares of the street's height), so it looks the same on a TV, a
   tablet and a phone on its side. A picture from images/street/ replaces
   each drawn stand-in once it is made (docs/game-street/GEMINI-PROMPTS.md). */
.screen.games-screen { max-width: none; padding: 0; gap: 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tonight-line { margin: 2px 0 0; align-self: flex-start; padding: 4px 14px; border-radius: 999px; background: var(--soft); font-size: clamp(16px, 2.2vh, 18px); font-weight: 700; }

[data-section='guessing'] { --sec: var(--sec-guessing); --plank-ink: var(--on-sec, #FFFFFF); }
[data-section='movement'] { --sec: var(--sec-movement); --plank-ink: var(--on-sec, #FFFFFF); }
[data-section='learning'] { --sec: var(--sec-learning); --plank-ink: var(--on-sec, #FFFFFF); }
[data-section='group'] { --sec: var(--sec-group); --plank-ink: var(--navy); }

.street {
  --street-sky: var(--w-sky); --street-haze: var(--w-sky-low); --street-hill: #B5E3A6; --street-hill-2: #A3D996;
  --street-kerb: #CFD3DC; --street-road: var(--w-road); --street-line: #FFE14D;
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
}

.street-view { --top-h: 150px; position: relative; flex: 1 1 0; min-height: 0; container-type: size; overflow: hidden; }
/* The street's own room is under the bar: the shops size to it, while the sky
   runs up behind the bar to the top of the screen. */
.street-scroll {
  position: absolute; inset: var(--top-h) 0 0; container-type: size; isolation: isolate;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
}
.street-scroll::-webkit-scrollbar { display: none; }
.street-row {
  position: relative; box-sizing: border-box; height: 100%; width: max-content; min-width: 100%;
  /* One unit of street furniture: a share of the street's height, but on a
     phone held upright, of its width, so a couple of shops still fit. */
  --u: min(1cqh, 1.15cqw);
  display: flex; align-items: flex-end; gap: calc(3 * var(--u));
  padding: 0 max(var(--gutter), calc(10 * var(--u))) 19cqh;
}

/* Sky and hills stay put behind the street; the road's picture repeats along it. */
.street-backdrop {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(var(--street-sky), var(--street-haze) 70%);
}
.street-backdrop::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: calc((100cqh - var(--top-h)) * 0.18); height: 45cqh;
  background:
    radial-gradient(ellipse 60cqh 30cqh at 15% 100%, var(--street-hill) 98%, transparent 100%),
    radial-gradient(ellipse 80cqh 38cqh at 45% 100%, var(--street-hill-2) 98%, transparent 100%),
    radial-gradient(ellipse 70cqh 32cqh at 80% 100%, var(--street-hill) 98%, transparent 100%);
  background-size: 200cqh 100%; background-repeat: repeat-x;
}
.street-backdrop.has-day { background: var(--day) center bottom / cover no-repeat; }
.street-backdrop.has-day::before { content: none; }
.street-cloud { position: absolute; height: 9cqh; aspect-ratio: 2 / 1; }
.street-cloud.c0 { left: 22%; top: 6cqh; }
.street-cloud.c1 { left: 55%; top: 3cqh; height: 6cqh; }
.street-cloud.c2 { left: 84%; top: 9cqh; }
.street-cloud:not(.has-art) { border-radius: 99px; background: #FFFFFF; opacity: 0.9; height: 5cqh; aspect-ratio: 4 / 1; }
.street-cloud:not(.has-art)::before { content: ''; position: absolute; left: 22%; bottom: 40%; width: 40%; aspect-ratio: 1; border-radius: 50%; background: inherit; }
.street-cloud img { width: 100%; height: 100%; object-fit: contain; }

.street-road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 21cqh;
  background: linear-gradient(var(--street-kerb) 0 5cqh, var(--street-road) 5cqh);
}
.street-road::after {
  content: ''; position: absolute; left: 0; right: 0; top: 12.5cqh; height: 1.2cqh;
  background: repeating-linear-gradient(90deg, var(--street-line) 0 7cqh, transparent 7cqh 14cqh);
}
.street-road.has-art { background: var(--road) left top / auto 100% repeat-x; }
.street-road.has-art::after { content: none; }

/* A shop. The window holds the game's card picture; in a 3D picture it
   shows through the see-through glass, and the name sits on the sign. */
.shop {
  position: relative; z-index: 1; flex: none; height: calc(56 * var(--u)); aspect-ratio: var(--ar, 3 / 4);
  margin-bottom: -calc(2 * var(--u)); padding: 0; border: 0; background: none; color: var(--navy);
  transition: transform 0.18s ease, filter 0.18s ease;
}
.shop:focus-visible { transform: translateY(-calc(1.8 * var(--u))); }
@media (hover: hover) { .shop:hover { transform: translateY(-calc(1.8 * var(--u))); } }
.shop:focus-visible { outline: none; }
/* The shop you are on stands in a pool of light in its kind's colour, with a
   bright ring on the pavement: cheap to draw, and easy to see from the sofa
   (a glow filter on the whole picture slowed TV sticks down). */
.shop-glow {
  position: absolute; z-index: -1; left: -22%; right: -22%; top: 4%; bottom: calc(-3 * var(--u));
  border-radius: 50%; opacity: 0; transition: opacity 0.18s ease; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sec) 70%, #FFFFFF) 0%, color-mix(in srgb, var(--sec) 45%, transparent) 60%, transparent 100%);
}
.shop-glow::after {
  content: ''; position: absolute; left: 14%; right: 14%; bottom: 0; height: calc(6 * var(--u));
  border-radius: 50%; border: calc(0.9 * var(--u)) solid #FFFFFF; background: color-mix(in srgb, var(--sec) 35%, transparent);
  box-shadow: 0 0 calc(2 * var(--u)) var(--sec);
}
@media (hover: hover) { .shop:hover .shop-glow { opacity: 0.6; } }
.shop:focus-visible .shop-glow { opacity: 1; }
/* Shops off screen hold their window's drawing still. */
.shop.idle .shop-window * { animation-play-state: paused !important; }
/* Until its picture has loaded, a shop is a soft shape in its kind's colour;
   the picture fades in over it. */
.shop.has-art::before {
  content: ''; position: absolute; left: 10%; right: 10%; top: 22%; bottom: 0; border-radius: calc(3 * var(--u)) calc(3 * var(--u)) calc(1 * var(--u)) calc(1 * var(--u));
  background: color-mix(in srgb, var(--sec) 22%, #FFFFFF); opacity: 0.85; transition: opacity 0.3s ease;
}
.shop.has-art.loaded::before { opacity: 0; }
.shop.has-art .shop-art { opacity: 0; transition: opacity 0.3s ease; }
.shop.has-art.loaded .shop-art { opacity: 1; }
.shop:active { transform: translateY(0); }
.shop-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 1; pointer-events: none; }
.shop-window { position: absolute; z-index: 0; overflow: hidden; border-radius: calc(1.2 * var(--u)); background: var(--stage); }
.shop-window .game-art { width: 100%; height: 100%; aspect-ratio: auto; padding: 4%; background: var(--stage); }
.shop-window .game-art.has-photo { padding: 0; }
/* The name on its sign: one size and one box for every shop on the map,
   set by src/ui/street.js (fitSigns) on the middle of the painted board,
   long names on two lines. The sizes below stand in until it has measured. */
.shop-sign {
  position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center;
  width: var(--sign-w, 80%); height: var(--sign-h, auto); transform: translate(-50%, -50%);
  font-weight: 800; line-height: 1.1; text-align: center; white-space: nowrap;
  /* The 2D street's sign: the kit's painted wood sign (.w-wood-sign), sized to the shop. */
  font-size: var(--sign-font, 14px); --wood-frame: max(2px, calc(0.8 * var(--u)));
}
.shop-sign > span { font-size: var(--sign-font, 14px); }
.shop-flag { position: absolute; z-index: 3; right: 4%; top: -calc(4 * var(--u)); width: calc(11 * var(--u)); aspect-ratio: 1; }
.shop.locked .shop-window, .shop.locked .shop-art { filter: grayscale(0.7) brightness(0.85); }
/* The World Kit's 🔒 Premium badge (src/ui/world.js badge), sized to the shop. */
.shop-lock { position: absolute; z-index: 3; left: 50%; top: 30%; transform: translate(-50%, -50%); pointer-events: none; }
.shop-lock .w-badge { padding: calc(0.8 * var(--u)) calc(2.4 * var(--u)); font-size: calc(4.2 * var(--u)); }
.shop-lock .w-badge.jiggle { animation: jiggle 0.5s; }
@keyframes jiggle { 20% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .shop-lock .w-badge.jiggle { animation: none; } }
/* Something new inside (a Spot the Difference scene): the World Kit's star
   badge on the shop's roof and on its district's gate, twinkling. */
.shop-fresh { position: absolute; z-index: 4; left: 6%; top: 2%; pointer-events: none; animation: fresh-twinkle 1.6s ease-in-out infinite; }
.shop-fresh .w-badge { padding: 6px; font-size: clamp(16px, calc(4.6 * var(--u, 4px)), 34px); }
.district-gate .shop-fresh { left: auto; right: 10%; top: 6%; }
@keyframes fresh-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .shop-fresh { animation: none; } }
.shop-flag img { width: 100%; height: 100%; object-fit: contain; }
.shop-flag:empty { width: calc(6 * var(--u)); height: calc(9 * var(--u)); aspect-ratio: auto; }
.shop-flag:empty::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: calc(0.7 * var(--u)); border-radius: calc(1 * var(--u)); background: #C99A00; }
.shop-flag:empty::after { content: '★'; position: absolute; left: calc(0.7 * var(--u)); top: calc(0.4 * var(--u)); width: calc(5.6 * var(--u)); height: calc(4.4 * var(--u)); display: grid; place-items: center; background: var(--yellow); color: #FFFFFF; font-size: calc(3 * var(--u)); clip-path: polygon(0 0, 100% 50%, 0 100%); padding-right: calc(1.6 * var(--u)); }

/* The drawn stand-in, until the shop's picture is made. */
.shop-facade {
  position: absolute; left: 6%; right: 6%; top: 18%; bottom: 0; border-radius: calc(1 * var(--u)) calc(1 * var(--u)) 0 0;
  background: color-mix(in srgb, var(--sec) 30%, #FFFFFF); box-shadow: inset -calc(2 * var(--u)) 0 0 rgba(0, 0, 0, 0.07);
}
.shop-facade::before { content: ''; position: absolute; left: -5%; right: -5%; top: -calc(3 * var(--u)); height: calc(3.4 * var(--u)); border-radius: calc(1 * var(--u)); background: var(--sec); }
.shop.roof-1 .shop-facade::before { top: -calc(11 * var(--u)); height: calc(11.4 * var(--u)); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.shop.roof-2 .shop-facade::before { left: 14%; right: 14%; top: -calc(9 * var(--u)); height: calc(9.4 * var(--u)); border-radius: 50% 50% 0 0; }
.shop-awning { position: absolute; left: 6%; right: 6%; top: 27%; height: calc(4 * var(--u)); border-radius: 0 0 calc(1.4 * var(--u)) calc(1.4 * var(--u)); background: repeating-linear-gradient(90deg, var(--sec) 0 calc(3 * var(--u)), #FFFFFF calc(3 * var(--u)) calc(6 * var(--u))); }
.shop-door { position: absolute; left: 50%; bottom: 0; width: 22%; height: 15%; transform: translateX(-50%); border-radius: calc(4 * var(--u)) calc(4 * var(--u)) 0 0; background: rgba(0, 0, 0, 0.22); }
.shop.drawn .shop-window { z-index: 1; border: calc(0.8 * var(--u)) solid rgba(0, 0, 0, 0.16); }
/* The Player house at the start of the street (street.js house): a little
   bigger than the shops, in warm coral, tonight's players in its window. */
.street-house { --sec: var(--w-roof); height: calc(60 * var(--u)); }
/* The faces stand in one row, as big as the window lets them (--n faces). */
.house-faces { display: flex; align-items: center; justify-content: center; gap: calc(0.8 * var(--u)); container-type: size; }
.house-face .avatar { --size: min(72cqh, calc(88cqw / var(--n, 1))); width: var(--size); height: var(--size); font-size: calc(var(--size) * 0.5); border: max(1px, calc(var(--size) * 0.07)) solid var(--w-board); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.house-face { position: relative; }
.house-face.host .avatar { opacity: 0.6; }
.house-face.host::after { content: "🎤"; position: absolute; right: calc(-1 * var(--u)); bottom: calc(-1 * var(--u)); font-size: calc(3.4 * var(--u)); }

/* A district's gate on the street (street.js gate): an arch in its kind's
   colour over two pillars, the roofs of its shops peeking over the wall
   behind; its picture (gate-<kind>) replaces the drawing once made. */
.district-gate {
  position: relative; z-index: 1; flex: none; height: calc(60 * var(--u)); aspect-ratio: var(--ar, 9 / 10);
  margin-bottom: calc(-2 * var(--u)); padding: 0; border: 0; background: none; color: #FFFFFF;
  transition: transform 0.18s ease;
}
.district-gate:focus-visible { transform: translateY(calc(-1.8 * var(--u))); }
@media (hover: hover) { .district-gate:hover { transform: translateY(calc(-1.8 * var(--u))); } }
.district-gate:focus-visible { outline: none; }
/* A tap shows at once, before the next screen is drawn. */
.btn:not(:disabled):active, .shop:active, .district-gate:active, .street-stop:active { transform: scale(0.96); transition-duration: 0.05s; }
@media (hover: hover) { .district-gate:hover .shop-glow { opacity: 0.6; } }
.district-gate:focus-visible .shop-glow { opacity: 1; }
.gate-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 1; pointer-events: none; }
.gate-drawn { position: absolute; inset: 0; }
.gate-roofs { position: absolute; left: 14%; right: 14%; top: 34%; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; }
.gate-roofs i { position: relative; width: 28%; border-radius: calc(0.8 * var(--u)) calc(0.8 * var(--u)) 0 0; background: var(--w-board); }
.gate-roofs i::before { content: ''; position: absolute; left: -12%; right: -12%; top: calc(-5 * var(--u)); height: calc(5.4 * var(--u)); background: color-mix(in srgb, var(--sec) 75%, #FFFFFF); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.gate-roofs i:nth-child(1) { height: 52%; } .gate-roofs i:nth-child(2) { height: 66%; } .gate-roofs i:nth-child(3) { height: 44%; }
.gate-pillar { position: absolute; bottom: 0; width: 17%; height: 78%; border: calc(0.9 * var(--u)) solid var(--sec); border-bottom: 0; border-radius: calc(1.2 * var(--u)) calc(1.2 * var(--u)) 0 0; background: linear-gradient(90deg, #FFFFFF, #E8E2D6); }
.gate-pillar.left { left: 0; }
.gate-pillar.right { right: 0; }
.gate-arch {
  position: absolute; z-index: 2; left: -4%; right: -4%; top: 4%; height: 30%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; container-type: size;
  border-radius: 999px 999px calc(2 * var(--u)) calc(2 * var(--u)); background: var(--sec); color: var(--plank-ink);
  box-shadow: 0 calc(1 * var(--u)) 0 rgba(0, 0, 0, 0.15); font-weight: 800; line-height: 1.05; text-align: center;
}
.gate-arch b { font-size: max(18px, min(30cqh, 15cqw)); }
.gate-arch small { font-size: max(18px, min(16cqh, 9cqw)); font-weight: 700; opacity: 0.9; }
/* A small arch (a phone) keeps the district's name; its game count is on the
   banner that shows when the gate is tapped. */
@container (max-height: 64px) { .gate-arch small { display: none; } }
.district-gate.has-art .gate-arch { background: none; box-shadow: none; border-radius: 0; color: var(--w-ink); }
.gate-icon {
  position: absolute; z-index: 3; left: 50%; top: calc(-4 * var(--u)); width: calc(11 * var(--u)); aspect-ratio: 1; transform: translateX(-50%);
  display: grid; place-items: center; border-radius: 50%; background: #FFFFFF; border: calc(0.8 * var(--u)) solid var(--sec);
}
.gate-icon img { width: 74%; height: 74%; object-fit: contain; }
.district-gate .shop-flag { top: calc(2 * var(--u)); right: -6%; }

/* Inside a district (street.js district): the shops stand along a winding
   path on grass, --across in a row and --rows rows, sized from the screen's
   width so they are big, the map as tall as its rows need; a long district
   scrolls down. */
.district-view { --grass: #9ADB7C; --grass-2: #86CC68; --path: #F2DDAE; --path-edge: #CDAF78; }
.district-scroll {
  position: absolute; inset: 0; padding-top: var(--top-h); overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
  container-type: size;
  /* Its shops' and life's depths stay inside it, so the bar (and Look) is always on top. */
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 30%, var(--grass-2) 0 5%, transparent 5.5%),
    radial-gradient(circle at 88% 70%, var(--grass-2) 0 7%, transparent 7.5%),
    radial-gradient(circle at 55% 90%, var(--grass-2) 0 4%, transparent 4.5%),
    linear-gradient(color-mix(in srgb, var(--sec) 30%, var(--grass)), var(--grass) 30%);
}
.district-map {
  position: relative; margin: 0 auto; width: min(100%, 1500px); overflow-x: clip;
  /* A shop's height: nearly its column's width (--across in a row, street.js
     districtAcross), never more than about half the screen under the bar;
     the map is as tall as its rows need and scrolls down. */
  --col: calc(min(100cqw, 1500px) * 0.84 / var(--across, 3));
  --shop-h: min(calc(var(--col) * 1.1), 55cqh);
  --u: calc(var(--shop-h) / 56);
  height: max(100%, calc(var(--rows) * var(--shop-h) * 1.6));
}
.district-ground { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The road stands a little off the grass: a soft shadow under its kerb, a
   light top, and a line of round stepping stones; once road-district is
   made (street.js district) it is paved with it. */
.district-path {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(0 calc(1.2 * var(--u)) calc(1 * var(--u)) rgba(38, 48, 82, 0.22));
}
.district-path path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.district-path .path-edge { stroke: var(--path-edge); stroke-width: calc(9 * var(--u)); }
.district-path .path-top { stroke: var(--path); stroke-width: calc(7 * var(--u)); }
.district-path .path-dash { stroke: rgba(255, 255, 255, 0.7); stroke-width: calc(1.4 * var(--u)); stroke-dasharray: 0 calc(4 * var(--u)); }
.district-path.paved .path-dash { stroke: rgba(255, 255, 255, 0.35); }
.district-path .path-centre { stroke: none; }
.district-map .shop { position: absolute; z-index: var(--z, 1); height: var(--shop-h); margin: 0; transform: translate(-50%, -100%); }
.district-map .shop:focus-visible { z-index: 2000; transform: translate(-50%, -100%) translateY(calc(-1.8 * var(--u))); }
@media (hover: hover) { .district-map .shop:hover { z-index: 2000; transform: translate(-50%, -100%) translateY(calc(-1.8 * var(--u))); } }
.district-map .shop:active { transform: translate(-50%, -100%); }

/* The district's landmark (deco-<section>) in the last row's empty place,
   twinkling now and then. */
.district-deco {
  position: absolute; height: calc(var(--shop-h) * 0.85); aspect-ratio: var(--ar); transform: translate(-50%, -100%); pointer-events: none;
}
.district-deco img { width: 100%; height: 100%; display: block; animation: deco-glow 5s ease-in-out infinite; }
@keyframes deco-glow { 0%, 80%, 100% { filter: none; } 90% { filter: brightness(1.12) drop-shadow(0 0 calc(2 * var(--u)) rgba(255, 236, 160, 0.9)); } }

/* The district's life (street.js life): each sprite is a point at its feet,
   moved over the map (and turned with the road, about its feet); its body
   stands on that point, a car a little lower on the road, turned round at
   once (no flip in the air) when it goes the other way its picture faces,
   with a soft shadow under it. A picture bobs as it goes; a video has its
   own movement. Nothing here takes a tap. */
.life-sprite { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform; }
/* Shown once they stand in their places (street.js life, .life-on). */
:not(.life-on) > .life-sprite { visibility: hidden; }
.life-body {
  --lane: 0; position: absolute; left: 0; top: 0; height: var(--life-h); aspect-ratio: var(--ar);
  transform: translate(-50%, calc(-100% + var(--lane) * var(--u)));
}
.life-body.turned { transform: translate(-50%, calc(-100% + var(--lane) * var(--u))) scaleX(-1); }
/* A car turning round on a bend: its body narrows for a moment, as a car
   seen turning towards us does, and is the other way round after. */
.life-body.turning { animation: life-turn 0.3s ease-in-out; }
@keyframes life-turn { 50% { scale: 0.3 1; } }
.life-body::after {
  content: ''; position: absolute; left: 15%; right: 15%; bottom: -4%; height: 12%; z-index: -1;
  border-radius: 50%; background: radial-gradient(rgba(38, 48, 82, 0.3), transparent 70%);
}
.life-art { width: 100%; height: 100%; display: block; object-fit: contain; transform-origin: 50% 100%; }
.life-car { --life-h: calc(15 * var(--u) * var(--life-k, 1)); }
.life-car .life-body { --lane: 1.5; }
.life-car img.life-art { animation: life-bump 0.5s ease-in-out infinite; }
.life-walker { --life-h: calc(17 * var(--u) * var(--life-k, 1)); }
.life-walker img.life-art { animation: life-walk 0.6s ease-in-out infinite; }
.life-animal { --life-h: calc(11 * var(--u) * var(--life-k, 1)); }
.life-animal img.life-art { animation: life-hop 0.7s ease-in-out infinite; }
.life-sprite.still .life-art { animation-play-state: paused; }
@keyframes life-walk { 50% { transform: translateY(calc(-0.8 * var(--u))) rotate(1.5deg); } }
@keyframes life-hop { 50% { transform: translateY(calc(-1.6 * var(--u))) scaleY(1.04); } }
@keyframes life-bump { 50% { transform: translateY(calc(-0.35 * var(--u))); } }
@media (prefers-reduced-motion: reduce) {
  .district-deco img, .life-art, .life-body.turning { animation: none; }
}

.street-prop { position: relative; z-index: 1; flex: none; height: calc(30 * var(--u)); margin-bottom: -calc(2 * var(--u)); }
.street-prop img { height: 100%; width: auto; display: block; }
.street-prop.prop-lamp { height: calc(50 * var(--u)); }
.street-prop.prop-bench, .street-prop.prop-planter { height: calc(13 * var(--u)); }
.street-prop.prop-postbox { height: calc(20 * var(--u)); }
.street-prop.prop-tree:not(.has-art) { width: calc(14 * var(--u)); }
.street-prop.prop-tree:not(.has-art)::before { content: ''; position: absolute; left: 50%; bottom: 0; width: calc(2.4 * var(--u)); height: calc(14 * var(--u)); transform: translateX(-50%); background: #8A5A2B; border-radius: calc(1 * var(--u)); }
.street-prop.prop-tree:not(.has-art)::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(19 * var(--u)); border-radius: 50%; background: #5CB85C; box-shadow: inset -calc(1.6 * var(--u)) -calc(1.6 * var(--u)) 0 rgba(0, 0, 0, 0.1); }
.street-prop.prop-lamp:not(.has-art) { width: calc(6 * var(--u)); }
.street-prop.prop-lamp:not(.has-art)::before { content: ''; position: absolute; left: 50%; bottom: 0; top: calc(5 * var(--u)); width: calc(1.2 * var(--u)); transform: translateX(-50%); background: #3D5A6C; border-radius: calc(1 * var(--u)); }
.street-prop.prop-lamp:not(.has-art)::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(6 * var(--u)); border-radius: 50%; background: #FFE9A3; box-shadow: 0 0 calc(3 * var(--u)) #FFE14D; }

/* The bus drives along the road to the shop you are on. */
.street-bus {
  position: absolute; z-index: 2; left: 0; bottom: calc(1 * var(--u)); height: calc(14 * var(--u)); aspect-ratio: var(--ar, 100 / 46);
  transform: translateX(-50%); transition: left 0.6s cubic-bezier(0.5, 0, 0.3, 1); pointer-events: none;
}
/* Placed without driving when the street opens. */
.street-bus.parked { transition: none; }
.street-bus-art, .street-bus-drawn { width: 100%; height: 100%; display: block; }
.street-bus-art { object-fit: contain; }
.street-bus-sign { position: absolute; display: grid; place-items: center; container-type: size; overflow: hidden; color: var(--w-ink); font-weight: 800; line-height: 1; white-space: nowrap; }
/* Sized from the sign's own box, like a shop's name. */
.street-bus-sign > span { font-size: min(78cqh, 13cqw); }
.bus-body { fill: #FFD43B; stroke: var(--w-ink); stroke-width: 2.2; }
.bus-glass { fill: var(--w-sky-low); stroke: var(--w-ink); stroke-width: 1.4; }
.bus-panel { fill: #FFFFFF; opacity: 0.7; }
.bus-wheel { fill: var(--w-ink); }

/* The bus in layers (street.js layeredBus): a little bigger, rocking on its
   springs, the animals bobbing in the windows and taking turns to jump, the
   wheels turning and smoke puffing while it drives. Only transform and
   opacity move, which a TV stick draws cheaply. */
.street-bus.layered { height: calc(21 * var(--u)); }
.bus-shadow {
  position: absolute; left: 6%; right: 6%; bottom: -3%; height: 9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 24, 40, 0.38), rgba(20, 24, 40, 0));
}
.bus-bob { position: absolute; inset: 0; transform-origin: 50% 100%; animation: bus-idle 1.1s ease-in-out infinite; }
.bus-bob > .bus-body { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.street-bus.driving .bus-bob { animation: bus-drive 0.34s ease-in-out infinite; }
@keyframes bus-idle { 50% { transform: translateY(-1%); } }
@keyframes bus-drive { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-3.5%) rotate(-0.8deg); } 65% { transform: translateY(-1.5%) rotate(0.6deg); } }
/* The inside of the bus, seen through a window behind its animal. */
.bus-window { position: absolute; overflow: hidden; border-radius: 18%; background: linear-gradient(#CDEEFF, #FFF3D6 70%, #F2C57E); }
.bus-rider {
  position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 100%;
  animation: bus-rider 4.8s ease-in-out infinite; animation-delay: calc(var(--i) * 1.2s - 4.8s);
}
@keyframes bus-rider {
  0%, 60%, 100% { transform: translateY(2%) rotate(0); }
  15% { transform: translateY(4%) rotate(-4deg); }
  35% { transform: translateY(2%) rotate(0); }
  48% { transform: translateY(4%) rotate(4deg); }
  66% { transform: translateY(9%) scale(1.08, 0.88); }
  76% { transform: translateY(-24%) rotate(-6deg) scale(0.94, 1.08); }
  82% { transform: translateY(-25%) rotate(6deg) scale(0.94, 1.08); }
  90% { transform: translateY(8%) scale(1.08, 0.9); }
  95% { transform: translateY(1%); }
}
/* Driving, everyone bounces in their seat. */
.street-bus.driving .bus-rider { animation: bus-ride 0.34s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.12s); }
@keyframes bus-ride { from { transform: translateY(5%) rotate(-3deg); } to { transform: translateY(-8%) rotate(3deg); } }
.bus-wheel { position: absolute; }
.bus-wheel > img { width: 100%; height: 100%; display: block; animation: bus-wheel 0.5s linear infinite paused; }
.street-bus.driving .bus-wheel > img { animation-play-state: running; }
.street-bus.back .bus-wheel > img { animation-direction: reverse; }
@keyframes bus-wheel { to { transform: rotate(360deg); } }
/* Smoke from the exhaust at the back. */
.bus-puffs { position: absolute; left: -1%; bottom: 12%; width: 11%; aspect-ratio: 1; }
.bus-puffs > i {
  position: absolute; inset: 0; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 35%, #FFFFFF, #C3CAD6 75%); box-shadow: 0 0 0 1px rgba(38, 48, 82, 0.15);
  animation: bus-puff 2.4s ease-out infinite;
}
.bus-puffs > i:nth-child(2) { animation-delay: 0.8s; }
.bus-puffs > i:nth-child(3) { animation-delay: 1.6s; }
.street-bus.driving .bus-puffs > i { animation-duration: 0.9s; }
.street-bus.back .bus-puffs { display: none; }
@keyframes bus-puff {
  0% { transform: translate(0, 0) scale(0.3); opacity: 0; }
  15% { opacity: 0.95; }
  100% { transform: translate(-140%, -120%) scale(1.3); opacity: 0; }
}

/* The banner over the street names the shop you are on, with what to do,
   in letters big enough to read across a living room. */
.street-banner {
  position: absolute; z-index: 4; left: 50%; top: calc(var(--top-h) + 1cqh); transform: translate(-50%, -1cqh);
  max-width: min(90%, 1100px); padding: 1.2cqh 4.4cqh 1.4cqh; font-size: clamp(14px, 2.4cqh, 26px);
  text-align: center; pointer-events: none;
  opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
}
/* Its two ropes, up to the bar. */
.street-banner::before, .street-banner::after {
  content: ''; position: absolute; bottom: calc(100% + max(3px, 0.35em)); width: 0.5em; height: 3cqh; border-radius: 0.3em;
  background: repeating-linear-gradient(160deg, var(--w-rope) 0 0.35em, color-mix(in srgb, var(--w-rope) 65%, var(--w-wood-dark)) 0.35em 0.7em);
}
.street-banner::before { left: 14%; }
.street-banner::after { right: 14%; }
.street-banner.on { opacity: 1; transform: translate(-50%, 0); }
.street-banner b { display: block; font-size: clamp(22px, 6cqh, 60px); line-height: 1.05; }
.street-banner span { display: block; margin-top: 0.4cqh; font-size: clamp(18px, 2.8cqh, 28px); font-weight: 700; color: var(--w-paint); opacity: 0.92; }

/* The bar over the sky: back, title, who is playing on the left; Look, the trophy shelf, the night's end and the sound, music and
   full screen buttons on the right; the chips under it. Every button stays
   on screen at every size: where room runs short the words go and the
   icons stay (each keeps its name for screen readers). */
.street-top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; flex-direction: column; gap: clamp(6px, 1.2vh, 12px);
  padding: clamp(8px, 1.6vh, 16px) max(var(--gutter), env(safe-area-inset-right)) clamp(6px, 1.2vh, 12px) max(var(--gutter), env(safe-area-inset-left));
  background: linear-gradient(color-mix(in srgb, var(--card) 88%, transparent), color-mix(in srgb, var(--card) 55%, transparent));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(20, 30, 70, 0.12);
}
/* One line at every width: the bar measures itself (a container), and as it
   narrows the words go, then the title, then the sound and screen buttons
   fold behind ⋯. The title shrinks last-resort, so nothing ever overlaps. */
.games-bar { position: relative; container-type: inline-size; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
.bar-start, .bar-end { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.bar-start { flex: 1 1 auto; }
.bar-end { flex: 0 0 auto; margin-left: auto; justify-content: flex-end; }
.bar-start > *, .bar-end > * { flex-shrink: 0; }
.bar-title { font-size: clamp(22px, min(2.6vw, 4vh), 40px); white-space: nowrap; margin-right: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.games-bar .bar-start > .bar-title, .games-bar .bar-start > .tonight-line { flex-shrink: 1; }
.bar-tools { display: flex; gap: 8px; }
.bar-tools > .fullscreen, .bar-tools > .music-toggle { position: static; }
/* The bar's toy coin buttons (world.js coinButton): a size smaller than a
   screen's, the words always there; short words, then tiles, as room runs out. */
.games-bar .w-coin-btn { min-height: 56px; font-size: var(--w-text-s); }
.games-bar .w-coin-btn.bare { width: 56px; }
.games-bar .tonight-line { margin: 0; align-self: center; background: var(--card); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.games-bar .w-coin-btn.bar-more { display: none; }
.games-bar .look-panel {
  position: absolute; z-index: 6; top: calc(100% + 8px); right: 0; width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 120px); overflow-y: auto;
}

/* Tablets and small laptops: the short words. */
@container (max-width: 1400px) {
  .bar-end .w-coin-btn .w-words { display: none; }
  .bar-end .w-coin-btn .w-short { display: inline; }
}
/* Phones upright: the title kept for screen readers only; the buttons drop
   to a row of tiles under Back, and sound, music, cast and full screen fold
   behind ⋯. */
@container (max-width: 760px) {
  .bar-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tonight-line { display: none; }
  .games-bar { flex-wrap: wrap; row-gap: 4px; }
  .games-bar .bar-end {
    flex: 1 1 100%; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; align-items: end;
  }
  .bar-end .w-coin-btn:not(.bare) {
    flex-direction: column; justify-content: center; gap: 4px; width: 100%; min-width: 0;
    min-height: 72px; margin: 18px 0 0; padding: 0 0 8px; border-radius: var(--w-radius-s);
  }
  .bar-end .w-coin-btn:not(.bare) .w-coin { width: 38px; height: 38px; margin: -20px 0 0; }
  .bar-end .w-coin-btn .w-short { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  /* ⋯ waits up beside Back, so the four tiles share the whole row. */
  .games-bar .w-coin-btn.bar-more { display: inline-flex; position: absolute; top: 0; right: 0; }
  .bar-tools {
    display: none; position: absolute; z-index: 6; top: calc(100% + 8px); right: 0;
    padding: 8px; border-radius: var(--w-radius-s); background: var(--card); box-shadow: 0 6px 20px rgba(20, 30, 70, 0.2);
  }
  .bar-more[aria-expanded='true'] ~ .bar-tools { display: flex; }
}
/* The smallest phones: the tiles a touch tighter. */
@container (max-width: 340px) {
  .games-bar .bar-end { gap: 4px; }
  .bar-end .w-coin-btn:not(.bare) { font-size: 16px; }
}
/* Short screens (a phone on its side): one row, short words. */
@media (max-height: 560px) {
  .street-top { gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .bar-title, .games-bar .tonight-line { display: none; }
  .games-bar .w-coin-btn { min-height: 52px; font-size: 18px; }
  .games-bar .w-coin-btn.bare { width: 52px; }
  .bar-end .w-coin-btn .w-words { display: none; }
  .bar-end .w-coin-btn .w-short { display: inline; }
  .bar-tools .corner-btn, .bar-tools > .fullscreen, .bar-tools > .music-toggle { width: 48px; height: 48px; }
  /* One row, not tiles, even where the bar is narrow: height is short here. */
  .games-bar { flex-wrap: nowrap; }
  .games-bar .bar-end { flex: 0 0 auto; margin-left: auto; display: flex; gap: 8px; }
  .bar-end .w-coin-btn:not(.bare) {
    flex-direction: row; width: auto; min-height: 52px; margin: 0 0 0 0.7em; padding: 0 0.8em 0 0.35em; border-radius: 999px;
  }
  .bar-end .w-coin-btn:not(.bare) .w-coin { width: 1.95em; height: 1.95em; margin: 0 0 0 -0.95em; }
  /* The sound, music, cast and full screen buttons fold behind ⋯ here too. */
  .games-bar .w-coin-btn.bar-more { display: inline-flex; position: static; }
  .bar-tools {
    display: none; position: absolute; z-index: 6; top: calc(100% + 8px); right: 0;
    padding: 8px; border-radius: var(--w-radius-s); background: var(--card); box-shadow: 0 6px 20px rgba(20, 30, 70, 0.2);
  }
  .bar-more[aria-expanded='true'] ~ .bar-tools { display: flex; }
}
/* The shortest screens (most phones on their side): the buttons a little
   smaller and no strip behind them, so the town shows to the top. */
@media (max-height: 460px) {
  .street-top { padding-top: 4px; padding-bottom: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
  .games-bar .w-coin-btn, .bar-end .w-coin-btn:not(.bare) { min-height: 46px; font-size: 16px; }
  .games-bar .w-coin-btn.bare { width: 46px; }
}

/* Game thumbnails: a looping scene on each card that acts out the game
   (src/ui/thumbnails.js). Each scene loops every --th; without animation
   (reduced motion) the resting pose below still explains the game. */
.thumb { --th: 6s; display: block; width: 100%; height: 100%; overflow: visible; font-weight: 800; }
.thumb * { animation-duration: var(--th); animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.thumb text { font-family: inherit; }

/* The admin's own picture for a game fills the stage instead. */
.game-art.has-photo { padding: 0; overflow: hidden; }
.game-art .game-photo { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Shared pieces */
.th-tile { fill: var(--tile); }
.th-edge { stroke: var(--border); stroke-width: 1.5; }
.th-none { fill: none; }
.th-ink { fill: var(--ink); }
.th-on-ink { fill: var(--on-ink); }
.th-ink-text { fill: var(--navy); }
.th-muted { fill: var(--muted); }
.th-dash { fill: none; stroke: var(--dash); stroke-width: 2; stroke-dasharray: 5 4; }
.th-ring { fill: none; stroke: var(--good); stroke-width: 3; }
.th-good-fill { fill: var(--good); }
.th-on-good { fill: #FFFFFF; }
.th-good-edge { stroke: var(--good); stroke-width: 2.5; }
.th-bad-fill { fill: var(--bad); }
.th-gold { fill: var(--w-sun); stroke: #B5861A; stroke-width: 1; stroke-linejoin: round; }
.th-sec { fill: var(--sec); }
.th-on-sec { fill: #FFFFFF; }
.th-line { fill: var(--dash); }
.th-track { fill: var(--stage-line); }
.th-stage-fill { fill: var(--stage); }
.th-flood { flood-color: var(--navy); }
.th-chk-dark { fill: var(--w-ink); }
.th-chk-light { fill: #FFFFFF; }
.th-lens { fill: color-mix(in srgb, var(--tile) 55%, transparent); stroke: var(--ink); stroke-width: 2.5; }
.th-handle { stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.th-arrow { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.th-check circle { fill: var(--good); }
.th-cross circle { fill: var(--bad); }
.th-check path, .th-cross path { fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.th-bubble > path:first-child { fill: var(--tile); stroke: var(--border); stroke-width: 1.5; stroke-linejoin: round; }
.th-no { fill: none; stroke: var(--bad); stroke-width: 3; stroke-linecap: round; }
.th-tag { fill: #FFE08A; stroke: #B5861A; stroke-width: 1.5; stroke-linejoin: round; }
.th-coin { stroke-width: 2; }
.th-coin.silver { fill: #D3DAE6; stroke: #8892A8; }
.th-coin.copper { fill: #DD9763; stroke: #9C5A2E; }
.th-coin-text { fill: #2B2F45; }
.th-note ellipse { fill: var(--sec); }
.th-note path { fill: none; stroke: var(--sec); stroke-width: 1.8; stroke-linecap: round; }
.th-pause { stroke: #FFFFFF; stroke-width: 3; stroke-linecap: round; }
.th-ice { fill: rgba(120, 200, 255, 0.16); stroke: #5BC0EB; stroke-width: 2; stroke-dasharray: 6 4; }
.th-flake { fill: none; stroke: #5BC0EB; stroke-width: 3; stroke-linecap: round; }
.th-pole { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.th-ground { stroke: var(--stage-line); stroke-width: 2.5; stroke-linecap: round; }
.th-lane { stroke: var(--stage-line); stroke-width: 2; stroke-dasharray: 6 5; }
.th-lamp { fill: #2B2F45; }
.th-lamp-g { fill: #2FD07F; }
.th-lamp-y { fill: #FFC83D; }
.th-lamp-r { fill: #F2554B; }
.th-lamp-g.dim, .th-lamp-y.dim, .th-lamp-r.dim { opacity: 0.22; }
.th-screen { fill: var(--w-ink); }
.th-pointer { fill: var(--bad); stroke: var(--ink); stroke-width: 1; }
.th-seg { stroke: var(--tile); stroke-width: 1.5; }
.th-seg.s0 { fill: #A5E08A; }
.th-seg.s1 { fill: #9DD1FF; }
.th-seg.s2 { fill: #FFB9C9; }
.th-seg.s3 { fill: #FFE08A; }
.th-story { fill: none; stroke: var(--sec); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
/* The game's tin cup: plum enamel, a gold ring, rim and base. */
.th-cup > path:first-child { fill: #6B2D8C; stroke: #39406A; stroke-width: 1.5; stroke-linejoin: round; }
.th-cup .band { fill: none; stroke: #F2B53A; stroke-width: 1.5; }
.th-cup .lip, .th-cup .base { fill: none; stroke: #F2B53A; stroke-linecap: round; }
.th-cup .lip { stroke-width: 4; }
.th-cup .base { stroke-width: 2.5; }

/* The stick person: arms turn at the shoulder, legs at the hip. */
.th-fig { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.th-fig .head { fill: var(--tile); }
.th-fig.th-fig-alt { stroke: var(--sec); }
.th-fig.th-fig-screen { stroke: #FFFFFF; }
.th-fig.th-fig-screen .head { fill: var(--w-ink); }
.th-fig .trunk { stroke-width: 3; }
.th-fig .arm { transform-origin: 0 -28px; }
.th-fig .leg { transform-origin: 0 -14px; }

/* Pieces that turn or pop around their own middle. */
.sh-col, .wm-gone, .oo-taxi, .tq-back, .tq-front, .mp-back, .mp-front, .wa-back, .wa-front, .gn-ok, .gn-secret, .gn-open,
.gn-win, .gw-fly, .ch-ans, .ch-ok, .ch-q, .sd-die, .fd-pause, .ss-ok, .ar-win, .ar-ok, .am-frog, .mc-tag {
  transform-box: fill-box; transform-origin: center;
}

/* Shadow: two guesses, the right one is picked, then the colour comes in. */
.sh-col { opacity: 0; animation-name: th-sh-col; }
.sh-pick { animation-name: th-sh-pick; }
@keyframes th-sh-pick {
  0%, 8% { opacity: 0; transform: translateY(-38px); }
  14%, 34% { opacity: 1; transform: translateY(-38px); }
  44%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes th-sh-col { 0%, 50% { opacity: 0; } 62%, 92% { opacity: 1; } 100% { opacity: 0; } }

/* What's Missing: lights out, one picture is gone. */
.wm-cur { transform-origin: 0 6px; transform: scaleY(0); animation-name: th-wm-cur; }
.wm-gone { opacity: 0; animation-name: th-wm-gone; }
.wm-slot { animation-name: th-wm-slot; }
@keyframes th-wm-cur { 0%, 20% { transform: scaleY(0); } 28%, 36% { transform: scaleY(1); } 44%, 100% { transform: scaleY(0); } }
@keyframes th-wm-gone {
  0%, 30% { opacity: 1; transform: none; }
  32%, 82% { opacity: 0; transform: scale(0.6); }
  90% { opacity: 1; transform: scale(1.15); }
  96%, 100% { opacity: 1; transform: none; }
}
@keyframes th-wm-slot { 0%, 32% { opacity: 0; } 40%, 82% { opacity: 1; } 88%, 100% { opacity: 0; } }

/* Odd One Out: look at each, then circle the taxi. */
.oo-fruit { animation-name: th-oo-look; }
.oo-1 { animation-name: th-oo-look1; }
.oo-2 { animation-name: th-oo-look2; }
.oo-taxi { animation-name: th-oo-taxi; }
.oo-ring { stroke-dasharray: 100; stroke-dashoffset: 0; animation-name: th-oo-ring; }
@keyframes th-oo-look { 0%, 4%, 14%, 100% { transform: none; opacity: 1; } 9% { transform: translateY(-6px); } 50%, 90% { opacity: 0.45; } }
@keyframes th-oo-look1 { 0%, 14%, 24%, 100% { transform: none; opacity: 1; } 19% { transform: translateY(-6px); } 50%, 90% { opacity: 0.45; } }
@keyframes th-oo-look2 { 0%, 24%, 34%, 100% { transform: none; opacity: 1; } 29% { transform: translateY(-6px); } 50%, 90% { opacity: 0.45; } }
@keyframes th-oo-taxi {
  0%, 34%, 44%, 66%, 100% { transform: none; }
  39% { transform: translateY(-6px); }
  50% { transform: rotate(-9deg) scale(1.08); }
  56% { transform: rotate(9deg) scale(1.08); }
  61% { transform: rotate(-5deg) scale(1.04); }
}
@keyframes th-oo-ring { 0%, 42% { stroke-dashoffset: 100; opacity: 1; } 56%, 90% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* Twenty Questions: yes, no, yes... then the card turns over. */
.tq-q { animation-name: th-tq-q0; }
.tq-q1 { animation-name: th-tq-q1; }
.tq-q2 { animation-name: th-tq-q2; }
.tq-back { animation-name: th-tq-back; }
.tq-front { transform: scaleX(0); animation-name: th-tq-front; }
@keyframes th-tq-q0 { 0%, 4% { opacity: 0; transform: translateX(-8px); } 10%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes th-tq-q1 { 0%, 20% { opacity: 0; transform: translateX(-8px); } 26%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes th-tq-q2 { 0%, 36% { opacity: 0; transform: translateX(-8px); } 42%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes th-tq-back { 0%, 56% { transform: none; } 61%, 93% { transform: scaleX(0); } 98%, 100% { transform: none; } }
@keyframes th-tq-front { 0%, 61% { transform: scaleX(0); } 66%, 88% { transform: none; } 93%, 100% { transform: scaleX(0); } }

/* Zoom: a close-up pulls back; the points run down with the clock. */
.zm-img { transform-origin: 81px 27px; transform: scale(3.2); animation-name: th-zm-img; }
.zm-bar { transform-origin: 30px 0; animation-name: th-zm-bar; }
@keyframes th-zm-img { 0%, 12% { transform: scale(3.2); } 70%, 92% { transform: none; } 100% { transform: scale(3.2); } }
@keyframes th-zm-bar { 0%, 12% { transform: none; } 70%, 92% { transform: scaleX(0.3); } 100% { transform: none; } }

/* Memory Pairs: card 2, card 4, a match! */
.mp-2 .mp-back, .mp-4 .mp-back { transform: scaleX(0); }
.mp-2 .mp-back { animation-name: th-mp-back-a; }
.mp-2 .mp-front { animation-name: th-mp-front-a; }
.mp-4 .mp-back { animation-name: th-mp-back-b; }
.mp-4 .mp-front { animation-name: th-mp-front-b; }
.mp-front .th-good-edge { animation-name: th-mp-glow; }
@keyframes th-mp-back-a { 0%, 8% { transform: none; } 12%, 86% { transform: scaleX(0); } 90%, 100% { transform: none; } }
@keyframes th-mp-front-a { 0%, 12% { transform: scaleX(0); } 16%, 82% { transform: none; } 86%, 100% { transform: scaleX(0); } }
@keyframes th-mp-back-b { 0%, 28% { transform: none; } 32%, 86% { transform: scaleX(0); } 90%, 100% { transform: none; } }
@keyframes th-mp-front-b { 0%, 32% { transform: scaleX(0); } 36%, 82% { transform: none; } 86%, 100% { transform: scaleX(0); } }
@keyframes th-mp-glow { 0%, 40% { stroke-width: 1.5; stroke: var(--border); } 46%, 80% { stroke-width: 3.5; stroke: var(--good); } 86%, 100% { stroke-width: 1.5; stroke: var(--border); } }

/* Who Am I: the magnifier reads each clue, then the card turns over. */
.wa-clue { transform-origin: 70px 0; animation-name: th-wa-c0; }
.wa-c1 { animation-name: th-wa-c1; }
.wa-c2 { animation-name: th-wa-c2; }
.wa-glass { transform: translate(146px, 72px); animation-name: th-wa-glass; }
.wa-back { animation-name: th-wa-back; }
.wa-front { transform: scaleX(0); animation-name: th-wa-front; }
@keyframes th-wa-c0 { 0%, 4% { opacity: 0; transform: scaleX(0.2); } 12%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes th-wa-c1 { 0%, 20% { opacity: 0; transform: scaleX(0.2); } 28%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes th-wa-c2 { 0%, 36% { opacity: 0; transform: scaleX(0.2); } 44%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes th-wa-glass {
  0% { transform: translate(90px, 26px); opacity: 0; }
  4% { transform: translate(90px, 26px); opacity: 1; }
  14% { transform: translate(150px, 26px); }
  20% { transform: translate(90px, 49px); }
  30% { transform: translate(138px, 49px); }
  36% { transform: translate(90px, 72px); }
  46%, 52% { transform: translate(146px, 72px); opacity: 1; }
  56%, 100% { transform: translate(146px, 72px); opacity: 0; }
}
@keyframes th-wa-back { 0%, 52% { transform: none; } 57%, 93% { transform: scaleX(0); } 98%, 100% { transform: none; } }
@keyframes th-wa-front { 0%, 57% { transform: scaleX(0); } 62%, 88% { transform: none; } 93%, 100% { transform: scaleX(0); } }

/* Guess the Number: 3, higher! 9, lower! 7, got it. */
.gn-n3, .gn-n9, .gn-up, .gn-down, .gn-secret { opacity: 0; }
.gn-n3 { animation-name: th-gn-n3; }
.gn-n9 { animation-name: th-gn-n9; }
.gn-n7 { animation-name: th-gn-n7; }
.gn-up { animation-name: th-gn-up; }
.gn-down { animation-name: th-gn-down; }
.gn-ok, .gn-win { animation-name: th-gn-ok; }
.gn-secret { animation-name: th-gn-secret; }
.gn-open { animation-name: th-gn-open; }
@keyframes th-gn-n3 { 0%, 26% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes th-gn-n9 { 0%, 28% { opacity: 0; } 32%, 56% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes th-gn-n7 { 0%, 58% { opacity: 0; } 62%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes th-gn-up { 0%, 8% { opacity: 0; transform: translateY(6px); } 14%, 26% { opacity: 1; transform: none; } 30%, 100% { opacity: 0; } }
@keyframes th-gn-down { 0%, 36% { opacity: 0; transform: translateY(-6px); } 42%, 56% { opacity: 1; transform: none; } 60%, 100% { opacity: 0; } }
@keyframes th-gn-ok { 0%, 64% { opacity: 0; transform: scale(0.5); } 70% { opacity: 1; transform: scale(1.12); } 74%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-gn-secret { 0%, 70% { opacity: 1; transform: none; } 74%, 94% { opacity: 0; transform: scaleX(0); } 100% { opacity: 1; transform: none; } }
@keyframes th-gn-open { 0%, 72% { opacity: 0; transform: scaleX(0); } 78%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Guess the Word: A P P L E fills in; a wrong Z sends the top scoop flying. */
.gw-l { animation-name: th-gw-l; }
.gw-l1, .gw-l2 { animation-name: th-gw-p; }
.gw-l3 { animation-name: th-gw-3; }
.gw-l4 { animation-name: th-gw-4; }
.gw-z { opacity: 0; animation-name: th-gw-z; }
.gw-fly { animation-name: th-gw-fly; }
@keyframes th-gw-l { 0%, 8% { opacity: 0; transform: translateY(-6px); } 14%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-gw-p { 0%, 22% { opacity: 0; transform: translateY(-6px); } 28%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-gw-3 { 0%, 60% { opacity: 0; transform: translateY(-6px); } 66%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-gw-4 { 0%, 72% { opacity: 0; transform: translateY(-6px); } 78%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-gw-z { 0%, 36% { opacity: 0; } 40%, 54% { opacity: 1; } 58%, 100% { opacity: 0; } }
@keyframes th-gw-fly {
  0%, 40% { opacity: 1; transform: none; } 52% { opacity: 1; transform: translate(26px, -22px) rotate(160deg); }
  58%, 96% { opacity: 0; transform: translate(40px, 4px) rotate(300deg); } 100% { opacity: 1; transform: none; }
}

/* Money Count: 10, 15, 17: that pays for the teddy. */
.mc-n0, .mc-n10, .mc-n15 { opacity: 0; }
.mc-c0 { animation-name: th-mc-c0; }
.mc-c1 { animation-name: th-mc-c1; }
.mc-c2 { animation-name: th-mc-c2; }
.mc-n0 { animation-name: th-mc-n0; }
.mc-n10 { animation-name: th-mc-n10; }
.mc-n15 { animation-name: th-mc-n15; }
.mc-n17, .mc-win { animation-name: th-mc-n17; }
.mc-tag { animation-name: th-mc-tag; }
@keyframes th-mc-c0 { 0%, 8% { opacity: 0; transform: translateY(-56px); } 18%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-mc-c1 { 0%, 26% { opacity: 0; transform: translateY(-56px); } 36%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-mc-c2 { 0%, 44% { opacity: 0; transform: translateY(-56px); } 54%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-mc-n0 { 0%, 17% { opacity: 1; } 18%, 100% { opacity: 0; } }
@keyframes th-mc-n10 { 0%, 17% { opacity: 0; } 18%, 35% { opacity: 1; } 36%, 100% { opacity: 0; } }
@keyframes th-mc-n15 { 0%, 35% { opacity: 0; } 36%, 53% { opacity: 1; } 54%, 100% { opacity: 0; } }
@keyframes th-mc-n17 { 0%, 53% { opacity: 0; } 54%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes th-mc-tag { 0%, 56%, 70%, 100% { transform: none; } 62% { transform: scale(1.15); } }

/* Charades: mime an elephant, no talking, until someone guesses. */
.ch-actor .arm.l { transform: rotate(120deg); }
.ch-actor .arm.r { transform: rotate(-30deg); }
.ch-actor { animation-name: th-ch-sway; animation-duration: 1.6s; }
.ch-trunk { transform-origin: 4px -37px; animation-name: th-ch-trunk; animation-duration: 1.6s; }
.ch-q { animation-name: th-ch-q; }
.ch-ans { animation-name: th-ch-ans; }
.ch-ok { animation-name: th-ch-ok; }
.ch-quiet { animation-name: th-ch-quiet; }
.ch-q { opacity: 0; }
@keyframes th-ch-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes th-ch-trunk { 0%, 100% { transform: rotate(-25deg); } 50% { transform: rotate(30deg); } }
@keyframes th-ch-q { 0%, 6% { opacity: 0; transform: scale(0.5); } 12%, 50% { opacity: 1; transform: none; } 54%, 100% { opacity: 0; } }
@keyframes th-ch-ans { 0%, 54% { opacity: 0; transform: scale(0.5); } 60% { opacity: 1; transform: scale(1.12); } 64%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-ch-ok { 0%, 62% { opacity: 0; transform: scale(0.4); } 68%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-ch-quiet { 0%, 100% { transform: none; } 20% { transform: translateY(-2px); } 40% { transform: none; } }

/* Story Dice: roll the dice, then one story runs through them. */
.sd-die { animation-name: th-sd-0; }
.sd-1 { animation-name: th-sd-1; }
.sd-2 { animation-name: th-sd-2; }
.sd-line { animation-name: th-sd-line; }
@keyframes th-sd-0 {
  0% { opacity: 0; transform: translateY(-60px) rotate(-220deg); }
  12% { opacity: 1; transform: translateY(3px) rotate(8deg); }
  16%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes th-sd-1 {
  0%, 8% { opacity: 0; transform: translateY(-60px) rotate(220deg); }
  20% { opacity: 1; transform: translateY(3px) rotate(-8deg); }
  24%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes th-sd-2 {
  0%, 16% { opacity: 0; transform: translateY(-60px) rotate(-220deg); }
  28% { opacity: 1; transform: translateY(3px) rotate(8deg); }
  32%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes th-sd-line { 0%, 36% { stroke-dashoffset: 100; opacity: 1; } 70%, 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* Freeze Dance: dance while the music plays; it stops: freeze! */
.fd-note { opacity: 0; animation-name: th-fd-note0; }
.fd-n1 { animation-name: th-fd-note1; }
.fd-n2 { animation-name: th-fd-note2; }
.fd-pause { animation-name: th-fd-pause; }
.fd-ice { animation-name: th-fd-ice; }
.fd-fig .arm.l { transform: rotate(100deg); animation-name: th-fd-l; }
.fd-fig .arm.r { transform: rotate(-20deg); animation-name: th-fd-r; }
.fd-fig .leg.l { animation-name: th-fd-leg; }
.fd-body { animation-name: th-fd-bob; }
.fd-fig { animation-name: th-fd-cold; }
@keyframes th-fd-note0 { 0% { opacity: 0; transform: none; } 4% { opacity: 1; } 22% { opacity: 0; transform: translate(10px, -24px); } 100% { opacity: 0; } }
@keyframes th-fd-note1 { 0%, 14% { opacity: 0; transform: none; } 18% { opacity: 1; } 36% { opacity: 0; transform: translate(14px, -20px); } 100% { opacity: 0; } }
@keyframes th-fd-note2 { 0%, 28% { opacity: 0; transform: none; } 32% { opacity: 1; } 50% { opacity: 0; transform: translate(6px, -22px); } 100% { opacity: 0; } }
@keyframes th-fd-pause { 0%, 54% { opacity: 0; transform: scale(0.5); } 60%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-fd-ice { 0%, 58% { opacity: 0; } 64%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes th-fd-l {
  0%, 18%, 36% { transform: rotate(100deg); } 9%, 27%, 45% { transform: rotate(20deg); }
  54%, 100% { transform: rotate(100deg); }
}
@keyframes th-fd-r {
  0%, 18%, 36% { transform: rotate(-20deg); } 9%, 27%, 45% { transform: rotate(-100deg); }
  54%, 100% { transform: rotate(-20deg); }
}
@keyframes th-fd-leg { 0%, 18%, 36%, 54%, 100% { transform: none; } 9%, 27%, 45% { transform: rotate(25deg); } }
@keyframes th-fd-bob { 0%, 9%, 18%, 27%, 36%, 45%, 54%, 100% { transform: none; } 4.5%, 13.5%, 22.5%, 31.5%, 40.5%, 49.5% { transform: translateY(-4px); } }
@keyframes th-fd-cold { 0%, 58% { stroke: var(--ink); } 64%, 94% { stroke: #5BC0EB; } 100% { stroke: var(--ink); } }

/* Red Light: run on green, slow on yellow, freeze on red. */
.rl-g, .rl-y { opacity: 0; }
.rl-g { animation-name: th-rl-g; }
.rl-y { animation-name: th-rl-y; }
.rl-r { animation-name: th-rl-r; }
.rl-run { transform: translateX(76px); animation-name: th-rl-run; animation-timing-function: linear; }
.rl-fig .leg.l, .rl-fig .arm.r { transform: rotate(28deg); animation-name: th-rl-a; animation-timing-function: linear; }
.rl-fig .leg.r, .rl-fig .arm.l { transform: rotate(-28deg); animation-name: th-rl-b; animation-timing-function: linear; }
@keyframes th-rl-g { 0%, 38% { opacity: 1; } 40%, 100% { opacity: 0; } }
@keyframes th-rl-y { 0%, 38% { opacity: 0; } 40%, 63% { opacity: 1; } 65%, 100% { opacity: 0; } }
@keyframes th-rl-r { 0%, 63% { opacity: 0; } 65%, 100% { opacity: 1; } }
@keyframes th-rl-run {
  0% { opacity: 0; transform: none; } 3% { opacity: 1; transform: translateX(2px); }
  40% { transform: translateX(62px); } 64%, 94% { opacity: 1; transform: translateX(76px); }
  100% { opacity: 0; transform: translateX(76px); }
}
@keyframes th-rl-a {
  0%, 10%, 20%, 30%, 40% { transform: rotate(28deg); } 5%, 15%, 25%, 35% { transform: rotate(-28deg); }
  52% { transform: rotate(-28deg); } 64%, 100% { transform: rotate(28deg); }
}
@keyframes th-rl-b {
  0%, 10%, 20%, 30%, 40% { transform: rotate(-28deg); } 5%, 15%, 25%, 35% { transform: rotate(28deg); }
  52% { transform: rotate(28deg); } 64%, 100% { transform: rotate(-28deg); }
}

/* Simon Says: with the crown, copy the move; without it, stay still. */
.ss-lead .arm.l, .ss-play .arm.l { transform: rotate(100deg); }
.ss-lead .arm.r, .ss-play .arm.r { transform: rotate(-100deg); }
.ss-lead .arm.l { animation-name: th-ss-lead-l; }
.ss-lead .arm.r { animation-name: th-ss-lead-r; }
.ss-play .arm.l { animation-name: th-ss-play-l; }
.ss-play .arm.r { animation-name: th-ss-play-r; }
.ss-b1 { animation-name: th-ss-b1; }
.ss-b2 { opacity: 0; animation-name: th-ss-b2; }
.ss-ok { animation-name: th-ss-ok; }
@keyframes th-ss-lead-l { 0%, 8%, 44%, 54%, 92%, 100% { transform: none; } 14%, 40%, 60%, 88% { transform: rotate(100deg); } }
@keyframes th-ss-lead-r { 0%, 8%, 44%, 54%, 92%, 100% { transform: none; } 14%, 40%, 60%, 88% { transform: rotate(-100deg); } }
@keyframes th-ss-play-l { 0%, 16%, 44%, 100% { transform: none; } 22%, 40% { transform: rotate(100deg); } }
@keyframes th-ss-play-r { 0%, 16%, 44%, 100% { transform: none; } 22%, 40% { transform: rotate(-100deg); } }
@keyframes th-ss-b1 { 0%, 2% { opacity: 0; } 6%, 42% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes th-ss-b2 { 0%, 48% { opacity: 0; } 52%, 90% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes th-ss-ok {
  0%, 22% { opacity: 0; transform: scale(0.4); } 27%, 41% { opacity: 1; transform: none; } 45%, 66% { opacity: 0; transform: scale(0.4); }
  71%, 89% { opacity: 1; transform: none; } 93%, 100% { opacity: 0; }
}

/* Cup Shuffle: the frog hides, the cups swap, there it is! */
.cs-b { transform: translateY(-26px); animation-name: th-cs-b; }
.cs-a { animation-name: th-cs-a; }
.cs-c { animation-name: th-cs-c; }
.cs-f1 { animation-name: th-cs-f1; }
.cs-f2 { opacity: 0; animation-name: th-cs-f2; }
@keyframes th-cs-b {
  0% { transform: none; } 5%, 14% { transform: translateY(-26px); } 19%, 24% { transform: none; }
  32% { transform: translate(-20px, -8px); } 40%, 45% { transform: translateX(-40px); }
  52% { transform: translate(0, -10px); } 60%, 70% { transform: translateX(40px); }
  76%, 90% { transform: translate(40px, -26px); } 95%, 100% { transform: translateX(40px); }
}
@keyframes th-cs-a { 0%, 24% { transform: none; } 32% { transform: translate(20px, 6px); } 40%, 100% { transform: translateX(40px); } }
@keyframes th-cs-c { 0%, 45% { transform: none; } 52% { transform: translate(-40px, 6px); } 60%, 100% { transform: translateX(-80px); } }
@keyframes th-cs-f1 { 0%, 20% { opacity: 1; } 22%, 100% { opacity: 0; } }
@keyframes th-cs-f2 { 0%, 72% { opacity: 0; } 74%, 94% { opacity: 1; } 96%, 100% { opacity: 0; } }

/* Copy the Dancer: the dancer on screen moves; the player copies. */
.cd-fig { --th: 4s; }
.cd-fig .arm.l { transform: rotate(100deg); animation-name: th-cd-l; }
.cd-fig .arm.r { transform: rotate(-100deg); animation-name: th-cd-r; }
.cd-fig { animation-name: th-cd-jump; }
.cd-copy, .cd-copy .arm { animation-delay: 0.45s; }
.cd-note { animation-name: th-cd-note; animation-duration: 2s; }
.cd-arrow { animation-name: th-cd-arrow; animation-duration: 2s; }
@keyframes th-cd-l { 0%, 100% { transform: none; } 12%, 22% { transform: rotate(100deg); } 34%, 44% { transform: rotate(55deg); } 56%, 66% { transform: rotate(100deg); } 78%, 88% { transform: rotate(20deg); } }
@keyframes th-cd-r { 0%, 100% { transform: none; } 12%, 22% { transform: rotate(-100deg); } 34%, 44% { transform: rotate(-55deg); } 56%, 66% { transform: none; } 78%, 88% { transform: rotate(-20deg); } }
@keyframes th-cd-jump { 0%, 74%, 92%, 100% { transform: none; } 80%, 86% { transform: translateY(-7px); } }
@keyframes th-cd-note { 0% { opacity: 0; transform: none; } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -14px); } }
@keyframes th-cd-arrow { 0%, 100% { transform: none; opacity: 0.6; } 50% { transform: translateX(4px); opacity: 1; } }

/* Animal Moves: spin the wheel, then hop like the frog. */
.am-wheel { transform-origin: 42px 46px; animation-name: th-am-wheel; animation-timing-function: linear; }
.am-frog { transform: translateY(-10px); animation-name: th-am-frog; }
.am-hop { transform: translateY(-6px); animation-name: th-am-hop; }
.am-fig .leg.l { animation-name: th-am-leg-l; }
.am-fig .leg.r { animation-name: th-am-leg-r; }
@keyframes th-am-wheel {
  0% { transform: none; animation-timing-function: cubic-bezier(0.2, 0.6, 0.3, 1); }
  36%, 100% { transform: rotate(1080deg); }
}
@keyframes th-am-frog {
  0%, 36% { opacity: 0.25; transform: scale(0.7); } 42% { opacity: 1; transform: none; }
  50%, 64%, 78%, 92% { transform: none; } 57%, 71%, 85% { transform: translateY(-14px); } 100% { opacity: 0.25; transform: scale(0.7); }
}
@keyframes th-am-hop { 0%, 50%, 64%, 78%, 92%, 100% { transform: none; } 57%, 71%, 85% { transform: translateY(-10px); } }
@keyframes th-am-leg-l { 0%, 50%, 64%, 78%, 92%, 100% { transform: rotate(20deg); } 57%, 71%, 85% { transform: rotate(-10deg); } }
@keyframes th-am-leg-r { 0%, 50%, 64%, 78%, 92%, 100% { transform: rotate(-20deg); } 57%, 71%, 85% { transform: rotate(10deg); } }

/* Animal Race: every right answer, the horse runs on to the flag. */
.ar-horse { transform: translateX(108px); animation-name: th-ar-horse; }
.ar-rabbit { transform: translateX(34px); animation-name: th-ar-rabbit; }
.ar-ok { opacity: 0; animation-name: th-ar-ok; }
.ar-win { animation-name: th-ar-win; }
@keyframes th-ar-horse {
  0% { opacity: 0; transform: none; } 4%, 16% { opacity: 1; transform: none; }
  24%, 36% { transform: translateX(36px); } 44%, 56% { transform: translateX(72px); }
  64%, 94% { opacity: 1; transform: translateX(108px); } 100% { opacity: 0; transform: translateX(108px); }
}
@keyframes th-ar-rabbit { 0% { opacity: 0; transform: none; } 4%, 30% { opacity: 1; transform: none; } 40%, 94% { opacity: 1; transform: translateX(34px); } 100% { opacity: 0; transform: translateX(34px); } }
@keyframes th-ar-ok {
  0%, 8%, 20%, 28%, 40%, 48%, 60%, 100% { opacity: 0; transform: scale(0.4); }
  12%, 16%, 32%, 36%, 52%, 56% { opacity: 1; transform: none; }
}
@keyframes th-ar-win { 0%, 62% { opacity: 0; transform: scale(0.3) rotate(-90deg); } 70% { opacity: 1; transform: scale(1.2); } 76%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Spot the Difference: a ring pops on each difference, on both pictures. */
.sp-r0, .sp-r1, .sp-ok { transform-box: fill-box; transform-origin: center; }
.th-spot-difference .th-ring { stroke-width: 3.5; }
.sp-r0 { animation-name: th-sp-r0; }
.sp-r1 { animation-name: th-sp-r1; }
.sp-ok { animation-name: th-sp-ok; }
@keyframes th-sp-r0 { 0%, 22% { opacity: 0; transform: scale(1.8); } 28% { opacity: 1; transform: scale(0.9); } 32%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-sp-r1 { 0%, 50% { opacity: 0; transform: scale(1.8); } 56% { opacity: 1; transform: scale(0.9); } 60%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes th-sp-ok { 0%, 64% { opacity: 0; transform: scale(0.4); } 70%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Rolling Balls: the family on beach balls, two swap, each picture flashes, who had it? */
.rbt-white { fill: #FFFFFF; }
.rbt-a-fill { fill: var(--w-movement); }
.rbt-b-fill { fill: var(--w-guessing); }
.rbt-c-fill { fill: var(--w-good); }
.rbt-rim { fill: none; stroke: var(--border); stroke-width: 1.6; }
.rbt-shine { fill: rgb(255 255 255 / 0.75); }
.rbt-shadow { fill: rgb(38 48 82 / 0.25); }
.rbt-spin, .rbt-face, .rbt-rider, .rbt-ok, .rbt-ask { transform-box: fill-box; transform-origin: center; }
.rbt-rider { transform-origin: 50% 100%; animation-name: th-rbt-sway; animation-duration: 1.2s; }
.rbt-b .rbt-rider { animation-delay: -0.6s; }
.rbt-spin { animation-name: th-rbt-spin; animation-duration: 1.5s; animation-timing-function: linear; }
.rbt-a { animation-name: th-rbt-a; }
.rbt-b { animation-name: th-rbt-b; }
.rbt-face { opacity: 0; }
.rbt-g1 { animation-name: th-rbt-g1; }
.rbt-g2 { animation-name: th-rbt-g2; }
.rbt-g3 { animation-name: th-rbt-g3; }
.rbt-ask { opacity: 0; animation-name: th-rbt-ask; }
.rbt-ok { opacity: 0; animation-name: th-rbt-ok; }
@keyframes th-rbt-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes th-rbt-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes th-rbt-a { 0%, 36% { transform: none; } 48%, 100% { transform: translateX(48px); } }
@keyframes th-rbt-b { 0%, 36% { transform: none; } 42% { transform: translate(-24px, -4px); } 48%, 100% { transform: translateX(-48px); } }
@keyframes th-rbt-g1 { 0%, 4% { opacity: 0; transform: scaleX(0.1); } 10%, 14% { opacity: 1; transform: none; } 20%, 100% { opacity: 0; transform: scaleX(0.1); } }
@keyframes th-rbt-g2 { 0%, 18% { opacity: 0; transform: scaleX(0.1); } 24%, 28% { opacity: 1; transform: none; } 34%, 100% { opacity: 0; transform: scaleX(0.1); } }
@keyframes th-rbt-g3 { 0%, 50% { opacity: 0; transform: scaleX(0.1); } 56%, 60% { opacity: 1; transform: none; } 66%, 100% { opacity: 0; transform: scaleX(0.1); } }
@keyframes th-rbt-ask { 0%, 68% { opacity: 0; transform: scale(0.4); } 72%, 82% { opacity: 1; transform: none; } 85%, 100% { opacity: 0; } }
@keyframes th-rbt-ok { 0%, 84% { opacity: 0; transform: scale(0.4); } 88%, 97% { opacity: 1; transform: none; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .thumb, .thumb * { animation: none !important; }
}

/* Look: the Easy-Read switch and the bus colour. */
.look-panel { padding: clamp(12px, 2vw, 22px); display: flex; flex-direction: column; gap: 14px; border: 2px solid var(--line); }
.look-switch {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px;
  border-radius: 999px; border: 2px solid var(--line); background: var(--soft); font-size: 18px; font-weight: 700;
}
.look-switch .knob { width: 48px; height: 28px; border-radius: 999px; background: var(--dash); position: relative; transition: background 0.15s; }
.look-switch .knob::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--card); transition: transform 0.15s;
}
.look-switch[aria-pressed='true'] .knob { background: var(--good); }
.look-switch[aria-pressed='true'] .knob::after { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) {
  .shop, .district-gate, .street-bus, .shop-glow, .shop-art, .street-banner, .look-switch .knob, .look-switch .knob::after { transition: none; }
  .bus-bob, .bus-rider, .bus-wheel > img { animation: none !important; }
  .bus-puffs { display: none; }
}

/* Ready screen note */
.night-note { max-width: 520px; color: var(--n-dim); font-size: clamp(16px, 2.4vh, 20px); }
.night-warn { padding: 8px 14px; border-radius: var(--w-radius-s); background: color-mix(in srgb, var(--yellow) 30%, transparent); color: inherit; font-weight: 700; }

/* Spot the Difference: two square pictures as big as the screen allows,
   side by side (one above the other on a tall screen). Rings and the
   remote's cursor sit on top, placed in % of the picture. The pictures are
   the game, so everything else steps aside: the count (or the result) rides
   in the header row, the coloured frame goes, there is no "Everyone" banner
   (the header has the round), and no host bar while the family looks (it
   only holds a note until Next). */
.screen.play:has(.sp-stage) { max-width: none; padding: clamp(4px, 1vh, 14px) clamp(6px, 1.2vw, 20px); gap: clamp(4px, 0.8vh, 10px); }
.screen.play:has(.sp-panel.live) > .host-bar { display: none; }
.screen.play:has(.sp-stage) > .play-head { flex-wrap: wrap; gap: clamp(6px, 1vw, 16px); }
.screen.play:has(.sp-stage) .play-title { flex: 0 1 auto; }
.screen.play:has(.sp-stage) .play-title .game { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.night:has(.sp-stage) {
  padding: 0 0 6px; gap: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
}
.night:has(.sp-stage) > .night-head { display: none; }
/* The header's middle: outside the board, so it brings the board's pieces. */
.play-head-mid {
  --piece-line: 3px solid var(--border); --n-dim: color-mix(in srgb, var(--muted) 78%, var(--ink));
  order: 1; flex: 1 1 0; min-width: 0; display: flex; justify-content: center;
}
.play-head > #clock { order: 2; }
.sp-stage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.sp-bar { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.4vw, 20px); flex-wrap: wrap; row-gap: 4px; }
.sp-left {
  padding: 2px 16px; border-radius: 999px; background: var(--card); border: var(--piece-line); box-shadow: 0 3px 0 var(--border);
  font-size: clamp(16px, min(2.2vw, 3.4vh), 28px); font-weight: 800; color: var(--ink); white-space: nowrap;
}
.sp-dots { display: flex; gap: clamp(4px, 0.6vw, 8px); }
.sp-dot { width: clamp(12px, min(1.8vw, 2.6vh), 22px); aspect-ratio: 1; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 3px var(--border); }
.sp-dot.on {
  display: grid; place-items: center; background: var(--good); box-shadow: inset 0 0 0 3px var(--border);
  color: #FFFFFF; font-size: clamp(8px, min(1vw, 1.5vh), 13px); font-weight: 800; line-height: 1;
}
.sp-dot.new { animation: sp-pop 0.35s ease-out; }
.sp-strikes { display: flex; gap: 6px; }
.sp-strike { font-size: clamp(18px, 3vh, 26px); font-weight: 800; color: color-mix(in srgb, var(--n-dim) 45%, transparent); }
.sp-strike.used { color: var(--bad); }
/* A new scene, or this week's: a banner over the pictures for a moment
   (src/ui/spotDifference.js sceneFlash), and a tag in the bar all round. */
.sp-board { position: relative; }
.sp-scene-flash { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none;
  animation: scene-flash 2.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.sp-scene-flash .w-badge { font-size: clamp(28px, 5vw, 64px); padding: 0.3em 0.9em; box-shadow: 0 6px 0 var(--w-sun-edge), var(--w-shadow); }
@keyframes scene-flash { 0% { opacity: 0; transform: scale(0.4) rotate(-6deg); } 15% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  25% { transform: scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .sp-scene-flash { animation: scene-flash-calm 2.8s both; } }
@keyframes scene-flash-calm { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.sp-scene-tag .w-badge { font-size: var(--w-text-s); }
.sp-board { flex: 1 1 0; min-height: 0; container-type: size; display: flex; align-items: center; justify-content: center; }
.sp-pair { display: flex; align-items: center; gap: clamp(4px, 0.6vw, 10px); }
.sp-panel {
  --side: min(calc(50cqw - 10px), 100cqh);
  position: relative; width: var(--side); height: var(--side); border-radius: var(--w-radius-s); overflow: hidden;
  background: #FFFFFF; border: var(--piece-line); box-shadow: var(--piece-shadow); touch-action: manipulation;
}
.sp-panel.live { cursor: crosshair; }
.sp-panel img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.sp-divider { align-self: stretch; width: 4px; border-radius: 3px; background: var(--board-sec); }
@container (max-aspect-ratio: 1/1) {
  .sp-pair { flex-direction: column; }
  .sp-panel { --side: min(100cqw, calc(50cqh - 10px)); }
  .sp-divider { width: auto; height: 4px; }
}
/* Markers sit on the picture and never take a tap. */
.sp-rings, .sp-tag, .sp-burst, .sp-spot, .sp-cursor, .sp-miss { position: absolute; pointer-events: none; box-sizing: border-box; }
/* A found difference: a crayon ring inside its box (src/model/spotRing.js).
   A white edge, a dark edge and the green line, so it reads on any picture
   from across the room. The SVG is the picture's own 1000 x 1000 square. */
.sp-rings { inset: 0; width: 100%; height: 100%; overflow: visible; }
.sp-ring { transform-box: fill-box; transform-origin: center; }
.sp-ring path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sp-ring .under { stroke: #FFFFFF; stroke-width: 26; opacity: 0.95; }
.sp-ring .edge { stroke: var(--w-ink); stroke-width: 17; }
.sp-ring .line { stroke: var(--good); stroke-width: 10; }
.sp-ring.new { animation: sp-settle 0.5s 0.45s ease-out both; }
.sp-ring.new path { stroke-dasharray: 1 1; animation: sp-draw 0.5s cubic-bezier(0.3, 0.7, 0.3, 1) both; }
/* Its number, the order it was found, on a sun-yellow chip like the kit's badges. */
.sp-panel { container-type: inline-size; }
.sp-tag {
  display: grid; place-items: center; transform: translate(-50%, -50%);
  width: clamp(22px, 7cqw, 44px); aspect-ratio: 1; border-radius: 50%;
  background: var(--w-sun); border: clamp(2px, 0.5cqw, 3px) solid var(--w-ink); box-shadow: 0 clamp(2px, 0.5cqw, 3px) 0 var(--w-ink);
  color: var(--w-ink); font-size: clamp(12px, 3.6cqw, 22px); font-weight: 800; line-height: 1;
}
.sp-tag.new { animation: sp-tag 0.4s 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
/* The stars of a catch, flying out of the ring. */
.sp-burst { width: 0; height: 0; }
.sp-burst i {
  position: absolute; transform: translate(-50%, -50%); font-style: normal; line-height: 1;
  font-size: clamp(12px, 4cqw, 26px); color: var(--w-sun); text-shadow: 0 0 2px var(--w-ink), 0 0 1px var(--w-ink);
  animation: sp-fly 0.7s 0.3s ease-out both;
}
/* The catch: everything but the find dims for a moment. */
.sp-spot { inset: 0; --sp-dim: color-mix(in srgb, var(--navy) 45%, transparent); animation: sp-spot 0.9s ease-in forwards; }
.sp-cursor { border-radius: 12px; border: 5px solid var(--yellow); box-shadow: 0 0 0 3px var(--navy), inset 0 0 0 3px var(--navy); }
.sp-miss {
  transform: translate(-50%, -50%); font-size: clamp(28px, 6cqh, 56px); font-weight: 800; line-height: 1;
  color: var(--bad); text-shadow: 0 0 4px #FFFFFF, 0 0 2px #FFFFFF; animation: sp-shake 0.3s;
}
.sp-help { color: var(--n-dim); font-size: clamp(16px, min(1.4vw, 2vh), 18px); text-align: center; }
/* The result sits in the end-of-round pop-up like other games' banners. */
.sp-result { gap: 16px; flex-wrap: wrap; }
.sp-stars { display: flex; gap: 4px; }
.sp-star { font-size: clamp(24px, 4.4vh, 40px); line-height: 1; color: color-mix(in srgb, var(--navy) 25%, transparent); }
.sp-star.on { color: var(--yellow); text-shadow: 0 2px 0 var(--navy); animation: sp-pop 0.5s ease-out backwards; }
.sp-star.on:nth-child(2) { animation-delay: 0.15s; }
.sp-star.on:nth-child(3) { animation-delay: 0.3s; }
/* Too narrow for the count beside the title (a phone or tablet held
   upright): it takes one slim line under the title and the clock. The help
   gives way to the pictures (the ready screen said how to play). */
@media (max-width: 900px) and (orientation: portrait) {
  .play-head-mid { order: 3; flex-basis: 100%; }
  .sp-help { display: none; }
}
@media (max-width: 900px) { .sp-help { display: none; } }
@media (max-width: 520px) {
  .sp-bar { flex-wrap: nowrap; gap: 8px; }
  .sp-left { padding: 1px 10px; font-size: 16px; }
  .sp-dots { gap: 3px; }
  .sp-dot { width: 11px; box-shadow: inset 0 0 0 2px var(--border); }
  .sp-dot.on { box-shadow: inset 0 0 0 2px var(--border); }
  .sp-strikes { gap: 2px; }
  .sp-strike { font-size: 16px; }
}
/* Short screens (a phone on its side): a smaller header. */
@media (max-height: 560px) {
  .screen.play:has(.sp-stage) .play-title { gap: 8px; }
  .screen.play:has(.sp-stage) .play-title .game { font-size: 16px; }
  .screen.play:has(.sp-stage) .play-title .round { font-size: 16px; }
  .screen.play:has(.sp-stage) .icon-btn { width: 44px; height: 44px; }
  .screen.play:has(.sp-stage) .ring { width: 48px; height: 48px; }
  .screen.play:has(.sp-stage) .ring span { font-size: 18px; }
  .sp-help { display: none; }
}
@keyframes sp-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sp-settle { 40% { transform: scale(1.04); } }
@keyframes sp-tag { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }
@keyframes sp-fly {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } 25% { opacity: 1; }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); }
}
@keyframes sp-spot { 0%, 45% { opacity: 1; } to { opacity: 0; } }
@keyframes sp-pop { from { transform: scale(0.3); } 60% { transform: scale(1.25); } to { transform: none; } }
@keyframes sp-shake { 0%, 100% { margin-left: 0; } 25% { margin-left: -6px; } 75% { margin-left: 6px; } }
@media (prefers-reduced-motion: reduce) {
  .sp-ring.new, .sp-ring.new path, .sp-tag.new, .sp-dot.new, .sp-star.on, .sp-miss { animation: none; }
  .sp-ring.new path { stroke-dasharray: none; }
  .sp-spot, .sp-burst { display: none; }
}

/* Volume Pilot: the flight on one canvas, sized to the screen; the
   first-flight cards ask how to fly and listen to the room. */
.vp-stage { flex: 1 1 0; min-height: 0; container-type: size; display: flex; align-items: center; justify-content: center; }
.vp-sky { position: relative; width: min(100cqw, 200cqh); }
.vp-canvas {
  display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: var(--w-radius);
  border: var(--piece-line); box-shadow: var(--piece-shadow); touch-action: none; user-select: none;
}
.vp-paused { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(18, 13, 46, 0.55); border-radius: var(--w-radius); }
.vp-card { max-width: 640px; margin: auto; padding: clamp(12px, min(3vw, 4vh), 36px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.6vh, 12px); }
.vp-card h2 { margin: 0; font-size: clamp(22px, min(3.4vw, 6vh), 40px); line-height: 1.15; }
.vp-card p { margin: 0; color: var(--muted); font-size: clamp(16px, min(2vw, 3.6vh), 22px); }
.vp-card .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.vp-big { font-size: clamp(40px, min(9vw, 14vh), 110px); line-height: 1; }
.vp-note { color: var(--muted); font-size: clamp(16px, 1.8vw, 20px); font-weight: 700; text-align: center; margin: 0; }
.vp-cal { --level: 0; width: min(420px, 80%); height: 26px; border-radius: 999px; background: var(--soft); border: 2px solid var(--line); overflow: hidden; }
.vp-cal span { display: block; height: 100%; width: calc(var(--level) * 100%); background: var(--good); transition: width 0.08s linear; }
.th-wave { fill: none; stroke: var(--sec); stroke-width: 3; stroke-linecap: round; }
.vp-rocket { animation-name: th-vp-fly; }
.vp-w0 { animation-name: th-vp-w0; }
.vp-w1 { animation-name: th-vp-w1; }
.vp-w2 { animation-name: th-vp-w2; }
@keyframes th-vp-fly { 0%, 100% { transform: translateY(14px); } 35%, 60% { transform: translateY(-14px); } }
@keyframes th-vp-w0 { 0%, 20%, 70%, 100% { opacity: 0.2; } 30%, 60% { opacity: 1; } }
@keyframes th-vp-w1 { 0%, 25%, 70%, 100% { opacity: 0.2; } 35%, 60% { opacity: 1; } }
@keyframes th-vp-w2 { 0%, 30%, 70%, 100% { opacity: 0.2; } 40%, 60% { opacity: 1; } }

/* Cards Memorize Challenge: the Memory Pairs cards, a number badge on the
   face-up ones, the level ladder in the header and the picture to find. */
.cm-bar { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.4vw, 20px); flex-wrap: wrap; row-gap: 4px; }
.cm-level {
  padding: 2px 16px; border-radius: 999px; background: var(--card); border: var(--piece-line); box-shadow: 0 3px 0 var(--border);
  font-size: clamp(16px, min(2.2vw, 3.4vh), 28px); font-weight: 800; color: var(--ink); white-space: nowrap;
}
.cm-dots { display: flex; gap: clamp(4px, 0.6vw, 8px); }
.cm-dot { width: clamp(12px, min(1.8vw, 2.6vh), 22px); aspect-ratio: 1; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 3px var(--border); }
.cm-dot.on { background: var(--good); }
.cm-dot.off { background: var(--bad); }
.cm-dot.now { background: var(--yellow); animation: sp-pop 0.35s ease-out; }
.mem-card.up { position: relative; }
.cm-num {
  position: absolute; top: 6px; left: 6px; display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%;
  font-size: clamp(16px, min(2vw, 3vh), 28px); font-weight: 900; background: var(--navy); color: #FFFFFF; border: 2px solid #FFFFFF;
}
.night .mem-card.cm-right { box-shadow: 0 0 0 6px var(--good); border-color: var(--good); }
.night .mem-card.cm-wrong { box-shadow: 0 0 0 6px var(--bad); border-color: var(--bad); }
.cm-ask { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 24px); }
.night .mem-card.cm-target { width: clamp(80px, 16vh, 160px); height: clamp(80px, 16vh, 160px); flex: none; box-shadow: 0 0 0 5px var(--yellow); }
.cm-result { gap: 16px; flex-wrap: wrap; align-items: center; }
.cm-result img { width: clamp(48px, 8vh, 80px); height: clamp(48px, 8vh, 80px); object-fit: contain; }
@media (max-width: 520px) {
  .cm-level { padding: 1px 10px; font-size: 16px; }
  .cm-dots { gap: 3px; }
  .cm-dot { width: 11px; box-shadow: inset 0 0 0 2px var(--border); }
}
@media (prefers-reduced-motion: reduce) { .cm-dot.now { animation: none; } }

/* Charades */
.ch-card {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--w-radius); background: #FFFFFF; color: var(--navy); border: 3px solid var(--border); box-shadow: 0 5px 0 var(--border); padding: 8px; text-align: center;
  container-type: size; overflow: hidden; font: inherit; cursor: pointer;
}
.ch-card.covered { background: var(--navy); color: #FFFFFF; } /* the covered card is navy */
.ch-card.covered .ch-word { font-size: min(40px, 14cqh, 7cqw); }
.ch-card.covered .ch-rule { color: color-mix(in srgb, #FFFFFF 80%, var(--navy)); }
.ch-emoji { font-size: min(140px, 42cqh, 30cqw); line-height: 1.1; }
.ch-word { font-size: min(64px, 20cqh, 9cqw); font-weight: 800; line-height: 1.1; }
.ch-rule { font-size: min(17px, 9cqh); color: color-mix(in srgb, var(--navy) 75%, #FFFFFF); } /* the card is white */
@container (max-height: 150px) {
  .ch-rule { display: none; }
}

.ch-count { text-align: center; font-size: clamp(18px, 3vh, 24px); font-weight: 800; color: var(--n-mark); }
.ch-play { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.ch-buttons { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.ch-skip { border: 3px solid var(--border); border-radius: var(--w-radius); background: var(--card); box-shadow: 0 5px 0 var(--border); font-size: clamp(18px, 3vh, 24px) !important; font-weight: 700; }
.ch-skip:not(:disabled):active { transform: translateY(5px); box-shadow: none; }
.ch-done { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.ch-big { font-size: clamp(54px, 12vh, 120px); font-weight: 800; color: var(--n-mark); line-height: 1; }
.ch-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; }
.ch-chip { padding: 4px 14px; border-radius: 999px; background: var(--card); border: 2px solid var(--border); font-size: clamp(16px, 2.2vh, 18px); font-weight: 700; }

/* Story Dice */
.sd-twist { padding: 8px 14px; border-radius: var(--w-radius-s); background: color-mix(in srgb, var(--n-gold) 22%, var(--card)); border: 2px dashed var(--border); font-size: clamp(16px, 2.4vh, 20px); }
.sd-twist b { color: var(--n-mark); }
.sd-dice { flex: 1 1 0; min-height: 0; display: grid; gap: clamp(8px, 1.4vh, 16px); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); container-type: size; }
.sd-die {
  border: 3px solid var(--border); border-radius: var(--w-radius); background: #FFFFFF; box-shadow: 0 6px 0 var(--border); display: flex; align-items: center; justify-content: center; min-height: 0;
}
.sd-die span { font-size: min(110px, 55cqh / var(--rows, 2), 55cqw / var(--cols, 3)); line-height: 1; }
.sd-die img { width: min(180px, 75cqh / var(--rows, 2), 75cqw / var(--cols, 3)); height: min(180px, 75cqh / var(--rows, 2), 75cqw / var(--cols, 3)); object-fit: contain; pointer-events: none; }
.sd-die:not(:disabled):active { transform: translateY(6px); box-shadow: none; }
.sd-die.used { opacity: 1; background: color-mix(in srgb, #FFFFFF 55%, transparent); border-color: var(--c); box-shadow: 0 0 0 3px var(--c) inset; }
.sd-die.used span, .sd-die.used img { opacity: 0.55; }
.sd-vote .tq-person { color: var(--ink); }

/* Freeze Dance, Red Light, Simon Says */
.mv-panel {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--w-radius); padding: 10px; text-align: center; container-type: size; overflow: hidden;
  /* A dance floor: the wall (--mat, which the light tints) over chequered floor tiles. */
  --mat: var(--card);
  --floor: linear-gradient(var(--mat), var(--mat)) top / 100% 82% no-repeat,
    repeating-conic-gradient(color-mix(in srgb, var(--board-sec, var(--sec-movement)) 16%, var(--card)) 0 25%, var(--card) 0 50%) 0 0 / 48px 48px;
  background: var(--floor); border: 3px solid var(--border); box-shadow: 0 5px 0 var(--border);
}
.mv-panel.go { --mat: color-mix(in srgb, var(--w-good) 30%, var(--card)); }
.mv-panel.slow { --mat: color-mix(in srgb, var(--w-sun) 32%, var(--card)); }
.mv-panel.stop { --mat: color-mix(in srgb, var(--w-sky) 45%, var(--card)); }
.mv-panel.paused { filter: saturate(0.3); }
.mv-panel.simon.says { --mat: color-mix(in srgb, var(--n-gold) 30%, var(--card)); }
.mv-emoji { font-size: min(120px, 38cqh, 30cqw); line-height: 1.1; }
.mv-panel.go .mv-emoji { animation: mv-bop 0.6s ease-in-out infinite alternate; }
@keyframes mv-bop { from { transform: rotate(-8deg) translateY(0); } to { transform: rotate(8deg) translateY(-6%); } }
.mv-word { font-size: min(60px, 16cqh, 10cqw); font-weight: 800; line-height: 1.15; max-width: 92%; }
.mv-rule { font-size: min(22px, 9cqh, 5cqw); color: var(--n-dim); max-width: 560px; }
.mv-kicker { font-size: min(30px, 10cqh, 6cqw); font-weight: 800; color: var(--n-mark); }
.mv-again { border: 0; background: none; color: var(--n-dim); font-size: min(17px, 8cqh); text-decoration: underline; }
.mv-finish { align-self: center; }
.mv-wrap { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.mv-side { display: flex; flex-direction: column; gap: 10px; }
@media (max-height: 500px) and (min-aspect-ratio: 4/3) {
  .mv-wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: minmax(0, 1fr); }
  .mv-side { justify-content: center; }
}
.mv-lights { display: flex; gap: min(18px, 4cqw); padding: min(12px, 3cqh); border-radius: 999px; background: #10142C; border: 3px solid var(--border); box-shadow: 0 4px 0 var(--border); }
.mv-lamp { width: min(90px, 30cqh, 16cqw); aspect-ratio: 1; border-radius: 50%; opacity: 0.18; }
/* Red Light's stop lamp is the kit's soft orange, as on its ready screen
   (never alarm red); the lamp's place, bottom, says "stop" too. */
.mv-lamp.freeze { background: var(--w-oops); }
.mv-lamp.slow { background: var(--w-sun); }
.mv-lamp.dance { background: var(--w-good); }
.mv-lamp.on { opacity: 1; box-shadow: 0 0 28px currentColor; }
.mv-lamp.freeze.on { color: var(--w-oops); }
.mv-lamp.slow.on { color: var(--w-sun); }
.mv-lamp.dance.on { color: var(--w-good); }
.mv-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.mv-btn {
  border: 2px solid var(--border); border-radius: 999px; background: var(--card); color: inherit; box-shadow: 0 3px 0 var(--border);
  padding: 6px 16px; font-size: clamp(16px, 2.2vh, 18px); font-weight: 700;
}
.mv-btn:active, .mv-person:not(:disabled):active { transform: translateY(3px); box-shadow: none; }
.mv-people { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.mv-person {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px;
  border: 3px solid var(--c); background: var(--card); box-shadow: 0 3px 0 var(--border); color: inherit; font-weight: 700; font-size: clamp(16px, 2.2vh, 18px);
}
.mv-person .avatar { --size: clamp(30px, 5vh, 48px) !important; width: var(--size); height: var(--size); }
.mv-person.out { opacity: 0.45; border-style: dashed; box-shadow: none; }
.mv-person.out .mv-name { text-decoration: line-through; }
/* On a big TV the grown-up taps these mid-dance: make them easy to hit. */
@media (min-width: 1400px) and (min-height: 800px) {
  .mv-people { gap: 14px; }
  .mv-person { min-height: 72px; padding: 6px 22px 6px 6px; font-size: 24px; }
  .mv-person .avatar { --size: 58px !important; }
}
.mv-x { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: clamp(20px, 3.4vh, 30px); color: var(--w-oops); }

/* Short, wide screens: the card on the left, the buttons on the right. */
@media (max-height: 500px) and (min-aspect-ratio: 4/3) {
  .ch-play { display: grid; grid-template-columns: 3fr 2fr; grid-template-rows: auto minmax(0, 1fr); gap: 8px 12px; }
  .ch-card { grid-row: 1 / 3; }
  .ch-count { font-size: 17px; }
  .ch-buttons { grid-template-columns: 1fr; grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); min-height: 0; padding-bottom: 6px; }
  .ch-buttons > button { min-height: 0 !important; padding: 0 8px !important; font-size: 22px !important; line-height: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .ch-done { gap: 4px; }
  .ch-big { font-size: 44px; }
}

/* A big family (6 to 10) picking a person: four to a row, smaller faces. */
.tq-people.many { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px; }
.tq-people.many .tq-person { min-width: 0; padding: 6px 4px; gap: 4px; font-size: clamp(16px, 2.2vh, 18px) !important; }
.tq-people.many .tq-person .avatar { width: clamp(30px, 5.5vh, 56px); height: clamp(30px, 5.5vh, 56px); font-size: clamp(16px, 2.6vh, 24px); }

/* ==========================================================================
   Home page: the town square at the start of Game Street. The picture fills
   the screen (.home-scene). The name on a cream sign in its sky, the way in
   under it, the family and Leo on the pavement in front.
   ========================================================================== */
.screen.home {
  position: relative; max-width: none; height: 100svh; min-height: 100svh; overflow: hidden; display: block; isolation: isolate; padding: 0;
  background: var(--w-sky); color: var(--w-ink);
}

/* The town square, covering the screen like a backdrop. */
.home-scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.home-scene img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 65%; pointer-events: none; user-select: none;
  animation: scene-breathe 40s ease-in-out infinite alternate;
}
@keyframes scene-breathe { to { scale: 1.04; } }

/* The name on its cream sign in the sky (the World Kit's card), and what this is */
.home-top {
  position: absolute; z-index: 2; left: 50%; top: max(clamp(16px, 4vh, 48px), env(safe-area-inset-top)); translate: -50% 0;
  width: max-content; max-width: 92vw; display: flex; flex-direction: column; align-items: center; gap: clamp(2px, 0.8vh, 8px);
  padding: clamp(10px, 2vh, 22px) clamp(22px, 3vw, 48px);
}
.home-top h1 {
  margin: 0; font-weight: 800; line-height: 0.95; white-space: nowrap; text-align: center; color: var(--w-ink);
  font-size: clamp(36px, min(6vw, 8.6vh), 92px);
}
.home-top .word { display: inline-block; }
.home-top .letter { display: inline-block; cursor: pointer; animation: letter-drop 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) calc(var(--i) * 45ms) both; }
.home-top .letter:nth-child(odd) { rotate: -2deg; }
.home-top .letter:nth-child(even) { rotate: 2deg; }
.home-top .letter.poked { animation: letter-jump 0.55s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes letter-drop { from { transform: translateY(-120%) rotate(-12deg); opacity: 0; } }
@keyframes letter-jump { 30% { transform: translateY(-28%) scale(1.08, 0.92); } 60% { transform: translateY(0) scale(0.92, 1.08); } }
.home .sub {
  margin: 0; color: var(--w-ink-soft); font-size: var(--w-text-s); font-weight: 700; line-height: 1.3; text-align: center; text-wrap: balance;
  animation: home-rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) 1s both;
}
@keyframes home-rise { from { transform: translateY(24px); opacity: 0; } }

/* The way in, under the sign: the big go, and How it works beside it */
.home-go {
  position: absolute; z-index: 2; left: 50%; top: clamp(150px, 38vh, 440px); translate: -50% 0; width: min(92vw, 720px);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.home-go > * { animation: home-rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both; animation-delay: 1.2s; }
.home-go > .home-next { animation-delay: 1.27s; }
.home-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; }
.home-row .w-btn.go { white-space: nowrap; }
.home-next {
  margin: 0; max-width: 46ch; padding: 4px 14px; border-radius: 999px; background: rgb(255 248 231 / 0.85);
  font-size: var(--w-text-s); font-weight: 700; color: var(--w-ink);
}
@media (max-height: 900px) and (min-aspect-ratio: 1 / 1) { .home-next { display: none; } }

/* Leo, the night's host, beside the family */
.home-host { position: absolute; z-index: 2; bottom: 0; right: clamp(8px, 7vw, 160px); pointer-events: none; }
.home-host .w-host-pic { width: clamp(84px, 26vh, 300px); }

/* The family on the bottom edge: the video, or the pictures until it plays */
.family-row {
  position: absolute; z-index: 1; bottom: 0; left: 50%; translate: -50% 0; width: min(80vw, 1100px, 61vh * 1294 / 720); height: min(34vh, 40vw);
  display: flex; align-items: flex-end; justify-content: center;
}
.char {
  flex: 0 1 var(--w); min-width: 0; height: 88%; padding: 0; border: 0; background: none; margin: 0 var(--m);
  display: flex; align-items: flex-end; transform-origin: 50% 100%;
}
.char.sway, .char.wave { --w: 30%; --m: -5%; }
.char.jump { --w: 25%; --m: -2.5%; z-index: 1; }
.char.hop { --w: 22%; --m: -2.5%; z-index: 1; }
.char.wobble { --w: 18%; --m: -2%; z-index: 2; }
.char .move { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; }
.char img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.char.yay { animation: yay 0.7s ease-out; }
.family-video { width: 100%; height: 100%; object-fit: contain; object-position: bottom; cursor: pointer; }
/* The packed MP4 an iPhone plays, drawn into the canvas above (packedVideo.js). */
.family-video-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* No long-press menu (save, share) on the family, on a phone or tablet. */
.family-row canvas, .family-row video { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes jump {
  0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
  10% { transform: translateY(0) scale(1.08, 0.9); }
  30% { transform: translateY(-14%) scale(0.95, 1.06); }
  50% { transform: translateY(0) scale(1.06, 0.93); }
}
@keyframes hop {
  0%, 60%, 100% { transform: translateY(0) rotate(0); }
  20% { transform: translateY(-8%) rotate(-6deg); }
  40% { transform: translateY(-8%) rotate(6deg); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg) scale(1.02); }
  75% { transform: rotate(5deg) scale(1.02); }
}
@keyframes yay {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(0) scale(1.1, 0.85); }
  50% { transform: translateY(-22%) scale(0.92, 1.1) rotate(-6deg); }
  80% { transform: translateY(0) scale(1.08, 0.92); }
  100% { transform: none; }
}

/* A phone held upright: the table shown narrower, centred on the C-A-T, its
   edges melting into the table colour; the name above, the family below. */
@media (max-width: 760px) and (orientation: portrait) {
  .home-top { top: max(60px, env(safe-area-inset-top) + 52px); }
  .home-top h1 { font-size: clamp(40px, 12vw, 60px); white-space: normal; }
  .home .sub { max-width: 30ch; }
  .home-go { top: auto; bottom: calc(118vw * 720 / 1294 + 6px); }
  .home-row { flex-direction: column; }
  .home-next { display: none; }
  .family-row { width: 118vw; height: auto; aspect-ratio: 1294 / 720; }
  /* The family fills the width: Leo waits for the street. */
  .home-host { display: none; }
}
/* A phone held sideways: a smaller sign, the way in below it. */
@media (max-height: 520px) and (orientation: landscape) {
  .home-top { padding: 6px 22px; }
  .home-top h1 { font-size: clamp(28px, 8vh, 40px); }
  /* Under the sign: its two lines of name, the line under them, its padding, and a gap. */
  .home-go { top: calc(clamp(16px, 4vh, 48px) + 8vh * 2 + 76px); }
  .home-row .w-btn.go { min-height: var(--w-tap); font-size: var(--w-text); }
}
@media (prefers-reduced-motion: reduce) {
  .home *, .home *::before { animation: none !important; transition: none !important; }
}

/* --- Animated characters ---------------------------------------------------
   Every animation starts at var(--since) (a negative delay) so a redraw of
   the screen carries on from where it was instead of starting again. */

/* Animal moves: .an-<move> on the box around an animal picture. */
[class^='an-'], [class*=' an-'] { transform-origin: 50% 100%; animation-delay: var(--since, 0ms); animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.an-hop { animation-name: an-hop; animation-duration: 0.9s; }
.an-waddle { animation-name: an-waddle; animation-duration: 0.8s; }
.an-stomp { animation-name: an-stomp; animation-duration: 0.9s; }
.an-march { animation-name: an-stomp; animation-duration: 0.4s; }
.an-flap { animation-name: an-flap; animation-duration: 0.6s; }
.an-buzz { animation-name: an-buzz; animation-duration: 1.6s; animation-timing-function: linear; }
.an-stretch { animation-name: an-stretch; animation-duration: 1.8s; }
.an-peck { animation-name: an-peck; animation-duration: 0.7s; }
.an-sway { animation-name: an-sway; animation-duration: 1.6s; }
.an-wag { animation-name: an-wag; animation-duration: 0.45s; }
.an-swim { animation-name: an-swim; animation-duration: 1.4s; }
.an-prowl { animation-name: an-prowl; animation-duration: 2.2s; }
.an-gallop { animation-name: an-gallop; animation-duration: 0.6s; }
.an-roar { animation-name: an-roar; animation-duration: 1.4s; }
.an-swing { animation-name: an-swing; animation-duration: 1.2s; transform-origin: 50% 0; }
.an-turn { animation-name: an-turn; animation-duration: 2s; }
.an-roll { animation-name: an-roll; animation-duration: 1.4s; transform-origin: 50% 60%; }
@keyframes an-hop { 0%, 100% { transform: translateY(0) scale(1.08, 0.92); } 15% { transform: translateY(0) scale(0.95, 1.06); } 50% { transform: translateY(-34%) scale(1); } 85% { transform: translateY(0) scale(1.1, 0.9); } }
@keyframes an-waddle { 0%, 100% { transform: translateX(-8%) rotate(-10deg); } 50% { transform: translateX(8%) rotate(10deg); } }
@keyframes an-stomp { 0%, 50%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-8%) rotate(-4deg); } 75% { transform: translateY(-8%) rotate(4deg); } }
@keyframes an-flap { 0%, 100% { transform: translateY(0) rotate(-6deg) scaleY(1); } 50% { transform: translateY(-14%) rotate(6deg) scaleY(0.92); } }
@keyframes an-buzz { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(14%, -12%) rotate(10deg); } 50% { transform: translate(0, -20%) rotate(-6deg); } 75% { transform: translate(-14%, -8%) rotate(-12deg); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes an-stretch { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(0.94, 1.16); } }
@keyframes an-peck { 0%, 40%, 100% { transform: rotate(0); } 60% { transform: rotate(16deg) translateY(4%); } }
@keyframes an-sway { 0%, 100% { transform: rotate(-4deg) translateX(-4%); } 50% { transform: rotate(4deg) translateX(4%); } }
@keyframes an-wag { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes an-swim { 0%, 100% { transform: translate(-10%, 0) rotate(-5deg); } 50% { transform: translate(10%, -6%) rotate(5deg); } }
@keyframes an-prowl { 0%, 100% { transform: translateX(-12%) scaleY(0.96); } 50% { transform: translateX(12%) scaleY(1); } }
@keyframes an-gallop { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-14%) rotate(5deg); } }
@keyframes an-roar { 0%, 60%, 100% { transform: scale(1); } 75% { transform: scale(1.16) rotate(-3deg); } 88% { transform: scale(1.1) rotate(3deg); } }
@keyframes an-swing { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes an-turn { 0%, 35%, 100% { transform: scaleX(1); } 50%, 85% { transform: scaleX(-1); } }
@keyframes an-roll { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(18deg) translateX(6%); } }

/* Copy the Dancer: the dancer turns at its joints (points in the SVG). */
.mv-panel.dancer { gap: 4px; background: radial-gradient(circle at 50% 110%, rgba(255, 122, 89, 0.35), transparent 60%), var(--floor); }
.mv-panel.dancer.frozen { background: radial-gradient(circle at 50% 110%, rgba(140, 196, 255, 0.45), transparent 60%), rgba(110, 170, 255, 0.18); border-color: #8CC4FF; }
.mv-panel.dancer { padding: 4px; }
.dz-floor { position: relative; flex: 1 1 0; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; }
/* As big as the panel lets it be: the full height, or the full width when that runs out first. */
.dz { height: 100%; max-width: 100%; aspect-ratio: 2 / 3; perspective: 600px; --beat: 900ms; --since: 0ms; }
.dz-clip { height: min(100%, 100cqw * 16 / 9); }
.dz-caption {
  position: absolute; left: 0; right: 0; bottom: 2%; margin-inline: auto; width: fit-content; max-width: 96%;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 18px; border-radius: var(--w-radius);
  background: color-mix(in srgb, var(--card) 78%, transparent); backdrop-filter: blur(4px);
}
.dz-caption .mv-word { font-size: min(52px, 9cqh, 9cqw); max-width: none; }
.dz-count { font-size: min(70cqh, 60cqw); font-weight: 900; line-height: 1; color: var(--n-gold, #FFC94A); text-shadow: 0 6px 0 var(--border); animation: dz-count 1s ease-out both; }
@keyframes dz-count { 0% { transform: scale(0.3); opacity: 0; } 25% { transform: scale(1.1); opacity: 1; } 40%, 85% { transform: none; opacity: 1; } 100% { transform: scale(0.85); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .dz-count { animation: none; } }
/* Any wide screen: the dancer on the left, the full height; the buttons and players beside it. */
@media (min-aspect-ratio: 1/1) {
  .mv-wrap.mv-dancer { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .mv-wrap.mv-dancer .mv-side { justify-content: center; }
}
/* Tall screens (phones): the buttons and players shrink to a strip or two under the dancer. */
@media (max-aspect-ratio: 1/1) {
  .prompt:has(+ .mv-wrap.mv-dancer) { display: none; }
  .mv-wrap.mv-dancer { gap: 6px; }
  .mv-wrap.mv-dancer .mv-side { gap: 6px; }
  .mv-wrap.mv-dancer .mv-controls { flex-wrap: nowrap; gap: 6px; }
  .mv-wrap.mv-dancer .mv-btn { flex: none; padding: 4px 10px; font-size: 16px; white-space: nowrap; }
  /* Only the song's name gives way on a narrow phone. */
  .mv-wrap.mv-dancer .mv-song { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mv-wrap.mv-dancer .mv-people { gap: 6px; }
  .mv-wrap.mv-dancer .mv-person { padding: 2px 10px 2px 2px; gap: 5px; font-size: 16px; border-width: 2px; }
  .mv-wrap.mv-dancer .mv-person .avatar { --size: 26px !important; }
  .mv-wrap.mv-dancer .mv-x { font-size: 16px; left: 4px; }
  .mv-wrap.mv-dancer .dz-caption { padding: 4px 12px; gap: 4px; border-radius: var(--w-radius-s); }
  .mv-wrap.mv-dancer .dz-caption .mv-word { font-size: min(30px, 6cqh, 7cqw); }
  .mv-wrap.mv-dancer .dz-chip { padding: 2px 10px; font-size: min(16px, 4cqh); }
}
.dz-svg { width: 100%; height: 100%; overflow: visible; }
.dz-clip { aspect-ratio: 9 / 16; max-width: 100%; }
.dz-video { width: 100%; height: 100%; object-fit: cover; border-radius: var(--w-radius); background: #E9E3FF; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.dz .dz-fig { transform-origin: 100px 292px; }
.dz .dz-arm-l { transform-origin: 78px 122px; transform: rotate(15deg); }
.dz .dz-arm-r { transform-origin: 122px 122px; transform: rotate(-15deg); }
.dz .dz-leg-l { transform-origin: 90px 196px; }
.dz .dz-leg-r { transform-origin: 110px 196px; }
.dz .dz-head { transform-origin: 100px 106px; }
.dz .dz-eye { transform-box: fill-box; transform-origin: center; animation: dz-blink 3.2s infinite; }
.dz .dz-fig, .dz .dz-arm, .dz .dz-leg, .dz .dz-head, .dz .dz-svg {
  animation-duration: var(--beat); animation-delay: var(--since); animation-iteration-count: infinite; animation-timing-function: ease-in-out;
}
@keyframes dz-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes dz-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.dz-clap .dz-fig { animation-name: dz-bob; }
.dz-clap .dz-arm-l { animation-name: dz-clap-l; animation-duration: calc(var(--beat) / 2); }
.dz-clap .dz-arm-r { animation-name: dz-clap-r; animation-duration: calc(var(--beat) / 2); }
@keyframes dz-clap-l { 0%, 100% { transform: rotate(140deg); } 50% { transform: rotate(176deg); } }
@keyframes dz-clap-r { 0%, 100% { transform: rotate(-140deg); } 50% { transform: rotate(-176deg); } }

.dz-jump .dz-fig { animation-name: dz-jump; }
.dz-jump .dz-arm-l { animation-name: dz-jump-l; }
.dz-jump .dz-arm-r { animation-name: dz-jump-r; }
.dz-jump .dz-leg-l { animation-name: dz-tuck-l; }
.dz-jump .dz-leg-r { animation-name: dz-tuck-r; }
@keyframes dz-jump { 0%, 100% { transform: translateY(0) scaleY(0.94); } 15% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-56px); } 85% { transform: translateY(0) scaleY(0.94); } }
@keyframes dz-jump-l { 0%, 100% { transform: rotate(30deg); } 50% { transform: rotate(165deg); } }
@keyframes dz-jump-r { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(-165deg); } }
@keyframes dz-tuck-l { 0%, 30%, 70%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
@keyframes dz-tuck-r { 0%, 30%, 70%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }

.dz-wave .dz-fig { animation-name: dz-sway; }
.dz-wave .dz-arm-r { animation-name: dz-wave; animation-duration: calc(var(--beat) / 2); }
.dz-wave .dz-head { animation-name: dz-tilt; }
@keyframes dz-wave { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(-112deg); } }
@keyframes dz-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes dz-tilt { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

.dz-flap .dz-fig { animation-name: dz-bob; animation-duration: calc(var(--beat) / 2); }
.dz-flap .dz-arm-l { animation-name: dz-flap-l; animation-duration: calc(var(--beat) / 2); }
.dz-flap .dz-arm-r { animation-name: dz-flap-r; animation-duration: calc(var(--beat) / 2); }
@keyframes dz-flap-l { 0%, 100% { transform: rotate(55deg); } 50% { transform: rotate(118deg); } }
@keyframes dz-flap-r { 0%, 100% { transform: rotate(-55deg); } 50% { transform: rotate(-118deg); } }

.dz-wiggle .dz-fig { animation-name: dz-wiggle; }
.dz-wiggle .dz-arm-l { transform: rotate(50deg); }
.dz-wiggle .dz-arm-r { transform: rotate(-50deg); }
.dz-wiggle .dz-head { animation-name: dz-tilt; }
@keyframes dz-wiggle { 0%, 100% { transform: rotate(-10deg) translateX(-6px); } 50% { transform: rotate(10deg) translateX(6px); } }

.dz-stomp .dz-fig { animation-name: dz-bob; animation-duration: calc(var(--beat) / 2); }
.dz-stomp .dz-leg-l { animation-name: dz-stomp; }
.dz-stomp .dz-leg-r { animation-name: dz-stomp; animation-delay: calc(var(--since) - var(--beat) / 2); }
.dz-stomp .dz-arm-l { transform: rotate(35deg); }
.dz-stomp .dz-arm-r { transform: rotate(-35deg); }
@keyframes dz-stomp { 0%, 50%, 100% { transform: translateY(0); } 25% { transform: translateY(-30px); } }

.dz-reach .dz-fig { animation-name: dz-stretch; }
.dz-reach .dz-arm-l { animation-name: dz-reach-l; }
.dz-reach .dz-arm-r { animation-name: dz-reach-r; }
@keyframes dz-stretch { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-14px) scaleY(1.04); } }
@keyframes dz-reach-l { 0%, 100% { transform: rotate(160deg); } 50% { transform: rotate(176deg); } }
@keyframes dz-reach-r { 0%, 100% { transform: rotate(-160deg); } 50% { transform: rotate(-176deg); } }

.dz-star .dz-fig { animation-name: dz-star; }
.dz-star .dz-arm-l { animation-name: dz-star-l; }
.dz-star .dz-arm-r { animation-name: dz-star-r; }
.dz-star .dz-leg-l { animation-name: dz-splay-l; }
.dz-star .dz-leg-r { animation-name: dz-splay-r; }
@keyframes dz-star { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }
@keyframes dz-star-l { 0%, 100% { transform: rotate(12deg); } 50% { transform: rotate(168deg); } }
@keyframes dz-star-r { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(-168deg); } }
@keyframes dz-splay-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(24deg); } }
@keyframes dz-splay-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-24deg); } }

.dz-spin .dz-svg { animation-name: dz-spin; animation-duration: calc(var(--beat) * 1.6); animation-timing-function: linear; }
.dz-spin .dz-arm-l { transform: rotate(95deg); }
.dz-spin .dz-arm-r { transform: rotate(-95deg); }
@keyframes dz-spin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }

.dz-squat .dz-fig { animation-name: dz-squat; animation-duration: calc(var(--beat) * 1.4); }
.dz-squat .dz-leg-l { animation-name: dz-splay-l; animation-duration: calc(var(--beat) * 1.4); }
.dz-squat .dz-leg-r { animation-name: dz-splay-r; animation-duration: calc(var(--beat) * 1.4); }
.dz-squat .dz-arm-l { transform: rotate(80deg); }
.dz-squat .dz-arm-r { transform: rotate(-80deg); }
@keyframes dz-squat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(32px); } }

.dz-hop .dz-fig { animation-name: dz-hop; animation-duration: calc(var(--beat) / 1.5); }
.dz-hop .dz-leg-r { transform: rotate(-38deg) translateY(-8px); }
.dz-hop .dz-arm-l { transform: rotate(70deg); }
.dz-hop .dz-arm-r { transform: rotate(-70deg); }
@keyframes dz-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-26px); } }

.dz-robot .dz-arm-l { animation-name: dz-robot-l; animation-timing-function: steps(1, end); }
.dz-robot .dz-arm-r { animation-name: dz-robot-r; animation-timing-function: steps(1, end); }
.dz-robot .dz-head { animation-name: dz-robot-head; animation-timing-function: steps(1, end); }
.dz-robot .dz-fig { animation-name: dz-robot; animation-timing-function: steps(1, end); }
@keyframes dz-robot-l { 0% { transform: rotate(90deg); } 50% { transform: rotate(20deg); } 100% { transform: rotate(90deg); } }
@keyframes dz-robot-r { 0% { transform: rotate(-20deg); } 50% { transform: rotate(-90deg); } 100% { transform: rotate(-20deg); } }
@keyframes dz-robot-head { 0% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } 100% { transform: rotate(-10deg); } }
@keyframes dz-robot { 0% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 100% { transform: translateX(-6px); } }

.dz-swim .dz-fig { animation-name: dz-sway; }
.dz-swim .dz-arm-l { animation-name: dz-swim-l; animation-timing-function: linear; animation-duration: calc(var(--beat) * 1.2); }
.dz-swim .dz-arm-r { animation-name: dz-swim-r; animation-timing-function: linear; animation-duration: calc(var(--beat) * 1.2); animation-delay: calc(var(--since) - var(--beat) * 0.6); }
@keyframes dz-swim-l { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes dz-swim-r { from { transform: rotate(0); } to { transform: rotate(-360deg); } }

.dz-disco .dz-fig { animation-name: dz-sway; }
.dz-disco .dz-arm-r { animation-name: dz-disco; }
.dz-disco .dz-arm-l { transform: rotate(28deg); }
@keyframes dz-disco { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(30deg); } }

.dz-freeze .dz-fig { transform: rotate(5deg); }
.dz-freeze .dz-arm-l { transform: rotate(105deg); }
.dz-freeze .dz-arm-r { transform: rotate(-45deg); }
.dz-freeze .dz-leg-r { transform: rotate(-14deg); }
.frozen .dz { filter: drop-shadow(0 0 22px rgba(140, 196, 255, 0.9)) saturate(0.7) brightness(1.1); }
.dz-ice { position: absolute; top: 4%; right: 18%; font-size: min(70px, 14cqh); animation: an-wag 1.4s ease-in-out infinite; }
.dz-combo { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dz-chip { padding: 4px 14px; border-radius: 999px; border: 2px solid var(--n-line); font-weight: 800; font-size: min(22px, 7cqh); opacity: 0.6; }
.dz-chip.on { opacity: 1; border-color: var(--n-gold); background: rgba(255, 201, 74, 0.25); transform: scale(1.1); }

/* Animal Moves */
.am-panel { gap: 6px; }
.am-window { position: relative; width: min(100%, 140cqh); height: 58cqh; overflow: hidden; border-radius: var(--w-radius-s); background: var(--card); border: 3px solid var(--border); }
.am-reel { display: flex; height: 100%; animation: am-reel var(--spin) cubic-bezier(0.12, 0.8, 0.22, 1) var(--since) both; }
@keyframes am-reel { from { transform: translateX(0); } to { transform: translateX(var(--to)); } }
.am-slot { flex: 1 1 0; min-width: 0; padding: 12px; }
.am-slot img { width: 100%; height: 100%; object-fit: contain; }
.am-pointer { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: min(52px, 14cqh); color: var(--n-mark); z-index: 2; }
.am-window::before, .am-window::after { content: ''; position: absolute; top: 0; bottom: 0; width: 33.3%; z-index: 1; pointer-events: none; }
.am-window::before { left: 0; background: linear-gradient(90deg, var(--card) 10%, transparent); }
.am-window::after { right: 0; background: linear-gradient(270deg, var(--card) 10%, transparent); }
.am-star { height: 56cqh; aspect-ratio: 1; display: flex; align-items: flex-end; justify-content: center; }
/* The pop-in counts from the landing (--since), as the move does: a redraw (a
   star tapped, the call ending) must not play it again from nothing. */
.am-star img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)); animation: am-in 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) var(--since, 0ms) both; }
@keyframes am-in { from { transform: scale(0.2) translateY(40%); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.am-person:disabled { opacity: 1; }
.am-person.starred { background: color-mix(in srgb, var(--n-gold) 40%, var(--card)); box-shadow: 0 3px 0 var(--border); }
.am-stars { font-weight: 800; }

/* Cup Shuffle */
.cs-stage { flex: 1 1 0; min-height: 0; display: flex; }
.cs-table { position: relative; flex: 1; min-height: 0; container-type: size; }
.cs-cloth {
  position: absolute; left: 3%; right: 3%; bottom: 4%; height: 20%; border-radius: 999px;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--board-sec, var(--sec-guessing)) 62%, var(--card)), color-mix(in srgb, var(--board-sec, var(--sec-guessing)) 80%, var(--border)));
  border: 3px solid var(--border); box-shadow: 0 5px 0 var(--border);
  outline: 2px dashed color-mix(in srgb, #FFFFFF 65%, transparent); outline-offset: -10px; /* the stitching */
}
/* A lifted cup (78% of its height) stays on the board: 12% + 1.78 x 1.25 x 38cqh is under 100%. */
.cs-cup, .cs-animal {
  position: absolute; bottom: 12%; width: min(calc(80cqw / var(--n)), 38cqh); aspect-ratio: 4 / 5; translate: -50% 0;
}
/* On a big TV, a little narrower, so five cups keep gaps between them. */
@media (min-width: 1400px) and (min-height: 800px) {
  .cs-cup, .cs-animal { width: min(calc(68cqw / var(--n)), 38cqh); }
}
.cs-cup {
  border: 0; padding: 0; background: none; color: inherit;
  /* The picture has its own ink outline; a hard shadow sets it on the cloth. */
  filter: drop-shadow(0 5px 0 var(--border));
  transform: translateY(calc(var(--lift, 0) * -78% + var(--arc, 0) * 22%)) scale(calc(1 - var(--arc, 0) * 0.12));
  transition: transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.cs-table:not(.picking) .cs-cup { transition: none; }
.night:has(.cs-table) .cs-cup:not(:disabled) { cursor: pointer; }
.cs-table.picking .cs-cup:not(:disabled) { animation: cs-wobble 1.2s ease-in-out infinite; }
.cs-table.picking .cs-cup:nth-child(odd) { animation-delay: -0.6s; }
@keyframes cs-wobble { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
.cs-cup:disabled { opacity: 1; }
.cs-cup-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; pointer-events: none; }
.cs-cup-num {
  position: absolute; left: 0; right: 0; top: 34%; height: 46%; display: grid; place-items: center;
  font-weight: 800; line-height: 1; color: #FFF1D0; font-size: min(140px, calc(42cqw / var(--n)));
  -webkit-text-stroke: 0.08em var(--border); paint-order: stroke fill;
  animation: cs-num-in 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes cs-num-in { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cs-cup.wrong .cs-cup-art { filter: saturate(0.4) brightness(0.8); }
.cs-animal { z-index: 1; display: flex; align-items: flex-end; justify-content: center; }
.cs-animal.gone { visibility: hidden; }
/* Narrower than the cup's top, so the cup covers it as it comes down. */
.cs-animal img { width: 72%; height: 80%; object-fit: contain; object-position: bottom; }
.cs-animal.found img { animation: am-in 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; filter: drop-shadow(0 0 20px rgba(255, 220, 120, 0.9)); }

/* Rolling Balls: the family on balls on the stage, then a row of answers per player. */
/* The stage is the whole board all round; the answers float on it (the stage
   used to halve when they opened). The wrap is their size container. */
.rb-wrap { flex: 1 1 0; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); container: rb-wrap / size; }
.rb-wrap > * { grid-area: 1 / 1; }
.rb-stage { position: relative; min-height: 0; container-type: size; overflow: hidden; }
/* On a narrow screen "Watch the balls!" takes two lines and most questions
   one: room for two from the start, so the question does not move the stage. */
@media (max-width: 700px) { .prompt:has(+ .rb-wrap) { min-height: 2lh; display: grid; place-items: center; } }
/* The theatre (docs/rolling-balls-stage.txt). The back drop is a little
   taller than the stage, from the bottom up, so the back curtain shows on a
   wide phone too; past its sides the stage is navy, under the open curtains.
   Its wooden floor starts 19% up the picture, so the balls stand at --floor,
   on the front planks, and are small enough for the riders to clear the pelmet. */
.rb-stage {
  --valance: clamp(30px, 15cqh, 130px);
  --floor: 25cqh;
  --open: 0.9s cubic-bezier(0.55, 0, 0.25, 1) calc(0.25s + var(--since, 0ms)) both;
  background: var(--w-ink);
}
.rb-back, .rb-dim, .rb-lights, .rb-front { position: absolute; inset: 0; pointer-events: none; }
.rb-lights { overflow: hidden; }
.rb-back { background: url('../images/rolling-balls/rb-stage-back.webp') 50% 100% / max(100cqw, 213cqh) 120cqh no-repeat; }
/* House lights down as the curtains open. */
.rb-dim { background: var(--w-ink); opacity: 0.4; animation: rb-dim var(--open); }
.rb-front { z-index: 4; overflow: hidden; }
.rb-valance {
  position: absolute; left: 0; right: 0; top: 0; height: var(--valance);
  background: url('../images/rolling-balls/rb-valance.webp') 50% 100% / auto 100% repeat-x;
}
/* The main curtain: two halves (the right one mirrored) that close the
   stage at the start of a round and open, bunching up at the sides. */
.rb-curtain {
  position: absolute; top: 0; bottom: 0; width: 51%; animation: rb-open var(--open);
}
.rb-curtain::before { content: ''; position: absolute; inset: 0; background: url('../images/rolling-balls/rb-curtain-left.webp') 0 0 / 100% 103% no-repeat; }
.rb-curtain.l { left: 0; transform-origin: 0 50%; }
.rb-curtain.r { right: 0; transform-origin: 100% 50%; }
.rb-curtain.r::before { scale: -1 1; }
/* A spotlight: the lamp hangs under the pelmet and turns with its beam. */
.rb-light {
  position: absolute; top: calc(var(--valance) * 1.05); width: 0; height: 0;
  rotate: var(--aim); animation: rb-sweep 7s ease-in-out calc(var(--since, 0ms) - var(--off, 0s)) infinite alternate;
}
.rb-light.l { left: 17%; --from: -14deg; --to: -46deg; --aim: -30deg; }
.rb-light.r { right: 17%; --from: 14deg; --to: 46deg; --aim: 30deg; --off: 2.6s; animation-duration: 5.3s; }
.rb-beam {
  position: absolute; top: 0; left: -45cqh; width: 90cqh; height: 150cqh;
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  background: linear-gradient(to bottom, rgb(255 248 231 / 0.5), rgb(255 248 231 / 0.18) 55%, rgb(255 248 231 / 0) 80%);
  mix-blend-mode: screen; opacity: 0; animation: rb-beam-on 0.4s ease-out calc(1s + var(--since, 0ms)) both;
}
.rb-lamp { position: absolute; left: clamp(-20px, -5cqh, -8px); top: clamp(-40px, -9cqh, -12px); height: clamp(40px, 24cqh, 150px); width: auto; rotate: 30deg; }
.rb-light.r .rb-lamp { left: auto; right: clamp(-20px, -5cqh, -8px); }
.rb-light.r .rb-lamp { scale: -1 1; rotate: -30deg; }
/* Once the answer is out the sweep stops, the beams go and a pool of light
   lands on each ball in turn; the one the question was about glows warm. */
.rb-stage.out .rb-light { animation: none; }
.rb-stage.out .rb-beam { animation: rb-beam-off 0.3s ease-in both; }
.rb-pool {
  position: absolute; bottom: calc(var(--floor) - var(--size-pool) * 0.12); width: var(--size-pool); height: calc(var(--size-pool) * 0.3);
  --size-pool: min(calc(80cqw / var(--n)), 44cqh);
  translate: -50% 0; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse at 50% 50%, rgb(255 248 231 / 0.85), rgb(255 248 231 / 0.35) 45%, transparent 70%);
  animation: rb-pool-in 0.18s ease-out calc(0.2s + var(--k, 0) * 0.14s) both;
}
.rb-pool.star { background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--w-sun) 70%, var(--w-board)), color-mix(in srgb, var(--w-sun) 40%, transparent) 45%, transparent 70%); }
/* A short stage (the answers open on a phone): no pelmet or lamps, so the
   family stay big enough to see; the curtains and beams frame it still. */
@container (max-height: 200px) {
  .rb-ball, .rb-light { --valance: 0px; }
  .rb-ball { --floor: 22cqh; }
  .rb-valance, .rb-lamp { display: none; }
}
/* A short stage while the family answer (a phone held sideways): the balls
   roll on a floor just above the answer cards, so no card hides a ball's picture. */
@container (max-height: 300px) {
  .rb-wrap:has(.rb-choices) .rb-ball { --floor: calc(clamp(64px, 22cqh, 170px) + 14px); }
}
@keyframes rb-dim { from { opacity: 0; } }
@keyframes rb-open { from { scale: 1 1; } to { scale: 0.16 1; } }
@keyframes rb-sweep { from { rotate: var(--from); } to { rotate: var(--to); } }
@keyframes rb-beam-on { to { opacity: 1; } }
@keyframes rb-beam-off { from { opacity: 1; } to { opacity: 0; } }
@keyframes rb-pool-in { from { opacity: 0; scale: 0.6; } }
@media (prefers-reduced-motion: reduce) {
  .rb-curtain { animation: none; scale: 0.16 1; }
  .rb-dim { animation: none; }
  .rb-light { animation: none; }
  .rb-beam { animation: none; opacity: 1; }
  .rb-pool { animation: none; }
}
/* A ball and its rider: the ball is --size wide, the rider stands on top. */
.rb-ball {
  --size: min(calc(62cqw / var(--n)), 34cqh, calc((100cqh - var(--floor) - var(--valance)) / 2.55));
  position: absolute; bottom: var(--floor, 9%); width: var(--size); height: calc(var(--size) * 2.6); translate: -50% 0;
  /* Passing in depth: nearer the camera is a little lower and bigger. */
  transform: translateY(calc(var(--depth, 0) * 5%)) scale(calc(1 + var(--depth, 0) * 0.08));
}
/* A 3D beach ball: panels that turn as it rolls, under a light that stays put
   (a highlight top left, the rim and the underside in shade), so it reads round. */
.rb-sphere {
  --ball: var(--w-sun); --ball-edge: var(--w-sun-edge);
  position: absolute; left: 0; bottom: 0; width: var(--size); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: var(--w-board); box-shadow: 0 0 0 var(--w-line) var(--w-ink);
}
.rb-ball:nth-child(3n) .rb-sphere { --ball: var(--w-movement); --ball-edge: var(--w-roof); }
.rb-ball:nth-child(3n+1) .rb-sphere { --ball: var(--w-good); --ball-edge: var(--w-good-edge); }
.rb-ball:nth-child(4n+2) .rb-sphere { --ball: var(--w-guessing); --ball-edge: var(--w-ink-soft); }
.rb-panels {
  position: absolute; inset: 0; border-radius: 50%; rotate: var(--spin, 0deg);
  background:
    radial-gradient(circle at 50% 50%, var(--w-board) 0 7%, var(--ball-edge) 7.5% 9%, transparent 9.5%),
    repeating-conic-gradient(from 0deg, var(--ball) 0 45deg, var(--w-board) 45deg 90deg);
}
/* The picture: a round patch on the surface that turns with the ball. */
.rb-face {
  position: absolute; left: 17%; top: 17%; width: 66%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: var(--w-board); box-shadow: 0 0 0 calc(var(--w-line) * 0.75) var(--w-board), 0 0 0 var(--w-line) var(--ball-edge);
  translate: calc(var(--fx, 0) * 52%) 0; scale: var(--fs, 0) 1; opacity: min(1, calc(var(--look, 0) * 3));
}
.rb-face img { width: 100%; height: 100%; object-fit: cover; }
.rb-shade {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle at 36% 30%, transparent 0 38%, rgb(38 48 82 / 0.16) 62%, rgb(38 48 82 / 0.5) 88%, rgb(38 48 82 / 0.68) 100%),
    radial-gradient(ellipse at 50% 108%, rgb(255 255 255 / 0.28) 0 22%, transparent 40%);
}
.rb-shine {
  position: absolute; left: 16%; top: 11%; width: 34%; height: 24%; border-radius: 50%; rotate: -28deg; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgb(255 255 255 / 0.9) 0 18%, rgb(255 255 255 / 0.35) 45%, transparent 72%);
}
.rb-sphere.gl { background: none; box-shadow: none; overflow: visible; }
.rb-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rb-stage.out .rb-face { left: 8%; top: 8%; width: 84%; transition: opacity 0.5s, scale 0.5s; }
.rb-shadow {
  position: absolute; left: 8%; width: 84%; bottom: calc(var(--size) * -0.06); height: calc(var(--size) * 0.16); border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgb(38 48 82 / 0.45), transparent 70%);
}
.rb-who {
  position: absolute; left: -15%; width: 130%; bottom: calc(var(--size) * 0.86); height: calc(var(--size) * 1.7);
  object-fit: contain; object-position: bottom; transform-origin: 50% 100%;
  transition: rotate 0.25s ease-out; animation: rb-bob 0.9s ease-in-out infinite;
}
.rb-ball:nth-child(even) .rb-who { animation-delay: -0.45s; }
/* The moving rider (src/ui/riderGl.js): the picture bent by its bones, on a
   canvas a little bigger than the picture so raised arms and a lean fit. It
   takes the plain picture's place once it is ready. */
.rb-rig {
  position: absolute; left: calc(var(--size) * -0.41); width: calc(var(--size) * 1.82); height: calc(var(--size) * 1.82);
  bottom: calc(var(--size) * 0.756); pointer-events: none; visibility: hidden;
}
.rb-ball.rigged .rb-rig { visibility: visible; }
.rb-ball.rigged .rb-who { visibility: hidden; }
.rb-who.wait { visibility: hidden; } /* a 3D rider still loading: never flat first */
/* Body moves: lean into the roll, wobble back, a proud bounce when the picture shows. */
.rb-ball[data-pose='lean-r'] .rb-who { rotate: 9deg; }
.rb-ball[data-pose='lean-l'] .rb-who { rotate: -9deg; }
.rb-ball[data-pose='balance'] .rb-who { animation-name: rb-balance; }
.rb-ball[data-pose='proud'] .rb-who { animation-name: rb-proud; animation-duration: 0.5s; }
@keyframes rb-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3%; } }
@keyframes rb-balance { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
@keyframes rb-proud { 0%, 100% { translate: 0 0; scale: 1; } 50% { translate: 0 -6%; scale: 1.04; } }
.rb-stage.out .rb-who { animation: none; rotate: 0deg; }
/* The players along the top, the answer cards on the front of the stage
   below the balls; the stage shows between them. */
.rb-answers {
  z-index: 5; min-height: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none;
  padding: clamp(6px, 3cqh, 24px) clamp(8px, 2cqw, 24px) clamp(6px, 2cqh, 16px);
  animation: rb-float-in 0.35s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.rb-answers > * { pointer-events: auto; }
@keyframes rb-float-in { from { opacity: 0; scale: 0.94; } }
.rb-strip { align-self: center; display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(6px, 0.8vw, 12px); }
.rb-strip .rb-player { box-shadow: 0 var(--w-lip) 0 var(--w-ink); }
.rb-player {
  position: relative; display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 3px 14px 3px 4px; border-radius: 999px;
  background: var(--w-board); border: var(--w-line) solid var(--w-board-edge); color: var(--w-ink);
}
.rb-player-name { font-size: var(--w-text-s); font-weight: 800; }
.rb-player.now { border-color: var(--w-player); box-shadow: 0 0 0 4px color-mix(in srgb, var(--w-player) 35%, transparent); animation: rb-now 1s ease-in-out infinite; }
@keyframes rb-now { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }
.rb-player.done, .rb-player:disabled { opacity: 1; }
.rb-player.done { opacity: 0.6; }
.rb-player.right { background: color-mix(in srgb, var(--w-good) 25%, var(--w-board)); border-color: var(--w-good); }
.rb-player.oops { background: color-mix(in srgb, var(--w-oops) 25%, var(--w-board)); border-color: var(--w-oops); }
.rb-tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--w-good); color: var(--w-board); font-weight: 800; }
.rb-choices {
  --card: clamp(64px, min(22cqh, calc((100cqw - 48px) / var(--n) - 12px)), 170px);
  align-self: center; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 1vw, 16px); padding-bottom: var(--w-lip);
}
.rb-choices .rb-choice { width: var(--card); height: var(--card); }
/* A short stage (a phone held sideways): smaller faces, so the family show. */
@container rb-wrap (max-height: 300px) {
  .rb-answers { padding-top: 4px; padding-bottom: 4px; }
  .rb-player { min-height: 0; padding: 2px 10px 2px 2px; }
  .rb-player .avatar { --size: 28px !important; }
}
.rb-choice {
  position: relative; min-height: var(--w-tap); padding: 6px; border-radius: var(--w-radius-s); display: grid; place-items: center; overflow: hidden;
  background: var(--w-board); border: var(--w-line) solid var(--w-player, var(--w-ink)); box-shadow: 0 var(--w-lip) 0 var(--w-ink); color: var(--w-ink);
}
.rb-choice img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.rb-choice b { font-size: var(--w-title); font-weight: 800; }
.rb-choice:active:not(:disabled) { translate: 0 var(--w-lip); box-shadow: none; }
.rb-choice:disabled { opacity: 1; }
.rb-choice.right { background: color-mix(in srgb, var(--w-good) 35%, var(--w-board)); border-color: var(--w-good-edge); }
.rb-choice.oops { background: color-mix(in srgb, var(--w-oops) 35%, var(--w-board)); border-color: var(--w-oops-edge); }
.rb-by { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; }
.rb-result { display: flex; align-items: center; gap: 14px; }
.rb-result-face { width: clamp(64px, 8vw, 120px); aspect-ratio: 1; display: grid; place-items: center; }
.rb-result-face img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rb-result-face b { font-size: var(--w-title); }
@media (prefers-reduced-motion: reduce) { .rb-who, .rb-answers { animation: none; } }

/* Rolling Balls on the card table. */
.tbl-rb { position: absolute; bottom: 14%; width: 34%; height: 80%; }
.tbl-rb.l { left: 8%; }
.tbl-rb.r { right: 8%; }
.tbl-rb-who { position: absolute; left: 0; right: 0; bottom: 38%; height: 62%; width: 100%; object-fit: contain; object-position: bottom; }
.tbl-rb-ball {
  position: absolute; left: 6%; right: 6%; bottom: 0; aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 30%, var(--w-board), var(--w-sun) 55%, var(--w-sun-edge)); border: 3px solid var(--w-ink);
}
.tbl-rb-ball img { width: 62%; height: 62%; object-fit: cover; border-radius: 50%; }

/* Animal Race */
.ar-lanes { flex: 1 1 0; min-height: 0; display: grid; grid-template-rows: repeat(var(--lanes), minmax(0, 1fr)); gap: clamp(6px, 1vh, 12px); }
.ar-lane {
  display: grid; grid-template-columns: 4.5em minmax(0, 1fr) min(560px, 50%); align-items: center; gap: clamp(8px, 1.4vw, 18px);
  padding: 6px clamp(8px, 1.2vw, 16px); border-radius: var(--w-radius-s); background: var(--card); border: 3px solid var(--c);
  box-shadow: 0 4px 0 var(--border); container-type: size; min-height: 0;
}
.ar-lane.right { background: color-mix(in srgb, var(--n-yes) 24%, var(--card)); }
.ar-lane.wrong { background: color-mix(in srgb, var(--n-no) 18%, var(--card)); }
.ar-who { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; font-size: clamp(16px, 20cqh, 18px); }
.ar-who .avatar { --size: min(44px, 40cqh) !important; width: var(--size); height: var(--size); }
.ar-track {
  position: relative; height: 82cqh; --runner: min(80cqh, 120px);
  /* The track: the game's colour printed in a strip, a white start line on
     the left and a chequered finish line on the right. */
  background:
    linear-gradient(var(--card), var(--card)) left / 4px 100% no-repeat,
    repeating-conic-gradient(var(--border) 0 25%, var(--card) 0 50%) right top / 14px 14px repeat-y,
    color-mix(in srgb, var(--board-sec, var(--sec-learning)) 26%, var(--card));
  border-radius: 12px; border: 2px solid var(--border);
}
.ar-flag { position: absolute; right: -4px; top: 50%; transform: translateY(-50%); font-size: min(44px, 44cqh); }
.ar-tick { position: absolute; top: 30%; bottom: 30%; width: 3px; border-radius: 2px; background: var(--card); opacity: 0.8; }
.ar-runner { position: absolute; bottom: 4%; width: var(--runner); height: 92%; display: flex; align-items: flex-end; justify-content: center; }
.ar-runner img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); }
.ar-runner img.flip { transform: scaleX(-1); }
.ar-runner.running { animation: ar-run 0.9s ease-out var(--since) both; }
.ar-runner.running img, .ar-runner.won img { animation: an-gallop 0.3s ease-in-out infinite; }
.ar-runner.won { filter: drop-shadow(0 0 16px rgba(255, 220, 120, 0.9)); }
@keyframes ar-run { from { left: var(--from); } to { left: var(--to); } }
.ar-ask { display: flex; align-items: center; justify-content: flex-end; gap: clamp(8px, 1.2vw, 16px); min-width: 0; }
.ar-q { flex: 1 1 auto; font-size: min(44px, 40cqh); font-weight: 800; white-space: nowrap; text-align: center; }
/* Little counts the animals: one row as big as the lane allows, two rows past three. */
.ar-q.count { display: grid; grid-template-columns: repeat(3, min(64px, 72cqh)); justify-content: center; gap: 2px 4px; min-width: 0; }
.ar-q.count.two { grid-template-columns: repeat(3, min(48px, 44cqh)); }
.ar-q.count img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.ar-choices { display: flex; gap: clamp(6px, 0.8vw, 12px); }
.ar-choice {
  min-width: min(96px, 78cqh); height: min(84px, 74cqh); border: 3px solid var(--border); border-radius: var(--w-radius-s); background: #FFFFFF; color: var(--navy) !important;
  font-size: min(36px, 36cqh); font-weight: 800; box-shadow: 0 4px 0 var(--border);
}
.ar-choice:not(:disabled):active { transform: translateY(4px); box-shadow: none; }
.ar-choice:disabled { opacity: 0.45; }
.ar-choice.right { opacity: 1; background: var(--n-yes); color: var(--navy) !important; box-shadow: 0 4px 0 var(--border); }
.ar-finish { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .ar-lane { grid-template-columns: 3.5em minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .ar-ask { grid-column: 1 / -1; }
  .ar-track { height: 46cqh; --runner: min(44cqh, 80px); }
  .ar-q { font-size: min(28px, 22cqh); }
  .ar-choice { height: min(56px, 40cqh); min-width: 56px; font-size: min(24px, 22cqh); }
}

/* Tall screens: the cups sit in the middle, not at the very bottom. */
@media (max-aspect-ratio: 3/4) {
  .cs-cup, .cs-animal { bottom: 34%; }
  .cs-cloth { bottom: 26%; }
}

@media (prefers-reduced-motion: reduce) {
  /* The moves are the game, so they stay, only slower. */
  .dz { --beat: 1600ms; }
  [class^='an-'], [class*=' an-'] { animation-duration: 2s; }
  .cs-table.picking .cs-cup { animation: none; }
}

/* A screen that failed to draw (app.js) */
.crash { display: grid; place-items: center; padding: 24px; }
.crash-card { max-width: 440px; padding: 28px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.crash-card h1 { margin: 0; font-size: 28px; }
.crash-card p { margin: 0; color: var(--muted); }
.crash-emoji { font-size: 56px; line-height: 1; }
.crash-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* The buttons in the top corner (sound, music, full screen) */
.corner { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); z-index: 15; display: flex; gap: 8px; }
.corner > .fullscreen, .corner > .music-toggle, .play-tools > .fullscreen { position: static; }
.play-tools { display: flex; gap: 8px; margin-left: auto; align-self: flex-start; }
/* 56px: a comfortable target for small fingers (48px on a short phone,
   64px on a TV, below). */
.corner-btn {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--dash); background: var(--card); color: var(--ink); opacity: 0.85; cursor: pointer;
}
.corner-btn:focus-visible, .corner-btn[aria-expanded="true"] { opacity: 1; }
@media (hover: hover) { .corner-btn:hover { opacity: 1; } }
.corner-btn.off { color: var(--dash); }
@media (min-width: 1400px) and (min-height: 800px) {
  .corner-btn, .corner > .fullscreen, .corner > .music-toggle, .play-tools > .fullscreen, .bar-tools > .fullscreen, .bar-tools > .music-toggle { width: 64px; height: 64px; }
}
@media (max-width: 600px) {
  /* On a phone the corner buttons would sit over the heading: start the screen below them. */
  .screen:not(.play):not(.home):not(.games-screen) { padding-top: 60px; }
  /* In a game they get a row of their own above the title, so a long name has room. */
  .screen.play > .play-head { flex-wrap: wrap; row-gap: 6px; }
  .screen.play > .play-head > .play-tools { order: -1; flex: 1 0 100%; justify-content: flex-end; margin-left: 0; }
  .screen.play > .play-head > .play-title { flex: 1 1 0; }
}

/* The street tour (src/ui/tour.js): a bubble under the bar and a hand
   bouncing over what to tap. Only Got it takes a tap. */
.tour { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.tour-bubble {
  position: absolute; top: var(--tour-top, 80px); left: 50%; transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px)); padding: 14px 18px; display: flex; gap: 12px; align-items: center;
  pointer-events: auto;
}
.tour-bubble p { margin: 0; flex: 1; font-size: 18px; font-weight: 700; line-height: 1.3; }
.tour-hand { position: absolute; left: 0; top: 0; font-size: 56px; line-height: 1; transition: transform 0.3s ease; }
.tour-hand > span { display: block; margin: -1em 0 0 -0.5em; animation: tour-tap 1s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)); }
.tour-hand.swipe { left: 50%; top: 60%; }
.tour-hand.swipe > span { animation: tour-swipe 1.6s ease-in-out infinite; }
@keyframes tour-tap { 50% { transform: translateY(14px); } }
@keyframes tour-swipe { 0%, 100% { transform: translateX(80px); } 50% { transform: translateX(-80px); } }
@media (prefers-reduced-motion: reduce) { .tour-hand > span { animation: none; } .tour-hand { transition: none; } }

/* Getting a game's pictures ready (screens/games.js getReady) */
.ready-sheet {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(23, 26, 69, 0.45);
}
.ready-card { padding: 28px 36px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ready-card p { margin: 0; font-size: 22px; font-weight: 700; }
.ready-dots { display: flex; gap: 10px; }
.ready-dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); animation: ready-bounce 0.9s ease-in-out infinite; }
.ready-dots i:nth-child(2) { animation-delay: 0.15s; }
.ready-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ready-bounce { 50% { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .ready-dots i { animation: none; } }

/* Sound settings */
.sound-panel {
  position: fixed; top: calc(52px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); z-index: 16; width: min(320px, calc(100vw - 16px));
  /* Scrolls when the screen is too short for it (a phone on its side). */
  max-height: calc(100dvh - 60px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
}
.sound-panel > * { flex-shrink: 0; }
.sound-panel h2 { margin: 0; font-size: 20px; }
.sound-row { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.sound-name { display: flex; gap: 8px; align-items: center; }
.sound-row input[type="range"] { width: 100%; accent-color: var(--yellow); min-height: 32px; }
.sound-actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }

/* Showing the app on a TV (src/ui/tv.js) */
.cast-btn.on { opacity: 1; color: var(--on-ink); background: var(--ink); border-color: var(--ink); }
.cast-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; line-height: 1.35; }
.cast-note { margin: 0; color: var(--muted); font-size: 16px; }
.tv-turn {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px; text-align: center; background: var(--bg); color: var(--ink);
}
.tv-turn p { margin: 0; font-size: 24px; font-weight: 800; max-width: 20ch; }
.tv-turn-emoji { font-size: 64px; line-height: 1; animation: tv-turn 1.6s ease-in-out infinite; }
@keyframes tv-turn { 0%, 30% { transform: rotate(0deg); } 60%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .tv-turn-emoji { animation: none; } }
/* The TV layout, sideways: many TVs crop the picture's edges (overscan), so
   everything sits 3% in from them. The phone is scaled down to show the TV
   width (--tv-scale, set by tv.js) but is still what people tap: its buttons
   stay at least 44px on its own screen. */
html[data-tv="wide"] { --tv-touch: calc(44px / (var(--tv-scale, 1) * 0.94)); }
html[data-tv="wide"] #app { transform: scale(0.94); transform-origin: center; }
/* !important: a floor under every screen's own button sizes. */
html[data-tv="wide"] :is(.btn, .night-go, .icon-btn, .corner-btn, .corner > .fullscreen, .corner > .music-toggle, .play-tools > .fullscreen, .bar-tools > .fullscreen, .bar-tools > .music-toggle) {
  min-width: var(--tv-touch) !important; min-height: var(--tv-touch) !important;
}

/* The app's own yes/no pop-up (src/ui/confirm.js), in place of the browser's box. */
/* It is the World Kit's question (.w-dialog in assets/world.css); this only adds its entrance. */
.confirm-pop { width: min(680px, calc(100vw - 32px)); animation: zoom-pop 0.35s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.confirm-pop p { margin: 0; font-weight: 700; line-height: 1.3; }

/* Results: the podium (results.js), the night so far, what next */
.podium { display: flex; flex-shrink: 0; justify-content: center; align-items: flex-end; gap: 10px; margin: 0 auto; width: min(520px, 100%); }
.podium .step { flex: 1 1 0; min-width: 0; max-width: 200px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.step-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.step-names { font-weight: 800; text-align: center; overflow-wrap: anywhere; line-height: 1.2; }
.step-block {
  width: 100%; border-radius: 16px 16px 6px 6px; background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding-top: 10px;
}
.place-1 .step-block { height: clamp(64px, 12vh, 120px); background: var(--yellow); color: var(--navy, var(--w-ink)); }
.place-2 .step-block { height: clamp(50px, 9vh, 88px); }
.place-3 .step-block { height: clamp(40px, 6.5vh, 64px); }
.medal { font-size: clamp(22px, 3.4vh, 30px); line-height: 1; }
.step-points { font-size: 22px; font-weight: 800; }
@media (prefers-reduced-motion: no-preference) {
  .podium .step { animation: step-rise 0.5s ease-out both; }
  .podium .place-2 { animation-delay: 0.15s; }
  .podium .place-1 { animation-delay: 0.3s; }
  @keyframes step-rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.standings.tonight h2 { margin: 0; font-size: 18px; }
.tonight-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tonight-rule { margin: 0 0 4px; font-size: 16px; color: var(--muted); text-align: left; }
.score-row .credit { display: block; font-size: 16px; font-weight: 600; color: var(--muted); }
.results-next { justify-content: center; flex-wrap: wrap; gap: 10px; }

/* A right or wrong answer, the moment it shows (rounds.js, stages.js) */
@media (prefers-reduced-motion: no-preference) {
  .pop { animation: answer-pop 0.5s ease-out; }
  @keyframes answer-pop {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(61, 197, 150, 0.7); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); box-shadow: 0 0 0 18px rgba(61, 197, 150, 0); }
  }
}

/* The trophy shelf (screens/shelf.js) and its news on the results */
.sticker { position: relative; display: inline-grid; place-items: center; width: 84px; height: 84px; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden; background: var(--card); box-shadow: 0 0 0 4px var(--yellow), var(--shadow); }
.sticker .game-art { width: 100%; height: 100%; aspect-ratio: auto; padding: 0; }
.sticker .game-art > * { width: 100%; height: 100%; object-fit: cover; }
.sticker.empty { background: var(--soft); box-shadow: inset 0 0 0 3px var(--dash); color: var(--dash); font-size: 34px; font-weight: 800; }
.sticker-times { position: absolute; right: 2px; bottom: 2px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 16px; font-weight: 800; }
.shelf-stickers { display: flex; flex-wrap: wrap; gap: 12px; }
.shelf-news { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: var(--w-radius-s);
  background: var(--card); box-shadow: var(--shadow); font-size: 19px; text-align: left; }
.shelf-news > div { display: flex; flex-direction: column; gap: 2px; }
.shelf-news .sticker { width: 64px; height: 64px; }
.night-champ { font-weight: 700; color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .shelf-news .sticker { animation: sticker-in 0.8s cubic-bezier(.2, 1.6, .4, 1) 0.4s both; }
  @keyframes sticker-in { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
}
/* The buttons for what to do next stay in sight when the scores run long.
   The toy coins stand on their own: no strip behind them. */
.results .results-next { position: sticky; bottom: 0; z-index: 2; width: 100%; padding: 22px 0 10px; gap: 18px 22px; }
/* The grass the coins stand on, fading up over the scores and out at the sides. */
.results .results-next::before {
  content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--w-grass-light) 92%, transparent) 34%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.shelf-stickers .sticker { width: 64px; height: 64px; }
.shelf-stickers .sticker.empty { font-size: 26px; }

/* Who Am I?: what a right answer pays now, by the prompt (rounds.js). */
.clue-worth { display: inline-block; margin-left: 12px; padding: 2px 12px; border-radius: 999px; background: var(--yellow); color: var(--navy); font-size: 0.8em; font-weight: 800; vertical-align: middle; }

/* Guess My Number above 30: the number line (stages.js) */
.gn-line { display: flex; align-items: center; gap: 12px; padding: 22px 4px 4px; font-weight: 800; }
.gn-end { font-size: clamp(16px, 2vh, 18px); color: var(--muted); font-variant-numeric: tabular-nums; }
.gn-track { position: relative; flex: 1 1 auto; height: 14px; border-radius: 999px; background: var(--n-glass, var(--soft)); }
.gn-window { position: absolute; top: -4px; bottom: -4px; min-width: 6px; border-radius: 999px; background: var(--yellow); transition: left 0.4s ease, width 0.4s ease; }
.gn-low, .gn-high, .gn-both { position: absolute; bottom: calc(100% + 2px); font-size: clamp(16px, 1.9vh, 17px); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gn-low { left: 0; transform: translateX(-50%); }
.gn-high { right: 0; transform: translateX(50%); }
.gn-mark { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); opacity: 0.55; }
.gn-mark.right { width: auto; opacity: 1; top: auto; bottom: calc(100% + 2px); transform: translateX(-50%); margin: 0; padding: 0 8px; border-radius: 999px; background: var(--n-yes, var(--good)); color: var(--navy); font-size: clamp(16px, 1.9vh, 17px); }
@media (prefers-reduced-motion: reduce) { .gn-window { transition: none; } }
.gn-both { left: 50%; transform: translateX(-50%); }

/* The podium rises one step at a time: the others, third, second, and the
   winner last, with the winner's name popping up as their step lands. */
@media (prefers-reduced-motion: no-preference) {
  .podium .step { animation: step-rise 0.6s cubic-bezier(.2, 1.3, .4, 1) both; }
  .podium .place-next { animation-delay: 0s; }
  .podium .place-3 { animation-delay: 0.4s; }
  .podium .place-2 { animation-delay: 1s; }
  .podium .place-1 { animation-delay: 1.7s; }
  .results.has-podium h1 { animation: winner-pop 0.6s cubic-bezier(.2, 1.6, .4, 1) 2s both; }
  @keyframes winner-pop { from { transform: scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* The last winners' crown on their game's shop (street.js crown) */
.shop-champ { position: absolute; z-index: 3; left: 4%; top: calc(-2 * var(--u)); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.shop-crown { font-size: calc(7 * var(--u)); line-height: 1; margin-bottom: calc(-2.2 * var(--u)); position: relative; z-index: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25)); }
.shop-champ-faces { display: flex; align-items: center; }
.shop-champ-faces .avatar { --size: calc(9 * var(--u)); width: var(--size); height: var(--size); font-size: calc(4.6 * var(--u)); border: calc(0.6 * var(--u)) solid var(--w-board); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.shop-champ-faces .avatar + .avatar { margin-left: calc(-2.5 * var(--u)); }
.shop-champ-more { margin-left: calc(0.6 * var(--u)); padding: 0 calc(1.2 * var(--u)); border-radius: 999px; background: var(--w-board); color: var(--w-ink); font-weight: 800; font-size: calc(3.4 * var(--u)); }
@media (prefers-reduced-motion: no-preference) {
  .shop-crown { animation: crown-bob 2.4s ease-in-out infinite; }
  @keyframes crown-bob { 50% { transform: translateY(calc(-0.8 * var(--u))) rotate(-6deg); } }
}

/* The end-of-night recap (screens/recap.js) */
.recap-list { flex: 1 1 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 4px; position: relative; z-index: 1; }
.recap-list > * { flex-shrink: 0; width: min(680px, 100%); }
.recap-star { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; text-align: center; }
.recap-star h2, .recap-stickers h2 { margin: 0; }
.recap-star .sub { margin: 0; }
.recap-kicker { font-size: 16px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.recap-stickers { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.recap-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.recap-row .name { font-size: 20px; font-weight: 700; min-width: 4em; }
.recap-best { margin: 0; font-size: 20px; font-weight: 700; text-align: center; }
.recap-screen .results-next { position: relative; z-index: 1; padding-bottom: max(10px, env(safe-area-inset-bottom)); }   /* room for the buttons' lip on a short screen */

/* Bus colours unlocked on the trophy shelf (street.js bus, games.js busPicker).
   The bus picture is yellow: the others turn its hue. */
.street-bus.bus-red .street-bus-art, .street-bus.bus-red .street-bus-drawn, .street-bus.bus-red .bus-body { filter: hue-rotate(-58deg) saturate(2) brightness(0.92); }
.street-bus.bus-purple .street-bus-art, .street-bus.bus-purple .street-bus-drawn, .street-bus.bus-purple .bus-body { filter: hue-rotate(225deg) saturate(1.1); }
.street-bus.bus-rainbow .street-bus-art, .street-bus.bus-rainbow .street-bus-drawn, .street-bus.bus-rainbow .bus-body { animation: bus-rainbow 6s linear infinite; }
@keyframes bus-rainbow { to { filter: hue-rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .street-bus.bus-rainbow .street-bus-art, .street-bus.bus-rainbow .street-bus-drawn, .street-bus.bus-rainbow .bus-body { animation: none; filter: hue-rotate(150deg); } }
.look-bus { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.look-bus-label { font-size: 18px; font-weight: 700; margin-right: 4px; }
.look-bus-color { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--line); display: grid; place-items: center; font-size: 18px; }
.look-bus-color[aria-pressed='true'] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
.look-bus-color:disabled { opacity: 0.55; }
.look-bus-color.bus-yellow { background: #FFBE2E; }
.look-bus-color.bus-red { background: #E5484D; }
.look-bus-color.bus-purple { background: #9B7BFF; }
.look-bus-color.bus-rainbow { background: conic-gradient(#E5484D, #FFBE2E, #3DC596, #3BA9E0, #9B7BFF, #E5484D); }

/* The family's row on the trophy shelf: unlocks, the week's challenge, records */
.shelf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shelf-chip { padding: 4px 12px; border-radius: 999px; background: var(--soft); font-size: 16px; font-weight: 700; }
.shelf-news.more span { font-weight: 700; }
.recap-rewards { display: flex; flex-direction: column; gap: 6px; }

/* Shadow: at the answer the silhouette fills in with the picture (rounds.js) */
@media (prefers-reduced-motion: no-preference) {
  .card.feature.unshadow img { animation: unshadow 0.7s ease-out both; }
  @keyframes unshadow {
    from { filter: var(--silhouette, brightness(0)); transform: scale(0.92); }
    55% { filter: var(--silhouette, brightness(0)); transform: scale(1.12); }
    to { filter: none; transform: none; }
  }
}

/* Animal Race: the winner does a victory dance at the flag, crowned (animalRace.js .won) */
.ar-runner.won::before { content: '👑'; position: absolute; top: -18%; left: 50%; font-size: clamp(16px, 3.4vh, 30px); transform: translateX(-50%); z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .ar-runner.won:not(.running) { animation: ar-victory 1.1s ease-in-out infinite; transform-origin: 50% 100%; }
  @keyframes ar-victory {
    0%, 100% { transform: translateY(0) rotate(0); }
    20% { transform: translateY(-22%) rotate(-10deg); }
    40% { transform: translateY(0) rotate(0); }
    60% { transform: translateY(-22%) rotate(10deg); }
    80% { transform: translateY(0) scale(1.08, 0.92); }
  }
}

/* Money Count: the coin jar filling toward the target line (stages.js jar) */
.mc-jar { position: relative; height: clamp(18px, 3.2vh, 30px); border-radius: 999px; background: var(--soft); box-shadow: inset 0 0 0 3px var(--line); margin: 14px 4px 4px; flex-shrink: 0; }
.mc-jar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #E8A53A, #FFCF4A); transition: width 0.35s cubic-bezier(.2, 1.3, .4, 1); }
.mc-jar.full .mc-jar-fill { background: var(--good); }
.mc-jar.over .mc-jar-fill { background: var(--bad); }
.mc-jar-line { position: absolute; top: -10px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .mc-jar-fill { transition: none; } }

/* Freeze Dance: the illustrated dancer in place of the emoji (movement.js freezeDancer) */
.fd-dancer { position: relative; flex: 1 1 0; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; container-type: size; }
.fd-dancer .dz { height: 100%; }
.fd-dancer .dz-clip { height: min(100%, 100cqw * 16 / 9); }

/* Story Dice: the whole story, die by die, before the vote (stages.js) */
.sd-story { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sd-story-title { font-size: clamp(16px, 2.2vh, 19px); font-weight: 800; color: var(--muted); }
.sd-story-dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sd-story-die { position: relative; display: grid; place-items: center; width: clamp(48px, 9vh, 76px); aspect-ratio: 1; border-radius: var(--w-radius-s); background: var(--card); box-shadow: 0 0 0 4px var(--c); font-size: clamp(26px, 5vh, 44px); }
.sd-story-die img { width: 80%; height: 80%; object-fit: contain; }
.sd-story-who { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--navy); font-size: 13px; font-weight: 800; }
.mv-emoji.simon-icon { font-size: min(96px, 26cqh, 24cqw); }

/* The Player house's sheet: who is playing tonight (screens/tonight.js) */
.games-switches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }

.players-backdrop {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  padding: clamp(8px, 3vh, 32px) clamp(8px, 3vw, 32px); background: rgba(23, 26, 69, 0.45);
}
.players-sheet {
  width: min(1100px, 100%); max-height: min(860px, 100%); display: flex; flex-direction: column;
  gap: clamp(8px, 1.8vh, 20px); padding: clamp(12px, 2.6vh, 32px) clamp(12px, 2.4vw, 32px); overflow: hidden;
}
.players-sheet > * { flex-shrink: 0; }
.players-sheet .people { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 4px; grid-auto-rows: clamp(240px, 30dvh, 290px); }   /* tall enough for face, name, level and buttons */
.players-sheet .bar { box-shadow: none; border: 2px solid var(--line); }
.players-sheet h1 { font-size: clamp(22px, min(3.6vw, 5vh), 44px); margin: 0; }
/* A phone on its side: stacked, the cards got ~126px of the ~192px they need
   and cut off their Play / Host buttons. Side by side instead: the people
   fill the left, and the mode and Done stand in a column on the right. */
@media (max-height: 560px) and (min-aspect-ratio: 4/3) {
  .players-backdrop { padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); }
  .players-sheet {
    display: grid; max-height: 100%; height: 100%; gap: 8px 14px; padding: 10px 14px;
    grid-template-columns: minmax(0, 1fr) clamp(200px, 28vw, 260px); grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .players-sheet > .head { grid-column: 1 / -1; }
  .players-sheet .people { grid-column: 1; grid-row: 2 / 4; align-content: start; grid-auto-rows: minmax(240px, 1fr); }
  .players-sheet .mode-hint { grid-column: 2; grid-row: 2; align-self: end; margin: 0; }
  .players-sheet .bar { grid-column: 2; grid-row: 3; flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; }
  .players-sheet .bar-info { flex-direction: column; align-items: flex-start; gap: 6px; }
  .players-sheet .bar-info, .players-sheet .bar-info > div { width: 100%; }
  .players-sheet .bar-info .muted { display: none; }
  .players-sheet .bar-info .segmented { flex: 1; }
  .players-sheet .bar-info .segmented button { flex: 1; min-width: 0; }
  .players-sheet .bar .btn.primary { width: 100%; min-height: var(--w-tap); }
}
@media (max-width: 600px) {
  .players-backdrop { align-items: flex-end; padding: 0; }
  .players-sheet { max-height: 94dvh; width: 100%; border-radius: 24px 24px 0 0; padding: 14px 12px calc(12px + env(safe-area-inset-bottom)); }
  .players-sheet .head { align-items: flex-start; }
}

/* A phone on its side (about 844 x 325 under Safari's bars): the phone rules
   above are for narrow screens, so these fit the short one. The corner
   buttons stand in a column on the right and the screens leave room for
   them; nothing goes under the notch. */
@media (max-height: 560px) {
  .screen {
    padding-top: clamp(6px, 2vh, 48px); padding-bottom: max(clamp(6px, 2vh, 48px), env(safe-area-inset-bottom));
    padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
  .corner { flex-direction: column; gap: 6px; }
  .corner-btn, .corner > .fullscreen, .corner > .music-toggle { width: 48px; height: 48px; }
  .screen:not(.play):not(.home):not(.games-screen) { padding-right: calc(60px + env(safe-area-inset-right)); }
  .sound-panel { top: calc(8px + env(safe-area-inset-top)); right: calc(60px + env(safe-area-inset-right)); max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 12px 16px; gap: 8px; }
  .cast-steps { font-size: 18px; gap: 4px; }
  .cast-note { font-size: 18px; }
  .version { opacity: 0.6; font-size: 11px; }

  /* Family: the form scrolls instead of being cut off. */
  .member-form { overflow-y: auto; }
  /* Its button stays in sight while the rest scrolls. */
  .member-form .form-actions { position: sticky; bottom: calc(-1 * clamp(14px, 2.6vh, 28px)); margin-bottom: calc(-1 * clamp(14px, 2.6vh, 28px)); padding: 8px 0 clamp(14px, 2.6vh, 28px); background: var(--card); }
  .members { grid-auto-rows: minmax(0, 180px); }

  /* A game: the Ready card fits, and scrolls if it still can't. */
  .screen.play { padding-top: 6px; gap: 6px; }
  .icon-btn { width: 44px; height: 44px; }
  .play-tools .corner-btn, .play-tools > .fullscreen { width: 48px; height: 48px; }
  .stage > .night { overflow-y: auto; }
  .night { padding: 8px; border-width: 5px; }
  .night-ready { padding: 4px; gap: clamp(4px, 1.6vh, 22px); }
  .night-ready .avatar {
    width: clamp(40px, 13vh, 140px); height: clamp(40px, 13vh, 140px); font-size: clamp(18px, 6vh, 63px); margin: 8px 0 6px;
    box-shadow: 0 0 0 2px var(--border), 0 0 0 6px var(--card), 0 0 0 8px var(--border), 0 5px 0 8px var(--board-sec);
  }
  .night-ready .night-big { font-size: clamp(20px, min(4.4vw, 6.4vh), 48px); }
  .night-ready .night-note { font-size: 16px; }
  .night-ready .pill { padding: 1px 12px; font-size: 16px; }
  .night-go { padding: 6px 24px; font-size: 18px !important; }

}

/* The family account (src/ui/screens/account.js). */
.screen.account { align-items: center; gap: 20px; overflow-y: auto; }
.account-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; align-self: stretch; }
.account-head h1 { grid-column: 2; margin: 0; font-size: clamp(24px, 4vw, 40px); text-align: center; }
.account-head .btn { grid-column: 1; grid-row: 1; justify-self: start; }
@media (max-width: 600px) {
  .account-head { grid-template-columns: 1fr; }
  .account-head h1, .account-head .btn { grid-column: 1; grid-row: auto; }
}
.account-form { width: min(460px, 100%); padding: clamp(18px, 3vw, 32px); display: flex; flex-direction: column; gap: 14px; }
.account-form h2 { margin: 0; }
.account-form h3 { margin: 0; font-size: 20px; }
.account-privacy-link { display: inline; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; text-decoration: underline; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.account-privacy { width: min(620px, 100%); }
.account-privacy ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.account-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
/* Game progress (account.js progressSection): one row a game, its reset beside it. */
.account-progress h3 { font-size: 17px; margin: 0; }
.progress-spot { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--w-radius-s); background: var(--soft); }
.progress-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.progress-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.progress-list li > span { display: flex; flex-direction: column; min-width: 0; }
.progress-list li .note { margin: 0; }
.progress-list li .btn { flex: none; }
.account-section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.account-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.account-consent input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; }
.account-owner { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: var(--w-radius-s); background: var(--soft); }
.account-owner h3 { margin: 0; }
.account-verify { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--w-radius-s); background: var(--soft); }
.account-verify p { margin: 0; font-weight: 700; }
.account-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.account-top > div { min-width: 0; }
.account-top p { margin: 4px 0 0; overflow-wrap: anywhere; }
.account-top .btn { flex: none; }
.account-tabs { align-self: stretch; }
.account-tabs button { flex: 1; min-width: 0; padding: 0 6px; white-space: nowrap; font-size: 17px; }
/* Four tabs: two rows of two on a narrow phone. */
@media (max-width: 480px) { .account-tabs { display: grid; grid-template-columns: 1fr 1fr; } }
.account-panel { display: flex; flex-direction: column; gap: 12px; }
.account-panel > .account-section:first-child { border-top: 0; padding-top: 0; }
.account-danger summary { cursor: pointer; font-weight: 700; color: var(--danger); min-height: 44px; display: flex; align-items: center; }
.btn.home-account {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); z-index: 15;
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--card); color: var(--ink);
}
.home-account-dot { color: var(--danger); }

/* Start the night: carry on or a new night, and the past nights
   (src/ui/screens/nights.js, night.js). */
.nights-screen { align-items: center; gap: 20px; overflow-y: auto; }
.nights-head { display: flex; align-items: center; gap: 16px; align-self: stretch; padding-right: 220px; }
.nights-head h1 { margin: 0; font-size: clamp(24px, 3.4vw, 40px); }
@media (max-width: 600px) { .nights-head { padding-right: 0; flex-direction: column; align-items: flex-start; gap: 8px; } }
.night-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; width: min(900px, 100%); }
.night-card { padding: clamp(16px, 3vw, 28px); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.night-card h2 { margin: 0; }
.night-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.night-faces .avatar { width: var(--size, 48px); height: var(--size, 48px); font-size: calc(var(--size, 48px) * 0.45); }
.night-past { width: min(900px, 100%); display: flex; flex-direction: column; gap: 10px; }
.night-past h2 { margin: 0; }
.night-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.night-row {
  width: 100%; min-height: 56px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; text-align: left;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--w-radius-s); background: var(--card); color: var(--ink); font-size: 18px;
}
.night-date { font-weight: 800; }
.night-games { color: var(--muted); }
.night-won { grid-column: 1 / -1; font-weight: 700; }
.night-won:empty { display: none; }
.night-games-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.night-games-list li { padding: 6px 14px; border-radius: 999px; background: var(--soft); font-weight: 700; }

/* The Trophy Hall (src/ui/screens/hall.js): trophies, the leaderboard and
   the star shop as three tabs, one row of players they share. Panels sit one
   tone step off the page, without lines or shadows. */
:root { --hall-can: #146B45; --gold: #F5B800; --silver: #B8C2D6; --bronze: #D9894A; }
.hall-screen { overflow-y: auto; gap: 16px; }
.hall-screen h2, .hall-screen h3, .hall-screen p { margin: 0; }
.hall-screen ul, .hall-screen ol { list-style: none; margin: 0; padding: 0; }
.hall-top { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-right: 208px; }
/* Clear of the corner buttons (sound, music, full screen), fixed top right. */
@media (min-width: 1400px) and (min-height: 800px) { .hall-top { padding-right: 256px; } }
@media (max-width: 600px) { .hall-top { padding-right: 0; } }
.hall-top h1 { margin: 0; font-size: clamp(26px, 2.6vw, 36px); line-height: 1; letter-spacing: -0.02em; }
.hall-back { border-radius: 999px; }
.hall-tabs { display: flex; gap: 6px; padding: 6px; margin-left: auto; border-radius: 999px; background: var(--soft); overflow-x: auto; scrollbar-width: none; }
.hall-tab { min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px; background: transparent; font-size: 20px; font-weight: 800; white-space: nowrap; transition: background 0.15s, transform 0.15s; }
@media (hover: hover) { .hall-tab:hover { background: var(--line); } }
.hall-tab:active { transform: scale(0.96); }
.hall-tab[aria-selected='true'] { background: var(--ink); color: var(--on-ink); }
.hall-who { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 6px 4px; }
.hall-person { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 6px 18px 6px 6px; border: 0; border-radius: 999px; background: var(--card); text-align: left; transition: background 0.15s, transform 0.15s; }
@media (hover: hover) { .hall-person:hover { background: var(--line); } }
.hall-person:active { transform: scale(0.97); }
.hall-person[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); }
.hall-person b { display: block; font-size: 19px; line-height: 1.1; }
.hall-person small { display: block; font-size: 16px; }
.hall-body { display: grid; gap: 16px; align-items: stretch; }
.hall-screen[data-tab='board'] .hall-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }

/* How it works (src/ui/screens/guide.js): the Trophy Hall's top and tabs,
   then a column of cards. */
.guide-body { display: grid; gap: 16px; width: 100%; max-width: 960px; margin: 0 auto; padding-bottom: 24px; }
.guide-intro { font-size: 20px; font-weight: 700; }
.guide-card { display: grid; gap: 12px; padding: 20px 24px; }
.guide-card h2 { font-size: 24px; }
.guide-card h3 { font-size: 18px; color: var(--muted); }
.guide-card p, .guide-list li { font-size: 18px; line-height: 1.4; }
.hall-screen .guide-list { display: grid; gap: 8px; }
.hall-screen .guide-list:not(.guide-steps) li::before { content: '• '; color: var(--muted); }
.hall-screen .guide-steps { counter-reset: step; }
.guide-steps li { counter-increment: step; display: flex; gap: 10px; }
.guide-steps li::before { content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.guide-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.guide-games li { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border-radius: var(--w-radius-s); background: var(--soft); }
.guide-games b { font-size: 19px; }
.guide-games span { font-size: 17px; line-height: 1.35; }
.guide-games small { font-size: 16px; color: var(--muted); line-height: 1.35; }
.guide-tag { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--on-ink) !important; font-size: 16px !important; vertical-align: middle; }
.guide-go { justify-self: start; }
@media (max-width: 600px) { .guide-card { padding: 16px; } .guide-games { grid-template-columns: 1fr; } }
.hall-screen[data-tab='shop'] .hall-body { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); }
.hall-screen[data-tab='shop'] .hall-body { align-items: start; }
/* The shopper's mirror stays in view and scrolls on its own while the goods scroll past. */
.hall-screen[data-tab='shop'] .hall-mirror { position: sticky; top: 0; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hall-body > * { animation: hall-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hall-body > :nth-child(2) { animation-delay: 0.07s; }
@keyframes hall-in { from { opacity: 0; transform: translateY(16px); } }
/* Drawn again in place (a tap): no entrance, so nothing blinks. */
[data-again] .hall-body > *, [data-again] .hall-bar > span, [data-again] .hall-block { animation: none; }
.hall-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: clamp(18px, 2.2vw, 32px); border-radius: var(--w-radius); background: var(--card); }
.hall-panel h2 { font-size: 26px; line-height: 1.15; }
.hall-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.hall-title-line { font-size: 20px; font-weight: 700; color: var(--muted); }
.hall-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.hall-pill { min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--soft); font-size: 18px; font-weight: 800; white-space: nowrap; transition: background 0.15s, transform 0.15s; }
@media (hover: hover) { .hall-pill:hover { background: var(--line); } }
.hall-pill:active { transform: scale(0.96); }
.hall-pill[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); }
.hall-pill span { font-weight: 600; opacity: 0.75; }

/* Trophies: the chosen player, then the whole family. */
.hall-me { display: grid; grid-template-columns: auto 1fr minmax(240px, 400px); align-items: center; gap: 20px 32px; }
.hall-me > .avatar { margin: 16px; }
.hall-me h2 { font-size: clamp(36px, 3.6vw, 52px); line-height: 1; letter-spacing: -0.02em; }
.hall-me-text { display: flex; flex-direction: column; gap: 6px; }
.hall-figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; }
.hall-big { font-size: clamp(44px, 4.6vw, 68px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hall-big small { font-size: 0.4em; letter-spacing: 0; color: var(--muted); }
.hall-medals { display: flex; gap: 16px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hall-medal { display: inline-block; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; vertical-align: -3px; background: var(--gold); }
.hall-medal.silver { background: var(--silver); }
.hall-medal.bronze { background: var(--bronze); }
.hall-finding { padding: 20px 24px; border-radius: var(--w-radius); background: var(--soft); font-size: 21px; font-weight: 700; line-height: 1.3; }
/* The player's stickers, one card per district; a card opens that
   district's page of the sticker book. */
.hall-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.hall-district { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: var(--w-tap-big); padding: 16px 18px;
  border: 0; border-radius: var(--w-radius); background: var(--w-board); color: var(--w-ink); text-align: left;
  box-shadow: inset 0 6px 0 var(--sec), 0 var(--w-lip) 0 var(--w-board-edge); transition: transform 0.15s; }
.hall-district:active { transform: translateY(var(--w-lip)); box-shadow: inset 0 6px 0 var(--sec); }
@media (hover: hover) { .hall-district:hover { transform: translateY(-3px); } }
.hall-district .hall-bar > span { background: var(--sec); }
.hall-district-peek { display: flex; align-items: center; min-height: 52px; }
.hall-district-peek .sticker { width: 48px; height: 48px; margin-right: -10px; box-shadow: 0 0 0 3px var(--w-board), 0 0 0 5px var(--sec); }
.hall-district-peek .sticker.empty { box-shadow: none; background: var(--soft); color: var(--muted); font-weight: 800; }
.hall-district-more { margin-left: 14px; font-size: var(--w-text-s); font-weight: 800; color: var(--w-ink-soft); }
.hall-book .hall-stickers { margin-top: 0; }
.hall-district h3 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.hall-district h3::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--sec); }
.hall-district h3 span { font-size: 17px; font-weight: 600; color: var(--muted); }
.hall-stickers { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.hall-sticker { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 88px; text-align: center; font-size: 16px; font-weight: 700; line-height: 1.15; }
.hall-sticker .sticker { box-shadow: 0 0 0 5px var(--sec); margin: 5px; }
.hall-sticker .sticker.empty { box-shadow: none; color: var(--muted); }
.hall-sticker.empty { color: var(--muted); font-weight: 600; }
.hall-family { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 20px 32px; }
.hall-family > h2 { grid-column: 1 / -1; }
.hall-goal { display: flex; flex-direction: column; gap: 8px; }
.hall-goal > p:first-child { font-size: 19px; font-weight: 700; }
.hall-goal .sub { font-size: 17px; }
.hall-bar { display: block; height: 16px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.hall-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--yellow); transform-origin: left; animation: hall-grow 0.9s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes hall-grow { from { transform: scaleX(0); } }
.hall-together { display: flex; flex-direction: column; gap: 12px; }
.hall-together li { display: flex; align-items: center; gap: 14px; }
.hall-together .sticker { width: 56px; height: 56px; margin: 4px; box-shadow: 0 0 0 4px var(--sec-group); }
.hall-together b { display: block; font-size: 18px; }
.hall-together .sub { display: block; font-size: 16px; }

/* Leaderboard: a podium for the top three, everyone in a list. */
.hall-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 14px; margin-top: 12px; }
.hall-step { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hall-step > .avatar { margin: 18px 0 6px; }
.hall-step strong { font-size: 24px; line-height: 1; }
.hall-step-pts { font-size: 18px; font-weight: 700; color: var(--muted); }
.hall-block { display: grid; place-items: center; width: 100%; border-radius: 22px 22px 8px 8px; font-size: 46px; font-weight: 800; color: var(--navy); transform-origin: bottom; animation: hall-lift 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hall-step.p1 .hall-block { height: 190px; background: var(--gold); animation-delay: 0.25s; }
.hall-step.p2 .hall-block { height: 140px; background: var(--silver); animation-delay: 0.1s; }
.hall-step.p3 .hall-block { height: 104px; background: var(--bronze); animation-delay: 0.4s; }
@keyframes hall-lift { from { opacity: 0; transform: scaleY(0.2); } }
.hall-rows { display: flex; flex-direction: column; gap: 8px; }
.hall-row { display: grid; grid-template-columns: 44px auto 1fr auto; align-items: center; gap: 14px; padding: 10px 18px 10px 12px; border-radius: var(--w-radius-s); background: var(--soft); }
.hall-row.mine { background: var(--ink); color: var(--on-ink); }
.hall-row:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.hall-place { font-size: 24px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.hall-row-name b { display: block; font-size: 20px; line-height: 1.1; }
.hall-row-name small { font-size: 16px; opacity: 0.8; }
.hall-row-main { font-size: 20px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.hall-empty { padding: 48px 24px; border-radius: var(--w-radius); background: var(--soft); font-size: 21px; font-weight: 700; text-align: center; }
.hall-level { display: flex; flex-direction: column; gap: 8px; }
.hall-level h3 { font-size: 20px; }
.hall-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.hall-filters select { min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 18px; font-weight: 700; }
html[data-tv="wide"] .hall-filters select { min-height: var(--tv-touch) !important; }

/* Star shop: the player's picture tries each item on before it is bought. */
.hall-mirror { position: relative; align-items: center; justify-content: flex-start; gap: 10px; overflow: hidden; text-align: center; }
.hall-mirror > .avatar { margin: calc(var(--size, 84px) * 0.3) 0 14px; }
.hall-mirror h2 { font-size: 34px; }
.hall-balance { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hall-balance small { font-size: 22px; letter-spacing: 0; color: var(--muted); }
.hall-trying { min-height: 2.6em; font-size: 20px; font-weight: 700; }
.hall-buy { border-radius: 999px; padding: 0 34px; }
.hall-mirror .note { max-width: 34ch; }
.hall-goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.hall-goods li { display: flex; }
.hall-good { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 22px 12px 16px; border: 0; border-radius: var(--w-radius); background: var(--soft); text-align: center; transition: transform 0.15s, background 0.15s; }
@media (hover: hover) { .hall-good:hover { transform: translateY(-3px); background: var(--line); } }
.hall-good:active { transform: scale(0.97); }
.hall-good[aria-current='true'] { background: var(--ink); color: var(--on-ink); }
.hall-good > .avatar { margin: 12px 0 10px; }
.hall-good-title { display: grid; place-items: center; height: 76px; margin: 10px 0 8px; font-size: 22px; font-weight: 800; line-height: 1.05; }
.hall-good-fx { display: grid; place-items: center; height: 76px; margin: 10px 0 8px; font-size: 46px; }
.hall-good strong { font-size: 18px; line-height: 1.15; }
.hall-price { font-size: 17px; font-weight: 700; }
.hall-price.short { color: var(--muted); }
.hall-price.can { color: var(--hall-can); }
.hall-good[aria-current='true'] .hall-price { color: inherit; }
.hall-good[aria-current='true'] .hall-price.can { color: var(--yellow); }

/* The Trophy Hall's building on the street (street.js hall): gold, with a
   trophy in its window. */
.street-hall { --sec: var(--w-sun); }
.street-hall.drawn { --ar: 510 / 893; }
.hall-window { display: grid; place-items: center; font-size: calc(10 * var(--u)); line-height: 1; }
.street-hall.drawn .hall-window { background: #FFF3C4; }

/* The Family Trip station (street.js trip): the family's bus in its window. */
.street-trip { --sec: var(--w-sun); }
.street-trip.drawn { --ar: 681 / 900; }
.trip-window { display: grid; place-items: center; color: var(--w-sun); }
.trip-window .w-icon { width: 60%; height: 60%; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.2)); }
.trip-bus { width: 86%; height: auto; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.2)); }
.street-trip.drawn .trip-window { background: var(--w-board); }

@media (max-width: 1100px) {
  .hall-screen[data-tab] .hall-body { grid-template-columns: minmax(0, 1fr); }
  .hall-screen[data-tab='shop'] .hall-mirror { position: relative; max-height: none; overflow: hidden; }
  .hall-me { grid-template-columns: auto 1fr; }
  .hall-finding { grid-column: 1 / -1; }
  .hall-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hall-family { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hall-tabs { width: 100%; margin-left: 0; }
  .hall-tab { flex: 1; min-height: 48px; padding: 0 14px; font-size: 18px; }
  .hall-me { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .hall-figure, .hall-medals { justify-content: center; }
  .hall-sticker { width: 72px; }
  .hall-wall { gap: 10px; }
  .hall-district { padding: 12px; }
  .hall-me > .avatar { --size: 104px !important; margin: 4px; }
  .hall-district h3 { flex-wrap: wrap; gap: 2px 8px; font-size: 18px; }
  .hall-family { grid-template-columns: minmax(0, 1fr); }
  .hall-podium { gap: 8px; }
  .hall-step > .avatar { --size: 72px !important; }
  .hall-step.p1 > .avatar { --size: 88px !important; }
  .hall-step strong { font-size: 19px; }
  .hall-step.p1 .hall-block { height: 130px; }
  .hall-step.p2 .hall-block { height: 96px; }
  .hall-step.p3 .hall-block { height: 72px; }
  .hall-block { font-size: 34px; }
  .hall-mirror > .avatar { --size: 140px !important; }
  .hall-balance { font-size: 52px; }
  .hall-goods { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hall-body > *, .hall-bar > span, .hall-block { animation: none; }
}

/* Stars: looks bought in the shop (src/model/rewards.js, screens/shop.js).
   Frames are rings round the picture; backgrounds are flat patterns over the
   player's own colour, so their colour still says who it is. */
.avatar { position: relative; background-size: calc(var(--size, 84px) * 0.5); }
.avatar.frame-silver { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.06) #AEB8CC, 0 0 0 calc(var(--size, 84px) * 0.11) #EEF1F7; }
.avatar.frame-gold { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.06) #F5B800, 0 0 0 calc(var(--size, 84px) * 0.11) #FFF3C4; }
.avatar.frame-ocean { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #0E7FC0, 0 0 0 calc(var(--size, 84px) * 0.09) #7FD3F5, 0 0 0 calc(var(--size, 84px) * 0.13) #0E7FC0; }
.avatar.frame-rainbow { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.08) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.12) #2EC4B6, 0 0 0 calc(var(--size, 84px) * 0.16) #6A4CFF; }
.avatar.frame-flowers { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #F27BB5, 0 0 0 calc(var(--size, 84px) * 0.1) #FFE3F0, 0 0 0 calc(var(--size, 84px) * 0.13) #3DC596; }
.avatar.frame-candy { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.035) #FF4F8B, 0 0 0 calc(var(--size, 84px) * 0.07) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.105) #FF4F8B, 0 0 0 calc(var(--size, 84px) * 0.14) #FFFFFF; }
.avatar.frame-stars { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) var(--w-ink), 0 0 calc(var(--size, 84px) * 0.17) calc(var(--size, 84px) * 0.07) rgba(255, 214, 0, 0.8); }
.avatar.frame-lava { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #3A1410, 0 0 0 calc(var(--size, 84px) * 0.1) #FF5A1F, 0 0 0 calc(var(--size, 84px) * 0.14) #FFC233; }
.avatar.frame-diamond { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.08) #8FE3FF, 0 0 0 calc(var(--size, 84px) * 0.12) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.16) #5AB8FF; }
.avatar.bg-dots { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='5' cy='5' r='2.2' fill='%23fff' fill-opacity='.55'/%3E%3Ccircle cx='15' cy='15' r='2.2' fill='%23fff' fill-opacity='.55'/%3E%3C/svg%3E"); }
.avatar.bg-stripes { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 20L20 0H10L0 10zM20 20V10L10 20z' fill='%23fff' fill-opacity='.4'/%3E%3C/svg%3E"); }
.avatar.bg-ocean { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 7q5-4 10 0t10 0v3q-5 4-10 0T0 10zM0 16q5-4 10 0t10 0v3q-5 4-10 0T0 19z' fill='%230E7FC0' fill-opacity='.45'/%3E%3C/svg%3E"); }
.avatar.bg-jungle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M2 12C2 5 8 2 10 2c0 4-2 10-8 10zM12 19c0-6 4-8 7-8 0 3-2 8-7 8z' fill='%23137A4A' fill-opacity='.5'/%3E%3C/svg%3E"); }
.avatar.bg-space { color: #FFFFFF; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect width='20' height='20' fill='%23141A3C' fill-opacity='.62'/%3E%3Ccircle cx='4' cy='5' r='1' fill='%23fff'/%3E%3Ccircle cx='14' cy='3' r='.7' fill='%23fff'/%3E%3Ccircle cx='11' cy='13' r='1.2' fill='%23FFD600'/%3E%3Ccircle cx='3' cy='16' r='.7' fill='%23fff'/%3E%3C/svg%3E"); }
.avatar.bg-sunset { background-size: 100% 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' preserveAspectRatio='none'%3E%3Crect width='20' height='7' fill='%23FF7A59' fill-opacity='.55'/%3E%3Crect y='7' width='20' height='6' fill='%23FFBE2E' fill-opacity='.5'/%3E%3Crect y='13' width='20' height='7' fill='%23F27BB5' fill-opacity='.5'/%3E%3C/svg%3E"); }
/* More frames (rarer ones shine and move). */
.avatar.frame-wood { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.06) #8A5A2B, 0 0 0 calc(var(--size, 84px) * 0.1) #C79A62; }
.avatar.frame-mint { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.06) #3DC596, 0 0 0 calc(var(--size, 84px) * 0.1) #D3F5E7; }
.avatar.frame-sky { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.06) #3BA9E0, 0 0 0 calc(var(--size, 84px) * 0.1) #D6EEFA; }
.avatar.frame-bubblegum { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.06) #FF8CC6, 0 0 0 calc(var(--size, 84px) * 0.1) #FFE0F0; }
.avatar.frame-lemon { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #FFD23F, 0 0 0 calc(var(--size, 84px) * 0.09) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.12) #FFD23F; }
.avatar.frame-grape { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #7A4BD8, 0 0 0 calc(var(--size, 84px) * 0.09) #C9B3FF, 0 0 0 calc(var(--size, 84px) * 0.12) #7A4BD8; }
.avatar.frame-forest { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #1F7A4A, 0 0 0 calc(var(--size, 84px) * 0.09) #8FCB6B, 0 0 0 calc(var(--size, 84px) * 0.13) #1F7A4A; }
.avatar.frame-sunset { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF7A59, 0 0 0 calc(var(--size, 84px) * 0.08) #FFBE2E, 0 0 0 calc(var(--size, 84px) * 0.12) #F27BB5; }
.avatar.frame-ice { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.08) #BDEBFF, 0 0 0 calc(var(--size, 84px) * 0.12) #7FD3F5, 0 0 calc(var(--size, 84px) * 0.12) calc(var(--size, 84px) * 0.02) rgba(127, 211, 245, 0.7); }
.avatar.frame-neon { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #1B1F3B, 0 0 0 calc(var(--size, 84px) * 0.08) #39FF88, 0 0 calc(var(--size, 84px) * 0.18) calc(var(--size, 84px) * 0.04) rgba(57, 255, 136, 0.75); }
.avatar.frame-emerald { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.08) #1DBF73, 0 0 0 calc(var(--size, 84px) * 0.12) #0B7A47, 0 0 0 calc(var(--size, 84px) * 0.15) #B8F2D4; }
.avatar.frame-ruby { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.08) #E0245E, 0 0 0 calc(var(--size, 84px) * 0.12) #8C0F38, 0 0 0 calc(var(--size, 84px) * 0.15) #FFC2D4; }
.avatar.frame-sapphire { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.08) #2F6BFF, 0 0 0 calc(var(--size, 84px) * 0.12) #13308C, 0 0 0 calc(var(--size, 84px) * 0.15) #BFD3FF, 0 0 calc(var(--size, 84px) * 0.16) calc(var(--size, 84px) * 0.03) rgba(47, 107, 255, 0.5); }
.avatar.frame-galaxy { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.05) #141A3C, 0 0 0 calc(var(--size, 84px) * 0.09) #6A4CFF, 0 0 0 calc(var(--size, 84px) * 0.13) #F27BB5, 0 0 calc(var(--size, 84px) * 0.2) calc(var(--size, 84px) * 0.04) rgba(106, 76, 255, 0.6); }
.avatar.frame-aurora { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #3DF5B0, 0 0 0 calc(var(--size, 84px) * 0.08) #4CB8FF, 0 0 0 calc(var(--size, 84px) * 0.12) #B36BFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #3DF5B0AA; animation: frame-aurora 3s ease-in-out infinite alternate; }
@keyframes frame-aurora { 0% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #3DF5B0, 0 0 0 calc(var(--size, 84px) * 0.08) #4CB8FF, 0 0 0 calc(var(--size, 84px) * 0.12) #B36BFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #3DF5B0AA; } 50% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #4CB8FF, 0 0 0 calc(var(--size, 84px) * 0.08) #B36BFF, 0 0 0 calc(var(--size, 84px) * 0.12) #3DF5B0, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #4CB8FFAA; } 100% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #B36BFF, 0 0 0 calc(var(--size, 84px) * 0.08) #3DF5B0, 0 0 0 calc(var(--size, 84px) * 0.12) #4CB8FF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #B36BFFAA; } }
.avatar.frame-fire { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF3B1F, 0 0 0 calc(var(--size, 84px) * 0.08) #FF8A00, 0 0 0 calc(var(--size, 84px) * 0.12) #FFD23F, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FF3B1FAA; animation: frame-fire 0.9s ease-in-out infinite alternate; }
@keyframes frame-fire { 0% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF3B1F, 0 0 0 calc(var(--size, 84px) * 0.08) #FF8A00, 0 0 0 calc(var(--size, 84px) * 0.12) #FFD23F, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FF3B1FAA; } 50% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF8A00, 0 0 0 calc(var(--size, 84px) * 0.08) #FFD23F, 0 0 0 calc(var(--size, 84px) * 0.12) #FF3B1F, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #FF8A00AA; } 100% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFD23F, 0 0 0 calc(var(--size, 84px) * 0.08) #FF3B1F, 0 0 0 calc(var(--size, 84px) * 0.12) #FF8A00, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FFD23FAA; } }
.avatar.frame-royal { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #6A1FBF, 0 0 0 calc(var(--size, 84px) * 0.08) #F5B800, 0 0 0 calc(var(--size, 84px) * 0.12) #FFFFFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #6A1FBFAA; animation: frame-royal 2.6s ease-in-out infinite alternate; }
@keyframes frame-royal { 0% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #6A1FBF, 0 0 0 calc(var(--size, 84px) * 0.08) #F5B800, 0 0 0 calc(var(--size, 84px) * 0.12) #FFFFFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #6A1FBFAA; } 50% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #F5B800, 0 0 0 calc(var(--size, 84px) * 0.08) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.12) #6A1FBF, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #F5B800AA; } 100% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.08) #6A1FBF, 0 0 0 calc(var(--size, 84px) * 0.12) #F5B800, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FFFFFFAA; } }
.avatar.frame-glow { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #F5B800, 0 0 0 calc(var(--size, 84px) * 0.08) #FFE07A, 0 0 0 calc(var(--size, 84px) * 0.12) #FFFFFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #F5B800AA; animation: frame-glow 1.8s ease-in-out infinite alternate; }
@keyframes frame-glow { 0% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #F5B800, 0 0 0 calc(var(--size, 84px) * 0.08) #FFE07A, 0 0 0 calc(var(--size, 84px) * 0.12) #FFFFFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #F5B800AA; } 50% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFE07A, 0 0 0 calc(var(--size, 84px) * 0.08) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.12) #F5B800, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #FFE07AAA; } 100% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFFFFF, 0 0 0 calc(var(--size, 84px) * 0.08) #F5B800, 0 0 0 calc(var(--size, 84px) * 0.12) #FFE07A, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FFFFFFAA; } }
.avatar.frame-prism { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.08) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.12) #2EC4B6, 0 0 0 calc(var(--size, 84px) * 0.16) #6A4CFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FF5A5FAA; animation: frame-prism 2.2s ease-in-out infinite alternate; }
@keyframes frame-prism { 0% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.08) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.12) #2EC4B6, 0 0 0 calc(var(--size, 84px) * 0.16) #6A4CFF, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FF5A5FAA; } 33% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.08) #2EC4B6, 0 0 0 calc(var(--size, 84px) * 0.12) #6A4CFF, 0 0 0 calc(var(--size, 84px) * 0.16) #FF5A5F, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #FFB400AA; } 67% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #2EC4B6, 0 0 0 calc(var(--size, 84px) * 0.08) #6A4CFF, 0 0 0 calc(var(--size, 84px) * 0.12) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.16) #FFB400, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #2EC4B6AA; } 100% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #6A4CFF, 0 0 0 calc(var(--size, 84px) * 0.08) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.12) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.16) #2EC4B6, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #6A4CFFAA; } }
.avatar.frame-legend { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.08) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.12) #3DC596, 0 0 0 calc(var(--size, 84px) * 0.16) #3BA9E0, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FF5A5FAA; animation: frame-legend 2s ease-in-out infinite alternate; }
@keyframes frame-legend { 0% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.08) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.12) #3DC596, 0 0 0 calc(var(--size, 84px) * 0.16) #3BA9E0, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #FF5A5FAA; } 25% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.08) #3DC596, 0 0 0 calc(var(--size, 84px) * 0.12) #3BA9E0, 0 0 0 calc(var(--size, 84px) * 0.16) #B36BFF, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #FFB400AA; } 50% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #3DC596, 0 0 0 calc(var(--size, 84px) * 0.08) #3BA9E0, 0 0 0 calc(var(--size, 84px) * 0.12) #B36BFF, 0 0 0 calc(var(--size, 84px) * 0.16) #FF5A5F, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #3DC596AA; } 75% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #3BA9E0, 0 0 0 calc(var(--size, 84px) * 0.08) #B36BFF, 0 0 0 calc(var(--size, 84px) * 0.12) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.16) #FFB400, 0 0 calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.04) #3BA9E0AA; } 100% { box-shadow: 0 0 0 calc(var(--size, 84px) * 0.04) #B36BFF, 0 0 0 calc(var(--size, 84px) * 0.08) #FF5A5F, 0 0 0 calc(var(--size, 84px) * 0.12) #FFB400, 0 0 0 calc(var(--size, 84px) * 0.16) #3DC596, 0 0 calc(var(--size, 84px) * 0.14) calc(var(--size, 84px) * 0.02) #B36BFFAA; } }
/* More backgrounds. */
.avatar.bg-checks { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 0h10v10H0zM10 10h10v10H10z' fill='%23fff' fill-opacity='.5'/%3E%3C/svg%3E"); }
.avatar.bg-hearts { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 16S3 11.5 3 7.5A3.5 3.5 0 0 1 10 6a3.5 3.5 0 0 1 7 1.5C17 11.5 10 16 10 16z' fill='%23FF4F8B' fill-opacity='.45'/%3E%3C/svg%3E"); }
.avatar.bg-zigzag { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 8l5-5 5 5 5-5 5 5v4l-5-5-5 5-5-5-5 5z' fill='%23fff' fill-opacity='.5'/%3E%3C/svg%3E"); }
.avatar.bg-clouds { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 14a3 3 0 0 1 .5-6A4 4 0 0 1 12 7a3 3 0 0 1 4 4 2.5 2.5 0 0 1 0 3z' fill='%23fff' fill-opacity='.65'/%3E%3C/svg%3E"); }
.avatar.bg-bubbles { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='5' cy='6' r='3' fill='none' stroke='%23fff' stroke-opacity='.7' stroke-width='1.2'/%3E%3Ccircle cx='14' cy='14' r='4' fill='none' stroke='%23fff' stroke-opacity='.6' stroke-width='1.2'/%3E%3Ccircle cx='15' cy='4' r='1.5' fill='%23fff' fill-opacity='.6'/%3E%3C/svg%3E"); }
.avatar.bg-confetti { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='2' y='3' width='3' height='1.6' fill='%23FF5A5F' transform='rotate(30 3 4)'/%3E%3Crect x='12' y='5' width='3' height='1.6' fill='%232EC4B6' transform='rotate(-25 13 6)'/%3E%3Crect x='6' y='13' width='3' height='1.6' fill='%23FFB400' transform='rotate(60 7 14)'/%3E%3Crect x='15' y='15' width='3' height='1.6' fill='%236A4CFF' transform='rotate(-50 16 16)'/%3E%3C/svg%3E"); }
.avatar.bg-flowers { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='%23fff' fill-opacity='.7'%3E%3Ccircle cx='6' cy='4' r='2'/%3E%3Ccircle cx='6' cy='8' r='2'/%3E%3Ccircle cx='4' cy='6' r='2'/%3E%3Ccircle cx='8' cy='6' r='2'/%3E%3C/g%3E%3Ccircle cx='6' cy='6' r='1.4' fill='%23FFD23F'/%3E%3Cg fill='%23FFE3F0' fill-opacity='.8'%3E%3Ccircle cx='15' cy='13' r='1.6'/%3E%3Ccircle cx='15' cy='17' r='1.6'/%3E%3Ccircle cx='13' cy='15' r='1.6'/%3E%3Ccircle cx='17' cy='15' r='1.6'/%3E%3C/g%3E%3C/svg%3E"); }
.avatar.bg-stars { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 2l1.2 2.6 2.8.3-2.1 1.9.6 2.8L6 8.2 3.5 9.6l.6-2.8L2 4.9l2.8-.3z' fill='%23FFD600' fill-opacity='.85'/%3E%3Cpath d='M15 11l.9 1.9 2.1.2-1.6 1.4.5 2L15 15.5l-1.9 1 .5-2-1.6-1.4 2.1-.2z' fill='%23fff' fill-opacity='.8'/%3E%3C/svg%3E"); }
.avatar.bg-rainbow { background-size: 100% 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' preserveAspectRatio='none'%3E%3Crect width='20' height='3.4' fill='%23FF5A5F' fill-opacity='.5'/%3E%3Crect y='3.3' width='20' height='3.4' fill='%23FFB400' fill-opacity='.5'/%3E%3Crect y='6.6' width='20' height='3.4' fill='%23FFE14D' fill-opacity='.5'/%3E%3Crect y='9.9' width='20' height='3.4' fill='%233DC596' fill-opacity='.5'/%3E%3Crect y='13.2' width='20' height='3.4' fill='%233BA9E0' fill-opacity='.5'/%3E%3Crect y='16.5' width='20' height='3.5' fill='%239B7BFF' fill-opacity='.5'/%3E%3C/svg%3E"); }
.avatar.bg-candy { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 0h5L0 5zM0 10L10 0h5L0 15zM0 20L20 0v5L5 20zM10 20L20 10v5l-5 5z' fill='%23FF4F8B' fill-opacity='.4'/%3E%3C/svg%3E"); }
.avatar.bg-snow { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg stroke='%23fff' stroke-opacity='.8' stroke-width='.9' stroke-linecap='round'%3E%3Cpath d='M6 2v6M3 5h6M4 3l4 4M8 3L4 7'/%3E%3Cpath d='M15 12v5M12.5 14.5h5M13.2 12.7l3.6 3.6M16.8 12.7l-3.6 3.6'/%3E%3C/g%3E%3C/svg%3E"); }
.avatar.bg-music { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 4v7.5A2 2 0 1 1 4 10V2h5v2z' fill='%23263052' fill-opacity='.35'/%3E%3Cpath d='M14 11v5.5a1.8 1.8 0 1 1-1-1.6V9l4-1v2z' fill='%23263052' fill-opacity='.35'/%3E%3C/svg%3E"); }
.avatar.bg-honeycomb { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 1l4 2.3v4.6L5 10.2 1 7.9V3.3zM15 9.8l4 2.3v4.6l-4 2.3-4-2.3v-4.6z' fill='%23FFB400' fill-opacity='.45' stroke='%23fff' stroke-opacity='.6' stroke-width='.6'/%3E%3C/svg%3E"); }
.avatar.bg-lava { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect width='20' height='20' fill='%233A1410' fill-opacity='.35'/%3E%3Cpath d='M0 12q5-6 10 0t10 0v8H0z' fill='%23FF5A1F' fill-opacity='.6'/%3E%3Ccircle cx='5' cy='5' r='1.6' fill='%23FFC233'/%3E%3Ccircle cx='15' cy='7' r='1' fill='%23FFC233'/%3E%3C/svg%3E"); }
.avatar.bg-crystal { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1l5 6-5 12-5-12z' fill='%23BDEBFF' fill-opacity='.6' stroke='%23fff' stroke-opacity='.8' stroke-width='.5'/%3E%3Cpath d='M5 7h10' stroke='%23fff' stroke-opacity='.8' stroke-width='.5'/%3E%3C/svg%3E"); }
.avatar.bg-aurora { background-size: 100% 100%, 300% 300%; background-image: linear-gradient(rgba(20, 26, 60, 0.35), rgba(20, 26, 60, 0.35)), linear-gradient(120deg, #3DF5B0, #4CB8FF, #B36BFF, #3DF5B0); animation: bg-flow 8s ease-in-out infinite alternate; color: #FFFFFF; }
.avatar.bg-galaxy { color: #FFFFFF; background-size: calc(var(--size, 84px) * 0.5), 100% 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='4' cy='5' r='.8' fill='%23fff'/%3E%3Ccircle cx='14' cy='3' r='.6' fill='%23fff'/%3E%3Ccircle cx='11' cy='13' r='1' fill='%23FFD600'/%3E%3Ccircle cx='3' cy='16' r='.6' fill='%23fff'/%3E%3Ccircle cx='17' cy='17' r='.7' fill='%23fff'/%3E%3C/svg%3E"), radial-gradient(circle at 30% 30%, #B36BFF, #2A1F6B 55%, #0E1230); }
.avatar.bg-gold { background-size: 100% 100%, 250% 250%; background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0)), linear-gradient(115deg, #C98100, #FFE07A 30%, #F5B800 50%, #FFF3C4 65%, #C98100); animation: bg-flow 4s ease-in-out infinite alternate; }
.avatar.bg-neon { color: #FFFFFF; background-size: calc(var(--size, 84px) * 0.33), 100% 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M0 10h20M10 0v20' stroke='%2339FF88' stroke-opacity='.8' stroke-width='.8'/%3E%3C/svg%3E"), linear-gradient(#1B1F3B, #2A1F6B); }
.avatar.bg-cosmos { color: #FFFFFF; background-size: calc(var(--size, 84px) * 0.5), 300% 300%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='4' cy='5' r='.8' fill='%23fff'/%3E%3Ccircle cx='14' cy='3' r='.6' fill='%23fff'/%3E%3Ccircle cx='11' cy='13' r='1' fill='%23FFD600'/%3E%3Ccircle cx='3' cy='16' r='.6' fill='%23fff'/%3E%3Ccircle cx='17' cy='17' r='.7' fill='%23fff'/%3E%3C/svg%3E"), linear-gradient(135deg, #0E1230, #6A4CFF, #F27BB5, #FFB400, #0E1230); animation: bg-flow 6s linear infinite alternate; }
@keyframes bg-flow { from { background-position: 0 0, 0% 50%; } to { background-position: 0 0, 100% 50%; } }
/* Auras: a glow round the picture, behind it (some sparkle or swirl). */
.avatar[class*=' aura-'] { isolation: isolate; --aura-in: 60%; }
/* A small picture in a row keeps its aura close, clear of the name. */
.hall-person .avatar[class*=' aura-']::before, .hall-person .avatar[class*=' aura-']::after { inset: -14%; }
/* The aura starts outside a frame, so the frame stays in sight. */
.avatar[class*=' aura-'][class*=' frame-'] { --aura-in: 79%; }
.avatar[class*=' aura-']::before, .avatar[class*=' aura-']::after { content: ''; position: absolute; inset: -32%; z-index: -1; border-radius: 50%; pointer-events: none; }
.avatar[class*=' aura-']::before { background: radial-gradient(circle closest-side, transparent var(--aura-in), var(--aura) calc(var(--aura-in) + 5%), transparent 100%); }
.avatar[class*=' aura-']::after { -webkit-mask: radial-gradient(circle closest-side, transparent var(--aura-in), #000 calc(var(--aura-in) + 3%), #000 92%, transparent 100%); mask: radial-gradient(circle closest-side, transparent var(--aura-in), #000 calc(var(--aura-in) + 3%), #000 92%, transparent 100%); }
.avatar.aura-sun { --aura: rgba(255, 210, 63, 0.85); }
.avatar.aura-mint { --aura: rgba(61, 197, 150, 0.8); }
.avatar.aura-rose { --aura: rgba(255, 79, 139, 0.75); }
.avatar.aura-sky { --aura: rgba(59, 169, 224, 0.8); }
.avatar.aura-lime { --aura: rgba(160, 230, 60, 0.85); }
.avatar.aura-peach { --aura: rgba(255, 150, 110, 0.85); }
.avatar.aura-lilac { --aura: rgba(179, 107, 255, 0.75); }
.avatar.aura-pulse { --aura: rgba(255, 79, 139, 0.85); }
.avatar.aura-pulse::before { animation: aura-pulse 1.1s ease-in-out infinite; }
@keyframes aura-pulse { 0%, 100% { transform: scale(0.92); opacity: 0.7; } 30% { transform: scale(1.06); opacity: 1; } }
.avatar.aura-sparkle { --aura: rgba(255, 214, 0, 0.6); }
.avatar.aura-sparkle::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3l1.5 5.5L17 10l-5.5 1.5L10 17l-1.5-5.5L3 10l5.5-1.5z' fill='%23FFD600'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.3) calc(var(--size, 84px) * 0.3); animation: aura-spin 9s linear infinite; }
.avatar.aura-bubbles { --aura: rgba(127, 211, 245, 0.55); }
.avatar.aura-bubbles::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='6' fill='%23fff' fill-opacity='.25' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.26) calc(var(--size, 84px) * 0.26); animation: aura-rise 5s linear infinite; }
.avatar.aura-hearts { --aura: rgba(255, 79, 139, 0.55); }
.avatar.aura-hearts::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 17S2 12 2 7a4 4 0 0 1 8-1 4 4 0 0 1 8 1c0 5-8 10-8 10z' fill='%23FF4F8B'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.28) calc(var(--size, 84px) * 0.28); animation: aura-spin 10s linear infinite reverse; }
.avatar.aura-snow { --aura: rgba(214, 238, 250, 0.8); }
.avatar.aura-snow::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 2v16M2 10h16M4.5 4.5l11 11M15.5 4.5l-11 11'/%3E%3C/g%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.22) calc(var(--size, 84px) * 0.22); animation: aura-fall 6s linear infinite; }
.avatar.aura-electric { --aura: rgba(76, 184, 255, 0.85); }
.avatar.aura-electric::after { background: repeating-conic-gradient(from 0deg, transparent 0 14deg, #E6F7FF 15deg 17deg, transparent 18deg 30deg); animation: aura-spin 1.6s steps(6) infinite, aura-flicker 0.4s steps(2) infinite; }
.avatar.aura-fire { --aura: rgba(255, 90, 31, 0.9); }
.avatar.aura-fire::after { background: conic-gradient(from 0deg, #FF3B1F, #FFD23F, #FF8A00, #FF3B1F, #FFD23F, #FF8A00, #FF3B1F); opacity: 0.75; animation: aura-spin 2.4s linear infinite, aura-flicker 0.3s ease-in-out infinite alternate; }
.avatar.aura-ice { --aura: rgba(127, 211, 245, 0.9); }
.avatar.aura-ice::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2l2 6 6 2-6 2-2 6-2-6-6-2 6-2z' fill='%23fff'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.2) calc(var(--size, 84px) * 0.2); animation: aura-spin 14s linear infinite; }
.avatar.aura-rainbow { --aura: rgba(255, 255, 255, 0.5); }
.avatar.aura-rainbow::after { background: conic-gradient(#FF5A5F, #FFB400, #FFE14D, #3DC596, #3BA9E0, #9B7BFF, #FF5A5F); animation: aura-spin 3s linear infinite; }
.avatar.aura-galaxy { --aura: rgba(106, 76, 255, 0.8); }
.avatar.aura-galaxy::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='4' cy='5' r='.8' fill='%23fff'/%3E%3Ccircle cx='14' cy='3' r='.6' fill='%23fff'/%3E%3Ccircle cx='11' cy='13' r='1' fill='%23FFD600'/%3E%3Ccircle cx='3' cy='16' r='.6' fill='%23fff'/%3E%3Ccircle cx='17' cy='17' r='.7' fill='%23fff'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.3) calc(var(--size, 84px) * 0.3), conic-gradient(#141A3C, #6A4CFF, #F27BB5, #141A3C, #3BA9E0, #141A3C); animation: aura-spin 6s linear infinite; }
.avatar.aura-gold { --aura: rgba(245, 184, 0, 0.95); }
.avatar.aura-gold::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3l1.5 5.5L17 10l-5.5 1.5L10 17l-1.5-5.5L3 10l5.5-1.5z' fill='%23fff'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.24) calc(var(--size, 84px) * 0.24), conic-gradient(#C98100, #FFE07A, #F5B800, #FFF3C4, #C98100); animation: aura-spin 5s linear infinite; }
.avatar.aura-gold::before { animation: aura-pulse 1.8s ease-in-out infinite; }
.avatar.aura-cosmic { --aura: rgba(242, 123, 181, 0.85); }
.avatar.aura-cosmic::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='4' cy='5' r='.8' fill='%23fff'/%3E%3Ccircle cx='14' cy='3' r='.6' fill='%23fff'/%3E%3Ccircle cx='11' cy='13' r='1' fill='%23FFD600'/%3E%3Ccircle cx='3' cy='16' r='.6' fill='%23fff'/%3E%3Ccircle cx='17' cy='17' r='.7' fill='%23fff'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.26) calc(var(--size, 84px) * 0.26), conic-gradient(#0E1230, #B36BFF, #3DF5B0, #4CB8FF, #F27BB5, #0E1230); animation: aura-spin 4s linear infinite; }
.avatar.aura-cosmic::before { animation: aura-pulse 2.4s ease-in-out infinite; }
.avatar.aura-legend { --aura: rgba(255, 214, 0, 0.95); }
.avatar.aura-legend::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3l1.5 5.5L17 10l-5.5 1.5L10 17l-1.5-5.5L3 10l5.5-1.5z' fill='%23fff'/%3E%3C/svg%3E") 0 0 / calc(var(--size, 84px) * 0.2) calc(var(--size, 84px) * 0.2), conic-gradient(#FF5A5F, #FFB400, #FFE14D, #3DC596, #3BA9E0, #9B7BFF, #FF5A5F); animation: aura-spin 2.2s linear infinite; }
.avatar.aura-legend::before { animation: aura-pulse 1.2s ease-in-out infinite; }
@keyframes aura-spin { to { transform: rotate(360deg); } }
@keyframes aura-rise { from { background-position: 0 0; } to { background-position: 0 calc(var(--size, 84px) * -0.52); } }
@keyframes aura-fall { from { background-position: 0 0; } to { background-position: 0 calc(var(--size, 84px) * 0.44); } }
@keyframes aura-flicker { from { opacity: 0.55; } to { opacity: 1; } }
/* Name colours (parts.js memberName): rarer ones are gradients that shine. */
.member-name.name-sky { color: #1E8FD0; }
.member-name.name-grass { color: #3E9A2A; }
.member-name.name-berry { color: #C2185B; }
.member-name.name-orange { color: #E8710A; }
.member-name.name-ocean { color: #0E6FB0; }
.member-name.name-mint { color: #16A57A; }
.member-name.name-forest { color: #1F7A4A; }
.member-name.name-candy { background-image: linear-gradient(90deg, #FF4F8B, #B36BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-sunset { background-image: linear-gradient(90deg, #FF5A1F, #F5A800, #E0245E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-lava { background-image: linear-gradient(90deg, #B3200E, #FF5A1F, #F5A800); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-ice { background-image: linear-gradient(90deg, #1E8FD0, #6FC8F0, #1E8FD0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-gold { background-image: linear-gradient(90deg, #B87300, #F5B800, #B87300); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-neon { background-image: linear-gradient(90deg, #11B85E, #13A6E8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-galaxy { background-image: linear-gradient(90deg, #3A2BB0, #9B3BD8, #E0459A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-rainbow { background-image: linear-gradient(90deg, #E5383B, #F08A00, #D9A400, #2EAA6A, #1E8FD0, #7A4BD8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.member-name.name-fire { background-image: linear-gradient(90deg, #C81D11, #FF7A00, #E0A800, #FF7A00, #C81D11); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: name-shine 2s linear infinite; }
.member-name.name-aurora { background-image: linear-gradient(90deg, #0FA87A, #1E8FD0, #8A3BD8, #0FA87A); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: name-shine 3s linear infinite; }
.member-name.name-diamond { background-image: linear-gradient(90deg, #1E8FD0, #6FC8F0, #3A2BB0, #6FC8F0, #1E8FD0); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: name-shine 2.4s linear infinite; }
.member-name.name-royal { background-image: linear-gradient(90deg, #5B16A8, #C98100, #5B16A8, #C98100); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: name-shine 3s linear infinite; }
.member-name.name-legend { background-image: linear-gradient(90deg, #E5383B, #F08A00, #D9A400, #2EAA6A, #1E8FD0, #7A4BD8, #E5383B); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: name-shine 1.6s linear infinite; }
@keyframes name-shine { to { background-position: 200% 0; } }
/* What sits on the picture (src/ui/shopArt.js pictures, the same on every
   device): a badge at its foot, a hat on top, a pet beside it. */
.avatar-badge, .avatar-hat, .avatar-pet { position: absolute; z-index: 1; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.avatar-badge { right: -6%; bottom: -6%; width: 42%; height: 42%; }
.avatar-hat { left: 50%; top: -30%; width: 52%; height: 52%; transform: translateX(-50%); }
.avatar-pet { left: -22%; bottom: -10%; width: 46%; height: 46%; }

/* How rare a shop item is (rewards.js rarityOf): a tag on its tile, and a
   mythic one's tile shines. */
.hall-good { position: relative; padding-top: 40px; }
.hall-rarity { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; z-index: 2; font-size: 14px; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; color: var(--w-ink); background: var(--w-board-edge); }
.hall-rarity.rare { color: #FFFFFF; background: var(--w-guessing); }
.hall-rarity.epic { color: #FFFFFF; background: #7A4BD8; }
.hall-rarity.legendary { color: var(--w-ink); background: var(--w-sun); }
.hall-rarity.mythic { color: #FFFFFF; background: linear-gradient(90deg, var(--w-movement), var(--w-sun), var(--w-learning), var(--w-guessing), var(--w-movement)); background-size: 200% 100%; animation: name-shine 2.4s linear infinite; }
.hall-good.legendary { box-shadow: inset 0 0 0 3px var(--w-sun); }
.hall-good.mythic { box-shadow: inset 0 0 0 3px var(--w-movement), 0 0 0 3px var(--w-sun); }
.hall-good-fx img { width: 64px; height: 64px; object-fit: contain; }
.hall-mirror .member-name { display: inline-block; }

/* A victory of pictures (results.js pictureVictory): they fall, rise, burst
   or swirl. */
.victory-pics img { position: absolute; width: calc(56px * var(--s, 1)); height: calc(56px * var(--s, 1)); object-fit: contain; }
.victory-fall img { top: -60px; animation: fall linear forwards; }
.victory-rise img { top: auto; bottom: -60px; animation: balloon-up ease-out forwards; }
.confetti.contained.victory-rise img { animation-name: balloon-up-box; }
.victory-swirl img { opacity: 0; animation: pic-swirl ease-in-out forwards; }
@keyframes pic-swirl { 0% { opacity: 0; transform: scale(0.7) rotate(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(60px, -120px) scale(1.5) rotate(540deg); } }
.victory-burst b { position: absolute; width: 0; height: 0; }
.victory-burst b img { left: -22px; top: -22px; width: 44px; height: 44px; opacity: 0; animation: firework 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 2 both; animation-delay: inherit; }

@media (prefers-reduced-motion: reduce) {
  .avatar[class*=' frame-'], .avatar[class*=' bg-'], .avatar[class*=' aura-']::before, .avatar[class*=' aura-']::after, .member-name, .hall-rarity.mythic { animation: none !important; }
}
.results-title { position: relative; z-index: 1; margin: 0; font-size: clamp(17px, 2.2vh, 22px); font-weight: 800; color: var(--muted); }

/* A win's victory (results.js victory): what the winner bought, or the plain
   confetti. Contained: inside the shop's try-on panel. */
.confetti.contained { position: absolute; z-index: 0; }
.hall-mirror > :not(.confetti) { position: relative; z-index: 1; }
.victory-confetti i { width: 16px; height: 24px; }
.victory-stars i { width: 26px; height: 26px; border-radius: 0; background: #FFD600 !important; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.victory-balloons i { top: auto; bottom: -70px; width: 40px; height: 50px; border-radius: 50% 50% 46% 46%; animation-name: balloon-up; animation-timing-function: ease-out; }
.victory-balloons i::after { content: ''; position: absolute; left: 50%; top: 100%; width: 2px; height: 30px; background: rgba(31, 37, 71, 0.35); }
@keyframes balloon-up { to { transform: translateY(-130vh) rotate(-6deg); } }
.confetti.contained.victory-balloons i { animation-name: balloon-up-box; }
@keyframes balloon-up-box { to { transform: translateY(-900px); } }
.victory-fireworks b { position: absolute; width: 0; height: 0; }
.victory-fireworks b i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; opacity: 0; animation: firework 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 2 both; animation-delay: inherit; }
@keyframes firework { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1.3); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(170px) scale(0.6); } }
.victory-fireworks b { animation: none; }

/* The parent PIN keypad (src/ui/pin.js). */
.pin-pop { width: min(420px, calc(100vw - 32px)); }
.pin-pop h2 { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 8px; font-size: var(--w-text-l); }
.pin-pop h2 .w-icon { width: 1em; height: 1em; }
.pin-body { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pin-body input { width: 100%; min-height: var(--w-tap); border-radius: var(--w-radius-s); border: var(--w-line) solid var(--w-board-edge); padding: 0 16px; font-size: var(--w-text); }
.pin-reason { margin: 0; font-weight: 700; }
.pin-dots { display: flex; gap: 16px; }
.pin-dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--w-ink); }
.pin-dot.on { background: var(--w-ink); }
.pin-note { margin: 0; min-height: 1.3em; color: var(--w-oops-edge); font-weight: 700; }
/* The keypad: the kit's soft buttons (.w-btn.soft), one finger wide. */
.pin-keypad { display: grid; grid-template-columns: repeat(3, var(--w-tap)); gap: 14px; }
.pin-key { padding: 0; font-size: var(--w-text-l); }
.pin-key .w-icon { width: 50%; height: 50%; }
.pin-pop.shake { animation: pin-shake 0.35s; }
/* A phone held sideways: the keypad beside the rest, so it all fits. */
@media (max-height: 520px) {
  .pin-pop { width: min(640px, calc(100vw - 32px)); padding: 14px 20px; }
  .pin-body { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; row-gap: 8px; align-items: center; justify-items: center; }
  .pin-body > :not(.pin-keypad) { grid-column: 1; }
  .pin-keypad { grid-column: 2; grid-row: 1 / span 5; gap: 10px; }
}
@keyframes pin-shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .pin-pop.shake { animation: none; } }

/* The card table: the Guessing games except Shadow play on one sky-blue
   table (docs/design/OddOneOut-cards.html; the list is in src/ui/table.js).
   Pieces are flat cream cards with yellow backs and no outlines or printed
   shadows, the actions are dark ink pills. */
.night[data-table] {
  --tbl-sky: #5BB8F5; --tbl-deep: #3FA3E6; --tbl-cream: var(--w-board); --tbl-back: #F2C21A; --tbl-ink: #161616;
  --tbl-yes: var(--w-good); --tbl-no: #F2766E;
  --ooo-sky: var(--tbl-sky); --ooo-cream: var(--tbl-cream); --ooo-back: var(--tbl-back); --ooo-ink: var(--tbl-ink);
  --ink: var(--tbl-ink); --border: var(--tbl-ink); --muted: #1B3A52; --n-mark: #0B3F66; --n-dim: #1B3A52;
  --card: var(--tbl-cream); --tile: var(--tbl-cream); --n-gold: var(--tbl-back); --n-yes: var(--tbl-yes); --n-no: var(--tbl-no);
  --board-sec: var(--tbl-deep); --piece-line: 0 solid transparent; --piece-shadow: none;
  background: var(--tbl-sky); border-color: var(--tbl-sky); box-shadow: none; color: var(--tbl-ink);
}

/* Odd One Out: picture cards on the table (src/ui/oddOneOut.js). Four cards
   are dealt face down and flip over in a fan; at the answer the three that
   belong squeeze into one hand and the odd card is pulled out with an "odd!"
   band. Cards are sized from the space they have (container units). */
.ooo { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: clamp(4px, 1vh, 12px); }
.ooo-say { margin: 0; text-align: center; font-size: clamp(26px, min(4.6vw, 6.4vh), 64px); font-weight: 800; line-height: 1; letter-spacing: -0.02em; text-wrap: balance; }
.ooo-again { margin: 0; text-align: center; font-size: clamp(18px, 3vh, 28px); font-weight: 800; animation: ooo-wobble 0.4s both; }
@keyframes ooo-wobble { 25% { rotate: -3deg; } 75% { rotate: 3deg; } }
.ooo-fan, .ooo-done { flex: 1 1 0; min-height: 36vh; container-type: size; display: flex; justify-content: center; align-items: center; }

.ooo-card {
  --w: min(23cqw, 90cqh * 5 / 7); --rot: 0deg; --lift: 0px;
  position: relative; flex: none; width: var(--w); aspect-ratio: 5 / 7; margin: 0 calc(var(--w) * -0.03); padding: 0;
  border: 0; background: none; transform: translateY(var(--lift)) rotate(var(--rot)); perspective: 1200px;
  transition: transform 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}
/* A gentle fan with space between the cards: on touch no card may cover a
   corner of the next one (a 4-year-old's thumb lands on the wrong card). */
.ooo-fan { gap: clamp(8px, 3cqw, 32px); }
.ooo-fan .ooo-card { --w: min(21cqw, 88cqh * 5 / 7); margin: 0; }
.ooo-fan .ooo-card:nth-child(1) { --rot: -3deg; --lift: 2cqh; }
.ooo-fan .ooo-card:nth-child(2) { --rot: -1deg; }
.ooo-fan .ooo-card:nth-child(3) { --rot: 1deg; }
.ooo-fan .ooo-card:nth-child(4) { --rot: 3deg; --lift: 2cqh; }
.ooo-fan .ooo-card:focus-visible { --lift: -5cqh; z-index: 2; }
@media (hover: hover) { .ooo-fan .ooo-card:not(:disabled):hover { --lift: -5cqh; z-index: 2; } }
.ooo-fan .ooo-card:not(:disabled):active { --lift: -2cqh; }
.ooo-card:focus-visible { outline: 5px solid var(--ooo-ink); outline-offset: 6px; }
.ooo-card:disabled { cursor: default; opacity: 1; }
.ooo-flip { position: absolute; inset: 0; transform-style: preserve-3d; }
.ooo-face, .ooo-back { position: absolute; inset: 0; border-radius: clamp(10px, calc(var(--w) * 0.07), 20px); backface-visibility: hidden; overflow: hidden; }
.ooo-face { background: var(--ooo-cream); }
.ooo-back {
  transform: rotateY(180deg); display: grid; place-items: center; background: var(--ooo-back); color: var(--ooo-ink);
  font-size: calc(var(--w) * 0.4); font-weight: 800;
}
.ooo-back { isolation: isolate; }
.ooo-back::before { content: ''; position: absolute; z-index: -1; inset: 6%; border-radius: inherit; background: rgba(255, 255, 255, 0.22); }
.ooo-name { position: absolute; top: 5%; left: 7%; right: 7%; font-size: clamp(16px, calc(var(--w) * 0.075), 22px); font-weight: 800; line-height: 1; text-align: left; }
.ooo-pic {
  position: absolute; inset: 18% 10% 12%; width: 80%; height: 70%; object-fit: contain;
  /* A white die-cut edge, like a sticker. */
  filter: drop-shadow(3px 0 0 #FFFFFF) drop-shadow(-3px 0 0 #FFFFFF) drop-shadow(0 3px 0 #FFFFFF) drop-shadow(0 -3px 0 #FFFFFF);
}
.ooo-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * 0.5); font-weight: 800; letter-spacing: -0.04em; }

/* The deal: one card after another flips face up. */
.deal .ooo-flip { animation: ooo-deal 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
.deal .ooo-card:nth-child(2) .ooo-flip { animation-delay: 0.12s; }
.deal .ooo-card:nth-child(3) .ooo-flip { animation-delay: 0.24s; }
.deal .ooo-card:nth-child(4) .ooo-flip { animation-delay: 0.36s; }
@keyframes ooo-deal { 0% { transform: translateY(60px) rotateY(180deg); opacity: 0; } 25% { opacity: 1; } 100% { transform: none; } }

/* Little ones: bigger cards, no words, and a wrong card turns back over. */
.ooo.little .ooo-fan .ooo-card { --w: min(22cqw, 90cqh * 5 / 7); }
.ooo.little .ooo-pic { inset: 10% 8%; width: 84%; height: 80%; }
.ooo-card.nope { --lift: 5cqh; }
.ooo-card.nope .ooo-flip { transform: rotateY(180deg); }
.ooo-card.nope.turning .ooo-flip { animation: ooo-turn 0.5s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
@keyframes ooo-turn { from { transform: none; } }

/* The answer: the three close into one hand, the odd card is pulled out.
   They sit high, clear of the pop-up along the bottom. */
.ooo-done { gap: 7cqw; align-items: flex-start; padding-top: 3cqh; }
.ooo-hand { display: flex; align-items: center; padding: 0 3cqw; }
.ooo-hand .ooo-card { --w: min(17cqw, 56cqh * 5 / 7); margin: 0 calc(var(--w) * -0.04); }
.ooo-hand .ooo-card:nth-child(1) { --rot: -9deg; --lift: 3cqh; }
.ooo-hand .ooo-card:nth-child(3) { --rot: 9deg; --lift: 3cqh; }
.ooo-done .out { --w: min(20cqw, 62cqh * 5 / 7); --rot: 5deg; --lift: -1cqh; }
.ooo-ribbon {
  position: absolute; left: -8%; right: -8%; bottom: 16%; padding: 2% 0 4%; rotate: -6deg; background: var(--ooo-ink); color: var(--ooo-cream);
  text-align: center; font-size: calc(var(--w) * 0.22); font-weight: 800; line-height: 1; letter-spacing: -0.03em;
}
.ooo-pick {
  position: absolute; bottom: 5%; left: 50%; translate: -50% 0; white-space: nowrap; padding: 2px 12px; border-radius: 999px;
  background: var(--ooo-ink); color: var(--ooo-cream); font-size: clamp(16px, calc(var(--w) * 0.07), 18px); font-weight: 700;
}
/* On the odd card the mark for a right pick sits in the cream strip under the band. */
.out .ooo-pick { bottom: 2.5%; }
.fresh .ooo-hand .ooo-card { animation: ooo-squeeze 0.55s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes ooo-squeeze { from { margin: 0; } }
.fresh .out { animation: ooo-pull 0.6s 0.1s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes ooo-pull { from { transform: none; } }
.fresh .ooo-ribbon { animation: ooo-slap 0.35s 0.5s cubic-bezier(0.2, 1.6, 0.5, 1) both; }
@keyframes ooo-slap { from { scale: 1.6; opacity: 0; } }

/* Before the turn, on every table game: a deck lies face down beside the
   player, and the button starts the round (src/ui/table.js). The four backs
   splay out once as the screen opens. */
.tbl-ready { flex: 1 1 0; min-height: 0; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: clamp(28px, 7vw, 110px); }
.tbl-deck { --deck-w: clamp(140px, min(24vw, 46vh), 300px); position: relative; flex: none; width: var(--deck-w); aspect-ratio: 5 / 7; }
.tbl-deck .ooo-card { --w: var(--deck-w); position: absolute; inset: 0; width: 100%; margin: 0; animation: ooo-splay 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.tbl-deck .ooo-card:nth-child(1) { --rot: -11deg; translate: -14% 5%; }
.tbl-deck .ooo-card:nth-child(2) { --rot: -4deg; translate: -5% 2%; animation-delay: 0.06s; }
.tbl-deck .ooo-card:nth-child(3) { --rot: 5deg; translate: 6% 1%; animation-delay: 0.12s; }
.tbl-deck .ooo-card:nth-child(4) { --rot: -1deg; animation-delay: 0.18s; }
.tbl-deck .ooo-flip { transform: rotateY(180deg); }
@keyframes ooo-splay { from { translate: 0 0; transform: rotate(0deg); } }
/* Each Guessing game shows its own picture there instead
   (docs/design/GuessingReady-mock.html), drawn in the table's pieces: cream
   picture cards, yellow backs and ink. Its pieces come in one after another. */
.tbl-art { --a: clamp(220px, min(34vw, 56vh), 420px); position: relative; flex: none; width: var(--a); height: var(--a); color: var(--tbl-ink); }
.tbl-card { position: absolute; display: grid; place-items: center; overflow: hidden; border-radius: calc(var(--a) * 0.045); background: var(--tbl-cream); }
.tbl-card img { width: 82%; height: 82%; object-fit: contain; }
.tbl-back { background: var(--tbl-back); font-size: calc(var(--a) * 0.16); font-weight: 800; line-height: 1; }
.tbl-art .in { animation: tbl-in 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes tbl-in { from { opacity: 0; translate: 0 30px; } }

[data-art="odd-one-out"] .tbl-card { width: 36%; aspect-ratio: 5 / 7; }
[data-art="odd-one-out"] .c1 { left: 2%; top: 20%; rotate: -10deg; }
[data-art="odd-one-out"] .c2 { left: 20%; top: 14%; rotate: -3deg; }
[data-art="odd-one-out"] .c3 { left: 38%; top: 18%; rotate: 5deg; }
[data-art="odd-one-out"] .c4 { right: 0; top: 6%; width: 40%; rotate: 9deg; overflow: visible; }
.tbl-band { position: absolute; left: -10%; right: -10%; bottom: 2%; padding: 2% 0 4%; rotate: -6deg; background: var(--tbl-ink); color: var(--tbl-cream); text-align: center; font-size: calc(var(--a) * 0.09); font-weight: 800; line-height: 1; }

[data-art="whats-missing"] { display: grid; grid-template-columns: 1fr 1fr; gap: 6%; align-content: center; }
[data-art="whats-missing"] .tbl-card { position: relative; aspect-ratio: 1; }
[data-art="whats-missing"] .tbl-gap { background: rgba(11, 63, 102, 0.18); }
[data-art="whats-missing"] .tbl-float { position: absolute; right: -2%; bottom: -6%; width: 44%; rotate: 8deg; animation: tbl-in 0.6s 0.4s both, tbl-hover 2.4s 1s ease-in-out infinite; }
@keyframes tbl-hover { 50% { translate: 0 -10px; } }

.tbl-clue { width: 64%; height: 22%; justify-items: start; grid-template-columns: auto 1fr; gap: 6%; align-items: center; padding: 0 6%; white-space: nowrap; font-size: calc(var(--a) * 0.04); font-weight: 700; text-align: left; }
.tbl-clue b { display: grid; place-items: center; width: calc(var(--a) * 0.09); height: calc(var(--a) * 0.09); border-radius: 50%; background: var(--tbl-back); font-size: calc(var(--a) * 0.05); }
.tbl-clue.k1 { left: 0; top: 8%; rotate: -8deg; }
.tbl-clue.k2 { left: 4%; top: 38%; rotate: -3deg; }
.tbl-clue.k3 { left: 0; top: 68%; rotate: 4deg; }
.tbl-mystery { right: 0; top: 14%; width: 38%; aspect-ratio: 5 / 7; rotate: 6deg; font-size: calc(var(--a) * 0.26); }

[data-art="zoom"] .tbl-card { inset: 6%; }
[data-art="zoom"] .tbl-card img { width: 100%; height: 100%; object-fit: cover; transform-origin: 4% 30%; scale: 2.6; animation: tbl-creep 8s ease-in-out infinite alternate; }
@keyframes tbl-creep { to { scale: 2; } }
.tbl-corner { position: absolute; width: 14%; height: 14%; border: 0 solid var(--tbl-back); }
.tbl-corner.tl { left: 12%; top: 12%; border-top-width: 6px; border-left-width: 6px; border-top-left-radius: 10px; }
.tbl-corner.tr { right: 12%; top: 12%; border-top-width: 6px; border-right-width: 6px; border-top-right-radius: 10px; }
.tbl-corner.bl { left: 12%; bottom: 12%; border-bottom-width: 6px; border-left-width: 6px; border-bottom-left-radius: 10px; }
.tbl-corner.br { right: 12%; bottom: 12%; border-bottom-width: 6px; border-right-width: 6px; border-bottom-right-radius: 10px; }
.tbl-rec { position: absolute; left: 50%; top: 13%; translate: -50% 0; padding: 3px 12px; border-radius: 999px; background: var(--tbl-ink); color: var(--tbl-cream); font-size: calc(var(--a) * 0.042); font-weight: 800; }
.tbl-points { position: absolute; right: 2%; bottom: 2%; padding: 8px 16px; border-radius: var(--w-radius-s); background: var(--tbl-back); font-size: calc(var(--a) * 0.09); font-weight: 800; line-height: 1; rotate: -6deg; }
.tbl-points small { display: block; font-size: 0.4em; }

[data-art="memory-pairs"] { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 5%; padding: 8% 0; }
[data-art="memory-pairs"] .tbl-card { position: relative; }
[data-art="memory-pairs"] .tbl-back { font-size: calc(var(--a) * 0.1); }
[data-art="memory-pairs"] .tbl-card:nth-child(2) { rotate: -4deg; }
[data-art="memory-pairs"] .tbl-card:nth-child(6) { rotate: 4deg; }

.tbl-mat { position: absolute; left: 0; right: 0; bottom: 10%; height: 24%; border-radius: 999px; background: var(--tbl-deep); }
.tbl-cup { position: absolute; bottom: 16%; width: 32%; }
.tbl-cup.l { left: 0; }
.tbl-cup.m { left: 34%; bottom: 46%; animation: tbl-in 0.6s 90ms both, tbl-lift 2.6s 0.7s ease-in-out infinite; }
.tbl-cup.r { right: 0; }
@keyframes tbl-lift { 50% { translate: 0 -8%; } }
.tbl-peek { position: absolute; left: 36%; bottom: 14%; width: 28%; }

.tbl-secret { left: 18%; top: 2%; width: 64%; aspect-ratio: 5 / 6; rotate: -4deg; }
.tbl-seal { display: grid; place-items: center; width: 38%; aspect-ratio: 1; border-radius: 50%; background: var(--tbl-no); font-size: calc(var(--a) * 0.1); rotate: -12deg; }
.tbl-pegs { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 3%; padding: 3%; border-radius: 999px; background: var(--tbl-deep); }
.tbl-peg { aspect-ratio: 1; border-radius: 50%; background: rgba(11, 63, 102, 0.18); }
.tbl-peg.on { background: var(--tbl-back); }

[data-art="guess-the-word"] .tbl-word { left: 26%; top: 0; width: 48%; aspect-ratio: 5 / 6; rotate: -3deg; padding: 4%; }
[data-art="guess-the-word"] .tbl-word img { width: 100%; height: 100%; object-fit: contain; }
.tbl-slots { position: absolute; left: 4%; right: 4%; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4%; }
.tbl-slot { display: grid; place-items: center; aspect-ratio: 5 / 6; border-radius: calc(var(--a) * 0.03); background: rgba(11, 63, 102, 0.18); font-weight: 800; font-size: calc(var(--a) * 0.1); color: var(--tbl-ink); }
.tbl-slot.on { background: var(--tbl-cream); animation: tbl-in 0.6s 0.3s both; }

.tbl-secretn { left: 30%; top: 4%; width: 40%; aspect-ratio: 5 / 7; rotate: 3deg; font-size: calc(var(--a) * 0.26); }
.tbl-num { width: 30%; aspect-ratio: 5 / 7; overflow: visible; font-size: calc(var(--a) * 0.16); font-weight: 800; line-height: 1; }
.tbl-num.lo { left: 0; top: 26%; rotate: -12deg; }
.tbl-num.hi { right: 0; top: 30%; rotate: 11deg; }
.tbl-hint { position: absolute; left: 50%; bottom: -22%; translate: -50% 0; padding: 4px 10px; border-radius: 999px; background: var(--tbl-ink); color: var(--tbl-cream); font-size: calc(var(--a) * 0.042); white-space: nowrap; }
.tbl-num.lo .tbl-hint { rotate: 12deg; }
.tbl-num.hi .tbl-hint { rotate: -11deg; }

[data-art="money-count"] .tbl-mat { bottom: 8%; height: 30%; }
.tbl-coin { position: absolute; display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-weight: 800; line-height: 1; box-shadow: inset 0 0 0 calc(var(--a) * 0.014) rgba(22, 22, 22, 0.18); } /* taste-skill-ignore: the coin's milled rim, not a shadow */
.tbl-coin.ten { left: 6%; bottom: 20%; width: 34%; background: var(--tbl-back); font-size: calc(var(--a) * 0.12); }
.tbl-coin.five { left: 34%; bottom: 28%; width: 28%; background: var(--tbl-cream); font-size: calc(var(--a) * 0.1); }
.tbl-coin.one { left: 56%; bottom: 18%; width: 20%; background: #E59A62; font-size: calc(var(--a) * 0.08); }
.tbl-price { right: 2%; top: 4%; overflow: visible; padding: 6% 8% 6% 12%; rotate: 7deg; font-size: calc(var(--a) * 0.11); font-weight: 800; line-height: 1; }
.tbl-price::before { content: ""; position: absolute; left: 6%; top: 14%; width: 6%; aspect-ratio: 1; border-radius: 50%; background: var(--tbl-sky); }

.tbl-lanes { position: absolute; inset: 8% 0; display: grid; grid-template-rows: repeat(3, 1fr); gap: 5%; }
.tbl-lane { position: relative; border-radius: 999px; background: var(--tbl-deep); }
.tbl-runner { position: absolute; top: 50%; height: 120%; translate: 0 -55%; animation: tbl-run 1.6s 1s ease-in-out infinite alternate; }
.tbl-runner.r0 { left: 44%; }
.tbl-runner.r1 { left: 22%; animation-delay: 1.3s; }
.tbl-runner.r2 { left: 4%; animation-delay: 1.6s; }
@keyframes tbl-run { to { translate: 8% -55%; } }
.tbl-flag { position: absolute; right: 3%; top: 0; bottom: 0; display: grid; width: 12%; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; overflow: hidden; border-radius: calc(var(--a) * 0.03); }
.tbl-flag i { background: var(--tbl-cream); }
.tbl-flag i:nth-child(4n+1), .tbl-flag i:nth-child(4n+4) { background: var(--tbl-ink); }
.tbl-lid { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(8px, 1.8vh, 18px); min-width: 0; max-width: 40ch; }
.tbl-who { display: flex; align-items: center; gap: 14px; }
.tbl-who .avatar { width: clamp(56px, 11vh, 92px); height: clamp(56px, 11vh, 92px); font-size: clamp(24px, 5vh, 42px); box-shadow: 0 0 0 3px var(--ooo-ink); }
.tbl-tag { font-size: clamp(17px, 2.8vh, 24px); font-weight: 700; }
.tbl-say { margin: 0; font-weight: 800; line-height: 1; letter-spacing: -0.02em; text-wrap: balance; text-align: left; font-size: clamp(34px, min(5.6vw, 8.4vh), 80px); }
.tbl-rule { margin: 0; font-size: clamp(18px, 2.8vh, 26px); font-weight: 600; line-height: 1.25; }
.tbl-lid .night-champ { font-size: clamp(16px, 2.4vh, 20px); }
.night .tbl-go {
  margin-top: clamp(4px, 1vh, 10px); padding: clamp(14px, 2.4vh, 22px) clamp(28px, 3vw, 46px); border: 0; border-radius: 999px;
  background: var(--ooo-ink); color: var(--ooo-cream); font-size: clamp(20px, 3.2vh, 30px); font-weight: 800; line-height: 1;
  transition: transform 0.12s;
}
@media (hover: hover) { .night .tbl-go:hover { transform: translateY(-3px); } }
.night .tbl-go:active { transform: scale(0.96); }
.tbl-go:focus-visible { outline: 5px solid var(--ooo-ink); outline-offset: 5px; }

/* The Learning games' ready screen takes the green of their shops
   (docs/design/LearningReady-mock.html): the table's pieces on the shop
   green, with a forest ink. The games still play on the sky table. */
.night[data-section='learning'][data-ready] {
  --tbl-sky: var(--w-learning); --tbl-deep: #127A4E; --tbl-ink: #0F3A26;
  --ooo-sky: var(--tbl-sky); --ooo-ink: var(--tbl-ink); --ink: var(--tbl-ink); --border: var(--tbl-ink); --muted: var(--tbl-ink);
  background: var(--tbl-sky); border-color: var(--tbl-sky); color: var(--tbl-ink);
}
.night[data-section='learning'][data-ready] .tbl-slot { background: rgba(6, 40, 24, 0.28); }

/* The Group games' ready screen takes the honey of their shops on the street
   (docs/design/GroupReady-mock.html): cream cards like the shop windows, backs
   in the red of their doors, and the board's olive ink and big serif words. */
.night[data-board][data-ready] {
  --tbl-sky: #D9962A; --tbl-deep: #B87818; --tbl-cream: var(--w-board); --tbl-back: #C8402E; --tbl-ink: var(--brd-ink); --tbl-no: #C8402E;
  --ooo-cream: var(--tbl-cream); --ooo-back: var(--tbl-back); --ooo-ink: var(--tbl-ink);
  padding: var(--pad); background: var(--tbl-sky); border-color: var(--tbl-sky);
}
.night[data-board] .tbl-back { color: var(--tbl-cream); }
.night[data-board] .tbl-say { font-family: var(--brd-serif); font-weight: 900; }

[data-art="cards-memorize"] { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 5%; padding: 10% 0 6%; }
[data-art="cards-memorize"] .tbl-card { position: relative; }
[data-art="cards-memorize"] .tbl-back { font-size: calc(var(--a) * 0.1); }
[data-art="cards-memorize"] .up { rotate: -6deg; translate: 0 -8%; }
.tbl-timer { position: absolute; right: -2%; top: 0; padding: 6px 14px; border-radius: 999px; background: var(--tbl-ink); color: var(--tbl-cream); font-size: calc(var(--a) * 0.06); font-weight: 800; rotate: 6deg; }

.tbl-stage { position: absolute; inset: 4% 0 10%; overflow: hidden; border-radius: calc(var(--a) * 0.05); background: var(--tbl-deep); }
.tbl-curtain { position: absolute; top: 0; bottom: 0; width: 24%; background: var(--tbl-back); }
.tbl-curtain.l { left: 0; border-bottom-right-radius: 60% 30%; }
.tbl-curtain.r { right: 0; border-bottom-left-radius: 60% 30%; }
.tbl-valance { position: absolute; left: 0; right: 0; top: 0; height: 10%; background: var(--tbl-back); }
.tbl-act { left: 28%; top: 18%; width: 44%; aspect-ratio: 4 / 5; }
.tbl-shh { position: absolute; left: 50%; bottom: 0; translate: -50% 0; padding: 6px 18px; border-radius: 999px; background: var(--tbl-ink); color: var(--tbl-cream); font-size: calc(var(--a) * 0.07); font-weight: 800; rotate: -4deg; }

[data-art="spot-difference"] { display: grid; grid-template-columns: 1fr 1fr; gap: 5%; align-content: center; }
[data-art="spot-difference"] .tbl-card { position: relative; aspect-ratio: 3 / 4; padding: 6%; }
[data-art="spot-difference"] .tbl-card:first-child { rotate: -3deg; }
[data-art="spot-difference"] .tbl-card:nth-child(2) { rotate: 3deg; }
[data-art="spot-difference"] svg { display: block; width: 100%; height: 100%; border-radius: calc(var(--a) * 0.025); }
.tbl-ring { position: absolute; width: 26%; aspect-ratio: 1; border: calc(var(--a) * 0.022) solid var(--tbl-back); border-radius: 50%; animation: tbl-pop 0.4s both; } /* taste-skill-ignore: the ring the game draws round a found difference */
.tbl-ring.r1 { left: 14%; top: 11%; animation-delay: 0.6s; }
.tbl-ring.r2 { left: 37%; top: 67%; animation-delay: 0.9s; }
@keyframes tbl-pop { from { scale: 1.8; opacity: 0; } }

[data-art="story-dice"] .tbl-mat { bottom: 8%; height: 30%; }
.tbl-die { width: 34%; aspect-ratio: 1; border-radius: calc(var(--a) * 0.06); }
.tbl-die img { width: 74%; height: 74%; }
.tbl-die.d1 { left: 0; bottom: 18%; rotate: -12deg; }
.tbl-die.d2 { left: 33%; bottom: 40%; rotate: 8deg; animation: tbl-in 0.6s 0.1s both, tbl-tumble 2.6s 1s ease-in-out infinite; }
.tbl-die.d3 { right: 0; bottom: 16%; rotate: -4deg; }
@keyframes tbl-tumble { 50% { translate: 0 -10%; rotate: 20deg; } }

.tbl-bars { position: absolute; left: 18%; right: 18%; bottom: 6%; display: flex; align-items: flex-end; gap: 4%; height: 42%; }
.tbl-bar { flex: 1; height: calc(var(--h) * 1%); border-radius: 999px; background: var(--tbl-ink); transform-origin: bottom; animation: tbl-grow 0.6s both; animation-delay: calc(var(--i) * 60ms); }
@keyframes tbl-grow { from { scale: 1 0; } }
.tbl-vol { position: absolute; bottom: 4%; width: 16%; }
.tbl-vol.quiet { left: 0; }
.tbl-vol.loud { right: 0; }
.tbl-rocket { position: absolute; left: 46%; top: 2%; width: 42%; rotate: -20deg; animation: tbl-in 0.6s 0.4s both, tbl-fly 2.4s 1s ease-in-out infinite; }
@keyframes tbl-fly { 50% { translate: 4% -6%; } }

/* The Movement games' ready screen takes the coral pink of their shops
   (docs/design/MovementReady-mock.html): cream windows, yellow and mint trims
   and a plum ink. */
.night[data-section='movement'][data-ready] {
  --tbl-sky: var(--w-movement); --tbl-deep: #C23F59; --tbl-cream: var(--w-board); --tbl-back: #F2C21A; --tbl-ink: #3A1028; --tbl-mint: #8FCFB0; --tbl-red: #E23B3B;
  --ooo-cream: var(--tbl-cream); --ooo-back: var(--tbl-back); --ooo-ink: var(--tbl-ink);
  --ink: var(--tbl-ink); --border: var(--tbl-ink); --muted: var(--tbl-ink); --card: var(--tbl-cream); --piece-shadow: none;
  background: var(--tbl-sky); border-color: var(--tbl-sky); box-shadow: none; color: var(--tbl-ink);
}
.tbl-chip { position: absolute; padding: 6px 16px; border-radius: 999px; background: var(--tbl-ink); color: var(--tbl-cream); font-size: calc(var(--a) * 0.065); font-weight: 800; line-height: 1.1; white-space: nowrap; }

.tbl-reel { left: 0; right: 0; top: 14%; height: 62%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%; padding: 5%; background: var(--tbl-deep); }
.tbl-window { display: grid; place-items: center; overflow: hidden; border-radius: calc(var(--a) * 0.035); background: var(--tbl-cream); }
.tbl-window img { width: 94%; height: 94%; object-fit: contain; }
.tbl-window:not(.pick) { opacity: 0.7; }
.tbl-window.pick img { animation: tbl-wobble 1.4s 1s ease-in-out infinite; }
@keyframes tbl-wobble { 50% { rotate: 8deg; } }
.tbl-arrow { position: absolute; left: 50%; translate: -50% 0; width: 0; height: 0; border: calc(var(--a) * 0.05) solid transparent; }
.tbl-arrow.t { top: 3%; border-top-color: var(--tbl-back); }
.tbl-arrow.b { bottom: 14%; border-bottom-color: var(--tbl-back); }
[data-art="animal-moves"] .tbl-chip { right: 2%; bottom: 2%; rotate: -6deg; }

.tbl-pose { left: 14%; top: 4%; width: 62%; aspect-ratio: 4 / 5; }
.tbl-pose img { width: 100%; height: 100%; transform-origin: 50% 90%; animation: tbl-sway 1.2s ease-in-out infinite alternate; }
@keyframes tbl-sway { from { rotate: -4deg; } to { rotate: 4deg; } }
.tbl-note { position: absolute; width: 12%; animation: tbl-float 2.6s ease-in-out infinite; }
.tbl-note.n1 { right: 8%; top: 10%; }
.tbl-note.n2 { right: 2%; top: 38%; animation-delay: 0.8s; }
.tbl-note.n3 { left: 2%; top: 22%; animation-delay: 1.4s; }
@keyframes tbl-float { 50% { translate: 0 -14%; rotate: 10deg; } }
[data-art="copy-dancer"] .tbl-chip { left: 30%; bottom: 2%; rotate: -4deg; }
.tbl-note svg, .tbl-flake svg, .tbl-ice svg { display: block; width: 100%; height: 100%; }

.tbl-ice { left: 16%; top: 6%; width: 62%; aspect-ratio: 4 / 5; background: var(--tbl-mint); }
.tbl-ice::after { content: ""; position: absolute; left: 10%; top: 6%; width: 16%; height: 30%; border-radius: 999px; background: rgba(255, 255, 255, 0.55); rotate: 20deg; }
.tbl-flake { position: absolute; width: 12%; animation: tbl-spin 6s linear infinite; }
.tbl-flake.f1 { right: 4%; top: 6%; }
.tbl-flake.f2 { left: 2%; bottom: 18%; width: 9%; }
.tbl-flake.f3 { right: 10%; bottom: 8%; width: 8%; }
@keyframes tbl-spin { to { rotate: 360deg; } }

.tbl-light { position: absolute; left: 14%; top: 2%; display: grid; grid-template-rows: repeat(3, 1fr); gap: 5%; width: 30%; height: 86%; padding: 7%; border-radius: calc(var(--a) * 0.06); background: var(--tbl-ink); }
.tbl-pole { position: absolute; left: 26%; bottom: 0; width: 6%; height: 14%; background: var(--tbl-ink); }
.tbl-lamp { justify-self: center; height: 100%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.tbl-lamp.on { background: var(--tbl-red); animation: tbl-glow 1.2s ease-in-out infinite alternate; }
@keyframes tbl-glow { to { scale: 1.06; } }
.tbl-say-lamp { position: absolute; left: 52%; padding: 5px 14px; border-radius: 999px; background: var(--tbl-cream); font-size: calc(var(--a) * 0.06); font-weight: 800; }
.tbl-say-lamp i { display: inline-block; width: 0.7em; height: 0.7em; margin-right: 0.35em; border-radius: 50%; vertical-align: -0.05em; }
.tbl-say-lamp.s1 { top: 10%; }
.tbl-say-lamp.s1 i { background: var(--w-good); }
.tbl-say-lamp.s2 { top: 37%; }
.tbl-say-lamp.s2 i { background: var(--tbl-back); }
.tbl-say-lamp.s3 { top: 64%; background: var(--tbl-ink); color: var(--tbl-cream); font-size: calc(var(--a) * 0.075); }
.tbl-say-lamp.s3 i { background: var(--tbl-red); }

.tbl-bubble { left: 0; width: 88%; padding: 7% 8%; overflow: visible; justify-items: start; text-align: left; font-size: calc(var(--a) * 0.088); font-weight: 800; line-height: 1.15; }
.tbl-bubble::after { content: ""; position: absolute; left: 14%; bottom: -10%; border: calc(var(--a) * 0.04) solid transparent; border-top-color: var(--tbl-cream); }
.tbl-bubble small { display: block; font-size: 0.7em; font-weight: 700; opacity: 0.75; }
.tbl-bubble.b1 { top: 6%; rotate: -3deg; }
.tbl-bubble.b2 { left: auto; right: 0; top: 58%; width: 52%; rotate: 3deg; }
.tbl-mark { position: absolute; right: -6%; top: -12%; display: grid; place-items: center; width: calc(var(--a) * 0.14); aspect-ratio: 1; border-radius: 50%; color: var(--tbl-cream); font-size: calc(var(--a) * 0.08); font-weight: 800; }
.tbl-mark.yes { background: var(--w-good); }
.tbl-mark.no { background: var(--tbl-red); }

/* At the answer the pop-up is only the way on: the Next pill and its
   countdown in the table's empty bottom-right corner, clear of the cards
   (the table itself shows the rule, the odd card and a wrong pick). */
.screen.play:has(.ooo-done) .round-pop { justify-content: flex-end; padding: 0 clamp(28px, 4vw, 64px) clamp(22px, 4vh, 44px); }
.screen.play:has(.ooo-done) .card.round-popup { width: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.screen.play:has(.ooo-done) .round-popup .info { color: var(--w-ink); font-size: clamp(16px, 2.4vh, 20px); font-weight: 700; }
.screen.play:has(.ooo-done) .round-popup .btn.primary {
  padding: clamp(12px, 2vh, 18px) clamp(28px, 3vw, 44px); border: 0; border-radius: 999px;
  box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge), var(--w-shadow); background: var(--w-sun); color: var(--w-ink); font-size: clamp(18px, 2.8vh, 26px); font-weight: 800; line-height: 1;
}
.screen.play:has(.ooo-done) .round-popup .btn.primary:focus-visible { outline: 5px solid var(--w-ink); outline-offset: 5px; }
.ooo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* A phone held upright: the cards in two rows, and the answer stacked. */
@media (max-width: 760px) and (orientation: portrait) {
  .ooo-fan { display: grid; grid-template-columns: 1fr 1fr; place-items: center; gap: 2cqh 3cqw; }
  .ooo-fan .ooo-card, .ooo.little .ooo-fan .ooo-card { --w: min(44cqw, 46cqh * 5 / 7); margin: 0; }
  .ooo-fan .ooo-card:nth-child(n) { --lift: 0px; }
  /* safe: a tall stack (the judge warning) scrolls instead of losing its picture off the top */
  .tbl-ready { flex-direction: column; justify-content: safe center; gap: 6vh; }
  .night[data-section='movement'][data-ready] .tbl-ready { gap: 3vh; }
  .night[data-section='movement'][data-ready] .tbl-art { --a: min(54vw, 20vh); }
  .tbl-lid .night-warn { padding: 8px 12px; font-size: clamp(16px, 2vh, 17px); }
  .screen.play:has(.ooo-done) .round-pop { justify-content: center; padding: 0 28px 28px; }
  /* The odd card is small here: a right pick is a round tick on its top corner. */
  .out .ooo-pick.right { top: -10px; right: -10px; bottom: auto; left: auto; translate: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 18px; }
  .out .ooo-pick.right .ooo-pick-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .screen.play:has(.ooo-done) .card.round-popup { width: 100%; }
  .screen.play:has(.ooo-done) .round-popup .actions { width: 100%; justify-content: space-between; }
  .tbl-deck { --deck-w: clamp(120px, 40vw, 200px); }
  .tbl-art { --a: min(60vw, 26vh); flex: none; }
  .tbl-lid { align-items: center; text-align: center; }
  .tbl-say { text-align: center; }
  .ooo-done { gap: 4cqw; padding-top: 2cqh; }
  .ooo-hand { padding: 0 2cqw; }
  .ooo-hand .ooo-card { --w: min(23cqw, 40cqh * 5 / 7); }
  .ooo-done .out { --w: min(29cqw, 46cqh * 5 / 7); }
}
@media (prefers-reduced-motion: reduce) {
  .tbl-art *, .ooo-again, .tbl-deck .ooo-card, .deal .ooo-flip, .ooo-card.nope.turning .ooo-flip, .fresh .ooo-hand .ooo-card, .fresh .out, .fresh .ooo-ribbon { animation: none; }
  .ooo-card, .tbl-go { transition: none; }
}

/* The card table on the other Guessing games (src/ui/table.js): the pieces
   lose their outlines and printed shadows and take the table's cream and
   yellow, the prompt is the table's headline, and the actions are ink pills. */
.night[data-table] .prompt { text-align: center; font-size: clamp(22px, min(3.6vw, 5vh), 48px); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.night[data-table] .tile { position: relative; border: 0; box-shadow: none; transition: transform 0.15s; }
.night[data-table] .tile:disabled { box-shadow: none; }
@media (hover: hover) { .night[data-table] .tile:not(:disabled):hover { transform: translateY(-4px); } }
/* The answer is marked in words as well as colour: a tick on the right one, a cross on a wrong pick. */
.night[data-table] .tile.correct::after, .night[data-table] .tile.wrong:not(.tried)::after {
  content: '✓'; position: absolute; top: 8px; right: 8px; display: grid; place-items: center;
  width: clamp(30px, 5vh, 44px); height: clamp(30px, 5vh, 44px); border-radius: 50%;
  background: var(--tbl-ink); color: var(--tbl-cream); font-size: clamp(16px, 2.8vh, 24px); font-weight: 800;
}
.night[data-table] .tile.wrong:not(.tried)::after { content: '✗'; }
/* Hover and focus rings in ink: the usual yellow ring is lost on the yellow backs. */
.night[data-table] .tile:focus-visible, .night[data-table] .tq-card:focus-visible { outline-color: var(--tbl-ink); }
@media (hover: hover) { .night[data-table] .tile:not(:disabled):hover, .night[data-table] .tq-card:hover { outline-color: var(--tbl-ink); } }
.night[data-table] .night-go, .night[data-table] .study-ready, .night[data-table] .tq-use, .night[data-table] .tq-back-btn {
  border: 0; border-radius: 999px; background: var(--tbl-ink); color: var(--tbl-cream) !important; box-shadow: none;
}
.night[data-table] .night-go:focus-visible, .night[data-table] .study-ready:focus-visible { outline: 5px solid var(--tbl-ink); outline-offset: 5px; }

.night[data-table] .pill { border: 0; background: var(--tbl-cream); color: var(--tbl-ink); }

/* Memory Pairs: flat yellow backs like the dealt cards, the number on a cream disc. */
.night[data-table] .mem-card { border: 0; box-shadow: none; background: var(--tbl-back); }
.night[data-table] .mem-card:not(.up)::before { inset: 6%; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.22); }
.night[data-table] .mem-back { position: relative; border: 0; background: var(--tbl-cream); }
.night[data-table] .mem-card.up { background: var(--tbl-cream); box-shadow: none; }
.night[data-table] .mem-card.matched { box-shadow: 0 0 0 5px var(--owner); }

/* Twenty Questions: cream cards, yellow backs and a yellow sealed secret; flat Yes and No. */
.night[data-table] .tq-card, .night[data-table] .tq-person, .night[data-table] .tq-clue, .night[data-table] .tq-flip, .night[data-table] .tq-chip {
  border: 0; box-shadow: none; background: var(--tbl-cream); color: var(--tbl-ink) !important;
}
.night[data-table] .tq-card.back, .night[data-table] .tq-vault { border: 0; box-shadow: none; background: var(--tbl-back); }
.night[data-table] .tq-card-mark { color: var(--tbl-ink); text-shadow: none; }
.night[data-table] .tq-vault.open { background: var(--tbl-cream); color: var(--tbl-ink) !important; }
.night[data-table] .tq-chip.on { background: var(--tbl-back); }
.night[data-table] .tq-yes, .night[data-table] .tq-no { border: 0; border-radius: 999px; box-shadow: none; color: var(--tbl-ink) !important; }
.night[data-table] .tq-rules p { border: 0; background: var(--tbl-cream); }

/* Cup Shuffle: the cloth is a flat deeper-blue mat. Zoom: the camera's marks in ink. */
.night[data-table] .cs-cloth { border: 0; box-shadow: none; outline: 0; background: var(--tbl-deep); }
.night[data-table] .zoom-rec { background: var(--tbl-ink); }
.night[data-table] .zoom-dot { background: rgba(22, 22, 22, 0.2); }
.night[data-table] .zoom-dot.done { background: rgba(22, 22, 22, 0.55); }
.night[data-table] .zoom-dot.now { box-shadow: 0 0 0 3px var(--tbl-ink); }

@media (prefers-reduced-motion: reduce) { .night[data-table] .tile { transition: none; } }

/* The game board: the Group games (src/ui/table.js, docs/design/GroupGames-mock.html).
   The screen is a printed game board: bone paper on an amber edge, olive ink, and
   the game filling the board. Whose turn it is and what to do sit on one printed
   strip along its bottom edge, perforated where it meets the play area. Its big
   words are in Baloo 2, as everything is (docs/design/STYLE-BIBLE.md §5). */
.night[data-board] {
  --brd-edge: var(--w-sun); --brd-paper: var(--w-board); --brd-paper-2: #E3DFD3; --brd-ink: #38450F; --brd-ink-2: #5D683A; --brd-on-ink: var(--w-board);
  --brd-yes: var(--w-good); --brd-no: #F2766E; --brd-serif: 'Baloo 2', 'Trebuchet MS', sans-serif; --pad: clamp(10px, 2.4vh, 30px);
  --ink: var(--brd-ink); --border: var(--brd-ink); --muted: var(--brd-ink-2); --n-mark: var(--brd-ink); --n-dim: var(--brd-ink-2);
  --card: var(--brd-paper-2); --tile: var(--brd-paper-2); --n-gold: var(--brd-edge); --n-yes: var(--brd-yes); --n-no: var(--brd-no);
  --board-sec: var(--brd-edge); --piece-line: 0 solid transparent; --piece-shadow: none;
  padding: var(--pad) var(--pad) 0; border-color: var(--brd-edge); background: var(--brd-paper); box-shadow: none; color: var(--brd-ink);
}
.night[data-board] .night-big, .night[data-board] .night-name, .night[data-board] .prompt, .night[data-board] .ch-word { font-family: var(--brd-serif); font-weight: 900; letter-spacing: -0.02em; }

/* The printed strip: the last thing on the board, edge to edge. */
.night[data-board] > .brd-strip {
  --n-mark: var(--brd-edge); --border: var(--brd-on-ink);
  position: relative; margin: auto calc(var(--pad) * -1) 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 6px clamp(16px, 2.4vw, 32px); padding: clamp(12px, 2vh, 18px) var(--pad); background: var(--brd-ink); color: var(--brd-on-ink);
}
.night[data-board] > .brd-strip::before {
  content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 12px;
  background: radial-gradient(circle, var(--brd-paper) 4px, transparent 4.5px) 0 0 / 18px 12px repeat-x; /* the perforation */
}
.brd-strip .night-head { flex: 0 1 auto; }
.brd-strip .night-player .avatar { box-shadow: 0 0 0 3px var(--brd-on-ink); }
.brd-strip .night-big { font-size: clamp(22px, 3.6vh, 32px); }
.brd-strip .prompt { flex: 1 1 320px; margin: 0; color: var(--brd-on-ink); font-size: clamp(18px, 3vh, 28px); line-height: 1.15; text-wrap: balance; }
.brd-strip .clue-worth { color: var(--brd-ink); }

/* Pieces: flat bone cards, no outlines or printed shadows; actions are pills. */
.night[data-board] .night-go, .night[data-board] .btn.primary {
  border: 0; border-radius: 999px; background: var(--brd-edge); color: var(--brd-ink) !important; box-shadow: none;
}
.night[data-board] .btn:not(.primary), .night[data-board] .ch-skip { border: 0; border-radius: 999px; box-shadow: none; background: var(--brd-paper-2); color: var(--brd-ink); }
.night[data-board] .ch-buttons > button { border-radius: 999px; border: 0; box-shadow: none; }
.night[data-board] .ch-card, .night[data-board] .sd-die, .night[data-board] .ch-chip { border: 0; box-shadow: none; background: var(--brd-paper-2); color: var(--brd-ink); }
.night[data-board] .ch-card.covered { background: var(--brd-ink); color: var(--brd-on-ink); }
.night[data-board] .ch-card.covered .ch-rule { color: var(--brd-on-ink); opacity: 0.85; }
.night[data-board] .sd-die.used { background: var(--brd-paper); box-shadow: inset 0 0 0 4px var(--c); }
.night[data-board] .vp-card { border: 0; box-shadow: none; background: var(--brd-paper-2); }
.night[data-board] .vp-card p { color: var(--brd-ink-2); }
.night[data-board] .vp-card h2 { font-family: var(--brd-serif); font-weight: 900; }
.night[data-board] .night-ready .night-big { font-size: clamp(32px, min(5vw, 7vh), 64px); line-height: 1; }
.night[data-board] .night-ready { padding-bottom: var(--pad); }

/* Cards Memorize: face-down cards in olive ink with a bone number, face-up cards on bone. */
.night[data-board] .mem-card { border: 0; box-shadow: none; background: var(--brd-ink); }
.night[data-board] .mem-card:not(.up)::before { border: 0; }
.night[data-board] .mem-back { border: 0; background: var(--brd-paper); color: var(--brd-ink); }
.night[data-board] .mem-card.up { background: var(--brd-paper-2); box-shadow: none; }
.night[data-board] .cm-num { background: var(--brd-ink); color: var(--brd-on-ink); border-color: var(--brd-paper-2); }

/* Spot the Difference keeps its big pictures, now on the board; its count rides in the header, so no strip. */
.night[data-board]:has(.sp-stage) { padding: clamp(6px, 1.2vh, 14px); border: clamp(5px, 1vh, 9px) solid var(--brd-edge); border-radius: var(--w-radius); background: var(--brd-paper); }
.night[data-board]:has(.sp-stage) > .brd-strip { display: none; }

/* A phone held upright: the strip and the bar stack their parts. */
@media (max-width: 760px) and (orientation: portrait) {
  .brd-strip .prompt { flex-basis: 100%; }
}

/* Guess the Word on the card table (docs/design/GuessTheWord-mock.html,
   src/ui/guessTheWord.js): the ice cream scene on the left (3:4, sized in
   container units so Momo, his tower and the splats keep their places at any
   size), the blanks and the letters on the right. */
.gtw-layout { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(12px, 2.4vw, 28px); align-items: stretch; }
.gtw-scene {
  position: relative; height: clamp(260px, 58vh, 640px); aspect-ratio: 717 / 960; align-self: center; container-type: size; overflow: hidden;
  border-radius: 22px; background: var(--day, linear-gradient(#BFE9FF, #E9F8FF 72%, #9ED98A 72%)) center / cover no-repeat;
}
:root[data-theme='midnight'] .gtw-scene { background: var(--night, linear-gradient(#1D2D52, #2A3B66 72%, #2F5A3A 72%)) center / cover no-repeat; }
.gtw-scene img { display: block; user-select: none; -webkit-user-drag: none; }
.gtw-emoji { display: grid; place-items: center; line-height: 1; }
.gtw-momo { position: absolute; left: 50%; aspect-ratio: 439 / 520; translate: -50% 0; transform-origin: 50% 95%; }
.gtw-pose { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.gtw-momo .gtw-emoji { font-size: 30cqh; }
.gtw-hit { animation: gtw-hit 0.9s step-end both; }
@keyframes gtw-hit { 0% { opacity: 1; } 100% { opacity: 0; } }
.gtw-splat { position: absolute; width: 12cqh; translate: -50% -50%; opacity: 0.95; animation: gtw-splat 0.35s cubic-bezier(0.2, 1.8, 0.4, 1) both; pointer-events: none; }
@keyframes gtw-splat { from { scale: 0.2; } }
.gtw-scene.nervous .gtw-momo { animation: gtw-wobble 0.45s ease-in-out infinite alternate; }
.gtw-scene.won .gtw-momo { animation: gtw-dance 0.5s ease-in-out infinite alternate; }
@keyframes gtw-wobble { from { rotate: -3deg; } to { rotate: 3deg; } }
@keyframes gtw-dance { from { rotate: -6deg; translate: -50% 0; } to { rotate: 6deg; translate: -50% -3cqh; } }
/* The tower: cone tip in Momo's fist, scoops stacked up from it. */
.gtw-tower { position: absolute; width: 11cqh; translate: -50% 0; display: flex; flex-direction: column-reverse; align-items: center; transform-origin: 50% 100%; }
.gtw-scene.nervous .gtw-tower { animation: gtw-sway 1.2s ease-in-out infinite alternate; }
@keyframes gtw-sway { from { rotate: -4deg; } to { rotate: 4deg; } }
.gtw-cone { width: 74%; }
.gtw-scoop { width: 100%; margin-bottom: -5.2cqh; position: relative; z-index: calc(1 + var(--i)); }
.gtw-scoop:first-of-type { margin-bottom: -5.6cqh; }
.gtw-cherry { width: 34%; margin-bottom: -2cqh; position: relative; z-index: 20; animation: gtw-cherry 0.6s cubic-bezier(0.3, 1.6, 0.6, 1) both; }
@keyframes gtw-cherry { from { translate: 0 -60cqh; } }
.gtw-tower > .gtw-emoji { font-size: 8cqh; }
/* Lost: the empty cone flips onto his head, tip up. */
.gtw-hat { position: absolute; width: 8cqh; translate: -50% 0; rotate: 180deg; animation: gtw-hat 0.6s cubic-bezier(0.4, 1.8, 0.6, 1) both; }
@keyframes gtw-hat { from { translate: -50% -40cqh; rotate: 20deg; } }
/* The cat strolls across now and then. */
.gtw-cat { position: absolute; bottom: 3cqh; left: -20cqw; width: 14cqh; z-index: 5; animation: gtw-cat linear infinite; }
.gtw-cat img, .gtw-cat .gtw-emoji { width: 100%; font-size: 10cqh; }
.gtw-cat .gtw-splat { left: 50%; top: 35%; width: 7cqh; }
@keyframes gtw-cat { 0% { left: -20cqw; } 60%, 100% { left: 120cqw; } }
.gtw-left { position: absolute; left: 3cqh; top: 3cqh; padding: 0.3em 0.9em; border-radius: 999px; background: var(--tbl-cream); color: var(--tbl-ink); font-weight: 800; font-size: max(13px, 3.4cqh); z-index: 30; }
.gtw-reveal-pic { position: absolute; right: 4cqh; top: 4cqh; width: 26cqh; aspect-ratio: 1; object-fit: contain; padding: 2cqh; border-radius: 18px; background: var(--tbl-cream); rotate: 4deg; z-index: 30; animation: tbl-in 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
/* The flying scoop and the splat on the "camera lens" sit over the whole page. */
.gtw-flyer { position: fixed; z-index: 60; pointer-events: none; }
.gtw-flyer img, .gtw-flyer .gtw-emoji { width: 100%; font-size: 48px; }
.gtw-lens { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; }
.gtw-lens img, .gtw-lens .gtw-emoji { width: min(38vw, 300px); opacity: 0.45; filter: blur(1px); transition: opacity 0.8s; animation: gtw-splat 0.35s cubic-bezier(0.2, 1.8, 0.4, 1) both; }
.gtw-lens.fade img, .gtw-lens.fade .gtw-emoji { opacity: 0; }
/* The board: blanks, the letters, the whole-word guess. */
.gtw-board { min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(8px, 2vh, 18px); }
.gtw-count { align-self: center; margin: 0; padding: 0.2em 0.9em; border-radius: 999px; background: var(--tbl-cream); color: var(--tbl-ink); font-weight: 800; font-size: clamp(14px, 2.4vh, 18px); }
.gtw-blanks { display: flex; justify-content: center; gap: clamp(3px, 0.7vw, 8px); }
.gtw-blank {
  flex: 0 1 56px; min-width: 0; aspect-ratio: 5 / 7; max-height: 11vh; display: grid; place-items: center; border-radius: 10px;
  background: rgba(11, 63, 102, 0.18); color: var(--tbl-ink); font-weight: 800; font-size: clamp(16px, min(calc(52vw / var(--n, 8)), 6vh), 44px);
}
.gtw-blank.in { background: var(--tbl-cream); animation: gtw-land 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }
.gtw-blank.missed { background: var(--tbl-no); color: #fff; }
@keyframes gtw-land { 40% { transform: translateY(-14%) scale(1.12); } }
.gtw-note { margin: 0; text-align: center; color: var(--tbl-ink); font-weight: 800; font-size: clamp(16px, 3vh, 24px); }
.gtw-keys { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: clamp(4px, 0.8vh, 8px); }
.gtw-key {
  min-height: clamp(38px, 7vh, 60px); padding: 0; border: 0; border-radius: 12px; background: var(--tbl-cream); color: var(--tbl-ink);
  font-weight: 800; font-size: clamp(18px, 3.6vh, 28px); box-shadow: 0 4px 0 rgba(11, 63, 102, 0.3);
}
.gtw-key:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(11, 63, 102, 0.3); }
.gtw-key.yes { background: var(--tbl-yes); color: #fff; box-shadow: none; }
.gtw-key.no { background: transparent; color: var(--tbl-ink); opacity: 0.4; text-decoration: line-through; box-shadow: none; }
.gtw-guess { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gtw-input {
  flex: 1 1 200px; max-width: 420px; min-height: 50px; padding: 4px 14px; border: 3px solid var(--tbl-ink); border-radius: 14px;
  background: var(--tbl-cream); color: var(--tbl-ink); font: inherit; font-weight: 800; font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase;
}
.gtw-board .gtw-tool, .gtw-board .gtw-go { align-self: center; min-height: 48px; padding: 6px 18px; border: 0; border-radius: 999px; background: var(--tbl-ink); color: var(--tbl-cream); font-weight: 800; }
.gtw-board .gtw-go { background: var(--tbl-back); color: var(--tbl-ink); }
.gtw-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gtw-board .gtw-hint { background: var(--tbl-back); color: var(--tbl-ink); }
.gtw-board .gtw-hint.locked { background: #8a8a8a; color: #fff; cursor: not-allowed; }
@media (max-width: 760px) and (orientation: portrait) {
  .gtw-layout { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .gtw-scene { flex: none; height: clamp(160px, 25vh, 320px); }
  .gtw-board { width: 100%; flex: none; gap: 8px; }
  .gtw-keys { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .gtw-key { min-height: 38px; font-size: 18px; }
  .gtw-board .gtw-tool, .gtw-board .gtw-go { min-height: 40px; padding: 4px 14px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gtw-scene *, .gtw-lens * { animation: none !important; transition: none !important; }
  .gtw-cat { display: none; }
}

/* The other Learning games on the card table: flat cream keys and answers,
   no outlines or printed shadows; the player's colour stays as a ring. */
.night[data-table] .gn-num, .night[data-table] .gn-key, .night[data-table] .ar-choice {
  border: 0; box-shadow: none; background: var(--tbl-cream); color: var(--tbl-ink) !important;
}
@media (hover: hover) { .night[data-table] .gn-num:not(:disabled):hover, .night[data-table] .gn-key:not(:disabled):hover, .night[data-table] .ar-choice:not(:disabled):hover { transform: translateY(-3px); } }
.night[data-table] .gn-num.tried { background: rgba(11, 63, 102, 0.18); color: var(--tbl-ink) !important; }
.night[data-table] .gn-num.right, .night[data-table] .ar-choice.right { background: var(--tbl-yes); box-shadow: none; }
.night[data-table] .ar-lane { border: 0; box-shadow: inset 0 0 0 4px var(--c); background: var(--tbl-cream); }
.night[data-table] .ar-choice { background: var(--tbl-sky); }

/* ---- The world on the setup screens (docs/design/STYLE-BIBLE.md, R2 B3) ----
   Our Family, Teams, Nights, a past night and the Player house sheet carry
   .w-skin: the World Kit's surfaces and buttons (assets/world.css tokens)
   on the screens' own layouts. .w-screen adds the sky over the grass. */
.w-screen { background: transparent; color: var(--w-ink); }
/* The sky fills the whole window, not just the screen's own column. */
html:has(.w-screen), body:has(.w-screen) { background: linear-gradient(var(--w-sky), var(--w-sky-low) 45%, var(--w-grass-light)) fixed; }
.w-skin h1, .w-skin h2 { color: var(--w-ink); }
.w-skin .sub, .w-skin .note, .w-skin .muted, .w-skin .meta, .w-skin .field label, .w-skin .field .label, .w-skin .strength { color: var(--w-ink-soft); }

/* Cards are cream sign boards with a lip. */
.w-skin .card, .players-sheet.w-skin {
  background: var(--w-board); color: var(--w-ink); border-radius: var(--w-radius);
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), var(--w-shadow);
}
.w-skin .add-member { border: var(--w-line) dashed var(--w-board-edge); border-radius: var(--w-radius); background: rgb(255 248 231 / 0.6); color: var(--w-ink-soft); }

/* Buttons are the kit's toys: round ends, a lip, they sink when pressed. */
.w-skin .btn {
  --w-fill: var(--w-board); --w-edge: var(--w-board-edge);
  min-height: var(--w-tap); border: 0; border-radius: 999px; background: var(--w-fill); color: var(--w-ink);
  font-weight: 800; box-shadow: 0 var(--w-lip) 0 var(--w-edge), 0 8px 16px rgb(0 0 0 / 0.12);
  transition: transform 0.08s, box-shadow 0.08s;
}
.w-skin .btn:active:not(:disabled) { transform: translateY(var(--w-lip)); box-shadow: 0 0 0 var(--w-edge), 0 4px 8px rgb(0 0 0 / 0.12); }
.w-skin .btn.primary, .w-skin .btn.dark { --w-fill: var(--w-sun); --w-edge: var(--w-sun-edge); }
/* One sun-yellow "go" per screen: on Nights it is Carry on; a new night is the other choice. */
.w-skin .night-card .btn.dark { --w-fill: var(--w-board); --w-edge: var(--w-board-edge); }
.w-skin .member-form .btn.primary { --w-fill: var(--w-good); --w-edge: var(--w-good-edge); color: var(--w-ink); }
.w-skin .btn.danger { --w-fill: var(--w-board); --w-edge: var(--w-oops); color: var(--w-oops-edge); }
.w-skin .btn .w-icon, .w-skin .night-row .w-icon { width: 1.25em; height: 1.25em; flex: none; }
.w-skin .btn:focus-visible { outline: 5px solid var(--w-ink); outline-offset: 4px; }

/* Choices in a row (Play / Host, Solo / Teams): the picked one in sun yellow. */
.w-skin .segmented { background: var(--w-board-edge); border-radius: 999px; }
.w-skin .segmented button { min-height: calc(var(--w-tap) - 12px); border-radius: 999px; color: var(--w-ink); font-weight: 700; }
.w-skin .segmented button[aria-pressed='true'], .w-skin .segmented button[aria-selected='true'] { background: var(--w-sun); color: var(--w-ink); box-shadow: 0 3px 0 var(--w-sun-edge); }

/* Fields: white wells in the cream board. */
.w-skin .field input, .w-skin .field select, .w-skin .team-name-input {
  min-height: var(--w-tap); border: var(--w-line) solid var(--w-board-edge); border-radius: var(--w-radius-s);
  background: #FFFFFF; color: var(--w-ink);
}
.w-skin .swatch { width: 64px; height: 64px; box-shadow: 0 3px 0 rgb(0 0 0 / 0.18); }

/* Labels (levels, counts) as the kit's badges. */
.w-skin .pill:not(.card) { background: var(--w-board-edge); color: var(--w-ink); font-weight: 800; }
.w-skin .meter { background: var(--w-board-edge); }
.w-skin .night-row { border-radius: var(--w-radius-s); background: var(--w-board); box-shadow: 0 4px 0 var(--w-board-edge); color: var(--w-ink); }
/* A phone held sideways has little height: the grown-ups' fields and small
   buttons give way first (never below 44 px); the main buttons keep --w-tap. */
@media (max-height: 520px) {
  .w-skin .field input, .w-skin .field select { min-height: 44px; }
  .w-skin .btn.small { min-height: 44px; }
  .w-skin .segmented button { min-height: 48px; }

  /* The family form scrolls; its Add button stays in sight at the bottom. */
  .w-skin .member-form { overflow-y: auto; }
  .w-skin .member-form .form-actions { position: sticky; bottom: calc(-1 * clamp(14px, 2.6vh, 28px)); padding: 8px 0 clamp(14px, 2.6vh, 28px); background: var(--w-board); }
}

/* ---- Every game on its district's board (docs/design/STYLE-BIBLE.md §7, R2 B4) ----
   One frame for every game: the district's colour with a lip around the cream
   board, white pieces edged in the district's colour, sun yellow for go.
   The three older looks (the plain board, the card table [data-table], the
   printed board [data-board]) keep their layouts; their colour names are
   given the World Kit's colours here, so each game's own CSS follows. */
.stage .night.w-frame[data-district] {
  --w-edge-dark: color-mix(in srgb, var(--w-district) 70%, #000);
  /* The plain board's names. */
  --sec: var(--w-district); --board-sec: var(--w-district); --felt: var(--w-board);
  --ink: var(--w-ink); --muted: var(--w-ink-soft); --border: var(--w-edge-dark); --card: #FFFFFF; --tile: #FFFFFF;
  --n-night: var(--w-ink); --n-gold: var(--w-sun); --n-yes: var(--w-good); --n-no: var(--w-oops);
  --n-mark: var(--w-edge-dark); --n-dim: var(--w-ink-soft); --n-line: var(--w-board-edge);
  --piece-line: var(--w-line) solid var(--w-district); --piece-shadow: 0 var(--w-lip) 0 var(--w-edge-dark);
  /* The card table's. */
  --tbl-sky: var(--w-board); --tbl-deep: var(--w-district); --tbl-cream: #FFFFFF; --tbl-back: var(--w-sun);
  --tbl-ink: var(--w-ink); --tbl-yes: var(--w-good); --tbl-no: var(--w-oops); --tbl-mint: var(--w-good); --tbl-red: var(--w-oops);
  --ooo-sky: var(--w-board); --ooo-cream: #FFFFFF; --ooo-back: var(--w-sun); --ooo-ink: var(--w-ink);
  /* The printed board's, in Baloo 2. */
  --brd-edge: var(--w-district); --brd-paper: var(--w-board); --brd-paper-2: #FFFFFF; --brd-ink: var(--w-ink);
  --brd-ink-2: var(--w-ink-soft); --brd-on-ink: #FFFFFF; --brd-yes: var(--w-good); --brd-no: var(--w-oops);
  --brd-serif: 'Baloo 2', 'Trebuchet MS', sans-serif;
  background: var(--w-board); color: var(--w-ink);
  border: clamp(8px, 1.4vh, 16px) solid var(--w-district); border-radius: calc(var(--w-radius) + 8px);
  box-shadow: 0 var(--w-lip) 0 var(--w-edge-dark), var(--w-shadow);
}
/* The Group games' strip: what to do, on the district's colour. */
.stage .night.w-frame[data-board] > .brd-strip { background: var(--w-district); color: #FFFFFF; }
.stage .night.w-frame[data-board] > .brd-strip::before { display: none; }
.stage .night.w-frame[data-board] .brd-strip .prompt { color: #FFFFFF; }

/* The game's big buttons are the kit's go: Start, Deal, Next. */
.stage .night.w-frame .night-go, .stage .night.w-frame .tbl-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: var(--w-tap-big); padding: 0 clamp(24px, 3vw, 44px); border: 0; border-radius: 999px;
  background: var(--w-sun); color: var(--w-ink) !important; font-size: var(--w-text-l) !important; font-weight: 800;
  box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge), 0 10px 18px rgb(0 0 0 / 0.16);
}
.stage .night.w-frame .night-go:active, .stage .night.w-frame .tbl-go:active { transform: translateY(var(--w-lip)); box-shadow: 0 0 0 var(--w-sun-edge); }
.night-go .w-icon, .tbl-go .w-icon, .round-popup .btn .w-icon { width: 1.2em; height: 1.2em; flex: none; }

/* The host stands by on the ready screen, at the board's bottom left. */
.night.w-frame { position: relative; }
.night.w-frame > .ready-host { position: absolute; left: clamp(6px, 1.4vw, 24px); bottom: 0; z-index: 3; pointer-events: none; }
.night.w-frame > .ready-host .w-host-pic { width: clamp(84px, 24vh, 260px); }

/* The top row: Back and the game's name, then whose turn with the clock. */
.screen.play .play-head { gap: clamp(8px, 1.4vw, 20px); }
.screen.play .play-title .w-btn { flex: none; }
.screen.play .play-title .game { color: var(--w-ink); }
.screen.play .play-title .round { color: var(--w-ink-soft); font-weight: 700; }
.play-who { display: flex; align-items: center; gap: clamp(8px, 1.4vw, 20px); flex: 1 1 auto; justify-content: center; min-width: 0; }
.play-who .w-turn { min-width: 0; max-width: 100%; }
.play-who .w-turn .avatar { --size: 100%; width: 100%; height: 100%; font-size: clamp(22px, 3.6vh, 44px); }
.play-who .ring { width: clamp(64px, 11vh, 120px); height: clamp(64px, 11vh, 120px); }
.play-who .ring span { font-size: clamp(24px, 4.4vh, 48px); }

/* The pop-up after a round, in every game: a cream sign board framed in the
   district's colour with the toy's lip, the host leaning out on the left, the
   result on a soft tint (green for right, the kit's soft orange for a miss),
   and the sun Next. Only World Kit tokens; no dark bars. */
.round-pop[data-district] { padding: 0 clamp(16px, 3vw, 48px) clamp(14px, 2.4vh, 26px); }
.card.round-popup.w-skin {
  --w-fill: var(--w-district);
  width: min(1040px, 100%); overflow: visible; flex-wrap: nowrap; gap: clamp(10px, 1.4vw, 18px);
  padding: clamp(8px, 1.2vh, 14px) clamp(10px, 1.4vw, 16px); border: var(--w-line) solid var(--w-district);
  border-radius: var(--w-radius); background: var(--w-board);
  box-shadow: 0 var(--w-lip) 0 color-mix(in srgb, var(--w-district) 72%, #000), var(--w-shadow);
}
.round-popup.w-skin .feedback {
  flex: 1 1 auto; justify-content: flex-start; align-self: stretch; gap: clamp(10px, 1.2vw, 16px);
  min-height: clamp(56px, 8vh, 80px); padding: 6px clamp(12px, 1.6vw, 22px); text-align: left; line-height: 1.15;
  border: 0; border-left: 8px solid var(--w-good); border-radius: var(--w-radius-s); box-shadow: none;
  background: color-mix(in srgb, var(--w-good) 16%, var(--w-board)); color: var(--w-ink);
  font-size: var(--w-text); font-weight: 800;
}
.round-popup.w-skin .feedback.bad { border-left-color: var(--w-oops); background: color-mix(in srgb, var(--w-oops) 18%, var(--w-board)); }
/* The answer's picture sits on a small white card, like the game's own cards. */
.round-popup.w-skin .feedback > img, .round-popup.w-skin .rb-result-face {
  flex: none; width: clamp(56px, 9vh, 92px); height: clamp(56px, 9vh, 92px); padding: 6px; object-fit: contain;
  border: 3px solid var(--w-district); border-radius: var(--w-radius-s); background: #FFFFFF;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--w-district) 70%, #000);
}
.round-popup.w-skin .rb-result-face { display: grid; place-items: center; }
.round-popup.w-skin .rb-result-face b { font-size: var(--w-text-l); }
.round-popup.w-skin .actions { flex: none; flex-wrap: nowrap; gap: 12px; }
.round-popup.w-skin .info { color: var(--w-ink-soft); font-size: var(--w-text-s); font-weight: 700; white-space: nowrap; }
.round-popup.w-skin .btn:not(.primary) { --w-fill: var(--w-board); --w-edge: var(--w-board-edge); }
/* The table and the board give up the bar's height while it is up, so it
   covers nothing. The bar is as tall as its tallest piece (the host leaning
   out, the result or Next), plus its padding, frame, lip and the gap under it. */
.screen.play:has(.night[data-table], .night[data-board]):not(:has(.ooo-done)) .play-main:has(~ .round-pop) {
  padding-bottom: calc(max(clamp(72px, 16vh, 150px) - 18px, clamp(56px, 8vh, 80px), var(--w-tap))
    + 2 * clamp(8px, 1.2vh, 14px) + 2 * var(--w-line) + var(--w-lip) + clamp(14px, 2.4vh, 26px));
}
/* A phone held upright: the result on its own row, then the countdown and Next. */
@media (max-width: 760px) and (orientation: portrait) {
  .card.round-popup.w-skin { flex-wrap: wrap; }
  .round-popup.w-skin .feedback { flex-basis: 100%; font-size: var(--w-text-s); }
  .round-popup.w-skin .popup-host { display: none; }
  .round-popup.w-skin .actions { flex: 1 1 100%; justify-content: space-between; }
  .round-popup.w-skin .actions .btn { flex: 1 1 auto; }
  .screen.play:has(.night[data-table], .night[data-board]):not(:has(.ooo-done)) .play-main:has(~ .round-pop) { padding-bottom: 190px; }
}
/* A phone on its side: a tighter board. */
@media (orientation: landscape) and (max-height: 600px) {
  .card.round-popup.w-skin { padding: 6px 10px; }
  .round-popup.w-skin .feedback { min-height: 48px; font-size: var(--w-text-s); }
  .round-popup.w-skin .feedback > img, .round-popup.w-skin .rb-result-face { width: 48px; height: 48px; padding: 3px; }
}
/* A narrow screen: the top row keeps Back, whose turn, the clock and the
   game's own counter; the game's name gives way (it is on the board). */
@media (max-width: 900px) {
  .screen.play .play-title .names { display: none; }
  .screen.play .play-head-mid { min-width: 0; flex: 0 1 auto; }
}
/* The host's bubble on the ready screen sits over the host, small. */
.night.w-frame > .ready-host .w-bubble { font-size: var(--w-text-s); padding: 8px 16px; white-space: nowrap; }
/* A phone held sideways: the go button gets what the height leaves (96 px
   from about 390 px tall, the kit's 64 px under Safari's bars), so a long
   rule still fits without scrolling. */
@media (max-height: 520px) {
  .stage .night.w-frame .night-go, .stage .night.w-frame .tbl-go { min-height: clamp(var(--w-tap), calc(100vh - 294px), var(--w-tap-big)); font-size: var(--w-text-l) !important; }
  .night.w-frame > .ready-host .w-host-pic { width: clamp(64px, 20vh, 110px); }
  /* No room for the bubble beside the play area here: the host's voice says it. */
  .night.w-frame > .ready-host .w-bubble { display: none; }
  .night.w-frame .tbl-lid { gap: 6px; max-width: 48ch; }
  .night.w-frame .tbl-say { font-size: clamp(22px, 7vh, 30px); }
  .night.w-frame .tbl-rule { font-size: clamp(16px, 3.6vh, 16px); line-height: 1.2; }
  .night.w-frame .tbl-lid .night-note { font-size: 16px; padding: 4px 10px; }
}

/* ---- The hosts come alive (R2 B7) and the results' props (B9) ---- */
/* The round's pop-up: the district's host cheers or comforts beside it. */
.round-popup .popup-host { flex: 0 0 auto !important; align-self: flex-end; margin: -6px 0 -12px; }
.round-popup .popup-host .w-host-pic { width: clamp(72px, 16vh, 150px); }
/* The results: Leo and the prop instead of an emoji. */
.results .results-host { display: flex; align-items: flex-end; justify-content: center; gap: clamp(4px, 1vw, 16px); font-size: 0; }
.results .results-host .w-host-pic { width: clamp(84px, 20vh, 220px); }
.results-prop { width: clamp(64px, 15vh, 170px); height: auto; filter: drop-shadow(0 8px 10px rgb(0 0 0 / 0.2)); animation: prop-pop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) 0.3s both; }
@keyframes prop-pop { from { transform: scale(0.3) rotate(-12deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .results-prop { animation: none; } }
/* The loading window: the bus drives in on a cream board, the host waits. */
.ready-sheet .ready-card { background: var(--w-board); color: var(--w-ink); border-radius: calc(var(--w-radius) + 8px); box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), 0 24px 60px rgb(0 0 0 / 0.3); }
.ready-road { display: flex; align-items: flex-end; gap: 12px; width: min(78vw, 460px); overflow: hidden; border-bottom: 6px solid var(--w-road); padding-bottom: 2px; }
.ready-bus { width: 62%; height: auto; animation: bus-in 1.2s cubic-bezier(0.2, 0.9, 0.3, 1) both, bus-bob 0.5s ease-in-out 1.2s infinite alternate; }
.ready-road .w-host-pic { width: clamp(70px, 14vh, 120px); }
@keyframes bus-in { from { transform: translateX(-120%); } }
@keyframes bus-bob { to { transform: translateY(-3px); } }
.ready-dots i { background: var(--w-sun); }
@media (prefers-reduced-motion: reduce) { .ready-bus { animation: none; } }

/* ---- The top row on a phone mirroring to a TV ----
   The TV layout lays a phone out 1280 px wide but under 600 px tall, with
   the corner buttons grown for fingers, and Android's larger text makes the
   words wider still. The corner buttons always stand last and never shrink,
   so nothing runs under them: the game's own counter and the host's buttons
   come before them, and the game's name gives way (the round stays). */
.play-head > .play-tools { order: 9; flex: none; }
.play-host { flex-shrink: 0; }
.screen.play .play-title { flex: 0 1 auto; min-width: 0; }
.screen.play .play-title .names > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen.play .play-head-mid { flex: 1 1 0; min-width: min-content; }
@media (max-width: 1100px) {
  .screen.play .play-head:is(:has(.play-host), :has(.play-head-mid)) .play-title .game { display: none; }
  .screen.play .play-head:is(:has(.play-host), :has(.play-head-mid)) .play-title { flex: none; }
}
html[data-tv="wide"] .screen.play .play-head:is(:has(.play-host), :has(.play-head-mid)) .play-title .game { display: none; }
html[data-tv="wide"] .screen.play .play-head:is(:has(.play-host), :has(.play-head-mid)) .play-title { flex: none; }
/* The clock never shrinks; the turn banner follows the screen's height too,
   so a short, wide screen gets a banner that fits beside everything else. */
.play-who > #clock { flex: none; }
.play-who .w-turn .w-face { width: clamp(52px, min(7vw, 13vh), 112px); }
.play-who .w-turn .w-name { font-size: clamp(22px, min(2.8vw, 5.4vh), 44px); }
/* A short screen: Spot the Difference's help line wraps under the count and
   steals the pictures' height (the ready screen said how to play). */
@media (max-height: 700px) { .sp-help { display: none; } }

/* The grown-up's buttons in the movement games and Guess the Word's keys: big
   enough to hit mid-dance on a phone, and on a phone mirroring to a TV. */
.mv-btn, .mv-person, .gtw-key, .gtw-tool, .gtw-go { min-width: 44px; min-height: 44px; }
html[data-tv="wide"] :is(.mv-btn, .mv-person, .gtw-key, .gtw-tool, .gtw-go) { min-width: var(--tv-touch); min-height: var(--tv-touch) !important; }

/* ---- R3: the animal friend picker in the family form ---- */
/* At least 64 px each (the kit's smallest tap): four to a row in the form. */
.animal-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.animal-pick {
  aspect-ratio: 1; min-width: 0; min-height: 64px; padding: 3px; border: 3px solid transparent; border-radius: 50%;
  background: var(--w-board-edge, var(--soft)); box-shadow: 0 3px 0 rgb(0 0 0 / 0.15); touch-action: manipulation;
}
.animal-pick img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.animal-pick[aria-pressed='true'] { border-color: var(--w-ink, var(--ink)); background: var(--w-sun, var(--yellow)); }
.animal-pick:disabled { opacity: 0.3; }
/* P4: a Wozzleby's picture is the whole figure; a player's round picture
   shows the head and shoulders. */
.avatar > .avatar-face { display: block; overflow: hidden; }
.avatar-face > img, .family-pick img { width: 100%; height: 100%; object-fit: cover; transform: scale(2.3); transform-origin: 50% 12%; pointer-events: none; }
.family-pick { overflow: hidden; }

/* R3: a short screen (a phone held sideways) lays each family card out
   as a row, so the animal friend stays big next to the name and level. */
@media (max-height: 500px) {
  .member {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-auto-rows: auto;
    align-content: center; justify-items: start; column-gap: 10px; row-gap: 2px; text-align: left;
  }
  .member .avatar { grid-row: span 2; width: min(64px, 70cqh); height: min(64px, 70cqh); }
}

/* R3: Animal Race with four or more players on a short screen (a phone
   held sideways): two columns of lanes, each with its track as a thin
   strip over the question, so the answer buttons stay 64 px. The rule
   line goes (the voice says it). */
@media (max-height: 500px) {
  .night:has(.ar-lanes.crowd) .prompt { display: none; }
  .ar-lanes.crowd { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-auto-rows: minmax(0, 1fr); gap: 6px; }
  .ar-lanes.crowd .ar-lane {
    grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(14px, 1fr) auto;
    row-gap: 2px; padding: 4px 8px;
  }
  .ar-lanes.crowd .ar-who { grid-row: 1 / -1; }
  .ar-lanes.crowd .ar-who .ar-name { display: none; }
  .ar-lanes.crowd .ar-track { height: 100%; --runner: 22px; }
  .ar-lanes.crowd .ar-flag { font-size: 18px; }
  .ar-lanes.crowd .ar-ask { justify-content: space-between; }
  .ar-lanes.crowd .ar-q { font-size: 20px; }
  .ar-lanes.crowd .ar-q.count { grid-template-columns: repeat(3, 26px); }
  .ar-lanes.crowd .ar-choices { gap: 4px; }
  .ar-lanes.crowd .ar-choice { width: 64px; min-width: 64px; height: 64px; font-size: 24px; padding: 0; }
}

/* R3: the buttons a child presses to go on are never under 64 px. */
.night-go, .study-ready { min-height: 64px; }
.results-next .btn { gap: 10px; }
.results-next .w-icon { width: 1.3em; height: 1.3em; flex: none; }

/* Results on a phone held sideways: one row of coins with their short
   words and the big Next beside them, and each side scrolls on its own
   above them. */
@media (orientation: landscape) and (max-height: 600px) {
  .results { grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; row-gap: 6px; }
  .results-side { align-self: stretch; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
  .results .results-next { position: static; flex-wrap: nowrap; gap: 12px; padding: 4px 0 10px; }
  .results .results-next::before { display: none; }
  .results-next .w-coin-btn { font-size: 18px; }
  .results-next .w-coin-btn:not(.go) { padding-right: 0.8em; }
  .results-next .w-coin-btn .w-words { display: none; }
  .results-next .w-coin-btn .w-short { display: inline; }
  .results-next .w-coin-btn.go { min-height: 72px; font-size: 22px; }
}
/* Small phones on their side: the coins a touch closer. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 720px) {
  .results .results-next { gap: 6px; }
  .results-next .w-coin-btn:not(.go) { margin-left: 0.6em; padding-right: 0.6em; }
}
/* Phones upright: the coins become tiles, coin on top and the short word
   under, and Next takes the whole row under them. */
@media (max-width: 700px) and (min-height: 601px), (max-width: 700px) and (orientation: portrait) {
  .results .results-next { flex-wrap: wrap; gap: 8px; padding: 6px 0 10px; }
  .results-next .w-coin-btn:not(.go) {
    flex: 1 1 0; flex-direction: column; justify-content: center; gap: 4px; min-width: 0;
    min-height: 76px; margin: 18px 0 0; padding: 0 2px 8px; border-radius: var(--w-radius-s); font-size: var(--w-text-s);
  }
  .results-next .w-coin-btn:not(.go) .w-coin { width: 40px; height: 40px; margin: -20px 0 0; }
  .results-next .w-coin-btn:not(.go) .w-words { display: none; }
  .results-next .w-coin-btn:not(.go) .w-short { display: inline; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .results-next .w-coin-btn.go { flex: 1 1 100%; justify-content: space-between; min-height: 80px; margin-top: 4px; font-size: 22px; }
  .results-next .w-coin-btn.go .w-words { overflow: hidden; text-overflow: ellipsis; }
}

/* Spot the Difference's scene album (src/ui/screens/shelf.js albumPanel) and
   the scenes a game opened (results.js sceneNews). */
.hall-album { --w-district: var(--w-group); }
.scene-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.scene-tile { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.scene-pic { width: 100%; overflow: hidden; --w-district: var(--w-group); }
.scene-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-tile figcaption { font-size: var(--w-text-s); font-weight: 800; line-height: 1.15; }
.scene-tile.locked .scene-pic img { filter: brightness(0) opacity(0.35); }
.scene-tile.locked .scene-pic { background: var(--w-board); }
.scene-lock { position: absolute; inset: 0; display: grid; place-items: center; color: var(--w-ink); }
.scene-lock .w-icon { width: 36%; height: 36%; }
.scene-tile.week .scene-pic { border-color: var(--w-sun-edge); }
.scene-tile.fresh .scene-pic, .scene-tile.week .scene-pic { animation: scene-glow 2s ease-in-out infinite; }
@keyframes scene-glow { 50% { box-shadow: 0 var(--w-lip) 0 color-mix(in srgb, var(--w-district) 70%, #000), 0 0 0 6px color-mix(in srgb, var(--w-sun) 70%, transparent); } }
@media (prefers-reduced-motion: reduce) { .scene-tile.fresh .scene-pic, .scene-tile.week .scene-pic { animation: none; } }
.scene-flag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 2; }
.scene-stars { display: flex; gap: 4px; font-size: 20px; line-height: 1; }
.scene-star { color: color-mix(in srgb, var(--w-ink) 20%, transparent); }
.scene-star.on { color: var(--w-sun-edge); }
/* Twenty Questions' sticker album (shelf.js tqAlbumPanel): photo-real
   pictures on a light card; one still to guess is a dark shape with a "?". */
.tq-album, .tq-album .scene-pic { --w-district: var(--w-guessing); }
.tq-album-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(76px, 8vw, 112px), 1fr)); gap: clamp(10px, 1vw, 14px); }
.tq-pic { position: relative; aspect-ratio: 1; background: var(--w-board); }
.tq-pic img { object-fit: contain; padding: 10%; box-sizing: border-box; }
.tq-tile.locked .scene-pic img { filter: brightness(0) opacity(0.7); }
.tq-tile.locked .scene-pic { background: var(--w-board-edge); }
.tq-mystery { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(32px, 4vw, 48px); font-weight: 800; color: var(--w-sun); text-shadow: 0 3px 0 var(--w-ink); }
.scene-news { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scene-news-pics { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.scene-news .scene-tile { width: clamp(120px, 18vw, 200px); animation: scene-unwrap 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes scene-unwrap { from { opacity: 0; transform: scale(0.3) rotate(-10deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .scene-news .scene-tile { animation: none; } }

/* Spot the Difference's road map (src/ui/spotDifference.js spotMap): the
   scenes' pictures in a winding row along a road, the bus at the current
   stop, and the next stop's Play beside the week's bonus scene. */
.night[data-game='spot-difference'][data-ready] .ready-host { display: none; }
.sp-map { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 18px); padding: clamp(8px, 1.4vw, 20px); }
.sp-map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-map-title { font-size: var(--w-text-l); font-weight: 800; }
.sp-road { position: relative; list-style: none; margin: 0; padding: clamp(30px, 8vh, 64px) clamp(24px, 4vw, 60px) clamp(12px, 4vh, 40px); display: flex; align-items: center;
  gap: clamp(20px, 3vw, 48px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; flex: 1 1 auto; min-height: 0;
  border-radius: var(--w-radius);
  /* The road runs through the middle and scrolls with the stops (local). */
  background:
    linear-gradient(transparent calc(50% - 14px), var(--w-road) calc(50% - 14px), var(--w-road) calc(50% + 14px), transparent calc(50% + 14px)) local,
    linear-gradient(var(--w-grass-light), var(--w-grass)) local; }
.sp-stop { position: relative; z-index: 1; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; scroll-snap-align: center; }
.sp-stop:nth-child(odd) { transform: translateY(-16%); }
.sp-stop:nth-child(even) { transform: translateY(16%); }
.sp-stop-pic { width: clamp(60px, min(12vw, 22vh), 170px); padding: 0; overflow: hidden; cursor: pointer; --w-district: var(--w-group); }
.sp-stop-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-stop-pic:disabled { cursor: default; }
.sp-stop.locked .sp-stop-pic img { filter: brightness(0) opacity(0.35); }
.sp-stop.locked .sp-stop-pic { background: var(--w-board); }
.sp-stop.current .sp-stop-pic { width: clamp(76px, min(16vw, 28vh), 230px); border-color: var(--w-sun-edge); animation: scene-glow 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sp-stop.current .sp-stop-pic { animation: none; } }
.sp-stop-num { position: absolute; top: -10px; left: -10px; z-index: 2; min-width: 32px; height: 32px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 999px; background: var(--w-board); border: 3px solid var(--w-ink); font-weight: 800; font-size: var(--w-text-s); }
.sp-stop.cleared .sp-stop-num { background: var(--w-good); color: var(--w-ink); border-color: var(--w-good-edge); }
.sp-stop.current .sp-stop-num { background: var(--w-sun); }
.sp-bus { position: absolute; z-index: 3; bottom: 100%; width: 70%; max-width: min(120px, 11vh); margin-bottom: -10px; pointer-events: none; animation: bus-idle 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sp-bus { animation: none; } }
.sp-chest { position: absolute; z-index: 2; right: -18px; bottom: 28px; font-size: clamp(24px, 3vw, 40px); }
.sp-road-end .sp-flag { font-size: clamp(36px, 5vw, 64px); }
.sp-map-foot { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 32px); flex-wrap: wrap; }
.sp-next { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.sp-next-what { font-size: var(--w-text); font-weight: 800; }
.sp-next.end .sp-next-what { font-size: var(--w-text-l); }
.sp-bonus { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: var(--w-line) solid var(--w-sun-edge); border-radius: var(--w-radius);
  background: var(--w-board); box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge); cursor: pointer; min-height: var(--w-tap); font: inherit; color: inherit; }
.sp-bonus-pic { width: clamp(56px, 6vw, 80px); padding: 0; overflow: hidden; }
.sp-bonus-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-bonus.done { opacity: 0.85; }
.sp-bonus-pic { position: relative; }
.sp-bonus.locked { cursor: default; border-color: color-mix(in srgb, var(--w-ink) 25%, transparent); box-shadow: 0 var(--w-lip) 0 color-mix(in srgb, var(--w-ink) 25%, transparent); }
.sp-bonus.locked .sp-bonus-pic img { filter: brightness(0) opacity(0.35); }
.sp-bonus.locked .w-badge { --w-fill: var(--w-board); }
.sp-bonus.locked .scene-stars { display: none; }
.sp-bonus-when { font-weight: 800; font-size: var(--w-text-s); }
.sp-map .scene-stars { font-size: clamp(16px, 2vw, 24px); }
/* The three roads as tabs on the map: dots for how hard, the progress, and
   a star on the youngest player's road. */
.sp-tiers { display: flex; gap: clamp(6px, 1vw, 12px); flex-wrap: wrap; }
.sp-tier { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--w-tap); padding: 6px 16px;
  border: var(--w-line) solid color-mix(in srgb, var(--w-ink) 25%, transparent); border-radius: 999px; background: var(--w-board);
  font: inherit; font-weight: 800; font-size: var(--w-text-s); color: var(--w-ink); cursor: pointer; }
.sp-tier.on { background: var(--w-sun); border-color: var(--w-sun-edge); box-shadow: 0 4px 0 var(--w-sun-edge); cursor: default; }
.sp-tier-dots { display: inline-flex; gap: 3px; }
.sp-tier-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--w-ink); }
.sp-tier-count { font-weight: 700; opacity: 0.75; }
.sp-tier-young { position: absolute; top: -10px; right: -6px; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: var(--w-good); color: var(--w-ink); }
.sp-tier-young .w-icon { width: 14px; height: 14px; }
/* After a stop: Next stop or Try again, the road map, Done. */
.round-popup .actions .w-btn { min-height: var(--w-tap); }

/* The road on the results and in the Trophy Hall. */
.road-news { gap: 8px; }
.road-bar { display: block; width: min(420px, 80vw); height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--w-ink) 12%, transparent); overflow: hidden; }
.road-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--w-sun); }
.road-chest { font-weight: 800; }
.road-row { display: flex; flex-direction: column; gap: 8px; }
.road-album { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.road-tile figcaption { display: none; }
.road-tile .sp-chest { right: -10px; bottom: 18px; font-size: 22px; }
@media (max-height: 500px) {
  .sp-map { gap: 6px; padding: 6px; }
  .sp-map-head .sp-map-title { font-size: var(--w-text); }
  .sp-map .scene-stars { font-size: 14px; }
  .sp-stop-num { min-width: 24px; height: 24px; top: -6px; left: -6px; border-width: 2px; }
  .sp-road { min-height: 40vh; padding-top: 24px; padding-bottom: 8px; }
  .sp-map-head > .w-badge { display: none; }
  .sp-tier { min-height: 40px; padding: 2px 10px; gap: 6px; }
  .sp-tier-count { display: none; }
  .sp-map-foot { flex-wrap: nowrap; gap: 10px; }
  .sp-map-foot .w-btn.go { min-height: var(--w-tap); font-size: var(--w-text); }
  .sp-map-foot .w-btn.soft { width: var(--w-tap); min-width: var(--w-tap); padding: 0; justify-content: center; }
  .sp-map-foot .w-btn.soft > span { display: none; }
  .sp-next-what { font-size: var(--w-text-s); }
  .sp-bonus { min-height: 0; padding: 4px 10px 4px 4px; }
  .sp-bonus-pic { width: 44px; }
}

/* The albums in the Trophy Hall (screens/shelf.js): on the Trophies tab
   only their covers; a cover opens its album as a book, one page at a
   time, the pages as chips that scroll sideways on a phone. */
.hall-covers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.hall-cover { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: var(--w-tap-big);
  padding: 14px 18px 14px 14px; border: 0; border-radius: var(--w-radius); background: var(--w-board); color: var(--w-ink); text-align: left;
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge); transition: transform 0.15s; }
.hall-cover:active { transform: translateY(var(--w-lip)); box-shadow: none; }
@media (hover: hover) { .hall-cover:hover { transform: translateY(-3px); } }
.hall-cover-art { display: block; width: clamp(84px, 9vw, 120px); aspect-ratio: 1; border-radius: var(--w-radius-s); overflow: hidden; }
.hall-cover-art .game-art { width: 100%; height: 100%; aspect-ratio: auto; padding: 0; }
.hall-cover-art .game-art > * { width: 100%; height: 100%; object-fit: cover; }
.hall-cover-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hall-cover-text b { font-size: var(--w-text); line-height: 1.15; }
.hall-cover-text .sub { font-size: var(--w-text-s); }
.hall-cover-go { display: grid; place-items: center; width: var(--w-tap); height: var(--w-tap); border-radius: 50%; background: var(--w-sun); color: var(--w-ink); box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge); }
.hall-cover-go .w-icon { width: 50%; height: 50%; }
.hall-cover.fresh .hall-cover-art { animation: scene-glow 2s ease-in-out infinite; }
.hall-book-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.hall-book-head h2 { flex: 1 1 auto; }
.hall-book-pages { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 4px 2px calc(var(--w-lip) + 4px); }
.hall-page { flex: none; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; min-height: var(--w-tap); padding: 6px 20px;
  border: 0; border-radius: 999px; background: var(--w-board); color: var(--w-ink); box-shadow: 0 var(--w-lip) 0 var(--w-board-edge); white-space: nowrap; }
.hall-page b { font-size: var(--w-text-s); line-height: 1.1; }
.hall-page small { font-size: 16px; font-weight: 700; color: var(--w-ink-soft); }
.hall-page.full small::after { content: ' ★'; color: var(--w-sun-edge); }
.hall-page.fresh b::after { content: ' ★'; color: var(--w-sun); }
.hall-page[aria-selected='true'] { background: var(--w-ink); color: var(--w-board); box-shadow: 0 var(--w-lip) 0 #000; }
.hall-page[aria-selected='true'] small { color: var(--w-board-edge); }
.hall-page:active { transform: translateY(3px); }
@media (max-width: 600px) {
  .hall-cover { grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
  .hall-cover-go { display: none; }
  .hall-book .road-album, .hall-book .tq-album-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .hall-cover.fresh .hall-cover-art { animation: none; } .hall-cover, .hall-page, .hall-district { transition: none; } }

/* ---- The results on the game's board (results.js stand) ----
   The win and the scores stand on the district's board, like the game just
   played; the coins for what next stand under it on the grass, so nothing
   covers a score. Only World Kit tokens. */
.results { display: flex; flex-direction: column; align-items: stretch; gap: clamp(10px, 2vh, 22px); overflow: visible; }
/* Static, so the confetti falls over the board but under the words. */
.results-board { position: static; flex: 1 1 auto; min-height: 0; width: min(1500px, 100%); margin: 0 auto; display: flex; flex-direction: column; padding: clamp(8px, 1.2vw, 18px); }
.results-board > .w-board-in {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start;
  gap: clamp(12px, 2vh, 24px) clamp(16px, 3vw, 48px); padding: clamp(12px, 2vh, 28px) clamp(12px, 2vw, 32px);
}
.results-side { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.6vh, 18px); min-width: 0; }
/* Landscape (a TV, a phone on its side): the two sides side by side, each
   scrolling on its own if it must. */
@media (orientation: landscape) {
  .results-board > .w-board-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
  .results.one-side .results-board > .w-board-in { grid-template-columns: minmax(0, 1fr); }
  .results-board .results-side { max-height: 100%; overflow-y: auto; justify-content: safe center; padding-bottom: 8px; }
  /* A tablet held sideways keeps about half its height for the board: the
     host, the title and the blocks shrink with it, so the podium stands whole. */
  .results.has-podium .results-host .w-host-pic { width: clamp(56px, 9vh, 220px); }
  .results.has-podium .results-prop { width: clamp(44px, 7vh, 170px); }
  .results.has-podium h1 { font-size: clamp(28px, 5.5vh, 64px); }
  .results.has-podium .place-1 .step-block { height: clamp(52px, 8vh, 120px); }
  .results.has-podium .place-2 .step-block { height: clamp(44px, 6.5vh, 88px); }
  .results.has-podium .place-3 .step-block, .results.has-podium .place-next .step-block { height: clamp(38px, 5vh, 64px); }
  /* The place coin and the points side by side, so the lower blocks hold both. */
  .results.has-podium .step-block { flex-direction: row; justify-content: center; align-items: center; gap: 10px; padding-top: 0; }
  /* Players sharing a step stand close, a little overlapped, so three stay on one row. */
  .results.has-podium .step-faces { gap: 0; }
  .results.has-podium .step-faces > .avatar + .avatar { margin-left: -12px; }
}
/* A side that still scrolls fades out at its foot until scrolled to the end,
   so what is below (tonight's stars) shows it is there. */
@property --side-fade { syntax: '<length>'; inherits: false; initial-value: 0px; }
@supports (animation-timeline: scroll()) {
  .results-board .results-side {
    mask-image: linear-gradient(to bottom, #000 calc(100% - var(--side-fade)), transparent);
    animation: side-fade linear both; animation-timeline: scroll(self);
  }
  @keyframes side-fade { 0%, 92% { --side-fade: 32px; } 100% { --side-fade: 0px; } }
}
.results .results-next { position: static; padding: 0 0 clamp(6px, 1.4vh, 14px); }
.results .results-next::before { display: none; }

/* The words. */
.results h1 { margin: 0; color: var(--w-ink); }
.results .sub, .results .results-title { margin: 0; color: var(--w-ink-soft); font-weight: 700; }
/* News from the shelf: white cards on the cream board, with a lip. */
.results .shelf-news, .results .scene-news {
  background: #FFFFFF; color: var(--w-ink); border: 3px solid var(--w-board-edge); border-radius: var(--w-radius-s);
  box-shadow: 0 4px 0 var(--w-board-edge);
}
.results .shelf-news .sticker { box-shadow: 0 0 0 4px var(--w-sun), 0 4px 0 4px var(--w-sun-edge); }
.results .winners .avatar { box-shadow: 0 0 0 5px #FFFFFF, 0 0 0 9px var(--w-sun); }

/* The podium: toy blocks with a lip; the winner's in the bus's sun yellow,
   the others white edged in the district; a number coin for each place. */
.results .step-names { color: var(--w-ink); }
.results .step-block {
  border: 3px solid var(--w-district); border-bottom: 0; border-radius: var(--w-radius-s) var(--w-radius-s) 6px 6px;
  background: #FFFFFF; color: var(--w-ink); box-shadow: 0 var(--w-lip) 0 color-mix(in srgb, var(--w-district) 72%, #000);
}
.results .place-1 .step-block { background: var(--w-sun); border-color: var(--w-sun-edge); box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge); }
.results .place-next .step-block { background: transparent; border: 3px dashed var(--w-board-edge); box-shadow: none; color: var(--w-ink-soft); }
.results .step-next { font-size: var(--w-text-s); font-weight: 800; }
.results .medal {
  display: grid; place-items: center; width: 1.7em; height: 1.7em; border: 3px solid var(--w-ink); border-radius: 50%;
  background: var(--w-board); color: var(--w-ink); font-size: clamp(16px, 2.4vh, 22px); font-weight: 800; box-shadow: 0 3px 0 var(--w-ink);
}
.results .place-1 .medal { background: #FFFFFF; }
.results .step-points { font-size: var(--w-text); font-weight: 800; }

/* The scores: white rows on the board; the winner's tinted sun with a
   stripe, as the round's result is. */
.results .standings { padding: 0; gap: 8px; width: min(640px, 100%); background: transparent; box-shadow: none; border-radius: 0; }
.results .standings .score-row { background: #FFFFFF; color: var(--w-ink); box-shadow: 0 4px 0 var(--w-board-edge); }
.results .standings .score-row.now { background: color-mix(in srgb, var(--w-sun) 24%, #FFFFFF); box-shadow: inset 8px 0 0 var(--w-sun), 0 4px 0 var(--w-sun-edge); }
.results .score-row .credit, .results .tonight-rule { color: var(--w-ink-soft); }
.results .standings.tonight h2 { color: var(--w-ink); font-size: var(--w-text-s); }
.results .standings.tonight { margin-top: clamp(4px, 1vh, 12px); }

/* A phone on its side: a slimmer frame, so the scores keep their room. */
@media (orientation: landscape) and (max-height: 600px) {
  .results { gap: 6px; }
  .results-board { padding: 6px; border-radius: var(--w-radius); }
  .results-board > .w-board-in { padding: 8px 10px; border-radius: var(--w-radius-s); }
}
/* On the board, Leo and his prop stay small enough for the podium to show. */
.results-board .results-host .w-host-pic { width: clamp(72px, 14vh, 170px); }
.results-board .results-prop { width: clamp(56px, 10vh, 130px); }
/* Read from the sofa: the scores at the kit's sizes. */
.results .standings .score-row .name { font-size: var(--w-text); }
.results .standings .score-row .pts { font-size: var(--w-text); }
.results .tonight-rule { font-size: var(--w-text-s); }
/* A big screen: the corner buttons run along the top, so the board starts under them. */
@media (min-width: 1000px) and (min-height: 601px) {
  .results-board { margin-top: clamp(48px, 6.5vh, 76px); }
}
.results-board .results-side { gap: clamp(6px, 1.2vh, 14px); }
.results-board .podium { margin-top: clamp(4px, 1vh, 12px); }

/* ---- The Trophy Hall in the World Kit (hall.js) ----
   The street's sky, the Group district's gold board, white cards with a
   lip on its cream, and the sun yellow for what is chosen (never navy).
   The hall's older colour names are given the kit's colours here, so the
   trophy shelf, the leaderboard and the star shop follow. */
.hall-screen {
  --card: #FFFFFF; --soft: var(--w-board); --line: var(--w-board-edge); --dash: var(--w-board-edge);
  --ink: var(--w-ink); --muted: var(--w-ink-soft); --yellow: var(--w-sun); --sec-group: var(--w-group);
  color: var(--w-ink);
}
.hall-top h1 { color: var(--w-ink); font-size: var(--w-text-l); }
.hall-back { flex: none; }
/* The tabs: cream toy pills on a track; the chosen one sun yellow. */
.hall-tabs { gap: 8px; padding: 6px 6px 10px; background: var(--w-board-edge); }
.hall-tab {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--w-tap); background: var(--w-board); color: var(--w-ink);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--w-board-edge) 70%, #000);
}
.hall-tab .w-icon { width: 1.2em; height: 1.2em; flex: none; }
.hall-tab[aria-selected='true'] { background: var(--w-sun); color: var(--w-ink); box-shadow: 0 4px 0 var(--w-sun-edge); }
@media (hover: hover) { .hall-tab:hover:not([aria-selected='true']) { background: #FFFFFF; } }
/* Who: each player a cream pill with a lip; the chosen one sun yellow. */
.hall-who { padding: 6px 4px 12px; }
.hall-person { background: var(--w-board); color: var(--w-ink); box-shadow: 0 4px 0 var(--w-board-edge); }
.hall-person small { color: var(--w-ink-soft); font-weight: 700; }
.hall-person[aria-pressed='true'] { background: var(--w-sun); color: var(--w-ink); box-shadow: 0 4px 0 var(--w-sun-edge); }
.hall-person[aria-pressed='true'] small { color: var(--w-ink); }
/* A star-shop name colour (a gradient) on the sun yellow pill: an ink outline keeps it readable. */
.hall-person[aria-pressed='true'] .member-name[class*='name-'] { -webkit-text-stroke: 0.04em var(--w-ink); }
@media (hover: hover) { .hall-person:hover:not([aria-pressed='true']) { background: #FFFFFF; } }
/* The board the shelves stand on. */
.hall-board { --w-district: var(--w-group); padding: clamp(8px, 1.2vw, 18px); }
.hall-board > .w-board-in { padding: clamp(12px, 1.8vw, 28px); }
/* Panels: white cards with a lip on the cream board. */
.hall-panel { background: #FFFFFF; border: 3px solid var(--w-board-edge); box-shadow: 0 var(--w-lip) 0 var(--w-board-edge); }
.hall-panel h2 { color: var(--w-ink); }
/* Chosen pills, rows and goods: sun yellow with a lip, ink words. */
.hall-pill { background: var(--w-board); color: var(--w-ink); box-shadow: 0 3px 0 var(--w-board-edge); }
.hall-pill[aria-pressed='true'] { background: var(--w-sun); color: var(--w-ink); box-shadow: 0 3px 0 var(--w-sun-edge); }
.hall-row.mine { background: color-mix(in srgb, var(--w-sun) 24%, #FFFFFF); color: var(--w-ink); box-shadow: inset 8px 0 0 var(--w-sun), 0 3px 0 var(--w-sun-edge); }
.hall-good { box-shadow: 0 4px 0 var(--w-board-edge); }
.hall-good[aria-current='true'] { background: var(--w-sun); color: var(--w-ink); box-shadow: 0 4px 0 var(--w-sun-edge); }
.hall-good[aria-current='true'] .hall-price.can { color: var(--w-ink); }
@media (hover: hover) { .hall-good:hover:not([aria-current='true']) { background: #FFFFFF; } }
.hall-filters select { background: var(--w-board); box-shadow: 0 3px 0 var(--w-board-edge); }
.hall-bar { background: var(--w-board-edge); }
.hall-empty, .hall-finding { color: var(--w-ink); }
.guide-steps li::before { background: var(--w-sun); color: var(--w-ink); }
.guide-tag { background: var(--w-sun); color: var(--w-ink) !important; }
/* A phone on its side: a slimmer top, so the shelves keep the height. The
   tabs say where you are, so the title gives way. */
@media (orientation: landscape) and (max-height: 600px) {
  .hall-screen { gap: 8px; }
  .hall-top { gap: 8px 14px; }
  .hall-top h1 { display: none; }
  /* The corner buttons stand in one column here: Back and the tabs share a row. */
  .hall-top { padding-right: 64px; flex-wrap: nowrap; }
  .hall-tabs { min-width: 0; }
  .hall-top .hall-back { width: 52px; min-width: 52px; min-height: 52px; }
  .hall-tabs { margin-left: 0; padding: 4px 4px 7px; }
  .hall-tab { min-height: 48px; padding: 0 16px; font-size: 17px; }
  .hall-who { padding: 2px 4px 8px; }
  .hall-person { padding: 3px 14px 3px 3px; }
  .hall-person .avatar { --size: 38px !important; width: 38px; height: 38px; }
  .hall-person b { font-size: 16px; }
  .hall-board { padding: 6px; }
  .hall-board > .w-board-in { padding: 8px; }
}
/* A phone upright: the chosen tab keeps its word; the others show their
   icon alone (the word stays for screen readers). */
@media (max-width: 520px) {
  .hall-tab { flex: 0 0 auto; padding: 0 16px; }
  .hall-tab[aria-selected='true'] { flex: 1 1 auto; }
  .hall-tab:not([aria-selected='true']) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hall-board { padding: 6px; }
  .hall-board > .w-board-in { padding: 8px; }
}

/* ---------------------------------------------------------------------------
   Street Party, the board game (src/ui/screens/party.js, docs/STREET-PARTY.md).
   Kit tokens only: the board is grass with the street's road, its spaces the
   kit's feedback colours (Sunny is good green, Puddle the soft oops orange).
   ------------------------------------------------------------------------- */
.party-screen { display: flex; flex-direction: column; gap: 10px; height: 100dvh; padding: 10px clamp(10px, 2vw, 28px); box-sizing: border-box; }
.party-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-right: clamp(60px, 12vw, 240px); }
.party-top h1 { margin: 0; font-size: var(--w-text-l); }
.party-top .w-turn { flex: 0 1 auto; }

/* The board fills the screen below the top row and stretches to its shape;
   --sp is one space's size, and everything on the board is measured in it. */
.party-board { --sp: clamp(22px, min(3.4vw, 6.2vh), 64px); position: relative; flex: 1; min-height: 0; width: 100%;
  background: radial-gradient(circle at 50% 45%, var(--w-grass-light), var(--w-grass)); border-radius: calc(var(--w-radius) + 8px);
  box-shadow: 0 var(--w-lip) 0 var(--w-good-edge), var(--w-shadow); overflow: hidden; transition: filter 1.2s ease; }
.party-board.evening { filter: saturate(0.85) brightness(0.88); }
.party-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.party-road line { stroke: var(--w-road); stroke-width: calc(var(--sp) * 1.3); stroke-linecap: round; }
.party-space { --w-fill: var(--w-board); position: absolute; width: var(--sp); aspect-ratio: 1; translate: -50% -50%; display: grid; place-items: center;
  border-radius: 999px; background: var(--w-fill); color: var(--w-board); box-shadow: 0 calc(var(--sp) * 0.1) 0 color-mix(in srgb, var(--w-fill) 72%, #000); }
.party-space .w-icon { width: 62%; height: 62%; }
.party-space .w-obj { width: 78%; height: 78%; }
.party-space.pt-sunny { --w-fill: var(--w-good); }
.party-space.pt-puddle, .party-space.pt-oops { --w-fill: var(--w-oops); }
.party-space.pt-street { --w-fill: var(--w-district); }
.party-space.pt-lucky, .party-space.pt-bus, .party-space.pt-mixup { --w-fill: var(--w-sun); color: var(--w-ink); }
.party-space.pt-storm { --w-fill: var(--w-ink-soft); }
.party-space.pt-kiosk, .party-space.pt-house { --w-fill: var(--w-roof); }
.party-space[data-district] { --w-district: var(--w-guessing); }
.party-space[data-district="movement"] { --w-district: var(--w-movement); }
.party-space[data-district="learning"] { --w-district: var(--w-learning); }
.party-space[data-district="group"] { --w-district: var(--w-group); }
.party-space.choose { outline: 4px solid var(--w-sun); outline-offset: 2px; animation: party-glow 0.9s ease-in-out infinite alternate; }
@keyframes party-glow { to { outline-offset: 8px; } }
.party-gate { position: absolute; width: calc(var(--sp) * 3.4); translate: -50% -78%; pointer-events: none; filter: drop-shadow(0 6px 6px rgb(0 0 0 / 0.2)); }
.party-house { position: absolute; width: calc(var(--sp) * 3); translate: -50% -96%; pointer-events: none; }
.party-stand { position: absolute; width: calc(var(--sp) * 1.3); aspect-ratio: 1; translate: -50% -150%; display: grid; place-items: center; color: var(--w-ink); z-index: 1;
  background: var(--w-sun); border-radius: 999px; box-shadow: 0 4px 0 var(--w-sun-edge), var(--w-shadow); animation: w-bounce 1.6s ease-in-out infinite; }
.party-stand .w-icon { width: 70%; height: 70%; }
.party-stand .w-obj { width: 100%; height: 100%; }
/* Pawns sharing a space (--k: 0, 1, 2…) stand side by side. */
.party-pawn { position: absolute; width: calc(var(--sp) * 1.45); aspect-ratio: 1; z-index: 2;
  translate: calc(var(--k) * 45% - 50%) calc(-80% - var(--k) * 15%); transition: left 0.28s ease-out, top 0.28s ease-out; }
.party-pawn > * { width: 100% !important; height: 100% !important; border-radius: 999px; box-shadow: 0 0 0 4px var(--w-player), 0 6px 0 color-mix(in srgb, var(--w-player) 72%, #000); }
.party-pawn.now { z-index: 3; scale: 1.25; }

/* Floating on the map: the players along the top, inside the loop. */
.party-players { display: flex; flex-wrap: wrap; gap: clamp(6px, 1vw, 16px); list-style: none; margin: 0; padding: 0; }
.party-players li { display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--w-board);
  box-shadow: inset 0 0 0 var(--w-line) color-mix(in srgb, var(--w-player) 55%, var(--w-board)), 0 4px 0 var(--w-board-edge), var(--w-shadow); transition: scale 0.2s ease-out; }
.party-players li.now { scale: 1.12; box-shadow: inset 0 0 0 var(--w-line) var(--w-player), 0 4px 0 color-mix(in srgb, var(--w-player) 72%, #000), var(--w-shadow); }
.party-players .avatar { width: clamp(38px, 3.4vw, 64px) !important; height: clamp(38px, 3.4vw, 64px) !important; }
.party-counts { display: grid; font-size: var(--w-text-s); line-height: 1.15; }
.party-count { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--w-ink); }
.party-count .w-icon { width: 1.2em; height: 1.2em; }
.party-count .w-obj { width: 1.5em; height: 1.5em; }
/* A count that just changed bounces, tinted green for more, soft orange for less. */
.party-count.bump { animation: party-bump 900ms cubic-bezier(.34, 1.56, .64, 1) both; }
.party-count.bump.up b { animation: party-tint 900ms ease-in var(--bump-age, 0ms) both; --tint: var(--w-good-edge); }
.party-count.bump.down b { animation: party-tint 900ms ease-in var(--bump-age, 0ms) both; --tint: var(--w-oops-edge); }
@keyframes party-tint { 0%, 60% { color: var(--tint); } 100% { color: var(--w-ink); } }
@keyframes party-bump { 0% { scale: 1; } 25% { scale: 1.35; } 55% { scale: .95; } 100% { scale: 1; } }
@media (prefers-reduced-motion: reduce) { .party-count.bump, .party-count.bump b { animation: none; } }
/* The host's line pops up low on the left and fades away; the dice, low on the right. */
.party-say { position: absolute; z-index: 4; left: clamp(10px, 3%, 48px); bottom: clamp(10px, 5%, 48px); max-width: 46%;
  animation: party-bubble 3.2s ease-out both; pointer-events: none; }
@keyframes party-bubble { 0% { opacity: 0; translate: 0 12px; } 8%, 85% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 6px; } }
.party-say .w-host { align-items: center; }
.party-say .w-host-pic { width: calc(var(--sp) * 2.2); }
.party-say .w-bubble { margin-bottom: 0; font-size: var(--w-text-s); }
.party-dice { position: absolute; z-index: 4; right: clamp(10px, 3%, 48px); bottom: clamp(10px, 5%, 48px); display: flex; align-items: center; gap: 10px; }
/* The starting roll's result over the Roll button: who goes 1st, 2nd... each with their die. */
.party-order { position: absolute; right: 0; bottom: calc(100% + 12px); display: flex; width: max-content; max-width: calc(100vw - 32px); gap: 10px; margin: 0; padding: 10px 14px;
  list-style: none; border-radius: var(--w-radius); background: var(--w-board); box-shadow: inset 0 0 0 var(--w-line) var(--w-board-edge), 0 8px 0 var(--w-board-edge); }
.party-order li { position: relative; display: grid; justify-items: center; gap: 2px; font-size: var(--w-text-s);
  animation: party-order-in 420ms cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--k) * 260ms + 300ms); }
.party-order li .avatar { box-shadow: 0 0 0 3px var(--w-board), 0 0 0 calc(3px + var(--w-line)) var(--w-player); }
.party-order-place { position: absolute; top: -6px; left: -6px; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 999px; background: var(--w-sun); color: var(--w-ink); font-weight: 800; box-shadow: 0 3px 0 var(--w-sun-edge); }
@keyframes party-order-in { from { opacity: 0; transform: translateY(18px) scale(.7); } }
@media (max-height: 500px) { .party-order { gap: 6px; padding: 6px 10px; } .party-order .avatar { --size: 40px !important; } }
@media (prefers-reduced-motion: reduce) { .party-order li { animation: none; } }
.party-die { width: var(--w-tap-big); aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--w-radius); background: var(--w-board);
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), var(--w-shadow); font-size: var(--w-title); font-weight: 800; color: var(--w-ink); }
.party-die b { animation: w-bounce 0.32s ease-out infinite; }
/* Rolling: the die shakes and its numbers flick by, then it lands with a pop. */
.party-die { overflow: hidden; }
.party-die:not(.rolling) b { animation: party-die-land 0.36s ease-out, w-bounce 0.32s ease-out 0.36s infinite; }
.party-die.rolling { animation: party-die-shake 0.22s ease-in-out infinite; }
.party-die-tumble { display: grid; height: 1.2em; overflow: hidden; line-height: 1.2em; }
.party-die-tumble b { grid-area: 1 / 1; opacity: 0; animation: party-die-face 0.54s steps(1) infinite; }
.party-die-tumble b:nth-child(2) { animation-delay: 0.09s; }
.party-die-tumble b:nth-child(3) { animation-delay: 0.18s; }
.party-die-tumble b:nth-child(4) { animation-delay: 0.27s; }
.party-die-tumble b:nth-child(5) { animation-delay: 0.36s; }
.party-die-tumble b:nth-child(6) { animation-delay: 0.45s; }
@keyframes party-die-face { 0% { opacity: 1; } 16.6%, 100% { opacity: 0; } }
@keyframes party-die-shake { 0%, 100% { rotate: -9deg; translate: 0 0; } 50% { rotate: 9deg; translate: 0 -6px; } }
@keyframes party-die-land { 0% { scale: 0.4; } 60% { scale: 1.35; } 100% { scale: 1; } }
/* The player's short reaction to the number, before the pawn sets off. */
.party-players li.react, .party-pawn.react > * { animation: party-react 0.7s ease-out; }
@keyframes party-react { 0%, 100% { transform: none; } 25% { transform: translateY(-14px) rotate(-8deg); } 50% { transform: rotate(6deg); } 70% { transform: translateY(-6px) rotate(-3deg); } }
.party-items { display: grid; gap: 8px; }
.party-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.party-item { display: flex; align-items: center; gap: 10px; min-height: var(--w-tap); padding: 8px 14px; text-align: left; border-radius: var(--w-radius); }
.party-item-words { display: grid; line-height: 1.15; }
.party-item-words b { font-size: var(--w-text-s); }
.party-item-words small { font-size: clamp(18px, 1.4vw, 28px); color: var(--w-ink-soft); font-weight: 700; max-width: 22ch; }
.party-item-price { margin-left: auto; display: flex; align-items: center; gap: 4px; font-weight: 800; white-space: nowrap; }
.party-item-price .w-obj { width: 1.5em; height: 1.5em; flex: none; }
.party-intro .w-bubble { font-size: var(--w-text-s); text-align: left; }
.party-intro-pics { grid-column: 1; display: flex; gap: 12px; justify-content: center; }
.party-intro-pics span { width: var(--w-tap); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--w-sun); color: var(--w-ink); box-shadow: 0 var(--w-lip) 0 var(--w-board-edge); }
.party-intro-pics .w-icon { width: 55%; height: 55%; }
.party-intro-pics .w-obj { width: 72%; height: 72%; }
.party-fps { position: absolute; z-index: 6; left: 50%; bottom: 6px; translate: -50% 0; padding: 2px 10px; border-radius: 999px; background: var(--w-ink); color: var(--w-board); font-size: 18px; font-weight: 700; pointer-events: none; white-space: nowrap; }
.party-loading { display: grid; place-items: center; background: var(--w-sky); }
.party-wait { display: grid; justify-items: center; gap: 10px; padding: clamp(12px, 2vw, 28px); }
.party-dots { display: flex; gap: 8px; }
.party-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--w-sun); animation: w-bounce 0.9s ease-in-out infinite; }
.party-dots i:nth-child(2) { animation-delay: 0.15s; }
.party-dots i:nth-child(3) { animation-delay: 0.3s; }
.party-bag { font-size: 18px; font-weight: 800; color: var(--w-ink); background: var(--w-board); border-radius: 999px; padding: 2px 12px; justify-self: start; }
.party-pay small { white-space: nowrap; }
.party-pay li > svg, .party-pay li > .w-obj { width: 28px; height: 28px; flex: none; }
.party-question:has(.party-shelf) { top: 50%; gap: 6px; padding: 8px 12px; max-height: 100%; }
.party-held { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: var(--w-radius); background: var(--w-board); box-shadow: inset 0 0 0 var(--w-line) var(--w-board-edge); }
.party-item-title { font-size: var(--w-text); }
.party-held > svg, .party-held > .w-obj { flex: none; width: 32px; height: 32px; }
.party-item-pic svg, .party-item-pic .w-obj { width: 60%; height: 60%; }
.party-item-pic { width: clamp(40px, 9vh, 80px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--w-sun); }
.party-item-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(2px, 1vh, 10px); text-align: left; }
.party-item-facts li { display: flex; gap: 10px; align-items: center; }
.party-item-facts li > svg { flex: none; width: 28px; height: 28px; }
.party-item-facts li > span { display: grid; line-height: 1.2; font-size: clamp(18px, 1.5vw, 30px); font-weight: 700; }
.party-item-facts b { font-size: clamp(14px, 1.1vw, 20px); color: var(--w-ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.party-question:has(.party-item-facts) { top: 50%; gap: clamp(2px, 1vh, 10px); padding: 6px 14px; max-height: 100%; }
.party-question:has(.party-item-facts) .w-btn { min-height: 56px; }
.party-how { margin: 0; font-size: clamp(18px, 1.4vw, 28px); color: var(--w-ink-soft); }
.party-pay small { font-size: 18px; color: var(--w-ink-soft); font-weight: 700; }
.party-pay li.first { box-shadow: inset 0 0 0 var(--w-line) var(--w-sun); }
.party-corner { position: absolute; z-index: 4; left: clamp(10px, 2%, 32px); top: clamp(10px, 3%, 32px); display: flex; gap: 10px; align-items: center; }
/* The 3D board (src/ui/party3d/scene.js): the canvas is the whole board. */
.party-board.party-3d { background: var(--w-sky); }
.party-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* A card over the live street (the intro): along the bottom, the town above it. */
.party-over-board > .party-call { position: absolute; z-index: 5; left: 50%; bottom: clamp(10px, 3%, 32px); translate: -50% 0;
  width: min(1100px, 94%); box-sizing: border-box; box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), var(--w-shadow); }
/* Over the town the game's shop picture is smaller, so the card stays low and the town shows. */
.party-over-board .party-game img { width: clamp(80px, 17vh, 170px); }
/* A phone held sideways: a slimmer card, so the town still shows above it. */
@media (max-height: 500px) {
  .party-over-board > .party-call { padding-block: 8px; gap: 6px; }
  .party-over-board .party-intro-pics span { width: 44px; }
}
/* A question floats in the middle of the map. */
.party-question { position: absolute; z-index: 5; left: 50%; top: 52%; translate: -50% -50%; width: max-content; max-width: 90%; box-sizing: border-box;
  display: grid; gap: 10px; padding: clamp(10px, 1.6vw, 24px); text-align: center; }
.party-actions, .party-ask { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.party-question p { margin: 0; font-weight: 800; font-size: var(--w-text); display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.party-question .w-icon { width: 1.4em; height: 1.4em; }
.party-pay, .party-final { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
/* A Trip Pal: its face on its player's card with the turns left; waiting on the flat board. */
.party-pal { position: relative; display: inline-grid; margin-left: -10px; }
.party-pal img { width: clamp(30px, 2.6vw, 48px); aspect-ratio: 1; object-fit: contain; }
.party-pal b { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px;
  background: var(--w-sun); color: var(--w-ink); font-size: 14px; line-height: 1; }
.party-pal-here { position: absolute; z-index: 2; width: calc(var(--sp) * 2); translate: -50% -95%; pointer-events: none; animation: w-bounce 1.4s ease-in-out infinite; }
.party-ahead .avatar { box-shadow: 0 0 0 5px var(--w-sun); border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .party-pal-here { animation: none; } }
/* Family Trip's rewards: the Trip tab of the Trophy Hall (screens/trip.js),
   what a trip paid on its results, and the Cheers on the board. */
.trip-tab { display: grid; gap: 22px; }
.trip-tab h2 { margin: 0 0 10px; font-size: var(--w-text); }
.trip-rank { display: flex; align-items: center; gap: 16px; }
.trip-rank-text { flex: 1; min-width: 0; }
.trip-rank-text p { margin: 6px 0 0; font-size: var(--w-text-s); }
.trip-badge { --w-fill: var(--w-board); position: relative; flex: none; display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--w-fill); color: var(--w-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--w-fill) 72%, #000), inset 0 0 0 3px var(--w-ink); }
.trip-badge .w-icon { width: 60%; height: 60%; }
.trip-badge b { position: absolute; right: -6px; bottom: -6px; min-width: 26px; height: 26px; padding: 0 4px; box-sizing: border-box; display: grid; place-items: center;
  border-radius: 999px; background: var(--w-ink); color: var(--w-board); font-size: 16px; line-height: 1; }
.trip-badge.badge-bronze { --w-fill: var(--w-oops); }
.trip-badge.badge-silver { --w-fill: var(--w-sky-low); }
.trip-badge.badge-gold { --w-fill: var(--w-sun); }
.trip-badge.badge-diamond { --w-fill: var(--w-sky); }
.trip-badge.badge-rainbow { background: conic-gradient(var(--w-movement), var(--w-sun), var(--w-good), var(--w-guessing), var(--w-movement)); }
.trip-bar { height: 16px; border-radius: 999px; background: var(--w-board-edge); overflow: hidden; }
.trip-bar i { display: block; height: 100%; border-radius: 999px; background: var(--w-sun); }
.trip-achievements { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.trip-achievements li { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: var(--w-radius-s); background: var(--w-board); opacity: 0.6;
  box-shadow: inset 0 0 0 3px var(--w-board-edge); }
.trip-achievements li.earned { opacity: 1; box-shadow: inset 0 0 0 3px var(--w-sun); }
.trip-achievements li > span:last-child { display: grid; font-size: var(--w-text-s); line-height: 1.2; }
.trip-achievements small { font-size: 18px; color: var(--w-ink-soft); }
.trip-achievement-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--w-board-edge); color: var(--w-ink); }
.trip-achievements li.earned .trip-achievement-icon { background: var(--w-sun); }
.trip-achievement-icon .w-icon { width: 62%; height: 62%; }
.trip-cards { margin-bottom: 14px; padding: 10px; border-radius: var(--w-radius); grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.trip-cards .hall-good { padding: 12px 6px 10px; }
@media (max-width: 900px) { .trip-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trip-cards.full { box-shadow: inset 0 0 0 4px var(--w-sun); }
.trip-card-pic { width: 84px; height: 84px; object-fit: contain; }
.trip-good:not(.owned) .trip-card-pic { filter: grayscale(1) opacity(0.55); }
.trip-good[disabled] { cursor: default; }
.trip-owned .w-icon { width: 24px; height: 24px; color: var(--w-good-edge); }
.trip-stand { width: 84px; height: 44px; margin: 20px 0; border-radius: 50%; background: var(--w-guessing); box-shadow: 0 8px 0 color-mix(in srgb, var(--w-guessing) 72%, #000); }
.trip-stand.stand-gold { background: var(--w-sun); box-shadow: 0 8px 0 var(--w-sun-edge); }
.trip-stand.stand-cloud { background: #FFFFFF; box-shadow: 0 8px 0 var(--w-board-edge), 22px -8px 0 -6px #FFFFFF, -22px -6px 0 -8px #FFFFFF; }
.trip-stand.stand-flower { background: var(--w-sun); box-shadow: 0 0 0 10px var(--w-movement); }
.party-got { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; font-size: var(--w-text-s); }
.party-got .trip-badge { width: 40px; height: 40px; }
.party-got .trip-badge b { min-width: 20px; height: 20px; font-size: 13px; right: -6px; bottom: -6px; }
.party-got small { font-size: 18px; color: var(--w-ink-soft); }
.party-call:has(.party-got) .party-final { grid-template-columns: 1fr; width: 100%; }
.party-cheers { position: absolute; z-index: 4; right: clamp(10px, 2%, 32px); top: clamp(10px, 3%, 32px); display: flex; gap: 8px; }
.party-cheer { width: var(--w-tap); height: var(--w-tap); padding: 4px; border: 0; border-radius: 50%; background: var(--w-board);
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), var(--w-shadow); }
.party-cheer:active { translate: 0 var(--w-lip); box-shadow: var(--w-shadow); }
.party-cheer img { width: 100%; height: 100%; object-fit: contain; }

/* A wheel being spun, in the middle of the map; Bev's question; the Bonus Lanterns. */
.party-wheel { position: absolute; z-index: 5; left: 50%; top: 52%; translate: -50% -50%; }
/* The 3D wheel turns on the board; this only tells a screen reader what it is. */
.party-wheel-3d { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* What the wheel did, once it has stopped: each face with "−10" and a Ticket. */
.party-result { position: absolute; z-index: 5; right: clamp(10px, 3%, 40px); bottom: clamp(10px, 4%, 40px); list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.party-result li { display: flex; align-items: center; gap: 12px; padding: 8px 22px 8px 8px; border-radius: 999px; background: var(--w-board);
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), var(--w-shadow); animation: sp-pop 0.5s ease-out both; }
.party-result li b { font-size: var(--w-title); line-height: 1; }
.party-result li.gain b { color: var(--w-good-edge); }
.party-result li.loss b { color: var(--w-oops-edge); }
.party-result li.loss { animation: sp-pop 0.5s ease-out both, result-droop 1.4s 0.5s ease-in-out both; }
.party-result .w-obj { width: 52px; height: 52px; }
@media (prefers-reduced-motion: reduce) { .party-result li { animation: none; } }
@keyframes result-droop { 40% { translate: 0 6px; rotate: -2deg; } 100% { translate: 0 2px; rotate: 0deg; } }
.party-apples { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.party-apples img { width: clamp(40px, 9vh, 84px); }
.party-question .party-sum { font-size: var(--w-title); }
.party-question .w-host { justify-content: center; align-items: center; }
.party-question .w-host-pic { width: clamp(52px, 12vh, 110px); }
.party-question .w-bubble { margin-bottom: 0; font-size: var(--w-text-s); }
.party-answer { min-width: var(--w-tap-big); min-height: var(--w-tap); font-size: var(--w-text-l); }
.party-bonus { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-column: 1; width: 100%; }
.party-bonus li { display: flex; align-items: center; gap: 12px; padding: 6px 14px; border-radius: 999px; background: var(--w-board);
  box-shadow: inset 0 0 0 var(--w-line) var(--w-board-edge); min-height: 56px; opacity: 0.55; }
.party-bonus li.shown { opacity: 1; box-shadow: inset 0 0 0 var(--w-line) var(--w-sun); }
.party-bonus-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--w-sun); color: var(--w-ink); }
.party-bonus-icon .w-icon { width: 62%; height: 62%; }
.party-bonus-icon .w-obj { width: 80%; height: 80%; }
.party-bonus-name { display: grid; text-align: left; font-size: var(--w-text-s); line-height: 1.15; }
.party-bonus-name small { font-size: 18px; color: var(--w-ink-soft); }
.party-bonus .party-faces { margin-left: auto; gap: 6px; font-weight: 800; }
/* The last show (party.js stage): the family stands in a row on a cream stage,
   bouncing; a sun light runs along them to the drum roll and stops on whoever
   wins, who jumps forward (and, for the Star, steps up with the trophy). */
.party-show > .party-stage, .party-show > .party-bonus { grid-column: 1; }
.party-show > .w-host .w-host-pic { width: clamp(84px, 22vh, 200px); }
.party-show > .w-host .w-bubble { font-size: var(--w-text); font-weight: 800; }
.party-stage { position: relative; width: 100%; padding: 18px 12px 12px; box-sizing: border-box; border-radius: 28px; overflow: hidden;
  background: var(--w-board); box-shadow: inset 0 0 0 var(--w-line) var(--w-board-edge), inset 0 -14px 0 color-mix(in srgb, var(--w-board-edge) 45%, var(--w-board)); }
.party-stage ol { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-around; align-items: flex-end; gap: 10px; }
.party-stage li { --lift: 0px; display: grid; justify-items: center; gap: 2px; min-width: 0; transform-origin: 50% 100%;
  animation: party-excited 0.9s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -0.23s); }
.party-stage li .avatar { box-shadow: 0 0 0 4px var(--w-board), 0 0 0 calc(4px + var(--w-line)) var(--w-player); }
.party-stage-name { font-size: var(--w-text-s); line-height: 1.1; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes party-excited { 0% { translate: 0 0; rotate: -3deg; } 100% { translate: 0 -10px; rotate: 3deg; } }
/* The drum roll: everyone holds still and the light runs to and fro. */
/* The lights go down for the drum roll, so the running light shows. */
.party-stage.spot { background: color-mix(in srgb, var(--w-ink) 14%, var(--w-board)); transition: background 0.3s; }
.party-show .party-stage { padding-top: 40px; }
.party-reveal .party-stage { padding-top: 70px; }
.party-stage.spot li { animation: party-shiver 0.12s linear infinite alternate; animation-delay: calc(var(--k) * -0.05s); }
@keyframes party-shiver { from { translate: -1px 0; } to { translate: 1px 0; } }
.party-stage-light { position: absolute; z-index: 0; top: 0; bottom: 0; width: calc(100% / var(--n)); left: 0;
  background: radial-gradient(ellipse 55% 85% at 50% 62%, var(--w-sun), color-mix(in srgb, var(--w-sun) 40%, transparent) 55%, transparent 75%);
  animation: party-spot 0.95s ease-in-out infinite alternate; }
@keyframes party-spot { from { left: 0; } to { left: calc(100% - 100% / var(--n)); } }
/* Whoever it stopped on jumps forward; the others cheer them on. */
.party-stage.done li { animation: party-hop 0.6s ease-out 2 both; animation-delay: calc(var(--k) * 0.08s); opacity: 0.8; }
.party-stage.done li.won { opacity: 1; z-index: 2; animation: party-jump 0.7s cubic-bezier(.2, 1.4, .4, 1) both, party-proud 1.1s 0.7s ease-in-out infinite alternate; }
.party-stage li.won .avatar { box-shadow: 0 0 0 4px var(--w-board), 0 0 0 calc(4px + var(--w-line)) var(--w-sun), 0 0 26px 8px color-mix(in srgb, var(--w-sun) 70%, transparent); }
.party-stage li.won .party-stage-name { font-size: var(--w-text); }
.party-stage li.up { padding: 8px 14px 6px; border-radius: 22px 22px 8px 8px; background: color-mix(in srgb, var(--w-sun) 45%, var(--w-board)); box-shadow: inset 0 0 0 var(--w-line) var(--w-sun); }
.party-stage-cup { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--w-sun); color: var(--w-ink); animation: party-jump 0.7s 0.3s cubic-bezier(.2, 1.4, .4, 1) both; }
.party-stage-cup .w-icon { width: 64%; height: 64%; }
@keyframes party-hop { 0%, 100% { translate: 0 0; } 40% { translate: 0 -14px; } }
@keyframes party-jump { 0% { scale: 1; translate: 0 0; } 45% { scale: 1.3; translate: 0 -34px; } 100% { scale: 1.18; translate: 0 -10px; } }
@keyframes party-proud { from { rotate: -4deg; } to { rotate: 4deg; } }
.party-bonus li.next { opacity: 1; box-shadow: inset 0 0 0 var(--w-line) var(--w-sun); animation: party-glow 0.5s ease-in-out infinite alternate; outline: var(--w-line) solid color-mix(in srgb, var(--w-sun) 50%, transparent); }
.party-show .w-btn.go[aria-disabled="true"] { opacity: 0.55; }
.party-reveal .confetti { z-index: 3; }
/* The show on its 3D stage (party3d/ceremony.js): the Pal's words high in
   the middle, the Lanterns so far in the top corner, the action low right. */
.party-ceremony { background: linear-gradient(to bottom, color-mix(in srgb, var(--w-guessing) 55%, var(--w-sky)) 0%, var(--w-sky) 38%,
  color-mix(in srgb, var(--w-sun) 35%, var(--w-board)) 62%, color-mix(in srgb, var(--w-sun) 45%, var(--w-board)) 100%); }
/* The Pal's words as a TV caption low on the stage: a name tab, then the
   line coming in word by word. */
.party-caption { position: absolute; z-index: 3; left: clamp(10px, 2.5%, 32px); bottom: clamp(10px, 4%, 36px); max-width: min(62%, 900px);
  padding: 14px 22px 14px 18px; border-radius: var(--w-radius); background: var(--w-board); color: var(--w-ink);
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), var(--w-shadow); }
.party-caption-who { position: absolute; left: 14px; top: 0; translate: 0 -60%; display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 14px 2px 4px; border-radius: 999px; background: var(--w-sun); color: var(--w-ink); font-weight: 800; font-size: var(--w-text-s); }
.party-caption-who img { width: 36px; height: 36px; object-fit: contain; }
.party-caption p { margin: 6px 0 0; font-size: var(--w-text); font-weight: 800; line-height: 1.25; }
.party-word { display: inline-block; white-space: pre; animation: party-word 0.32s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes party-word { from { opacity: 0; translate: 0 0.4em; } }
.party-caption .party-dots { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.party-caption .party-dots i { width: 10px; height: 10px; }
/* The reveal: a white flash, then the title card drops in with a shine. */
.party-flash { position: absolute; inset: 0; z-index: 4; background: var(--w-board); pointer-events: none; animation: party-flash 0.7s ease-out both; }
@keyframes party-flash { 0% { opacity: 0.9; } 100% { opacity: 0; visibility: hidden; } }
.party-reveal-card { position: absolute; z-index: 3; top: clamp(10px, 4%, 36px); left: 50%; translate: -50% 0; display: grid; justify-items: center; gap: 4px;
  padding: 26px 30px 16px; border-radius: var(--w-radius); background: var(--w-board); overflow: hidden;
  box-shadow: 0 var(--w-lip) 0 var(--w-board-edge), var(--w-shadow), 0 0 0 var(--w-line) var(--w-sun) inset;
  animation: party-card-in 0.6s cubic-bezier(.2, 1.35, .4, 1) both; }
.party-reveal-card::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--w-board) 85%, transparent) 50%, transparent 65%);
  translate: -120% 0; animation: party-shine 1.2s 0.5s ease-in-out both; }
@keyframes party-card-in { from { opacity: 0; translate: -50% -60%; scale: 0.6; } }
@keyframes party-shine { to { translate: 120% 0; } }
.party-reveal-ribbon { position: absolute; top: 0; left: 50%; translate: -50% 0; padding: 4px 22px 6px; border-radius: 0 0 14px 14px; background: var(--w-sun);
  color: var(--w-ink); font-weight: 800; font-size: var(--w-text-s); white-space: nowrap; }
.party-reveal-who { display: flex; align-items: center; gap: 16px; }
.party-reveal-icon { width: 64px; height: 64px; display: grid; place-items: center; }
.party-reveal-icon .w-icon { width: 100%; height: 100%; color: var(--w-sun); }
.party-reveal-face { display: grid; justify-items: center; gap: 2px; animation: party-face-in 0.5s 0.25s cubic-bezier(.2, 1.5, .4, 1) both; }
.party-reveal-face b { font-size: var(--w-text-l); line-height: 1; }
@keyframes party-face-in { from { opacity: 0; scale: 0.4; } }
.party-ceremony-list { position: absolute; z-index: 2; left: clamp(8px, 2%, 24px); top: clamp(8px, 3%, 28px); list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 26%; }
.party-ceremony-list li { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--w-board);
  box-shadow: inset 0 0 0 var(--w-line) var(--w-board-edge); opacity: 0.7; }
.party-ceremony-list li.shown { opacity: 1; box-shadow: inset 0 0 0 var(--w-line) var(--w-sun); }
.party-ceremony-list li.next { opacity: 1; box-shadow: inset 0 0 0 var(--w-line) var(--w-sun); animation: party-glow 0.5s ease-in-out infinite alternate; outline: var(--w-line) solid color-mix(in srgb, var(--w-sun) 50%, transparent); }
.party-ceremony-list .party-bonus-name { font-size: 18px; }
.party-ceremony-list .party-faces { display: flex; gap: 2px; }
.party-ceremony-go { position: absolute; z-index: 2; right: clamp(10px, 2.5%, 32px); bottom: clamp(10px, 4%, 36px); display: flex; gap: 12px; align-items: center; }
/* The family photo: the 3-2-1, the camera's flash, then the picture to keep. */
.party-photo-count { position: absolute; z-index: 4; left: 50%; top: 42%; translate: -50% -50%; font-size: clamp(96px, 18vh, 180px);
  font-weight: 800; color: var(--w-board); -webkit-text-stroke: var(--w-line) var(--w-ink); animation: party-photo-count 0.9s ease-out both; pointer-events: none; }
@keyframes party-photo-count { from { scale: 1.6; opacity: 0; } 25% { scale: 1; opacity: 1; } to { scale: 0.9; opacity: 0.85; } }
.party-photo-flash { position: absolute; inset: 0; z-index: 5; background: var(--w-board); animation: party-photo-flash 0.6s ease-out both; pointer-events: none; }
@keyframes party-photo-flash { from { opacity: 1; } to { opacity: 0; } }
.party-photo-card { position: absolute; z-index: 4; left: 50%; top: 50%; translate: -50% -50%; width: min(70%, 860px); padding: 14px; display: grid; gap: 12px;
  rotate: -1.5deg; animation: party-photo-card 0.45s ease-out both; }
.party-photo-card img { width: 100%; border-radius: var(--w-radius-s); box-shadow: var(--w-shadow); }
.party-photo-actions { display: flex; gap: 12px; justify-content: center; }
@keyframes party-photo-card { from { scale: 0.6; rotate: -8deg; opacity: 0; } to { scale: 1; rotate: -1.5deg; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .party-photo-count, .party-photo-flash, .party-photo-card { animation: none; } }
.party-pay li, .party-final li { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 999px;
  background: var(--w-board); box-shadow: inset 0 0 0 var(--w-line) color-mix(in srgb, var(--w-player) 55%, var(--w-board)); font-size: var(--w-text-s); }

.party-setup, .party-call { align-self: center; width: min(100%, 1100px); display: grid; gap: clamp(8px, 2vh, 18px); justify-items: center; align-items: center; padding: clamp(10px, 2vw, 32px); box-sizing: border-box; text-align: center; }
.party-setup .w-bubble, .party-call .w-bubble { margin-bottom: 0; font-size: var(--w-text-s); }
.party-setup .w-host, .party-call .w-host { align-items: center; }
.party-setup .w-host-pic, .party-call .w-host-pic { width: clamp(64px, 16vh, 150px); }
/* Wide enough: the people on the left, the game and the go button on the right. */
.party-call { grid-template-columns: minmax(0, 1fr) auto; }
.party-call > .w-host, .party-call > .party-groups, .party-call > .party-pay, .party-call > .party-final { grid-column: 1; }
.party-call > .party-game { grid-column: 2; grid-row: 1; }
.party-call > .party-actions { grid-column: 2; grid-row: 2; }
.party-call > .w-btn.go { grid-column: 2; grid-row: 1 / span 2; }
/* The how-to-play card: Next on top, the card count and Skip under it, never over each other. */
.party-intro > .w-btn.go { grid-row: 1; align-self: end; }
.party-intro > .party-actions { align-self: start; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.party-faces { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.party-lengths { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.party-note { font-size: var(--w-text); margin: 0; }
.party-groups { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.party-team { padding: 12px 18px; border-radius: var(--w-radius); background: var(--w-board); box-shadow: inset 0 0 0 var(--w-line) var(--w-board-edge); }
.party-team.green { box-shadow: inset 0 0 0 var(--w-line) var(--w-good); }
.party-team.orange { box-shadow: inset 0 0 0 var(--w-line) var(--w-oops); }
.party-team h2 { margin: 0 0 8px; font-size: var(--w-text); }
.party-game { margin: 0; display: grid; justify-items: center; gap: 6px; font-weight: 800; font-size: var(--w-text); }
.party-game img { width: clamp(90px, 26vh, 240px); }
.party-pay, .party-final { grid-template-columns: repeat(2, minmax(0, auto)); gap: 8px 14px; }
.party-pay b { font-size: var(--w-text); }
.party-final li.first { box-shadow: inset 0 0 0 var(--w-line) var(--w-sun); }
.party-place { font-weight: 800; min-width: 1.6em; }

/* A phone held sideways: the side panel narrows, the board keeps its shape. */
@media (max-height: 500px) {
  .party-screen { padding: 6px 10px; gap: 6px; }
  .party-top { gap: 8px; }
  .party-dice .w-btn.go { min-height: 80px; min-width: 80px; }
  .party-die { width: 80px; }
  .party-say .w-bubble { padding: 6px 10px; }
  .party-players li { padding-right: 10px; gap: 4px; }
  .party-counts { font-size: 16px; }
  .party-setup, .party-call { gap: 6px; padding: 8px 12px; }
  .party-call .avatar, .party-setup .party-faces .avatar { width: 48px !important; height: 48px !important; }
  .party-team { padding: 6px 12px; }
  .party-team h2 { margin-bottom: 4px; font-size: var(--w-text-s); }
  .party-game img { width: 84px; }
  .party-game { font-size: var(--w-text-s); }
  .party-call .w-host-pic, .party-setup .w-host-pic { width: 52px; }
  .party-setup { grid-template-columns: minmax(0, 1fr) auto; }
  .party-setup > .w-host { grid-column: 1 / -1; }
  .party-setup > .party-faces, .party-setup > .party-lengths { grid-column: 1; }
  /* Six trip lengths in three columns of slim buttons, so all fit a phone held sideways. */
  .party-setup .party-lengths { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; }
  .party-setup .party-lengths .w-btn { min-height: var(--w-tap); padding-block: 4px; padding-inline: 12px; }
  .party-setup > .w-btn.go { grid-column: 2; grid-row: 2 / span 2; }
  .party-show > .w-host .w-host-pic { width: 64px; }
  .party-stage, .party-show .party-stage { padding: 26px 8px 6px; border-radius: 20px; }
  .party-stage .avatar { width: 56px !important; height: 56px !important; }
  .party-stage-name { font-size: 16px; }
  .party-stage-cup { width: 36px; height: 36px; }
  .party-show .party-bonus li { min-height: 40px; padding: 2px 10px; }
  .party-show .party-bonus { display: none; }
  .party-ceremony-list .party-bonus-name { display: none; }
  .party-caption { max-width: 58%; padding: 10px 14px 8px; }
  .party-caption p { font-size: var(--w-text-s); margin-top: 4px; }
  .party-caption-who { font-size: 15px; }
  .party-caption-who img { width: 26px; height: 26px; }
  .party-reveal-card { padding: 20px 18px 8px; }
  .party-reveal-icon { width: 40px; height: 40px; }
  .party-reveal-face .avatar { width: 44px !important; height: 44px !important; }
  .party-reveal-face b { font-size: var(--w-text); }
  .party-ceremony-list .party-bonus-icon { width: 34px; height: 34px; }
  .party-ceremony-go .w-btn.go { min-height: 72px; min-width: 72px; }
  .party-call.party-show > .w-host .w-host-pic { width: 76px; }
  .party-reveal .party-stage { padding-top: 46px; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .party-call { grid-template-columns: 1fr; }
  .party-call > * { grid-column: 1 !important; grid-row: auto !important; }
  /* One player a row, so each pill keeps its score and Tickets on a narrow phone. */
  .party-pay, .party-final { grid-template-columns: 1fr; width: 100%; }
}
@keyframes party-bubble-still { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .party-stand, .party-space.choose, .party-die b, .party-die.rolling, .party-die:not(.rolling) b, .party-players li.react, .party-pawn.react > * { animation: none; }
  .party-die-tumble b { animation: none; }
  .party-die-tumble b:first-child { opacity: 1; }
  .party-say { animation-name: party-bubble-still; }
  .party-stage li, .party-stage.spot li, .party-stage.done li, .party-stage.done li.won, .party-stage-cup, .party-bonus li.next { animation: none; }
  .party-stage li.won { scale: 1.15; }
  .party-stage-light { display: none; }
  .party-pawn, .party-board, .party-players li { transition: none; }
}

/* ===== Animal Kingdom (src/ui/animalKingdom.js, docs/design/AnimalKingdom-mock.html) =====
   The board fills the play area: a ring of 22 squares with the action in its
   middle, every player's open hand under it. The herd draft, the power card
   sheets and the reward chest use the same pieces. */
.ak-table { flex: 1 1 0; min-height: 0; position: relative; display: grid; grid-template: 'field' minmax(0, 1fr) 'hands' auto / minmax(0, 1fr); gap: clamp(6px, 1.4vh, 16px); }
.ak-ring, .ak-stage { grid-area: field; min-width: 0; min-height: 0; }
.ak-hands { grid-area: hands; }
.ak-ring { container-type: size; display: grid; grid-template: repeat(5, minmax(0, 1fr)) / repeat(8, minmax(0, 1fr)); gap: 1.4cqh; }
.ak-sq { position: relative; display: grid; grid-template-rows: auto 1fr; justify-items: center; align-items: center; padding: 1cqh 0.4cqw;
  border-radius: var(--w-radius-s); background: var(--sq); box-shadow: 0 1cqh 0 color-mix(in srgb, var(--sq) 72%, #000); }
.ak-lab { max-width: 94%; padding: 0 1.4cqh; border-radius: 99px; background: var(--w-board); color: var(--w-ink); font-size: clamp(10px, 3.3cqh, 24px);
  font-weight: 800; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-ico { font-size: 9cqh; line-height: 1; }
.ak-sq.corner { outline: 0.8cqh dashed var(--w-ink); outline-offset: -1.6cqh; }
.ak-sq.here { box-shadow: 0 1cqh 0 var(--w-ink), 0 0 0 1cqh var(--w-ink); }
.ak-way { position: absolute; font-size: 4cqh; font-weight: 800; line-height: 1; opacity: 0.75; color: var(--w-ink); }
.ak-way.r, .ak-way.d { right: 2cqh; bottom: 1cqh; }
.ak-way.l { left: 2cqh; bottom: 1cqh; }
.ak-way.u { left: 2cqh; top: 1cqh; }
.ak-toks { position: absolute; inset: auto 0 -1.6cqh 0; display: flex; justify-content: center; }
.ak-face { display: inline-grid; place-items: center; flex: none; border-radius: 50%; }
.ak-tok { margin: 0 -1.8cqh; border: 0.6cqh solid var(--c); border-radius: 50%; background: var(--w-board); box-shadow: 0 0.7cqh 0 rgb(0 0 0 / 0.3); }
.ak-tok .avatar { --size: 7cqh !important; width: 7cqh; height: 7cqh; }
.ak-tok.me { z-index: 1; animation: w-bounce 0.35s ease-out; }
.ak-tok.me .avatar { --size: 9.5cqh !important; width: 9.5cqh; height: 9.5cqh; }

.ak-stage { place-self: center; width: calc(75% - 12px); height: calc(60% - 8px); padding: clamp(6px, 1.4vh, 16px) clamp(8px, 1.2vw, 18px);
  border-radius: var(--w-radius); background: color-mix(in srgb, var(--w-grass-light) 30%, var(--w-board)); box-shadow: inset 0 4px 0 rgb(0 0 0 / 0.06);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(8px, 1.2vw, 18px); align-items: center; color: var(--w-ink); }
.ak-bev { display: grid; justify-items: center; gap: 0.6vh; }
.ak-bev-pic { height: clamp(60px, 15vh, 180px); filter: drop-shadow(0 8px 10px rgb(0 0 0 / 0.2)); }
.ak-num { display: grid; place-items: center; width: clamp(34px, 7vh, 80px); height: clamp(34px, 7vh, 80px); border-radius: 50%; background: var(--w-sun);
  font-size: clamp(20px, 4.6vh, 52px); font-weight: 800; line-height: 1; box-shadow: 0 var(--w-lip) 0 var(--w-sun-edge); }
.ak-num.empty { opacity: 0.35; }
.ak-play { min-width: 0; min-height: 0; height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 0.8vh; }
.ak-steps { display: flex; flex-wrap: nowrap; overflow: hidden; gap: 0.6vw; margin: 0; padding: 0; list-style: none; }
.ak-steps li { padding: 0.2vh 1.2vh; border-radius: 99px; background: var(--w-board); box-shadow: inset 0 0 0 0.3vh var(--w-board-edge);
  white-space: nowrap; font-size: clamp(10px, 1.8vh, 20px); font-weight: 800; color: var(--w-ink-soft); opacity: 0.7; }
.ak-steps li.done { opacity: 0.45; }
.ak-steps li.on { background: var(--w-sun); box-shadow: 0 0.4vh 0 var(--w-sun-edge); color: var(--w-ink); opacity: 1; }
.ak-say { margin: 0; font-size: clamp(15px, 3vh, 36px); font-weight: 800; line-height: 1.1; color: var(--w-ink); }
.ak-say small { display: block; font-size: clamp(12px, 2.1vh, 24px); font-weight: 700; color: var(--w-ink-soft); }
.ak-note { display: inline-block; margin-top: 0.4vh; padding: 0 1.2vh; border-radius: 99px; background: var(--w-sun); color: var(--w-ink); }
.ak-cards { min-width: 0; min-height: 0; container-type: size; display: flex; align-items: center; justify-content: center; gap: 1.4cqw; }
.ak-vs { font-size: clamp(14px, 3.6vh, 40px); font-weight: 800; color: var(--w-ink-soft); }
.ak-acts { display: grid; gap: 1vh; justify-items: stretch; width: clamp(130px, 13vw, 250px); }
.ak-acts .w-btn { font-size: clamp(14px, 2.3vh, 26px); min-height: clamp(44px, 7vh, 90px); }
.ak-go { width: 100%; }

.ak-card { --w-district: var(--w-learning); position: relative; flex: none; width: min(calc(94cqw / var(--n, 4) - 1.6cqw), 70cqh); aspect-ratio: 5 / 7;
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 0.3vh; padding: 0.7vh; border: var(--w-line) solid var(--w-district);
  border-radius: var(--w-radius-s); background: var(--w-board); font: inherit; color: var(--w-ink); text-align: center;
  box-shadow: 0 var(--w-lip) 0 color-mix(in srgb, var(--w-district) 70%, #000), var(--w-shadow); }
button.ak-card { cursor: pointer; touch-action: manipulation; }
button.ak-card:active { transform: translateY(var(--w-lip)); }
.ak-pic { position: relative; min-height: 0; display: grid; place-items: center; border-radius: 12px; background: #FFFFFF; font-size: min(24cqh, 9cqw); line-height: 1; overflow: hidden; }
.ak-pic img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; }
.ak-card b, .ak-val { font-size: clamp(11px, 2vh, 22px); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-val { font-weight: 800; }
.ak-bar { height: 1vh; border-radius: 99px; background: var(--w-board-edge); overflow: hidden; }
.ak-bar i { display: block; height: 100%; border-radius: 99px; background: var(--w-learning); }
.ak-home { position: absolute; top: -1vh; left: -1vh; display: grid; place-items: center; width: clamp(22px, 4.2vh, 44px); height: clamp(22px, 4.2vh, 44px);
  border-radius: 50%; font-size: clamp(12px, 2.4vh, 26px); box-shadow: 0 0.4vh 0 rgb(0 0 0 / 0.2); }
.ak-zz { position: absolute; top: -1.2vh; right: -1vh; font-size: clamp(18px, 4vh, 44px); line-height: 1; }
.ak-card.won { --w-district: var(--w-good); outline: 0.7vh solid var(--w-good); }
.ak-card.lost { --w-district: var(--w-oops); opacity: 0.7; }
.ak-card.tired, .ak-card.dim { opacity: 0.45; }
.ak-card.wild { --w-district: var(--w-roof); }
.ak-card.golden { --w-district: var(--w-sun); }
.ak-card.legend { --w-district: var(--w-group); }
.ak-card.fresh, .ak-dt.fresh { animation: w-bounce 0.6s ease-out; }
.ak-tag { display: block; font-style: normal; font-size: 0.8em; font-weight: 700; color: var(--w-ink-soft); }
.ak-choices { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.2vw; }
.ak-choices .w-btn { font-size: clamp(15px, 2.8vh, 34px); min-height: clamp(46px, 8vh, 100px); }
.ak-choices .w-btn:disabled { opacity: 1; cursor: default; }
.ak-choices .w-btn.soft:disabled { opacity: 0.5; }

.ak-pc { display: grid; grid-template-columns: auto 1fr; gap: 0 1vh; align-items: center; padding: 0.7vh 1.1vh; border: var(--w-line) solid var(--w-ink);
  border-radius: var(--w-radius-s); background: var(--w-sun); color: var(--w-ink); font: inherit; text-align: left; cursor: pointer;
  touch-action: manipulation; box-shadow: 0 var(--w-lip) 0 var(--w-ink); }
.ak-pc:active { transform: translateY(var(--w-lip)); box-shadow: none; }
.ak-pi { grid-row: 1 / 3; display: grid; place-items: center; width: clamp(26px, 5vh, 56px); height: clamp(26px, 5vh, 56px); border-radius: 50%;
  background: var(--w-board); font-size: clamp(14px, 3vh, 32px); font-style: normal; line-height: 1; }
.ak-pc b { font-size: clamp(13px, 2.2vh, 24px); line-height: 1.05; }
.ak-pc span { font-size: clamp(10px, 1.7vh, 18px); font-weight: 700; line-height: 1.05; }
.ak-pc.auto { background: var(--w-board); }
.ak-pc.spent { opacity: 0.6; }

.ak-hands { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1vh 1vw; }
.ak-hand { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.4vh 0.8vw; align-items: center; padding: 0.7vh 1vh;
  border-radius: var(--w-radius-s); background: #FFFFFF; border: 0.5vh solid var(--c); box-shadow: 0 0.6vh 0 rgb(0 0 0 / 0.12); color: var(--w-ink); }
.ak-hand.turn { background: color-mix(in srgb, var(--c) 22%, #FFFFFF); }
.ak-who { grid-row: 1 / 3; display: grid; justify-items: center; gap: 2px; font-size: clamp(11px, 2vh, 22px); font-weight: 800; line-height: 1.05; text-align: center; }
button.ak-who { border: 0; padding: 0.4vh; border-radius: var(--w-radius-s); background: var(--w-sun); font: inherit; font-weight: 800; color: var(--w-ink); cursor: pointer; animation: w-bounce 0.6s ease-out; }
.ak-row { display: flex; gap: 0.5vh; min-width: 0; }
.ak-slot, .ak-mini { flex: 1 1 0; min-width: 0; aspect-ratio: 1; max-width: 5.4vh; display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 22%; font: inherit; font-size: 2.8vh; line-height: 1; overflow: hidden; }
.ak-slot { opacity: 0.35; }
.ak-slot.full { opacity: 1; box-shadow: inset 0 0 0 0.5vh var(--w-ink); }
.ak-mini { background: var(--w-board); box-shadow: inset 0 0 0 0.35vh var(--w-board-edge); }
.ak-mini.pow { background: var(--w-sun); border-radius: 50%; box-shadow: none; }
.ak-mini.tired { opacity: 0.35; }
.ak-mini.golden { box-shadow: inset 0 0 0 0.45vh var(--w-sun); }
.ak-mini.legend { box-shadow: inset 0 0 0 0.45vh var(--w-group); }
.ak-slot img, .ak-mini img { width: 100%; height: 100%; object-fit: contain; }
button.ak-slot, button.ak-mini { cursor: pointer; outline: 0.6vh solid var(--w-sun); animation: w-bounce 0.6s ease-out; }

.ak-draft { flex: 1 1 0; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 1.2vh; color: var(--w-ink); }
.ak-dtop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2vw; align-items: center; }
.ak-dtop .ak-bev-pic { height: clamp(50px, 10vh, 120px); }
.ak-dherds { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1vw; }
.ak-dh { display: flex; align-items: center; gap: 0.8vh; min-width: 0; padding: 0.5vh 1vh; border-radius: var(--w-radius-s); background: #FFFFFF;
  border: 0.4vh solid var(--c); font-size: clamp(11px, 2vh, 22px); }
.ak-dh.on { background: color-mix(in srgb, var(--c) 25%, #FFFFFF); box-shadow: 0 0.5vh 0 var(--c); }
.ak-dh .ak-row { flex: 1; }
.ak-dgrid { min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.8vw; }
.ak-dcol { display: grid; align-content: start; gap: 0.6vh; padding: 0.8vh; border-radius: var(--w-radius-s); background: color-mix(in srgb, var(--sq) 35%, var(--w-board)); }
.ak-dhead { font-size: clamp(12px, 2.1vh, 24px); text-align: center; }
.ak-dt { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.6vh; min-height: 5vh; padding: 0.4vh 0.6vh;
  border: 0.3vh solid var(--w-board-edge); border-radius: 12px; background: #FFFFFF; font: inherit; color: var(--w-ink); text-align: left; }
button.ak-dt { cursor: pointer; touch-action: manipulation; box-shadow: 0 0.4vh 0 var(--w-board-edge); }
button.ak-dt:active { transform: translateY(0.4vh); box-shadow: none; }
.ak-dp { display: grid; place-items: center; width: clamp(20px, 4.4vh, 50px); height: clamp(20px, 4.4vh, 50px); font-size: clamp(14px, 3.2vh, 36px); line-height: 1; }
.ak-dp img { width: 100%; height: 100%; object-fit: contain; }
.ak-dn { min-width: 0; overflow: hidden; font-size: clamp(10px, 1.8vh, 20px); font-weight: 800; line-height: 1.05; }
.ak-dt.taken { opacity: 0.5; }
.ak-by { position: absolute; right: -0.6vh; top: -0.8vh; }
.ak-dt.legend { border-color: var(--w-group); }
.ak-dt.extra { border-color: var(--w-learning); }
.ak-dt.golden { border-color: var(--w-sun); background: color-mix(in srgb, var(--w-sun) 25%, #FFFFFF); }

.ak-over { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 2vh 2vw; background: rgb(38 48 82 / 0.45); }
.ak-over .w-dialog { width: min(1000px, 94vw); max-width: none; max-height: 94vh; overflow: auto; display: grid; gap: 1.4vh; justify-items: center; }
.ak-over h2 { margin: 0; font-size: var(--w-text-l); line-height: 1.05; }
.ak-over p { margin: 0; font-size: var(--w-text); font-weight: 700; line-height: 1.2; }
.ak-over .w-actions { margin: 0; align-items: center; }
.ak-soft { color: var(--w-ink-soft); }
.ak-over p.ak-soft { font-size: var(--w-text-s); }
.ak-bigpc { display: grid; justify-items: center; gap: 0.4vh; padding: 1.4vh 4vh; border: var(--w-line) solid var(--w-ink); border-radius: var(--w-radius);
  background: var(--w-sun); box-shadow: 0 var(--w-lip) 0 var(--w-ink); }
.ak-bigpc i { font-style: normal; font-size: clamp(34px, 9vh, 100px); line-height: 1; }
.ak-bigpc b { font-size: var(--w-text-l); line-height: 1; }
.ak-bigpc small { font-size: var(--w-text-s); font-weight: 700; }
.ak-baw { display: flex; align-items: center; justify-content: center; gap: 2vw; }
.ak-ba { display: grid; justify-items: center; gap: 0.4vh; min-width: 16vh; padding: 1.2vh 2vh; border-radius: var(--w-radius-s); background: #FFFFFF; box-shadow: 0 0.6vh 0 rgb(0 0 0 / 0.12); }
.ak-ba i { font-style: normal; font-size: clamp(24px, 6vh, 64px); line-height: 1.1; }
.ak-ba small { font-size: var(--w-text-s); font-weight: 800; }
.ak-arr { font-size: clamp(20px, 5vh, 54px); font-weight: 800; }
.ak-over p.ak-why { padding: 0.4vh 1.6vh; border-radius: 99px; background: var(--w-oops); }
.ak-gifts { display: flex; flex-wrap: wrap; justify-content: center; gap: 2vw; }
.ak-gift { display: grid; justify-items: center; align-content: center; gap: 0.6vh; width: min(26vw, 280px); min-height: 28vh; padding: 1.6vh;
  border: var(--w-line) solid var(--w-ink); border-radius: var(--w-radius); background: var(--w-sun); font: inherit; color: var(--w-ink); text-align: center;
  box-shadow: 0 var(--w-lip) 0 var(--w-ink); }
button.ak-gift { cursor: pointer; touch-action: manipulation; }
button.ak-gift:active { transform: translateY(var(--w-lip)); box-shadow: none; }
.ak-gift i, .ak-look { font-style: normal; font-size: clamp(34px, 10vh, 110px); line-height: 1; }
.ak-gift i img { width: clamp(44px, 12vh, 130px); height: clamp(44px, 12vh, 130px); object-fit: contain; }
.ak-gift b { font-size: var(--w-text-l); line-height: 1.05; }
.ak-gift span { font-size: var(--w-text-s); font-weight: 700; line-height: 1.15; }
.ak-gift small { font-size: var(--w-text-s); font-weight: 800; color: var(--w-ink-soft); }
.ak-gift.open { background: var(--w-board); animation: w-bounce 0.6s ease-out; }
.ak-gift.shut { opacity: 0.4; }
.th-card { fill: #FFFFFF; stroke: var(--ink); stroke-width: 2.5; }
.th-flag { fill: var(--w-oops); }

/* A phone held sideways: the board small on the left, the action on the right. */
@media (max-height: 500px) {
  .ak-table { grid-template: 'ring stage' minmax(0, 1fr) 'ring hands' auto / 32% minmax(0, 1fr); gap: 6px 8px; }
  .ak-ring { grid-area: ring; align-self: center; aspect-ratio: 8 / 5; gap: 2px; }
  .ak-sq { grid-template-rows: 1fr; padding: 0; border-radius: 8px; }
  .ak-lab, .ak-bev-pic, .ak-steps { display: none; }
  .ak-play { grid-template-rows: auto minmax(0, 1fr); }
  .ak-ico { font-size: 11cqh; }
  .ak-stage { grid-area: stage; width: 100%; height: 100%; padding: 6px 8px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .ak-acts { width: 130px; gap: 6px; }
  .ak-acts .w-btn { min-height: 44px; font-size: 16px; }
  .ak-pc span { display: none; }
  .ak-hand { grid-template-columns: 1fr; padding: 3px 4px; }
  .ak-who { grid-row: auto; grid-auto-flow: column; justify-content: start; gap: 4px; align-items: center; }
  .ak-dtop .ak-bev-pic { display: none; }
  .ak-dherds { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 4px; }
  .ak-dh { padding: 2px 4px; font-size: 11px; }
  .ak-dgrid { gap: 4px; }
  .ak-dcol { padding: 4px; gap: 3px; }
  .ak-dt { min-height: 40px; padding: 2px 3px; }
  .ak-dn .ak-tag { display: none; }
  .ak-gift { min-height: 110px; width: 30vw; padding: 6px; gap: 2px; }
}

/* Animal Kingdom's icon pictures (images/animal-kingdom/icons/): sized by the text around them. */
.ak-i { display: inline-block; width: 1.15em; height: 1.15em; object-fit: contain; vertical-align: -0.22em; }
.ak-ico .ak-i { width: 1.25em; height: 1.25em; vertical-align: middle; }
.ak-pi .ak-i, .ak-home .ak-i, .ak-slot .ak-i, .ak-mini .ak-i { width: 86%; height: 86%; vertical-align: middle; }
.ak-bigpc i .ak-i, .ak-gift i .ak-i, .ak-zz .ak-i { width: 1.2em; height: 1.2em; }

/* Game Street in 3D (src/ui/street3d.js): one canvas behind the street's own
   buttons and signs. A picture that a model stands in for is hidden (.in-3d);
   the finger moves the scroll position itself, so the page does not scroll. */
.street-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.street.is-3d .street-backdrop, .street.is-3d .street-road { visibility: hidden; }
.street.is-3d .street-scroll, .street.is-3d .district-scroll { overflow: hidden; touch-action: none; }
.street.is-3d .in-3d > .gate-art, .street.is-3d .in-3d > .shop-art, .street.is-3d .street-prop.in-3d > img, .street.is-3d .street-bus.in-3d { opacity: 0; transition: none; }
.street.is-3d .in-3d > .shop-glow { display: none; }
/* The plain shop shape a 2D picture fades in over: never under a model. */
.street.is-3d .shop.in-3d::before { content: none; }
.street.is-3d .street-stop.in-3d:focus-visible, .street.is-3d .street-stop.in-3d:active { transform: none; }
@media (hover: hover) { .street.is-3d .street-stop.in-3d:hover { transform: none; } }
.street.is-3d .district-scroll { background: none; }
.street.is-3d .district-ground, .street.is-3d .district-path { visibility: hidden; }
.street.is-3d .district-map .shop.in-3d:focus-visible, .street.is-3d .district-map .shop.in-3d:active { transform: translate(-50%, -100%); }
@media (hover: hover) { .street.is-3d .district-map .shop.in-3d:hover { transform: translate(-50%, -100%); } }
/* A name, a gate's name or a window card drawn onto its model
   (street3dFronts.js): the page's copy stays, unseen (a video keeps playing for it). */
.street.is-3d .in-3d > .on-model { opacity: 0; }
/* While the 3D models come (the first visit): the sky and the loading bus,
   never the 2D pictures (street3d.js whenReady). */
.street.loading-3d .street-view { background: linear-gradient(var(--w-sky), var(--w-sky-low) 62%, var(--w-grass-light)); }
.street.loading-3d .street-scroll, .street.loading-3d .district-scroll, .street.loading-3d .street-banner, .street.loading-3d .street-steps { visibility: hidden; }
.street-loading { position: absolute; inset: var(--top-h) 0 0; z-index: 5; display: grid; place-items: center; padding: 16px; pointer-events: none; }
/* Left and right along the street (street.js), on the road either side of
   the bus, as in docs/design/Street3D-mock.html. */
.street-steps {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 2.5cqh);
  display: flex; justify-content: center; gap: min(48cqw, 640px); pointer-events: none;
}
.street-steps .w-btn { pointer-events: auto; }
/* Through a gate (street3d.js flyTo): the street's signs and buttons fade
   while the camera flies in, a soft veil comes up, and the district fades in
   from under it. */
.street-veil { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; background: linear-gradient(var(--w-sky-low), var(--w-grass-light)); }
.street-veil.leaving { animation: street-veil-out 0.7s ease-out 0.15s both; }
@keyframes street-veil-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
.street.flying .street-scroll, .street.flying .street-banner, .street.flying .street-steps { opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
@media (prefers-reduced-motion: reduce) { .street-veil.leaving { animation: none; opacity: 0; } }

/* The 3D town (src/ui/town3d, behind its flag): the canvas takes drags and pinches. */
.town-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.town-gl:active { cursor: grabbing; }
.town-view { background: linear-gradient(var(--w-sky), var(--w-sky-low) 62%, var(--w-grass-light)); }
.town-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--w-text); font-weight: 800; color: var(--w-ink); }
/* A button over each place in the town (town3d/index.js keeps it on its
   building every frame): see-through, its name on a sign on top. */
/* The town takes every touch itself (drag, pinch, tap), on the buildings' buttons too:
   left to the browser, a finger's drag became a page gesture and cancelled the drag and the tap. */
.town-places { position: absolute; inset: 0; pointer-events: none; overflow: hidden; touch-action: none; }
.town-place {
  touch-action: none; -webkit-tap-highlight-color: transparent;
  position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: pointer;
  pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  border-radius: var(--w-radius, 24px); font: inherit;
}
.town-place[hidden] { display: none; }
.town-place:focus-visible { outline: 5px solid var(--w-ink); outline-offset: 4px; }
.town-sign { transform: translateY(-70%); font-size: var(--w-text-s); padding: 0.15em 0.6em; white-space: nowrap; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.town-place.picked .town-sign { transform: translateY(-70%) scale(1.15); }
.town-gate .town-sign { font-size: var(--w-text); }
/* On the town map a gate is its district's button: over it a slim one-line
   sign with the district's name. */
.town-gate .town-sign { --wood-frame: 3px; transform: translateY(-70%); font-size: var(--w-text-s); padding: 0.1em 0.95em; line-height: 1.2; max-width: none; flex-shrink: 0; overflow: visible; white-space: nowrap; }
/* Inside a district: the Map button, bottom right by the bus. */
.town-bottom .town-out { min-height: var(--w-tap); }
/* A shop in a shop row: its sign fits over it, on two lines when it must, so it never covers the next shop. */
.town-row .town-sign { white-space: normal; text-align: center; line-height: 1.05; max-width: 135%; width: max-content; padding: 0.2em 0.5em; transform: translateY(-85%); }
.town-row.picked .town-sign { transform: translateY(-85%) scale(1.12); }
.town-far .town-shop .town-sign { display: none; }
.town-place .shop-lock { position: absolute; right: 0; top: 30%; }
.town-place .shop-lock .w-badge.jiggle { animation: jiggle 0.5s; }
.town-go { position: absolute; left: 0; right: 0; bottom: max(24px, env(safe-area-inset-bottom)); display: flex; justify-content: center; pointer-events: none; z-index: 4; }
.town-go > .w-btn { pointer-events: auto; }
/* A shop's game picture beside Go, as tall as it (town3d/index.js gamePicture). */
.town-go { align-items: center; gap: clamp(10px, 1.4vw, 20px); }
.town-go > .w-pic { pointer-events: auto; height: var(--w-tap-big); width: auto; flex: none; }
@media (prefers-reduced-motion: reduce) { .town-place .shop-lock .w-badge.jiggle { animation: none; } }
/* Over a shop in the town: the last winners' crown at its top corner, a
   star on the sign of a game with something new inside. */
.town-place .town-champ { position: absolute; left: 0; top: 18%; --u: 4px; }
.town-sign .w-badge { padding: 4px; margin-inline-end: 0.3em; font-size: 0.8em; vertical-align: middle; }
.town-sign { display: inline-flex; align-items: center; }
/* The town's bottom row (town3d/index.js): Map on the left, inside a district. */
.town-bottom {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom));
  padding: 0 max(var(--gutter, 16px), env(safe-area-inset-right)) 0 max(var(--gutter, 16px), env(safe-area-inset-left));
  display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none;
}
.town-bottom > * { pointer-events: auto; }
/* The town's painted fronts are drawn from these (town3d/index.js
   frontSource): laid out and styled, but never seen or reached. Kept off
   screen, and no tap may land on them (the old street's styles give some of
   them their own visibility and pointer events): left over the town, they
   swallowed every tap and drag. */
.town-fronts { position: absolute; left: -10000px; top: 0; width: 1px; height: 1px; overflow: hidden; visibility: hidden; pointer-events: none; }
.town-fronts > * { position: absolute; left: 0; top: 0; width: 240px; height: 240px; }
.town-fronts, .town-fronts * { pointer-events: none !important; visibility: hidden !important; }

/* A place facing the camera has its name painted on its model: the floating
   sign keeps only a badge it carries. */
.town-place.on-model .town-sign:not(:has(.w-badge)) { display: none; }
.town-place.on-model .town-sign > span:last-child { display: none; }
.town-view .town-go { bottom: max(20px, env(safe-area-inset-bottom)); }
/* The Spinning Island (TOWN-3D-PLAN.md §14): the big turn arrows either side
   (the left one is the right one turned round), and the sky that fades in
   while the camera glides into a district or back out. */
.town-turns { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.town-turns[hidden] { display: none; }
/* Centred with `translate`, not `transform`: a pressed button sinks by its
   transform (world.css), which replaced the centring and dropped the arrow by
   half its height while pressed, so the next quick tap missed it. */
.town-turn.w-btn.round {
  position: absolute; top: 50%; translate: 0 -50%; pointer-events: auto;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  width: calc(var(--w-tap) * 1.25); height: calc(var(--w-tap) * 1.25);
}
.town-turn.left { left: max(var(--gutter, 16px), env(safe-area-inset-left)); }
.town-turn.left .w-icon { transform: scaleX(-1); }
.town-turn.right { right: max(var(--gutter, 16px), env(safe-area-inset-right)); }
.town-fade { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: var(--w-sky); opacity: 0; transition: opacity 0.45s ease-in; }
.town-fade.on { opacity: 1; }
.town-gl { cursor: default; }
@media (prefers-reduced-motion: reduce) { .town-fade { transition: none; } }

/* Playing on every device (src/room.js). The join card on the home page,
   under the way in: another device of the family opened a game room. */
.home-room {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px;
  font-size: var(--w-text); color: var(--w-ink);
}
.home-room > .w-icon, .home-room > svg { width: 36px; height: 36px; flex: none; }
.home-room .home-room-join { min-height: var(--w-tap); }

/* The Player house, hosting the room: the button, and each member's seat. */
.players-sheet .room-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.players-sheet .room-toggle { min-height: var(--w-tap); }
.players-sheet .room-toggle.on { background: var(--w-good); border-color: var(--w-good-edge); }
.person .seat {
  position: absolute; top: 6px; left: 6px; z-index: 1;
  display: flex; align-items: center; gap: 4px; padding: 2px 10px; min-height: 30px;
  border: var(--w-line) solid var(--w-ink-soft); border-radius: 999px; background: var(--w-paint);
  font: inherit; font-size: var(--w-text-s); font-weight: 700; color: var(--w-ink-soft);
}
.person .seat.joined { border-color: var(--w-good-edge); background: var(--w-good); color: var(--w-ink); cursor: pointer; }
.person .seat svg { width: 16px; height: 16px; flex: none; }
.person .seat-kick { display: grid; place-items: center; margin-left: 2px; opacity: 0.7; }

/* A player's own device in the room (screens/guest.js). */
.screen.guest { min-height: 100dvh; display: flex; flex-direction: column; gap: 16px; padding: clamp(12px, 3vh, 28px); }
.guest-head { display: flex; }
.guest-card {
  align-self: center; margin-block: auto; width: min(100%, 980px); display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: clamp(16px, 3vh, 32px); text-align: center;
}
.guest-card h1 { font-size: var(--w-title); margin: 0; }
.guest-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.guest-person {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 140px; padding: 12px;
  border: var(--w-line) solid var(--w-ink); border-radius: var(--w-radius); background: var(--w-paint);
  box-shadow: 0 var(--w-lip) 0 var(--w-ink); font-size: var(--w-text); font-weight: 700; color: var(--w-ink); cursor: pointer;
}
.guest-person[aria-pressed="true"] { background: var(--w-sun); }
.guest-person:disabled { opacity: 0.6; }

/* Whose device is this (home page, once after signing in), and the small
   grown-up switch on a child's device. */
.home-kind { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 20px; font-size: var(--w-text); color: var(--w-ink); }
.home-kind .w-btn { min-height: var(--w-tap); }
.home-grownup { margin-top: 4px; }


/* A player's own device during a game (screens/guest.js playView). */
.guest-play-head { display: flex; align-items: center; gap: 14px; justify-content: center; }
.guest-play-head h1 { font-size: var(--w-title); }
.guest-clock {
  display: grid; place-items: center; min-width: var(--w-tap); height: var(--w-tap); padding: 0 8px;
  border: var(--w-line) solid var(--w-ink); border-radius: 999px; background: var(--w-paint);
  font-size: var(--w-text-l); font-weight: 800; color: var(--w-ink);
}
.guest-play.mine { outline: var(--w-line) solid var(--w-sun-edge); }
.guest-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 2vh, 20px); }
.guest-choice-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.guest-choice-wrap .label { font-size: var(--w-text); font-weight: 700; color: var(--w-ink); }
.guest-choices .w-pic { width: clamp(130px, 22vh, 220px); height: clamp(130px, 22vh, 220px); }
.guest-choices .w-pic.tried { opacity: 0.35; }
.guest-choice.num {
  min-width: clamp(120px, 18vh, 180px); min-height: clamp(110px, 16vh, 160px);
  border: var(--w-line) solid var(--w-ink); border-radius: var(--w-radius); background: var(--w-paint);
  box-shadow: 0 var(--w-lip) 0 var(--w-ink); font-size: var(--w-title); font-weight: 800; color: var(--w-ink); cursor: pointer;
}
.guest-choice.num:disabled { opacity: 0.35; }


/* Odd One Out with everyone at once (src/ui/oddOneOut.js togetherStage):
   a seat for each player on the table. */
.ooo.together { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 22px); }
.ooo-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 2vh, 20px); }
.ooo-seat {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: clamp(150px, 20vw, 230px); padding: 12px;
  border: var(--w-line) solid var(--w-ink); border-radius: var(--w-radius); background: var(--w-paint);
  box-shadow: 0 var(--w-lip) 0 var(--w-ink); color: var(--w-ink);
}
.ooo-seat-who { display: flex; align-items: center; gap: 8px; font-size: var(--w-text); }
.ooo-seat-status { font-size: var(--w-text); font-weight: 800; color: var(--w-ink-soft); }
.ooo-seat.done .ooo-seat-status, .ooo-seat.right .ooo-seat-status { color: var(--w-ink); }
.ooo-seat.right { background: var(--w-good); }
.ooo-seat.miss { background: var(--w-oops); }
.ooo-seat-rule { max-width: 24ch; text-align: center; font-size: var(--w-text-s); font-weight: 700; }
.ooo-seat-odd {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px;
  border: var(--w-line) solid var(--w-ink); border-radius: var(--w-radius-s); background: var(--w-paint);
}
.ooo-seat-odd img { width: clamp(90px, 15vh, 150px); height: clamp(90px, 15vh, 150px); object-fit: contain; }
.ooo-seat-odd .ooo-num { position: static; display: grid; place-items: center; min-width: clamp(90px, 15vh, 150px); min-height: clamp(90px, 15vh, 150px); font-size: clamp(48px, 9vh, 96px); line-height: 1; font-weight: 800; color: var(--w-ink); }
.ooo-seat-stamp { padding: 2px 10px; border-radius: 999px; background: var(--w-ink); color: var(--w-paint); font-size: var(--w-text-s); font-weight: 800; }


/* A player's own device on a Family Trip (screens/guest.js tripView). */
.guest-trip-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.guest-trip-option { min-height: var(--w-tap-big); padding: 0 26px; font-size: var(--w-text-l); }
.guest-wallet { margin: 0; font-size: var(--w-text); font-weight: 800; color: var(--w-ink); }


/* A player's own device: the question above the choices (guest.js askView). */
.guest-ask { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.guest-ask img { width: clamp(70px, 12vh, 120px); height: clamp(70px, 12vh, 120px); object-fit: contain; }
.guest-ask.shadow img.guest-shadow { width: clamp(140px, 26vh, 260px); height: clamp(140px, 26vh, 260px); filter: brightness(0); }
.guest-ask.zoom {
  width: clamp(160px, 30vh, 300px); height: clamp(160px, 30vh, 300px); overflow: hidden;
  border: var(--w-line) solid var(--w-ink); border-radius: var(--w-radius); background: var(--w-paint);
}
.guest-ask.zoom img { width: 100%; height: 100%; object-fit: contain; }
.guest-ask.missing img { width: clamp(80px, 14vh, 130px); height: clamp(80px, 14vh, 130px); }
.guest-ask.missing.small img { width: clamp(50px, 8vh, 80px); height: clamp(50px, 8vh, 80px); }
.guest-ask.clues { flex-direction: column; align-items: flex-start; margin: 0; padding-left: 1.4em; font-size: var(--w-text); font-weight: 700; color: var(--w-ink); }
.guest-ask.sum { margin: 0; font-size: var(--w-title); font-weight: 800; color: var(--w-ink); }
.guest-choices .w-pic.dark img { filter: brightness(0); }


/* A player's own device as a remote for the stage's buttons (phase 6). */
.guest-trip-options.many { max-width: 900px; gap: 8px; }
.guest-trip-options.many .guest-trip-option { min-height: var(--w-tap); padding: 0 16px; font-size: var(--w-text); }
.guest-trip-option img { width: 56px; height: 56px; object-fit: contain; }
.guest-secret {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 22px;
  border: var(--w-line) dashed var(--w-ink); border-radius: var(--w-radius); background: var(--w-sun);
  color: var(--w-ink); font-size: var(--w-title);
}
.guest-secret img { width: clamp(100px, 18vh, 170px); height: clamp(100px, 18vh, 170px); object-fit: contain; }
.guest-secret-label { font-size: var(--w-text-l); }

/* A board of cards on the player's own device (Memory Pairs): the big
   screen's own board, cut to the device. */
.guest-stage { flex-grow: 0; width: min(100%, 1100px); align-self: center; }
.guest-mirror { width: 100%; height: min(64vh, 640px); flex-grow: 0; box-sizing: border-box; }
.guest-mirror .mem-grid { flex: 1 1 0; min-height: 0; grid-template-rows: repeat(var(--rows, 3), minmax(0, 1fr)); }
.guest-mirror .mem-card { aspect-ratio: auto; min-height: var(--w-tap); height: 100%; padding: 4px; }
.guest-mirror .mem-card img { width: 100%; height: 100%; min-height: 0; }

/* A few picture choices on the player's device (the Twenty Questions
   keeper's cards): big cards with their names. */
.guest-trip-options.pics .guest-trip-option {
  flex-direction: column; gap: 8px; padding: 14px; min-width: clamp(150px, 22vw, 240px); background: #FFFFFF; border-radius: var(--w-radius);
}
.guest-trip-options.pics .guest-trip-option img { width: clamp(120px, 20vw, 200px); height: clamp(120px, 20vw, 200px); }

/* The device as a controller: a tapped button presses in, a pick stays lit,
   the rest dim; at the answer the right one shines. */
.guest-trip-option.pressed, .guest-mirror .pressed { translate: 0 var(--w-lip); box-shadow: 0 0 0 var(--w-line) var(--w-sun); }
.guest-choices .picked { outline: var(--w-line) solid var(--w-sun); outline-offset: 4px; }
.guest-choices .dim { opacity: 0.45; }
.guest-choices .picked, .guest-choices .right { border-radius: var(--w-radius); }
.guest-choices .right { outline: var(--w-line) solid var(--w-good); outline-offset: 4px; }
@keyframes guest-press { 50% { scale: 0.94; } }
.guest-trip-option.pressed, .guest-mirror .pressed, .guest-choices .picked { animation: guest-press 0.18s ease-out; }
@media (prefers-reduced-motion: reduce) { .guest-trip-option.pressed, .guest-mirror .pressed, .guest-choices .picked { animation: none; } }

/* Which way? A slim bar at the bottom, so the whole map shows above it; each
   road says what is on it, in the colour its rings glow on the map. */
.party-question.party-fork {
  top: auto; bottom: clamp(8px, 2vh, 20px); translate: -50% 0; grid-auto-flow: column; align-items: center;
  gap: clamp(8px, 1.4vw, 18px); padding: 8px clamp(10px, 1.4vw, 18px);
}
.party-fork .w-btn { white-space: pre-line; line-height: 1.15; text-align: left; }
.party-fork [data-road="0"] { box-shadow: 0 0 0 var(--w-line) var(--w-sun), 0 var(--w-lip) 0 var(--w-edge-dark, var(--w-ink)); }
.party-fork [data-road="1"] { box-shadow: 0 0 0 var(--w-line) var(--w-good), 0 var(--w-lip) 0 var(--w-edge-dark, var(--w-ink)); }

/* Rolling Balls on a player's own device: the same answer cards as the big
   screen's, a little bigger (no show above them). */
.guest-rb { --card: clamp(96px, min(26vh, calc((100vw - 140px) / var(--n) - 14px)), 190px); max-width: 100%; }
.guest-rb .rb-choice.picked { box-shadow: 0 0 0 var(--w-line) var(--w-sun); }
.guest-rb .rb-choice.right { background: color-mix(in srgb, var(--w-good) 35%, var(--w-board)); border-color: var(--w-good-edge, var(--w-good)); }
