/* Хипстер-бинго: a night club in your hand. Players on top, the disco ball and the record in the middle, your question,
   your bingo card at the bottom. Five neon colours = five questions. */
:root {
  --ink: #120a26;
  --ink-2: #1b1238;
  --ink-3: #281c4d;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f7f3ff;
  --text-dim: #b4a9d6;
  --r: #ff4d5e;
  --y: #ffd23f;
  --g: #3ddc84;
  --b: #3fa9ff;
  --p: #b06cff;
  --x: #ffd27a;
  --gold: #ffd23f;
  --ok: #3ddc84;
  --no: #ff4d5e;
  --cat: #ffffff;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(180deg, rgba(18, 10, 38, 0.55), rgba(18, 10, 38, 0.92)), url('/img/bg_phone.webp') center / cover fixed, var(--ink);
  color: var(--text); font: 500 15px/1.35 var(--font); overscroll-behavior: none; -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
body.wide { background-image: linear-gradient(180deg, rgba(18, 10, 38, 0.5), rgba(18, 10, 38, 0.9)), url('/img/bg_wide.webp'); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; }
[hidden] { display: none !important; }
.app { position: relative; height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; }
.muted { color: var(--text-dim); }
.center { text-align: center; }
.small { font-size: 13px; }
.tiny { font-size: 11px; margin-top: 14px; }
.strong { font-weight: 700; }
.hide { visibility: hidden; }
.grow { flex: 1; }

/* ---------------------------------------------------------------- shared pieces */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px;
  font-weight: 700; font-size: 16px; background: var(--ink-3); border: 1px solid var(--line); transition: transform 0.08s, filter 0.15s; }
.btn:active { transform: scale(0.97); }
.btn.big { min-height: 54px; font-size: 18px; }
.btn.wide { width: 100%; }
.btn.small { min-height: 34px; font-size: 13px; padding: 0 10px; }
.btn.gold { background: linear-gradient(180deg, #ffe17a, #f5b81c); color: #2a1a00; border: 0; box-shadow: 0 3px 0 #a87510, 0 0 22px rgba(255, 210, 63, 0.25); }
.btn.ghost { background: transparent; }
.btn[disabled] { filter: grayscale(1) brightness(0.6); pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--ink-3); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip.hot { background: rgba(255, 77, 94, 0.25); border-color: var(--r); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); position: relative; flex: none; }
.face { position: relative; width: var(--fs, 40px); height: var(--fs, 40px); border-radius: 50%; overflow: hidden; flex: none; background: var(--ink-3); border: 2px solid rgba(255, 255, 255, 0.28); }
.face img, .face video { width: 100%; height: 100%; object-fit: cover; display: block; }
.face video { transform: scaleX(-1); }
.face.off { filter: grayscale(1) brightness(0.55); }
.face.talking { box-shadow: 0 0 0 3px var(--ok); }
.face.tiny { --fs: 22px; border-width: 1.5px; }
.face.mid { --fs: 44px; }
.face.big { --fs: 74px; border: 3px solid var(--gold); box-shadow: 0 0 30px rgba(255, 210, 63, 0.6); }
.toast { position: fixed; z-index: 90; left: 50%; top: calc(env(safe-area-inset-top) + 54px); transform: translateX(-50%); max-width: min(92vw, 480px); padding: 10px 16px; border-radius: 14px;
  background: #2c2150; border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-weight: 700; text-align: center; animation: toast-in 0.2s ease-out; }
.toast.warn { background: #4a1f2a; border-color: #a5394d; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 10px var(--cat); flex: none; }
.langs { display: inline-flex; background: var(--ink-3); border-radius: 99px; padding: 3px; border: 1px solid var(--line); }
.langs button { padding: 5px 12px; border-radius: 99px; font-weight: 700; font-size: 13px; color: var(--text-dim); }
.langs button.on { background: var(--text); color: var(--ink); }
.field { width: 100%; height: 52px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.18); background: #0d071d; color: var(--text); padding: 0 14px; font-size: 18px; font-weight: 600; outline: none; user-select: text; -webkit-user-select: text; }
.field:focus { border-color: var(--gold); }
.label { font-weight: 700; font-size: 14px; color: var(--text-dim); margin: 0 0 8px; }
.why { text-align: center; color: var(--gold); font-weight: 700; font-size: 14px; min-height: 18px; margin: 0; }
.note { font-size: 13px; font-weight: 600; color: var(--text-dim); margin: 6px 0 0; }
.linkbtn { display: block; margin: 8px auto 0; font-size: 12px; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn[disabled] { opacity: 0.4; }

/* ---------------------------------------------------------------- brand, join */
.join { flex: 1; overflow-y: auto; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.djf { width: 72px; height: 72px; border-radius: 20px; overflow: hidden; flex: none; box-shadow: 0 6px 22px rgba(176, 108, 255, 0.35); border: 2px solid rgba(255, 255, 255, 0.2); }
.djf img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; color: #fff; text-shadow: 0 0 18px rgba(176, 108, 255, 0.7); }
.rainbow { margin: 6px 0 0; display: flex; align-items: center; gap: 4px; color: var(--text-dim); font-weight: 600; font-size: 14px; }
.rainbow i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.rainbow span { margin-inline-start: 6px; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.faces { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.faces button { aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid transparent; background: var(--ink-3); position: relative; }
.faces button img { width: 100%; height: 100%; object-fit: cover; }
.faces button.on { border-color: var(--gold); transform: scale(1.06); }
.faces .selfie { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; gap: 1px; background: #2f2257; }
.faces .selfie b { font-size: 20px; }
.cam { position: relative; width: 210px; height: 210px; border-radius: 50%; overflow: hidden; margin: 0 auto; border: 4px solid var(--gold); background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lvl { text-align: start; padding: 10px 12px; border-radius: 14px; background: var(--ink-2); border: 2px solid var(--line); display: flex; flex-direction: column; gap: 3px; transition: transform 0.08s; }
.lvl b { font-size: 16px; font-weight: 800; }
.lvl small { font-size: 12px; color: var(--text-dim); font-weight: 500; line-height: 1.25; }
.lvl.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(255, 210, 63, 0.16), rgba(255, 210, 63, 0.04)); }
.lvl:active { transform: scale(0.98); }

/* ---------------------------------------------------------------- lobby */
.lobby { flex: 1; overflow-y: auto; padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.roomline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.roomno { font-size: 13px; font-weight: 700; color: var(--text-dim); display: flex; align-items: baseline; gap: 6px; }
.roomno b { font-size: 28px; color: var(--text); font-weight: 800; letter-spacing: 0.02em; }
.dj-say { display: flex; gap: 10px; align-items: flex-start; }
.dj-say .djf { width: 52px; height: 52px; border-radius: 16px; }
.bubble { flex: 1; background: #f7f1ff; color: #2a1747; border-radius: 16px; border-start-start-radius: 4px; padding: 9px 12px; font-weight: 600; font-size: 14px; min-height: 46px; display: flex; align-items: center; }
.panel { background: rgba(27, 18, 56, 0.85); border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plist.tv { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.member { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 12px; }
.member.me { background: rgba(255, 255, 255, 0.07); }
.member .face { --fs: 36px; }
.member .nm { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .nm small { display: block; font-weight: 600; font-size: 11.5px; color: var(--text-dim); }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team { border-radius: 16px; background: rgba(27, 18, 56, 0.85); border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.team.mine { border-color: var(--gold); }
.team .head { display: flex; align-items: center; }
.team h3 { margin: 0; font-size: 16px; font-weight: 800; }
.team .head .n { margin-inline-start: auto; }
.team ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.team.t1 { box-shadow: inset 0 3px 0 var(--r); } .team.t2 { box-shadow: inset 0 3px 0 var(--b); } .team.t3 { box-shadow: inset 0 3px 0 var(--y); } .team.t4 { box-shadow: inset 0 3px 0 var(--g); }
.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.how div { background: rgba(27, 18, 56, 0.85); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.how b { display: block; font-size: 20px; margin-bottom: 2px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.setrow:last-child { border-bottom: 0; }
.setrow .k { font-weight: 700; font-size: 14px; }
.seg { display: inline-flex; background: var(--ink); border-radius: 12px; padding: 3px; border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { padding: 6px 9px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.seg button.on { background: var(--gold); color: #2a1a00; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.chips button { flex: 1; min-width: 96px; padding: 8px 8px; border-radius: 12px; background: var(--ink); border: 2px solid var(--line); font-weight: 700; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.chips button small { color: var(--text-dim); font-size: 11px; font-weight: 600; }
.chips button.on { border-color: var(--gold); background: rgba(255, 210, 63, 0.1); }
.chips button[disabled] { opacity: 0.35; }
.lobby-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.btnrow { display: flex; gap: 8px; margin-top: 10px; }
.btnrow .btn { flex: 1; }
.btnrow .btn.grow { flex: 2; }
.scoreline { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; font-size: 14px; margin: 8px 0; color: var(--text-dim); }
.scoreline b { color: var(--gold); font-size: 16px; }
.tvjoin { display: flex; gap: 18px; align-items: center; background: rgba(27, 18, 56, 0.85); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.tvjoin .big { font-size: 22px; font-weight: 800; }
.tvjoin .url { font-size: 28px; font-weight: 800; color: var(--gold); margin: 4px 0 8px; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: 180px; height: 180px; flex: none; }
.qr img { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- the game screen */
.game { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.topbar { display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top) + 6px) 10px 4px; }
.topbar .roomno b { font-size: 20px; }
.roundno { font-size: 12px; font-weight: 800; color: var(--text-dim); margin-inline-start: 6px; padding: 2px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }
.roundno:empty { display: none; }

/* players on top */
.units { display: flex; gap: 6px; padding: 2px 10px 6px; overflow-x: auto; scrollbar-width: none; flex: none; }
.units::-webkit-scrollbar { display: none; }
.unit { flex: none; width: 62px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 3px 5px; border-radius: 14px; background: rgba(27, 18, 56, 0.7); border: 1px solid var(--line); position: relative; transition: transform 0.2s, box-shadow 0.3s; }
.units.many .unit { width: 58px; }
.units.teams .unit { width: 104px; }
.units.teams .uname { font-size: 12px; }
.unit.me { background: rgba(255, 255, 255, 0.1); }
.unit.turn { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255, 210, 63, 0.35); }
.unit.near { box-shadow: 0 0 0 2px var(--r), 0 0 20px rgba(255, 77, 94, 0.55); animation: nearpulse 1.4s infinite; }
.unit.out { opacity: 0.4; }
.unit.winner { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255, 210, 63, 0.8); transform: scale(1.05); }
@keyframes nearpulse { 50% { box-shadow: 0 0 0 2px var(--r), 0 0 30px rgba(255, 77, 94, 0.85); } }
.unit .faces { display: flex; position: relative; }
.unit .faces .face { --fs: 30px; }
.unit .faces.n2 .face, .unit .faces.n3 .face { --fs: 26px; margin-inline-start: -9px; }
.unit .faces.n2 .face:first-child, .unit .faces.n3 .face:first-child { margin-inline-start: 0; }
.badge { position: absolute; bottom: -4px; inset-inline-end: -6px; min-width: 18px; height: 18px; border-radius: 9px; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid var(--ink); background: #3a2d63; }
.badge.ok { background: var(--ok); color: #062b16; }
.badge.no { background: var(--no); color: #fff; }
.badge.spin { top: -6px; bottom: auto; inset-inline-start: -8px; inset-inline-end: auto; background: var(--gold); font-size: 10px; }
.uname { font-size: 10.5px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 2px; }
.lvlb { position: absolute; top: -5px; inset-inline-end: -7px; font-size: 12px; line-height: 1; filter: drop-shadow(0 1px 1px #000); }
.mini { display: grid; gap: 1.5px; }
.mini.s3 { grid-template-columns: repeat(3, 8px); } .mini.s4 { grid-template-columns: repeat(4, 7px); } .mini.s5 { grid-template-columns: repeat(5, 6px); }
.mini i { aspect-ratio: 1; border-radius: 2px; opacity: 0.32; }
.mini i.m { opacity: 1; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
.mini i.w { box-shadow: 0 0 0 1.5px var(--gold); }
.mini i.pop { animation: cellpop 0.6s; }
.mini i.poof { animation: cellpoof 0.8s; }
:is(.cell, .mini i).r { background: var(--r); } :is(.cell, .mini i).y { background: var(--y); } :is(.cell, .mini i).g { background: var(--g); } :is(.cell, .mini i).b { background: var(--b); } :is(.cell, .mini i).p { background: var(--p); }

/* the stage */
.stage { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; position: relative; }
.arena { flex: 1; position: relative; container-type: size; overflow: hidden; }
.spots { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(circle at 15% 30%, rgba(255, 77, 94, 0.18), transparent 22%), radial-gradient(circle at 85% 25%, rgba(63, 169, 255, 0.18), transparent 24%),
  radial-gradient(circle at 70% 85%, rgba(176, 108, 255, 0.18), transparent 25%), radial-gradient(circle at 25% 80%, rgba(61, 220, 132, 0.12), transparent 22%); opacity: 0.7; transition: opacity 0.6s; }
.m-spinning .spots { animation: spots 1.2s linear infinite; opacity: 1; }
@keyframes spots { to { filter: hue-rotate(360deg); } }
.ballwrap { position: absolute; left: 50%; top: 50%; width: min(92cqmin, 560px); height: min(92cqmin, 560px); transform: translate(-50%, -50%); transition: all 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); z-index: 2; }
.ball-cv { display: block; touch-action: none; }
.ball-cv.grab { cursor: grab; filter: drop-shadow(0 0 18px rgba(255, 210, 63, 0.45)); animation: ballhint 1.8s ease-in-out infinite; }
@keyframes ballhint { 50% { transform: rotate(-8deg) scale(1.02); } }
.m-listen .ballwrap, .m-reveal .ballwrap { left: 46px; top: 46px; width: 82px; height: 82px; }
[dir='rtl'] .m-listen .ballwrap, [dir='rtl'] .m-reveal .ballwrap { left: auto; right: -36px; }
.m-over .ballwrap { opacity: 0.25; }
.m-reveal .ballwrap { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }

/* the record: spins while the song plays, its ring of lights is the timer; at the reveal it flips into the cover */
.deck { position: absolute; left: 50%; top: 50%; width: min(78cqmin, 480px); height: min(78cqmin, 480px); transform: translate(-50%, -50%) scale(0.6); opacity: 0; transition: all 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); perspective: 900px; pointer-events: none; }
.deck.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.m-reveal .deck { left: 28%; width: min(62cqmin, 420px); height: min(62cqmin, 420px); }
[dir='rtl'] .m-reveal .deck { left: 72%; }
.lights { position: absolute; inset: -9%; width: 118%; height: 118%; overflow: visible; }
.lights circle { fill: rgba(255, 255, 255, 0.12); transition: fill 0.25s; }
.lights circle.on { fill: var(--cat); filter: drop-shadow(0 0 2px var(--cat)); }
.lights circle.low { fill: #fff; }
.lights circle.done { fill: rgba(255, 255, 255, 0.06); }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.3, 1.4, 0.5, 1); }
.flip.flipped { transform: rotateY(180deg); }
.vinyl, .cover { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.vinyl { border-radius: 50%; background: radial-gradient(circle, #222 0 18%, #0b0b0f 19% 22%, #1a1a20 23%, #0b0b0f 24%, #17171d 40%, #0b0b0f 41%, #1b1b21 60%, #0b0b0f 61%, #18181e 80%, #0b0b0f 81% 100%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.06); }
.grooves { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, rgba(255, 255, 255, 0.12), transparent 12%, transparent 45%, rgba(255, 255, 255, 0.1) 55%, transparent 65%); }
.deck.spinning .vinyl { animation: spin 1.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vinyl .label { position: absolute; left: 33%; top: 33%; width: 34%; height: 34%; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25), 0 0 20px var(--cat); }
.vinyl .label i { position: absolute; left: 50%; top: 50%; width: 10%; height: 10%; margin: -5% 0 0 -5%; border-radius: 50%; background: #0b0b0f; }
.cover { transform: rotateY(180deg); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 3px var(--cat), 0 0 30px var(--cat); background: #222; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .yr { position: absolute; bottom: 6px; inset-inline-end: 6px; background: var(--gold); color: #2a1a00; font-weight: 800; font-size: 18px; padding: 2px 9px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); }
.songinfo { position: absolute; top: 6px; bottom: 6px; inset-inline-start: 52%; inset-inline-end: 10px; opacity: 0; transition: opacity 0.4s 0.35s; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; }
.songinfo.on { opacity: 1; }
.si-t { font-size: clamp(15px, 9cqmin, 24px); font-weight: 800; line-height: 1.12; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.si-h { font-size: 12px; color: var(--text-dim); font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.si-a { font-size: clamp(13px, 7cqmin, 18px); font-weight: 700; color: #e8ddff; overflow-wrap: anywhere; margin-top: 3px; line-height: 1.15; }
.si-y { font-size: 13px; color: var(--text-dim); font-weight: 600; margin-top: 3px; }
.si-y b { color: var(--gold); font-size: 18px; }
.djhead { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.djhead .djf { width: 36px; height: 36px; border-radius: 11px; border-width: 1.5px; }
.djhead .roomno b { font-size: 18px; }
.djhead.talk .djf { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(255, 210, 63, 0.6); }
.caption { position: absolute; z-index: 6; left: 50%; bottom: 8px; transform: translate(-50%, 8px); width: max-content; max-width: calc(100% - 20px); padding: 6px 12px; border-radius: 12px;
  background: rgba(10, 5, 24, 0.86); border: 1px solid rgba(255, 210, 63, 0.55); color: #fff; font-weight: 600; font-size: 14px; line-height: 1.3; text-align: center;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.caption.on { opacity: 1; transform: translate(-50%, 0); }
.caption::before { content: '🦝 '; }
.banner { position: absolute; inset: 0; z-index: 5; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; pointer-events: none; background: radial-gradient(circle, rgba(18, 10, 38, 0.75), rgba(18, 10, 38, 0.2) 70%); }
.banner.on { display: flex; animation: bannerin 0.6s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes bannerin { from { transform: scale(0.5); opacity: 0; } }
.banner .bingo { font-size: clamp(44px, 22cqmin, 92px); font-weight: 800; letter-spacing: 0.04em; line-height: 1; display: flex; }
.banner .bingo i { font-style: normal; color: var(--c); text-shadow: 0 0 18px var(--c), 0 0 4px #fff; animation: letter 1.2s ease-in-out infinite; animation-delay: calc(var(--k) * 0.12s); }
@keyframes letter { 50% { transform: translateY(-10%) scale(1.08); } }
.banner .bingo.small { font-size: clamp(30px, 12cqmin, 54px); color: var(--gold); text-shadow: 0 0 18px rgba(255, 210, 63, 0.7); }
.banner .who { display: flex; gap: 8px; align-items: center; }
.banner .wn { font-size: 18px; font-weight: 800; }
.banner.win { justify-content: flex-start; padding-top: 6%; }
.m-reveal .deck { top: calc(50% - 16px); }
.banner .vs { font-size: 26px; }

/* the question and the answer */
.ask { flex: none; padding: 6px 12px 8px; max-height: 50dvh; overflow-y: auto; }
.qhead { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; margin-bottom: 8px; }
.qhead b { font-size: 18px; font-weight: 800; }
.qhead small { flex-basis: 100%; padding-inline-start: 20px; font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.qhead .count { margin-inline-start: auto; font-size: 22px; font-weight: 800; color: var(--cat); min-width: 32px; text-align: end; font-variant-numeric: tabular-nums; }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; padding: 6px 8px; border-radius: 14px; background: rgba(40, 28, 77, 0.92); border: 2px solid var(--line); font-weight: 700; font-size: 15px; transition: transform 0.08s, background 0.15s; text-align: center; }
.opt:active { transform: scale(0.96); }
.opt.on { background: var(--cat); color: #170b2c; border-color: #fff; box-shadow: 0 0 22px var(--cat); }
.opt.big { min-height: 72px; font-size: 18px; }
.opt.big b { font-size: 26px; }
.opt .face.tiny { position: absolute; top: -6px; inset-inline-end: -6px; }
.opt .face.tiny ~ .face.tiny { inset-inline-end: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.decs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.years { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.opt.yr { min-height: 42px; font-size: 16px; font-variant-numeric: tabular-nums; }
.four { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.four .opt { min-height: 64px; }
.four .tx { font-size: 14.5px; line-height: 1.15; overflow-wrap: anywhere; }
.four small { font-size: 11px; font-weight: 600; opacity: 0.75; line-height: 1.15; }
.prompt { display: flex; align-items: center; justify-content: center; gap: 10px; flex-direction: column; text-align: center; padding: 6px 0 10px; }
.prompt b { font-size: 20px; font-weight: 800; }
.prompt span { font-size: 15px; font-weight: 600; color: var(--text-dim); }
.prompt.me b { color: var(--gold); }
.who-in { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.who-in span { opacity: 0.35; transition: opacity 0.3s; }
.who-in span.in { opacity: 1; }
.tvq { display: flex; flex-direction: column; gap: 4px; font-weight: 700; margin-bottom: 8px; }
.actsrow { display: flex; gap: 8px; align-items: center; }
.actsrow .note { flex: 1; text-align: center; margin: 0; }

/* the reveal */
.result { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 14px; margin-bottom: 4px; position: relative; padding-inline-end: 36px; }
.result .flag { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; font-size: 13px; background: rgba(255, 255, 255, 0.08); opacity: 0.7; }
.result .flag.sent { opacity: 0.25; }
.result b { font-size: 18px; font-weight: 800; }
.result span { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.result s { opacity: 0.6; font-weight: 600; margin-inline-start: 4px; }
.result.ok { background: rgba(61, 220, 132, 0.18); box-shadow: inset 0 0 0 2px var(--ok); }
.result.no { background: rgba(255, 77, 94, 0.14); box-shadow: inset 0 0 0 2px rgba(255, 77, 94, 0.6); }
.todo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin: 4px 0; }
.todo.mark { color: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.55; } }
.steal { background: rgba(255, 210, 63, 0.1); border: 1px solid rgba(255, 210, 63, 0.5); border-radius: 14px; padding: 8px 10px; margin: 6px 0; }
.steal p { margin: 0 0 6px; font-weight: 800; }
.ruler { position: relative; height: 58px; margin: 4px 16px 0; }
.ruler .line { position: absolute; left: 0; right: 0; top: 34px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--p), var(--b)); opacity: 0.7; }
.ruler .truth { position: absolute; top: 24px; transform: translateX(-50%); width: 3px; height: 28px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
[dir='rtl'] .ruler .truth { transform: translateX(50%); }
.ruler .truth b { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #2a1a00; padding: 0 6px; border-radius: 6px; font-size: 13px; font-weight: 800; }
.ruler .pin { position: absolute; top: calc(var(--row) * 14px - 4px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0; }
[dir='rtl'] .ruler .pin { transform: translateX(50%); }
.ruler .pin span { font-size: 10px; font-weight: 800; }
.ruler .pin.ok .face { border-color: var(--ok); }
.ruler .pin.no .face { border-color: var(--no); opacity: 0.8; }
.ruler .end { position: absolute; top: 40px; font-size: 10px; color: var(--text-dim); }
.ruler .end.lo { inset-inline-start: 0; } .ruler .end.hi { inset-inline-end: 0; }
.achips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.achip { display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, 0.07); border: 1.5px solid var(--line); max-width: 100%; }
.achip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.achip.ok { border-color: var(--ok); }
.achip.no { opacity: 0.75; }

/* my bingo card */
.mycard { --cs: 46px; flex: none; display: grid; gap: 5px; justify-content: center; padding: 6px 12px 10px; transition: all 0.4s; }
.mycard.s3 { grid-template-columns: repeat(3, calc(var(--cs) * 1.15)); }
.mycard.s4 { grid-template-columns: repeat(4, var(--cs)); }
.mycard.s5 { grid-template-columns: repeat(5, calc(var(--cs) * 0.86)); }
.m-listen .mycard { --cs: 30px; }
.m-spin .mycard, .m-spinning .mycard { --cs: 40px; }
.m-reveal .mycard { --cs: 38px; }
.m-reveal .mycard.can { --cs: 44px; }
.cell { position: relative; aspect-ratio: 1; border-radius: 22%; opacity: 0.55; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.3); transition: transform 0.15s, opacity 0.25s, box-shadow 0.25s; }
.cell.m { opacity: 1; }
.stamp { position: absolute; inset: 13%; border-radius: 50%; background: radial-gradient(circle, #111 0 7%, #fff 8% 30%, #151518 31% 40%, #26262c 41% 55%, #151518 56% 70%, #222228 71% 100%); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), inset 0 0 0 1.5px rgba(255, 255, 255, 0.18); }
.cell.hot { opacity: 1; animation: hot 0.9s ease-in-out infinite; box-shadow: 0 0 0 3px #fff, 0 0 22px var(--cat); cursor: pointer; z-index: 1; }
.cell.best::before { content: '★'; position: absolute; top: -9px; inset-inline-end: -7px; font-size: 16px; color: var(--gold); text-shadow: 0 0 6px #000; }
@keyframes hot { 50% { transform: scale(1.08); } }
.mycard.can .cell:not(.hot):not(.m) { opacity: 0.25; }
.cell.w { opacity: 1; box-shadow: 0 0 0 3px var(--gold), 0 0 24px var(--gold); animation: hot 0.7s ease-in-out infinite; }
.cell.pop { animation: cellpop 0.6s; }
.cell.poof { animation: cellpoof 0.9s; }
@keyframes cellpop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes cellpoof { 0% { filter: brightness(3); transform: scale(1.2) rotate(8deg); } 100% { filter: none; transform: none; } }
.bigcard { display: grid; gap: 6px; justify-content: center; margin: 8px 0 14px; }
.bigcard.s3 { grid-template-columns: repeat(3, 58px); } .bigcard.s4 { grid-template-columns: repeat(4, 50px); } .bigcard.s5 { grid-template-columns: repeat(5, 44px); }
.bigcard .cell { --cs: 50px; }
.bigcard .cell.stealable { opacity: 1; box-shadow: 0 0 0 3px #fff, 0 0 16px rgba(255, 255, 255, 0.6); animation: hot 1s ease-in-out infinite; }
.rival { border-top: 1px solid var(--line); padding-top: 8px; }
.rh { display: flex; align-items: center; gap: 6px; }
.rh .face { --fs: 30px; }

/* ---------------------------------------------------------------- sheets, coach, flashes */
.sheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(6, 3, 14, 0.6); animation: fade 0.18s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; z-index: 71; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100vw, 560px); max-height: 84dvh; overflow-y: auto; background: #1d1440; border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); border-top: 1px solid rgba(255, 255, 255, 0.12); animation: up 0.22s ease-out; }
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); margin: 0 auto 8px; }
.sheet h2 { margin: 4px 0 10px; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sheet h2 .x { margin-inline-start: auto; }
.sheet h2 .face { --fs: 34px; margin-inline-end: -4px; }
.sheet .sec { margin: 14px 0 6px; font-size: 13px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.sheet .btn.wide { margin-top: 8px; }
.rule { display: flex; gap: 10px; padding: 7px 0; font-size: 14.5px; font-weight: 500; }
.rule b { font-size: 20px; width: 26px; flex: none; text-align: center; }
.kinds { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.kinds div { display: grid; grid-template-columns: 16px 1fr 1fr; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; }
.kinds .dot { box-shadow: none; }
.vol { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 700; font-size: 14px; }
.vol span { width: 72px; }
.vol input { flex: 1; accent-color: var(--gold); }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-weight: 700; font-size: 14px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--gold); }
.track { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.track img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.track .play { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #2a1a00; font-size: 15px; font-weight: 800; flex: none; }
.track .play.on { background: var(--r); color: #fff; }
.track .ti { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.track .ti b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .ti span { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .ti small { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.track .ti small .dot { width: 9px; height: 9px; box-shadow: none; }
.track .got { display: flex; gap: 2px; }
.coach { position: fixed; z-index: 65; max-width: min(330px, 88vw); background: var(--gold); color: #2a1a00; border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 14px; line-height: 1.3;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: toast-in 0.2s; }
.coach .ok { display: block; margin-top: 8px; margin-inline-start: auto; padding: 6px 12px; border-radius: 9px; background: #2a1a00; color: var(--gold); font-weight: 800; font-size: 13px; }
.coach::after { content: ''; position: absolute; width: 14px; height: 14px; background: var(--gold); transform: rotate(45deg); left: var(--ax, 50%); margin-left: -7px; }
.coach.below::after { top: -6px; } .coach.above::after { bottom: -6px; } .coach.inside::after { display: none; }
.unlock { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 140px); padding: 10px 16px; border-radius: 99px; background: var(--gold); color: #2a1a00; font-weight: 800; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.05); } }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 60; animation: flash 0.9s ease-out forwards; }
.flash.steal { background: rgba(255, 77, 94, 0.25); }
@keyframes flash { to { opacity: 0; } }
.callnote { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.rotate { display: none; }
@media (min-aspect-ratio: 4/3) and (max-height: 500px) {
  body:not(.wide) .rotate { display: flex; position: fixed; inset: 0; z-index: 100; background: var(--ink); flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 18px; }
  body:not(.wide) .rotate b { font-size: 48px; }
}
@media (max-height: 680px) {
  .unit .faces .face { --fs: 26px; }
  .m-reveal .mycard, .m-reveal .mycard.can { --cs: 36px; }
  .m-listen .mycard { --cs: 24px; }
  .ruler { height: 50px; }
  .m-spin .mycard, .m-spinning .mycard { --cs: 34px; }
  .opt.big { min-height: 58px; }
}

/* ---------------------------------------------------------------- wide screens (laptop, TV): the same parts side by side */
body.wide .app { max-width: none; }
body.wide .lobby { max-width: 1000px; margin: 0 auto; width: 100%; }
body.wide .game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 34vw); grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: 'top top' 'units units' 'stage ask' 'stage card'; padding: 0 16px 12px; gap: 0 18px; }
body.wide .topbar { grid-area: top; }
body.wide .units { grid-area: units; justify-content: center; gap: 10px; }
body.wide .unit { width: 96px; }
body.wide .unit .faces .face { --fs: 52px; }
body.wide .uname { font-size: 14px; }
body.wide .mini.s3 { grid-template-columns: repeat(3, 16px); } body.wide .mini.s4 { grid-template-columns: repeat(4, 14px); } body.wide .mini.s5 { grid-template-columns: repeat(5, 12px); }
body.wide .stage { grid-area: stage; min-height: 0; }
body.wide .ask { grid-area: ask; max-height: none; align-self: center; font-size: 17px; }
body.wide .mycard { grid-area: card; --cs: 58px; }
body.wide .m-listen .mycard { --cs: 44px; }
body.wide .djhead .djf { width: 52px; height: 52px; }
body.wide .djhead .bubble { font-size: 18px; }
body.wide .game.tv .ask { grid-row: ask / card; }
body.wide .m-listen .ballwrap, body.wide .m-reveal .ballwrap { left: 80px; top: 80px; width: 150px; height: 150px; }
body.wide .si-h { font-size: 16px; }
body.wide .si-t { font-size: clamp(22px, 7cqmin, 44px); }
body.wide .si-a { font-size: clamp(18px, 5cqmin, 30px); }
body.wide .si-y { font-size: 18px; } body.wide .si-y b { font-size: 26px; }
body.wide .caption { font-size: 18px; }
body.wide .tvq { font-size: 20px; }
body.wide .who-in .face { --fs: 52px; }
body.wide .unlock { bottom: 24px; top: auto; }
.hero { width: 100%; border-radius: 20px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(176, 108, 255, 0.25); }
.rainbow i.r { background: var(--r); color: var(--r); } .rainbow i.y { background: var(--y); color: var(--y); } .rainbow i.g { background: var(--g); color: var(--g); } .rainbow i.b { background: var(--b); color: var(--b); } .rainbow i.p { background: var(--p); color: var(--p); }
