:root {
  --bg1: #1a0b3d;
  --bg2: #3b0f6b;
  --bg3: #0b2a5b;
  --ink: #fff;
  --ink-soft: rgba(255, 255, 255, .72);
  --glass: rgba(255, 255, 255, .09);
  --glass-strong: rgba(255, 255, 255, .16);
  --line: rgba(255, 255, 255, .18);
  --accent: #ffd23f;
  --accent2: #ff5d8f;
  --good: #3ddc97;
  --bad: #ff4d6d;
  --shadow: 0 20px 60px rgba(0, 0, 0, .35);
  --radius: 22px;
  --font: 'Rubik', system-ui, sans-serif;
  --display: 'Secular One', 'Rubik', sans-serif;
}
body.kids {
  --bg1: #0c4a8a;
  --bg2: #1597c9;
  --bg3: #6a2bc2;
  --accent: #ffe14d;
  --accent2: #ff7ab6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg1);
  background: linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background .8s;
}
button, input { font-family: inherit; }

/* ---------- Animated background ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.bg span {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
  animation: float 18s ease-in-out infinite alternate;
}
.bg span:nth-child(1) { width: 45vmax; height: 45vmax; background: #ff2e88; top: -15vmax; right: -10vmax; }
.bg span:nth-child(2) { width: 40vmax; height: 40vmax; background: #3a86ff; bottom: -15vmax; left: -10vmax; animation-duration: 22s; }
.bg span:nth-child(3) { width: 28vmax; height: 28vmax; background: #ffbe0b; top: 40%; left: 40%; opacity: .25; animation-duration: 26s; }
.bg span:nth-child(4) { width: 22vmax; height: 22vmax; background: #8338ec; top: 10%; left: 10%; animation-duration: 15s; }
body.kids .bg span:nth-child(1) { background: #ff9f1c; }
body.kids .bg span:nth-child(2) { background: #2ec4b6; }
body.kids .bg span:nth-child(3) { background: #ffe14d; opacity: .4; }
@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, -4vh) scale(1.12); }
  100% { transform: translate(-5vw, 5vh) scale(.92); }
}
.bg .shape {
  position: absolute; font-size: 2.2rem; opacity: .14; filter: none; border-radius: 0;
  animation: drift linear infinite; width: auto; height: auto; background: none;
}
@keyframes drift {
  from { transform: translateY(110vh) rotate(0); }
  to { transform: translateY(-20vh) rotate(360deg); }
}

/* ---------- Generic ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.logo {
  font-family: var(--display);
  font-size: 2rem;
  margin: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2), #7df9ff, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
  letter-spacing: .02em;
}
@keyframes shimmer { to { background-position: 300% 0; } }

.btn {
  --c: var(--accent);
  appearance: none; border: 0; cursor: pointer;
  font-weight: 800; font-size: 1.15rem;
  padding: .9em 1.6em; border-radius: 999px;
  color: #1a0b3d; background: var(--c);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform .12s, box-shadow .12s, filter .2s, opacity .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.pink { --c: var(--accent2); color: #fff; }
.btn.ghost { background: var(--glass-strong); color: #fff; box-shadow: none; border: 1px solid var(--line); }
.btn.big { font-size: 1.5rem; padding: .8em 2.2em; }
.btn.block { width: 100%; }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--glass); color: #fff;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
  display: grid; place-items: center; transition: background .2s, transform .15s;
}
.icon-btn:hover { background: var(--glass-strong); transform: scale(1.08); }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, calc(100% + 40px));
  background: #fff; color: #1a0b3d; font-weight: 700; padding: .8em 1.4em; border-radius: 999px;
  box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2, 1.6, .4, 1), opacity .25s, visibility .35s; z-index: 100;
  max-width: calc(100vw - 32px); text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

.scene { animation: sceneIn .6s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: none; } }
.pop-in { animation: popIn .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.4) rotate(-6deg); } to { opacity: 1; transform: none; } }
.stagger > * { animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.stagger > *:nth-child(1) { animation-delay: .05s; } .stagger > *:nth-child(2) { animation-delay: .12s; }
.stagger > *:nth-child(3) { animation-delay: .19s; } .stagger > *:nth-child(4) { animation-delay: .26s; }
.stagger > *:nth-child(5) { animation-delay: .33s; } .stagger > *:nth-child(6) { animation-delay: .40s; }
.stagger > *:nth-child(7) { animation-delay: .47s; } .stagger > *:nth-child(8) { animation-delay: .54s; }
.stagger > *:nth-child(9) { animation-delay: .61s; } .stagger > *:nth-child(10) { animation-delay: .68s; }
.wiggle { animation: wiggle 2.4s ease-in-out infinite; display: inline-block; }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) scale(1.05); } }
.bounce { animation: bounce 1.4s ease-in-out infinite; display: inline-block; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.blank {
  display: inline-block; min-width: 4.5em; border-bottom: .12em solid var(--accent);
  margin: 0 .15em; height: 1em; vertical-align: baseline;
}
.blank.filled { min-width: 0; height: auto; color: var(--accent); padding: 0 .2em; }

.avatar {
  display: grid; place-items: center; border-radius: 50%;
  width: 64px; height: 64px; font-size: 2.2rem;
  background: var(--c, #fff); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), 0 6px 18px rgba(0, 0, 0, .25);
  border: 3px solid rgba(255, 255, 255, .85); flex-shrink: 0;
}
.avatar.sm { width: 40px; height: 40px; font-size: 1.35rem; border-width: 2px; }
.avatar.lg { width: 110px; height: 110px; font-size: 4rem; }

/* ================= HOST ================= */
body.host { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.topbar {
  position: relative; z-index: 10;
  display: flex; align-items: center; gap: 12px; padding: 14px 24px; flex-shrink: 0;
}
.topbar .spacer { flex: 1; }
.room-chip {
  font-weight: 800; background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
  padding: .4em 1em; display: flex; align-items: center; gap: .6em;
}
.room-chip small { font-weight: 500; color: var(--ink-soft); }
.room-chip span { letter-spacing: .15em; direction: ltr; }
#stage { flex: 1; display: flex; align-items: safe center; justify-content: center; padding: 0 32px 12px; min-height: 0; position: relative; overflow-y: auto; }
@media (max-height: 820px) {
  .pslot { aspect-ratio: auto; height: clamp(90px, 16vh, 150px); }
  .pslot.filled .avatar { width: 48px; height: 48px; font-size: 1.6rem; }
  .join-card { padding: 18px; gap: 6px; }
  .room-code { font-size: clamp(2.6rem, 6vw, 4rem); }
  .btn.big { font-size: 1.25rem; }
}
#stage > .scene { width: 100%; max-width: 1400px; }

/* Lobby */
.lobby { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 32px; align-items: stretch; }
.join-card { padding: 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.join-card .qr { background: #fff; padding: 14px; border-radius: 18px; width: min(260px, 30vh); aspect-ratio: 1; display: grid; place-items: center; }
.join-card .qr svg, .join-card .qr img { width: 100%; height: 100%; }
.join-card .url { direction: ltr; font-weight: 600; color: var(--ink-soft); word-break: break-all; font-size: .95rem; }
.room-code {
  font-family: var(--display); font-size: clamp(3rem, 7vw, 5.5rem); line-height: 1; letter-spacing: .12em;
  direction: ltr; color: var(--accent); text-shadow: 0 6px 0 rgba(0, 0, 0, .25);
}
.join-card h3 { margin: 6px 0 0; font-weight: 600; color: var(--ink-soft); }
.lobby-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lobby-main h2 { margin: 0; font-family: var(--display); font-size: 2.2rem; display: flex; align-items: center; gap: 12px; }
.lobby-main h2 .count { font-family: var(--font); font-size: 1.1rem; background: var(--glass-strong); padding: .2em .8em; border-radius: 999px; }
.lobby-players { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.pslot {
  aspect-ratio: 1 / 1.05; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--line); color: var(--ink-soft); font-size: 2rem; position: relative;
}
.pslot.filled { border: 2px solid transparent; background: var(--glass-strong); animation: popIn .55s cubic-bezier(.2, 1.6, .4, 1) both; cursor: pointer; }
.pslot.filled .name { font-size: 1.2rem; font-weight: 700; color: #fff; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pslot.filled .avatar { animation: bounce 2s ease-in-out infinite; }
.pslot.offline { opacity: .45; filter: grayscale(.8); }
.pslot .vip { position: absolute; top: 8px; right: 10px; font-size: .8rem; background: var(--accent); color: #1a0b3d; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.pslot .kick { position: absolute; top: 6px; left: 8px; font-size: .9rem; opacity: 0; transition: opacity .2s; }
.pslot.filled:hover .kick { opacity: .8; }
.settings { padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; user-select: none; }
.toggle input { display: none; }
.toggle .sw { width: 52px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, .2); position: relative; transition: background .25s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.2, 1.6, .4, 1); }
.toggle input:checked + .sw { background: var(--good); }
.toggle input:checked + .sw::after { transform: translateX(-22px); }
.seg { display: inline-flex; background: rgba(0, 0, 0, .2); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; color: #fff; padding: .45em 1em; border-radius: 999px; cursor: pointer; font-weight: 600; }
.seg button.on { background: #fff; color: #1a0b3d; }
.music-pick .seg { flex-wrap: wrap; }
.replace-q { margin-top: 26px; }
.btn.small { font-size: .9rem; padding: .45em 1em; }
.credit { flex-basis: 100%; font-size: .8rem; color: var(--ink-soft); margin-top: -6px; }
.sound-hint { position: fixed; left: 24px; bottom: 24px; z-index: 20; animation: pulse .8s ease-in-out infinite alternate; }
.start-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.start-row .hint { color: var(--ink-soft); }

/* Big titles */
.title-card { text-align: center; }
.title-card .kicker { font-size: 1.4rem; color: var(--ink-soft); font-weight: 600; letter-spacing: .1em; }
.title-card h1 { font-family: var(--display); font-size: clamp(3.5rem, 10vw, 8rem); margin: .1em 0; line-height: 1; text-shadow: 0 8px 0 rgba(0, 0, 0, .25); }
.title-card .mult { display: inline-block; font-size: 1.6rem; font-weight: 800; background: var(--accent); color: #1a0b3d; padding: .3em 1em; border-radius: 999px; transform: rotate(-3deg); }
.zoom-in { animation: zoomIn .8s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes zoomIn { from { opacity: 0; transform: scale(2.5); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }

/* Pick */
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 1000px; margin: 30px auto 0; }
.cat {
  padding: 30px; font-size: 2rem; font-weight: 800; text-align: center; border-radius: var(--radius);
  background: var(--glass-strong); border: 2px solid var(--line); transition: transform .3s, background .3s, opacity .3s;
}
.cat.chosen { background: var(--accent); color: #1a0b3d; transform: scale(1.08); }
.cat.dim { opacity: .25; transform: scale(.94); }

/* Question */
.q-wrap { text-align: center; max-width: 1200px; margin: 0 auto; }
.q-cat { display: inline-block; background: var(--accent2); color: #fff; font-weight: 800; padding: .35em 1.1em; border-radius: 999px; font-size: 1.2rem; transform: rotate(-2deg); }
.q-text { font-size: clamp(2rem, 4.2vw, 3.6rem); font-weight: 800; line-height: 1.35; margin: 22px 0; text-wrap: balance; }
.q-sub { font-size: 1.4rem; color: var(--ink-soft); }
.row-center { display: flex; align-items: center; justify-content: center; gap: 24px; }

/* Timer */
.timer { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 9; }
.timer .track { stroke: rgba(255, 255, 255, .15); }
.timer .prog { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.low .prog { stroke: var(--bad); }
.timer.low { animation: pulse .5s ease-in-out infinite alternate; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.3rem; font-weight: 800; }
@keyframes pulse { to { transform: scale(1.08); } }

/* Options */
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 26px; }
.opt {
  background: #fff; color: #1a0b3d; font-weight: 800; font-size: clamp(1.3rem, 2.2vw, 2rem);
  padding: 22px 18px; border-radius: 20px; box-shadow: 0 8px 0 rgba(0, 0, 0, .2); text-align: center;
  display: flex; align-items: center; justify-content: center; min-height: 100px;
}
.opts.many { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.opts.many .opt { min-height: 72px; padding: 14px 12px; font-size: clamp(1.1rem, 1.8vw, 1.6rem); }
.opt:nth-child(6n+1) { transform: rotate(-1.2deg); } .opt:nth-child(6n+2) { transform: rotate(1deg); }
.opt:nth-child(6n+4) { transform: rotate(1.4deg); } .opt:nth-child(6n+5) { transform: rotate(-.8deg); }

/* Player bar (host) */
#playerbar { display: flex; justify-content: center; gap: 18px; padding: 10px 20px 20px; flex-wrap: wrap; flex-shrink: 0; }
#playerbar:empty { display: none; }
#playerbar.compact { gap: 12px; }
#playerbar.compact .avatar { width: 52px; height: 52px; font-size: 1.8rem; }
#playerbar.compact .pb .name { max-width: 84px; font-size: .85rem; }
.pb { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; transition: transform .3s, opacity .3s; }
.pb .name { font-weight: 700; font-size: .95rem; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb .score { font-size: .85rem; color: var(--ink-soft); }
.pb.waiting .avatar { opacity: .55; }
.pb.done .avatar { animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1); }
.pb.done::after {
  content: '✓'; position: absolute; top: -6px; left: -6px; background: var(--good); color: #0b3d2a; font-weight: 900;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}
.pb.offline { opacity: .35; filter: grayscale(1); }

/* Reveal */
.reveal { text-align: center; }
.reveal .q-text { font-size: clamp(1.4rem, 2.6vw, 2.2rem); margin: 10px 0 30px; opacity: .85; }
#revealBox { min-height: 420px; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.rv-card {
  position: relative; background: #fff; color: #1a0b3d; font-size: clamp(2.2rem, 5vw, 4.2rem); font-weight: 800;
  padding: 30px 60px; border-radius: 28px; box-shadow: 0 12px 0 rgba(0, 0, 0, .22), var(--shadow); max-width: 90%;
  transition: background .4s, color .4s, transform .4s;
}
.rv-card.lie { background: #ffe0e6; }
.rv-card.truth { background: var(--good); color: #06331f; transform: scale(1.08); box-shadow: 0 12px 0 rgba(0, 0, 0, .22), 0 0 80px rgba(61, 220, 151, .7); }
.stamp {
  position: absolute; top: -26px; left: -30px; font-family: var(--display); font-size: 2.4rem; padding: .1em .6em;
  border: 5px solid currentColor; border-radius: 14px; transform: rotate(-14deg); color: var(--bad); background: rgba(255, 255, 255, .92);
  animation: stamp .45s cubic-bezier(.2, 1.8, .4, 1) both;
}
.stamp.good { color: #0e8a55; }
@keyframes stamp { from { opacity: 0; transform: rotate(-14deg) scale(3); } to { opacity: 1; transform: rotate(-14deg) scale(1); } }
.rv-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; min-height: 90px; align-items: center; }
.rv-row .label { font-size: 1.4rem; color: var(--ink-soft); font-weight: 600; }
.chip { display: flex; align-items: center; gap: 10px; background: var(--glass-strong); padding: 8px 18px 8px 8px; border-radius: 999px; font-weight: 700; font-size: 1.25rem; animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.chip .pts { color: var(--accent); font-weight: 900; direction: ltr; unicode-bidi: isolate; }
.verdict { font-size: 2rem; font-weight: 800; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* Scores */
.board { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.board h1 { text-align: center; font-family: var(--display); font-size: 3rem; margin: 0 0 10px; }
.brow { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); animation: slideIn .5s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
.brow .rank { font-size: 1.6rem; font-weight: 900; width: 44px; text-align: center; }
.brow .nm { font-size: 1.4rem; font-weight: 700; width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bar { flex: 1; height: 18px; background: rgba(0, 0, 0, .2); border-radius: 999px; overflow: hidden; }
.brow .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 999px; transition: width 1.4s cubic-bezier(.2, .9, .3, 1); }
.brow .sc { font-size: 1.6rem; font-weight: 900; width: 110px; text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
.brow .dl { font-weight: 800; color: var(--good); width: 80px; text-align: left; direction: ltr; opacity: 0; animation: popIn .5s .6s both; }

/* Podium */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 22px; margin-top: 30px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pod .blk {
  width: 190px; border-radius: 18px 18px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 14px;
  font-family: var(--display); font-size: 3rem; color: #1a0b3d; box-shadow: var(--shadow); animation: rise 1s cubic-bezier(.2, 1.2, .4, 1) both;
  transform-origin: bottom;
}
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.pod.p1 .blk { height: 260px; background: linear-gradient(#ffe066, #f4b400); animation-delay: 1.2s; }
.pod.p2 .blk { height: 190px; background: linear-gradient(#f1f5f9, #b8c2cc); animation-delay: .6s; }
.pod.p3 .blk { height: 140px; background: linear-gradient(#f4a261, #c26a2e); animation-delay: 0s; }
.pod .who { text-align: center; animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.pod.p1 .who { animation-delay: 2s; } .pod.p2 .who { animation-delay: 1.4s; } .pod.p3 .who { animation-delay: .8s; }
.pod .who .name { font-size: 1.5rem; font-weight: 800; }
.pod .who .pts { color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.crown { font-size: 3rem; animation: bounce 1.2s ease-in-out infinite; }

/* ================= LANDING ================= */
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; gap: 34px; text-align: center; }
.landing .logo { font-size: clamp(4.5rem, 16vw, 9rem); line-height: 1; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .25)); }
.landing .tag { font-size: clamp(1.1rem, 3vw, 1.6rem); color: var(--ink-soft); margin: -10px 0 0; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 22px; width: 100%; justify-content: center; }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 22px; text-decoration: none; color: #fff;
  transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), background .25s;
}
.choice:hover { transform: translateY(-8px) rotate(-1deg); background: var(--glass-strong); }
.choice .em { font-size: 4rem; }
.choice b { font-size: 1.5rem; }
.choice span { color: var(--ink-soft); }
.how { max-width: 760px; padding: 24px 28px; text-align: right; line-height: 1.7; }
.how h2 { margin: 0 0 8px; font-family: var(--display); }
.how ol { margin: 0; padding-inline-start: 1.3em; }
.footer-note { color: var(--ink-soft); font-size: .9rem; }

/* ================= PLAYER (phone) ================= */
body.player { min-height: 100dvh; }
.ptop { display: flex; align-items: center; gap: 10px; padding: 12px 16px; position: sticky; top: 0; z-index: 5; }
.ptop .logo { font-size: 1.5rem; }
.ptop .me { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ptop .me .pts { color: var(--accent); direction: ltr; }
.ptimer { height: 6px; background: rgba(255, 255, 255, .15); margin: 0 16px; border-radius: 999px; overflow: hidden; }
.ptimer i { display: block; height: 100%; background: var(--accent); width: 100%; border-radius: 999px; }
#app { padding: 18px 16px 40px; max-width: 520px; margin: 0 auto; }
.pcard { padding: 22px 18px; }
.pcenter { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6vh; }
.pcenter h2 { font-family: var(--display); font-size: 2rem; margin: 0; }
.pcenter p { margin: 0; color: var(--ink-soft); font-size: 1.1rem; }
.big-emoji { font-size: 5rem; line-height: 1; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; text-align: right; }
.field label { font-weight: 700; }
.input {
  width: 100%; font-size: 1.3rem; padding: .75em .9em; border-radius: 16px; border: 2px solid transparent; outline: none;
  background: rgba(255, 255, 255, .95); color: #1a0b3d; font-weight: 700; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 210, 63, .3); }
.input.code { text-align: center; letter-spacing: .3em; text-transform: uppercase; direction: ltr; font-size: 1.8rem; }
.av-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
.av-grid button { aspect-ratio: 1; font-size: clamp(1.1rem, 5.2vw, 1.6rem); min-width: 0; border-radius: 14px; border: 2px solid transparent; background: var(--glass); cursor: pointer; transition: transform .15s; padding: 0; }
.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-row button {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: .7em; font-size: 1.2rem; font-weight: 800;
  color: #fff; background: var(--glass); border: 2px solid transparent; border-radius: 16px; cursor: pointer; transition: transform .15s, background .2s;
}
.gender-row button span { font-size: 1.8rem; }
.gender-row button.on { border-color: var(--accent); background: var(--glass-strong); transform: scale(1.04); }
.av-grid button.on { border-color: var(--accent); background: var(--glass-strong); transform: scale(1.12); }
.pq { font-size: 1.35rem; font-weight: 800; line-height: 1.45; margin: 0 0 16px; }
.pq .blank { min-width: 3em; }
.ok { color: #d4ffe9; background: rgba(61, 220, 151, .22); border: 1px solid rgba(61, 220, 151, .55); padding: .7em 1em; border-radius: 14px; margin-bottom: 12px; font-weight: 700; }
.err { color: #ffd1dc; background: rgba(255, 77, 109, .25); border: 1px solid rgba(255, 77, 109, .5); padding: .7em 1em; border-radius: 14px; margin-bottom: 12px; font-weight: 600; }
.counter { text-align: left; font-size: .85rem; color: var(--ink-soft); margin-top: 6px; margin-bottom: 12px; direction: ltr; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.suggest { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.popt {
  width: 100%; text-align: center; font-size: 1.25rem; font-weight: 800; padding: 1em; border-radius: 18px; border: 0; cursor: pointer;
  background: #fff; color: #1a0b3d; box-shadow: 0 5px 0 rgba(0, 0, 0, .22); transition: transform .12s, background .2s;
}
.popt:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.popt.sel { background: var(--accent); }
.plist { display: flex; flex-direction: column; gap: 12px; }
.cat-btn { font-size: 1.35rem; padding: 1.1em; }
.result-num { font-family: var(--display); font-size: 4rem; color: var(--accent); direction: ltr; }
.overlay {
  position: fixed; inset: 0; background: rgba(10, 5, 30, .8); display: none; align-items: center; justify-content: center;
  z-index: 50; flex-direction: column; gap: 16px; text-align: center; padding: 24px;
}
.overlay.show { display: flex; }
.spinner { width: 54px; height: 54px; border: 6px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.kids.player .pq { font-size: 1.5rem; }
body.kids.player .popt { font-size: 1.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  body.host { overflow: auto; height: auto; min-height: 100vh; }
  .lobby { grid-template-columns: 1fr; }
  .lobby-players { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .pslot { font-size: 1.2rem; }
  .pslot .avatar { width: 44px; height: 44px; font-size: 1.5rem; }
  .pslot.filled .name { font-size: .9rem; }
  #stage { padding: 0 16px 12px; }
  .pod .blk { width: 100px; }
}
@media (max-width: 600px) {
  .choices { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
