/* Freaky Game Night: light, soft, cheeky. Colours in OKLCH, neutrals tinted toward the blue. */
:root {
  --bg: oklch(0.962 0.008 262);
  --bg-2: oklch(0.945 0.011 262);
  --surface: oklch(0.993 0.003 262);
  --surface-2: oklch(0.968 0.007 262);
  --surface-3: oklch(0.935 0.01 262);
  --ink: oklch(0.26 0.035 268);
  --ink-2: oklch(0.47 0.03 266);
  --ink-3: oklch(0.63 0.022 264);
  --line: oklch(0.91 0.01 262);
  --blue: oklch(0.6 0.2 259);
  --blue-hi: oklch(0.56 0.21 261);
  --blue-soft: oklch(0.945 0.035 255);
  --rose: oklch(0.63 0.21 10);
  --rose-soft: oklch(0.95 0.035 10);
  --violet: oklch(0.58 0.2 295);
  --violet-soft: oklch(0.95 0.035 295);
  --teal: oklch(0.66 0.12 190);
  --teal-soft: oklch(0.95 0.035 190);
  --amber: oklch(0.76 0.15 70);
  --amber-soft: oklch(0.96 0.04 80);
  --on-blue: oklch(0.99 0.005 262);
  --shadow-sm: 0 1px 2px oklch(0.35 0.05 262 / .06), 0 4px 12px -4px oklch(0.35 0.06 262 / .12);
  --shadow: 0 1px 2px oklch(0.35 0.05 262 / .05), 0 20px 44px -20px oklch(0.35 0.08 262 / .28);
  --shadow-lg: 0 2px 4px oklch(0.35 0.05 262 / .05), 0 32px 70px -26px oklch(0.3 0.09 262 / .38);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar: 64px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* One fixed screen: the page itself never scrolls. */
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; font-family: var(--font); color: var(--ink); background: radial-gradient(120% 80% at 50% 0%, var(--bg) 40%, var(--bg-2) 100%); -webkit-font-smoothing: antialiased; touch-action: manipulation; }
#app { position: relative; height: 100%; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid oklch(0.6 0.2 259 / .45); outline-offset: 2px; }
input { font: inherit; }
b { font-weight: 700; }

/* top bar: where you are, the name in the middle, actions on the right */
.bar { flex: none; height: var(--bar); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 clamp(16px, 3vw, 32px); }
.bar .mid { justify-self: start; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar .mid small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.bar .mid span { font-size: 15px; font-weight: 700; color: var(--ink); }
.logo { justify-self: center; font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo i { font-style: normal; color: var(--rose); }
.bar .right { justify-self: end; display: flex; gap: 8px; }
.iconbtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 700; color: var(--ink-2); transition: color .15s, transform .15s var(--ease); }
.iconbtn:hover { color: var(--ink); }
.iconbtn:active { transform: translateY(1px); }
.iconbtn svg { width: 18px; height: 18px; }

/* every screen: centred and scaled as one piece (see fitScreen in app.js) */
.screen { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: clamp(14px, 3.5vh, 36px) 16px clamp(18px, 4.5vh, 44px); text-align: center; overflow: hidden; }
.fit { flex: none; width: 100%; max-width: 920px; display: flex; flex-direction: column; align-items: center; gap: 18px; transform-origin: center center; }

.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--rose); }
.muted { color: var(--ink-2); }
.title { margin: 0; font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -.025em; }

/* buttons */
.cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 56px; padding: 0 32px; border-radius: 18px; font-size: 16px; font-weight: 800; letter-spacing: -.005em; color: var(--on-blue); background: var(--blue); box-shadow: 0 1px 0 oklch(1 0 0 / .25) inset, 0 12px 26px -12px oklch(0.55 0.2 260 / .75); transition: background .15s, transform .15s var(--ease), box-shadow .15s; flex: none; }
.cta:hover:not(:disabled) { background: var(--blue-hi); }
.cta:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 6px 14px -8px oklch(0.55 0.2 260 / .7); }
.cta:disabled { background: oklch(0.86 0.04 258); box-shadow: none; color: oklch(0.97 0.01 258); }
.cta.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.cta.ghost:hover:not(:disabled) { background: var(--surface); color: var(--blue); }
.cta.wide { width: 100%; }
.link { font-size: 14px; font-weight: 700; color: var(--blue); padding: 6px 4px; }
.link:hover { color: var(--blue-hi); text-decoration: underline; text-underline-offset: 3px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2); transition: color .15s, background .15s; }
.pill:hover { color: var(--blue); background: var(--blue-soft); }
.pill svg { width: 15px; height: 15px; }
.field { width: 100%; height: 58px; padding: 0 20px; font-size: 17px; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 2px solid transparent; border-radius: 18px; outline: none; transition: border-color .15s, background .15s; }
.field::placeholder { color: var(--ink-3); font-weight: 500; }
.field:focus { border-color: var(--blue); background: var(--surface); }
.field.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 800; }

/* cards */
.card { background: var(--surface); border-radius: 30px; box-shadow: var(--shadow); padding: 24px; text-align: left; }
.card-h { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.card-h h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.card-h svg { width: 22px; height: 22px; color: var(--blue); flex: none; }
.card-h.split { justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.card-h .count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 13px; }
.pills { display: flex; gap: 6px; }

/* avatars: size from --av so lists can shrink */
.av { position: relative; flex: none; width: var(--av, 56px); height: var(--av, 56px); border-radius: 50%; background: var(--surface-3) center/cover; box-shadow: 0 0 0 3px var(--surface), 0 8px 18px -8px oklch(0.35 0.08 262 / .45); }
.av svg { width: 100%; height: 100%; border-radius: 50%; display: block; }
.av.s { --av: 30px; box-shadow: 0 0 0 2px var(--surface); }
.av.l { --av: 92px; }
.av.xl { --av: 132px; }
.av .off { position: absolute; inset: 0; border-radius: 50%; background: oklch(0.97 0.006 262 / .6); }
.av .edit { position: absolute; right: -2px; bottom: 0; width: 34%; height: 34%; min-width: 22px; min-height: 22px; border-radius: 50%; background: var(--blue); color: var(--on-blue); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--surface); }
.av .edit svg { width: 52%; height: 52%; border-radius: 0; }

/* home */
.hero { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.crowd { display: flex; margin-bottom: 6px; }
.crowd .av { --av: 58px; margin-left: -12px; }
.crowd .av:first-child { margin-left: 0; }
.crowd .av:nth-child(odd) { transform: translateY(6px); }
.hero .big { margin: 0; font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -.045em; }
.hero .big i { font-style: normal; color: var(--rose); display: block; }
.hero .tag { margin: 0 0 10px; color: var(--ink-2); font-size: 16px; font-weight: 500; line-height: 1.5; max-width: 320px; }
.or { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.joinrow { display: flex; gap: 10px; width: 100%; }
.joinrow .field { flex: 1; min-width: 0; background: var(--surface); box-shadow: var(--shadow-sm); }
.joinrow .cta { height: 58px; padding: 0 26px; }
.foot { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-3); }

/* join */
.joincard { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; background: var(--surface); border-radius: 32px; box-shadow: var(--shadow-lg); padding: 30px 26px 24px; }
.joincard .avpick { margin: 4px 0 6px; }
.joincard .field { text-align: center; }
.already { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; font-weight: 600; min-height: 30px; }
.stackav { display: flex; }
.stackav .av { margin-left: -8px; }
.stackav .av:first-child { margin-left: 0; }

/* lobby: game list + players, side by side on desktop */
.lobby { width: min(900px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.games, .people { display: flex; flex-direction: column; gap: 14px; }
.game-list { display: flex; flex-direction: column; gap: 10px; }
.game-list.readonly { pointer-events: none; }
.game-row { display: grid; grid-template-columns: 50px 1fr 26px; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 20px; background: var(--surface-2); border: 2px solid transparent; text-align: left; transition: background .15s, border-color .15s, transform .15s var(--ease); }
.game-row:hover { background: var(--surface-3); }
.game-row:active { transform: scale(.99); }
.game-row.on { background: var(--blue-soft); border-color: var(--blue); }
.badge { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; }
.badge .art { width: 26px; height: 26px; }
.game-row.g-mlt .badge { background: var(--rose-soft); color: var(--rose); }
.game-row.g-spin .badge { background: var(--teal-soft); color: var(--teal); }
.game-row.g-wyr .badge { background: var(--violet-soft); color: var(--violet); }
.game-row.on .badge { background: var(--surface); }
.gtxt b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.gtxt small { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.radio { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; background: var(--surface); }
.radio svg { width: 14px; height: 14px; }
.game-row.on .radio { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.rules { margin: 2px 2px 0; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--ink-2); }
.rules b { color: var(--ink); }
.how { margin: -6px 2px 0; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.roster { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 14px 12px; flex: 1; padding: 6px 0; }
.pl { display: flex; flex-direction: column; align-items: center; gap: 7px; width: calc(var(--av) + 22px); cursor: default; }
.pl[data-act] { cursor: pointer; }
.pl .nm { font-size: 13px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .g { font-size: 11px; font-weight: 800; color: var(--blue); margin-top: -5px; min-height: 13px; }
.go { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.go .status { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); text-align: center; }
.extras { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: center; }

/* game screens */
.stage { width: min(720px, 100%); flex: none; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.qcard { width: 100%; background: var(--surface); border-radius: 32px; box-shadow: var(--shadow-lg); padding: 30px 36px 34px; animation: rise .35s var(--ease); }
.qcard .q { margin: 10px 0 0; font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; }
.qcard.sm { padding: 16px 22px 18px; border-radius: 24px; box-shadow: var(--shadow); animation: none; }
.qcard.sm .q { margin-top: 4px; font-size: 19px; letter-spacing: -.015em; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.votes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vbtn { display: flex; flex-direction: column; align-items: center; gap: 8px; width: calc(var(--av) + 30px); padding: 12px 6px 10px; border-radius: 22px; transition: background .15s, box-shadow .15s, transform .15s var(--ease); }
.vbtn:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.vbtn:active { transform: scale(.97); }
.vbtn.on { background: var(--surface); box-shadow: var(--shadow-sm); }
.vbtn.on .av { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--blue); }
.vbtn span { font-size: 13px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbtn.on span { color: var(--blue); }
.wait { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.wait .av.s { --av: 26px; }
.wait .av.dim { opacity: .35; }

.result { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: rise .4s var(--ease); }
.result .faces { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 4px 0; }
.result .faces .av { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--rose), 0 18px 36px -14px oklch(0.5 0.15 10 / .55); }
.result .who { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.1; letter-spacing: -.035em; }
.result .why { margin: 0; max-width: 520px; font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--ink-2); }
.sticker { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 10px; background: var(--rose-soft); color: var(--rose); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bars { width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-sm); padding: 14px 16px; }
.bar-row { display: grid; grid-template-columns: 20px 30px minmax(0, 90px) 1fr 26px; min-height: 30px; align-items: center; gap: 10px; text-align: left; font-size: 13px; font-weight: 700; }
.bar-row .bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row b { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.track { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow .6s var(--ease) both; }
.track i.c0 { background: linear-gradient(90deg, oklch(0.78 0.12 15), var(--rose)); }
.track i.c1 { background: linear-gradient(90deg, oklch(0.74 0.14 300), var(--violet)); }
.track i.c2 { background: linear-gradient(90deg, oklch(0.82 0.1 190), var(--teal)); }
.track i.c3 { background: linear-gradient(90deg, oklch(0.86 0.12 85), var(--amber)); }
@keyframes grow { from { transform: scaleX(0); } }
.next { display: flex; justify-content: center; gap: 12px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.countdown { font-size: 150px; font-weight: 800; line-height: 1; letter-spacing: -.06em; color: var(--blue); font-variant-numeric: tabular-nums; animation: beat 1s var(--ease); }
@keyframes beat { 0% { opacity: 0; transform: scale(1.18); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: .9; } }

/* writing round */
.timer { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 6px var(--blue-soft); font-size: 52px; font-weight: 800; letter-spacing: -.04em; color: var(--blue); font-variant-numeric: tabular-nums; }
.writebox { width: min(540px, 100%); display: flex; flex-direction: column; gap: 8px; text-align: left; }
.writebox .pre { font-size: 15px; font-weight: 700; color: var(--ink-2); padding-left: 4px; }
.writebox .field { background: var(--surface); box-shadow: var(--shadow-sm); }
.writebox.two { flex-direction: row; align-items: center; }
.writebox.two .field { flex: 1; min-width: 0; }

/* would you rather */
.asker { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.asker .av { --av: 32px; }
.asker .arrow { color: var(--ink-3); }
.asker b { color: var(--blue); font-weight: 800; }
.wyr { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 12px; width: 100%; }
.opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 200px; padding: 26px 20px; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); border: 3px solid transparent; font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; transition: border-color .15s, background .15s, transform .15s var(--ease); }
button.opt[data-act]:hover { background: var(--surface-2); }
.opt .k { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 9px; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.opt.a .k { background: var(--rose-soft); color: var(--rose); }
.opt.b .k { background: var(--violet-soft); color: var(--violet); }
.opt.a.on { border-color: var(--rose); background: var(--rose-soft); }
.opt.b.on { border-color: var(--violet); background: var(--violet-soft); }
.opt .cnt { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.opt .who { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.opt .who .av { --av: 26px; }
.opt.lose { border-color: var(--rose); }
.wyr.done .opt { min-height: 0; padding: 14px; gap: 6px; font-size: 17px; border-radius: 22px; }
.vs { align-self: center; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 800; color: var(--ink-3); }

/* spin the bottle */
.spinstage { position: relative; }
.table { position: relative; flex: none; width: min(86vw, calc(100dvh - var(--bar) - 270px), 520px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 42%, var(--surface) 0 58%, var(--surface-2) 100%); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); }
.table::before { content: ""; position: absolute; inset: 17%; border-radius: 50%; border: 2px dashed var(--surface-3); }
.seat { position: absolute; width: 0; height: 0; }
.seat .in { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; width: 90px; }
.seat .av { transition: transform .3s var(--ease), box-shadow .3s; }
.seat .nm { font-size: 12px; font-weight: 700; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.seat.turn .nm { color: var(--blue); }
.seat.hit .av { transform: scale(1.16); box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--blue), 0 14px 30px -10px oklch(0.55 0.2 260 / .6); }
.seat.hit .nm { color: var(--blue); }
.bottle { position: absolute; left: 50%; top: 50%; width: 40%; height: 40%; margin: -20% 0 0 -20%; will-change: transform; filter: drop-shadow(0 10px 10px oklch(0.3 0.06 262 / .28)); }
.bottle svg { width: 100%; height: 100%; display: block; }
.spinmsg { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; }
.spinmsg .who { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.spinmsg p { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.task { position: absolute; top: 0; right: 0; z-index: 5; padding: 14px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: left; min-width: 164px; }
.task-h { margin: 0 0 8px 6px; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.task ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task li { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 11px; font-size: 15px; font-weight: 700; color: var(--ink-3); transition: background .2s, color .2s; }
.task li i { width: 10px; height: 10px; border-radius: 50%; flex: none; opacity: .5; }
.task li.t-drink i { background: var(--amber); }
.task li.t-kiss i { background: var(--rose); }
.task li.t-insult i { background: var(--violet); }
.task li.t-praise i { background: var(--teal); }
.task li.on { background: var(--blue-soft); color: var(--ink); }
.task li.on i { opacity: 1; }
.task.rolling li { animation: roll 1s steps(1) infinite; }
.task.rolling li:nth-child(2) { animation-delay: .25s; }
.task.rolling li:nth-child(3) { animation-delay: .5s; }
.task.rolling li:nth-child(4) { animation-delay: .75s; }
@keyframes roll { 0% { color: var(--ink); background: var(--surface-2); } 25% { color: var(--ink-3); background: transparent; } }

/* sheets (pop-ups: the only things allowed to scroll inside) */
.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: oklch(0.25 0.04 262 / .32); animation: fade .15s; }
.sheet .box { position: relative; width: min(460px, 100%); max-height: min(86dvh, 720px); overflow-y: auto; overscroll-behavior: contain; padding: 26px; border-radius: 30px; background: var(--surface); box-shadow: var(--shadow-lg); text-align: left; animation: rise .25s var(--ease); }
.sheet h2 { margin: 0 0 18px; padding-right: 44px; font-size: 24px; font-weight: 800; letter-spacing: -.025em; }
.sheet .x { position: absolute; top: 20px; right: 20px; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); }
.sheet .x svg { width: 16px; height: 16px; }
@keyframes fade { from { opacity: 0; } }
.faces-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 4px 0 16px; }
.faces-grid button { border-radius: 50%; }
.faces-grid .av { width: 100%; height: auto; aspect-ratio: 1; }
.faces-grid button.on .av { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--blue); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; }
.acts > * { flex: 1; }
.btn2 { display: flex; align-items: center; justify-content: center; height: 50px; padding: 0 16px; border-radius: 16px; background: var(--surface-2); font-size: 15px; font-weight: 700; cursor: pointer; text-align: center; white-space: nowrap; transition: background .15s, color .15s; }
.btn2:hover { background: var(--blue-soft); color: var(--blue); }
.btn2 input { display: none; }
.seg { display: flex; padding: 4px; margin-bottom: 14px; border-radius: 16px; background: var(--surface-2); }
.seg button { flex: 1; height: 40px; border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.sheet .field { margin-bottom: 10px; }
.sheet .cta { margin-top: 6px; }
.sheet .label { margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: var(--ink); }
.sheet .label:first-of-type { margin-top: 0; }
.sheet .sub { margin: -6px 0 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); line-height: 1.45; }
.plist { max-height: 44dvh; overflow-y: auto; margin-top: 12px; border-radius: 18px; background: var(--surface-2); }
.pitem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; line-height: 1.4; cursor: pointer; }
.pitem:last-child { border-bottom: 0; }
.pitem input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--blue); }
.pitem.offp { color: var(--ink-3); text-decoration: line-through; }
.board .row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.board .row:last-child { border-bottom: 0; }
.board .no { width: 22px; font-weight: 800; color: var(--ink-3); }
.board .row .av { --av: 38px; }
.board .row .n { flex: 1; font-weight: 700; }
.board .row .d { font-size: 20px; font-weight: 800; color: var(--amber); font-variant-numeric: tabular-nums; }
.crop { position: relative; width: min(300px, 76vw); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 24px; background: var(--ink); touch-action: none; cursor: grab; user-select: none; }
.crop:active { cursor: grabbing; }
.crop img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.crop .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid oklch(0.99 0.003 262); box-shadow: 0 0 0 999px oklch(0.2 0.03 262 / .55); pointer-events: none; }
.zoomrow { display: flex; align-items: center; gap: 12px; width: min(300px, 76vw); margin: 16px auto 0; font-size: 18px; font-weight: 800; color: var(--ink-3); }
.zoomrow input { flex: 1; accent-color: var(--blue); height: 28px; }

#toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 50; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 13px 20px; border-radius: 16px; max-width: calc(100% - 32px); background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 700; box-shadow: var(--shadow); transition: opacity .2s, transform .25s var(--ease); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.conn { position: fixed; top: 0; left: 0; right: 0; z-index: 40; padding: 7px; text-align: center; font-size: 13px; font-weight: 700; background: var(--amber-soft); color: var(--ink); }

/* compact mode, applied by fitScreen() when a screen would not fit */
.screen.tight { padding-top: 8px; padding-bottom: 10px; }
.screen.tight .fit { gap: 10px; }
.screen.tight .how, .screen.tight .gtxt small, .screen.tight .writebox .pre, .screen.tight .result .why, .screen.tight .hero .tag, .screen.tight .foot { display: none; }
.screen.tight .card { padding: 16px; }
.screen.tight .game-row { padding: 8px 10px; }

@media (max-width: 900px) {
  .task { position: static; padding: 6px; min-width: 0; border-radius: 16px; }
  .task-h { display: none; }
  .task ul { flex-direction: row; gap: 4px; }
  .task li { height: 32px; font-size: 13px; padding: 0 9px; gap: 6px; }
  .task li i { width: 8px; height: 8px; }
  .table { width: min(86vw, calc(100dvh - var(--bar) - 320px), 520px); }
}
@media (max-width: 720px) {
  .lobby { grid-template-columns: 1fr; width: min(460px, 100%); gap: 14px; }
  .card { padding: 18px; border-radius: 26px; }
  .game-list { gap: 8px; }
  .game-row { grid-template-columns: 42px 1fr 24px; gap: 12px; padding: 9px 12px 9px 9px; border-radius: 17px; }
  .badge { width: 42px; height: 42px; border-radius: 13px; }
  .badge .art { width: 22px; height: 22px; }
  .gtxt small { display: none; }
  .game-row.on .gtxt small { display: block; }
  .qcard { padding: 24px 22px 26px; border-radius: 28px; }
  .qcard .q { font-size: 27px; }
  .result .who { font-size: 28px; }
  .wyr { grid-template-columns: 1fr; gap: 8px; }
  .vs { margin: -16px auto; z-index: 2; position: relative; width: 40px; height: 40px; }
  .opt { min-height: 120px; padding: 18px; font-size: 19px; }
  .countdown { font-size: 120px; }
}
@media (max-width: 640px) {
  .screen { padding: 10px 12px 14px; }
  .fit { gap: 14px; }
  .lobby .card { padding: 16px; gap: 12px; }
  .card-h, .card-h h2 { font-size: 17px; }
  .card-h.split { flex-wrap: nowrap; }
  .pill { height: 32px; padding: 0 10px; }
  .pill .long { display: none; }
  .roster { gap: 10px 6px; padding: 2px 0; }
  .people .roster .av { --av: 42px; }
  .pl { width: 50px; gap: 6px; }
  .pl .nm { font-size: 12px; }
  .rules { font-size: 13px; }
  .game-row { padding: 8px 12px 8px 8px; }
  .bar { padding: 0 14px; gap: 8px; }
  .logo { font-size: 16px; }
  .iconbtn { width: 40px; padding: 0; justify-content: center; }
  .iconbtn .lbl { display: none; }
  .bar .mid span { font-size: 14px; }
  .hero .big { font-size: 44px; }
  .writebox.two { flex-direction: column; }
  .writebox.two .vs { margin: -4px auto; width: 34px; height: 34px; }
  .sheet { place-items: end center; padding: 0; }
  .sheet .box { width: 100%; border-radius: 28px 28px 0 0; padding-bottom: max(26px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) { .logo .rest { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.pill .short { display: none; }
@media (max-width: 640px) { .pill .short { display: inline; } }

/* spectators: same view, nothing to tap */
.votes.watch .vbtn { cursor: default; }
.votes.watch .vbtn:hover { background: none; box-shadow: none; }
.joincard .hint { margin: -4px 0 0; font-size: 13px; line-height: 1.45; max-width: 320px; }

/* re-renders inside the same phase must not replay entrance animations (no flicker) */
#app.calm .qcard, #app.calm .result, #app.calm .track i, .sheet.calm, .sheet.calm .box { animation: none; }

/* the hint line always takes the same space, so nothing shifts when you vote */
.stage .hint { min-height: 2.9em; display: flex; align-items: center; justify-content: center; line-height: 1.45; max-width: 520px; }
.vtime { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 2px var(--blue); }
.vtime.low { background: var(--rose-soft); color: var(--rose); box-shadow: inset 0 0 0 2px var(--rose); }

/* vote results: top 5 visible, the rest scrolls inside the list (the page itself never scrolls) */
.bars { max-height: calc(5 * 30px + 4 * 10px + 28px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.bar-row .rk { font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar-row:first-child .rk { color: var(--rose); }

.autonext { font-size: 13px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* host shows results */
.still { margin: -6px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-3); min-height: 1.4em; }
.next .cta:disabled + .link { margin-left: 4px; }

/* chat */
.chatbtn { position: relative; }
.cbadge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--rose); color: var(--on-blue); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.cbadge.hide { display: none; }
.chatlist { height: min(48dvh, 420px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.chatlist .empty { margin: auto; color: var(--ink-3); font-weight: 600; font-size: 14px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.msg.mine { align-self: flex-end; }
.msg .av { --av: 28px; }
.bubble { display: flex; flex-direction: column; gap: 2px; padding: 9px 13px; border-radius: 16px 16px 16px 6px; background: var(--surface-2); font-size: 14px; font-weight: 500; line-height: 1.4; word-break: break-word; }
.bubble b { font-size: 12px; font-weight: 800; color: var(--blue); }
.msg.mine .bubble { background: var(--blue); color: var(--on-blue); border-radius: 16px 16px 6px 16px; }
.ctag { font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.ctag.praise { color: var(--teal); }
.ctag.insult { color: var(--violet); }
.msg.mine .ctag { color: oklch(0.95 0.03 258); }
.chatrow { display: flex; gap: 8px; margin-top: 6px; }
.chatrow .field { margin: 0; height: 52px; }
.chatrow .cta { height: 52px; padding: 0 20px; margin: 0; }

/* spin: written praise / insult */
.lineform { display: flex; gap: 8px; width: min(460px, 100%); }
.lineform .field { flex: 1; min-width: 0; height: 52px; background: var(--surface); box-shadow: var(--shadow-sm); }
.lineform .cta { height: 52px; padding: 0 22px; }
.line { margin: 4px 0 0; max-width: 460px; padding: 16px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); font-size: 18px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.line.praise { box-shadow: var(--shadow), inset 0 0 0 2px var(--teal); }
.line.insult { box-shadow: var(--shadow), inset 0 0 0 2px var(--violet); }
.line span { display: block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); }

/* who voted for whom, under each result row; the list scrolls inside when long */
.bar-row { row-gap: 6px; }
.voters { grid-column: 3 / -1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: -2px; }
.voters em { font-style: normal; color: var(--ink-3); font-weight: 700; }
.voters .vb { display: inline-flex; align-items: center; gap: 5px; }
.voters .av.s { --av: 20px; box-shadow: none; }
.bars { max-height: min(260px, 34vh); }

/* rows keep their height inside the scrolling list (no overlap) */
.bars { gap: 0; padding: 6px 16px; }
.bar-row { flex-shrink: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bar-row:last-child { border-bottom: 0; }
.bar-row > .rk, .bar-row > .av, .bar-row > .bn, .bar-row > .track, .bar-row > b { grid-row: 1; }
