/* Dumb Charades — a little family stage: maroon curtains, a marigold toran, warm footlights. */
:root {
  --desk: #141721; --panel: #20253a; --panel-2: #2a3049; --line: #363d5c; --ink: #f5f3ff; --muted: #a9abc6;
  --orange: #ff9a3c; --pink: #f04fa8; --violet: #8b5cf6; --teal: #2fd4c8; --gold: #ffc23d; --kesar: #ff9a3c; --neel: #3d8bff; --tc: #ff9a3c;
  --grad: linear-gradient(100deg, var(--orange), var(--pink) 50%, var(--violet));
  --display: "Outfit", "Trebuchet MS", system-ui, sans-serif; --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--desk); color: var(--ink); font-family: var(--body); font-size: 16px; -webkit-tap-highlight-color: transparent; min-height: 100vh; -webkit-user-select: none; user-select: none; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 10px; }
button:disabled { cursor: default; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
p { margin: 0; }
svg { display: block; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--ink); white-space: nowrap; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(240, 79, 168, .28); }
.btn.teal { background: var(--teal); color: #08221f; }
.btn.ghost { border: 2px solid var(--line); }
.btn.big { min-height: 58px; font-size: 20px; padding: 12px 24px; }
.btn:disabled { opacity: .4; }
.btn:not(:disabled):active { transform: scale(.97); }
.small { font-size: 13.5px; color: var(--muted) !important; }
.kick { color: var(--tc); font-weight: 800; font-size: 14px; }
.em { display: inline-block; width: 30px; height: 30px; flex: none; }
.em svg { width: 100%; height: 100%; }
.em.big { width: 64px; height: 64px; }

/* ---------- setup ---------- */
.setup { max-width: 980px; margin: 0 auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.stop { display: flex; gap: 14px; align-items: flex-start; }
.stop h1 { font-size: clamp(26px, 4.4vw, 38px); font-weight: 800; }
.stop .sub { color: var(--muted); font-weight: 700; margin-top: 4px; }
.back { min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); font-weight: 800; white-space: nowrap; }
.teams-hd { display: flex; align-items: center; justify-content: center; gap: 12px; }
.teams-hd .th { flex: 1; max-width: 260px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px; background: var(--panel); border: 2px solid; font-family: var(--display); font-size: 19px; }
.teams-hd .th .em { width: 44px; height: 44px; }
.teams-hd .t0 { border-color: var(--kesar); } .teams-hd .t1 { border-color: var(--neel); }
.teams-hd .vs { font-family: var(--display); font-weight: 800; color: var(--muted); }
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sbox { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lab { font-family: var(--body); font-size: 15px; font-weight: 800; color: var(--ink); }
.lab span { color: var(--muted); font-weight: 700; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); font-weight: 800; font-size: 15px; }
.chip[aria-pressed=true] { border-color: var(--teal); background: rgba(47,212,200,.15); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cat { position: relative; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel-2); min-height: 62px; }
.cat .ci { grid-row: 1 / 3; width: 38px; height: 38px; color: var(--muted); }
.cat b { font-size: 15px; line-height: 1.15; padding-right: 18px; }
.cat small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.cat .tick { position: absolute; top: 8px; right: 10px; font-style: normal; font-weight: 900; color: var(--teal); opacity: 0; }
.cat.on { border-color: var(--teal); background: rgba(47,212,200,.1); }
.cat.on .ci { color: var(--orange); } .cat.on .tick { opacity: 1; }
.sgo { position: sticky; bottom: 0; padding: 10px 0 6px; background: linear-gradient(transparent, var(--desk) 30%); display: flex; justify-content: center; }
.sgo .btn { width: min(420px, 100%); }
@media (max-width: 520px) { .sgrid { grid-template-columns: 1fr; } .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .teams-hd .th { font-size: 16px; padding: 8px 10px; } .teams-hd .th .em { width: 34px; height: 34px; } .stop { flex-direction: column; gap: 8px; } }

/* ---------- score row ---------- */
.score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.score .sc { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 16px; background: rgba(20,23,33,.75); border: 2px solid transparent; min-width: 0; }
.score .sc .nm { flex: 1; font-weight: 800; font-size: 14px; min-width: 0; }
.score .sc b { font-family: var(--display); font-size: 26px; }
.score .t0.turn { border-color: var(--kesar); } .score .t1.turn { border-color: var(--neel); }
.score.big .sc b { font-size: 32px; }

/* ---------- cover: pass the phone ---------- */
.cover { position: relative; min-height: calc(100vh - var(--kd-h, 70px)); min-height: calc(100dvh - var(--kd-h, 70px)); display: flex; align-items: stretch; justify-content: center; overflow: hidden; }
.stagebg { position: absolute; inset: 0; background: radial-gradient(70% 50% at 50% 100%, rgba(255,210,122,.32), transparent 70%), #1c1630; }
.stagebg .val { position: absolute; left: 0; right: 0; top: 0; }
.stagebg .val svg { width: 100%; height: auto; }
.stagebg .cl, .stagebg .cr { position: absolute; top: 0; bottom: 0; width: 13%; max-width: 110px; background: repeating-linear-gradient(90deg, #6a0c24 0 10px, #b51f45 10px 22px, #7a0f2a 22px 30px); box-shadow: 0 0 30px rgba(0,0,0,.5); }
.stagebg .cl { left: 0; border-radius: 0 0 60% 0 / 0 0 12% 0; } .stagebg .cr { right: 0; border-radius: 0 0 0 60% / 0 0 0 12%; }
.stagebg .fl { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: #3a2418; border-top: 2px solid rgba(255,194,61,.6); }
.cv-in { position: relative; width: min(560px, 100%); padding: calc(var(--valh, 80px) + 6px) 16px 48px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.cv-team { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.cv-team b { font-family: var(--display); font-size: 34px; color: var(--tc); text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.cv-turn { font-weight: 800; color: #f0e6d6; background: rgba(20,23,33,.6); padding: 4px 12px; border-radius: 999px; }
.cv-h { font-size: clamp(26px, 6vw, 36px); text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.cv-p { color: #f0e6d6; font-weight: 700; max-width: 34ch; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.cv-in .btn { width: min(380px, 100%); margin-top: 6px; white-space: normal; }
.cv-cats { color: #d8cfe8; font-size: 13px; font-weight: 700; background: rgba(20,23,33,.55); padding: 6px 12px; border-radius: 12px; }
.count { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12,10,22,.82); z-index: 5; }
.count b { font-family: var(--display); font-size: 140px; color: var(--tc); text-shadow: 0 0 40px rgba(255,154,60,.5); }
.bump { animation: bump .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { from { transform: scale(.6); opacity: .3; } }

/* ---------- acting ---------- */
.act { max-width: 640px; margin: 0 auto; padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - var(--kd-h, 70px)); min-height: calc(100dvh - var(--kd-h, 70px)); }
.act-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.act-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.act-team .em { width: 46px; height: 46px; }
.act-team b { display: block; font-family: var(--display); font-size: 21px; color: var(--tc); }
.act-team small { color: var(--muted); font-weight: 800; }
.ring { position: relative; width: 86px; height: 86px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .r0 { stroke: rgba(255,255,255,.1); }
.ring .r1 { stroke: var(--tc); stroke-linecap: round; stroke-dasharray: 276.46; transition: stroke-dashoffset .1s linear; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums; }
.ring.low .r1 { stroke: #ff5a6a; } .ring.low b { color: #ff8a96; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.a-cat { text-align: center; color: var(--muted); font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.word { flex: 1; min-height: 190px; max-height: 440px; display: grid; place-items: center; padding: 22px; border-radius: 28px; background: var(--grad); box-shadow: 0 20px 50px -16px rgba(240,79,168,.6); text-align: center; }
.word span { font-family: var(--display); font-weight: 800; font-size: var(--fs, 52px); line-height: 1.08; color: #fff; text-shadow: 0 3px 14px rgba(60,10,60,.35); overflow-wrap: anywhere; }
.act.paused .word span { filter: blur(14px); }
.a-this { text-align: center; color: var(--muted); font-weight: 800; }
.a-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.a-btns .btn { min-height: 72px; font-size: 22px; }
.a-tip { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; }
@media (min-width: 900px) { .act { max-width: 760px; } .word { min-height: 300px; } .word span { font-size: calc(var(--fs, 52px) * 1.3); } .ring { width: 104px; height: 104px; } }
@media (max-height: 700px) { .word { min-height: 150px; } .a-btns .btn { min-height: 60px; } .a-tip { display: none; } }

/* ---------- turn summary ---------- */
.summary { max-width: 640px; margin: 0 auto; padding: 18px 16px 24px; }
.sm-in { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.sm-in h1 { font-size: 36px; }
.sm-p { color: #d2d1e8; font-weight: 700; font-size: 17px; }
.sm-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wchip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 15px; border: 2px solid var(--line); background: var(--panel); flex-wrap: wrap; justify-content: center; }
.wchip i { font-style: normal; }
.wchip.got { border-color: rgba(47,212,200,.7); background: rgba(47,212,200,.12); } .wchip.got i { color: var(--teal); }
.wchip.miss { color: var(--muted); } .wchip.miss i { color: #ff8a96; }
.wchip.up { border-color: var(--gold); } .wchip.up small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; }
.sm-in .btn { margin-top: 6px; white-space: normal; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 2147483000; background: rgba(8,10,18,.76); display: grid; place-items: center; padding: 14px; }
.box { width: min(480px, 100%); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.box > * { flex-shrink: 0; }
.box h2 { font-size: 25px; font-weight: 800; }
.box p { color: #d2d1e8; line-height: 1.5; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 4px; }
.btns.col { flex-direction: column; align-items: stretch; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: #d2d1e8; line-height: 1.45; }
.steps li::marker { color: var(--orange); font-family: var(--display); font-weight: 800; }
.box.win { text-align: center; align-items: stretch; }
.win-em { display: flex; justify-content: center; gap: 8px; } .win-em svg { width: 84px; height: 84px; animation: bump .6s cubic-bezier(.2,1.6,.4,1); }
.win-stars { display: flex; justify-content: center; gap: 8px; font-size: 46px; line-height: 1; }
.win-stars span { color: #3a4060; } .win-stars span.on { color: var(--gold); animation: starin .5s cubic-bezier(.2,1.6,.4,1) both; text-shadow: 0 0 20px rgba(255,194,61,.5); }
@keyframes starin { from { transform: scale(0) rotate(-40deg); } }
.box .score .sc { background: var(--panel-2); }

.toast { position: fixed; left: 50%; bottom: calc(var(--kd-h, 70px) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 2147483100; background: var(--ink); color: #141721; font-weight: 800; padding: 10px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: calc(100vw - 28px); width: max-content; text-align: center; pointer-events: none; font-size: 15px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2147483200; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105%; transform: translateX(50px) rotate(760deg); } }
@media (prefers-reduced-motion: reduce) { .bump, .ring.low b, .win-em svg { animation: none; } }
@media (max-width: 520px) { .cv-in { padding-left: 15vw; padding-right: 15vw; } .cv-in .score { width: calc(100% + 24vw); margin: 0 -12vw; } .cv-team b { font-size: 28px; } }
