/* Loose Lips. Late-night plum, hot pink lipstick, a little gold. Chunky, friendly, phone first. */
:root {
  --plum: #1a0a26; --ink: #12061c; --deep: #2a0f3a; --panel: rgba(42, 15, 58, 0.78); --panel2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14); --pink: #ff3d8b; --pink2: #ff7ab3; --hot: #ff1f6e; --gold: #ffd23f; --mint: #3fcf8e; --sky: #2fb5ff;
  --txt: #fff5fb; --dim: #c9a9d8; --font: 'Fredoka', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; --display: 'Bagel Fat One', 'Fredoka', 'Arial Black', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--plum); color: var(--txt); font-family: var(--font); font-weight: 600; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, [role='button']:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }
canvas { display: block; }
em { font-style: normal; color: var(--pink2); }
q { quotes: '“' '”'; }

/* ---- the room behind everything: slow pink spotlights */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(130% 90% at 50% 0%, #3c1257 0%, #1f0a30 46%, #10051a 100%); }
#bg i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: 0.35; mix-blend-mode: screen; animation: drift 18s ease-in-out infinite alternate; }
#bg i:nth-child(1) { background: #ff2f86; left: -25vmax; top: -30vmax; }
#bg i:nth-child(2) { background: #7a2cff; right: -30vmax; top: 10vh; animation-duration: 23s; animation-delay: -6s; }
#bg i:nth-child(3) { background: #ff8a3d; left: 10vw; bottom: -45vmax; opacity: 0.18; animation-duration: 27s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { #bg i { animation: none; } }

/* ---- shared bits */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; font-size: 16px; line-height: 1.1; transition: transform 0.12s, background 0.2s, filter 0.2s; text-align: center; }
.btn small { display: block; font-size: 12px; font-weight: 600; opacity: 0.75; }
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.13); }
.btn:active:not(:disabled) { transform: translateY(2px) scale(0.985); }
.btn:disabled { opacity: 0.55; }
.btn.big { min-height: 58px; font-size: 18px; width: 100%; border-radius: 18px; }
.btn.small { min-height: 36px; font-size: 14px; padding: 6px 12px; }
.btn.primary { background: linear-gradient(180deg, #ff86bd, var(--pink) 50%, var(--hot)); border: 0; color: #fff; box-shadow: 0 5px 0 #a30d48, 0 12px 28px rgba(255, 40, 120, 0.38); text-shadow: 0 1px 0 rgba(120, 0, 40, 0.4); flex-direction: column; gap: 0; }
.btn.primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #a30d48; }
.btn.primary:disabled { filter: grayscale(0.85) brightness(0.75); box-shadow: 0 5px 0 #3a2a40; opacity: 1; font-size: 16px; }
.btn.primary.done { background: linear-gradient(180deg, #8dffbf, var(--mint)); box-shadow: 0 5px 0 #17824e; color: #05301b; text-shadow: none; }
.btn.ghost { background: none; border-color: transparent; color: var(--dim); }
.btn.danger { color: #ff9ab0; }
.iconbtn { width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 19px; display: grid; place-items: center; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.back { justify-self: start; color: var(--dim); font-size: 15px; padding: 6px 2px; }
.hint { color: var(--dim); font-size: 13.5px; font-weight: 500; line-height: 1.45; margin: 6px 0 0; }
.wait { color: var(--dim); text-align: center; margin: 6px 0; font-size: 15px; }
.sub { color: var(--dim); font-size: clamp(14px, 3.6vw, 17px); margin: 4px 0 0; line-height: 1.4; font-weight: 500; }
.round-tag { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 13px; letter-spacing: 0.04em; color: var(--dim); white-space: nowrap; }
.code { letter-spacing: 0.14em; color: var(--gold); }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.7); animation: livep 1.4s infinite; vertical-align: 1px; }
@keyframes livep { 70% { box-shadow: 0 0 0 7px rgba(255, 59, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); } }

/* the countdown ring */
.timer { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4.5; }
.timer .tr-bg { stroke: rgba(255, 255, 255, 0.14); }
.timer .tr-fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.timer b { position: relative; font-size: 18px; font-variant-numeric: tabular-nums; }
.timer.low .tr-fg { stroke: var(--hot); }
.timer.low b { color: #ff8fb3; animation: beat 1s infinite; }
@keyframes beat { 50% { transform: scale(1.15); } }

/* ---- screens */
#screen { position: fixed; inset: 0; z-index: 2; overflow: auto; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); display: grid; place-items: center; }
#screen.full { padding: 0; place-items: stretch; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); overflow: hidden; }
#screen.full > * { padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

/* ---- title */
.title { width: min(540px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.title-top { align-self: stretch; display: flex; justify-content: flex-start; }
.hero { position: relative; width: min(230px, 52vw); aspect-ratio: 1; margin-top: -4px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(255, 90, 160, 0.35), rgba(255, 60, 140, 0) 70%); }
.hero-av { width: 100%; height: 100%; }
.hero-bubble { position: absolute; right: -2%; top: 8%; font-size: 30px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-8deg); } }
.logo { margin: -6px 0 0; display: flex; align-items: center; gap: 0.08em; font-family: var(--display); font-weight: 400; line-height: 0.9; font-size: clamp(48px, 13vw, 92px); letter-spacing: 0.01em; transform: rotate(-4deg); }
.logo .w1 { color: #fff; text-shadow: 0 0.06em 0 #8a1d55, 0 0.12em 0 var(--ink); }
.logo .w2 { background: linear-gradient(180deg, #ffc1dc 0%, var(--pink) 45%, #c4004f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0.06em 0 #5c0a2c) drop-shadow(0 0.06em 0 var(--ink)); }
.logo .lips-mark { font-size: 0.62em; transform: rotate(10deg) translateY(-0.1em); animation: smooch 2.6s ease-in-out infinite; }
@keyframes smooch { 0%, 70%, 100% { transform: rotate(10deg) translateY(-0.1em) scale(1); } 78% { transform: rotate(4deg) translateY(-0.12em) scale(1.3); } 86% { transform: rotate(12deg) translateY(-0.1em) scale(0.95); } }
.tag { margin: 0; font-size: clamp(15px, 3.8vw, 19px); color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); font-weight: 500; }
.megas { display: grid; gap: 12px; width: 100%; margin-top: 6px; }
.mega { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.32), 0 14px 32px rgba(0, 0, 0, 0.3); transition: transform 0.15s, border-color 0.2s; }
.mega:hover { transform: translateY(-2px); border-color: var(--pink2); }
.mega:active { transform: translateY(3px); }
.mega .mi { font-size: 34px; }
.mega b { display: block; font-size: 20px; font-weight: 700; }
.mega small { color: var(--dim); font-size: 13.5px; font-weight: 500; }
.mega.host { background: linear-gradient(135deg, rgba(255, 61, 139, 0.42), rgba(42, 15, 58, 0.86) 62%); }
.mega.join { background: linear-gradient(135deg, rgba(122, 44, 255, 0.4), rgba(42, 15, 58, 0.86) 62%); }
.mega.rejoin { background: linear-gradient(135deg, rgba(63, 207, 142, 0.4), rgba(42, 15, 58, 0.86) 62%); }
.title-foot { display: flex; gap: 6px; }
.panel { width: min(440px, 100%); display: grid; gap: 12px; padding: 22px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); animation: rise 0.35s both; }
.panel h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 32px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--dim); letter-spacing: 0.04em; }
.field input { width: 100%; font: inherit; font-size: 18px; color: #fff; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); -webkit-user-select: text; user-select: text; }
.field input.code { text-transform: uppercase; letter-spacing: 0.3em; font-size: 28px; text-align: center; color: var(--gold); }

/* ---- lobby */
.lobby { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; max-width: 1180px; margin: 0 auto; width: 100%; }
.lb-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.codebox { flex: 1; display: flex; flex-direction: column; align-items: center; }
.codebox small { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.codebox b { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 8vw, 44px); letter-spacing: 0.16em; padding-left: 0.16em; color: var(--gold); line-height: 1; text-shadow: 0 3px 0 #8a5a00, 0 0 22px rgba(255, 210, 63, 0.35); }
.qr { width: 64px; height: 64px; flex: none; padding: 4px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 3px rgba(255, 61, 139, 0.6), 0 8px 18px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.qr:hover { transform: scale(1.05); }
.qr svg { width: 100%; height: 100%; display: block; }
.lb-scroll { overflow: auto; display: grid; gap: 14px; align-content: start; padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; }
.lb-foot { padding-top: 8px; }
.me-card { display: grid; gap: 10px; padding: 12px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); }
.me-stage { position: relative; height: min(46vh, 420px); border-radius: 18px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, #4a1a66, #22092f 70%); }
.me-view { width: 100%; height: 100%; }
.cam-slot { position: absolute; right: 10px; top: 10px; width: 26%; max-width: 130px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, 0.35); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); border: 2px solid rgba(255, 255, 255, 0.25); }
.cam-slot:empty { display: none; }
.cam-slot video, .cam-big video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-chip { position: absolute; left: 10px; bottom: 10px; padding: 6px 12px; border-radius: 999px; background: rgba(18, 6, 28, 0.74); font-size: 13px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.locked-badge { position: absolute; left: 10px; top: 10px; padding: 6px 12px; border-radius: 999px; background: var(--mint); color: #05301b; font-size: 13px; font-weight: 700; display: none; }
.me-card.locked .locked-badge { display: block; animation: pop 0.4s both; }
body[data-camstate='off'] .cam-slot, body[data-camstate='denied'] .cam-slot, body[data-camstate='nocamera'] .cam-slot, body[data-camstate='error'] .cam-slot, body[data-camstate='insecure'] .cam-slot, body:not([data-camstate]) .cam-slot { display: none; }
.me-card.locked .me-stage { box-shadow: inset 0 0 0 3px var(--mint); }
.me-actions { display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; text-align: left; padding: 10px 14px; border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); transition: transform 0.12s, background 0.2s; }
.step:active:not(:disabled) { transform: scale(0.985); }
.step i { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 18px; background: rgba(255, 255, 255, 0.12); }
.step span { font-size: 17px; font-weight: 700; }
.step small { font-size: 13px; color: var(--dim); font-weight: 500; }
.step.done i { background: var(--mint); color: #05301b; font-size: 0; }
.step.done i::before { content: '✓'; font-size: 20px; }
.step.next { color: #fff; background: linear-gradient(180deg, #ff86bd, var(--pink) 50%, var(--hot)); border-color: transparent; box-shadow: 0 5px 0 #a30d48, 0 10px 24px rgba(255, 40, 120, 0.35); }
.step.next small { color: rgba(255, 255, 255, 0.85); }
.step.next i { background: #fff; color: var(--hot); }
.step[data-ready].done { background: linear-gradient(180deg, #8dffbf, var(--mint)); color: #05301b; border-color: transparent; }
.step[data-ready].done small { color: #1d5a3c; }
.step[data-ready].done i { background: #05301b; color: #8dffbf; font-size: 20px; }
.step[data-ready].done i::before { content: none; }
.step:disabled { opacity: 0.6; }
.crew h3, .opts h4 { margin: 0 0 8px; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.crew h3 em, .opts h4 em { color: var(--pink2); font-style: normal; }
.crew h3 .aud { color: var(--dim); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 44vw), 1fr)); gap: 10px; }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } .lobby.tv .tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.tile { position: relative; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--pc, #7a2cff) 40%, #2a0f3a), #22092f 80%); border: 2px solid transparent; aspect-ratio: 4 / 5; display: flex; flex-direction: column; }
.tile canvas { flex: 1; width: 100%; min-height: 0; }
.tile.ready { border-color: var(--mint); }
.tile.off { opacity: 0.55; }
.tile-name { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-weight: 700; font-size: 15px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-name em { font-size: 10px; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.2); color: #fff; vertical-align: 2px; }
.tile-state { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 12px; color: var(--dim); }
.tile.ready .tile-state { color: var(--mint); }
.tile .x { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); font-size: 13px; }
.tile.empty { display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, 0.18); background: none; color: var(--dim); font-size: 13px; text-align: center; padding: 10px; }
.tile.add { display: grid; place-items: center; border: 2px dashed rgba(255, 210, 63, 0.4); background: rgba(255, 210, 63, 0.06); color: var(--gold); font-size: 15px; }
.opts { padding: 12px; border-radius: 20px; background: var(--panel2); border: 1px solid var(--line); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); }
.seg button { min-width: 44px; min-height: 38px; padding: 6px 12px; border-radius: 10px; font-weight: 700; color: var(--dim); }
.seg button.on { background: var(--pink); color: #fff; box-shadow: 0 3px 0 #a30d48; }
.seg button:disabled:not(.on) { opacity: 0.5; }
.tv-join { display: flex; gap: 22px; align-items: center; padding: 18px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); }
.tv-join h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 4vw, 40px); }
.tv-join p { margin: 0 0 6px; font-size: 18px; }
.big-qr { width: min(240px, 60vw); aspect-ratio: 1; flex: none; padding: 10px; border-radius: 18px; background: #fff; }
.big-qr svg { width: 100%; height: 100%; display: block; }
@media (min-width: 860px) {
  .lb-scroll { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); align-items: start; }
  .me-card { grid-row: span 2; position: sticky; top: 0; }
  .lobby.tv .lb-scroll { grid-template-columns: 1fr; }
  .lb-foot { max-width: 520px; width: 100%; margin: 0 auto; }
}

/* ---- the editor (in the sheet) */
.editor { width: min(520px, 100%); height: min(860px, calc(100vh - 24px)); height: min(860px, calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); display: grid; grid-template-rows: minmax(190px, 44%) auto minmax(0, 1fr) auto; gap: 10px; padding: 12px; border-radius: 26px; background: #22092f; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: rise 0.3s both; }
.ed-stage { position: relative; border-radius: 18px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, #4f1b6d, #1f0a2c 75%); }
.ed-view { width: 100%; height: 100%; }
.ed-x { position: absolute; left: 10px; top: 10px; width: 40px; height: 40px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); font-size: 16px; }
.ed-dice { position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); font-size: 14px; font-weight: 700; }
.ed-dice span { font-size: 20px; transition: transform 0.3s; }
.ed-dice:active span { transform: rotate(180deg); }
.ed-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ed-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--dim); }
.ed-tabs button span { font-size: 22px; }
.ed-tabs button.on { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 3px 0 #a30d48; }
.ed-panel { overflow: auto; padding: 0 4px 4px; -webkit-overflow-scrolling: touch; }
.ed-panel h4 { margin: 10px 0 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.ed-panel h4:first-child { margin-top: 2px; }
.ed-foot { display: grid; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 6px 14px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.chip span { font-size: 19px; }
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.sliders { display: grid; gap: 6px; }
.sl { display: grid; grid-template-columns: 82px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 6px 12px 4px; border-radius: 14px; background: var(--panel2); }
.sl b { grid-row: span 2; font-size: 15px; }
.sl input { width: 100%; height: 30px; margin: 0; accent-color: var(--pink); touch-action: pan-y; }
.sl .ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: -4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 42px; height: 42px; border-radius: 50%; background: var(--c); border: 3px solid rgba(255, 255, 255, 0.15); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15); }
.sw.on { border-color: #fff; transform: scale(1.08); box-shadow: 0 0 0 3px var(--pink), inset 0 -4px 0 rgba(0, 0, 0, 0.15); }
.sw.nat { width: auto; padding: 0 12px; border-radius: 21px; font-size: 13px; background: linear-gradient(90deg, #f3cfb4, #c96a7a); color: #3a0f20; }

/* ---- sheets: menu, QR, how to play */
#sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(10, 3, 16, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadein 0.2s both; }
@keyframes fadein { from { opacity: 0; } }
.sheet-card { width: min(420px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 10px; padding: 18px; border-radius: 26px; background: #250b33; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: rise 0.25s both; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head b { font-size: 20px; }
.sheet-head button { width: 40px; height: 40px; border-radius: 12px; background: var(--panel2); }
.sheet-card.how p { margin: 0; line-height: 1.5; font-weight: 500; }
.qr-card { justify-items: center; text-align: center; }
.qr-card p { margin: 0; font-size: 18px; }
.qr-card .big-qr { width: min(300px, 76vw); }
.menu-qr { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); text-align: left; }
.menu-qr svg { width: 74px; height: 74px; padding: 4px; border-radius: 10px; background: #fff; flex: none; }
.menu-qr b { display: block; }
.menu-qr small { color: var(--dim); }

/* ---- banner, toast, connection */
#toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 140%); max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 16px; background: #fff; color: #2a0f3a; font-weight: 700; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1); text-align: center; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); }
#net { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -160%); z-index: 90; padding: 7px 14px; border-radius: 999px; background: #ffd23f; color: #3a2400; font-weight: 700; font-size: 14px; transition: transform 0.3s; }
#net.show { transform: translate(-50%, 0); }
#banner { position: fixed; left: 50%; top: 30%; z-index: 70; transform: translate(-50%, -50%) scale(0.6); opacity: 0; pointer-events: none; text-align: center; transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.25s; }
#banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
#banner b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 11vw, 80px); color: #fff; text-shadow: 0 5px 0 var(--hot), 0 10px 30px rgba(0, 0, 0, 0.5); }
#banner small { font-size: 18px; }

/* ---- the brief */
.brief, .rec-watch { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; height: 100%; overflow: auto; }
.brief > .iconbtn, .rec-watch > .iconbtn { position: absolute; left: 12px; top: max(10px, env(safe-area-inset-top)); }
.brief > .round-tag, .rec-watch > .round-tag { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); }
.rec-watch > .timer { position: absolute; right: 12px; top: max(10px, env(safe-area-inset-top)); }
.role-badge { font-size: clamp(70px, 20vw, 120px); line-height: 1; animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4)); }
.brief h1, .rec-watch h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(32px, 9vw, 60px); line-height: 1; animation: rise 0.5s 0.15s both; }
.brief.loose { background: radial-gradient(100% 70% at 50% 30%, rgba(255, 31, 110, 0.5), transparent 70%); }
.brief.loose h1 em { color: #ff4f93; text-shadow: 0 0 24px rgba(255, 60, 140, 0.8); }
.brief.tight h1 em { color: var(--sky); }
.brief .sub { max-width: 520px; animation: rise 0.5s 0.3s both; }
.line-card { margin-top: 8px; width: min(560px, 100%); padding: 18px 22px; border-radius: 26px; background: #fff; color: #2a0f3a; box-shadow: 0 12px 0 rgba(0, 0, 0, 0.25), 0 24px 50px rgba(0, 0, 0, 0.4); animation: pop 0.55s 0.45s both; position: relative; }
.line-card::after { content: ''; position: absolute; left: 50%; bottom: -14px; border: 14px solid transparent; border-top-color: #fff; border-bottom: 0; transform: translateX(-50%); }
.line-card small { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #9a6aa8; margin-bottom: 6px; }
.line-card q { font-size: clamp(22px, 6vw, 34px); font-weight: 700; line-height: 1.2; }
.brief.loose .line-card { box-shadow: 0 0 0 4px var(--pink), 0 12px 0 rgba(0, 0, 0, 0.25), 0 24px 50px rgba(255, 30, 110, 0.4); }
.next { margin-top: 14px; color: var(--dim); font-size: 16px; }
.next b { color: var(--gold); font-size: 22px; font-variant-numeric: tabular-nums; }
.lineup { width: min(900px, 100%); height: min(34vh, 300px); }
.lineup canvas { width: 100%; height: 100%; }
.rec-tiles { width: min(900px, 100%); }
.rec-tiles .tile { aspect-ratio: 1; }

/* ---- recording */
.rec { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; gap: 10px; max-width: 760px; margin: 0 auto; width: 100%; }
.rec-top { display: flex; align-items: center; gap: 10px; }
.line-pill { flex: 1; min-width: 0; padding: 8px 14px; border-radius: 18px; background: #fff; color: #2a0f3a; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.rec.loose .line-pill { box-shadow: 0 0 0 3px var(--pink), 0 6px 18px rgba(0, 0, 0, 0.3); }
.line-pill small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #9a6aa8; }
.line-pill b { display: block; font-size: clamp(16px, 4.4vw, 22px); line-height: 1.2; }
.rec-stage { position: relative; border-radius: 26px; overflow: hidden; background: #0d0414; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }
.cam-big { position: absolute; inset: 0; }
.face-guide { position: absolute; left: 50%; top: 46%; width: min(56%, 300px); aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border: 3px dashed rgba(255, 255, 255, 0.35); border-radius: 50% / 46%; pointer-events: none; }
.rec-av { position: absolute; right: 10px; bottom: 10px; width: 38%; height: 44%; border-radius: 20px; background: radial-gradient(120% 90% at 50% 20%, #4f1b6d, #1f0a2c 75%); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); border: 2px solid rgba(255, 255, 255, 0.2); transition: all 0.35s cubic-bezier(0.3, 1.2, 0.4, 1); }
.rec-replay { position: absolute; right: 10px; top: 10px; width: 28%; max-height: 34%; border-radius: 16px; object-fit: cover; transform: scaleX(-1); border: 2px solid rgba(255, 255, 255, 0.25); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.rec-stage[data-mode='review'] .rec-av, .rec-stage[data-mode='done'] .rec-av { inset: 0; width: 100%; height: 100%; right: 0; bottom: 0; border-radius: 0; border: 0; }
.rec-stage[data-mode='review'] .face-guide, .rec-stage[data-mode='done'] .face-guide, .rec-stage[data-mode='review'] .cam-big, .rec-stage[data-mode='done'] .cam-big { display: none; }
.rec-stage[data-mode='recording'] { box-shadow: 0 0 0 4px #ff3b5c, 0 12px 40px rgba(255, 30, 70, 0.4); }
.rec-badge { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: #ff3b5c; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.rec-badge i { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.rec-stage .cam-chip { top: auto; bottom: 10px; }
.rec-stage[data-mode='review'] .cam-chip, .rec-stage[data-mode='done'] .cam-chip { display: none; }
.rec-foot { display: grid; justify-items: center; gap: 6px; min-height: 120px; align-content: center; }
.recbtn { position: relative; width: 92px; height: 92px; border-radius: 50%; touch-action: none; -webkit-touch-callout: none; }
.recbtn svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.recbtn circle { fill: none; stroke-width: 7; }
.recbtn .rb-bg { stroke: rgba(255, 255, 255, 0.85); }
.recbtn .rb-fg { stroke: #ff3b5c; stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; }
.recbtn i { position: absolute; inset: 14px; border-radius: 50%; background: #ff3b5c; transition: inset 0.2s, border-radius 0.2s; box-shadow: 0 6px 18px rgba(255, 40, 80, 0.5); }
.rec-stage[data-mode='recording'] ~ .rec-foot .recbtn i { inset: 28px; border-radius: 10px; }
.rec-stage[data-mode='recording'] ~ .rec-foot .recbtn { transform: scale(1.12); }
.rec-hint { margin: 0; color: var(--dim); font-size: 14px; text-align: center; max-width: 440px; }
.rev-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; width: 100%; }
.rev-done { font-size: 20px; font-weight: 700; color: var(--mint); animation: pop 0.4s both; }

/* ---- the spotlight */
.judge { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100%; gap: 8px; }
.jd-top { display: flex; align-items: center; gap: 10px; }
.jd-line { flex: 1; min-width: 0; text-align: center; }
.jd-line small { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.jd-line q { font-size: clamp(15px, 4vw, 22px); font-weight: 700; }
.jd-stage { position: relative; border-radius: 28px; overflow: hidden; background: radial-gradient(70% 65% at 50% 45%, #6a2690 0%, #2a0b3c 60%, #12051b 100%); box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.6); }
.jd-stage::before { content: ''; position: absolute; inset: -20% 15% 30%; background: radial-gradient(50% 60% at 50% 0%, rgba(255, 240, 200, 0.28), transparent 70%); pointer-events: none; }
.jd-stage.flash::after { content: ''; position: absolute; inset: 0; background: #fff; animation: flash 0.5s both; pointer-events: none; }
@keyframes flash { from { opacity: 0.35; } to { opacity: 0; } }
.jd-view { position: absolute; inset: 0; width: 100%; height: 100%; }
.jd-name { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 20px; border-radius: 999px; background: color-mix(in srgb, var(--pc, var(--pink)) 70%, #12051b); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); text-align: center; white-space: nowrap; }
.jd-name b { display: block; font-size: clamp(18px, 5vw, 26px); }
.jd-name small { font-size: 12px; opacity: 0.85; letter-spacing: 0.08em; text-transform: uppercase; }
.lights { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(10, 3, 16, 0.92); opacity: 0; pointer-events: none; transition: opacity 0.6s; }
.lights.on { opacity: 1; }
.lights b { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 9vw, 64px); }
.lights small { color: var(--dim); font-size: 16px; margin-top: 6px; }
.jd-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.jd-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); transform-origin: left; transform: scaleX(0); }
.jd-bar.talking { box-shadow: 0 0 14px rgba(255, 61, 139, 0.7); }
.jd-queue { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.jd-queue .q { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 13px; color: var(--dim); border: 1px solid transparent; }
.jd-queue .q.on { background: color-mix(in srgb, var(--pc) 70%, #12051b); color: #fff; border-color: rgba(255, 255, 255, 0.5); transform: scale(1.08); }
.jd-queue .q.past { opacity: 0.45; }

/* ---- the vote */
.vote { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; gap: 8px; max-width: 980px; margin: 0 auto; width: 100%; }
.vt-top { display: flex; align-items: center; gap: 10px; }
.vt-top > .vt-h { flex: 1; min-width: 0; text-align: center; }
.vt-top h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(24px, 6vw, 40px); line-height: 1; }
.vt-top .sub { font-size: 13px; }
.ll-tip { margin: 0; text-align: center; padding: 6px 12px; border-radius: 12px; background: rgba(255, 31, 110, 0.18); color: #ffb3cf; font-size: 14px; }
.suspects { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 44vw), 1fr)); gap: 10px; align-content: start; padding: 4px; }
.sus { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 5; background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 45%, #2a0f3a), #1f0a2c 85%); border: 3px solid transparent; cursor: pointer; transition: transform 0.15s, border-color 0.15s; display: flex; flex-direction: column; }
.sus canvas { flex: 1; min-height: 0; width: 100%; }
.sus b { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 16px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }
.sus b em { font-size: 12px; }
.sus.me { opacity: 0.6; cursor: default; }
.sus.picked { border-color: var(--pink); transform: scale(1.03); box-shadow: 0 0 0 4px rgba(255, 61, 139, 0.35), 0 12px 30px rgba(255, 30, 110, 0.35); }
.sus.picked::after { content: '👉'; position: absolute; left: 8px; top: 6px; font-size: 26px; animation: pop 0.3s both; }
.sus .replay { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); font-size: 16px; }
.sus .locked { position: absolute; left: 8px; bottom: 32px; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: #05301b; font-size: 14px; display: none; place-items: center; font-weight: 700; }
.sus.done .locked { display: grid; }
.vt-foot { display: grid; gap: 4px; }

/* ---- the reveal */
.reveal { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100%; gap: 8px; position: relative; }
.rv-top { display: flex; align-items: center; justify-content: space-between; }
.rv-tally { position: absolute; inset: 70px 12px auto; display: grid; justify-items: center; gap: 10px; z-index: 3; transition: opacity 0.5s, transform 0.5s; }
.rv-tally h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 8vw, 52px); }
.tally { display: grid; gap: 8px; width: min(520px, 100%); }
.tally-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 16px; border-radius: 16px; background: color-mix(in srgb, var(--pc) 35%, #250b33); animation: rise 0.4s both; }
.tally-row:nth-child(2) { animation-delay: 0.15s; }
.tally-row:nth-child(3) { animation-delay: 0.3s; }
.tally-row:nth-child(n + 4) { animation-delay: 0.45s; }
.tally-row b { font-size: 18px; }
.tally-row .n { font-weight: 700; color: var(--gold); }
.tally-row small { grid-column: 1 / -1; color: var(--dim); font-size: 13px; }
.reveal:not([data-step='tally']) .rv-tally { opacity: 0; transform: translateY(-20px); pointer-events: none; }
.rv-stage { position: relative; border-radius: 28px; overflow: hidden; background: radial-gradient(70% 70% at 50% 40%, #5a1f7c, #23092f 70%); opacity: 0; transition: opacity 0.5s; }
.reveal:not([data-step='tally']) .rv-stage { opacity: 1; }
.reveal[data-step='quiver'] .rv-stage { background: radial-gradient(50% 60% at 50% 40%, #6b2a4a, #1a0612 75%); }
.rv-view { position: absolute; inset: 0; width: 100%; height: 100%; }
.stamps { position: absolute; left: 0; right: 0; top: 4%; display: flex; justify-content: space-around; align-items: center; pointer-events: none; }
.stamp { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 8vw, 56px); padding: 6px 18px; border: 5px solid currentColor; border-radius: 12px; transform: rotate(-12deg); animation: stamp 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both; text-shadow: 0 3px 10px rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.25); }
@keyframes stamp { from { transform: rotate(-12deg) scale(3); opacity: 0; } }
.stamp.busted { color: #ff4f93; }
.stamp.innocent { color: var(--sky); }
.stamp.slipped { color: var(--gold); }
.rv-caption { text-align: center; min-height: 64px; }
.rv-caption h2 { margin: 0; font-size: clamp(22px, 6vw, 34px); font-weight: 700; }
.rv-caption p { margin: 4px 0 0; color: var(--dim); font-size: 15px; }
.rv-caption q { color: #fff; font-weight: 700; }
.rv-points .pts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rv-points .pts span { padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--pc) 50%, #250b33); animation: pop 0.4s both; }
.rv-points .pts b { color: var(--gold); }
.rv-points .none { color: var(--dim); }

/* ---- scores */
.scores, .end { display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; overflow: auto; }
.sc-top { width: 100%; display: flex; align-items: center; gap: 10px; }
.sc-top h2 { flex: 1; margin: 0; text-align: center; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 7vw, 42px); }
.board { list-style: none; margin: 0; padding: 0; width: min(620px, 100%); display: grid; gap: 8px; }
.board li { display: grid; grid-template-columns: 32px 52px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 0 10px; padding: 8px 14px 8px 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); animation: rise 0.4s both; }
.board li:nth-child(2) { animation-delay: 0.08s; }
.board li:nth-child(3) { animation-delay: 0.16s; }
.board li:nth-child(n + 4) { animation-delay: 0.24s; }
.board .rank { grid-row: span 2; font-size: 20px; font-weight: 700; color: var(--dim); text-align: center; }
.board .board-av { grid-row: span 2; width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--pc) 50%, #250b33); }
.board b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board b em { font-size: 12px; }
.board .bar { grid-column: 3; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.board .bar i { display: block; height: 100%; width: 0; background: var(--pc); border-radius: 4px; transition: width 1.2s cubic-bezier(0.3, 1, 0.4, 1) 0.3s; }
.scores.go .board .bar i { width: var(--w); }
.board .score { grid-row: span 2; grid-column: 4; font-size: 24px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.board .score em { font-size: 14px; color: var(--mint); }
.board li:first-child { border-color: rgba(255, 210, 63, 0.5); }
.board.compact li { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-rows: auto; }
.board.compact .rank, .board.compact .score { grid-row: auto; grid-column: auto; }
.board.compact li.win { background: linear-gradient(90deg, rgba(255, 210, 63, 0.25), var(--panel)); }

/* ---- the final tally */
.final { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; height: 100%; gap: 8px; position: relative; overflow: hidden; }
.fn-top { display: flex; align-items: center; gap: 10px; }
.fn-title { flex: 1; margin: 0; text-align: center; font-family: var(--display); font-weight: 400; font-size: clamp(28px, 8vw, 54px); }
.fn-stage { position: relative; border-radius: 28px; overflow: hidden; background: radial-gradient(80% 70% at 50% 30%, #4a1866, #1a0726 80%); }
.fn-view { position: absolute; inset: 0; width: 100%; height: 100%; }
.fn-stage .spot { position: absolute; inset: 0; background: radial-gradient(18% 70% at 50% 0%, rgba(255, 245, 200, 0.35), transparent 70%); opacity: 0; transition: opacity 0.8s; pointer-events: none; animation: sweep 3.2s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateX(-30%); } to { transform: translateX(30%); } }
.final.won .spot { opacity: 1; animation: none; }
.fn-scores { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.fs { min-width: 72px; padding: 6px 10px; border-radius: 14px; background: color-mix(in srgb, var(--pc) 40%, #250b33); text-align: center; border: 2px solid transparent; }
.fs b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.fs .n { font-size: 26px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; display: inline-block; }
.fs.bump .n { animation: bump 0.25s; }
@keyframes bump { 50% { transform: scale(1.3); } }
.fs.stop { opacity: 0.75; }
.fs.win { opacity: 1; border-color: var(--gold); box-shadow: 0 0 24px rgba(255, 210, 63, 0.6); transform: scale(1.1); }
.fn-winner { text-align: center; min-height: 0; }
.fn-winner b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 9vw, 60px); color: var(--gold); text-shadow: 0 4px 0 #8a5a00; animation: pop 0.6s both; }
.fn-winner small { color: var(--dim); font-size: 16px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 2px; animation: fall linear both; }
@keyframes fall { to { transform: translateY(120vh) rotate(var(--r)); } }
.awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.award { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 10px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); animation: pop 0.5s both; min-width: 200px; }
.award:nth-child(2) { animation-delay: 0.25s; }
.award:nth-child(3) { animation-delay: 0.5s; }
.award span { grid-row: span 2; font-size: 30px; }
.award small { color: var(--dim); }

/* ---- the end */
.end-stage { width: min(560px, 100%); height: min(30vh, 260px); flex: none; }
.end-stage canvas { width: 100%; height: 100%; }
.end-foot { width: min(560px, 100%); display: grid; gap: 8px; margin-top: auto; padding-bottom: 6px; }
.end-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.end-row .btn { flex-direction: column; gap: 0; }

@media (max-height: 560px) {
  .me-stage { height: 52vh; }
  .rec-foot { min-height: 96px; }
  .recbtn { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

#camhold { position: fixed; left: -10px; top: -10px; width: 2px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ---- alone: the face lab */
.solo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.solo-row .btn { flex-direction: column; gap: 0; font-size: 15px; }
.lab { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 8px; height: 100%; max-width: 760px; margin: 0 auto; width: 100%; }
.lab-top { display: flex; align-items: center; gap: 10px; }
.lab-top > div:nth-child(2) { flex: 1; min-width: 0; }
.lab-top b { display: block; font-size: 20px; }
.lab-top small { color: var(--dim); font-size: 12px; }
.cam-chip.static { position: static; white-space: nowrap; }
.lab-stage { position: relative; border-radius: 26px; overflow: hidden; background: radial-gradient(70% 65% at 50% 45%, #6a2690 0%, #2a0b3c 60%, #12051b 100%); }
.lab-stage[data-mode='recording'] { box-shadow: 0 0 0 4px #ff3b5c; }
.lab-av { position: absolute; inset: 0; width: 100%; height: 100%; }
.lab-cam { width: 30%; max-width: 170px; }
.lab-read { position: absolute; left: 10px; bottom: 8px; right: 10px; font: 600 11px ui-monospace, monospace; color: rgba(255, 255, 255, 0.6); text-shadow: 0 1px 2px #000; }
.lab-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.lab-faces button { min-width: 38px; padding: 6px 4px; font-size: 18px; }
.lab-foot { display: grid; justify-items: center; gap: 6px; min-height: 150px; align-content: center; }
.lab-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lab-stage[data-mode='recording'] ~ .lab-foot .recbtn i { inset: 28px; border-radius: 10px; }

/* fit to my face: the button on your own picture, and the coach that asks for three faces */
.fit-btn { position: absolute; right: 10px; bottom: 10px; padding: 6px 12px; border-radius: 999px; background: rgba(18, 6, 28, 0.74); color: #fff; font-size: 13px; font-weight: 700; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: none; }
body[data-camstate='live'] .me-card:not(.locked) .fit-btn { display: block; }
.fit-coach { position: fixed; z-index: 60; left: 50%; top: 10px; transform: translateX(-50%); min-width: 230px; padding: 14px 22px 18px; border-radius: 24px; background: rgba(18, 6, 28, 0.9); color: #fff; text-align: center; display: grid; gap: 2px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); pointer-events: none; overflow: hidden; }
.fit-coach b { font-size: 54px; line-height: 1.1; }
.fit-coach span { font-size: 24px; font-weight: 800; }
.fit-coach small { font-size: 14px; opacity: 0.75; }
.fit-coach i { position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--mint); transform-origin: left; animation: fitbar linear both; }
@keyframes fitbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* the face lab's recording session: a countdown, the cue word big over the avatar, the take's plan */
.sess-bar { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: rgba(255, 255, 255, 0.15); }
.sess-bar i { display: block; height: 100%; background: #ff3b5c; transform-origin: left; transform: scaleX(0); }
.sess-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; font-weight: 800; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); pointer-events: none; animation: pop 0.3s both; }
.sess-cue { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: max-content; max-width: 92%; padding: 10px 22px 12px; border-radius: 22px; background: rgba(18, 6, 28, 0.86); text-align: center; display: grid; gap: 2px; pointer-events: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sess-cue b { font-size: clamp(26px, 7vw, 48px); font-weight: 800; line-height: 1.1; color: #fff; }
.sess-cue small { font-size: 15px; color: var(--dim); min-height: 1em; }
.sess-cue.rest b { font-size: 22px; font-weight: 600; color: var(--dim); }
.sess-plan { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 30px; }
.sess-plan span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 13px; font-weight: 700; }
.sess-plan span.on { background: #ff3b5c; color: #fff; }
.sess-title { margin: 0; font-size: 22px; }
.sess-title em { font-style: normal; font-size: 14px; color: var(--mint); }
.sess-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; max-width: 440px; color: var(--dim); font-size: 14px; }
.sess-foot .btn.big { min-width: 240px; }
[data-ssave].glow { background: var(--mint); color: #05301b; animation: pop 0.4s both; }
