/* Self-hosted (SIL Open Font License) so the game looks right offline. */
@font-face { font-family: 'Marcellus'; src: url('../fonts/marcellus.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/jost-300.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/jost-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/jost-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/jost-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  /* Linen walls, plaster arches, forest-green doors. */
  --bg: #F3EDE3;
  --bg-2: #EAE1D3;
  --card: #FBF8F2;
  --card-2: #F6F0E6;
  --sunk: #EEE6D9;
  --line: rgba(74, 56, 36, 0.10);
  --line-2: rgba(74, 56, 36, 0.18);
  --text: #2B2622;
  --muted: #7B7064;
  --dim: #A69B8E;
  --green: #2F4B35;
  --green-2: #3D5C43;
  --green-ink: #F5F0E6;
  --sage: #8DA37F;
  --gold: #C99A2E;
  --sun: #E3B23C;
  --clay: #D9663A;
  --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 12px 28px -18px rgba(84, 62, 38, .45), 0 2px 6px -3px rgba(84, 62, 38, .12);
  --shadow-lg: 0 24px 50px -26px rgba(84, 62, 38, .55), 0 4px 12px -6px rgba(84, 62, 38, .15);
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 12px;
  --serif: 'Marcellus', 'Cormorant Garamond', Georgia, serif;
  --body: 'Jost', 'Avenir Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg); }
body {
  font-family: var(--body); color: var(--text); font-size: 16px; font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

#app {
  position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(90vmax 60vmax at 80% -10%, #FAF4EA, transparent 60%), var(--bg);
}

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0; display: none; flex-direction: column;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 18px) calc(var(--safe-b) + 18px) calc(var(--safe-l) + 18px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.screen.on { display: flex; animation: enter .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.center-col { margin: auto; width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 7vw, 36px); line-height: 1.1; letter-spacing: .02em; }
h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sub { margin: 8px 0 18px; color: var(--muted); font-size: 15px; line-height: 1.5; font-weight: 400; }
.sub.center { text-align: center; margin-top: -6px; }
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; border-radius: 16px;
  font-weight: 500; font-size: 17px; letter-spacing: .02em;
  background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn.big { min-height: 62px; font-size: 18px; width: 100%; max-width: 420px; }
.btn.primary { background: var(--green); border-color: transparent; color: var(--green-ink); box-shadow: 0 14px 28px -16px rgba(47, 75, 53, .9), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:active { background: var(--green-2); }
.btn.ghost-gold { background: #F6ECD3; border-color: rgba(201, 154, 46, .35); color: #8A6A1E; }
.btn.soft { background: var(--card); }
.btn.danger { color: #B4532E; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .ic { width: 20px; height: 20px; }

.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .12s;
}
.icon-btn.plain { background: transparent; border-color: transparent; box-shadow: none; }
.icon-btn:active { transform: scale(.92); }
.icon-spacer { width: 44px; flex: none; }
.corner-btn {
  position: absolute; z-index: 3; top: calc(var(--safe-t) + 12px); left: calc(var(--safe-l) + 12px);
  width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--text);
}
.corner-btn.right { left: auto; right: calc(var(--safe-r) + 12px); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex: none; }
.bar-title { font-size: 17px; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- home ---------- */
#home { padding: 0; overflow: hidden; }
.hero { position: absolute; left: 0; right: 0; top: 0; height: 74%; overflow: hidden; }
.hero svg { width: 100%; height: 100%; display: block; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(243, 237, 227, 0) 45%, var(--bg) 100%); }
.home-inner {
  position: relative; z-index: 2; flex: 1; width: 100%; max-width: 440px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  padding: calc(var(--safe-t) + 64px) calc(var(--safe-r) + 22px) 18px calc(var(--safe-l) + 22px);
}
.brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.agave { width: 64px; height: 48px; fill: none; stroke: var(--green); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.logo { font-family: var(--serif); font-size: clamp(56px, 18vw, 84px); font-weight: 400; letter-spacing: .24em; text-transform: uppercase; color: var(--green); line-height: 1; margin-right: -.24em; }
.tagline { margin: 6px 0 0; color: var(--text); font-size: clamp(10px, 3vw, 12px); white-space: nowrap; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }
.tagline i { font-style: normal; color: var(--dim); padding: 0 .3em; }
.home-actions { display: flex; flex-direction: column; gap: 12px; }
.menu-btn {
  display: flex; align-items: center; gap: 18px; width: 100%; min-height: 76px; padding: 12px 22px; border-radius: 20px; text-align: left;
  background: rgba(251, 248, 242, .94); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .12s;
}
.menu-btn:active { transform: scale(.98); }
.menu-btn .ic { width: 34px; height: 34px; stroke-width: 1.3; }
.menu-btn b { display: block; font-family: var(--serif); font-weight: 400; font-size: 21px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.15; }
.menu-btn small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.menu-btn.dark { background: var(--green); color: var(--green-ink); border-color: transparent; box-shadow: 0 18px 34px -18px rgba(47, 75, 53, .95); }
.menu-btn.dark small { color: rgba(245, 240, 230, .75); }
.menu-btn.gold { background: #F6ECD3; }
.tabbar {
  position: relative; z-index: 2; flex: none; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px calc(var(--safe-r) + 8px) calc(var(--safe-b) + 8px) calc(var(--safe-l) + 8px);
  background: var(--card); border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; font-size: 12px; color: var(--muted); }
.tab .ic { width: 24px; height: 24px; }
.tab.on { color: var(--green); }
.tab.on .ic { fill: var(--green); fill-opacity: .9; stroke: var(--green); }
#home .corner-btn { background: rgba(251, 248, 242, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- decks ---------- */
.deck-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; width: 100%; max-width: 620px; margin: 0 auto; }
.deck {
  display: flex; align-items: stretch; gap: 14px; padding: 0 14px 0 0; min-height: 84px; border-radius: 18px; overflow: hidden; text-align: left;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .12s, opacity .2s;
}
.deck:active { transform: scale(.985); }
.deck-art {
  width: 96px; flex: none; display: flex; align-items: center; justify-content: center; position: relative;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55), transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--c) 42%, #F1E6D4), color-mix(in srgb, var(--c) 70%, #6B5136));
}
.deck-art::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 9px); }
.deck-art span { font-size: 40px; filter: drop-shadow(0 6px 8px rgba(40, 25, 10, .3)); position: relative; z-index: 1; }
.deck-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 12px 0; }
.deck-text b { font-family: var(--serif); font-weight: 400; font-size: 19px; letter-spacing: .02em; }
.deck-text small { font-size: 14px; color: var(--muted); }
.deck-text em { font-style: normal; font-size: 12px; color: var(--dim); margin-top: 2px; }
.deck-check { align-self: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: transparent; flex: none; }
.deck-check .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.deck.on .deck-check { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.deck:not(.on) { opacity: .62; }
.deck:not(.on) .deck-art { filter: saturate(.25); }

/* ---------- setup ---------- */
#setup { padding-bottom: 0; }
#setup h1 { font-size: clamp(22px, 6vw, 28px); letter-spacing: .16em; text-transform: uppercase; text-align: center; }
#setup .eyebrow, #setup .sub { text-align: center; }
.steps { display: flex; gap: 6px; }
.steps i { width: 18px; height: 3px; border-radius: 3px; background: var(--line-2); transition: all .25s; }
.steps i.on { width: 34px; background: var(--green); }
.step { display: none; width: 100%; max-width: 620px; margin: 0 auto; padding-bottom: 24px; }
.step.on { display: block; animation: enter .28s ease-out; }
.setup-foot {
  position: sticky; bottom: 0; margin: auto -18px 0; padding: 16px 18px calc(var(--safe-b) + 18px);
  display: flex; justify-content: center; background: linear-gradient(to top, var(--bg) 60%, rgba(243, 237, 227, 0));
}

.player-list { display: flex; flex-direction: column; gap: 10px; }
.player {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 10px 12px; align-items: center;
}
.player .avbtn { grid-row: span 2; border-radius: 50%; }
.player input { width: 100%; min-width: 0; height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card-2); padding: 0 14px; font-size: 17px; font-weight: 500; outline: none; }
.player input::placeholder { color: var(--dim); }
.player input:focus { border-color: var(--green); background: #fff; }
.player .remove { width: 40px; height: 40px; border-radius: 12px; color: var(--dim); display: flex; align-items: center; justify-content: center; }
.ages { grid-column: 2 / 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.age { min-height: 42px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); font-size: 14px; font-weight: 500; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); }
.age small { font-size: 10px; letter-spacing: .04em; }
.age.on { background: var(--green); color: var(--green-ink); border-color: transparent; }
.btn.add { width: 100%; margin-top: 12px; background: transparent; border: 1px dashed var(--line-2); box-shadow: none; color: var(--muted); }

.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; line-height: 1;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .7), transparent 60%), var(--av, #EAD9BF);
  box-shadow: inset 0 0 0 1px rgba(74, 56, 36, .08);
}
.avatar.huge { width: 136px; height: 136px; font-size: 78px; box-shadow: inset 0 0 0 1px rgba(74, 56, 36, .08), 0 0 0 10px var(--card), 0 0 0 11px var(--line), var(--shadow-lg); }
.avatar.sm { width: 32px; height: 32px; font-size: 19px; }
.avatar.xs { width: 24px; height: 24px; font-size: 14px; }
.avatar img { width: 92%; height: 92%; object-fit: contain; }
.avatar.char { background: radial-gradient(circle at 30% 25%, #fff, #EFE6D6); }
.bounce { animation: hover 2.6s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-8px); } }

.cat-tools { display: flex; gap: 8px; margin-bottom: 14px; justify-content: center; }
.chip { min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 500; font-size: 14px; }

.opt-group { margin-bottom: 26px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 18px; background: var(--sunk); }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg button { min-height: 52px; border-radius: 13px; padding: 8px 6px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.2; transition: all .2s; }
.seg button b { font-size: 15px; font-weight: 500; }
.seg button small { font-size: 12px; opacity: .9; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.note { margin: 10px 4px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* ---------- handoff / pick ---------- */
.turn-count { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; }
.hand-title { font-size: clamp(34px, 9.5vw, 50px); letter-spacing: .04em; }
.hand-sub { margin: -8px 0 8px; color: var(--muted); font-size: 16px; }
.mini-scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.mini-score { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 500; font-size: 15px; box-shadow: var(--shadow); }
.mini-score b { color: var(--gold); }
.rainbow-meter { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; text-align: left; box-shadow: var(--shadow); }
.rainbow-meter .label { font-weight: 500; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.rainbow-track { height: 8px; border-radius: 8px; background: var(--sunk); overflow: hidden; }
.rainbow-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #D9663A, #E3B23C, #8DA37F, #2F4B35); background-size: 420px 100%; transition: width 1s cubic-bezier(.2, 1.2, .4, 1); }

.word-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.word-card {
  position: relative; border-radius: 22px; padding: 16px 10px 16px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
  animation: deal .5s cubic-bezier(.2, 1.2, .4, 1) both;
}
.word-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 118px; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .5), transparent 55%), linear-gradient(150deg, color-mix(in srgb, var(--c) 30%, #F4EADB), color-mix(in srgb, var(--c) 55%, #8A6C4C)); }
.word-card > * { position: relative; }
.word-card:nth-child(2) { animation-delay: .1s; }
@keyframes deal { from { transform: translateY(24px); opacity: 0; } }
.word-card:active { transform: scale(.98); }
.word-card .we { font-size: 68px; line-height: 1; height: 90px; display: flex; align-items: center; filter: drop-shadow(0 8px 10px rgba(40, 25, 10, .28)); }
.word-card .ww { font-family: var(--serif); font-size: 24px; line-height: 1.1; min-height: 2.2em; display: flex; align-items: center; text-align: center; margin-top: 6px; }
.word-card .wc { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.word-card .stars { font-size: 11px; letter-spacing: 3px; color: var(--gold); }
.word-card .wchar { width: 70px; height: 70px; }
.word-card .wchar-row { display: flex; align-items: center; gap: 2px; height: 90px; }
.word-card .wchar-row .we { font-size: 42px; height: auto; }
.word-card .wis { font-size: 13px; color: var(--muted); }
.say { position: absolute !important; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 12px; background: rgba(251, 248, 242, .85); display: flex; align-items: center; justify-content: center; color: var(--text); }
.say .ic { width: 18px; height: 18px; }

/* ---------- countdown ---------- */
.cd-num { font-family: var(--serif); font-size: 170px; line-height: 1; color: var(--green); }
.cd-num.tick { animation: cd .8s cubic-bezier(.2, .9, .3, 1); }
@keyframes cd { from { transform: scale(1.5); opacity: 0; } 35% { transform: scale(1); opacity: 1; } }
.cd-sub { margin: 0; font-size: 17px; font-weight: 500; }
.cd-sub.dim { color: var(--muted); font-weight: 400; }

/* ---------- draw board ---------- */
#draw { padding: calc(var(--safe-t) + 4px) calc(var(--safe-r) + 12px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 12px); gap: 10px; overflow: hidden; }
.draw-top { display: flex; align-items: center; gap: 4px; flex: none; min-height: 44px; }
.draw-title { flex: 1; text-align: center; font-size: 15px; font-weight: 500; letter-spacing: .04em; }
.draw-top-r { display: flex; gap: 2px; min-width: 44px; justify-content: flex-end; }
#draw:not(.free) .draw-top::before { content: ''; width: 0; }

.prompt-card { position: relative; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px 14px; box-shadow: var(--shadow); text-align: center; }
.pc-label { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 0 40px; flex-wrap: wrap; }
.pc-label .pc-cat { color: var(--dim); }
.pc-label { column-gap: 14px; row-gap: 2px; }
.pc-hint { font-family: var(--serif); font-size: 26px; line-height: 1.15; margin: 6px 0 8px; min-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-hint .blanks { letter-spacing: 4px; }
.pc-timer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.timer-num { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.timer { position: relative; width: 100%; max-width: 280px; height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; }
.timer-fill { position: absolute; inset: 0; transform-origin: left center; background: var(--green); border-radius: 6px; transition: background .3s; }
.timer.mid .timer-fill { background: var(--sun); }
.timer.low .timer-fill { background: var(--clay); }
.timer.off .timer-fill { background: var(--sage); opacity: .4; }
.prompt-card:has(.timer.low) { animation: pulse .8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: var(--shadow), 0 0 0 3px rgba(217, 102, 58, .3); } }
.peek { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; touch-action: none; }
.peek:active { background: var(--green); color: var(--green-ink); }

.board { position: relative; flex: 1; min-height: 0; border-radius: var(--r-lg); overflow: hidden; background: #FFFDF8; border: 1px solid var(--line); box-shadow: var(--shadow); }
.board canvas { position: absolute; left: 0; top: 0; touch-action: none; display: block; }
.peek-card { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(251, 248, 242, .97); font-family: var(--serif); font-size: 32px; text-align: center; pointer-events: none; }
.peek-card .we { font-size: 100px; }
.peek-card.on { display: flex; }
.hint-pop { position: absolute; left: 50%; top: 18%; transform: translate(-50%, -50%) scale(.7); background: var(--green); color: var(--green-ink); font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; padding: 9px 18px; border-radius: 999px; pointer-events: none; opacity: 0; }
.hint-pop.on { animation: hintpop 1.8s cubic-bezier(.2, .9, .3, 1); }
@keyframes hintpop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%); } }
.last-secs { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 190px; color: rgba(217, 102, 58, .2); pointer-events: none; }
.last-secs.tick { animation: cd .8s ease-out; }

.tools { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.palette { display: flex; justify-content: space-between; }
.swatch { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; justify-content: center; }
.swatch i { width: min(28px, 84%); aspect-ratio: 1; border-radius: 50%; background: var(--c); transition: transform .15s, box-shadow .15s; }
.swatch.rainbow i { background: conic-gradient(#FF3B30, #FF9500, #FFD60A, #34C759, #0A84FF, #AF52DE, #FF3B30); }
.swatch.on i { transform: scale(1.1); box-shadow: 0 0 0 3px var(--card), 0 0 0 4.5px var(--text); }
.size-row { display: flex; align-items: center; gap: 14px; padding: 0 4px; height: 30px; }
.size-row .size-dot { flex: none; }
.size-dot { display: block; border-radius: 50%; background: var(--text); }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 30px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--line-2)); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9.5px; border-radius: 50%; background: var(--green); border: 3px solid var(--card); box-shadow: 0 2px 6px rgba(40, 25, 10, .3); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--green); border: 3px solid var(--card); }
.toolrow { display: flex; gap: 4px; align-items: center; justify-content: space-between; }
.tool { flex: 1; min-width: 0; height: 42px; border-radius: 12px; color: var(--text); display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.tool:active { transform: scale(.9); }
.tool.on { background: var(--green); color: var(--green-ink); }
.answer-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.btn.gotit, .btn.missed { width: 100%; min-height: 52px; font-size: 17px; letter-spacing: .04em; padding: 0 12px; }
.btn.missed { color: var(--muted); box-shadow: none; background: var(--card-2); }

#draw.free .game-only { display: none !important; }
#draw:not(.free) .free-only { display: none !important; }

/* Full screen: the page is the whole phone. */
.full-ui { display: none; }
#draw.full { padding: 0; gap: 0; }
#draw.full .draw-top, #draw.full .prompt-card, #draw.full .tools { display: none !important; }
#draw.full .board { border-radius: 0; border: 0; box-shadow: none; }
#draw.full .full-ui { display: block; }
.full-exit {
  position: absolute; z-index: 3; top: calc(var(--safe-t) + 10px); left: calc(var(--safe-l) + 10px);
  height: 42px; padding: 0 16px 0 10px; border-radius: 999px; display: flex; align-items: center; gap: 6px;
  background: var(--green); color: var(--green-ink); font-weight: 500; font-size: 14px; box-shadow: 0 8px 20px -8px rgba(47, 75, 53, .8);
}
.full-exit .ic { width: 18px; height: 18px; }
.full-timer { position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 4px; background: var(--sunk); }
.full-timer i { position: absolute; inset: 0; transform-origin: left center; background: var(--green); }
.full-num { position: absolute; z-index: 3; top: calc(var(--safe-t) + 10px); right: calc(var(--safe-r) + 10px); min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.full-num:empty { display: none; }

/* Phone on its side: board on the left, everything else down the right. */
@media (orientation: landscape) and (max-height: 600px) {
  #draw:not(.full) { grid-template-columns: 1fr minmax(240px, 32%); grid-template-rows: auto auto 1fr; grid-template-areas: "board top" "board prompt" "board tools"; column-gap: 12px; row-gap: 8px; }
  #draw.on:not(.full) { display: grid; }
  .draw-top { grid-area: top; }
  .prompt-card { grid-area: prompt; padding: 8px 12px 10px; }
  .pc-hint { font-size: 20px; margin: 2px 0 4px; }
  .board { grid-area: board; }
  .tools { grid-area: tools; align-self: end; padding: 10px; gap: 8px; }
  .palette { flex-wrap: wrap; }
  .swatch { flex: 0 0 20%; height: 32px; }
  .tool { height: 36px; }
  .btn.gotit, .btn.missed { min-height: 44px; font-size: 15px; }
}

/* ---------- who / reveal ---------- */
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; width: 100%; }
.who-btn { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 500; font-size: 17px; box-shadow: var(--shadow); transition: transform .12s; }
.who-btn:active { transform: scale(.96); }
.who-btn .avatar { width: 72px; height: 72px; font-size: 42px; }

.reveal-title { font-size: clamp(34px, 9.5vw, 48px); letter-spacing: .04em; }
.reveal-word { display: flex; align-items: center; gap: 12px; padding: 8px 24px 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-family: var(--serif); font-size: clamp(22px, 6.5vw, 30px); animation: zoom .5s cubic-bezier(.2, 1.3, .4, 1); }
.reveal-word .we { font-size: 1.3em; }
@keyframes zoom { from { transform: scale(.7); opacity: 0; } }
.replay-card { position: relative; width: 100%; max-width: 420px; aspect-ratio: 4 / 3.4; max-height: 40dvh; border-radius: var(--r-lg); overflow: hidden; background: #FFFDF8; border: 10px solid var(--card); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
.replay-card canvas { width: 100%; height: 100%; display: block; }
.replay-btn { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: var(--green-ink); display: flex; align-items: center; justify-content: center; }
.reveal-stars { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 30px; }
.star-award { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 500; font-size: 15px; box-shadow: var(--shadow); animation: zoom .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.star-award:nth-child(2) { animation-delay: .15s; }
.star-award b { color: var(--gold); }

/* ---------- end ---------- */
.end-inner { margin: auto; width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.end-title { font-size: clamp(34px, 9.5vw, 50px); letter-spacing: .04em; margin-top: -8px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; width: 100%; margin-top: 10px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; max-width: 140px; }
.pod .name { font-weight: 500; font-size: 15px; }
.pod .block { width: 100%; border-radius: 999px 999px 8px 8px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 26px; font-family: var(--serif); font-size: 30px; }
.pod .block .medal { font-family: var(--body); font-size: 11px; font-weight: 500; letter-spacing: .2em; color: var(--muted); }
.pod.p1 .block { height: 156px; background: var(--green); color: var(--green-ink); border-color: transparent; }
.pod.p1 .block .medal { color: rgba(245, 240, 230, .75); }
.pod.p2 .block { height: 118px; }
.pod.p3 .block { height: 92px; }
.pod .avatar { animation: hover 2.6s ease-in-out infinite; }
.awards { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.award { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 16px 10px 10px; text-align: left; box-shadow: var(--shadow); animation: deal .5s cubic-bezier(.2, 1.2, .4, 1) both; }
.award .ai { width: 44px; height: 44px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.award .at { font-family: var(--serif); font-size: 18px; }
.award .an { color: var(--muted); font-size: 13px; }
.award .score { margin-left: auto; font-weight: 600; font-size: 17px; color: var(--gold); white-space: nowrap; }
.end-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; margin: 6px 0 10px; }
.end-actions .btn.soft { width: 100%; max-width: 420px; }
.team-total { font-family: var(--serif); font-size: 80px; line-height: 1; color: var(--green); }
.team-total small { font-size: .3em; color: var(--muted); letter-spacing: .1em; }
.record { color: var(--gold); font-weight: 500; font-size: 15px; letter-spacing: .06em; }

/* ---------- gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding-bottom: 20px; }
.gal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; box-shadow: var(--shadow); transition: transform .15s; }
.gal:active { transform: scale(.97); }
.gal img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #FFFDF8; display: block; border: 1px solid var(--line); }
.gal .cap { font-family: var(--serif); font-size: 16px; display: flex; align-items: center; gap: 6px; padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gal .by { font-size: 12px; color: var(--muted); padding: 0 4px; margin-top: -4px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 15px; padding: 60px 10px; }
.empty b { display: block; font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--text); margin-bottom: 6px; }

.viewer { position: absolute; inset: 0; z-index: 40; background: rgba(243, 237, 227, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); }
.viewer img { max-width: 100%; max-height: 62dvh; border-radius: var(--r-lg); background: #FFFDF8; border: 10px solid var(--card); box-shadow: var(--shadow-lg); }
.viewer-cap { font-family: var(--serif); font-size: 20px; text-align: center; }
.viewer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---------- how to ---------- */
.howto-body { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; align-items: center; }
.how { width: 100%; display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.how span { font-family: var(--serif); font-size: 18px; color: var(--green); line-height: 1.3; }
.how p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.how p b { color: var(--text); font-weight: 500; }
.howto-body .btn { margin-top: 10px; }

/* ---------- modal / toast / confetti ---------- */
.modal { position: absolute; inset: 0; z-index: 50; background: rgba(43, 38, 34, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 26px 20px 20px; text-align: center; box-shadow: 0 40px 80px -30px rgba(43, 38, 34, .6); animation: zoom .3s cubic-bezier(.2, 1.3, .4, 1); }
.modal-body { font-family: var(--serif); font-size: 24px; margin-bottom: 20px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions .btn { width: 100%; }

#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.toast { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 100px); transform: translate(-50%, 20px); z-index: 70; background: var(--green); color: var(--green-ink); font-weight: 500; font-size: 15px; padding: 12px 20px; border-radius: 999px; opacity: 0; transition: all .25s; pointer-events: none; white-space: nowrap; box-shadow: 0 16px 30px -12px rgba(47, 75, 53, .7); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- stamp tray ---------- */
.tray { position: absolute; inset: 0; z-index: 30; background: rgba(43, 38, 34, .3); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; }
.tray-card { width: 100%; max-width: 640px; max-height: 70dvh; background: var(--card); border-radius: 26px 26px 0 0; padding: 16px 16px calc(var(--safe-b) + 16px); display: flex; flex-direction: column; gap: 12px; animation: slide-up .3s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -20px 40px -20px rgba(43, 38, 34, .4); }
@keyframes slide-up { from { transform: translateY(100%); } }
.tray-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--serif); font-size: 18px; letter-spacing: .18em; text-transform: uppercase; }
.tray-head b { font-weight: 400; }
.tray-body { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.tray-sec { font-weight: 500; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 6px 2px 0; }
.tray-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.tray-item { aspect-ratio: 1; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); font-size: 36px; display: flex; align-items: center; justify-content: center; padding: 4px; }
.tray-item img { width: 100%; height: 100%; object-fit: contain; }
.tray-item:active { transform: scale(.92); }
.tray-item.make { font-size: 12px; font-weight: 500; flex-direction: column; gap: 4px; line-height: 1.1; border-style: dashed; color: var(--muted); }
.stamp-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--green); color: var(--green-ink); font-weight: 500; font-size: 14px; padding: 9px 16px; border-radius: 999px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; }
.stamp-hint.on { opacity: 1; }

/* ---------- character studio ---------- */
.studio-wrap { width: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.studio-stage { position: relative; align-self: center; width: min(60vw, 260px); aspect-ratio: 5 / 6; border-radius: 999px 999px 22px 22px; background: radial-gradient(circle at 50% 40%, #FFFDF8, #EFE5D4 75%); border: 10px solid var(--card); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
.studio-stage::before { content: ''; position: absolute; left: 22%; right: 22%; bottom: 9%; height: 7%; border-radius: 50%; background: rgba(84, 62, 38, .18); filter: blur(5px); }
.studio-stage canvas { position: relative; width: 100%; height: 100%; display: block; animation: hover 2.6s ease-in-out infinite; }
.studio-stage .dice { position: absolute; right: -16px; bottom: -6px; width: 54px; height: 54px; border-radius: 18px; background: var(--green); color: var(--green-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 24px -12px rgba(47, 75, 53, .9); }
.studio-stage .dice .ic { width: 26px; height: 26px; }
.studio-stage .dice:active { transform: scale(.9) rotate(25deg); }
.studio-name input { width: 100%; height: 54px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); padding: 0 18px; font-family: var(--serif); font-size: 22px; text-align: center; outline: none; box-shadow: var(--shadow); }
.studio-name input::placeholder { color: var(--dim); }
.studio-name input:focus { border-color: var(--green); }
.part-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; scrollbar-width: none; border-radius: 16px; background: var(--sunk); }
.part-tabs::-webkit-scrollbar { display: none; }
.part-tab { flex: none; padding: 0 16px; height: 38px; border-radius: 12px; color: var(--muted); font-weight: 500; font-size: 14px; display: flex; align-items: center; }
.part-tab.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.part-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.part-opt { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); }
.part-opt canvas { width: 68px; height: 68px; }
.part-opt.on { box-shadow: inset 0 0 0 2px var(--green), var(--shadow); color: var(--text); }
.part-opt:active { transform: scale(.95); }
.studio-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; }
.studio-actions .btn.soft { width: 100%; max-width: 420px; }
.my-chars-title { margin-top: 14px; text-align: center; }
.my-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.my-char { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; overflow: hidden; box-shadow: var(--shadow); }
.my-char img { width: 70px; height: 70px; }
.my-char span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-char.on { box-shadow: inset 0 0 0 2px var(--green), var(--shadow); }
.my-char.new { color: var(--muted); justify-content: center; border-style: dashed; min-height: 110px; box-shadow: none; background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Sound on/off: the same button on every screen; muted shows a clay tint. */
.sound-btn.muted { color: var(--clay); }
.sound-btn.muted::after { content: 'Off'; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sound-btn { position: relative; }
.corner-btn.sound-btn { position: absolute; }

/* Draw first: the artist sketches in secret; no clock, one Ready button. */
.ready-btn { display: none; width: 100%; min-height: 52px; font-size: 17px; letter-spacing: .02em; }
#draw.sketch:not(.free) .ready-btn { display: flex; }
#draw.sketch .answer-row, #draw.sketch .pc-timer { display: none !important; }
#draw.sketch .prompt-card { background: #F6ECD3; }

/* ---------- games hub ---------- */
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  min-height: 66px; padding: 10px 12px; border-radius: 18px; background: rgba(251, 248, 242, .94); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .12s;
}
.game-tile:active { transform: scale(.97); }
.game-tile .gt-e { grid-row: span 2; font-size: 26px; width: 40px; height: 44px; border-radius: 999px 999px 8px 8px; background: var(--card-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.game-tile b { font-family: var(--serif); font-weight: 400; font-size: 15px; line-height: 1.15; letter-spacing: .02em; }
.game-tile small { font-size: 12px; color: var(--muted); line-height: 1.2; }
.home-actions .menu-btn { min-height: 66px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- 4 cards to pick from ---------- */
.word-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
.word-card { padding: 10px 8px 12px; gap: 4px; border-radius: 20px; }
.word-card::before { height: 86px; }
.word-card .we { font-size: 50px; height: 66px; }
.word-card .wchar-row { height: 66px; }
.word-card .wchar { width: 56px; height: 56px; }
.word-card .wchar-row .we { font-size: 34px; }
.word-card .ww { font-size: 19px; min-height: 2.3em; margin-top: 4px; }
.word-card .wc { font-size: 11px; }
#pick .center-col { gap: 14px; }

/* ---------- Napkin / Charades: no board, the phone keeps time ---------- */
.offscreen { display: none; }
#draw.offscreen .board, #draw.offscreen .palette, #draw.offscreen .size-row, #draw.offscreen .toolrow, #draw.offscreen [data-act=fullscreen] { display: none !important; }
#draw.offscreen .offscreen {
  display: flex; flex: 1; min-height: 0; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px;
  border-radius: var(--r-lg); background: var(--card); border: 1px dashed var(--line-2);
}
.offscreen .os-ico { font-size: 84px; line-height: 1; }
.offscreen h2 { font-size: 22px; color: var(--green); margin: 0; }
.offscreen p { margin: 0; color: var(--muted); font-size: 15px; max-width: 280px; line-height: 1.45; }

/* ---------- shared game layout ---------- */
.game-col { width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
.game-foot { display: flex; justify-content: center; gap: 8px; }
.screen-tip { margin: 0; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.45; }
.btn.wide { width: 100%; }
.bar .sound-btn { color: var(--text); }

/* ---------- quiz ---------- */
.quiz-who { display: flex; align-items: center; justify-content: center; gap: 10px; }
.quiz-who b { display: block; font-weight: 500; font-size: 16px; }
.quiz-who small { display: block; font-size: 12px; color: var(--muted); }
.quiz-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 22px 20px 24px; text-align: center; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.quiz-cat { font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.quiz-q { font-family: var(--serif); font-size: clamp(22px, 6.4vw, 28px); line-height: 1.25; }
.quiz-a { font-family: var(--serif); font-size: clamp(24px, 7vw, 32px); color: var(--green); background: #EEF2EA; border-radius: 16px; padding: 10px 18px; animation: zoom .4s cubic-bezier(.2, 1.3, .4, 1); }
.quiz-judge { grid-template-columns: 1fr 1.4fr; }
.quiz-judge:has(.quiz-who-grid) { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.quiz-ask { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.quiz-who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.who-btn.sm { padding: 10px 6px; font-size: 14px; gap: 6px; }
.who-btn.sm .avatar { width: 40px; height: 40px; font-size: 24px; }
#quizModes button { min-height: 46px; }
#quizModes button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- story ---------- */
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reel { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 14px; border-radius: 999px 999px 18px 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 170px; }
.reel-k { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: 14px; }
.reel-e { font-size: 44px; line-height: 1; height: 56px; display: flex; align-items: center; }
.reel-e img { width: 56px; height: 56px; }
.reel-t { font-family: var(--serif); font-size: 14px; line-height: 1.2; text-align: center; }
.reel.spinning .reel-e { filter: blur(1.5px); transform: translateY(2px); }
.story-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 48px 18px 20px; }
.story-text { font-family: var(--serif); font-size: 19px; line-height: 1.45; }
.story-card .say { top: 10px; right: 10px; }
.story-twist { background: #F6ECD3; border: 1px solid rgba(201, 154, 46, .35); color: #7A5C17; border-radius: 16px; padding: 12px 16px; font-family: var(--serif); font-size: 17px; text-align: center; animation: zoom .4s cubic-bezier(.2, 1.3, .4, 1); }
.story-teller { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; color: var(--muted); }
.story-teller b { color: var(--text); font-weight: 500; }

/* ---------- I Spy bingo ---------- */
.spy-places { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 5px; border-radius: 18px; background: var(--sunk); }
.spy-places button { min-height: 52px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); }
.spy-places button b { font-size: 20px; font-weight: 400; }
.spy-places button small { font-size: 12px; }
.spy-places button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.bingo { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 6px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px; transition: transform .12s, background .2s; }
.cell:active { transform: scale(.94); }
.cell .ce { font-size: 30px; line-height: 1; }
.cell .ct { font-size: 11px; line-height: 1.15; color: var(--muted); text-align: center; }
.bingo[style*="--n: 3"] .cell .ce { font-size: 40px; }
.bingo[style*="--n: 3"] .cell .ct { font-size: 13px; }
.cell.found { background: #E6EEDF; border-color: rgba(47, 75, 53, .35); }
.cell.found::after { content: '✓'; position: absolute; top: 4px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: var(--green-ink); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.cell.line { background: var(--green); border-color: transparent; }
.cell.line .ct { color: rgba(245, 240, 230, .85); }
.cell.line::after { background: var(--sun); color: var(--text); }

.story-actions { grid-template-columns: 1fr 1.5fr; }
.story-actions .btn { padding: 0 12px; font-size: 16px; white-space: nowrap; }
