/* Game screens for the TV (tv.html) and phones (play.html, pass.html, daily.html). Builds on base.css tokens.
   One job per screen: the word tiles are the centre of attention, one gold button is the next step, and
   everything else is quiet (flat panels, short labels, drawn icons). */

[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dot { width: 0.75em; height: 0.75em; border-radius: 50%; display: inline-block; flex-shrink: 0; }
/* Supporter badge (PLAN.md section 8): only shown when the supporterPass switch is on. */
.supporter { color: var(--accent-ink); font-size: 0.85em; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 16px; box-shadow: 0 4px 0 var(--gold-edge); }
.btn.ghost.small { box-shadow: none; }
.btn.danger { background: var(--bad); box-shadow: 0 4px 0 var(--bad-edge); color: var(--on-accent); }
.btn.wide { width: 100%; }
.message { min-height: 1.5em; margin: 0; font-weight: 700; }
.message:empty { min-height: 0; }
.message.bad { color: var(--bad); }
.message.good { color: var(--good); }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); border: 0;
  background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 800; }
.icon-btn:hover { background: var(--panel-hi); }
.icon-btn .icon { width: 22px; height: 22px; }

/* Word tiles */
.word { display: flex; gap: 0.18em; justify-content: center; flex-wrap: nowrap; }
.word .tile { width: 1.15em; height: 1.32em; font-size: inherit; border-radius: 0.16em; box-shadow: 0 0.09em 0 var(--tile-edge); }
.word .tile.changed { box-shadow: 0 0.09em 0 var(--gold-edge); text-decoration-thickness: 0.06em; text-underline-offset: 0.1em; }
.word .tile.flip { animation: tile-in 0.3s ease-out; }
@keyframes tile-in { from { transform: rotateX(80deg); } to { transform: none; } }

/* Timer */
.timer { height: 10px; border-radius: 5px; background: var(--panel); overflow: hidden; }
.timer > div { height: 100%; background: var(--gold); border-radius: 5px; transform-origin: left; transition: transform 0.1s linear; }
.timer > div.low { background: var(--bad); }
.timer-row { display: flex; align-items: center; gap: 12px; }
.timer-row .timer { flex-grow: 1; }
.timer-text { font-family: var(--display); font-weight: 800; min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }

/* Players */
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.player { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--player); transition: background 0.2s; }
.player.on { background: var(--panel-hi); box-shadow: inset 4px 0 0 var(--ring); }
.player.out, .player.away { opacity: 0.5; }
.player .name { flex-grow: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.player .name small { color: var(--muted); font-weight: 400; }
.player .score { font-family: var(--display); font-weight: 800; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.hearts { display: inline-flex; gap: 2px; color: var(--bad); white-space: nowrap; }
.hearts .icon { width: 1em; height: 1em; vertical-align: 0; }
.hearts .lost { color: var(--heart-lost); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 999px; padding: 8px 16px 8px 12px; font-weight: 700; }
.chip small { color: var(--muted); font-weight: 400; }
.chip.empty { background: none; box-shadow: inset 0 0 0 2px var(--panel-hi); color: var(--muted); font-weight: 400; }

/* Chain */
.chain { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; color: var(--muted); letter-spacing: 0.06em; font-weight: 700; }
.chain li + li::before { content: ""; display: inline-block; width: 0.5em; height: 2px; background: var(--line); vertical-align: 0.3em; margin-right: 8px; border-radius: 1px; }
.chain .now { color: var(--accent-ink); }
.chain .start { color: var(--muted); }
.badge { font-size: 0.7em; letter-spacing: 0.05em; background: var(--gold); color: var(--on-accent); border-radius: 6px; padding: 1px 6px; vertical-align: middle; }

/* Meaning */
.meaning { background: var(--panel); border-radius: var(--radius); padding: 14px 18px; }
.meaning h3 { margin: 0 0 4px; font-size: 1.1em; letter-spacing: 0.04em; }
.meaning h3 small { font-family: var(--body); font-weight: 400; color: var(--muted); font-size: 0.75em; letter-spacing: 0; }
.meaning p { margin: 0; }
.meaning .credit { margin-top: 6px; font-size: 0.75em; color: var(--muted); }

/* Judges */
.vote-card { background: var(--panel); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: inset 0 3px 0 var(--ring); }
.vote-card p { margin: 0; }
.vote-card .vote-q { font-family: var(--display); font-weight: 800; font-size: 1.2em; }
.vote-card .chip { letter-spacing: 0.06em; background: var(--panel-hi); }
.phone .ballot { background: var(--panel); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 3px 0 var(--ring); }
.phone .ballot p { margin: 0; }
.ballot-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ballot-words .btn { letter-spacing: 0.08em; }
.ballot-words small { font-family: var(--body); font-weight: 400; letter-spacing: 0; }

/* Results */
.winner { display: flex; align-items: center; gap: 12px; }
.winner .icon { width: 1em; height: 1em; color: var(--gold); flex-shrink: 0; }
.scores { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scores th { text-align: left; font-weight: 400; color: var(--muted); font-size: 0.85em; padding: 6px 8px; }
.scores td { padding: 12px 8px; border-top: 1px solid var(--panel-hi); }
.scores td:first-child { font-weight: 700; }
.scores td:not(:first-child), .scores th:not(:first-child) { text-align: right; }
.scores .dot { margin-right: 10px; vertical-align: -0.05em; }
.scores .won { color: var(--accent-ink); font-size: 0.8em; font-weight: 700; margin-left: 8px; }
.scores tr.me td { color: var(--accent-ink); }
.awards { display: grid; gap: 8px; }
.award { background: var(--panel); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.award .t { font-size: 0.85em; font-weight: 700; color: var(--accent-ink); }
.award .w { font-size: 1.3em; font-weight: 700; }

/* Big moments ("Dead end!", "Out!", "Paused") */
.moment { position: fixed; inset: 0; display: grid; place-items: center; background: var(--overlay); z-index: 20; text-align: center; padding: 16px; }
.moment div { animation: pop 0.35s ease-out; }
.moment strong { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(48px, 10vw, 140px); color: var(--accent-ink); line-height: 1; letter-spacing: -0.02em; }
.moment span { display: block; margin-top: 12px; font-size: clamp(20px, 3vw, 40px); }
.moment .btn { margin-top: 24px; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* The mascot in the game (public/js/mascot.js, buddy() in shared.js): waving in the TV lobby, cheering
   for a winner, shocked at a dead end, sad when someone's out, hopping when it's your turn. Sized by
   the text around him (1.3em tall). Still with reduced motion (base.css). */
.buddy { display: inline-block; width: calc(1.3em * 100 / 140); height: 1.3em; color: var(--ink); flex-shrink: 0; }
.buddy svg { display: block; width: 100%; height: 100%; overflow: visible; }
.buddy :is(.m-arm-l, .m-arm-r, .m-body, .m-head) { transform-box: view-box; transition: transform 0.25s ease-out; }
.buddy :is(.m-arm-l, .m-arm-r) { transform-origin: 50px 70px; }
.buddy .m-head { transform-origin: 50px 58px; }
.buddy.wave .m-arm-r { animation: buddy-wave 0.8s ease-in-out infinite alternate; }
@keyframes buddy-wave { from { transform: rotate(-50deg); } to { transform: rotate(-78deg); } }
.buddy.cheer .m-arm-l { transform: rotate(74deg); }
.buddy.cheer .m-arm-r { transform: rotate(-74deg); }
.buddy.cheer .m-body { animation: buddy-hop 0.7s ease-in-out infinite; }
@keyframes buddy-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-9%); } }
.buddy.shock .m-arm-l { transform: rotate(40deg); }
.buddy.shock .m-arm-r { transform: rotate(-40deg); }
.buddy.shock .m-body { animation: buddy-jolt 0.45s ease-out; }
@keyframes buddy-jolt { 0% { transform: none; } 35% { transform: translateY(-12%); } 100% { transform: none; } }
.buddy.sad .m-arm-l { transform: rotate(-18deg); }
.buddy.sad .m-arm-r { transform: rotate(18deg); }
.buddy.sad .m-head { transform: rotate(10deg) translateY(4px); }
.buddy.turn .m-arm-r { transform: rotate(-74deg); }
.buddy.turn .m-body { animation: buddy-jolt 0.5s ease-out 2; }
.moment .buddy { font-size: clamp(60px, 9vw, 150px); margin-bottom: 8px; }

/* Reactions float up from the bottom: a name and a word ("Nice!", "Haha", "Whoa!") */
.reactions { position: fixed; right: 3vw; bottom: 12vh; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 10; pointer-events: none; }
.reaction { background: var(--panel-hi); border-radius: 999px; padding: 8px 18px 8px 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; animation: float 3s ease-out forwards; }
.reaction b { font-family: var(--display); font-size: 1.3em; color: var(--accent-ink); }
@keyframes float { 0% { transform: translateY(20px); opacity: 0; } 10%, 75% { transform: none; opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }

/* Choices as one-tap segments (level, word list, theme). The radio buttons stay for keyboards and screen readers. */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--panel); }
.seg label { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; min-height: 48px; padding: 6px 2px;
  border-radius: var(--radius-sm); text-align: center; cursor: pointer; font-weight: 700; font-size: 0.88em; line-height: 1.2; }
.seg b { white-space: nowrap; }
.seg label:hover { background: var(--panel-hi); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--gold); color: var(--on-accent); }
.seg label:has(input:checked) small { color: var(--on-accent); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg label > span { display: flex; flex-direction: column; align-items: center; }
.seg small { display: none; color: var(--muted); font-weight: 400; font-size: 0.85em; }
.seg.detail small { display: block; }
.seg-note { margin: -2px 0 0; color: var(--muted); font-size: 0.9em; }
.feedback { gap: 22px; }
.feedback fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.feedback legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
/* Themes: a colour swatch over each name. */
.seg.swatches label { min-height: 72px; gap: 6px; font-size: 0.82em; }
.swatch { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; background: var(--ground); box-shadow: inset 0 0 0 7px var(--panel-hi), 0 0 0 1px var(--line); }
.seg.swatches label:has(input:checked) .swatch { box-shadow: inset 0 0 0 7px var(--panel-hi), 0 0 0 2px var(--on-accent); }
.tv .swatch { display: none; }

/* ---------- TV ---------- */
body.tv { font-size: clamp(16px, 1.55vw, 30px); overflow-x: hidden; }
.tv .screen { min-height: 100dvh; padding: 3vh 3.5vw; display: flex; flex-direction: column; gap: 3vh; }
.tv .top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tv .logo { font-size: 1.2em; }
.tv .pill { background: var(--panel); border-radius: 10px; padding: 6px 14px; }
.tv .pill b { letter-spacing: 0.12em; }
.tv .lobby-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4vw; align-items: center; flex-grow: 1; }
.tv .join-box { display: flex; flex-direction: column; gap: 2.2vh; }
.tv .join-box h1 { font-size: 2.6em; }
.tv .join-title { display: flex; align-items: flex-end; gap: 0.5em; }
.tv .join-title .buddy { font-size: 3.4em; margin-bottom: -0.05em; }
.tv .join-step { margin: 0; color: var(--muted); font-size: 1.1em; }
.tv .qr { background: var(--tile); border-radius: 24px; padding: 18px; width: min(38vh, 80vw); aspect-ratio: 1; }
.tv .qr svg { width: 100%; height: 100%; display: block; }
.tv .join-url { font-size: 1.6em; font-weight: 700; overflow-wrap: anywhere; color: var(--ink); }
.tv .code { font-size: clamp(40px, 6.5vw, 110px); justify-content: flex-start; }
.tv .code .tile { background: var(--gold); box-shadow: 0 0.09em 0 var(--gold-edge); }
.tv .rules-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 3vw; color: var(--chain); flex-wrap: wrap; }
.tv .rules-strip li { display: flex; align-items: center; gap: 0.6em; }
.tv .rules-strip b { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--panel-hi); color: var(--accent-ink); font-family: var(--display); }
.tv .lobby-foot { display: flex; flex-direction: column; gap: 1.6vh; padding-top: 2vh; border-top: 1px solid var(--panel-hi); }
.tv .lobby-foot .chip { font-size: 1.1em; }
.tv .settings { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; }
.tv .settings label { color: var(--muted); }
.tv select { font: inherit; font-weight: 700; background: var(--panel); color: var(--ink); border: 0; border-radius: 10px; padding: 8px 12px; }
.tv .game-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 30%); gap: 3vw; flex-grow: 1; }
.tv .board { display: flex; flex-direction: column; justify-content: center; gap: 3vh; min-width: 0; }
.tv .turn-label { font-size: 2em; font-weight: 800; font-family: var(--display); text-align: center; margin: 0; display: flex; align-items: center; justify-content: center; gap: 0.4em; }
.tv .board .word { font-size: clamp(48px, 7.5vw, 150px); }
.tv .timer { height: 14px; }
.tv .next-label { text-align: center; color: var(--muted); margin: -2vh 0 0; }
.tv .phone-note { display: flex; align-items: center; justify-content: center; gap: 0.5em; color: var(--muted); margin: 0; font-size: 0.85em; }
.tv .predict-tally { text-align: center; color: var(--muted); margin: 0; min-height: 1.5em; }
.tv .side { display: flex; flex-direction: column; gap: 2vh; min-width: 0; }
.tv .chain-row { border-top: 1px solid var(--panel-hi); padding-top: 2vh; }
.tv .over-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3vw; align-items: start; }
.tv h1 { font-size: 3em; margin: 0; }
@media (max-width: 800px) {
  .tv .game-main, .tv .over-main, .tv .lobby-main { grid-template-columns: 1fr; }
}

/* ---------- Phone ---------- */
body.phone { font-size: 17px; }
html.large body.phone { font-size: 21px; }
.phone .screen { max-width: 480px; margin: 0 auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 18px; }
.phone header { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; }
.phone header .row { gap: 8px; flex-wrap: nowrap; }
.phone .logo { font-size: 19px; }
.phone h1 { font-size: 2em; margin: 0; }
.phone h2 { font-size: 1.35em; margin: 0; }
.phone .lead { margin: -8px 0 0; color: var(--chain); }
.phone label.field-label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.phone input[type="text"], .phone textarea { font: inherit; width: 100%; min-height: 56px; border-radius: var(--radius); border: 2px solid var(--panel-hi); background: var(--panel); color: var(--ink); padding: 0 16px; }
.phone textarea { min-height: 88px; padding: 12px 16px; }
.phone input[type="text"]:focus { border-color: var(--ring); outline: none; }
.phone input::placeholder { color: var(--muted); opacity: 0.7; }
.phone input.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--display); font-weight: 800; font-size: 1.6em; text-align: center; }
.phone .alt { margin: 0; color: var(--muted); text-align: center; }
.phone .fine { margin: 0; color: var(--muted); font-size: 0.85em; text-align: center; }
.phone .board .word { font-size: clamp(34px, 12vw, 60px); }
.phone .turn { display: flex; flex-direction: column; gap: 2px; }
.phone .turn-banner { text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.5em; margin: 0; }
.phone .turn-banner.mine { color: var(--accent-ink); font-size: 2em; }
.phone .turn-banner { display: flex; justify-content: center; align-items: flex-end; gap: 0.3em; }
.handoff .buddy { font-size: 56px; }
.winner .buddy { font-size: 1em; }
.phone .turn-sub { text-align: center; margin: 0; color: var(--muted); font-weight: 700; min-height: 1.5em; }
.phone .turn-sub.soon { color: var(--accent-ink); }
.phone .move-help { margin: 0; text-align: center; color: var(--chain); }
/* Your turn: a gold frame around the whole screen, so it's obvious at a glance from across the table. */
body.phone.my-turn::after { content: ""; position: fixed; inset: 0; border: 6px solid var(--ring); pointer-events: none; z-index: 25; animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { from { border-color: var(--ring); } to { border-color: var(--gold-edge); } }

/* Room code tiles in the phone lobby */
.phone .code-tiles { font-size: 44px; justify-content: center; }
.phone .code-tiles .tile { background: var(--gold); box-shadow: 0 0.09em 0 var(--gold-edge); }
.phone .room-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px 0 4px; }
.phone .room-head p { margin: 0; }

/* Share buttons */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { flex: 1 1 auto; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 0; background: var(--panel);
  color: var(--ink); font: 700 15px var(--body); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.share-btn:hover { background: var(--panel-hi); }
.share-url { flex-basis: 100%; font: inherit; min-height: 44px; border-radius: var(--radius-sm); border: 2px solid var(--ring); background: var(--panel); color: var(--ink); padding: 0 12px; }

/* Daily Word */
.daily-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-top .hearts { font-size: 1.3em; }
.daily-score { font-variant-numeric: tabular-nums; color: var(--chain); }
.daily-score b { font-family: var(--display); color: var(--ink); font-size: 1.15em; }
.phone .challenge { box-shadow: inset 0 3px 0 var(--ring); }
/* The result as a row of small squares, one per turn (the same colours as the share text). */
.marks { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.mark { width: 22px; height: 22px; border-radius: 5px; background: var(--good); }
.mark.f { background: var(--gold); }
.mark.d { background: var(--info); }
.mark.s { background: var(--tile); }
.mark.l { background: var(--panel-hi); box-shadow: inset 0 0 0 2px var(--line); }
.mark.o { background: var(--bad); }
.mark.more { width: auto; background: none; color: var(--muted); font-size: 0.8em; line-height: 22px; }
.marks-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.8em; }
.marks-key li { display: flex; align-items: center; gap: 6px; }
.marks-key .mark { width: 12px; height: 12px; border-radius: 3px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat-row div { background: var(--panel); border-radius: var(--radius-sm); padding: 10px 6px; display: flex; flex-direction: column; }
.stat-row b { font-family: var(--display); font-size: 1.7em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-row span { color: var(--muted); font-size: 0.8em; }
/* Today's board on the Daily intro: how many played and how they did. */
.board-card { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border-radius: var(--radius); padding: 16px 18px; }
/* How you did against everyone today: a line, a bar chart of everyone's words (yours in gold), facts */
.standing { background: var(--panel); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; }
.standing p { margin: 0; }
.standing-line { font-family: var(--display); font-weight: 800; font-size: 1.35em; line-height: 1.15; }
.standing-line b { color: var(--accent-ink); }
.standing-chart { display: flex; align-items: flex-end; gap: 4px; height: 96px; }
.standing-chart .bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.standing-chart i { display: block; width: 100%; height: calc(var(--h) * 58px); min-height: 3px; border-radius: 4px 4px 0 0; background: var(--line); }
.standing-chart .you i { background: var(--gold); }
.standing-chart b { font-size: 0.75em; color: var(--accent-ink); }
.standing-chart span { font-size: 0.7em; color: var(--muted); white-space: nowrap; }
.standing-axis, .standing-facts { font-size: 0.85em; }
/* Friend groups on the Daily Word: a join card from an invite link, one line per group on the start
   screen, and each group's board for today on the result screen (public/js/groups.js). */
.join-group { background: var(--panel); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 3px 0 var(--ring); }
.join-group-title { margin: 0; font-size: 1.1em; }
.group-lines { display: flex; flex-direction: column; gap: 6px; }
.group-lines p { margin: 0; color: var(--chain); }
.groups { display: flex; flex-direction: column; gap: 12px; }
.groups h2 { font-size: 1.25em; margin: 8px 0 0; }
.groups > p { margin: 0; }
.group { background: var(--panel); border-radius: var(--radius); padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 8px; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.group-head > span { display: flex; flex-direction: column; min-width: 0; }
.group-head b { font-family: var(--display); font-size: 1.15em; overflow-wrap: anywhere; }
.group-head small { color: var(--muted); }
.group-head .icon-btn { background: var(--panel-hi); color: var(--accent-ink); }
.group-board { list-style: none; margin: 0; padding: 0; }
.group-board li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--panel-hi); font-variant-numeric: tabular-nums; }
.group-board .rank { font-family: var(--display); font-weight: 800; color: var(--muted); }
.group-board li:first-child .rank { color: var(--accent-ink); }
.group-board .who { font-weight: 700; overflow-wrap: anywhere; }
.group-board .who small { color: var(--muted); font-weight: 400; }
.group-board .got { color: var(--chain); white-space: nowrap; }
.group-board .got b { font-family: var(--display); color: var(--ink); }
.group-board li.you .who { color: var(--accent-ink); }
.group-board li.waiting .who { color: var(--muted); font-weight: 400; }
.group .link-btn { align-self: flex-start; font-size: 14px; padding: 6px 0 8px; }
.group-form { background: var(--panel); border-radius: var(--radius); padding: 16px; }
.next-daily { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--muted); }
.phone textarea.share-text { font: inherit; width: 100%; border-radius: var(--radius); border: 2px solid var(--panel-hi); background: var(--panel); color: var(--ink); padding: 12px 16px; resize: none; }

/* Short rules (Daily intro, lobbies): one line each, with a mini tile or number. */
.howto { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: step; }
.howto li { display: flex; gap: 12px; align-items: baseline; color: var(--chain); counter-increment: step; }
.howto li::before { content: counter(step); flex-shrink: 0; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--panel-hi); color: var(--accent-ink); font: 800 14px var(--display); transform: translateY(-1px); }
.phone details.rules-more > summary { list-style: none; cursor: pointer; font-weight: 700; color: var(--muted); padding: 6px 0; }
.phone details.rules-more > summary::-webkit-details-marker { display: none; }
.phone details.rules-more > summary::after { content: " +"; }
.phone details.rules-more[open] > summary::after { content: " –"; }
.phone details.rules-more[open] > summary { margin-bottom: 10px; }

/* Pass-and-Play */
.name-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.name-list li { display: flex; gap: 8px; align-items: center; }
.name-list .icon-btn { min-height: 56px; min-width: 56px; }
.handoff { background: var(--panel); border-radius: 24px; padding: 32px 20px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; box-shadow: inset 0 4px 0 var(--ring); }
.handoff h1 { font-size: 2.6em; display: flex; align-items: center; gap: 12px; overflow-wrap: anywhere; }
.handoff p { margin: 0; }

/* Your turn: word box and power-ups */
.phone .move-form { display: flex; gap: 10px; }
.phone .move-form input { text-transform: uppercase; letter-spacing: 0.15em; font-family: var(--display); font-weight: 800; font-size: 1.4em; }
.phone .move-form input::placeholder { text-transform: none; letter-spacing: 0; font: 400 0.75em var(--body); }
.phone .powerups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pu { min-height: 72px; border-radius: var(--radius-sm); border: 0; background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px; text-align: center; cursor: pointer; line-height: 1.15; }
.pu:hover:not(:disabled) { background: var(--panel-hi); }
.pu .icon { width: 22px; height: 22px; color: var(--accent-ink); }
.pu b { font-size: 0.92em; }
.pu span { font-size: 0.72em; color: var(--muted); }
.pu[aria-pressed="true"] { background: var(--panel-hi); box-shadow: inset 0 0 0 2px var(--ring); }
.pu.confirm { box-shadow: inset 0 0 0 2px var(--bad); }

/* Someone else's turn: predict, react */
.phone .predict { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phone .predict-box { background: var(--panel); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.phone .predict-box p { margin: 0; font-weight: 700; }
.phone .react { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.phone .react button { min-height: 48px; border-radius: 999px; border: 0; background: var(--panel); cursor: pointer; font: 800 17px var(--display); color: var(--ink); }
.phone .react button:hover { background: var(--panel-hi); }
.phone .react button:active { transform: scale(0.96); }
.phone .notice { background: var(--panel); border-radius: var(--radius); padding: 12px 16px; margin: 0; }
.phone .player-admin { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.phone .player-admin li { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: var(--radius-sm); padding: 8px 8px 8px 14px; }
.phone .player-admin li span.n { flex-grow: 1; font-weight: 700; overflow-wrap: anywhere; }
.phone details > summary { cursor: pointer; font-weight: 700; padding: 6px 0; color: var(--muted); }
.phone .section { display: flex; flex-direction: column; gap: 8px; }
/* Notes filled in by the scripts take no space while they're empty. */
.phone .screen > p.muted:empty, .phone .screen > p.notice:empty { display: none; }

/* Reading options: the "Aa" menu (public/js/reading.js). */
.reading { position: relative; display: inline-flex; }
.reading-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 250px; display: flex; flex-direction: column; gap: 4px;
  padding: 8px; border-radius: var(--radius); background: var(--panel-hi); box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgb(0 0 0 / 0.4); }
.reading-menu label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.reading-menu label:hover { background: var(--panel); }
.reading-menu input, .tv-check input, .footer-check input { width: 20px; height: 20px; accent-color: var(--gold); }
.tv-check { display: inline-flex; align-items: center; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  .moment div, .reaction, body.phone.my-turn::after, .word .tile.flip { animation: none; }
  .timer > div { transition: none; }
}

/* Shown on phones while the connection is down; Socket.IO reconnects and the phone rejoins by itself. */
body.offline::before { content: "Reconnecting…"; position: fixed; inset: 0 0 auto 0; background: var(--bad); color: var(--on-accent); text-align: center; padding: 6px; font-weight: 700; z-index: 30; }
