/* ==========================================================================
   Who's the Most? — styles
   ========================================================================== */
:root {
  --bg: #1a0f3a;
  --ink: #ffffff;
  --muted: #cbbff7;
  --dim: #9487c9;
  --deep: #1b1035;
  --pink: #ff4d9d;
  --yellow: #ffd23d;
  --cyan: #4de3e3;
  --green: #3ddc84;
  --orange: #ff7a3d;
  --purple: #9b6bff;
  --blue: #3da5ff;
  --card: rgba(255, 255, 255, 0.07);
  --card-2: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.15);
  --font: 'Fredoka', ui-rounded, 'Segoe UI Rounded', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 760px at 12% 8%, #3b1d8a 0%, transparent 62%),
    radial-gradient(900px 700px at 92% 95%, #5c1a72 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--cyan); }

/* ---------- Background decoration ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg .orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.45; animation: drift 18s ease-in-out infinite alternate; }
.bg .o1 { width: 520px; height: 520px; background: #ff4d9d; left: -160px; top: -160px; }
.bg .o2 { width: 620px; height: 620px; background: #3d62ff; right: -200px; bottom: -240px; animation-duration: 23s; }
.bg .o3 { width: 380px; height: 380px; background: #ffd23d; left: 52%; top: 36%; opacity: 0.16; animation-duration: 27s; }
.bg .shape { position: absolute; top: 105%; opacity: 0.4; animation: floatUp linear infinite; }
.bg .shape svg { width: 100%; height: 100%; display: block; }
@keyframes drift { to { transform: translate(90px, 70px) scale(1.12); } }
@keyframes floatUp {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-125vh) rotate(420deg); }
}

/* ---------- Logo ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; line-height: 0.88; transform: rotate(-4deg); user-select: none; }
.logo .l1 {
  font-size: 0.34em; font-weight: 600; color: var(--cyan); letter-spacing: 0.03em;
  background: var(--deep); padding: 0.12em 0.7em 0.16em; border-radius: 999px;
  box-shadow: 0 0 0 0.07em var(--cyan); transform: rotate(3deg); margin-bottom: 0.08em;
}
.logo .l2 {
  font-size: 1em; font-weight: 700; color: var(--yellow); letter-spacing: 0.01em;
  text-shadow: 0 0.05em 0 #ff4d9d, 0 0.1em 0 #8a2bd0, 0 0.18em 0.25em rgba(0, 0, 0, 0.45);
}
.logo .qm { display: inline-block; color: var(--pink); text-shadow: 0 0.05em 0 #ffd23d, 0 0.1em 0 #8a2bd0, 0 0.18em 0.25em rgba(0,0,0,.45); animation: wiggle 2.6s ease-in-out infinite; transform-origin: 50% 85%; }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(14deg); } 80% { transform: rotate(-10deg); } 90% { transform: rotate(6deg); } }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--yellow); --s: #c99700; --t: var(--deep);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  border: 0; border-radius: 999px; padding: 0.78em 1.6em; font-size: 1.15rem; font-weight: 700;
  color: var(--t); background: var(--b); cursor: pointer; user-select: none;
  box-shadow: 0 0.3em 0 var(--s), 0 0.7em 1.4em rgba(0, 0, 0, 0.28);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.2s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(0.22em); box-shadow: 0 0.08em 0 var(--s), 0 0.3em 0.6em rgba(0, 0, 0, 0.28); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn.pink { --b: var(--pink); --s: #c2266f; --t: #fff; }
.btn.cyan { --b: var(--cyan); --s: #1fa9b3; --t: var(--deep); }
.btn.green { --b: var(--green); --s: #1f9d56; --t: var(--deep); }
.btn.ghost { --b: rgba(255, 255, 255, 0.1); --s: rgba(0, 0, 0, 0.25); --t: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:active { box-shadow: inset 0 0 0 2px var(--line); }
.btn[disabled] { filter: grayscale(0.85) brightness(0.65); cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.linkish { background: none; border: 0; color: var(--dim); text-decoration: underline; cursor: pointer; padding: 0.4em; font-size: 0.95rem; }

/* ---------- Characters ---------- */
.av { display: block; width: 100%; height: 100%; overflow: visible; }
.av .eyes { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; animation-delay: var(--blink-delay, 0s); }
.av .spin { transform-origin: 60px 68px; animation: spin 14s linear infinite; }
.av .wobble { transform-origin: 60px 32px; animation: wob 2.2s ease-in-out infinite; }
.av .flicker { transform-origin: 60px 32px; animation: flick 0.9s ease-in-out infinite alternate; }
.av .zz text { animation: zz 2.4s ease-in-out infinite; }
.av .zz text + text { animation-delay: 0.6s; }
.av.mood-sleep .body { filter: saturate(0.45) brightness(0.85); }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wob { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes flick { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(1.06, 0.94) rotate(3deg); } }
@keyframes zz { 0%, 100% { opacity: 0.2; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-3px); } }
.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7%); } }

/* ---------- Toasts & confetti ---------- */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #fff; color: var(--deep); font-weight: 600; padding: 12px 20px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: toastIn 0.3s cubic-bezier(.2,1.4,.4,1); max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transform: translateY(10px); transition: 0.35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.9); } }

.conn-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 80; background: var(--pink); color: #fff; text-align: center; font-weight: 600; padding: 8px; transform: translateY(-100%); transition: transform .3s; }
.conn-banner.show { transform: none; }

/* ---------- Shared keyframes ---------- */
@keyframes popIn { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes riseIn { from { transform: translateY(40px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slam { 0% { transform: scale(3.2) rotate(-8deg); opacity: 0; } 55% { transform: scale(0.92) rotate(2deg); opacity: 1; } 75% { transform: scale(1.05) rotate(-1deg); } 100% { transform: scale(1) rotate(-3deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 61, 0.0), 0 0 40px rgba(255, 210, 61, 0.35); } 50% { box-shadow: 0 0 0 6px rgba(255, 210, 61, 0.25), 0 0 70px rgba(255, 210, 61, 0.55); } }

/* ==========================================================================
   HOST (big screen) — fixed 1600×900 stage scaled to fit
   ========================================================================== */
body.host { overflow: hidden; height: 100vh; }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px;
  transform-origin: center center; z-index: 1;
}
.screen { position: absolute; inset: 0; animation: fadeIn 0.45s ease; }

.hud { position: absolute; top: 22px; right: 26px; display: flex; gap: 10px; z-index: 20; }
.hud button, .chip {
  background: rgba(255, 255, 255, 0.1); border: 0; border-radius: 999px; height: 46px; min-width: 46px; padding: 0 16px;
  font-size: 20px; font-weight: 600; color: #fff; cursor: pointer; box-shadow: inset 0 0 0 2px var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.hud button:hover { background: rgba(255, 255, 255, 0.18); }
.hud .room-chip { cursor: default; letter-spacing: 0.12em; }

.topbar { position: absolute; top: 22px; left: 30px; right: 290px; display: flex; align-items: center; gap: 18px; height: 46px; }
.topbar .logo { font-size: 46px; margin-right: 8px; }
.pill { background: var(--deep); border-radius: 999px; padding: 8px 20px; font-size: 22px; font-weight: 600; box-shadow: inset 0 0 0 2px var(--line); white-space: nowrap; }
.pill b { color: var(--yellow); }

/* ---- Lobby ---- */
.lobby { display: grid; grid-template-columns: 720px 1fr; gap: 44px; padding: 56px 60px 50px; }
.lobby-left { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.lobby-left .logo { font-size: 150px; margin-top: 6px; }
.tagline { margin: 4px 0 0; font-size: 26px; color: var(--muted); text-align: center; line-height: 1.3; max-width: 640px; }
.tagline b { color: #fff; }
.join-card {
  display: flex; gap: 30px; align-items: center; background: #fff; color: var(--deep);
  border-radius: 34px; padding: 26px 34px 26px 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 0 8px rgba(255,255,255,.12);
  transform: rotate(1deg); margin-top: 6px;
}
.qr { width: 270px; height: 270px; border-radius: 18px; overflow: hidden; background: #f3f0ff; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.join-info { display: flex; flex-direction: column; gap: 6px; min-width: 300px; }
.ji-label { font-size: 22px; font-weight: 500; color: #6b5fa0; }
.ji-url { font-size: 40px; font-weight: 700; color: var(--deep); margin-bottom: 8px; white-space: nowrap; }
.ji-code { display: flex; gap: 10px; margin-top: 4px; }
.ji-code span {
  width: 70px; height: 84px; border-radius: 16px; background: var(--deep); color: var(--yellow);
  font-size: 56px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 6px 0 #8a2bd0;
}
.ji-code span:nth-child(2) { color: var(--cyan); }
.ji-code span:nth-child(3) { color: var(--pink); }
.ji-code span:nth-child(4) { color: var(--green); }

.panel { background: var(--card); border-radius: 36px; box-shadow: inset 0 0 0 2px var(--line); padding: 30px 32px; }
.lobby-right { display: flex; flex-direction: column; gap: 20px; margin-top: 40px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; }
.panel-head h2 { margin: 0; font-size: 40px; }
.panel-head .count { font-size: 30px; font-weight: 600; color: var(--yellow); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.slot {
  position: relative; height: 178px; border-radius: 24px; background: var(--card-2);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 12px 8px 14px;
}
.slot.pop { animation: popIn 0.55s cubic-bezier(.2, 1.3, .4, 1) both; }
.slot-av { width: 112px; height: 112px; }
.slot-name { font-size: 22px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.slot.empty { background: transparent; box-shadow: inset 0 0 0 3px rgba(255,255,255,.12); border: 0; }
.slot.empty .slot-av { display: grid; place-items: center; font-size: 64px; font-weight: 700; color: rgba(255,255,255,.14); }
.slot.empty .slot-name { color: var(--dim); font-weight: 500; font-size: 18px; }
.slot.away .slot-name { color: var(--dim); }
.slot .crown { position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 34px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.slot .kick {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.35); color: #fff; font-size: 15px; cursor: pointer; opacity: 0; transition: opacity .2s;
}
.slot:hover .kick { opacity: 1; }
.toggles { display: flex; gap: 14px; }
.tog {
  flex: 1; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: var(--card-2); border: 0; border-radius: 20px; padding: 14px 16px;
}
.tog-track { flex: none; width: 58px; height: 34px; border-radius: 999px; background: rgba(255,255,255,.18); position: relative; transition: background .2s; }
.tog-track::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.tog.on .tog-track { background: var(--green); }
.tog.on .tog-track::after { transform: translateX(24px); }
.tog-text b { display: block; font-size: 21px; }
.tog-text small { display: block; font-size: 16px; color: var(--muted); }
.start-row { display: flex; align-items: center; gap: 22px; margin-top: 4px; }
.start-row .btn { font-size: 32px; padding: 20px 44px; }
.start-row .btn:not([disabled]) { animation: pulse 1.8s ease-in-out infinite; }
.hint { font-size: 19px; color: var(--muted); line-height: 1.35; }

/* ---- Round intro ---- */
.intro { display: grid; place-items: center; overflow: hidden; }
.burst {
  position: absolute; left: 50%; top: 46%; width: 1700px; height: 1700px; margin: -850px 0 0 -850px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 61, 0.16) 0deg 10deg, transparent 10deg 20deg);
  animation: spin 30s linear infinite; mask-image: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
}
.intro-txt { position: relative; text-align: center; margin-top: -90px; }
.intro-small { font-size: 46px; font-weight: 600; color: var(--cyan); animation: riseIn 0.5s 0.1s both; }
.intro-big {
  font-size: 230px; font-weight: 700; line-height: 1; color: var(--yellow); letter-spacing: 0.01em;
  text-shadow: 0 10px 0 var(--pink), 0 20px 0 #8a2bd0, 0 30px 50px rgba(0,0,0,.5);
  animation: slam 0.7s 0.3s cubic-bezier(.2, .9, .3, 1.2) both; transform: rotate(-3deg);
}
.intro-big.final { font-size: 190px; }
.intro-of { font-size: 48px; font-weight: 600; color: var(--muted); margin-top: 26px; animation: riseIn 0.5s 0.8s both; }
.parade { position: absolute; bottom: 50px; left: 0; right: 0; display: flex; justify-content: center; gap: 26px; }
.parade > div { width: 120px; height: 120px; animation: riseIn 0.5s both, bob 1.6s ease-in-out infinite; }

/* ---- Question ---- */
.qmain { position: absolute; top: 108px; left: 60px; right: 60px; height: 520px; display: grid; grid-template-columns: 1fr 330px; gap: 40px; align-items: center; }
.qcard {
  position: relative; background: #fff; color: var(--deep); border-radius: 44px; padding: 54px 64px 66px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 10px rgba(255,255,255,.1);
  animation: popIn 0.6s cubic-bezier(.2,1.2,.4,1) both; transform-origin: 40% 60%;
}
.qcard::before {
  content: ''; position: absolute; left: 80px; bottom: -34px; width: 70px; height: 70px; background: #fff;
  clip-path: polygon(0 0, 100% 0, 10% 100%);
}
.q-lead { font-size: 40px; font-weight: 600; color: #7a6bb5; margin-bottom: 10px; }
.q-text { font-size: 82px; font-weight: 700; line-height: 1.04; letter-spacing: -0.01em; }
.q-text.long { font-size: 68px; }
.q-prize { position: absolute; right: 36px; bottom: -26px; background: var(--deep); color: #fff; border-radius: 999px; padding: 10px 24px; font-size: 24px; font-weight: 600; box-shadow: 0 8px 20px rgba(0,0,0,.35), inset 0 0 0 3px var(--yellow); }
.q-prize b { color: var(--yellow); }

.timer { position: relative; width: 320px; height: 320px; justify-self: center; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .track { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 22; }
.timer .ring { fill: none; stroke: var(--tc, var(--green)); stroke-width: 22; stroke-linecap: round; transition: stroke .4s; filter: drop-shadow(0 0 14px var(--tc, var(--green))); }
.timer .face { fill: rgba(27,16,53,.75); }
.timer-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 130px; font-weight: 700; line-height: 1; }
.timer-num small { display: block; font-size: 24px; color: var(--muted); font-weight: 500; text-align: center; margin-top: -8px; }
.timer.urgent .timer-num span { color: var(--pink); }
.timer-num .bump { animation: popIn .35s ease; display: inline-block; }

.voters { position: absolute; left: 40px; right: 40px; bottom: 34px; display: flex; justify-content: center; gap: 22px; }
.voter { width: 150px; text-align: center; transition: transform .3s cubic-bezier(.2,1.4,.4,1); }
.voter .v-av { width: 112px; height: 112px; margin: 0 auto; position: relative; }
.voter .v-name { font-size: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voter .v-badge {
  position: absolute; right: -4px; bottom: 2px; width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: var(--deep);
  display: grid; place-items: center; font-size: 24px; font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,.35); transform: scale(0); transition: transform .35s cubic-bezier(.2,1.6,.4,1);
}
.voter.done { transform: translateY(-14px); }
.voter.done .v-badge { transform: scale(1); }
.voter.thinking .v-av { animation: think 1.4s ease-in-out infinite; }
@keyframes think { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.voter.just .v-av { animation: popIn .5s cubic-bezier(.2,1.4,.4,1); }

.all-in { position: absolute; left: 0; right: 0; top: 50%; margin-top: -80px; text-align: center; transform: rotate(-4deg); font-size: 110px; font-weight: 700; color: var(--yellow); text-shadow: 0 8px 0 var(--pink), 0 16px 40px rgba(0,0,0,.5); animation: slam .6s cubic-bezier(.2,.9,.3,1.2) both; z-index: 10; white-space: nowrap; pointer-events: none; }
.skip-btn { position: absolute; right: 30px; bottom: 26px; font-size: 18px !important; padding: 10px 18px !important; opacity: .65; }
.skip-btn:hover { opacity: 1; }

/* ---- Reveal ---- */
.rv-q { font-size: 26px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.rv-q b { color: #fff; font-weight: 600; }
.rv-main { position: absolute; top: 100px; left: 50px; right: 50px; bottom: 120px; display: grid; grid-template-columns: 860px 1fr; gap: 36px; }
.bars { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 74px 170px 1fr 70px; align-items: center; gap: 14px; height: 74px; padding: 0 14px 0 6px; border-radius: 22px; transition: background .4s, box-shadow .4s, transform .4s; animation: riseIn .4s both; }
.bar-av { width: 70px; height: 70px; }
.bar-name { font-size: 26px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; height: 40px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: visible; }
.bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; min-width: 40px; border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c));
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.15), inset 0 6px 0 rgba(255,255,255,.25);
  transition: width 1.3s cubic-bezier(.25, 1.25, .4, 1);
}
.bar-voters { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; opacity: 0; transition: opacity .5s .9s; }
.bar-voters.show { opacity: 1; }
.bar-voters div { width: 34px; height: 34px; }
.bar-num { font-size: 40px; font-weight: 700; text-align: right; }
.bar-row.win { background: rgba(255, 210, 61, .14); box-shadow: inset 0 0 0 3px var(--yellow); transform: scale(1.02); }
.bar-row.win .bar-num { color: var(--yellow); }
.bar-row.zero { opacity: .55; }

.spot {
  position: relative; border-radius: 40px; background: linear-gradient(160deg, #3a1d86, #23104f); box-shadow: inset 0 0 0 3px var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; overflow: hidden;
}
.spot::before { content: ''; position: absolute; inset: -40%; background: repeating-conic-gradient(rgba(255,255,255,.05) 0deg 12deg, transparent 12deg 24deg); animation: spin 40s linear infinite; }
.spot > * { position: relative; }
.spot-wait { font-size: 52px; font-weight: 700; color: var(--muted); animation: pulse 1s ease-in-out infinite; }
.spot.live { animation: glow 2.2s ease-in-out infinite; }
.spot-emoji { font-size: 96px; line-height: 1; animation: popIn .6s cubic-bezier(.2,1.4,.4,1) both; }
.spot-award { font-size: 54px; font-weight: 700; color: var(--yellow); line-height: 1.05; margin-top: 10px; text-transform: uppercase; letter-spacing: .01em; text-shadow: 0 5px 0 #8a2bd0; animation: slam .6s .15s cubic-bezier(.2,.9,.3,1.2) both; }
.spot-goes { font-size: 26px; color: var(--muted); margin: 14px 0 6px; animation: fadeIn .4s .5s both; }
.spot-winners { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; animation: popIn .6s .6s cubic-bezier(.2,1.4,.4,1) both; }
.spot-winner { display: flex; flex-direction: column; align-items: center; position: relative; }
.spot-winner .sw-av { width: 170px; height: 170px; }
.spot-winners.many .sw-av { width: 118px; height: 118px; }
.spot-winner .sw-crown { position: absolute; top: -22px; font-size: 54px; transform: rotate(-10deg); animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); }
.spot-winners.many .sw-crown { font-size: 40px; top: -18px; }
.spot-winner .sw-name { font-size: 44px; font-weight: 700; margin-top: 2px; }
.spot-winners.many .sw-name { font-size: 30px; }
.spot-winners.lots { gap: 6px 14px; }
.spot-winners.lots .sw-av { width: 80px; height: 80px; }
.spot-winners.lots .sw-crown { font-size: 30px; top: -14px; }
.spot-winners.lots .sw-name { font-size: 22px; }
.spot-votes { font-size: 26px; color: var(--muted); margin-top: 10px; animation: fadeIn .4s .9s both; }
.spot-votes b { color: #fff; }
.spot-none { font-size: 46px; font-weight: 700; }

.rv-bottom { position: absolute; left: 50px; right: 50px; bottom: 30px; height: 70px; display: flex; align-items: center; gap: 16px; animation: riseIn .5s both; }
.rv-bottom .lb-label { font-size: 22px; color: var(--muted); font-weight: 600; margin-right: 4px; white-space: nowrap; }
.lb { display: flex; gap: 10px; flex: 1; overflow: hidden; }
.lb-chip { display: flex; align-items: center; gap: 8px; background: var(--card-2); border-radius: 999px; padding: 4px 16px 4px 4px; font-size: 21px; font-weight: 600; white-space: nowrap; }
.lb-chip .lb-av { width: 42px; height: 42px; }
.lb-chip b { color: var(--yellow); }
.lb-chip.first { box-shadow: inset 0 0 0 2px var(--yellow); }
.rv-bottom .btn { font-size: 28px; padding: 16px 34px; flex: none; }
.leader-note { font-size: 17px; color: var(--dim); max-width: 180px; line-height: 1.25; }

/* ---- Final ---- */
.final-title { position: absolute; top: 48px; left: 0; right: 0; text-align: center; font-size: 66px; font-weight: 700; line-height: 1.05; }
.final-title .sub { display: block; font-size: 30px; color: var(--cyan); font-weight: 600; margin-bottom: 6px; }
.final-title .champ { color: var(--yellow); text-shadow: 0 6px 0 var(--pink), 0 12px 0 #8a2bd0; display: inline-block; animation: slam .7s cubic-bezier(.2,.9,.3,1.2) both; }
.final-title .drum { display: inline-block; font-size: 80px; animation: pulse .5s ease-in-out infinite; }
.podium { position: absolute; left: 0; right: 0; top: 190px; height: 370px; display: flex; justify-content: center; align-items: flex-end; gap: 26px; }
.pod { width: 250px; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(80px); transition: opacity .5s, transform .8s cubic-bezier(.2,1.3,.4,1); }
.pod.up { opacity: 1; transform: none; }
.pod-av { width: 140px; height: 140px; position: relative; }
.pod-1 .pod-av { width: 170px; height: 170px; }
.pod-crown { position: absolute; left: 50%; top: -48px; transform: translateX(-50%) rotate(-8deg); font-size: 64px; animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(0 5px 3px rgba(0,0,0,.45)); }
.pod-name { font-size: 32px; font-weight: 700; margin: 4px 0 8px; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-block { width: 100%; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; align-items: center; padding-top: 16px; color: var(--deep); box-shadow: inset 0 10px 0 rgba(255,255,255,.35), inset 0 -10px 0 rgba(0,0,0,.12); }
.pod-1 .pod-block { height: 150px; background: linear-gradient(var(--yellow), #f2a900); }
.pod-2 .pod-block { height: 118px; background: linear-gradient(#e3e6f5, #a9b0cf); }
.pod-3 .pod-block { height: 96px; background: linear-gradient(#ffb27a, #d66f2e); }
.pod-rank { font-size: 52px; font-weight: 700; line-height: 1; }
.pod-score { font-size: 22px; font-weight: 600; opacity: .8; }
.awards { position: absolute; left: 60px; right: 60px; bottom: 100px; align-content: flex-end; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; opacity: 0; transition: opacity .6s; }
.awards.show { opacity: 1; }
.aw { display: flex; align-items: center; gap: 10px; background: var(--card-2); border-radius: 20px; padding: 8px 16px 8px 8px; max-width: 360px; }
.aw-av { width: 52px; height: 52px; flex: none; }
.aw-name { font-size: 20px; font-weight: 700; }
.aw-list { font-size: 17px; color: var(--muted); line-height: 1.25; }
.final-actions { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; gap: 20px; opacity: 0; transition: opacity .6s; }
.final-actions.show { opacity: 1; }
.final-actions .btn { font-size: 26px; padding: 14px 32px; }

.fatal { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 36px; padding: 80px; }

/* ==========================================================================
   PLAYER (phone)
   ========================================================================== */
body.player { min-height: 100dvh; }
#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100dvh; padding: 18px 16px 28px; display: flex; flex-direction: column; }
.p-screen { flex: 1; display: flex; flex-direction: column; gap: 16px; animation: fadeIn .35s ease; }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.p-top .logo { font-size: 30px; }
.p-me { display: flex; align-items: center; gap: 8px; background: var(--card-2); border-radius: 999px; padding: 3px 14px 3px 3px; font-weight: 600; font-size: 16px; max-width: 60%; }
.p-me .pm-av { width: 34px; height: 34px; flex: none; }
.p-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-card { background: var(--card); border-radius: 26px; box-shadow: inset 0 0 0 2px var(--line); padding: 20px; }
.p-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.p-title { font-size: 30px; font-weight: 700; margin: 0; line-height: 1.1; }
.p-sub { font-size: 18px; color: var(--muted); margin: 0; line-height: 1.35; }
.p-big-av { width: 160px; height: 160px; }
.p-err { color: #ffd0e3; background: rgba(255,77,157,.18); border-radius: 14px; padding: 10px 14px; font-weight: 500; animation: shake .4s; }

.field label { display: block; font-weight: 600; font-size: 17px; margin: 0 0 8px 4px; color: var(--muted); }
.input {
  width: 100%; font: inherit; font-size: 24px; font-weight: 600; color: var(--deep); background: #fff; border: 0; border-radius: 18px; padding: 14px 18px;
  box-shadow: 0 5px 0 #c9bdf5; outline: none;
}
.input:focus { box-shadow: 0 5px 0 var(--pink), 0 0 0 4px rgba(255,77,157,.35); }
.input.code { text-align: center; letter-spacing: .4em; text-transform: uppercase; font-size: 40px; padding: 12px 10px 12px 26px; }

.char-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.char {
  position: relative; border: 0; background: var(--card-2); border-radius: 20px; padding: 8px 4px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s, box-shadow .15s, background .15s;
}
.char .c-av { width: 64px; height: 64px; }
.char .c-name { font-size: 13px; font-weight: 600; color: var(--muted); }
.char.sel { background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 3px var(--yellow); transform: scale(1.05); }
.char.sel .c-name { color: #fff; }
.char.taken { opacity: .3; cursor: not-allowed; filter: grayscale(1); }

.p-players { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.p-mini { text-align: center; }
.p-mini .pmi-av { width: 58px; height: 58px; margin: 0 auto; position: relative; }
.p-mini .pmi-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-mini.pop { animation: popIn .5s cubic-bezier(.2,1.3,.4,1) both; }
.p-mini .pmi-crown { position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 20px; }

.p-q { text-align: center; }
.p-q .lead { font-size: 18px; font-weight: 600; color: var(--muted); }
.p-q .text { font-size: 30px; font-weight: 700; line-height: 1.12; margin-top: 4px; }
.p-timer { height: 14px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; position: relative; }
.p-timer i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--tc, var(--green)); border-radius: 999px; transform-origin: left; transition: background .4s; }
.p-timer-row { display: flex; align-items: center; gap: 10px; }
.p-timer-row .p-timer { flex: 1; }
.p-timer-row .secs { font-weight: 700; font-size: 20px; min-width: 40px; text-align: right; }

.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.vote-opt {
  position: relative; border: 0; background: var(--card-2); border-radius: 22px; padding: 10px 8px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; transition: transform .15s, background .15s, box-shadow .15s;
}
.vote-opt .vo-av { width: 86px; height: 86px; }
.vote-opt .vo-name { font-size: 20px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-opt .vo-you { font-size: 13px; color: var(--muted); font-weight: 600; }
.vote-opt:active { transform: scale(.96); }
.vote-opt.sel { background: rgba(255, 210, 61, .2); box-shadow: inset 0 0 0 4px var(--yellow); transform: scale(1.03); }
.vote-opt.sel::after { content: '✓'; position: absolute; top: 8px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--deep); font-weight: 700; display: grid; place-items: center; }
.vote-opt[disabled] { opacity: .35; cursor: not-allowed; }
.lock-bar { position: sticky; bottom: 12px; margin-top: auto; padding-top: 6px; }
.lock-bar .btn { width: 100%; font-size: 24px; padding: 18px; }

.dots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.18); transition: background .3s, transform .3s; }
.dots i.on { background: var(--green); transform: scale(1.15); }

.p-award { font-size: 26px; font-weight: 700; color: var(--yellow); text-transform: uppercase; line-height: 1.1; }
.p-award-emoji { font-size: 64px; line-height: 1; animation: popIn .6s cubic-bezier(.2,1.4,.4,1) both; }
.p-winners { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.p-winners .pw { display: flex; flex-direction: column; align-items: center; }
.p-winners .pw-av { width: 110px; height: 110px; }
.p-winners.many .pw-av { width: 76px; height: 76px; }
.p-winners .pw-name { font-weight: 700; font-size: 22px; }
.you-got { font-size: 20px; font-weight: 600; background: var(--card-2); border-radius: 16px; padding: 10px 16px; }
.you-got b { color: var(--yellow); }

.p-lb { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.p-lb-row { display: flex; align-items: center; gap: 10px; background: var(--card-2); border-radius: 16px; padding: 6px 14px 6px 6px; font-weight: 600; font-size: 18px; text-align: left; }
.p-lb-row .rk { width: 34px; text-align: center; color: var(--muted); font-weight: 700; }
.p-lb-row .lr-av { width: 40px; height: 40px; flex: none; }
.p-lb-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-lb-row.me { box-shadow: inset 0 0 0 2px var(--cyan); }
.p-lb-row b { color: var(--yellow); }

.p-awards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.p-awards span { background: rgba(255, 210, 61, .16); box-shadow: inset 0 0 0 2px rgba(255,210,61,.5); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 16px; }
.p-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.p-actions .btn { font-size: 22px; padding: 16px; }
.p-actions.sticky { position: sticky; bottom: 12px; margin-top: auto; }
.p-actions.sticky:empty { display: none; }

/* ==========================================================================
   LANDING
   ========================================================================== */
body.landing #home { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 48px 20px 40px; display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.home-logo .logo { font-size: clamp(84px, 17vw, 170px); }
.home-tag { font-size: clamp(19px, 2.4vw, 26px); color: var(--muted); max-width: 720px; margin: 0; line-height: 1.35; }
.home-tag b { color: #fff; }
.home-parade { display: flex; gap: clamp(4px, 1.5vw, 16px); justify-content: center; flex-wrap: wrap; }
.home-parade > div { width: clamp(52px, 9vw, 96px); height: clamp(52px, 9vw, 96px); }
.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; width: 100%; max-width: 860px; }
.home-card { background: var(--card); border-radius: 30px; box-shadow: inset 0 0 0 2px var(--line); padding: 26px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: left; }
.home-card h2 { margin: 0; font-size: 30px; display: flex; align-items: center; gap: 10px; }
.home-card p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.4; flex: 1; }
.home-card .btn { font-size: 22px; }
.join-row { display: flex; gap: 10px; }
.join-row .input { flex: 1; min-width: 0; font-size: 30px; letter-spacing: .3em; padding-left: 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; width: 100%; max-width: 860px; }
.step { background: var(--card); border-radius: 24px; padding: 20px; text-align: left; }
.step .n { width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: var(--deep); font-weight: 700; font-size: 22px; display: grid; place-items: center; margin-bottom: 10px; }
.step:nth-child(2) .n { background: var(--cyan); }
.step:nth-child(3) .n { background: var(--pink); color: #fff; }
.step b { display: block; font-size: 20px; margin-bottom: 4px; }
.step span { color: var(--muted); font-size: 16px; line-height: 1.4; }
.home-foot { color: var(--dim); font-size: 14px; }

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