/* ==========================================================
   MAXZEETON — LIVE QUIZ
   Shared by the host screen (.lqh, projector) and the student
   screen (.lqs, phone first). Brand tokens come from the page's
   own stylesheet (dashboard.css for students, teacher-shell.css
   for teachers/admins) with literal fallbacks, so this file works
   on both without redefining either palette.
   Every animation here is switched off by the
   prefers-reduced-motion block at the bottom.
   ========================================================== */

.lq-root {
  --lq-brand: var(--brand, var(--ts-brand, #E8192C));
  --lq-brand-dark: var(--brand-dark, var(--ts-brand-dark, #C5141F));
  --lq-ink: #0D1117;
  --lq-stage: #0B0E14;
  --lq-panel: rgba(255, 255, 255, 0.06);
  --lq-line: rgba(255, 255, 255, 0.12);
  --lq-soft: rgba(255, 255, 255, 0.66);
  --lq-green: #16A34A;
  --lq-red: #DC2626;
  --lq-amber: #F59E0B;
  --lq-font: 'Outfit', sans-serif;
  --lq-display: 'Syne', sans-serif;
  font-family: var(--lq-font);
}
.lq-root [hidden] { display: none !important; }
.lq-root button { font-family: inherit; }

/* ---------- avatar (emoji on a preset background) ---------- */
.lq-avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 22px; line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.lq-avatar--lg { width: 96px; height: 96px; font-size: 52px; }
.lq-avatar--sm { width: 32px; height: 32px; font-size: 18px; }

/* ---------- answer tiles ---------- */
.lq-tile {
  position: relative; display: flex; align-items: center; gap: 16px;
  border: 0; border-radius: 18px; color: #fff; text-align: left;
  background: var(--tile); box-shadow: inset 0 -7px 0 var(--tile-dark), 0 6px 18px rgba(0, 0, 0, 0.22);
  transition: transform .12s ease, box-shadow .12s ease, opacity .25s ease, filter .25s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.lq-shape { width: 42px; height: 42px; fill: #fff; flex-shrink: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }
button.lq-tile { cursor: pointer; }
button.lq-tile:active:not(:disabled), button.lq-tile.is-pressed {
  transform: translateY(5px) scale(0.985);
  box-shadow: inset 0 -2px 0 var(--tile-dark), 0 2px 8px rgba(0, 0, 0, 0.2);
}
button.lq-tile:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.lq-tile.is-dim { opacity: 0.28; filter: saturate(0.5); }
.lq-tile.is-picked { outline: 5px solid #fff; outline-offset: -5px; }
.lq-tile .lq-tick {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--tile-dark); font-size: 15px;
  transform: scale(0); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.lq-tile.is-picked .lq-tick, .lq-tile.is-correct .lq-tick { transform: scale(1); }

/* ---------- countdown ring ---------- */
.lq-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.lq-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lq-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 9; }
.lq-ring-fg { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 282.74; stroke-dashoffset: 0; transition: stroke .3s ease; }
.lq-ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--lq-display); font-weight: 800; font-size: 42px; color: #fff; font-variant-numeric: tabular-nums; }
.lq-ring.is-warn .lq-ring-fg { stroke: var(--lq-amber); }
.lq-ring.is-urgent .lq-ring-fg { stroke: #F87171; }
.lq-ring.is-urgent .lq-ring-num { animation: lq-pulse .9s ease-in-out infinite; }
.lq-ring--sm { width: 76px; height: 76px; }
.lq-ring--sm .lq-ring-num { font-size: 26px; }

/* ---------- floating emoji reactions ---------- */
.lq-float-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.lq-float { position: absolute; bottom: -60px; font-size: 44px; will-change: transform, opacity; animation: lq-float-up 3.2s cubic-bezier(.2, .7, .3, 1) forwards; }
.lq-float small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; text-align: center; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); white-space: nowrap; }

/* ==========================================================
   HOST SCREEN
   ========================================================== */
body.lqh-page { margin: 0; background: #0B0E14; overflow: hidden; }
.lqh {
  position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  color: #fff; background:
    radial-gradient(900px 520px at 85% -10%, rgba(232, 25, 44, 0.30), transparent 62%),
    radial-gradient(700px 480px at -5% 105%, rgba(79, 70, 229, 0.22), transparent 60%),
    var(--lq-stage);
}
.lqh::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}
.lqh > * { position: relative; }

.lqh-top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--lq-line); min-width: 0; }
.lqh-brand { display: flex; align-items: center; gap: 10px; font-family: var(--lq-display); font-weight: 800; font-size: 18px; white-space: nowrap; color: #fff; text-decoration: none; }
.lqh-brand img { width: 30px; height: 30px; object-fit: contain; }
.lqh-brand em { font-style: normal; color: var(--lq-brand); }
.lqh-title { flex: 1; min-width: 0; font-size: 15px; color: var(--lq-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lqh-chips { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lqh-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--lq-panel); border: 1px solid var(--lq-line); font-size: 13.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lqh-chip strong { letter-spacing: 2px; font-family: var(--lq-display); }
.lqh-icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--lq-line); background: var(--lq-panel); color: #fff; cursor: pointer; font-size: 15px; }
.lqh-icon-btn:hover { background: rgba(255, 255, 255, 0.14); }

.lqh-stage { min-height: 0; overflow: auto; display: grid; padding: 24px; }
.lqh-view { display: grid; min-height: 0; min-width: 0; align-content: center; animation: lq-fade-in .35s ease both; }

.lqh-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--lq-line); background: rgba(11, 14, 20, 0.7); }
.lqh-controls .lqh-msg { flex: 1; min-width: 0; font-size: 13.5px; color: #FCA5A5; }
.lqh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; border: 1px solid var(--lq-line); background: var(--lq-panel); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .12s ease, background .15s ease, opacity .15s ease; text-decoration: none; }
.lqh-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.lqh-btn:active:not(:disabled) { transform: translateY(2px); }
.lqh-btn:disabled { opacity: .45; cursor: not-allowed; }
.lqh-btn--primary { background: var(--lq-brand); border-color: var(--lq-brand); box-shadow: 0 8px 24px rgba(232, 25, 44, 0.35); font-size: 16px; padding: 13px 26px; }
.lqh-btn--primary:hover:not(:disabled) { background: var(--lq-brand-dark); }
.lqh-btn--danger { color: #FCA5A5; }

/* lobby */
.lqh-lobby { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 32px; align-content: stretch; align-items: stretch; }
.lqh-join { display: grid; align-content: center; justify-items: center; gap: 16px; padding: 28px; border-radius: 24px; background: var(--lq-panel); border: 1px solid var(--lq-line); text-align: center; }
.lqh-join p { margin: 0; font-size: 17px; color: var(--lq-soft); }
.lqh-join p strong { color: #fff; }
.lqh-code { font-family: var(--lq-display); font-weight: 800; font-size: clamp(52px, 6.4vw, 92px); letter-spacing: .1em; line-height: 1; padding-left: .1em; font-variant-numeric: tabular-nums; }
.lqh-qr { padding: 14px; background: #fff; border-radius: 18px; line-height: 0; }
.lqh-qr img, .lqh-qr canvas { display: block; width: 200px; height: 200px; }
.lqh-roster { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 16px; min-height: 0; }
.lqh-roster-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lqh-roster-head h2 { margin: 0; font-family: var(--lq-display); font-size: 28px; }
.lqh-roster-head span { color: var(--lq-soft); font-size: 15px; }
.lqh-players { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 12px; overflow: auto; padding: 4px; }
.lqh-player { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: #fff; color: var(--lq-ink); font-size: 17px; font-weight: 600; max-width: 100%; animation: lq-pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.lqh-player span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lqh-waiting { align-self: center; justify-self: center; color: var(--lq-soft); font-size: 18px; text-align: center; }
.lqh-waiting i { display: block; font-size: 34px; margin-bottom: 12px; animation: lq-pulse 1.6s ease-in-out infinite; }

/* question + reveal */
.lqh-question { grid-template-rows: auto minmax(0, 1fr) auto; gap: 22px; align-content: stretch; }
.lqh-qhead { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lqh-qcount { font-family: var(--lq-display); font-weight: 700; font-size: 20px; padding: 8px 16px; border-radius: 999px; background: var(--lq-panel); border: 1px solid var(--lq-line); white-space: nowrap; }
.lqh-answered { text-align: right; font-size: 15px; color: var(--lq-soft); white-space: nowrap; }
.lqh-answered strong { display: block; font-family: var(--lq-display); font-size: 34px; color: #fff; font-variant-numeric: tabular-nums; }
.lqh-prompt { align-self: center; justify-self: center; max-width: 1100px; text-align: center; font-family: var(--lq-display); font-weight: 700; font-size: clamp(24px, 3.3vw, 48px); line-height: 1.22; overflow-wrap: anywhere; animation: lq-rise .5s cubic-bezier(.2, .8, .3, 1) both; }
.lqh-prompt code, .lqh-tile-text code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .82em; background: rgba(255, 255, 255, 0.12); padding: .08em .35em; border-radius: 8px; }
.lqh-prompt .lq-code { text-align: left; font-size: .52em; font-weight: 500; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--lq-line); border-radius: 14px; padding: 16px 20px; margin: 14px auto 0; width: fit-content; max-width: 100%; overflow: auto; }
.lqh-prompt .lq-code code { background: none; padding: 0; font-size: 1em; }
.lqh-hint { margin: 10px 0 0; font-family: var(--lq-font); font-size: 17px; font-weight: 500; color: var(--lq-soft); }
.lqh-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lqh-tiles .lq-tile { padding: 18px 22px; min-height: 86px; animation: lq-tile-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.lqh-tiles .lq-tile:nth-child(2) { animation-delay: .06s; }
.lqh-tiles .lq-tile:nth-child(3) { animation-delay: .12s; }
.lqh-tiles .lq-tile:nth-child(4) { animation-delay: .18s; }
.lqh-tiles .lq-tile:nth-child(5) { animation-delay: .24s; }
.lqh-tiles .lq-tile:nth-child(6) { animation-delay: .3s; }
.lqh-tile-text { flex: 1; min-width: 0; font-size: clamp(17px, 1.9vw, 27px); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.lqh-tile-count { flex-shrink: 0; min-width: 54px; text-align: right; font-family: var(--lq-display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.lqh-tile-bar { position: absolute; left: 0; bottom: 0; height: 7px; border-radius: 0 0 0 18px; background: rgba(255, 255, 255, 0.9); width: 0; transition: width .9s cubic-bezier(.2, .8, .3, 1); }
.lqh-banner { justify-self: center; display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 18px; background: var(--lq-panel); border: 1px solid var(--lq-line); animation: lq-pop .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.lqh-banner.is-skip { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.5); color: #FCD34D; }

/* question intro */
.lqh-intro { justify-items: center; gap: 10px; text-align: center; }
.lqh-intro small { font-size: 20px; letter-spacing: .22em; text-transform: uppercase; color: var(--lq-soft); }
.lqh-intro h2 { margin: 0; font-family: var(--lq-display); font-weight: 800; font-size: clamp(56px, 9vw, 128px); line-height: 1; animation: lq-zoom .6s cubic-bezier(.2, .9, .3, 1.15) both; }
.lqh-intro .lqh-intro-num { margin-top: 18px; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--lq-brand); font-family: var(--lq-display); font-weight: 800; font-size: 46px; box-shadow: 0 0 0 10px rgba(232, 25, 44, 0.2); }
.lqh-intro .lqh-intro-num.tick { animation: lq-tick .5s ease both; }

/* leaderboard */
.lqh-board-wrap { justify-items: center; gap: 22px; align-content: start; padding-top: 8px; }
.lqh-board-wrap h2 { margin: 0; font-family: var(--lq-display); font-size: clamp(30px, 3.6vw, 50px); }
.lqh-board { position: relative; width: min(860px, 100%); }
.lqh-row { position: absolute; left: 0; right: 0; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 20px 0 14px; border-radius: 16px; background: #fff; color: var(--lq-ink); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); transition: transform .9s cubic-bezier(.3, 1.25, .4, 1), opacity .5s ease; will-change: transform; }
.lqh-row.is-first { background: linear-gradient(90deg, #FEF3C7, #fff 60%); }
.lqh-rank { width: 40px; text-align: center; font-family: var(--lq-display); font-weight: 800; font-size: 24px; color: #6B7280; flex-shrink: 0; }
.lqh-row.is-first .lqh-rank { color: #B45309; }
.lqh-name { flex: 1; min-width: 0; font-size: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lqh-move { flex-shrink: 0; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.lqh-move.up { color: var(--lq-green); }
.lqh-move.down { color: var(--lq-red); }
.lqh-gain { flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--lq-green); background: #DCFCE7; padding: 3px 9px; border-radius: 999px; animation: lq-pop .5s .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.lqh-score { flex-shrink: 0; min-width: 84px; text-align: right; font-family: var(--lq-display); font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }
.lqh-empty { color: var(--lq-soft); font-size: 18px; text-align: center; }

/* podium */
.lqh-final { justify-items: center; gap: 18px; align-content: start; }
.lqh-final h2 { margin: 0; font-family: var(--lq-display); font-size: clamp(30px, 3.8vw, 52px); text-align: center; }
.lqh-final > p { margin: 0; color: var(--lq-soft); font-size: 16px; text-align: center; }
.lqh-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); align-items: end; justify-content: center; gap: 16px; width: 100%; margin-top: 8px; }
.lqh-pod { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.lqh-pod-who { display: grid; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; opacity: 0; animation: lq-rise .6s cubic-bezier(.2, .8, .3, 1) forwards; }
.lqh-pod-who .lq-avatar { width: 72px; height: 72px; font-size: 40px; }
.lqh-pod-name { font-size: 20px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lqh-pod-score { font-size: 15px; color: var(--lq-soft); font-variant-numeric: tabular-nums; }
.lqh-pod-block { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: start center; padding-top: 14px; font-family: var(--lq-display); font-weight: 800; font-size: 44px; transform-origin: bottom; transform: scaleY(0); animation: lq-grow .7s cubic-bezier(.2, .9, .3, 1.1) forwards; }
.lqh-pod--1 .lqh-pod-block { height: 190px; background: linear-gradient(180deg, #FBBF24, #B45309); }
.lqh-pod--2 .lqh-pod-block { height: 140px; background: linear-gradient(180deg, #CBD5E1, #64748B); }
.lqh-pod--3 .lqh-pod-block { height: 100px; background: linear-gradient(180deg, #FDBA74, #9A3412); }
/* reveal order: 3rd, then 2nd, then the winner */
.lqh-pod--3 .lqh-pod-block { animation-delay: .3s; } .lqh-pod--3 .lqh-pod-who { animation-delay: .9s; }
.lqh-pod--2 .lqh-pod-block { animation-delay: 1.5s; } .lqh-pod--2 .lqh-pod-who { animation-delay: 2.1s; }
.lqh-pod--1 .lqh-pod-block { animation-delay: 2.8s; } .lqh-pod--1 .lqh-pod-who { animation-delay: 3.5s; }
.lqh-standings { width: min(720px, 100%); display: grid; gap: 6px; margin-top: 6px; }
.lqh-standing { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 12px; background: var(--lq-panel); border: 1px solid var(--lq-line); font-size: 15px; }
.lqh-standing b { width: 34px; color: var(--lq-soft); }
.lqh-standing span.n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lqh-standing span.s { font-weight: 700; font-variant-numeric: tabular-nums; }
.lq-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.lq-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; opacity: .95; animation: lq-fall linear forwards; }

.lqh-notice { justify-items: center; gap: 14px; text-align: center; }
.lqh-notice h2 { margin: 0; font-family: var(--lq-display); font-size: 30px; }
.lqh-notice p { margin: 0; color: var(--lq-soft); font-size: 16px; max-width: 520px; }

@media (max-width: 900px) {
  body.lqh-page { overflow: auto; }
  .lqh-top { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .lqh-title { order: 5; flex-basis: 100%; }
  .lqh-brand span { display: none; }
  .lqh-chips { margin-left: auto; }
  .lqh-stage { padding: 14px; }
  .lqh-controls { padding: 10px 14px; }
  .lqh-controls .lqh-btn { flex: 1; padding: 12px 12px; font-size: 14px; }
  .lqh-controls .lqh-msg { flex-basis: 100%; }
  .lqh-lobby { grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
  .lqh-join { padding: 18px; gap: 12px; }
  .lqh-qr img, .lqh-qr canvas { width: 150px; height: 150px; }
  .lqh-tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .lqh-tiles .lq-tile { min-height: 62px; padding: 12px 14px; gap: 12px; }
  .lqh-tiles .lq-shape { width: 30px; height: 30px; }
  .lqh-ring-host { width: 84px; height: 84px; }
  .lqh-ring-host .lq-ring-num { font-size: 30px; }
  .lqh-answered strong { font-size: 24px; }
  .lqh-qcount { font-size: 15px; padding: 6px 12px; }
  .lqh-row { height: 58px; padding: 0 12px 0 8px; gap: 8px; }
  .lqh-name { font-size: 16px; } .lqh-score { font-size: 18px; min-width: 62px; } .lqh-rank { width: 28px; font-size: 18px; }
  .lqh-gain, .lqh-move { display: none; }
  .lqh-podium { gap: 8px; }
  .lqh-pod-who .lq-avatar { width: 52px; height: 52px; font-size: 28px; }
  .lqh-pod-name { font-size: 14px; } .lqh-pod-block { font-size: 30px; }
}

/* ==========================================================
   STUDENT SCREEN (mobile first)
   ========================================================== */
body.lqs-page { margin: 0; background: var(--bg, #F4F5F8); color: var(--t1, #0D1117); min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
.lqs { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.lqs-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--bdr, #E8E9EE); }
.lqs-back { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--t2, #4B5563); border: 1px solid var(--bdr, #E8E9EE); text-decoration: none; flex-shrink: 0; }
.lqs-brand { flex: 1; min-width: 0; font-family: var(--lq-display); font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.lqs-brand i { color: var(--lq-brand); }
.lqs-codechip { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; padding: 6px 10px; border-radius: 999px; background: var(--brand-bg, #FFF0F2); color: var(--lq-brand); font-variant-numeric: tabular-nums; }
.lqs-main { flex: 1; display: grid; align-content: start; justify-items: center; padding: 20px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.lqs-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--bdr, #E8E9EE); border-radius: 20px; box-shadow: var(--sh-md, 0 4px 16px rgba(0, 0, 0, 0.08)); padding: 24px 20px; display: grid; gap: 16px; animation: lq-fade-in .3s ease both; }
.lqs-card h1 { margin: 0; font-family: var(--lq-display); font-size: 24px; line-height: 1.2; }
.lqs-card p { margin: 0; color: var(--t2, #4B5563); font-size: 14.5px; line-height: 1.5; }
.lqs-label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--t2, #4B5563); }
.lqs-input { width: 100%; box-sizing: border-box; padding: 14px 14px; border-radius: 12px; border: 1.5px solid var(--bdr2, #D0D2DA); font: inherit; font-size: 16px; color: var(--t1, #0D1117); background: #fff; }
.lqs-input:focus { outline: none; border-color: var(--lq-brand); box-shadow: 0 0 0 3px rgba(232, 25, 44, 0.14); }
.lqs-input--code { text-align: center; font-family: var(--lq-display); font-weight: 800; font-size: 34px; letter-spacing: .3em; padding-left: .3em; font-variant-numeric: tabular-nums; }
.lqs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 12px; border: 0; background: var(--lq-brand); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .12s ease, background .15s ease, opacity .15s ease; }
.lqs-btn:active:not(:disabled) { transform: translateY(2px); }
.lqs-btn:disabled { opacity: .5; cursor: not-allowed; }
.lqs-btn--ghost { background: #fff; color: var(--t2, #4B5563); border: 1.5px solid var(--bdr2, #D0D2DA); font-weight: 600; }
.lqs-error { margin: 0; font-size: 13.5px; color: #B91C1C; min-height: 1.2em; }
.lqs-preview { display: flex; align-items: center; gap: 14px; }
.lqs-preview strong { font-size: 19px; overflow-wrap: anywhere; }
.lqs-emojis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.lqs-emoji { aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--bdr, #E8E9EE); background: #fff; font-size: 24px; cursor: pointer; padding: 0; transition: transform .12s ease, border-color .12s ease; }
.lqs-emoji:active { transform: scale(.9); }
.lqs-emoji.is-on { border-color: var(--lq-brand); background: var(--brand-bg, #FFF0F2); transform: scale(1.06); }
.lqs-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.lqs-swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--bdr2, #D0D2DA); cursor: pointer; padding: 0; transition: transform .12s ease; }
.lqs-swatch.is-on { box-shadow: 0 0 0 3px var(--lq-brand); transform: scale(1.08); }

.lqs-lobby { justify-items: center; text-align: center; }
.lqs-lobby .lq-avatar--lg { animation: lq-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.lqs-lobby h1 { font-size: 26px; }
.lqs-wait { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--t2, #4B5563); }
.lqs-dots span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--lq-brand); animation: lq-dot 1.2s ease-in-out infinite; }
.lqs-dots span:nth-child(2) { animation-delay: .15s; } .lqs-dots span:nth-child(3) { animation-delay: .3s; }
.lqs-reacts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.lqs-react { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--bdr, #E8E9EE); background: #fff; font-size: 26px; cursor: pointer; padding: 0; transition: transform .12s ease; }
.lqs-react:active, .lqs-react.is-sent { transform: scale(1.25) translateY(-6px); }

/* in-game: full-screen stage */
.lqs-stage { position: fixed; inset: 0; z-index: 50; display: grid; color: #fff; background: var(--lq-stage); padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.lqs-play { grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; }
.lqs-play-head { display: flex; justify-content: center; }
.lqs-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; min-height: 0; }
.lqs-tiles[data-count="2"] { grid-template-columns: minmax(0, 1fr); }
.lqs-tiles .lq-tile { justify-content: center; padding: 0; min-height: 0; animation: lq-tile-in .4s cubic-bezier(.2, .9, .3, 1.2) both; }
.lqs-tiles .lq-tile:nth-child(2) { animation-delay: .05s; } .lqs-tiles .lq-tile:nth-child(3) { animation-delay: .1s; }
.lqs-tiles .lq-tile:nth-child(4) { animation-delay: .15s; } .lqs-tiles .lq-tile:nth-child(5) { animation-delay: .2s; } .lqs-tiles .lq-tile:nth-child(6) { animation-delay: .25s; }
.lqs-tiles .lq-shape { width: min(34vw, 30vh, 120px); height: min(34vw, 30vh, 120px); }
.lqs-submit { padding: 16px; border-radius: 14px; border: 0; background: #fff; color: var(--lq-ink); font-size: 17px; font-weight: 800; cursor: pointer; }
.lqs-submit:disabled { opacity: .4; }
.lqs-center { place-items: center; align-content: center; text-align: center; gap: 14px; }
.lqs-center h2 { margin: 0; font-family: var(--lq-display); font-weight: 800; font-size: clamp(30px, 9vw, 46px); line-height: 1.1; }
.lqs-center p { margin: 0; font-size: 16px; color: rgba(255, 255, 255, 0.8); max-width: 320px; }
.lqs-center small { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.lqs-getready-num { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: var(--lq-brand); font-family: var(--lq-display); font-weight: 800; font-size: 56px; box-shadow: 0 0 0 12px rgba(232, 25, 44, 0.22); }
.lqs-getready-num.tick { animation: lq-tick .5s ease both; }
.lqs-picked { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lqs-picked .lq-tile { width: 96px; height: 96px; justify-content: center; padding: 0; animation: lq-pulse 1.6s ease-in-out infinite; }
.lqs-picked .lq-shape { width: 52px; height: 52px; }
.lqs-result { transition: background .3s ease; }
.lqs-result.is-correct { background: linear-gradient(160deg, #16A34A, #166534); }
.lqs-result.is-wrong { background: linear-gradient(160deg, #DC2626, #7F1D1D); }
.lqs-result.is-none { background: linear-gradient(160deg, #475569, #1E293B); }
.lqs-badge { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.18); font-size: 54px; animation: lq-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.lqs-points { font-family: var(--lq-display); font-weight: 800; font-size: 34px; padding: 6px 20px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); font-variant-numeric: tabular-nums; animation: lq-rise .5s .15s ease both; }
.lqs-statrow { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lqs-stat { min-width: 108px; padding: 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); font-size: 12.5px; color: rgba(255, 255, 255, 0.82); }
.lqs-stat strong { display: block; font-family: var(--lq-display); font-size: 24px; color: #fff; font-variant-numeric: tabular-nums; }
.lqs-stat .up { color: #86EFAC; } .lqs-stat .down { color: #FCA5A5; }
.lqs-stage .lqs-reacts { margin-top: 6px; }
.lqs-stage .lqs-react { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.22); }
.lqs-final { background: radial-gradient(600px 420px at 50% 0%, rgba(232, 25, 44, 0.4), transparent 65%), var(--lq-stage); }
.lqs-final-rank { font-family: var(--lq-display); font-weight: 800; font-size: clamp(72px, 26vw, 128px); line-height: 1; animation: lq-zoom .7s cubic-bezier(.2, .9, .3, 1.15) both; }
.lqs-stage .lqs-btn { max-width: 320px; }
.lqs-stage .lqs-btn--ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.3); }

@media (min-width: 700px) {
  .lqs-main { padding-top: 48px; }
  .lqs-tiles { max-width: 900px; width: 100%; justify-self: center; }
  .lqs-tiles[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- launcher list (teacher/admin shell page) ---------- */
.lql-active { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid #FECACA; background: #FFF0F2; margin-bottom: 10px; }
.lql-active strong { font-size: 15px; }
.lql-active .code { font-family: 'Syne', sans-serif; font-weight: 800; letter-spacing: 2px; font-size: 18px; color: #E8192C; }
.lql-active .grow { flex: 1; min-width: 160px; }
.lql-questions { max-height: 280px; overflow: auto; border: 1px solid #E8E9EE; border-radius: 12px; padding: 6px; display: grid; gap: 2px; }
.lql-q { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; font-family: 'Outfit', sans-serif; text-transform: none; letter-spacing: 0; font-weight: 400; color: #0D1117; }
.lql-q:hover { background: #F4F5F8; }
.lql-q input { width: 17px !important; height: 17px; margin-top: 2px; flex-shrink: 0; accent-color: #E8192C; }
.lql-q span { min-width: 0; overflow-wrap: anywhere; }
.lql-q em { font-style: normal; color: #9CA3AF; font-size: 12px; white-space: nowrap; margin-left: auto; padding-left: 8px; }
.lql-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.lql-note { font-size: 12.5px; color: #4B5563; margin: 0; }
.lql-note.warn { color: #B45309; }

/* ---------- keyframes ---------- */
@keyframes lq-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lq-pop { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes lq-rise { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes lq-zoom { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes lq-tile-in { from { transform: translateY(26px) scale(.94); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes lq-tick { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes lq-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes lq-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes lq-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes lq-float-up {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  12% { opacity: 1; transform: translate(0, -12vh) scale(1.1); }
  100% { transform: translate(var(--drift, 0px), -105vh) scale(1); opacity: 0; }
}
@keyframes lq-fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- reduced motion: no movement, state changes are instant ---------- */
@media (prefers-reduced-motion: reduce) {
  .lq-root *, .lq-root *::before, .lq-root *::after {
    animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .lq-confetti { display: none !important; }
  /* a reaction still shows (it is information), it just fades in place instead of flying */
  .lq-float { animation: lq-fade-static 1.8s linear forwards !important; bottom: 18vh; }
  .lqh-pod-who { opacity: 1; }
  .lqh-pod-block { transform: scaleY(1); }
}
@keyframes lq-fade-static { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ==========================================================
   Refinements after reviewing real screenshots
   ========================================================== */
/* base.css gives headings a dark colour; on the dark stage they must stay light. */
.lqh h1, .lqh h2, .lqh h3, .lqs-stage h1, .lqs-stage h2 { color: #fff; }
/* Numbers use the body face: the display face's digits are too wide and its "1" is easy to misread. */
.lqh-code, .lq-ring-num, .lqh-answered strong, .lqh-tile-count, .lqh-score, .lqh-rank, .lqh-pod-block,
.lqh-intro .lqh-intro-num, .lqh-chip strong, .lqs-getready-num, .lqs-points, .lqs-stat strong, .lqs-final-rank,
.lqs-input--code, .lqs-codechip, .lql-active .code { font-family: var(--lq-font, 'Outfit', sans-serif); font-weight: 800; }
.lqh-lobby { grid-template-columns: minmax(340px, 500px) minmax(0, 1fr); }
.lqh-code { font-size: clamp(46px, 6vw, 88px); letter-spacing: .12em; padding-left: .12em; max-width: 100%; }
.lqh-join { min-width: 0; overflow: hidden; }
.lqh-join p { overflow-wrap: anywhere; }
/* On the reveal the tick sits beside the count instead of on top of it. */
.lqh-tiles .lq-tile .lq-tick { position: static; flex-shrink: 0; }
.lqh-tiles .lq-tile { min-height: 96px; }
.lqh-podium[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 220px)); }
.lqh-podium[data-count="1"] { grid-template-columns: minmax(0, 240px); }
/* Launch dialog: question rows are plain compact rows, not the portal form's uppercase field labels. */
body.teacher-app .portal-form label.lql-q {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px;
  font-family: 'Outfit', sans-serif; font-size: 13.5px; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: #0D1117; cursor: pointer; line-height: 1.4;
}
body.teacher-app .portal-form label.lql-q:hover { background: #F4F5F8; }
body.teacher-app .portal-form label.lql-q input { width: 17px !important; height: 17px; margin: 2px 0 0; flex-shrink: 0; accent-color: #E8192C; }
body.teacher-app .portal-form label.lql-q span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
body.teacher-app .portal-form label.lql-q em { font-style: normal; color: #9CA3AF; font-size: 12px; white-space: nowrap; }
body.teacher-app .portal-form .lql-row label:not(.lql-q) select { width: 100%; }
@media (max-width: 900px) {
  .lqh-lobby { grid-template-columns: minmax(0, 1fr); }
  .lqh-code { font-size: clamp(40px, 13vw, 64px); }
  .lqh-tiles .lq-tile { min-height: 62px; }
  .lqh-controls .lqh-btn { white-space: nowrap; }
}
.lqh-roster-head h2 span { color: inherit; font-size: inherit; }

/* ==========================================================
   ROUND 2 — reactions on every screen, lobby emoji moves,
   questions on the phone, formatted code snippets
   ========================================================== */

/* The reaction layer must stay fixed over the whole host screen (".lqh > *" made it a zero-height grid row). */
.lqh > .lq-float-layer, .lq-float-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.lq-float-layer--phone { z-index: 70; }
/* Live-stream style reaction: pops up at the bottom, wobbles upward and fades away. */
.lq-float { position: absolute; bottom: 84px; display: grid; justify-items: center; font-size: 46px; line-height: 1; will-change: transform, opacity; animation: lq-react-rise 3.2s cubic-bezier(.22, .68, .32, 1) forwards; }
.lq-float span { display: block; animation: lq-react-sway 1.1s ease-in-out infinite alternate; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35)); }
.lq-float small { display: block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
.lq-float-layer--phone .lq-float { bottom: 96px; font-size: 38px; }
@keyframes lq-react-rise {
  0% { transform: translate(0, 40px) scale(.3) rotate(0deg); opacity: 0; }
  12% { transform: translate(0, 0) scale(1.25) rotate(var(--tilt, 0deg)); opacity: 1; }
  22% { transform: translate(0, -6vh) scale(1) rotate(0deg); opacity: 1; }
  80% { opacity: .9; }
  100% { transform: translate(var(--drift, 0px), -66vh) scale(.85) rotate(var(--tilt, 0deg)); opacity: 0; }
}
@keyframes lq-react-sway { from { transform: translateX(-9px) rotate(-8deg); } to { transform: translateX(9px) rotate(8deg); } }

/* Lobby: joined players' emoji do random little moves. */
.lqh-player .lq-avatar { transform-origin: 50% 80%; }
.lq-move-bounce { animation: lq-move-bounce 1s ease both; }
.lq-move-wiggle { animation: lq-move-wiggle 1s ease both; }
.lq-move-spin { animation: lq-move-spin 1s cubic-bezier(.3, 1.4, .5, 1) both; }
.lq-move-jump { animation: lq-move-jump 1s cubic-bezier(.3, 1.4, .5, 1) both; }
.lq-move-tada { animation: lq-move-tada 1s ease both; }
@keyframes lq-move-bounce { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-12px); } 50% { transform: translateY(0); } 70% { transform: translateY(-6px); } }
@keyframes lq-move-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-18deg); } 40% { transform: rotate(16deg); } 60% { transform: rotate(-12deg); } 80% { transform: rotate(8deg); } }
@keyframes lq-move-spin { from { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.2); } to { transform: rotate(360deg) scale(1); } }
@keyframes lq-move-jump { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.15, .82); } 45% { transform: translateY(-18px) scale(.92, 1.1); } 75% { transform: translateY(0) scale(1.08, .9); } }
@keyframes lq-move-tada { 0%, 100% { transform: scale(1) rotate(0); } 15% { transform: scale(.88) rotate(-6deg); } 35%, 65% { transform: scale(1.28) rotate(6deg); } 50% { transform: scale(1.28) rotate(-6deg); } }

/* Markdown question text (host + phone). Code blocks look like code: dark panel, monospace, coloured, left-aligned. */
.lq-md > :first-child { margin-top: 0; }
.lq-md > :last-child { margin-bottom: 0; }
.lq-md p { margin: 0 0 .45em; color: inherit; font: inherit; }
.lq-md strong { font-weight: 800; }
.lq-md ul, .lq-md ol { margin: 0 0 .45em; padding-left: 1.2em; text-align: left; display: inline-block; }
.lq-md code { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84em; font-weight: 500; background: rgba(255, 255, 255, 0.14); padding: .08em .36em; border-radius: 7px; }
.lq-md pre { margin: .55em auto 0; width: fit-content; max-width: 100%; box-sizing: border-box; text-align: left; overflow: auto; background: #0D1117; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 14px; padding: 14px 18px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); }
.lq-md pre code, .lq-md pre code.hljs { display: block; background: none; padding: 0; border-radius: 0; font-size: 1em; font-weight: 500; line-height: 1.5; white-space: pre; color: #E6EDF3; }
.lqh-prompt .lq-md pre { font-size: clamp(15px, 1.7vw, 24px); }
.lqh-prompt .lq-md { display: grid; justify-items: center; }

/* Phone: the question, the countdown and the answers (shape + text). */
.lqs-play { grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 12px; }
.lqs-play-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lqs-qcount { font-size: 13px; font-weight: 700; letter-spacing: .04em; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); white-space: nowrap; }
.lqs-play .lq-ring--sm { width: 58px; height: 58px; }
.lqs-play .lq-ring--sm .lq-ring-num { font-size: 21px; }
.lqs-prompt { max-height: 40vh; overflow: auto; -webkit-overflow-scrolling: touch; font-family: var(--lq-display); font-weight: 700; font-size: clamp(17px, 4.9vw, 24px); line-height: 1.28; color: #fff; overflow-wrap: anywhere; animation: lq-rise .4s ease both; }
.lqs-prompt .lq-md pre { margin-left: 0; font-size: 13.5px; padding: 11px 13px; border-radius: 12px; }
.lqs-multi-hint { margin: 8px 0 0; font-family: var(--lq-font); font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.75); }
.lqs-tiles, .lqs-tiles[data-count="2"] { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(56px, 1fr); gap: 10px; overflow: auto; }
.lqs-tiles .lq-tile { justify-content: flex-start; gap: 12px; padding: 10px 44px 14px 14px; text-align: left; }
.lqs-tiles .lq-shape { width: 30px; height: 30px; }
.lqs-tile-text { flex: 1; min-width: 0; font-size: clamp(15px, 4.3vw, 19px); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.lqs-tile-text code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .88em; background: rgba(255, 255, 255, 0.18); padding: .06em .32em; border-radius: 6px; }
.lqs-tiles .lq-tile .lq-tick { top: 50%; right: 10px; margin-top: -15px; }
.lqs-mute { background: #fff; cursor: pointer; font-size: 14px; }
@media (min-width: 700px) {
  .lqs-play { max-width: 980px; width: 100%; justify-self: center; }
  .lqs-tiles, .lqs-tiles[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .lqs-tiles .lq-tile { padding: 16px 48px 20px 18px; }
  .lqs-tiles .lq-shape { width: 38px; height: 38px; }
  .lqs-tile-text { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .lq-float { animation: lq-fade-static 1.8s linear forwards !important; bottom: 18vh; }
  .lq-float span { animation: none !important; }
}

/* ==========================================================
   ROUND 3 — student question / answer screens, laid out properly
   on phone, tablet and desktop.
   The stage is always full-bleed; its content sits in a centred
   column. The question owns the flexible middle of the screen and
   the answer tiles sit together at the bottom (thumb reach on a
   phone, a tidy 2-up grid on wider screens) instead of being
   stretched to fill whatever height is left.
   ========================================================== */
.lqs-stage {
  background:
    radial-gradient(820px 460px at 88% -8%, rgba(232, 25, 44, 0.26), transparent 62%),
    radial-gradient(640px 420px at -6% 106%, rgba(79, 70, 229, 0.20), transparent 60%),
    var(--lq-stage);
}
.lqs-stage.lqs-play {
  max-width: none; width: auto; justify-self: stretch;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  justify-items: center; gap: 14px;
}
.lqs-play > * { width: 100%; max-width: 1080px; min-width: 0; }

/* header: question count · countdown · me */
.lqs-play-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.lqs-qcount { justify-self: start; font-size: 13px; }
.lqs-qcount em { font-style: normal; opacity: .7; }
.lqs-me { justify-self: end; display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); font-size: 13px; font-weight: 600; }
.lqs-me .lq-avatar--sm { width: 28px; height: 28px; font-size: 16px; box-shadow: none; }
.lqs-me-name { min-width: 0; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none; }
.lqs-me strong { font-family: var(--lq-font); font-weight: 800; font-variant-numeric: tabular-nums; }
.lqs-play .lq-ring--sm { width: 62px; height: 62px; }
.lqs-play .lq-ring--sm .lq-ring-num { font-size: 22px; }

/* the question: centred in the free space, scrolls only if it is genuinely long */
.lqs-prompt {
  max-height: none; display: grid; align-content: safe center; justify-items: center; text-align: center;
  overflow: auto; padding: 4px 2px;
  font-size: clamp(19px, 5.3vw, 26px); line-height: 1.26;
}
.lqs-prompt .lq-md { display: grid; justify-items: center; max-width: 100%; }
.lqs-prompt .lq-md pre { margin: .6em auto 0; font-size: 14px; }
.lqs-multi-hint { text-align: center; }

/* the answers */
.lqs-tiles, .lqs-tiles[data-count="2"] {
  grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; align-content: end; gap: 10px; overflow: visible;
}
.lqs-tiles .lq-tile { min-height: clamp(60px, 10.5vh, 92px); padding: 12px 46px 16px 16px; gap: 14px; border-radius: 16px; }
.lqs-tiles .lq-shape { width: 30px; height: 30px; }
.lqs-tile-text { font-size: clamp(15.5px, 4.4vw, 19px); }
.lqs-tiles[data-count="5"], .lqs-tiles[data-count="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lqs-submit { justify-self: center; }

/* short phones (landscape or small devices): keep everything on one screen */
@media (max-height: 620px) {
  .lqs-stage.lqs-play { gap: 8px; }
  .lqs-tiles .lq-tile { min-height: 50px; padding-top: 8px; padding-bottom: 12px; }
  .lqs-prompt { font-size: 17px; }
  .lqs-play .lq-ring--sm { width: 50px; height: 50px; }
  .lqs-play .lq-ring--sm .lq-ring-num { font-size: 18px; }
}

/* tablet */
@media (min-width: 700px) {
  .lqs-stage { padding: 22px 28px 26px; }
  .lqs-stage.lqs-play { gap: 20px; max-width: none; }
  .lqs-qcount { font-size: 15px; padding: 8px 16px; }
  .lqs-me { font-size: 15px; padding: 5px 16px 5px 5px; gap: 10px; }
  .lqs-me .lq-avatar--sm { width: 36px; height: 36px; font-size: 20px; }
  .lqs-me-name { display: inline; }
  .lqs-play .lq-ring--sm { width: 92px; height: 92px; }
  .lqs-play .lq-ring--sm .lq-ring-num { font-size: 34px; }
  .lqs-prompt { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.22; }
  .lqs-prompt .lq-md pre { font-size: clamp(16px, 1.9vw, 21px); padding: 16px 20px; }
  .lqs-multi-hint { font-size: 16px; margin-top: 12px; }
  .lqs-tiles, .lqs-tiles[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 1080px; }
  .lqs-tiles[data-count="3"] .lq-tile:last-child { grid-column: 1 / -1; }
  .lqs-tiles .lq-tile { min-height: clamp(96px, 13vh, 132px); padding: 18px 56px 24px 24px; gap: 18px; border-radius: 20px; }
  .lqs-tiles .lq-shape { width: 44px; height: 44px; }
  .lqs-tile-text { font-size: clamp(19px, 2.2vw, 25px); }
  .lqs-tiles .lq-tile .lq-tick { right: 16px; width: 34px; height: 34px; margin-top: -17px; font-size: 16px; }
  .lqs-submit { width: auto; min-width: 280px; padding: 16px 40px; font-size: 19px; border-radius: 16px; }

  /* the between-question screens scale up too, instead of a phone layout floating in a big window */
  .lqs-center { gap: 20px; }
  .lqs-center h2 { font-size: clamp(44px, 6vw, 72px); }
  .lqs-center p { font-size: 20px; max-width: 520px; }
  .lqs-center small { font-size: 16px; }
  .lqs-badge { width: 150px; height: 150px; font-size: 72px; }
  .lqs-points { font-size: 48px; padding: 8px 30px; }
  .lqs-stat { min-width: 170px; padding: 16px 22px; font-size: 15px; border-radius: 18px; }
  .lqs-stat strong { font-size: 36px; }
  .lqs-statrow { gap: 16px; }
  .lqs-getready-num { width: 150px; height: 150px; font-size: 76px; }
  .lqs-picked .lq-tile { width: 132px; height: 132px; border-radius: 22px; }
  .lqs-picked .lq-shape { width: 70px; height: 70px; }
  .lqs-stage .lqs-react { width: 64px; height: 64px; font-size: 32px; }
  .lqs-stage .lqs-reacts { gap: 12px; margin-top: 10px; }
  .lqs-stage .lqs-btn { max-width: 380px; font-size: 18px; padding: 17px 22px; }
  .lqs-final-rank { font-size: clamp(120px, 16vw, 190px); }
}

/* desktop */
@media (min-width: 1100px) {
  .lqs-stage { padding: 28px 40px 34px; }
  .lqs-stage.lqs-play { gap: 26px; }
  .lqs-play .lq-ring--sm { width: 104px; height: 104px; }
  .lqs-play .lq-ring--sm .lq-ring-num { font-size: 38px; }
  .lqs-prompt { font-size: clamp(32px, 2.9vw, 44px); }
  .lqs-tiles .lq-tile { min-height: clamp(110px, 15vh, 150px); }
  .lqs-tiles .lq-shape { width: 50px; height: 50px; }
}

@media (min-width: 700px) { .lqs-picked { gap: 18px; } }
