:root {
  --bg: #14112a;
  --bg2: #1e1940;
  --card: rgba(255, 255, 255, 0.07);
  --card-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6f4ff;
  --muted: #b7b1d9;
  --accent: #ff4fa3;
  --accent2: #7b6cff;
  --good: #1fae7a;
  --bad: #ff4d5e;
  --warn: #f4a300;
  --radius: 22px;
  --font: 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
[hidden] { display: none !important; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.err { color: #ff8a96; min-height: 1.2em; margin: 8px 0 0; }
code, kbd { background: var(--card-strong); padding: 1px 6px; border-radius: 6px; font-family: ui-monospace, monospace; }

/* ---------- background blobs */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-blobs span {
  position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.35; animation: drift 18s ease-in-out infinite alternate;
}
.bg-blobs span:nth-child(1) { background: #ff4fa3; top: -20vmax; left: -15vmax; }
.bg-blobs span:nth-child(2) { background: #6c63ff; bottom: -25vmax; right: -15vmax; animation-delay: -6s; }
.bg-blobs span:nth-child(3) { background: #00c2a8; top: 30%; left: 40%; width: 35vmax; height: 35vmax; opacity: 0.2; animation-delay: -12s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.1); } }

body[data-event='bom'] .bg-blobs span:nth-child(1) { background: #ff3b30; }
body[data-event='kilat'] .bg-blobs span:nth-child(3) { background: #ffd60a; opacity: 0.3; }
body[data-event='buta'] .bg-blobs span { opacity: 0.12; }
body[data-event='final'] .bg-blobs span:nth-child(3) { background: #ffd700; opacity: 0.35; }

/* ---------- screen */
.screen { position: fixed; inset: 0; display: none; flex-direction: column; padding: 24px 32px; overflow-y: auto; }
.screen.active { display: flex; animation: fadeIn 0.35s ease; }
.screen.center { align-items: center; justify-content: center; text-align: center; }
.screen.pad { padding: 20px 16px 96px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(10px); }

.logo { font-size: clamp(2.4rem, 6vw, 3.6rem); margin: 0; font-weight: 700; letter-spacing: -1px; }
.logo span { color: var(--accent); display: inline-block; transform: rotate(-4deg); }
.tagline { color: var(--muted); margin: 4px 0 18px; }

/* ---------- tombol */
.btn {
  border: 0; cursor: pointer; color: white; font-weight: 600; font-size: 1.1rem;
  padding: 12px 24px; border-radius: 16px;
  background: linear-gradient(180deg, #ff6bb5, var(--accent));
  box-shadow: 0 5px 0 #b3236c, 0 10px 24px rgba(255, 79, 163, 0.3);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b3236c; }
.btn:disabled { filter: grayscale(1) brightness(0.7); cursor: not-allowed; }
.btn.big { font-size: 1.35rem; padding: 16px 28px; width: 100%; }
.btn.small { font-size: 0.95rem; padding: 8px 14px; }
.btn.ghost { background: var(--card-strong); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.icon-btn { border: 0; background: var(--card-strong); color: white; font-size: 1.4rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.top-right { position: fixed; top: 16px; right: 16px; z-index: 50; }

.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--card-strong); border-radius: 999px; padding: 6px 14px; font-weight: 600; white-space: nowrap; }
.pill.big { font-size: 1.1rem; padding: 10px 18px; margin-top: 12px; }
.event-pill { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.spacer { flex: 1; }

/* ---------- host: setup */
.setup-card { width: min(560px, 100%); text-align: center; }
.setup-card h3 { margin: 10px 0; text-align: left; }
.quiz-list { display: grid; gap: 10px; margin-bottom: 14px; max-height: 40vh; overflow-y: auto; }
.quiz-card {
  text-align: left; border: 2px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 16px; padding: 12px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-size: 1.05rem;
}
.quiz-card small { color: var(--muted); }
.quiz-card.selected { border-color: var(--accent); background: rgba(255, 79, 163, 0.15); }
.quiz-card:disabled { opacity: 0.5; cursor: not-allowed; }
.check { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--muted); }

/* ---------- host: lobby */
.lobby-top { display: flex; gap: 20px; justify-content: center; align-items: stretch; flex-wrap: wrap; }
.join-box { text-align: center; min-width: 340px; }
.join-step { font-size: 1.25rem; color: var(--muted); }
.join-step b { color: var(--text); font-size: 1.5rem; }
.pin { font-size: clamp(3.5rem, 9vw, 6.5rem); font-weight: 700; letter-spacing: 6px; line-height: 1.1; margin-top: 6px; }
.alt-urls { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.qr-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.qr-box img { width: 180px; height: 180px; border-radius: 12px; background: white; }
.qr-box small { color: var(--muted); }
.lobby-bar { display: flex; align-items: center; gap: 16px; margin: 20px auto 12px; width: min(1100px, 100%); }
.lobby-bar .count { font-size: 1.3rem; }
.lobby-bar .count b { font-size: 2rem; }
.quiz-title { flex: 1; text-align: center; color: var(--muted); }
.lobby-players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-content: flex-start; flex: 1; width: min(1100px, 100%); margin: 0 auto; }
.lobby-players .empty { color: var(--muted); font-size: 1.4rem; }
.chip {
  border: 0; cursor: pointer; color: var(--text); font-size: 1.2rem; font-weight: 600;
  background: var(--card-strong); border-radius: 999px; padding: 8px 16px 8px 8px;
  display: inline-flex; align-items: center; gap: 8px; height: fit-content;
}
.chip .av { font-size: 1.6rem; background: rgba(255, 255, 255, 0.12); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; }
.chip:hover { background: rgba(255, 77, 94, 0.4); text-decoration: line-through; }
.chip.off { opacity: 0.4; }
.pop-in { animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn { from { transform: scale(0); } }
.hint { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }

/* ---------- event roulette */
.roulette { font-size: clamp(7rem, 20vw, 13rem); line-height: 1.1; margin: 20px 0 6px; }
.roulette.landed, .ev-icon.landed { animation: land 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes land { 0% { transform: scale(0.3) rotate(-30deg); } 60% { transform: scale(1.25) rotate(8deg); } }
.ev-name { font-size: clamp(2rem, 5vw, 3.6rem); margin: 0; }
.ev-desc { font-size: clamp(1.1rem, 2.5vw, 1.7rem); color: var(--muted); margin: 8px 0 0; max-width: 800px; }
body[data-event='bom'] #screen-event.active { animation: shake 0.5s 2s 2; }
@keyframes shake { 25% { transform: translate(-8px, 4px); } 50% { transform: translate(8px, -4px); } 75% { transform: translate(-6px, -2px); } }

/* ---------- host: soal */
.q-top { display: flex; align-items: center; gap: 12px; padding-right: 60px; flex-wrap: wrap; }
.q-top h2 { margin: 0; }
.q-main { display: flex; align-items: center; gap: 24px; margin: 18px 0; flex: 1; min-height: 0; }
.q-text { flex: 1; font-size: clamp(1.8rem, 4vw, 3.2rem); margin: 0; text-align: center; line-height: 1.2; }
.q-text.small { font-size: clamp(1.4rem, 3vw, 2.2rem); flex: 0; margin: 16px 0; }
.q-image { max-height: 28vh; max-width: 60%; object-fit: contain; align-self: center; border-radius: 16px; margin-bottom: 16px; }
.timer { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 9; }
.timer .track { stroke: var(--card-strong); }
.timer .bar { stroke: var(--accent2); stroke-linecap: round; transition: stroke 0.3s; }
.timer .bar.urgent { stroke: var(--bad); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; font-weight: 700; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  position: relative; overflow: hidden; background: var(--c); border-radius: 18px; padding: 18px 22px; min-height: 96px;
  display: flex; align-items: center; gap: 16px; font-size: clamp(1.2rem, 2.4vw, 1.9rem); font-weight: 600;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.tile:nth-child(2) { animation-delay: 0.07s; }
.tile:nth-child(3) { animation-delay: 0.14s; }
.tile:nth-child(4) { animation-delay: 0.21s; }
.tile .ic { font-size: 2.2em; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.25)); position: relative; }
.tile .tx { position: relative; flex: 1; }
.tile .cnt { position: relative; font-size: 1.6em; font-weight: 700; }
.tile .fill { position: absolute; inset: 0 auto 0 0; width: var(--w); background: rgba(255, 255, 255, 0.22); animation: grow 1s ease-out; }
@keyframes grow { from { width: 0; } }
.tile.no { filter: grayscale(0.85) brightness(0.55); }
.tile.ok { outline: 5px solid white; outline-offset: -5px; animation: okPulse 0.8s ease 2; }
@keyframes okPulse { 50% { transform: scale(1.03); } }

.reveal-info { display: flex; gap: 24px; margin-top: 18px; align-items: flex-start; flex-wrap: wrap; }
.fastest { font-size: 1.4rem; background: var(--card); border-radius: 16px; padding: 12px 18px; }
.fastest .av { font-size: 1.6rem; }
.notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.notes li { background: var(--card); border-radius: 12px; padding: 8px 14px; font-size: 1.1rem; animation: fadeIn 0.4s backwards; }
.notes li:nth-child(2) { animation-delay: 0.15s; }
.notes li:nth-child(3) { animation-delay: 0.3s; }

/* ---------- host: papan skor */
.lb { position: relative; width: min(900px, 100%); margin: 28px auto 0; }
.lb-row {
  position: absolute; left: 0; right: 0; top: 0; height: 66px;
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: var(--card-strong); border-radius: 16px; font-size: 1.5rem; font-weight: 600;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.6s;
}
.lb-row:first-child { background: linear-gradient(90deg, rgba(255, 215, 0, 0.35), rgba(255, 255, 255, 0.1)); }
.lb-row .rk { width: 36px; color: var(--muted); }
.lb-row .av { font-size: 2rem; }
.lb-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .fire { font-size: 1.1rem; }
.lb-row .up { color: #5ef2a8; font-size: 1rem; }
.lb-row .down { color: #ff8a96; font-size: 1rem; }
.lb-row .gain { color: #5ef2a8; font-size: 1.05rem; }
.lb-row .gain.neg { color: #ff8a96; }
.lb-row .sc { min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- host: podium */
.end-title { text-align: center; font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 12px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; min-height: 46vh; }
.pcol { width: min(220px, 28vw); display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(60px); transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
.pcol.show { opacity: 1; transform: none; }
.pav { font-size: 4.5rem; animation: bounce 1.2s ease-in-out infinite; }
.pname { font-size: 1.5rem; font-weight: 700; text-align: center; }
.pscore { color: var(--muted); font-size: 1.2rem; margin-bottom: 8px; }
.pblock { width: 100%; border-radius: 18px 18px 0 0; display: grid; place-items: center; font-size: 3rem; }
.p1 .pblock { height: 30vh; background: linear-gradient(180deg, #ffd700, #c99a00); }
.p2 .pblock { height: 21vh; background: linear-gradient(180deg, #d9dde6, #9aa1ad); }
.p3 .pblock { height: 14vh; background: linear-gradient(180deg, #e39a5b, #a5612b); }
.pblock.empty { opacity: 0.25; }
.end-extra { opacity: 0; transition: opacity 0.8s; display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 16px; }
.end-extra.show { opacity: 1; }
.awards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.award { display: flex; gap: 12px; align-items: center; padding: 12px 16px; min-width: 220px; }
.award .aw-ic { font-size: 2.4rem; }
.award small { color: var(--muted); }
.final-list { columns: 2; column-gap: 32px; width: min(700px, 100%); margin: 0; padding-left: 24px; }
.final-list li { padding: 3px 0; break-inside: avoid; }
.final-list li span { display: inline-block; min-width: 70%; }

/* ---------- host: feed & reaksi */
.feed { position: fixed; left: 16px; bottom: 16px; display: flex; flex-direction: column-reverse; gap: 8px; z-index: 40; max-width: 420px; pointer-events: none; }
.feed-item {
  background: rgba(20, 17, 42, 0.88); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; font-size: 1.1rem;
  animation: slideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); transition: opacity 0.4s, transform 0.4s;
}
.feed-item .fi { font-size: 1.4rem; }
.feed-item.out { opacity: 0; transform: translateX(-30px); }
@keyframes slideIn { from { transform: translateX(-120%); } }
.reactions-layer { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.float-react { position: absolute; bottom: -80px; display: flex; flex-direction: column; align-items: center; animation: floatUp 3.2s ease-out forwards; }
.float-react span { font-size: 3rem; }
.float-react small { background: rgba(0, 0, 0, 0.45); padding: 1px 8px; border-radius: 8px; font-size: 0.8rem; }
@keyframes floatUp {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  10% { opacity: 1; transform: translate(0, -60px) scale(1.1); }
  100% { transform: translate(var(--dx), -85vh) scale(1); opacity: 0; }
}

.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: grid; place-items: center; z-index: 100; padding: 16px; }
.overlay .card { max-width: 420px; text-align: center; background: var(--bg2); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* ================================================= PEMAIN (HP) */
.join-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: left; }
.join-card .logo { text-align: center; font-size: 2.6rem; margin-bottom: 6px; }
.join-card label, .join-card .label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--muted); }
.join-card input {
  font: inherit; font-size: 1.4rem; font-weight: 600; text-align: center; color: var(--text);
  background: rgba(0, 0, 0, 0.25); border: 2px solid var(--line); border-radius: 14px; padding: 12px; outline: none;
}
.join-card input:focus { border-color: var(--accent); }
#inPin { letter-spacing: 6px; font-size: 1.8rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.av-btn { font-size: 1.7rem; aspect-ratio: 1; border: 2px solid transparent; background: var(--card); border-radius: 12px; cursor: pointer; padding: 0; }
.av-btn.selected { border-color: var(--accent); background: rgba(255, 79, 163, 0.2); transform: scale(1.08); }

.me-avatar { font-size: 6rem; }
.bounce { animation: bounce 1.4s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-14px); } }
.inv-preview { margin-top: 10px; }
.inv-chip { display: inline-block; background: var(--card-strong); border-radius: 999px; padding: 5px 12px; margin: 3px; }

.ev-icon { font-size: 7rem; margin: 16px 0 4px; }

.q-screen { padding: 12px 12px 10px; gap: 8px; }
.p-top { display: flex; gap: 6px; align-items: center; }
.p-top .pill { font-size: 0.9rem; padding: 5px 10px; }
.tbar { height: 8px; background: var(--card-strong); border-radius: 99px; overflow: hidden; }
.tbar div { height: 100%; width: 100%; background: linear-gradient(90deg, var(--bad), var(--warn), var(--good)); border-radius: 99px; }
.p-qtext { margin: 2px 4px; font-size: 1.1rem; font-weight: 600; text-align: center; max-height: 22vh; overflow-y: auto; }
.buffs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.buffs:empty { display: none; }
.buff { background: rgba(255, 215, 0, 0.18); border: 1px solid rgba(255, 215, 0, 0.4); border-radius: 999px; padding: 3px 10px; font-size: 0.9rem; }
.buff.big { border-radius: 14px; padding: 8px 14px; font-size: 1rem; margin: 6px; display: inline-block; }

.p-answers-wrap { position: relative; flex: 1; min-height: 0; }
.p-answers { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; height: 100%; }
.p-answers.two { grid-template-columns: 1fr; }
.p-ans {
  border: 0; border-radius: 18px; background: var(--c); color: white; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); transition: transform 0.08s, opacity 0.3s, filter 0.3s;
  font-size: 1.05rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); min-height: 0;
}
.p-ans .ic { font-size: 2.8rem; }
.p-ans .tx { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.p-ans:active { transform: translateY(4px) scale(0.98); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.p-ans.chosen { outline: 4px solid white; transform: scale(0.96); }
.p-ans.removed { opacity: 0.12; pointer-events: none; filter: grayscale(1); }
.goyang .p-ans { animation: goyang 1.1s ease-in-out infinite; animation-delay: var(--d); }
@keyframes goyang {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(12px, -8px) rotate(5deg); }
  50% { transform: translate(-10px, 6px) rotate(-6deg) scale(0.92); }
  75% { transform: translate(6px, 10px) rotate(3deg); }
}

.fog {
  position: absolute; inset: -6px; border-radius: 20px; z-index: 5; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 30% 30%, #e9e6f5, #a9a3c4 60%, #8a84a8);
  color: #2b2550; font-size: 1.2rem; touch-action: manipulation; user-select: none; cursor: pointer;
}
.fog > div { font-size: 1.1rem; line-height: 1.5; pointer-events: none; }
.fog > div::first-line { font-size: 3rem; }

.powerbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 2px; min-height: 64px; align-items: center; justify-content: center; }
.pw {
  flex-shrink: 0; border: 1px solid var(--line); background: var(--card-strong); color: var(--text);
  border-radius: 14px; padding: 6px 12px; display: flex; flex-direction: column; align-items: center; cursor: pointer; min-width: 70px;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pw:disabled { opacity: 0.4; }
.pw-ic { font-size: 1.6rem; }
.pw-nm { font-size: 0.75rem; font-weight: 600; }

.locked-ic { width: 120px; height: 120px; border-radius: 28px; display: grid; place-items: center; font-size: 4rem; margin-bottom: 8px; animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
#waitPowerWrap { margin-top: 18px; }

#screen-result.good { background: radial-gradient(circle at 50% 30%, rgba(31, 174, 122, 0.55), transparent 70%); }
#screen-result.bad { background: radial-gradient(circle at 50% 30%, rgba(255, 77, 94, 0.5), transparent 70%); }
#screen-result.none { background: radial-gradient(circle at 50% 30%, rgba(244, 163, 0, 0.4), transparent 70%); }
.res-ic { font-size: 5.5rem; animation: land 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
#resTitle { margin: 4px 0; font-size: 2.4rem; }
.res-gain { font-size: 2.6rem; font-weight: 700; color: #5ef2a8; }
.res-gain.neg { color: #ff8a96; }
.res-streak { font-size: 1.3rem; margin-top: 4px; }
#resNotes { margin: 12px 0; width: min(380px, 100%); }
#resNotes li { font-size: 0.95rem; }
.big-rank { font-size: 5.5rem; font-weight: 700; line-height: 1.1; animation: land 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.end-awards { margin: 12px 0; }

.react-bar {
  position: fixed; left: 0; right: 0; bottom: 0; display: none; justify-content: center; gap: 4px; padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  background: rgba(20, 17, 42, 0.85); border-top: 1px solid var(--line); z-index: 20;
}
body[data-screen='lobby'] .react-bar, body[data-screen='wait'] .react-bar, body[data-screen='result'] .react-bar,
body[data-screen='leaderboard'] .react-bar, body[data-screen='end'] .react-bar, body[data-screen='event'] .react-bar { display: flex; }
.react-bar button { border: 0; background: var(--card); font-size: 1.6rem; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; padding: 0; }
.react-bar button.bump { animation: bump 0.3s; }
@keyframes bump { 50% { transform: scale(1.4) translateY(-6px); } }

.freeze {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(170, 230, 255, 0.85), rgba(60, 140, 220, 0.92)); color: #0b2a4a; text-align: center;
  backdrop-filter: blur(6px); animation: fadeIn 0.2s;
}
.freeze .ice { font-size: 6rem; animation: shake 0.4s 3; }
.freeze h2 { font-size: 3rem; margin: 0; }
.freeze-count { font-size: 4rem; font-weight: 700; }

.modal { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 16px; }
.modal .card { width: min(360px, 100%); background: var(--bg2); text-align: center; }
.modal h3 { margin-top: 0; }
.spy-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.spy-row span { font-size: 1.6rem; }
.spy-bar { flex: 1; height: 16px; background: var(--card-strong); border-radius: 99px; overflow: hidden; }
.spy-bar i { display: block; height: 100%; border-radius: 99px; }

.toasts { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(20, 17, 42, 0.95); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; animation: drop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); transition: opacity 0.3s; max-width: 100%; }
.toast.out { opacity: 0; }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } }

/* ---------- landing */
.landing { width: min(520px, 100%); text-align: center; display: flex; flex-direction: column; gap: 14px; }
.landing a { text-decoration: none; display: block; }
.landing .btn { display: block; width: 100%; }
.landing .btn.alt { background: linear-gradient(180deg, #9a8fff, var(--accent2)); box-shadow: 0 5px 0 #4a3fc0, 0 10px 24px rgba(123, 108, 255, 0.3); }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; font-size: 0.95rem; color: var(--muted); margin-top: 6px; }

@media (max-width: 760px) {
  .screen { padding: 16px; }
  .answers { grid-template-columns: 1fr; }
  .q-main { flex-direction: column; }
  .timer { width: 90px; height: 90px; }
  .join-box { min-width: 0; width: 100%; }
  .lb-row { font-size: 1.1rem; padding: 0 12px; gap: 8px; }
  .final-list { columns: 1; }
  .features { grid-template-columns: 1fr; }
}

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