:root {
  --purple: #46178f;
  --purple-deep: #2b0d5c;
  --purple-mid: #5a24a8;
  --ink: #333;
  --red: #e21b3c;
  --red-d: #b3132e;
  --blue: #1368ce;
  --blue-d: #0d4fa0;
  --yellow: #d89e00;
  --yellow-d: #a87b00;
  --green: #26890c;
  --green-d: #1b6608;
  --good: #66bf39;
  --bad: #f35;
  --gold: #ffc23d;
  --silver: #d6dbe4;
  --bronze: #e08b4a;
  --tone: var(--purple);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  color: #fff;
  background: var(--purple);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}
body[data-tone="good"] { --tone: var(--good); }
body[data-tone="bad"] { --tone: var(--bad); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
svg { display: block; fill: currentColor; }

/* ---------------------------------------------------------------- backdrop */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background-color: var(--tone);
  transition: background-color .5s ease;
}
.bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,.12), transparent 60%),
              radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.25), transparent 60%);
}
.bg i { position: absolute; display: block; }
.bg i:nth-child(1) {
  width: 80vmax; height: 80vmax; border-radius: 50%;
  right: -38vmax; top: -44vmax;
  background: rgba(0,0,0,.1);
  animation: drift 22s ease-in-out infinite alternate;
}
.bg i:nth-child(2) {
  width: 60vmax; height: 60vmax;
  left: -30vmax; bottom: -34vmax;
  background: rgba(255,255,255,.05);
  animation: spin 90s linear infinite;
}
.bg i:nth-child(3) {
  width: 22vmax; height: 22vmax;
  right: 6vmax; bottom: 8vmax;
  background: rgba(255,255,255,.04);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  animation: drift 16s ease-in-out infinite alternate-reverse;
}

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: screenIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
.center {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  gap: 14px;
}

/* ------------------------------------------------------------- primitives */

.logo {
  font-weight: 900;
  font-size: clamp(44px, 13vw, 84px);
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-3deg);
  text-shadow: 0 4px 0 rgba(0,0,0,.18);
  animation: logoIn .7s var(--ease-pop) both;
}
.logo span { display: inline-block; color: var(--gold); }

.card {
  width: min(340px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 6px 0 rgba(0,0,0,.15), 0 20px 40px rgba(0,0,0,.2);
  animation: cardIn .5s .1s var(--ease-pop) both;
}
.card h2 { font-size: 15px; font-weight: 700; color: #6b6b6b; text-align: center; }

.field {
  width: 100%;
  height: 52px;
  border: 2px solid #ccc;
  border-radius: 6px;
  font: 800 19px var(--font);
  text-align: center;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(70,23,143,.18); }
.field::placeholder { color: #a8a8a8; font-weight: 700; }

.btn {
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: inset 0 -4px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s, filter .15s, opacity .2s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 -2px rgba(0,0,0,.35); }
.btn:disabled { opacity: .5; }
.btn.light { background: #fff; color: var(--ink); box-shadow: inset 0 -4px rgba(0,0,0,.15); }
.btn.ghost { background: rgba(0,0,0,.25); box-shadow: inset 0 -4px rgba(0,0,0,.2); }
.btn.sm { height: 42px; font-size: 15px; padding: 0 16px; }

.hint { opacity: .8; font-weight: 600; font-size: 14px; }
.muted { opacity: .8; font-weight: 600; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  font-weight: 800;
  font-size: 15px;
}

.loader { display: flex; gap: 8px; justify-content: center; }
.loader i {
  width: 14px; height: 14px; border-radius: 3px; background: #fff;
  animation: hop 1s ease-in-out infinite;
}
.loader i:nth-child(1) { background: var(--red); }
.loader i:nth-child(2) { background: var(--blue); animation-delay: .12s; --r: 45deg; }
.loader i:nth-child(3) { background: var(--yellow); animation-delay: .24s; border-radius: 50%; }
.loader i:nth-child(4) { background: var(--green); animation-delay: .36s; }

.progress {
  width: min(520px, 90%);
  height: 10px;
  border-radius: 99px;
  background: rgba(0,0,0,.25);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: inherit;
  transform-origin: left;
  animation: fill linear both;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top));
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: translate(-50%, -150%);
  transition: transform .35s var(--ease-pop);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

.conn {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(0,0,0,.7);
  font-weight: 700;
  font-size: 13px;
  animation: fadeIn .3s 1s both;
}

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

.shake { animation: shake .45s; }

/* ----------------------------------------------------------- answer tiles */

.ans {
  --c: var(--red);
  --d: var(--red-d);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 8px;
  padding: 14px 18px;
  background: var(--c);
  color: #fff;
  font-weight: 800;
  text-align: left;
  box-shadow: inset 0 -6px var(--d);
  transition: transform .12s, opacity .3s, box-shadow .12s, filter .2s;
  animation: tileIn .45s var(--ease-pop) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  overflow-wrap: anywhere;
}
.ans.c1 { --c: var(--blue); --d: var(--blue-d); }
.ans.c2 { --c: var(--yellow); --d: var(--yellow-d); }
.ans.c3 { --c: var(--green); --d: var(--green-d); }
.ans .shape { width: 1.6em; height: 1.6em; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }
.ans .mark {
  margin-left: auto;
  width: 1.5em; height: 1.5em;
  flex: none;
  animation: pop .45s .2s var(--ease-pop) both;
}
button.ans:hover:not(:disabled) { filter: brightness(1.08); }
button.ans:active:not(:disabled) { transform: translateY(3px) scale(.98); box-shadow: inset 0 -3px var(--d); }
.ans.picked { transform: scale(1.03); z-index: 1; box-shadow: inset 0 -6px var(--d), 0 0 0 4px #fff; }
.ans.faded { opacity: .25; }
.ans.wrong { opacity: .3; }

/* ================================================================ PLAYER */

.join { gap: 22px; }
.join .logo { margin-bottom: 6px; }

.lobby-p .big-icon {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--purple);
  animation: pop .6s var(--ease-pop) both;
}
.lobby-p .big-icon svg { width: 60%; }
.lobby-p h1 { font-size: clamp(24px, 7vw, 34px); font-weight: 900; }
.name-tag {
  padding: 10px 22px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  font-size: 22px;
  animation: wobble 2.4s 1s ease-in-out infinite;
}

.qnum {
  width: 110px; height: 110px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--purple);
  font-weight: 900; font-size: 54px;
  box-shadow: 0 6px 0 rgba(0,0,0,.2);
  animation: pop .6s var(--ease-pop) both;
}
.intro-text {
  font-size: clamp(22px, 6.5vw, 34px);
  font-weight: 800;
  line-height: 1.3;
  max-width: 640px;
  animation: zoomIn .6s .15s cubic-bezier(.2, .8, .2, 1) both;
}

.play {
  padding: 12px 12px calc(76px + env(safe-area-inset-bottom));
  gap: 12px;
}
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ptimer {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--purple-deep);
  border: 3px solid rgba(255,255,255,.9);
  font-weight: 900; font-size: 22px;
  transition: background-color .3s;
}
.ptimer.urgent { background: var(--red); animation: pulse .5s ease-in-out infinite alternate; }
.q-text {
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: clamp(17px, 4.8vw, 26px);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 5px 0 rgba(0,0,0,.15);
  animation: dropIn .5s var(--ease-pop) both;
}
.p-answers {
  flex: 1;
  min-height: 46vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 10px;
}
.p-answers .ans {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: clamp(18px, 5.6vw, 30px);
  padding: 14px 10px 18px;
  gap: 12px;
}
.p-answers .ans .shape { width: clamp(52px, 22vw, 110px); height: auto; }
.p-answers.n3 .ans:last-child { grid-column: span 2; }

.wait .badge {
  width: 120px; height: 120px; border-radius: 16px;
  display: grid; place-items: center;
  box-shadow: inset 0 -6px var(--d);
  background: var(--c);
  animation: bounce 1.1s ease-in-out infinite;
}
.wait .badge .shape { width: 62%; height: auto; }
.wait h1 { font-size: clamp(22px, 7vw, 32px); font-weight: 900; }
.badge.c0 { --c: var(--red); --d: var(--red-d); }
.badge.c1 { --c: var(--blue); --d: var(--blue-d); }
.badge.c2 { --c: var(--yellow); --d: var(--yellow-d); }
.badge.c3 { --c: var(--green); --d: var(--green-d); }

.reveal-p { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.rv-title {
  font-size: clamp(34px, 11vw, 56px);
  font-weight: 900;
  text-shadow: 0 4px 0 rgba(0,0,0,.15);
  animation: dropIn .5s var(--ease-pop) both;
}
.rv-icon {
  width: 112px; height: 112px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
  color: var(--tone);
  box-shadow: 0 6px 0 rgba(0,0,0,.15);
  animation: pop .6s .1s var(--ease-pop) both;
}
.rv-icon svg { width: 72%; }
.streak {
  padding: 8px 18px;
  border-radius: 99px;
  background: rgba(0,0,0,.25);
  font-weight: 800;
  animation: pop .5s .5s var(--ease-pop) both;
}
.points {
  padding: 12px 26px;
  border-radius: 8px;
  background: rgba(0,0,0,.28);
  font-size: 30px;
  font-weight: 900;
  animation: pop .5s .35s var(--ease-pop) both;
}
.rv-correct {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0,0,0,.22);
  font-weight: 700;
  animation: fadeUp .5s .4s both;
}
.mini { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--c); }
.mini .shape { width: 70%; height: auto; }
.mini.c0 { --c: var(--red); } .mini.c1 { --c: var(--blue); } .mini.c2 { --c: var(--yellow); } .mini.c3 { --c: var(--green); }
.rv-rank { font-size: 20px; font-weight: 800; animation: fadeUp .5s .6s both; }
.rv-gap { font-weight: 600; opacity: .9; animation: fadeUp .5s .7s both; }

.rank-big {
  min-width: 132px; height: 132px; padding: 0 20px; border-radius: 66px;
  display: grid; place-items: center;
  background: #fff; color: var(--purple);
  font-size: 66px; font-weight: 900;
  box-shadow: 0 6px 0 rgba(0,0,0,.2);
  animation: pop .6s var(--ease-pop) both;
}
.medal {
  width: 150px; height: 150px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 72px; font-weight: 900; color: rgba(0,0,0,.55);
  background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--m);
  box-shadow: inset 0 -8px rgba(0,0,0,.18), 0 0 0 8px rgba(255,255,255,.2), 0 10px 30px rgba(0,0,0,.3);
  animation: medalIn 1s var(--ease-pop) both;
}
.medal.m1 { --m: var(--gold); }
.medal.m2 { --m: var(--silver); }
.medal.m3 { --m: var(--bronze); }
.final h1 { font-size: clamp(30px, 9vw, 46px); font-weight: 900; animation: dropIn .5s .3s var(--ease-pop) both; }
.final-score { font-size: 20px; font-weight: 700; animation: fadeUp .5s .5s both; }
.final-score b { font-size: 34px; font-weight: 900; }
.final .btn { margin-top: 10px; animation: fadeUp .5s .8s both; }
.drum { font-size: 64px; animation: wobble .3s ease-in-out infinite; }

.pbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  animation: slideUp .4s cubic-bezier(.2, .8, .2, 1) both;
}
.pbar .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar .pscore {
  flex: none;
  min-width: 64px;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

/* ================================================================== HOST */

.hbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 25;
  height: calc(52px + env(safe-area-inset-bottom));
  padding: 0 12px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(14px, 1.5vw, 20px);
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
}
.hbar[hidden] { display: none; }
.hbar-btns { display: flex; gap: 4px; }
#hpin { justify-self: end; }
body.in-game #app { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--ink);
  transition: background-color .15s;
}
.icon-btn:hover { background: #eee; }
.icon-btn svg { width: 24px; }

.pick { align-items: center; padding: 48px 16px; gap: 28px; }
.pick h2 { font-size: clamp(18px, 3vw, 24px); font-weight: 700; opacity: .9; }
.quiz-list {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
  justify-content: center;
  gap: 16px;
}
.quiz-card {
  position: relative;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 20px 20px 18px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(0,0,0,.18);
  transition: transform .15s, box-shadow .15s;
  animation: cardIn .5s var(--ease-pop) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.quiz-card:hover { transform: translateY(-4px); box-shadow: 0 10px 0 rgba(0,0,0,.18); }
.quiz-card .sub { font-size: 13px; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: .04em; }
.quiz-card h3 { font-size: 24px; font-weight: 900; line-height: 1.15; }
.quiz-card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-weight: 700; color: #777; }
.quiz-card .go { padding: 8px 14px; border-radius: 6px; background: var(--purple); color: #fff; font-weight: 800; }
.quiz-card .stripes { display: flex; gap: 4px; margin-bottom: 6px; }
.quiz-card .stripes i { width: 22px; height: 6px; border-radius: 3px; }
.stripes i:nth-child(1) { background: var(--red); } .stripes i:nth-child(2) { background: var(--blue); }
.stripes i:nth-child(3) { background: var(--yellow); } .stripes i:nth-child(4) { background: var(--green); }

/* lobby */
.lobby { padding: 16px; gap: 16px; }
.join-banner {
  align-self: center;
  width: min(1100px, 100%);
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 0 rgba(0,0,0,.18);
  animation: dropIn .6s var(--ease-pop) both;
}
.join-how {
  flex: 1.2;
  display: flex; flex-direction: column; justify-content: center;
  padding: 16px 24px;
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 22px);
  border-right: 2px solid #eee;
}
.join-how b { font-size: clamp(20px, 2.6vw, 36px); font-weight: 900; color: var(--ink); word-break: break-all; }
.join-pin {
  flex: 1.5;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12px 24px;
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 22px);
}
.join-pin b {
  font-size: clamp(44px, 7.5vw, 104px);
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1;
}
.qr {
  flex: none;
  display: grid; place-items: center;
  padding: 12px;
  background: #fff;
  border-left: 2px solid #eee;
}
.qr svg { width: clamp(96px, 12vw, 170px); height: auto; }
.qr:empty { display: none; }

.lobby-bar {
  width: min(1100px, 100%);
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lobby-bar .logo { font-size: clamp(32px, 4vw, 52px); animation: none; }
.count-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: rgba(0,0,0,.3);
  font-size: 22px; font-weight: 900;
}
.count-pill svg { width: 26px; }
.count-pill b { display: inline-block; }
.count-pill b.bump { animation: bump .35s var(--ease-pop); }
.lobby-title { text-align: center; font-weight: 800; font-size: clamp(16px, 2vw, 22px); opacity: .9; }
.chips {
  width: min(1100px, 100%);
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 12px;
  padding: 8px 0 24px;
}
.chip {
  border: 0;
  padding: 10px 18px;
  border-radius: 8px;
  background: rgba(0,0,0,.3);
  color: #fff;
  font-weight: 800;
  font-size: clamp(16px, 1.8vw, 24px);
  animation: chipIn .5s var(--ease-pop) both;
  transition: background-color .15s, text-decoration-color .15s;
  text-decoration: line-through transparent 3px;
}
.chip:hover { background: rgba(0,0,0,.5); text-decoration-color: #fff; }
.chip.out { animation: chipOut .3s ease-in forwards; }
.waiting {
  align-self: center;
  margin-top: 4vh;
  padding: 14px 28px;
  border-radius: 8px;
  background: rgba(0,0,0,.3);
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 28px);
  animation: breathe 2s ease-in-out infinite;
}

/* intro */
.hintro { gap: 26px; padding: 40px 6vw; }
.hintro .qlabel {
  padding: 10px 26px;
  border-radius: 8px;
  background: #fff;
  color: var(--purple);
  font-weight: 900;
  font-size: clamp(18px, 2.4vw, 30px);
  animation: pop .5s var(--ease-pop) both;
}
.hintro h1 {
  max-width: 1200px;
  font-size: clamp(28px, 5vw, 68px);
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 4px 0 rgba(0,0,0,.15);
  animation: zoomIn .7s .15s cubic-bezier(.2, .8, .2, 1) both;
}

/* question + reveal */
.hq {
  padding: 16px 16px 20px;
  gap: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.q-top { display: flex; align-items: center; gap: 14px; }
.q-top .host-next { position: static; flex: none; }
.q-banner {
  flex: 1;
  padding: 18px 28px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  font-size: clamp(20px, 3vw, 44px);
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 6px 0 rgba(0,0,0,.15);
  animation: dropIn .5s var(--ease-pop) both;
}
.q-mid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 34vh;
}
.timer {
  position: relative;
  width: clamp(92px, 11vw, 168px);
  aspect-ratio: 1;
  animation: pop .5s .2s var(--ease-pop) both;
}
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 9; }
.timer .track { stroke: rgba(0,0,0,.25); fill: var(--purple-deep); }
.timer .ring { stroke: #fff; stroke-linecap: round; transition: stroke .3s; }
.timer.urgent .ring { stroke: var(--gold); }
.timer b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(34px, 4.6vw, 70px);
  font-weight: 900;
}
.timer.urgent b { animation: pulse .5s ease-in-out infinite alternate; }
.answers-count {
  min-width: clamp(92px, 11vw, 168px);
  display: grid;
  justify-items: center;
  font-weight: 800;
  font-size: clamp(14px, 1.5vw, 22px);
  animation: pop .5s .3s var(--ease-pop) both;
}
.answers-count b { font-size: clamp(40px, 5.4vw, 84px); font-weight: 900; line-height: 1; }
.answers-count b.bump { animation: bump .35s var(--ease-pop); }
.q-art { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 2vw, 28px); }
.q-art .float {
  width: clamp(54px, 9vw, 140px);
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--c);
  box-shadow: inset 0 -8px var(--d), 0 12px 30px rgba(0,0,0,.2);
  animation: float 2.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.55s);
}
.q-art .float .shape { width: 58%; height: auto; }
.float.c0 { --c: var(--red); --d: var(--red-d); }
.float.c1 { --c: var(--blue); --d: var(--blue-d); }
.float.c2 { --c: var(--yellow); --d: var(--yellow-d); }
.float.c3 { --c: var(--green); --d: var(--green-d); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tiles .ans {
  min-height: clamp(76px, 13vh, 150px);
  font-size: clamp(20px, 2.8vw, 42px);
  padding: 16px 24px 20px;
}

.host-next { position: fixed; right: 16px; top: 16px; z-index: 20; animation: fadeIn .4s .4s both; }

.chart {
  height: 100%;
  min-height: 30vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(14px, 3vw, 48px);
}
.bar-col {
  width: clamp(70px, 11vw, 170px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
}
.bar-col .num {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  font-size: clamp(24px, 3vw, 44px);
  font-weight: 900;
  margin-bottom: 6px;
}
.bar-col .num svg { width: .9em; }
.bar {
  height: 0;
  min-height: 10px;
  background: var(--c);
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 -6px var(--d);
  transition: height 1s cubic-bezier(.2, .9, .3, 1.1);
}
.bar-col .foot {
  display: grid; place-items: center;
  padding: 8px;
  background: var(--d);
  border-radius: 0 0 4px 4px;
}
.bar-col .foot .shape { width: 34px; height: auto; }
.bar-col.c0 { --c: var(--red); --d: var(--red-d); }
.bar-col.c1 { --c: var(--blue); --d: var(--blue-d); }
.bar-col.c2 { --c: var(--yellow); --d: var(--yellow-d); }
.bar-col.c3 { --c: var(--green); --d: var(--green-d); }
.bar-col.wrong { opacity: .4; }

/* scoreboard */
.hboard { align-items: center; padding: 28px 16px; gap: 28px; }
.title-tag {
  padding: 12px 34px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(26px, 3.6vw, 48px);
  font-weight: 900;
  box-shadow: 0 6px 0 rgba(0,0,0,.15);
  animation: dropIn .5s var(--ease-pop) both;
}
.board {
  --rh: clamp(58px, 8.5vh, 86px);
  --gap: 12px;
  position: relative;
  width: min(960px, 100%);
  height: calc(5 * var(--rh) + 4 * var(--gap));
}
.row {
  position: absolute;
  left: 0; right: 0;
  height: var(--rh);
  top: calc(var(--pos) * (var(--rh) + var(--gap)));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  border-radius: 8px;
  background: rgba(0,0,0,.3);
  font-weight: 800;
  font-size: clamp(18px, 2.4vw, 32px);
  transition: top .9s cubic-bezier(.6, 0, .2, 1), opacity .5s, background-color .4s, color .4s;
  animation: rowIn .5s var(--ease-pop) both;
  animation-delay: calc(var(--i) * 90ms);
}
.row.lead { background: #fff; color: var(--ink); }
.row.hidden { opacity: 0; }
.row .rk {
  width: 1.8em; height: 1.8em; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  font-size: .8em;
}
.row.lead .rk { background: var(--gold); color: var(--ink); }
.row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .fire { font-size: .8em; opacity: .9; }
.row .sc { font-weight: 900; }
.empty-note { opacity: .8; font-weight: 700; }

/* podium */
.hpodium { align-items: center; padding: 24px 16px 32px; gap: 18px; }
.stands {
  width: min(1000px, 100%);
  height: min(58vh, 560px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 2vw, 22px);
}
.stand { flex: 1; max-width: 280px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.stand .pname {
  max-width: 100%;
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(15px, 2.4vw, 32px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0;
  animation: nameIn .6s var(--ease-pop) both;
  animation-delay: calc(var(--d) + .7s);
}
.stand .block {
  width: 100%;
  height: var(--h);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--purple-mid), var(--purple-deep));
  box-shadow: inset 0 6px rgba(255,255,255,.12);
  transform-origin: bottom;
  animation: rise .9s cubic-bezier(.2, .9, .3, 1.05) both;
  animation-delay: var(--d);
}
.stand .block .medal { width: clamp(52px, 7vw, 96px); height: clamp(52px, 7vw, 96px); font-size: clamp(26px, 3.6vw, 48px); animation: medalIn .9s var(--ease-pop) both; animation-delay: calc(var(--d) + .5s); }
.stand .block .pts { font-weight: 900; font-size: clamp(15px, 2vw, 26px); opacity: 0; animation: fadeIn .4s both; animation-delay: calc(var(--d) + .8s); }
.stand.p1 { --h: 72%; --d: 3.6s; }
.stand.p2 { --h: 54%; --d: 2s; }
.stand.p3 { --h: 40%; --d: .6s; }
.stand.p1 .pname { font-size: clamp(18px, 3vw, 40px); }
.stand.empty .block { opacity: .35; }
.podium-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; animation: fadeUp .5s 4.6s both; }
.ranking {
  width: min(640px, 100%);
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease;
}
.ranking.open { max-height: 2000px; }
.ranking ol { list-style: none; padding: 0; display: grid; gap: 6px; }
.ranking li {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0,0,0,.25);
  font-weight: 700;
}
.ranking li .r { width: 2em; opacity: .75; }
.ranking li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking li .s { font-weight: 900; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .lobby-bar .logo { display: none; }
  .join-banner { flex-wrap: wrap; }
  .join-how { flex-basis: 100%; border-right: 0; border-bottom: 2px solid #eee; text-align: center; padding: 12px; }
  .join-pin { text-align: center; }
  .q-top { flex-direction: column; align-items: stretch; }
  .q-top .host-next { align-self: flex-end; order: -1; }
  .q-banner { padding: 14px 16px; }
  .q-mid { min-height: 22vh; }
  .q-art .float:nth-child(n+3) { display: none; }
  .tiles { gap: 8px; }
}

@media (min-width: 900px) {
  .p-answers .ans { flex-direction: row; text-align: left; justify-content: flex-start; padding: 18px 28px; }
  .p-answers .ans .shape { width: 64px; }
  .play { max-width: 1100px; width: 100%; margin: 0 auto; }
}

/* ----------------------------------------------------------- keyframes */

@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes bump { 50% { transform: scale(1.35); } }
@keyframes logoIn { from { opacity: 0; transform: rotate(-3deg) scale(.3); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.92); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-40px) scale(.95); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.6); } }
@keyframes tileIn { from { opacity: 0; transform: translateY(40px) scale(.85); } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-60px); } }
@keyframes chipIn { 0% { opacity: 0; transform: scale(.2) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
@keyframes chipOut { to { opacity: 0; transform: scale(.4); } }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(var(--r, 0)); } 40% { transform: translateY(-14px) rotate(var(--r, 0)); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-22px) scale(.96, 1.04); } 50% { transform: translateY(0) scale(1.06, .94); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(4deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6vmax, 4vmax) scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes nameIn { from { opacity: 0; transform: translateY(20px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes medalIn { 0% { opacity: 0; transform: scale(0) rotate(-200deg); } 100% { opacity: 1; transform: none; } }

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