/* Rumpus — pixel-art theme. AGPLv3, see LICENSE.
 * Fonts: Press Start 2P + VT323 (SIL OFL), bundled in /fonts — zero external loads. */
@font-face { font-family: 'Press Start 2P'; src: url('fonts/PressStart2P-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'VT323'; src: url('fonts/VT323-Regular.ttf') format('truetype'); font-display: swap; }

:root {
  --bg: #14121f;
  --panel: #241f3d;
  --panel2: #2f2850;
  --ink: #f4f1e8;
  --dim: #a9a3d9;
  --accent: #ffb02e;
  --accent2: #5ee0a0;
  --danger: #ff5d73;
  --purple: #7c5cff;
  --blue: #4fc3f7;
  --edge: #0b0914;
  --px: 4px;
  --pixel: 'Press Start 2P', monospace;
  --body: 'VT323', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 22px;
  line-height: 1.25;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}
img.avatar, canvas { image-rendering: pixelated; }

#bg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; object-fit: cover; image-rendering: pixelated; }
body.play #bg { opacity: 0.45; }

h1, h2, .brand, .room-code, button, .round-tag, .slam, .game-name { font-family: var(--pixel); font-weight: 400; letter-spacing: 0.02em; }
h1 { font-size: clamp(18px, 2.4vw, 34px); line-height: 1.4; margin: 0.4em 0; text-shadow: 3px 3px 0 var(--edge); }
h2 { font-size: clamp(14px, 1.6vw, 22px); line-height: 1.5; margin: 0.5em 0; text-shadow: 2px 2px 0 var(--edge); }
a { color: var(--accent2); }

.game-pick,.vote-btn,.hand-btn,.clue-list li,.chain-entry,.role,#sidebar,#topbar,.panel {
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--edge), 0 var(--px) 0 0 var(--edge),
    calc(-1 * var(--px)) 0 0 0 var(--edge), var(--px) 0 0 0 var(--edge),
    inset 0 calc(-1 * var(--px)) 0 0 rgba(0,0,0,0.35);
}

.brand { font-size: 14px; color: var(--accent); text-shadow: 2px 2px 0 var(--edge); }
.brand.small { font-size: 10px; }
.hint { color: var(--dim); font-size: 20px; }
.error { color: var(--danger); min-height: 1.2em; }
.round-tag { color: var(--dim); text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; }
.prompt { color: var(--accent); }
.timer { color: var(--accent2); font-family: var(--pixel); font-size: 0.8em; }
.timer.urgent { color: var(--danger); animation: blink 0.5s steps(15) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.count { color: var(--dim); font-size: 24px; }

button {
  background: var(--accent);
  color: #221a00;
  border: none;
  border-radius: 0;
  padding: 14px 18px 18px;
  font-size: 12px;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.3), 0 0 0 3px var(--edge);
  transition: transform 0.05s steps(2);
}
button:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), 0 0 0 3px var(--edge); }
button:disabled { opacity: 0.4; cursor: default; }
button.danger { background: var(--danger); color: #fff; }

input, select {
  background: #0e0c1a;
  color: var(--ink);
  border: none;
  box-shadow: 0 0 0 3px var(--dim), inset 0 4px 0 rgba(0,0,0,0.5);
  border-radius: 0;
  padding: 12px;
  font-family: var(--body);
  font-size: 26px;
  width: 100%;
}
input:focus, select:focus { outline: none; box-shadow: 0 0 0 3px var(--accent), inset 0 4px 0 rgba(0,0,0,0.5); }
select { width: auto; font-size: 22px; padding: 4px 8px; }
label { display: block; margin: 14px 0 6px; color: var(--dim); font-size: 22px; }

/* ---------- Avatars ---------- */
img.avatar { width: 40px; height: 40px; vertical-align: middle; }
img.avatar.tiny { width: 24px; height: 24px; }
img.avatar.big { width: 96px; height: 96px; }
img.avatar.huge { width: 140px; height: 140px; }
.bob { animation: bob 1.2s steps(36) infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ---------- Host (TV) layout ---------- */
body.host {
  display: grid;
  grid-template-areas: "top top" "stage side";
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto 1fr;
  height: 100vh;
  gap: 12px;
  padding: 12px;
}
#topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: rgba(36, 31, 61, 0.92);
}
.room-code { font-size: 36px; color: var(--accent2); text-shadow: 4px 4px 0 var(--edge); letter-spacing: 0.2em; }
.join-card { display: flex; gap: 22px; align-items: center; background: var(--panel); padding: 16px 20px; box-shadow: 0 0 0 4px var(--edge); }
.join-text { display: flex; flex-direction: column; gap: 4px; }
.join-label { color: var(--dim); font-size: 20px; }
.join-addr { font-size: 26px; color: var(--ink); }
.join-code { font-family: var(--pixel); font-size: 44px; color: var(--accent2); letter-spacing: 0.15em; text-shadow: 4px 4px 0 var(--edge); }
.join-count { margin-top: 6px; color: var(--accent); font-size: 22px; }
body.host:not(.in-game) #topbar .room-code { display: none; }
body.host.lobby #sidebar { display: none; }
.top-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; }
#controls { display: flex; gap: 10px; }
#controls[hidden] { display: none; }
#controls button { padding: 10px 12px 13px; font-size: 10px; }
.icon-btn { background: var(--panel2); color: var(--ink); font-size: 18px; padding: 6px 10px 9px; font-family: var(--body); }
.link-btn { background: none; box-shadow: none; color: var(--dim); text-decoration: underline; padding: 4px; font-family: var(--body); font-size: 20px; }
.vol { display: flex; flex-direction: column; gap: 2px; font-size: 16px; color: var(--dim); }
.vol label { margin: 0; font-size: 16px; display: flex; gap: 6px; align-items: center; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 110px; height: 12px; padding: 0; background: #0e0c1a; box-shadow: 0 0 0 2px var(--dim); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 18px; background: var(--accent); box-shadow: 0 0 0 2px var(--edge); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 18px; background: var(--accent); border: none; border-radius: 0; box-shadow: 0 0 0 2px var(--edge); }

#stage { grid-area: stage; padding: 24px 32px; overflow-y: auto; position: relative; }
.phase-view { background: rgba(20, 18, 31, 0.78); padding: 20px 28px; min-height: 100%; }
.big-sub { font-size: 30px; }
#sidebar {
  grid-area: side;
  background: rgba(36, 31, 61, 0.92);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
#sidebar h2 { font-size: 12px; margin: 0 0 6px; color: var(--accent); }
#player-list { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; }
#player-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  transition: transform 0.3s steps(9);
  animation: slide-in 0.3s steps(9) both;
}
#player-list li.offline { opacity: 0.45; }
#player-list li.leader .pname::after { content: ' 👑'; }
#player-list small { color: var(--dim); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.pname { flex: 1; font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pscore { color: var(--accent2); font-family: var(--pixel); font-size: 11px; }
button.kick { background: transparent; color: var(--danger); box-shadow: none; padding: 2px 6px; font-size: 10px; }

#timerbar { position: sticky; top: -24px; height: 10px; background: #0e0c1a; margin: -8px -8px 14px; box-shadow: 0 0 0 3px var(--edge); }
#timerbar > i { display: block; height: 100%; width: 100%; background: var(--accent2); transform-origin: left; will-change: transform; }
#timerbar.urgent > i { background: var(--danger); }
#timerbar[hidden] { display: none; }

.double-badge { display: inline-block; background: var(--danger); color: #fff; font-family: var(--pixel); font-size: 11px; padding: 6px 8px; animation: blink 0.8s steps(24) infinite; margin-left: 8px; vertical-align: middle; }

ol.answers { font-size: 32px; line-height: 1.5; padding-left: 1.6em; }
ol.answers li { margin: 6px 0; animation: pop-in 0.35s steps(10) both; }
ol.answers li:nth-child(2) { animation-delay: 0.1s; }
ol.answers li:nth-child(3) { animation-delay: 0.2s; }
ol.answers li:nth-child(4) { animation-delay: 0.3s; }
ol.answers li:nth-child(n+5) { animation-delay: 0.4s; }
ol.answers li.winner { color: var(--accent2); }
ol.answers li.winner::marker { content: '★ '; }
ol.answers li.lie { color: var(--danger); text-decoration: line-through; }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.9); } }
.byline { color: var(--dim); font-size: 0.8em; }
.votes { color: var(--accent); margin-left: 12px; font-size: 0.8em; }
.voters { display: inline-flex; gap: 2px; margin-left: 8px; vertical-align: middle; }
.sweep { display: inline-block; font-family: var(--pixel); font-size: 12px; background: var(--accent); color: #221a00; padding: 4px 6px; margin-left: 8px; animation: wiggle 0.4s steps(12) infinite; }
@keyframes wiggle { 50% { transform: rotate(-4deg) scale(1.08); } }
.big-answer { font-family: var(--pixel); font-size: clamp(18px, 2.6vw, 34px); color: var(--accent2); margin: 0.4em 0; text-shadow: 3px 3px 0 var(--edge); animation: pop-in 0.4s steps(12) both; }
.winner-line { color: var(--accent2); font-size: 34px; }
ul.scored-list { list-style: none; padding: 0; font-size: 26px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
ul.scored-list li.correct { color: var(--accent2); }
ul.scored-list li.wrong { color: var(--dim); }
.streak { color: var(--accent); }

/* ---------- Lobby / game picker ---------- */
.qr-big { width: 190px; height: 190px; background: #fff; padding: 8px; box-shadow: 0 0 0 4px var(--edge), 6px 6px 0 4px var(--edge); }
.settings { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.settings label { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--danger); /* old TVs: default colour, cosmetic */ box-shadow: none; }
.spicy-on { color: var(--danger); }
.lobby-crew { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 6px; min-height: 60px; }
.lobby-crew figure { margin: 0; text-align: center; font-size: 20px; animation: drop-in 0.4s steps(12) both; }
.lobby-crew figure img { display: block; margin: 0 auto 2px; }
@keyframes drop-in { from { transform: translateY(-40px); opacity: 0; } }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-top: 22px; }
button.game-pick {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  align-items: start;
  background: var(--panel);
  padding: 14px;
  text-align: left;
  color: var(--ink);
  font-family: var(--body);
}
button.game-pick:not(:disabled):hover, button.game-pick:not(:disabled):focus { background: var(--panel2); transform: translateY(-3px); }
button.game-pick .game-name { font-size: 12px; color: var(--accent); line-height: 1.5; }
button.game-pick .game-blurb { color: var(--dim); font-size: 19px; }
button.game-pick .game-min { color: var(--danger); font-size: 16px; }
button.game-pick:not(:disabled) .game-min { color: var(--dim); }

#offline-banner { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--danger); color: #fff; text-align: center; padding: 10px; font-family: var(--pixel); font-size: 12px; z-index: 50; }
body.offline #offline-banner { display: block; }

/* Press start overlay (TV) — needed so the browser lets audio play */
#start-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 8, 20, 0.7); cursor: pointer; }
#start-overlay .press { font-family: var(--pixel); font-size: clamp(16px, 3vw, 34px); color: var(--accent); text-shadow: 4px 4px 0 var(--edge); animation: blink 1s steps(30) infinite; text-align: center; line-height: 1.8; }
#start-overlay .logo { font-family: var(--pixel); font-size: clamp(28px, 4.4vw, 76px); line-height: 1.2; overflow-wrap: anywhere; color: var(--accent2); text-shadow: 6px 6px 0 var(--edge), -2px -2px 0 var(--purple); margin-bottom: 30px; }
#start-overlay[hidden] { display: none; }
#start-overlay { grid-auto-flow: column; gap: 6vw; align-content: center; justify-content: center; }
.start-join { display: flex; flex-direction: column; align-items: center; gap: 1.2vh; }
.start-join[hidden] { display: none; }
.start-qr { width: min(52vh, 38vw); height: min(52vh, 38vw); background: #fff; padding: 1.2vh; box-shadow: 0 0 0 6px var(--edge), 10px 10px 0 6px var(--edge); image-rendering: pixelated; }
.start-code-label { color: var(--dim); font-size: max(22px, 3vh); }
.start-code { font-family: var(--pixel); font-size: max(40px, 11vh); color: var(--accent2); letter-spacing: 0.15em; text-shadow: 6px 6px 0 var(--edge); line-height: 1; }
.start-addr { font-size: max(22px, 3.4vh); color: var(--ink); }
@media (max-aspect-ratio: 1/1) { #start-overlay { grid-auto-flow: row; } }

/* ---------- FX ---------- */
canvas.wipe, canvas.confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; display: none; image-rendering: pixelated; }
canvas.confetti { z-index: 41; }
.reaction { position: fixed; bottom: 30px; z-index: 45; display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: float-up 3.2s steps(96) forwards; }
.r-emoji { font-size: 54px; filter: drop-shadow(3px 3px 0 var(--edge)); }
.r-name { font-size: 18px; color: var(--ink); text-shadow: 2px 2px 0 var(--edge); }
@keyframes float-up { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 10% { opacity: 1; transform: translateY(-40px) scale(1.1); } 100% { transform: translateY(-62vh) scale(1); opacity: 0; } }
.score-pop { position: fixed; z-index: 46; font-family: var(--pixel); font-size: 14px; color: var(--accent2); text-shadow: 2px 2px 0 var(--edge); pointer-events: none; animation: pop-up 1.6s steps(48) forwards; }
.score-pop.neg { color: var(--danger); }
@keyframes pop-up { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-50px); opacity: 0; } }
.slam { position: fixed; left: 50%; top: 42%; z-index: 47; font-size: clamp(18px, 3.6vw, 48px); color: var(--ink); background: var(--danger); padding: 18px 26px; text-align: center; line-height: 1.5;
  box-shadow: 0 0 0 6px var(--edge), 10px 10px 0 6px var(--edge); animation: slam 2.3s steps(69) forwards; pointer-events: none; }
.slam.gold { background: var(--accent); color: #221a00; }
@keyframes slam { 0% { transform: translate(-50%, -50%) scale(3) rotate(-8deg); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(1) rotate(-3deg); opacity: 1; } 85% { transform: translate(-50%, -50%) scale(1) rotate(-3deg); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } }

/* ---------- Podium (game over) ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 18px; margin: 20px 0 10px; }
.podium .step { text-align: center; width: 170px; }
.podium .block { background: var(--panel2); font-family: var(--pixel); color: var(--accent); padding-top: 10px; box-shadow: 0 0 0 4px var(--edge); animation: rise 0.8s steps(24) both; transform-origin: bottom; }
.podium .p1 .block { height: 150px; background: var(--accent); color: #221a00; }
.podium .p2 .block { height: 105px; animation-delay: 0.3s; }
.podium .p3 .block { height: 70px; animation-delay: 0.6s; }
.podium .who { font-size: 26px; margin: 6px 0; }
.podium .pts { font-family: var(--pixel); font-size: 12px; color: var(--accent2); }
@keyframes rise { from { transform: scaleY(0); } }

/* ---------- Player (phone) layout ---------- */
body.play { min-height: 100vh; padding-bottom: 78px; }
.playbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(36, 31, 61, 0.95); color: var(--dim); font-size: 20px; position: sticky; top: 0; z-index: 10; }
#me-tag { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
#phone-timer { min-width: 2.5em; text-align: right; }
.banner { background: var(--danger); color: #fff; text-align: center; padding: 8px; font-size: 20px; }
.banner[hidden] { display: none; }
#screen { padding: 20px 16px; max-width: 520px; margin: 0 auto; }
#game-view, #join-view { background: rgba(20, 18, 31, 0.86); padding: 16px; box-shadow: 0 0 0 4px var(--edge); }
#game-view.enter { animation: screen-in 0.35s steps(10) both; }
@keyframes screen-in { from { transform: scale(0.85) translateY(20px); opacity: 0; } }
#code-input { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--pixel); font-size: 22px; }
.vote-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.vote-btn, .hand-btn { background: var(--panel); color: var(--ink); text-align: left; font-family: var(--body); font-size: 24px; padding: 12px 14px 16px; line-height: 1.2; }
.hand-btn { background: #f4f1e8; color: #14121f; }
.vote-btn:active, .hand-btn:active { background: var(--panel2); }
.ghost-btn { background: transparent; color: var(--accent); box-shadow: 0 0 0 3px var(--accent); width: 100%; margin-top: 14px; font-family: var(--body); font-size: 22px; }
.waiting-art { text-align: center; margin: 16px 0; }
.avatar-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 6px; }
.avatar-pick button { background: var(--panel); padding: 4px; box-shadow: 0 0 0 2px var(--edge); }
.avatar-pick button.on { background: var(--accent2); }
.avatar-pick button[disabled] { opacity: 0.25; }
.avatar-pick img { width: 100%; height: auto; display: block; }

.react-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; padding: 8px; background: rgba(36, 31, 61, 0.96); box-shadow: 0 -4px 0 var(--edge); z-index: 20; overflow-x: auto; }
.react-bar[hidden] { display: none; }
.react-bar button { background: var(--panel2); font-size: 26px; padding: 4px 8px 6px; box-shadow: 0 0 0 2px var(--edge); font-family: sans-serif; flex: 0 0 auto; }

/* ---------- New-game widgets ---------- */
.bars { max-width: 860px; margin: 20px 0; }
.bar-row { display: grid; grid-template-columns: 220px 1fr 50px; align-items: center; gap: 12px; margin: 10px 0; font-size: 28px; }
.bar-label { display: flex; gap: 8px; align-items: center; overflow: hidden; white-space: nowrap; }
.bar { height: 28px; background: var(--dim); min-width: 6px; animation: grow 0.7s steps(21) both; transform-origin: left; box-shadow: 0 0 0 3px var(--edge); }
.bar-row.winner .bar { background: var(--accent2); }
.bar-row.winner .bar-label { color: var(--accent2); }
.bar-n { font-family: var(--pixel); font-size: 14px; }
@keyframes grow { from { transform: scaleX(0); } }
.clue-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.clue-list li { background: var(--panel); padding: 12px 14px; display: flex; gap: 10px; align-items: center; animation: pop-in 0.35s steps(10) both; }
.clue-list .clue { font-size: 34px; color: var(--accent); display: block; }
.role { background: var(--panel); padding: 14px; text-align: center; font-size: 26px; margin-bottom: 14px; }
.role.imposter { background: #3a1222; color: var(--danger); font-family: var(--pixel); font-size: 14px; line-height: 1.6; }
.role small { color: var(--dim); font-family: var(--body); font-size: 20px; }
.waiting-on { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4em 1em; color: var(--muted, #b9b3c9); }
.waiting-on span { display: inline-flex; align-items: center; gap: 0.3em; color: var(--ink, #fff); }
.favs { color: #ff6b8b; font-family: var(--pixel); }
.suspicion { display: block; height: 10px; margin-top: 6px; background: rgba(0,0,0,0.4); box-shadow: 0 0 0 2px var(--edge); }
.suspicion i { display: block; height: 100%; background: #e83f5b; transition: width 0.4s steps(12); }
.dd-toggle.on { background: var(--accent); color: var(--bg, #14101f); }
.bot-tools { display: inline-flex; gap: 6px; align-items: center; }
.bot-tools button { font-size: 12px; padding: 6px 8px; min-height: 0; }
.night-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; font-size: 22px; }
.night-row button { font-size: 14px; padding: 8px 12px; min-height: 0; }
.bet-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.fav-pick { display: grid; gap: 10px; }
.fav-btn img { width: 60%; max-width: 220px; display: block; margin: 0 auto; background: #fff; }
.chain { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.chain-entry { background: var(--panel); padding: 12px; width: 260px; display: flex; flex-direction: column; gap: 6px; animation: pop-in 0.5s steps(15) both; }
.chain-entry img { width: 100%; background: #fff; }
.chain-text { font-size: 30px; color: var(--accent); margin: 0; min-height: 2.4em; }
.blank-drawing { min-height: 16vh; aspect-ratio: 1; /* old TVs: min-height when aspect-ratio is unknown */ background: #fff; color: #999; display: grid; place-items: center; }
.doodle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.doodle-grid figure { margin: 0; position: relative; box-shadow: 0 0 0 4px var(--edge); }
.doodle-grid img { width: 100%; display: block; background: #fff; }
.doodle-grid figcaption { position: absolute; top: 6px; left: 8px; color: #000; font-family: var(--pixel); font-size: 14px; }
.doodle-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.doodle-btn { padding: 4px; background: var(--panel); }
.doodle-btn img { width: 100%; display: block; }
.describe-img { width: 100%; background: #fff; margin-bottom: 8px; box-shadow: 0 0 0 3px var(--edge); }
.draw-prompt { font-size: 24px; margin: 0 0 8px; }
.draw-canvas { width: 100%; aspect-ratio: 1; /* phone only */ background: #fff; touch-action: none; display: block; box-shadow: 0 0 0 4px var(--edge); image-rendering: auto; }
.draw-tools { margin: 10px 0; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; padding: 0; box-shadow: 0 0 0 2px var(--edge); }
.swatch.on { box-shadow: 0 0 0 2px var(--edge), 0 0 0 5px var(--accent2); }
.draw-row { display: flex; gap: 8px; margin-top: 10px; }
.draw-row button { padding: 8px 10px 11px; font-size: 10px; }
.size { background: var(--panel); display: grid; place-items: center; width: 44px; }
.size.on { background: var(--accent2); }
.size span { background: var(--ink); display: block; }
.tool-btn { background: var(--panel2); color: var(--ink); }


@media (max-width: 900px) {
  body.host { grid-template-columns: 1fr; grid-template-areas: "top" "stage" "side"; height: auto; }
  .qr-big { width: 150px; height: 150px; }
  #topbar { flex-wrap: wrap; }
}
.slam { white-space: pre-line; }
#start-overlay small { font-size: 0.45em; color: var(--dim); }
.react-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 8px 10px; }
.react-bar[hidden] { display: none; }
.react-bar button { font-size: 24px; padding: 4px 0 6px; }
body.play { padding-bottom: 120px; }

/* ---------- v3: game-feel extras ---------- */
.now-playing { position: fixed; left: 16px; bottom: 16px; z-index: 48; pointer-events: none; background: rgba(36,31,61,0.95); color: var(--accent2); padding: 8px 14px; font-size: 22px;
  box-shadow: 0 0 0 3px var(--edge); transform: translateX(-120%); transition: transform 0.4s steps(12); }
.now-playing.show { transform: none; }
.storm-hunch { font-size: 2.6vh; color: var(--dim); }
/* Message in a Bottle: waiting doodles drift across the TV (6 s → steps(180)). */
.scribble-sea { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.scribble { position: absolute; left: 0; margin: 0; width: 14vh; text-align: center; animation: scribble-drift 6s steps(180) forwards; }
.scribble img { width: 100%; image-rendering: pixelated; background: var(--ink); box-shadow: 0 0 0 4px var(--edge); }
.scribble figcaption { font-size: 2.6vh; color: var(--dim); }
@keyframes scribble-drift { from { transform: translateX(-20vh); opacity: 1; } 85% { opacity: 1; } to { transform: translateX(110vw); opacity: 0; } }
#scribble-pad { height: 30vh; }
/* Phone: keep-awake failed (public/play.js wakeHint). */
.wake-hint { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 61; padding: 10px 14px; font-family: var(--body); font-size: 22px; background: var(--panel2); color: var(--accent);
  box-shadow: 0 0 0 3px var(--edge); pointer-events: none; }
/* Browser build: a second TV tab (web/host-entry.js secondTabNote). */
.second-tab-note { position: fixed; top: 0; left: 0; right: 0; z-index: 61; padding: 6px 16px; text-align: center; font-family: var(--body); font-size: max(28px, 2.6vh);
  background: var(--panel2); color: var(--accent); box-shadow: 0 3px 0 var(--edge); pointer-events: none; }
.intro-card { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 55; display: grid; place-items: center; background: rgba(10,8,20,0.88); animation: intro-in 0.4s steps(12) both; }
.intro-card.out { animation: intro-out 0.5s steps(15) forwards; }
@keyframes intro-in { from { clip-path: inset(50% 0 50% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes intro-out { to { clip-path: inset(50% 0 50% 0); } }
.intro-inner { text-align: center; }
.intro-icon { width: 128px; height: 128px; image-rendering: pixelated; animation: bob 0.8s steps(24) infinite; }
.intro-title { font-family: var(--pixel); font-size: clamp(24px, 5vw, 64px); color: var(--accent); text-shadow: 6px 6px 0 var(--edge); margin: 18px 0 24px; animation: slam-in 0.5s steps(15) both; }
@keyframes slam-in { from { transform: scale(3); opacity: 0; } }
.intro-rules { list-style: none; padding: 0; font-size: 34px; display: grid; gap: 10px; }
.intro-rules li { animation: pop-in 0.4s steps(12) both; }
.intro-rules li:nth-child(1) { animation-delay: 0.5s; } .intro-rules li:nth-child(2) { animation-delay: 1s; } .intro-rules li:nth-child(3) { animation-delay: 1.5s; }
.intro-rules li::before { content: '▶ '; color: var(--accent2); }
.intro-crew { margin-top: 24px; display: flex; justify-content: center; gap: 10px; }
.walker { position: fixed; bottom: 6px; left: -80px; width: 64px; height: 64px; z-index: 3; image-rendering: pixelated; pointer-events: none;
  animation: walk 13s steps(390) forwards, bob 0.4s steps(12) infinite; }
.walker.rtl { left: auto; right: -80px; transform: scaleX(-1); animation: walk-rtl 13s steps(390) forwards, bob 0.4s steps(12) infinite; }
@keyframes walk { to { left: 105vw; } }
@keyframes walk-rtl { to { right: 105vw; } }
.shake { animation: shake 0.4s steps(12); }
@keyframes shake { 20% { transform: translate(-6px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, 3px); } 80% { transform: translate(3px, -2px); } }
.awards { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 26px; }
.award { display: flex; gap: 12px; align-items: center; background: var(--panel); padding: 10px 14px; box-shadow: 0 0 0 4px var(--edge); animation: drop-in 0.5s steps(15) both; }
.award b { display: block; font-family: var(--pixel); font-size: 11px; color: var(--accent); margin-bottom: 4px; }
.award span { font-size: 22px; }

/* ---------- v4: head-to-head, suspense reveals, game-select art ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; margin: 18px 0; }
.vs-card { background: var(--panel); padding: 18px; font-size: 32px; box-shadow: 0 0 0 4px var(--edge); animation: pop-in 0.4s steps(12) both; }
.vs-card.b { animation-delay: 0.3s; }
.vs-card.won { background: #1d4a35; box-shadow: 0 0 0 4px var(--accent2), 8px 8px 0 4px var(--edge); }
.vs-card.lost { opacity: 0.6; }
.vs-meta { font-size: 22px; color: var(--dim); margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vs-bar { height: 16px; background: #0e0c1a; margin-top: 10px; box-shadow: 0 0 0 3px var(--edge); }
.vs-bar > i { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: grow 1s steps(30) both 0.6s; }
.vs-card.won .vs-bar > i { background: var(--accent2); }
.vs-badge { align-self: center; font-family: var(--pixel); font-size: 26px; color: var(--danger); text-shadow: 4px 4px 0 var(--edge); animation: wiggle 0.6s steps(18) infinite; }
.suspense li, .bars .bar-row { animation: pop-in 0.4s steps(12) both; }
.bar-row { animation: pop-in 0.4s steps(12) both; }
.cat-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.cat-card div { background: var(--purple); color: #fff; font-family: var(--pixel); font-size: 14px; line-height: 1.6; padding: 26px 16px; text-align: center; box-shadow: 0 0 0 4px var(--edge), 6px 6px 0 4px var(--edge); animation: drop-in 0.5s steps(15) both; }
.cat-card div:nth-child(2) { animation-delay: 0.2s; background: var(--blue); }
.cat-card div:nth-child(3) { animation-delay: 0.4s; background: var(--danger); }
.cat-banner { font-family: var(--pixel); font-size: 13px; color: #fff; background: var(--purple); display: inline-block; padding: 6px 10px; margin-bottom: 6px; }
button.game-pick { display: flex; flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; }
.game-art { display: grid; place-items: center; height: 150px; background: var(--art-bg, var(--panel2)); border-bottom: 4px solid var(--edge); }
.game-art img { image-rendering: pixelated; }
button.game-pick:not(:disabled):hover .game-art img { animation: bob 0.6s steps(18) infinite; }
.game-text { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- v5: pace votes, drawn avatars ---------- */
.pace-bar { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pace-bar[hidden] { display: none; }
.pace-btn { flex: 1; background: var(--panel2); color: var(--ink); font-size: 10px; padding: 10px 8px 13px; }
.pace-btn.on { background: var(--accent2); color: #14121f; }
.pace-btn small { display: block; font-family: var(--body); font-size: 18px; margin-top: 4px; }
.pace-pill { font-size: 18px; color: var(--accent2); align-self: center; background: var(--panel2); padding: 4px 8px; }
.avatar-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.avatar-mode button { background: var(--panel2); color: var(--ink); font-size: 9px; padding: 10px 6px 13px; }
.avatar-mode button.on { background: var(--accent); color: #221a00; }
.avatar-pick[hidden],.lobby-maker[hidden] { display: none; }
.lobby-maker { margin-top: 14px; background: rgba(20,18,31,0.86); padding: 14px; box-shadow: 0 0 0 4px var(--edge); }
img.avatar.drawn { background: #fff; box-shadow: 0 0 0 2px var(--edge); object-fit: cover; image-rendering: auto; }

/* ---------- v6: fill the screen (10-foot UI) ----------
 * Reference frame 1080p; sizes scale with screen height so bigger TVs get bigger text.
 * Body text ≥ 3.2vh (~35px @1080p), secondary ≥ 2.6vh (~28px). Prompts are sized by
 * Rumpus.fit() to fill their box. Few elements, big, generously spaced. */
body.host { font-size: max(22px, 3.2vh); }
body.host .phase-view.in-game { display: flex; flex-direction: column; justify-content: center; gap: 2.2vh; min-height: 100%; }
body.host .phase-view.in-game > * { margin-top: 0; margin-bottom: 0; }
body.host h1 { font-size: max(24px, 4.6vh); }
body.host h1.prompt { line-height: 1.35; }
body.host .big-sub { font-size: max(24px, 3.6vh); }
body.host .count { font-size: max(20px, 2.8vh); }
body.host .round-tag { font-size: max(12px, 1.6vh); }
body.host ol.answers { font-size: max(26px, 4.2vh); line-height: 1.4; }
body.host ol.answers li { margin: 1vh 0; }
body.host .vs-card { font-size: max(26px, 4.4vh); padding: 3vh 2.4vw; min-height: 22vh; display: flex; flex-direction: column; justify-content: center; }
body.host .vs-badge { font-size: max(22px, 4.5vh); }
body.host .vs-meta { font-size: max(18px, 2.6vh); }
body.host .vs-bar { height: 2.2vh; }
body.host ul.scored-list { font-size: max(22px, 3.2vh); }
body.host .clue-list .clue { font-size: max(26px, 4.6vh); }
body.host .clue-list li { padding: 2vh 1.4vw; }
body.host .bar-row { font-size: max(22px, 3.6vh); grid-template-columns: minmax(180px, 26vw) 1fr auto; }
body.host .bar { height: 4vh; }
body.host .cat-card div { font-size: max(14px, 2.4vh); padding: 6vh 2vw; }
body.host .chain-entry { width: min(30vw, 34vh); }
body.host .chain-text { font-size: max(22px, 3.6vh); }
body.host .waiting-on { font-size: max(28px, 3.2vh); }
body.host .big-answer { font-size: max(22px, 7vh); }
body.host .double-badge { font-size: max(11px, 1.6vh); }
body.host .timer { font-size: 0.9em; }
body.host .pname { font-size: max(20px, 2.8vh); }
body.host .pscore { font-size: max(11px, 1.5vh); }
body.host img.avatar { width: max(40px, 5vh); height: max(40px, 5vh); }
body.host img.avatar.tiny { width: max(24px, 3.2vh); height: max(24px, 3.2vh); }
body.host img.avatar.big { width: max(96px, 11vh); height: max(96px, 11vh); }
body.host img.avatar.huge { width: max(140px, 16vh); height: max(140px, 16vh); }
body.host #sidebar { width: auto; }
body.host { grid-template-columns: 1fr clamp(240px, 19vw, 420px); }
/* Phones: scale with width. */
body.play { font-size: clamp(20px, 5.4vw, 30px); }
body.play h2.prompt { font-size: clamp(16px, 4.6vw, 26px); }
body.play .vote-btn, body.play .hand-btn { font-size: clamp(20px, 5.6vw, 30px); }

/* ---------- v7: teams ---------- */
.team-bar { display: flex; gap: 4px; font-family: var(--pixel); font-size: max(10px, 1.4vh); margin-bottom: 8px; }
.team-bar[hidden] { display: none; }
.team-bar .tb { padding: 8px 6px; color: #fff; box-shadow: 0 0 0 3px var(--edge); transition: flex 0.5s steps(15); white-space: nowrap; overflow: hidden; }
.team-bar .red, .team-win.red { background: #c62f45; }
.team-bar .blue, .team-win.blue { background: #2f6fc6; }
.team-bar .blue { text-align: right; }
#player-list li.team-red { box-shadow: inset 6px 0 0 #e83f5b; }
#player-list li.team-blue { box-shadow: inset 6px 0 0 #4f8fe8; }
.team-col { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 12px; margin-right: 12px; box-shadow: 0 0 0 3px var(--edge); }
.team-col b { width: 100%; font-family: var(--pixel); font-size: 12px; }
.team-col.team-red { background: rgba(198,47,69,0.35); }
.team-col.team-blue { background: rgba(47,111,198,0.35); }
.teams-on { color: var(--blue); }
.team-win { font-family: var(--pixel); font-size: max(16px, 3vh); color: #fff; padding: 14px 18px; display: inline-block; box-shadow: 0 0 0 4px var(--edge); background: var(--panel2); animation: pop-in 0.4s steps(12) both; }
.team-win small { font-family: var(--body); font-size: 0.8em; margin-left: 10px; }
.team-badge { font-family: var(--pixel); font-size: 12px; padding: 10px; color: #fff; text-align: center; }
.team-badge.team-red { background: #c62f45; }
.team-badge.team-blue { background: #2f6fc6; }

/* ---------- v8: Minigame Mayhem ---------- */
.mg-title { font-size: max(28px, 8vh); text-align: center; }
.mg-rule { text-align: center; }
.mg-big { width: 100%; min-height: 46vh; font-size: clamp(28px, 10vw, 56px); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.mg-big.tap { background: var(--accent2); color: #14121f; }
.mg-big.wait { background: var(--danger); color: #fff; }
.mg-big.go { background: var(--accent2); color: #14121f; }
.mg-big.roast { background: #f4f1e8; color: #14121f; }
.mg-big.roast.holding { background: #3a1a08; color: #fff; }
.mg-count { text-align: center; font-family: var(--pixel); font-size: 20px; margin-top: 12px; }
.qd { display: grid; place-items: center; height: 60vh; font-family: var(--pixel); font-size: max(48px, 14vh); text-shadow: 8px 8px 0 var(--edge); }
.qd.wait { color: var(--danger); }
.qd.go { color: var(--accent2); animation: pop-in 0.2s steps(6) both; }
.tug { display: grid; grid-template-columns: auto 1fr auto; gap: 2vw; align-items: center; margin-top: 4vh; font-family: var(--pixel); font-size: max(16px, 3vh); }
.tug-lake { height: 18vh; background: #1e5f9e; position: relative; box-shadow: 0 0 0 4px var(--edge); }
.tug-rope { position: absolute; left: 0; right: 0; top: 45%; height: 1.4vh; background: #8a5a3b; }
.tug-flag { position: absolute; top: -5vh; width: 2vh; height: 6vh; background: var(--accent); transform: translateX(-50%); transition: left 0.1s steps(3); box-shadow: 0 0 0 3px var(--edge); }
.tug-team.red { color: #ff6b7f; } .tug-team.blue { color: #6fb0ff; }
.fly-field { position: relative; height: 70vh; background: rgba(5, 8, 20, 0.85); box-shadow: 0 0 0 4px var(--edge); }
.fly-field i { position: absolute; width: 1.6vh; height: 1.6vh; background: #d4ff6b; box-shadow: 0 0 12px #d4ff6b; animation: blink 1s steps(30) infinite; }

/* ---------- v9: per-game colour schemes, in-game declutter, auto-hiding sidebar ---------- */
body[data-theme="quiplash"]   { --accent: #ff7bd5; --accent2: #ffd23f; --panel: #2e0f4a; --panel2: #451a6b; }
body[data-theme="fibbage"]    { --accent: #ffb347; --accent2: #ffe08a; --panel: #4a1a0e; --panel2: #6e2a12; }
body[data-theme="trivia"]     { --accent: #7fd4ff; --accent2: #ffd23f; --panel: #103268; --panel2: #164180; }
body[data-theme="closest"]    { --accent: #c8ff6b; --accent2: #ffe08a; --panel: #0f321d; --panel2: #154226; }
body[data-theme="majority"]   { --accent: #ffcf3f; --accent2: #5ee0a0; --panel: #1d4f7a; --panel2: #2a679c; }
body[data-theme="mostlikely"] { --accent: #ff9bb5; --accent2: #ffe0a0; --panel: #4a1236; --panel2: #701a42; }
body[data-theme="imposter"]   { --accent: #ff5050; --accent2: #b8f0a0; --panel: #152319; --panel2: #223828; }
body[data-theme="twotruths"]  { --accent: #b0c8ff; --accent2: #ffd27a; --panel: #0c1836; --panel2: #152a58; }
body[data-theme="crush"]      { --accent: #ff8fb3; --accent2: #ffe6f0; --panel: #3d1248; --panel2: #53185c; }
body[data-theme="storm"]      { --accent: #9fb7ff; --accent2: #e8eeff; --panel: #141a2e; --panel2: #1e2742; }
body[data-theme="lantern"]    { --accent: #ffb74d; --accent2: #fff3e0; --panel: #13284a; --panel2: #1b3c6a; }
body[data-theme="looncall"]   { --accent: #7fe3d0; --accent2: #e6fff9; --panel: #0f2a3d; --panel2: #163a52; }
body[data-theme="telephone"]  { --accent: #ffe066; --accent2: #ffffff; --panel: #5a2a08; --panel2: #7e3d0c; }
body[data-theme="cah"]        { --accent: #ffffff; --accent2: #ff6040; --panel: #220808; --panel2: #3c0d0d; }
body[data-theme="minigames"]  { --accent: #ffe14d; --accent2: #ffffff; --panel: #0d4f7f; --panel2: #1468a5; }
body.host { transition: grid-template-columns 0.5s steps(15); }
body.host.in-game .brand { display: none; }
body.host.in-game #topbar { padding: 4px 16px; }
body.host.in-game .room-code { font-size: max(16px, 2.4vh); letter-spacing: 0.15em; }
body.host.in-game .phase-view { background: rgba(10, 8, 20, 0.55); }


#sidebar { transition: opacity 0.4s steps(12); }

.source-line { position: fixed; right: 16px; bottom: 10px; z-index: 30; font-size: max(14px, 1.8vh); color: var(--dim); background: rgba(10, 8, 20, 0.6); padding: 2px 8px; }
.source-line[hidden] { display: none; }

/* ---------- v10: readability + accessibility (WCAG 2.2 AA) ----------
 * - Long text (prompts, answers, cards, clues, buttons) uses VT323: a pixel font
 *   that's far more legible in sentences than the wide Press Start 2P, which is
 *   kept for short headings/labels only.
 * - Lines are capped at ~40 characters (readable line length) and sit on a dark,
 *   near-opaque panel so text keeps ≥ 4.5:1 contrast over bright scenes.
 * - Touch targets ≥ 48px; visible keyboard focus; reduced motion respected. */
h1.prompt, h2.prompt, .vs-card, ol.answers, .chain-text, .clue-list .clue, .big-answer, .vote-btn, .hand-btn,
.cat-card div, .winner-line, .intro-rules, .mg-rule, .role {
  font-family: var(--body); letter-spacing: 0; font-weight: 400;
}
h1.prompt { line-height: 1.12; max-width: 40ch; text-shadow: 3px 3px 0 var(--edge), 0 0 18px rgba(0,0,0,0.6); }
body.host h1.prompt { align-self: stretch; width: 100%; margin-left: 0; margin-right: 0; text-align: center; max-width: none; } /* auto margins in a flex column shrink-wrap the box and break fit() */
body.host .phase-view.in-game { background: rgba(8, 6, 16, 0.84); }
body.host .vs-card { line-height: 1.15; }
body.host ol.answers { max-width: 60ch; }
.big-answer { line-height: 1.1; }
/* Phones: scalable text + bigger targets */
body.play { --phone-scale: 1; font-size: calc(clamp(20px, 5.4vw, 30px) * var(--phone-scale)); }
body.play h2.prompt { font-size: calc(clamp(24px, 7vw, 34px) * var(--phone-scale)); line-height: 1.15; }
body.play .vote-btn, body.play .hand-btn { font-size: calc(clamp(22px, 6.4vw, 32px) * var(--phone-scale)); min-height: 56px; }
body.play button, body.play input, body.play select { min-height: 48px; }
body.play .react-bar button { min-width: 48px; }
#text-size { font-family: var(--pixel); font-size: 12px; min-height: 40px; min-width: 40px; }
:focus-visible { outline: 3px solid var(--accent2) !important; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
/* Character maker */
.avatar-mode button { font-size: 9px; }
.avatar-make[hidden] { display: none; }
.maker { display: grid; gap: 10px; }
.maker-preview { width: 160px; height: 160px; margin: 0 auto; image-rendering: pixelated; background: var(--panel2); box-shadow: 0 0 0 4px var(--edge); }





.maker-random { background: var(--accent2); color: #14121f; }

/* ---------- v11: compact player strip (replaces the big sidebar) ----------
 * Lobby: a slim strip under the top bar,in normal flow — it wraps and pushes
 * content down as players join. In a game it's hidden,and flashes in as an
 * overlay for 5 s when someone joins,leaves or reconnects. */
body.host { grid-template-areas: "top" "side" "stage"; grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
body.host #sidebar { grid-area: side; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 12px; overflow: visible; opacity: 1; pointer-events: auto; }
body.host #player-list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; overflow: visible; }
body.host #player-list li { margin: 0; padding: 3px 8px; gap: 6px; }
body.host #player-list .pname { flex: none; font-size: max(18px, 2.4vh); }
body.host #player-list img.avatar { width: max(28px, 3.6vh); height: max(28px, 3.6vh); }
body.host .team-bar { margin: 0; flex: 0 0 auto; min-width: 180px; }
body.host.in-game #sidebar { display: none; }
body.host.in-game.sidebar-peek #sidebar { display: flex; position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 35; max-width: 92vw;
  background: rgba(36, 31, 61, 0.96); box-shadow: 0 0 0 4px var(--edge); animation: drop-in 0.3s steps(9) both; }

/* ---------- v12: character maker (preview + tabs + tiles + swatches) ---------- */
.maker { display: grid; gap: 10px; }
.maker-top { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; }
.maker-preview { width: 140px; height: 140px; }
.maker-actions { display: grid; gap: 8px; }
.maker-actions button { font-size: 10px; }
.maker-undo { background: var(--panel2); color: var(--ink); }
.maker-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: sticky; top: 52px; z-index: 5; background: var(--bg); padding: 4px 0; }
.maker-tab { background: var(--panel); color: var(--ink); font-size: 22px; padding: 6px 2px 9px; display: grid; justify-items: center; gap: 2px; font-family: var(--body); }
.maker-tab span { font-size: 16px; }
.maker-tab.on { background: var(--accent); color: #221a00; }
.maker-part h3 { font-family: var(--pixel); font-size: 11px; color: var(--dim); margin: 10px 0 6px; font-weight: 400; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.tile-opt { background: var(--panel); padding: 4px 4px 6px; display: grid; justify-items: center; gap: 2px; font-family: var(--body); color: var(--ink); }
.tile-opt img { width: 56px; height: 56px; image-rendering: pixelated; }
.tile-opt span { font-size: 16px; line-height: 1; }
.tile-opt.on { background: var(--accent2); color: #14121f; box-shadow: 0 0 0 3px var(--edge), 0 0 0 6px var(--accent2); }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-opt { width: 48px; height: 48px; padding: 0; box-shadow: 0 0 0 3px var(--edge); }
.swatch-opt.on { box-shadow: 0 0 0 3px var(--edge), 0 0 0 7px var(--accent2); }
/* The join form's full-width button rule must not apply to the character maker's controls. */
#join-form .maker button { width: auto; margin-top: 0; }
#join-form .maker .swatch-opt { width: 48px; height: 48px; }
#join-form .maker .maker-actions button, #join-form .maker .maker-tab { width: 100%; }

.preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.preset-opt { background: var(--panel); padding: 4px; }
.preset-opt img { width: 100%; height: auto; image-rendering: pixelated; display: block; }
#join-form .maker .preset-opt { width: 100%; }
/* ---------- highlights page ---------- */
.highlights-page #screen { max-width: 760px; margin: 0 auto; padding: 16px; }
.hl-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hl-tabs button.on { background: var(--accent); }
.hl-card { background: var(--panel); padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 0 0 4px var(--edge); }
.hl-prompt { color: var(--dim); margin: 0 0 6px; }
.hl-text { font-size: 1.4em; color: var(--accent2); margin: 4px 0; }
.hl-img { width: min(100%, 320px); background: #fff; display: block; margin: 6px 0; }
.hl-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { background: var(--panel2); padding: 4px 8px; box-shadow: 0 0 0 2px var(--edge); }
.hl-link { color: var(--accent); }
/* ---------- /admin ---------- */
.admin-page #screen { max-width: 820px; margin: 0 auto; padding: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.admin-grid label { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.admin-page textarea, .admin-page input:not([type]), .admin-page select { width: 100%; box-sizing: border-box; }
.admin-items { list-style: none; padding: 0; max-height: 50vh; overflow-y: auto; }
.admin-items li { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 2px solid var(--edge); }
.admin-items li.off span { opacity: 0.45; text-decoration: line-through; }
.admin-items button { font-size: 12px; padding: 6px 8px; min-height: 0; flex: none; }
#add-form { display: grid; gap: 8px; }

/* ---------- colour-blind friendly palette (Okabe–Ito): right = blue, wrong/danger = vermillion ---------- */
body.cb, body.cb[data-theme] { --accent2: #56b4e9; --danger: #d55e00; --accent: #e69f00; }
/* Team red/blue stay as they are: red vs blue reads clearly for red-green colour blindness. */
/* ---------- Rocco, the TV host ---------- */
#rocco { position: fixed; right: 2vw; bottom: 1.5vh; z-index: 40; display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
#rocco[hidden] { display: none; }
.rocco-img { width: max(64px, 11vh); height: max(64px, 11vh); image-rendering: pixelated; }
.rocco-bubble { max-width: min(46vw, 640px); background: var(--ink); color: var(--edge); font-size: max(22px, 3vh); padding: 10px 14px;
  box-shadow: 0 0 0 4px var(--edge); margin-bottom: 4vh; animation: pop-in 0.3s steps(9) both; }
.rocco-bubble[hidden] { display: none; }
.game-lang { font-family: var(--pixel); font-size: 10px; color: var(--dim); margin-left: 6px; }
/* ---------- Cottage Crush ---------- */
.crush-admirers { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4em 1.4em; justify-content: center; }
.crush-list { list-style: none; padding: 0; }
.crush-note { background: var(--panel); padding: 8px 10px; margin: 6px 0; box-shadow: 0 0 0 3px var(--edge); }
.crush-pairs li { animation: pop-in 0.4s steps(12) both; }
.crush-exposed { color: var(--accent); }
.crush-to { width: 100%; }
.crush-bonus { animation: pop-in 0.4s steps(12) both; color: var(--accent); }
.crush-side { background: var(--panel); padding: 8px 10px; margin: 8px 0; box-shadow: 0 0 0 3px var(--edge); }
.crush-heard { list-style: none; padding: 0; margin: 4px 0; }
.crush-pair { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }

/* ---------- Loon Call (rhythm) ---------- */
.lc-stage { display: flex; align-items: center; justify-content: center; gap: 4vh; margin: 2vh 0; }
.lc-lead { width: 22vh; image-rendering: pixelated; transition: transform 0.1s steps(3); }
.lc-lead.singing { transform: translateY(-1.6vh) scale(1.06); }
.lc-meter { min-width: 40vh; text-align: left; min-height: 19vh; } /* fixed height: it fills in every frame and must not resize the screen */
.lc-mode { display: block; font-family: 'Press Start 2P', monospace; font-size: 5vh; color: var(--accent); }
.lc-mode.lc-echo, .lc-mode.lc-clicks { color: #ffd23f; }
.lc-dots { display: block; font-size: 6vh; letter-spacing: 1vh; color: var(--accent2); }
.lc-choir { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.4vh; }
.lc-loon { display: flex; flex-direction: column; align-items: center; padding: 1vh; border-radius: 0; box-shadow: 0 0 0 4px transparent; }
.lc-loon.hit-perfect { box-shadow: 0 0 0 4px #ffd23f; }
.lc-loon.hit-good { box-shadow: 0 0 0 4px #4caf50; }
.lc-loon.hit-miss, .lc-loon.hit-extra { box-shadow: 0 0 0 4px #8e8fa3; }
.lc-loon.bob-a { animation: lc-bob-a 0.2s steps(6); }
.lc-loon.bob-b { animation: lc-bob-b 0.2s steps(6); }
@keyframes lc-bob-a { 50% { transform: translateY(-1.2vh); } }
@keyframes lc-bob-b { 50% { transform: translateY(-1.2vh); } }
.lc-name { font-size: 2.8vh; }
.lc-tag { font-family: 'Press Start 2P', monospace; font-size: 2vh; min-height: 2.4vh; color: var(--accent2); }
.lc-sync { color: #ffd23f; font-family: 'Press Start 2P', monospace; }
.lc-grade { margin-left: auto; padding: 0 1em; }
.lc-tap.go { background: #ffd23f; color: #1a1423; }
.lc-tap.hit { animation: lc-press 0.1s steps(3); }
@keyframes lc-press { 50% { transform: scale(0.96); } }

/* ---------- Lantern Lake (tilt) ---------- */
.ll-title { margin-bottom: 0.2em; }
.ll-lake { width: min(100%, 128vh); height: auto; aspect-ratio: 16 / 9; /* old TVs: height:auto keeps the canvas's own 16:9 */ image-rendering: pixelated; box-shadow: 0 0 0 6px var(--edge), 0 0 0 12px var(--panel); display: block; margin: 1vh auto; }
.ll-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 1vh 2.4vh; margin-top: 1vh; }
.ll-chip { display: inline-flex; align-items: center; gap: 0.4em; border-bottom: 0.6vh solid var(--c); font-size: 3vh; }
.ll-you { border-left: 8px solid var(--c); padding-left: 8px; }
.ll-arrow { display: inline-block; color: var(--accent); }
.ll-pad { position: relative; width: min(78vw, 46vh); aspect-ratio: 1; /* phone only */ margin: 12px auto; border-radius: 50%; background: radial-gradient(circle, var(--panel2) 0 60%, var(--panel) 61%); box-shadow: 0 0 0 4px var(--edge); touch-action: none; user-select: none; -webkit-user-select: none; }
.ll-knob { position: absolute; left: 35%; top: 35%; width: 30%; height: 30%; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--edge), 0 0 24px var(--c); pointer-events: none; }
.ll-modes { text-align: center; }

/* ---------- Storm Watch (strategy) — its own full-screen mode ---------- */
body.mode-storm { background: #06080f; }
body.mode-storm #phase-view { position: relative; box-shadow: inset 0 0 0 1.4vh #3b2716, inset 0 0 0 2.2vh #1f140b, inset 0 0 8vh rgba(0,0,0,0.8); }
body.mode-storm #phase-view::before { content: ''; position: absolute; top: 2.2vh; right: 2.2vh; bottom: 2.2vh; left: 2.2vh; pointer-events: none; background: linear-gradient(90deg, transparent calc(50% - 0.6vh), #3b2716 calc(50% - 0.6vh), #3b2716 calc(50% + 0.6vh), transparent calc(50% + 0.6vh)); opacity: 0.25; }
.storm-rain { width: 100%; height: 100%; image-rendering: pixelated; }
.storm-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; opacity: 0.85; pointer-events: none; }
.storm-board { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2vh; padding: 3vh 4vh; }
.storm-head { display: flex; align-items: center; gap: 3vh; flex-wrap: wrap; justify-content: center; }
.storm-chores { list-style: none; display: flex; gap: 1.2vh; padding: 0; margin: 0; }
.storm-chores li { width: 14vh; min-height: 11vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--panel); box-shadow: 0 0 0 4px var(--edge); padding: 0.8vh; font-size: 2.2vh; }
.storm-chores li.now { box-shadow: 0 0 0 4px #ffcf80; }
.storm-chores li.done { background: #1f4a2c; }
.storm-chores li.ruined { background: #5a1d24; }
.storm-mark { font-family: 'Press Start 2P', monospace; font-size: 3.4vh; }
.storm-meter span { font-size: 4.6vh; opacity: 0.25; }
.storm-meter span.on { opacity: 1; }
.storm-hidden { margin: 0; font-size: 3vh; color: var(--accent); }
.storm-mid { text-align: center; }
.storm-event { display: inline-flex; flex-direction: column; gap: 0.6vh; padding: 1.4vh 3vh; margin: 1vh 0; background: #2a2135; box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #6b4c8a; }
.storm-event b { font-family: 'Press Start 2P', monospace; font-size: 2.6vh; color: #ffcf80; }
.storm-crew { display: flex; justify-content: center; gap: 3vh; flex-wrap: wrap; }
.storm-crew figure { margin: 0; text-align: center; }
.storm-yes { color: #7ed957; }
.storm-no { color: #ff6b6b; }
.storm-votes { display: flex; justify-content: center; flex-wrap: wrap; gap: 1vh 3vh; font-size: 3.6vh; }
.storm-votes .yes { color: #7ed957; } .storm-votes .no { color: #ff6b6b; }
.storm-cards { display: flex; justify-content: center; gap: 2vh; perspective: 60vh; }
.storm-card { width: 20vh; height: 26vh; display: flex; align-items: center; justify-content: center; font-family: 'Press Start 2P', monospace; font-size: 2.2vh; box-shadow: 0 0 0 4px var(--edge); animation: storm-flip 0.6s steps(18) both; }
.storm-card.good { background: #2e6b3c; } .storm-card.bad { background: #8a2430; }
@keyframes storm-flip { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.storm-result { animation: pop-in 0.4s steps(12) both; }
.storm-roles { display: flex; flex-wrap: wrap; justify-content: center; gap: 2vh; }
.storm-role { display: flex; flex-direction: column; align-items: center; gap: 0.4vh; padding: 1.2vh 2vh; background: var(--panel); box-shadow: 0 0 0 4px var(--edge); animation: storm-flip 0.6s steps(18) both; font-size: 2.8vh; }
.storm-role.raccoon { background: #4a1d2a; box-shadow: 0 0 0 4px var(--edge), 0 0 0 8px #ff6b6b; }
.storm-transition { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; background: #05070d; animation: storm-in 0.9s steps(27) both; }
.storm-transition.out { animation: storm-out 0.6s steps(18) both; }
.storm-transition .storm-rain { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.storm-bolt { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #e8eeff; opacity: 0; animation: storm-bolt 0.4s steps(12) 0.9s both; }
.storm-title { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; font-family: 'Press Start 2P', monospace; font-size: 9vh; color: #e8eeff; text-shadow: 0.6vh 0.6vh 0 #2a3348; opacity: 0; animation: storm-title 1.2s steps(36) 1.1s both; }
@keyframes storm-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes storm-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes storm-bolt { 0% { opacity: 0; } 20% { opacity: 1; } 40% { opacity: 0.1; } 60% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes storm-title { from { opacity: 0; transform: scale(1.2); } to { opacity: 1; transform: none; } }
.storm-rolecard { display: block; width: 100%; min-height: 22vh; margin: 12px 0; padding: 14px; text-align: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.storm-rolecard .storm-secret { display: none; }
.storm-rolecard.peek .storm-cover { display: none; }
.storm-rolecard.peek .storm-secret { display: block; }
.storm-rolecard.peek.raccoon { background: #4a1d2a; }
.storm-secret b { display: block; font-size: 1.4em; margin-bottom: 6px; }
.storm-secret small { display: block; margin-top: 6px; }
.storm-peek { background: var(--panel); padding: 8px 10px; box-shadow: 0 0 0 3px #ffcf80; }
.storm-pick .vote-btn[aria-pressed="true"] { background: var(--accent); color: var(--edge); }
.storm-yesno { grid-template-columns: 1fr 1fr; }
.vote-btn.bad { background: #8a2430; }


/* ---------- game feel: a brief shake for big hits (0.3 s → steps(9)) ---------- */
#phase-view.shake { animation: screen-shake 0.3s steps(9); }
@keyframes screen-shake { 0%, 100% { transform: none; } 20% { transform: translate(-0.6vh, 0.3vh); } 40% { transform: translate(0.5vh, -0.4vh); } 60% { transform: translate(-0.4vh, -0.2vh); } 80% { transform: translate(0.3vh, 0.3vh); } }

/* ---- connection + loading cues (phone) ---- */
.conn-dot { width: 10px; height: 10px; flex: none; background: #f2c14e; box-shadow: 0 0 0 2px #0006; }
.conn-dot[data-state="ok"] { background: #5fd35f; }
.conn-dot[data-state="lost"] { background: var(--danger); animation: conn-blink 1s steps(30) infinite; }
@keyframes conn-blink { 50% { opacity: 0.25; } }
.leave-btn { white-space: nowrap; }
.keep-awake { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; top: 0; }
.spinner { width: 40px; height: 40px; margin: 12px auto; background:
  conic-gradient(var(--accent, #f2c14e) 0 25%, transparent 0 50%, var(--accent, #f2c14e) 0 75%, transparent 0);
  animation: spin 0.8s steps(24) infinite; image-rendering: pixelated; }
.spinner.small { display: inline-block; width: 16px; height: 16px; margin: 0 6px -3px 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card { text-align: center; padding: 24px 8px; }
body.sending #game-view [data-send]:disabled, body.sending #game-view button[type="submit"] { opacity: 0.6; }
body.sending .playbar::after { content: 'Sending…'; font-size: 14px; color: var(--accent2, #f2c14e); margin-left: 6px; }

/* ---- phone: no pinch/double-tap zoom, no text selection or long-press copy menu (they break taps) ---- */
body.play { touch-action: manipulation; overscroll-behavior: none; }
html:has(body.play) { touch-action: manipulation; overscroll-behavior: none; } /* phone only (own rule: an unknown :has() drops the whole rule) */
body.play { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.play img { -webkit-user-drag: none; pointer-events: none; }
body.play button img, body.play [data-send] img { pointer-events: none; }
body.play input, body.play textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.lobby-crew figure { position: relative; }
.lobby-crew figure.offline img { opacity: 0.45; filter: grayscale(1); }
.lobby-crew .lobby-kick { position: absolute; top: -6px; right: -10px; font-size: 14px; padding: 2px 5px; opacity: 0.55; }
.lobby-crew .lobby-kick:hover, .lobby-crew .lobby-kick:focus { opacity: 1; }
/* TV: in-game content scales down to fit the stage (host.js shrinkToStage) — never a scrollbar. */
body.host .phase-view.in-game > * { zoom: var(--shrink, 1); }
body.host.in-game #stage { overflow: hidden; }
.status-line { text-align: center; font-size: calc(18px * var(--phone-scale, 1)); padding: 4px 8px; background: #0008; color: #e8e3ff; }
.status-line[data-kind="turn"] { color: var(--accent2, #f2c14e); }
.status-line[hidden] { display: none; }
.tv-loading { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(10, 8, 20, 0.7); font-size: 4vh; color: #fff; }
.tv-loading[hidden] { display: none; }
.tv-loading .spinner { width: 9vh; height: 9vh; }
/* Campfire Consensus herd call */
.herd-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2vh 1.6vh; }
.herd-card { font-size: 4vh; padding: 0.8vh 2vh; background: var(--panel2, #2a2440); box-shadow: 0 0 0 4px var(--edge, #000); animation: pop-in 0.4s steps(12) both; }
.herd-pick .herd-opt.on { background: var(--accent, #f2c14e); color: #1a1423; }
.herd-pick .herd-opt.on::before { content: '🐑 '; }
.answers li.herd { outline: 4px solid var(--accent, #f2c14e); }
/* Browser build: saving the game for offline play (web/offline.js) */
.cf-offline { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(10, 8, 20, 0.92); color: #fff; }
.cf-offline[hidden], .cf-offline-corner[hidden] { display: none; }
.cf-offline-box { width: min(80vw, 640px); text-align: center; font-size: 22px; }
.cf-offline-title { font-family: 'Press Start 2P', monospace; font-size: 18px; }
.cf-offline-track { height: 22px; background: #2a2440; box-shadow: 0 0 0 4px #000; margin: 18px 0; }
.cf-offline-track i { display: block; height: 100%; width: 0; background: #f2c14e; }
.cf-offline-corner { position: fixed; left: 12px; bottom: 12px; z-index: 90; font-size: 18px; background: #000a; color: #fff; padding: 4px 10px; }
.haptic-switch { position: fixed; left: -100px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
/* Loon Call: the rhythm lane on the TV and the phone's own tap feedback */
.lc-lane { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 0.5vh; width: min(100%, 90vh); margin: 1.2vh auto 0; }
.lc-lane i { height: 2.6vh; background: #ffffff1a; }
.lc-lane i.beat { background: #ffffff33; }
.lc-lane i.note { background: var(--accent, #f2c14e); }
.lc-lane i.now { outline: 0.4vh solid #fff; }
.lc-fb { min-height: 1.6em; text-align: center; font-family: 'Press Start 2P', monospace; font-size: calc(16px * var(--phone-scale, 1)); margin: 10px 0 0; }
.lc-fb[data-hit="perfect"] { color: #7ed957; }
.lc-fb[data-hit="good"] { color: #ffd23f; }
.lc-fb[data-hit="miss"], .lc-fb[data-hit="extra"] { color: #ff6b6b; }
.lc-fb.pop { animation: pop-in 0.2s steps(6) both; }
.lc-tap[data-hit="perfect"].hit { box-shadow: 0 0 0 8px #7ed957; }
.lc-tap[data-hit="good"].hit { box-shadow: 0 0 0 8px #ffd23f; }
.lc-tap[data-hit="miss"].hit, .lc-tap[data-hit="extra"].hit { box-shadow: 0 0 0 8px #ff6b6b; }
/* Cottage Crush phone: roomy steps, tiles and fold-outs */
.crush-steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 10px; font-size: calc(15px * var(--phone-scale, 1)); }
.crush-steps li { flex: 1; text-align: center; padding: 6px 2px; background: #ffffff12; opacity: 0.6; }
.crush-steps li.on { background: var(--accent, #ff8fb3); color: #2a0f2f; opacity: 1; font-weight: bold; }
.crush-steps li.done { opacity: 0.85; }
.crush-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 10px 0; }
.crush-people.small { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.crush-person { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; font-size: calc(20px * var(--phone-scale, 1)); min-height: 120px; }
.crush-person span { overflow-wrap: anywhere; }
.crush-agenda, .crush-fold { background: var(--panel); margin: 10px 0; box-shadow: 0 0 0 3px var(--edge); }
.crush-agenda summary, .crush-fold summary { padding: 12px; cursor: pointer; font-size: calc(19px * var(--phone-scale, 1)); }
.crush-agenda > :not(summary), .crush-fold > :not(summary) { margin: 0 12px 12px; }
.crush-to-line { font-size: calc(22px * var(--phone-scale, 1)); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crush-card { font-size: calc(21px * var(--phone-scale, 1)); line-height: 1.25; padding: 14px; }

/* Cottage Olympics: the new minis */
.mg-canvas { display: block; width: 100%; touch-action: none; box-shadow: 0 0 0 4px var(--edge); image-rendering: pixelated; }
.mg-meter { height: 64px; margin: 12px 0; }
.mg-field { height: 56vh; }
.spot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4vh; max-width: 110vh; margin: 1vh auto; }
.spot-cell { position: relative; min-height: 14vh; aspect-ratio: 4 / 3; /* old TVs: min-height instead */ display: grid; place-items: center; background: #1e5f9e; box-shadow: 0 0 0 4px var(--edge); font-size: 8vh; }
.spot-cell b { position: absolute; left: 0.8vh; top: 0.4vh; font-family: var(--pixel); font-size: 2.6vh; }
.spot-cell img { width: 60%; image-rendering: pixelated; }
.spot-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.spot-btn { min-height: 64px; font-size: 26px; font-family: var(--pixel); }
.paddle-pad, .simon-pad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mg-big.paddle { min-height: 50vh; font-size: clamp(20px, 7vw, 40px); }
.simon-pad .mg-big.simon { min-height: 24vh; background: var(--c); color: #14121f; font-size: clamp(16px, 5vw, 28px); }
.simon-stage { position: relative; height: 40vh; width: 40vh; margin: 2vh auto; }
.simon-spark { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; background: var(--c); box-shadow: 0 0 0 6px var(--edge), 0 0 6vh var(--c); visibility: hidden; animation: simon-flash 0.6s steps(18); }
.simon-spark span { font-family: var(--pixel); font-size: 4vh; color: #14121f; }
@keyframes simon-flash { from { visibility: visible; } 90% { visibility: visible; } to { visibility: hidden; } }
/* Porch Confessions */
.tt-confess { font-family: var(--pixel); color: var(--accent); text-align: center; margin-bottom: 0; }
.tt-role { font-family: var(--pixel); text-align: center; padding: 10px; font-size: calc(15px * var(--phone-scale, 1)); }
.tt-role.lie, .tt-stamp.lie { background: #6b1f2a; color: #ffd6dc; }
.tt-role.true, .tt-stamp.true { background: #1f5a2e; color: #d8ffe0; }
.tt-wall { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(42vh, 1fr)); gap: 1vh 2vh; font-size: 3vh; }
.tt-wall li { background: var(--panel); padding: 1vh 1.4vh; box-shadow: 0 0 0 4px var(--edge); animation: pop-in 0.4s steps(12) both; }
.tt-card { text-align: center; }
.tt-by { font-size: 3.4vh; }
.tt-stamp { display: inline-block; font-family: var(--pixel); font-size: 4vh; padding: 1vh 3vh; animation: pop-in 0.4s steps(12) both 0.8s; }
.tt-calls { font-size: 3vh; }
.tt-judge { list-style: none; padding: 0; }
.tt-judge li { background: var(--panel); padding: 8px 10px; margin: 8px 0; box-shadow: 0 0 0 3px var(--edge); }
.tt-judge li p { margin: 0 0 6px; }
.tt-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tt-pick .vote-btn.on { outline: 4px solid var(--accent); }
.ll-status { text-align: center; font-family: var(--pixel); font-size: calc(14px * var(--phone-scale, 1)); padding: 8px; }
.ll-status.it { background: #6b1f2a; color: #ffd6dc; animation: conn-blink 1s steps(30) infinite; }
.ll-status.out { background: #17325a; color: #cfe6ff; }
/* In a game the timer bar floats over the top of the stage (it must not push the screen down). */
body.host.in-game #timerbar { position: absolute; top: 8px; left: 32px; right: 32px; margin: 0; z-index: 2; }
/* Big rooms (8+ players): long answer lists flow into two columns, doodles stay on one screen. */
@supports selector(:has(a)) { body.host .phase-view.in-game ol.answers:has(> li:nth-child(6)) { columns: 2; column-gap: 4vh; } }
@supports selector(:has(a)) { body.host .phase-view.in-game ol.answers:has(> li:nth-child(6)) > li { break-inside: avoid; } } /* old TVs: one column, shrinkToStage fits it */
body.host .doodle-grid { grid-template-columns: repeat(auto-fit, minmax(min(24vh, 220px), 1fr)); }
body.host .doodle-grid img { max-height: 27vh; object-fit: contain; }

.voice-status { opacity: .75; font-size: .7em; }


/* ---------- Game menu: one screen, never scrolls (TV lobby + "choose the next game") ----------
   Games fill a 5-column grid whose rows share the height that is left; the join card and the
   players sit in a column on the right; settings are one compact bar. Sizes follow the window
   height (vh) so it fits a 720p TV as well as a 4K one. */
body.host.picking #stage { overflow: hidden; padding: 1.6vh 1.4vw; }
body.host.picking #sidebar { display: none; }
body.host.picking #phase-view { height: 100%; }
.game-menu { display: grid; height: 100%; gap: 1.2vh 1.2vw; grid-template-columns: minmax(0, 1fr) clamp(220px, 23vw, 470px);
  grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top side" "games side" "settings side"; }
.lobby-top { grid-area: top; display: flex; align-items: center; gap: 0.6vh 2vw; flex-wrap: wrap; min-width: 0; }
.lobby-top h1 { margin: 0; font-size: clamp(16px, 4vh, 44px); line-height: 1.1; }
.game-menu .night-row { margin: 0; font-size: clamp(12px, 2vh, 22px); gap: 0.6vw; }
.game-menu .night-row button { font-size: clamp(8px, 1.3vh, 14px); padding: 0.7vh 0.8vw; }
.game-menu .game-grid { grid-area: games; margin: 0; min-height: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 1.1vh 0.7vw; }
.lobby button.game-pick { min-height: 0; min-width: 0; }
.game-menu .game-art { height: auto; flex: 0 0 50%; min-height: 0; border-bottom-width: 3px; overflow: hidden; }
.game-menu .game-art img { height: 82%; width: auto; max-width: 92%; object-fit: contain; }
.game-menu .game-text { flex: 1 1 0; min-height: 0; overflow: hidden; padding: 0.7vh 0.6vw 0.9vh; gap: 0.3vh; min-width: 0; }
.lobby button.game-pick .game-name { font-size: clamp(7px, 1.3vh, 14px); line-height: 1.35; }
.lobby button.game-pick .game-blurb { font-size: clamp(10px, 1.65vh, 19px); line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lobby button.game-pick .game-min { font-size: clamp(9px, 1.35vh, 16px); margin-top: auto; }
@media (max-height: 880px) { .lobby button.game-pick .game-blurb { -webkit-line-clamp: 1; } }
/* Right column: join card on top, the players underneath (room is kept clear for Rocco in the corner). */
.lobby-side { grid-area: side; display: flex; flex-direction: column; gap: 1.2vh; min-height: 0; min-width: 0; padding-bottom: 104px; }
.game-menu .join-card { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-start; gap: 1vw; padding: 1.2vh 0.8vw; }
.game-menu .qr-big { flex: 0 0 auto; width: clamp(88px, 16vh, 190px); height: clamp(88px, 16vh, 190px); padding: 0.5vh; }
.game-menu .join-text { gap: 0.2vh; min-width: 0; }
.game-menu .join-label { font-size: clamp(11px, 1.8vh, 20px); }
.game-menu .join-addr { font-size: clamp(11px, 1.9vh, 22px); overflow-wrap: anywhere; line-height: 1.1; }
.game-menu .join-code { font-size: clamp(18px, 3.4vh, 40px); letter-spacing: 0.08em; }
.game-menu .join-count { margin-top: 0.3vh; font-size: clamp(12px, 2vh, 22px); }
/* Players: 4 across; the rows share the height there is (never more than 13vh each), so 12 fit as well as 2. */
.game-menu .lobby-crew { flex: 1 1 0; min-height: 0; max-height: calc(var(--rows, 1) * 13.5vh); margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); gap: 0.8vh 0.4vw; overflow: hidden; }
.game-menu .lobby-crew figure { display: flex; flex-direction: column; align-items: center; min-height: 0; font-size: clamp(10px, 1.6vh, 19px); line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-menu .lobby-crew figure img { flex: 1 1 0; min-height: 0; width: auto; max-width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; margin: 0; } /* old TVs: the image's own square shape */
.game-menu .lobby-crew .lobby-kick { top: 0; right: 0; font-size: clamp(9px, 1.3vh, 14px); }
.game-menu .lobby-crew .hint { grid-column: 1 / -1; margin: 0; font-size: clamp(12px, 2vh, 22px); }
.game-menu .lobby-crew.teams { grid-template-columns: 1fr 1fr; }
.game-menu .lobby-crew.teams { grid-template-rows: minmax(0, 1fr); max-height: calc(var(--rows, 1) * 13.5vh + 4vh); }
.game-menu .lobby-crew.teams .team-col { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto repeat(var(--rows, 1), minmax(0, 1fr)); gap: 0.6vh 0.3vw; min-width: 0; min-height: 0; padding: 0.6vh 0.3vw; margin: 0; align-items: stretch; }
.game-menu .lobby-crew.teams .team-col b { grid-column: 1 / -1; font-size: clamp(10px, 1.6vh, 18px); }
.game-menu .settings { grid-area: settings; margin: 0; gap: 0.5vh 1vw; font-size: clamp(11px, 1.6vh, 18px); padding-left: 0; }
.game-menu .settings label { gap: 0.4vw; }
.game-menu .settings select { font-size: inherit; padding: 0.2vh 0.3vw; min-height: 0; }
.game-menu .settings .toggle input { width: clamp(14px, 2vh, 22px); height: clamp(14px, 2vh, 22px); }
.game-menu .settings .link-btn, .game-menu .settings .bot-tools button { font-size: inherit; padding: 0.2vh 0.5vw; min-height: 0; }
.next-row { text-align: center; margin: 2vh 0 0; }
.next-game-btn { font-size: clamp(12px, 2.2vh, 22px); padding: 1.4vh 2vw; }
/* TV remote (host.js): the focused control gets a thick pixel ring you can see from the couch. */
body.kbd :focus, body.kbd :focus-visible { outline: 6px solid var(--accent) !important; outline-offset: 4px; box-shadow: 0 0 0 14px rgba(255, 176, 46, 0.25); }
/* 10-foot rule: secondary TV text ≥ 2.6vh / 28 px. The round tag and category banner were 17 px and
   13 px (Cottage Lab scorecard, feel-plan.md). */
/* The stage zoom (host.js shrinkToStage, --shrink) must not push these labels under 28 px: they grow by
   1/zoom, and the zoom search counts that in. */
/* --unzoom is the stage zoom only while it applies (in a game); on gameover and the lobby it's 1. */
body.host .phase-view { --unzoom: 1; }
body.host .phase-view.in-game { --unzoom: var(--shrink, 1); }
body.host .round-tag, body.host .cat-banner, body.host .vs-meta, body.host .next-game-btn, body.host .bar-n,
body.host .doodle-grid figcaption, body.host .byline, body.host .storm-chores li, body.host .storm-card { font-size: calc(max(28px, 2.6vh) / var(--unzoom)); }
body.host .count, body.host .lc-name { font-size: calc(max(28px, 2.8vh) / var(--unzoom)); }
body.host .ll-chip { font-size: calc(max(28px, 3vh) / var(--unzoom)); }
body.host ul.scored-list { font-size: calc(max(28px, 3.2vh) / var(--unzoom)); }
body.host .cat-banner { padding: 0.8vh 1.4vh; }
body.host .storm-chores li { width: 20vh; }
body.host .storm-card { width: 24vh; }
body.host .cat-card div { font-size: max(28px, 2.6vh); }
body.host .podium .pts { font-size: max(28px, 2.6vh); }
body.host .phase-view .hint { font-size: max(28px, 2.6vh); }
.start-spicy { margin-top: 1.4vh; font-size: max(28px, 2.6vh); color: var(--danger); }
.rate-row { display: flex; gap: 12px; justify-content: center; margin: 8px 0 14px; }
.rate-row .vote-btn { font-size: 34px; min-width: 72px; min-height: 64px; }
.shy-btn[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--accent2); }
/* 🕊 Calm (TV setting): no lightning flash, no shaking; transitions stay as gentle fades. */
body.calm .storm-bolt, body.calm canvas.confetti { display: none; }
body.calm .shake { animation: none !important; }
/* TV remote: "press BACK again to leave" (host.js). */
.remote-toast { position: fixed; left: 50%; bottom: 6vh; transform: translateX(-50%); z-index: 120; background: var(--panel); color: var(--ink); font-family: var(--pixel); font-size: max(28px, 2.6vh); padding: 2vh 3vh; box-shadow: 0 0 0 6px var(--edge), 0 0 0 10px var(--accent); }
/* Phones: everything you tap is ≥ 48 px (Material 48 dp, Apple 44 pt; Cottage Lab checks it). A checkbox
   is tapped through its whole label row. */
body.play #game-view button, body.play #game-view select { min-height: 48px; }
body.play .swatch { width: 48px; height: 48px; }
body.play #game-view .toggle { min-height: 48px; }
body.play #game-view .toggle input { width: 28px; height: 28px; }
/* A long results list (6+ players) uses the TV's width instead of zooming everything under 28 px. */
body.host ol.answers.two-col { columns: 2; column-gap: 4vw; }
body.host ol.answers.two-col li { break-inside: avoid; }
