:root {
  --bg: #070814;
  --ink: #f6f3ee;
  --muted: #b7b3c7;
  --pink: #ff4d8d;
  --lime: #c6f54a;
  --cyan: #3ee0ff;
  --sun: #ffd23f;
  --violet: #b388ff;
  --coral: #ff7a59;
  --glass: rgba(16, 18, 34, 0.62);
  --line: rgba(255, 255, 255, 0.14);
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", monospace;
  --radius: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(16px, 1.5vw, 18px);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 77, 141, 0.28), transparent 55%),
    radial-gradient(800px 480px at 110% 10%, rgba(62, 224, 255, 0.18), transparent 50%),
    radial-gradient(700px 500px at 70% 120%, rgba(198, 245, 74, 0.12), transparent 50%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
  z-index: 1;
}

a {
  color: inherit;
}

h1,
h2,
h3,
.logo,
.role strong {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0;
}

.shell {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 2.4rem) 6.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: -0.04em;
}

.brand span {
  color: var(--lime);
}

.chip-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(198, 245, 74, 0.7);
  animation: ping 1.8s ease-out infinite;
}

.hero {
  padding: 1.2rem 0 0.4rem;
}

.eyebrow {
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 0 0 0.8rem;
}

.logo {
  font-size: clamp(4.2rem, 14vw, 8.4rem);
  font-weight: 800;
  background: linear-gradient(120deg, #fff 10%, #ffd0e4 35%, #c6f54a 62%, #3ee0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 18px 30px rgba(255, 77, 141, 0.25));
  animation: rise 0.8s var(--ease) both;
}

.logo span {
  color: inherit;
}

.hero .eyebrow:empty,
.hero .lede:empty {
  display: none;
}

.lede {
  max-width: 38rem;
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0.8rem 0 0;
  animation: rise 0.9s var(--ease) 0.08s both;
}

.role-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 760px) {
  .role-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.role {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 190px;
  padding: 1.4rem 1.4rem 1.3rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: #141018;
  isolation: isolate;
  transform: translateY(0);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  animation: rise 0.9s var(--ease) both;
}

.role:nth-child(2) {
  animation-delay: 0.12s;
}

.role::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 70px;
  right: 8%;
  top: 12%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  filter: blur(2px);
  transform: rotate(-18deg);
  z-index: -1;
}

.role strong {
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.role span:last-child {
  max-width: 24ch;
  font-weight: 500;
}

.role-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.7;
}

.host-role {
  background: linear-gradient(145deg, #ffd23f, #ff7a59 70%);
}

.play-role {
  background: linear-gradient(145deg, #c6f54a, #3ee0ff 80%);
}

.role:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.35);
}

.role:active {
  transform: translateY(2px) scale(0.99);
}

.marquee {
  margin: 2.2rem -8vw 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: ticker 28s linear infinite;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: rgba(246, 243, 238, 0.72);
}

.marquee-set {
  display: flex;
  flex-shrink: 0;
  gap: 2.2rem;
  padding-right: 2.2rem;
}

.marquee b {
  color: var(--sun);
  font-weight: 700;
}

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.2rem;
  backdrop-filter: blur(18px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.card h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 0.4rem;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: pop 0.55s var(--ease);
}

label,
.label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(7, 8, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="range"],
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  accent-color: var(--lime);
}

input:focus,
select:focus {
  border-color: rgba(62, 224, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(62, 224, 255, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.3rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  cursor: pointer;
  text-decoration: none;
  color: #141018;
  background: var(--lime);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.12),
    inset 0 8px 12px rgba(255, 255, 255, 0.35),
    0 12px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s var(--ease), filter 0.18s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.985);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.btn-primary {
  background: linear-gradient(180deg, #ff7aa8, var(--pink));
  color: white;
}

.btn-cyan {
  background: linear-gradient(180deg, #9af3ff, var(--cyan));
}

.btn-sun {
  background: linear-gradient(180deg, #ffe58a, var(--sun));
}

.room-wrap {
  position: relative;
  margin: 1rem 0 0.4rem;
  padding: 1.2rem 0.6rem 1rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(198, 245, 74, 0.16), transparent 60%),
    rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(198, 245, 74, 0.45);
  text-align: center;
  overflow: hidden;
}

.room-wrap::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(198, 245, 74, 0.25), transparent 30%);
  animation: spin 8s linear infinite;
}

.room-code {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  letter-spacing: 0.18em;
  color: var(--lime);
  text-shadow: 0 0 24px rgba(198, 245, 74, 0.45);
}

.pack-title {
  position: relative;
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.join-hint {
  position: relative;
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.55rem;
  max-height: 280px;
  overflow: auto;
}

.player-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  animation: chip-in 0.45s var(--ease) both;
}

.avatar {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  animation: bob 3.2s ease-in-out infinite;
}

.pts {
  font-variant-numeric: tabular-nums;
  color: var(--sun);
  font-weight: 700;
}

.empty-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
}

.question-text {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.4vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0.9rem 0 0.35rem;
}

.host-roast {
  margin: 0.2rem 0 0.6rem;
  color: #ffb3cc;
}

.timer-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0.8rem 0 1rem;
  box-shadow: inset 0 0 0 1px var(--line);
}

.timer-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--pink), var(--sun), var(--lime));
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(255, 210, 63, 0.45);
}

.timer-fill.urgent {
  background: linear-gradient(90deg, #ff2d55, #ff7a59);
  filter: saturate(1.3);
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.page-play #question.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 7.5rem);
}

.page-play .answer-grid {
  flex: 1;
  min-height: 46dvh;
}

.answer-btn {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  border: 0;
  border-radius: 26px;
  padding: 0.9rem 1rem 1rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #141018;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.12),
    inset 0 10px 16px rgba(255, 255, 255, 0.38),
    0 16px 28px rgba(0, 0, 0, 0.22);
  transition: transform 0.16s var(--ease), filter 0.2s;
  animation: inflate 0.55s var(--ease) both;
}

.answer-btn:nth-child(2) { animation-delay: 0.05s; }
.answer-btn:nth-child(3) { animation-delay: 0.1s; }
.answer-btn:nth-child(4) { animation-delay: 0.15s; }

.answer-btn::before {
  content: attr(data-label);
  font-size: 1.15rem;
  opacity: 0.8;
  margin-bottom: auto;
}

.answer-btn::after {
  content: "";
  position: absolute;
  width: 58%;
  height: 26%;
  left: 10%;
  top: 12%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
  transform: rotate(-12deg);
  pointer-events: none;
}

.answer-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.015);
}

.answer-btn:active:not(:disabled),
.answer-btn.picked {
  transform: translateY(4px) scale(0.97);
  box-shadow:
    inset 0 12px 18px rgba(0, 0, 0, 0.18),
    0 6px 12px rgba(0, 0, 0, 0.18);
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.a0 { background: linear-gradient(160deg, #9af4ff, #14c4e0); }
.answer-btn.a1 { background: linear-gradient(160deg, #ff8ab4, #ff2f78); color: white; }
.answer-btn.a2 { background: linear-gradient(160deg, #ffe58a, #ffb703); }
.answer-btn.a3 { background: linear-gradient(160deg, #d2b8ff, #7a5cff); color: white; }

.answer-btn.dim {
  filter: grayscale(0.45) brightness(0.72);
}

.answer-btn.correct {
  filter: none;
  animation: celebrate 0.55s var(--ease);
  outline: 4px solid var(--lime);
  outline-offset: 3px;
}

.leaderboard {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.55rem;
  margin-top: 0.4rem;
}

.leaderboard th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0 0.7rem;
}

.leaderboard td {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.7rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.leaderboard td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 16px 0 0 16px;
  font-weight: 700;
}

.leaderboard td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 16px 16px 0;
  color: var(--sun);
  font-variant-numeric: tabular-nums;
}

.leaderboard tr.rank-1 td {
  background: rgba(255, 210, 63, 0.14);
}

.leaderboard tr.rank-2 td {
  background: rgba(198, 214, 233, 0.1);
}

.leaderboard tr.rank-3 td {
  background: rgba(255, 122, 89, 0.11);
}

.finale {
  background:
    radial-gradient(400px 180px at 20% 0%, rgba(255, 210, 63, 0.25), transparent 60%),
    var(--glass);
}

.score-pop {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: -0.04em;
  margin: 0.4rem 0 0;
  animation: pop 0.5s var(--ease);
}

.wait-pulse {
  text-align: center;
  padding: 1.2rem 0.4rem 0.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.04em;
}

.wait-pulse small {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.footer-hint,
.fine {
  color: var(--muted);
  font-size: 0.88rem;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%) translateY(140%);
  background: var(--sun);
  color: #141018;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.45s var(--ease);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.confetti {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  top: -12px;
  animation: fall 2.4s var(--ease) forwards;
}

.hidden {
  display: none !important;
}

/* Parade + inflatables */
.parade {
  position: fixed;
  inset: -8vh -6vw;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.4s linear;
}

.sky {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 22%, #fff, transparent),
    radial-gradient(2px 2px at 28% 68%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 70% 18%, #fff, transparent),
    radial-gradient(2px 2px at 84% 74%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 48% 40%, #fff, transparent);
  opacity: 0.55;
  animation: twinkle 4.5s ease-in-out infinite;
}

.blob {
  position: absolute;
  filter: blur(8px);
  opacity: 0.55;
  animation: morph 14s ease-in-out infinite;
}

.blob-a {
  width: 280px;
  height: 220px;
  left: -40px;
  top: 12%;
  background: #ff4d8d;
  border-radius: 60% 40% 55% 45%;
}

.blob-b {
  width: 240px;
  height: 240px;
  right: -30px;
  top: 38%;
  background: #3ee0ff;
  border-radius: 45% 55% 40% 60%;
  animation-delay: -4s;
}

.blob-c {
  width: 200px;
  height: 180px;
  left: 30%;
  bottom: -20px;
  background: #c6f54a;
  border-radius: 50% 50% 40% 60%;
  animation-delay: -7s;
  opacity: 0.28;
}

.floater {
  position: absolute;
  width: clamp(84px, 12vw, 150px);
  animation: drift 9s ease-in-out infinite;
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.28));
}

.floater svg {
  width: 100%;
  height: auto;
  display: block;
}

.f-flamingo { left: 4%; top: 18%; animation-duration: 8.5s; }
.f-duck { right: 6%; top: 8%; width: clamp(110px, 16vw, 190px); animation-duration: 7.2s; animation-delay: -2s; }
.f-dino { left: 8%; bottom: 8%; animation-duration: 10s; animation-delay: -3s; }
.f-uni { right: 10%; bottom: 14%; animation-duration: 9.4s; animation-delay: -1s; }
.f-dog { left: 38%; top: 6%; width: clamp(120px, 18vw, 210px); animation-duration: 11s; }
.f-ring { right: 28%; top: 22%; width: 78px; animation-duration: 6.5s; }
.f-octo { left: 22%; bottom: 6%; animation-duration: 8s; animation-delay: -5s; }
.f-star { right: 18%; top: 46%; width: 72px; animation-duration: 5.8s; }

.parade.party .floater {
  animation-duration: 2.8s;
}

.mascot {
  position: fixed;
  z-index: 20;
  right: 1rem;
  bottom: 0.8rem;
  width: min(168px, 34vw);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35));
}

.mascot-svg {
  display: block;
  animation: bob 3.4s ease-in-out infinite;
}

.mascot-svg svg {
  width: 100%;
  height: auto;
}

.bubble {
  display: block;
  position: absolute;
  right: 78%;
  bottom: 72%;
  width: min(220px, 52vw);
  padding: 0.7rem 0.8rem;
  border-radius: 18px 18px 4px 18px;
  background: rgba(246, 243, 238, 0.95);
  color: #171422;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.mascot.talking .bubble {
  opacity: 1;
  transform: none;
}

.mood-think .mascot-svg { animation: tilt 1.4s ease-in-out infinite; }
.mood-win .mascot-svg { animation: inflate 0.7s var(--ease); }
.mood-lose .mascot-svg { animation: deflate 0.6s var(--ease) both; filter: grayscale(0.25); }
.mood-hype .mascot-svg { animation: hop 0.55s ease-in-out infinite; }
.mood-lobby .mascot-svg { animation: bob 2.4s ease-in-out infinite; }

.mascot.boop .mascot-svg {
  animation: boop 0.45s var(--ease);
}

.page-play.answering .floater {
  opacity: 0.2;
  transition: opacity 0.4s;
}

.page-play.answering .mascot {
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-18px) rotate(5deg); }
}

@keyframes morph {
  0%, 100% { border-radius: 60% 40% 50% 50%; transform: translateY(0) scale(1); }
  50% { border-radius: 40% 60% 45% 55%; transform: translateY(-16px) scale(1.06); }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes ping {
  70% { box-shadow: 0 0 0 8px rgba(198, 245, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 245, 74, 0); }
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

@keyframes inflate {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes deflate {
  to { transform: scale(0.86) translateY(8px) rotate(-6deg); }
}

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

@keyframes tilt {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(7deg); }
}

@keyframes boop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12, 0.9); }
  100% { transform: scale(1); }
}

@keyframes celebrate {
  0% { transform: scale(0.96) rotate(-1deg); }
  40% { transform: scale(1.04) rotate(1deg); }
  100% { transform: scale(1); }
}

@keyframes shake {
  25% { transform: translateX(-1px) scaleX(var(--sx, 1)); }
  75% { transform: translateX(1px); }
}

@keyframes fall {
  to { transform: translateY(105vh) rotate(540deg); opacity: 0.2; }
}

@keyframes twinkle {
  50% { opacity: 0.25; }
}

/* ---- topbar, knoppen, focus ------------------------------------------- */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn,
.theme-toggle {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s;
}

.icon-btn:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

/* ---- setup ------------------------------------------------------------ */
.pack-tagline {
  margin: 0.45rem 0 0;
  min-height: 1.2em;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

.pick-logo {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.theme-picker button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: rgba(7, 8, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}

.theme-picker button span {
  font-size: 1.3rem;
}

.theme-picker button:hover {
  transform: translateY(-2px);
}

.theme-picker button[aria-checked="true"] {
  border-color: var(--lime);
  box-shadow: 0 0 0 4px rgba(198, 245, 74, 0.15);
}

/* ---- lobby ------------------------------------------------------------ */
.join-panel {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0.4rem;
}

@media (min-width: 760px) {
  .join-panel {
    grid-template-columns: 1fr auto;
  }
}

.join-panel .room-wrap {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qr-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.qr {
  width: clamp(150px, 18vw, 220px);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  animation: inflate 0.6s var(--ease) both;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr:empty {
  display: none;
}

.qr-card figcaption {
  max-width: 22ch;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.lobby-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.pill-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.player-list li.away {
  opacity: 0.45;
  border-style: dashed;
}

.player-list li.away .avatar {
  animation: none;
  filter: grayscale(1);
}

/* ---- vraag + aftellen ------------------------------------------------- */
.stage {
  position: relative;
}

#hostChoices {
  pointer-events: none;
}

.answers-pill b {
  color: var(--lime);
}

.answers-pill.bump {
  animation: bump 0.4s var(--ease);
}

.answer-grid.pending .answer-btn {
  opacity: 0;
  transform: scale(0.8);
  animation: none;
}

.countdown {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.2rem;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(7, 8, 20, 0.5), rgba(7, 8, 20, 0.9));
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.page-host .countdown {
  inset: auto 0 0;
  top: 40%;
  background: radial-gradient(ellipse at 50% 60%, rgba(7, 8, 20, 0.6), rgba(7, 8, 20, 0.92));
}

.page-play .countdown {
  position: fixed;
  z-index: 25;
}

.countdown.show {
  opacity: 1;
  visibility: visible;
}

.count-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.count-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(6rem, 22vw, 11rem);
  line-height: 1;
  background: linear-gradient(160deg, #fff, var(--sun) 50%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 30px rgba(255, 77, 141, 0.35));
}

.count-num.tick {
  animation: count-pop 0.9s var(--ease);
}

.feedback.pending-ack {
  color: var(--muted);
  animation: blink-soft 1.2s ease-in-out infinite;
}

.feedback.is-ok {
  color: var(--lime);
  font-weight: 700;
}

.feedback.is-bad {
  color: var(--coral);
  font-weight: 700;
}

/* ---- resultaten ------------------------------------------------------- */
.correct-answer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  animation: rise 0.5s var(--ease) both;
}

.shape {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 0.4em;
  font-size: 0.8em;
  color: #141018;
}

.shape.a0 { background: linear-gradient(160deg, #9af4ff, #14c4e0); }
.shape.a1 { background: linear-gradient(160deg, #ff8ab4, #ff2f78); color: #fff; }
.shape.a2 { background: linear-gradient(160deg, #ffe58a, #ffb703); }
.shape.a3 { background: linear-gradient(160deg, #d2b8ff, #7a5cff); color: #fff; }

.explain {
  color: var(--muted);
  margin: 0.6rem 0 0;
}

.section-title {
  margin-top: 1.4rem;
}

.bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  align-items: start;
  margin: 1rem 0 0.4rem;
}

.bar {
  display: grid;
  grid-template-rows: auto 140px auto;
  gap: 0.4rem;
  text-align: center;
}

.bar-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--d) + 0.5s);
}

.bar-track {
  display: flex;
  align-items: flex-end;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  height: max(6px, calc(var(--h) * 100%));
  border-radius: 18px 18px 6px 6px;
  transform-origin: bottom;
  box-shadow: inset 0 10px 14px rgba(255, 255, 255, 0.35);
  animation: grow 0.9s var(--ease) both;
  animation-delay: var(--d);
}

.bar.a0 .bar-fill { background: linear-gradient(180deg, #9af4ff, #14c4e0); }
.bar.a1 .bar-fill { background: linear-gradient(180deg, #ff8ab4, #ff2f78); }
.bar.a2 .bar-fill { background: linear-gradient(180deg, #ffe58a, #ffb703); }
.bar.a3 .bar-fill { background: linear-gradient(180deg, #d2b8ff, #7a5cff); }

.bar-label {
  font-size: 0.85rem;
  line-height: 1.2;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.bar-label b {
  display: block;
  font-size: 1rem;
  color: var(--ink);
}

.bar.is-wrong {
  animation: dim-out 0.6s ease forwards 1.2s;
}

.bar.is-correct .bar-track {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

.bar.is-correct .bar-label {
  color: var(--ink);
  font-weight: 600;
}

.tick {
  color: var(--lime);
}

.leaderboard tr[style] td {
  animation: row-in 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms);
}

.row-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.avatar.sm {
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.95rem;
  animation: none;
}

.gained {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lime);
  background: rgba(198, 245, 74, 0.12);
}

.leaderboard td.move-cell {
  width: 3.2rem;
  text-align: center;
}

.move {
  font-size: 0.8rem;
  font-weight: 700;
}

.move.up { color: var(--lime); }
.move.down { color: var(--coral); }
.move.same { color: var(--muted); }

.leaderboard tr.me td {
  border-color: var(--lime);
}

/* ---- podium ----------------------------------------------------------- */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 0.8rem;
  margin: 1.4rem 0 0.8rem;
}

.podium-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  text-align: center;
  animation: podium-rise 0.9s var(--ease) both;
}

.podium-spot.place-3 { animation-delay: 0.3s; }
.podium-spot.place-2 { animation-delay: 1.1s; }
.podium-spot.place-1 { animation-delay: 1.9s; }

.podium-avatar {
  font-size: clamp(2rem, 5vw, 3.2rem);
  animation: bob 3s ease-in-out infinite;
}

.place-1 .podium-avatar {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
}

.place-1 .podium-name::before {
  content: "👑 ";
}

.podium-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.podium-score {
  color: var(--sun);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.podium-block {
  width: 100%;
  display: grid;
  place-items: start center;
  padding-top: 0.5rem;
  border-radius: 18px 18px 6px 6px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: rgba(20, 16, 24, 0.7);
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.12),
    inset 0 10px 16px rgba(255, 255, 255, 0.35);
}

.place-1 .podium-block { height: 150px; background: linear-gradient(180deg, #ffe58a, var(--sun)); }
.place-2 .podium-block { height: 110px; background: linear-gradient(180deg, #eef3fb, #b9c6d8); }
.place-3 .podium-block { height: 80px; background: linear-gradient(180deg, #ffb59e, var(--coral)); }

/* ---- persoonlijke uitslag (telefoon) ---------------------------------- */
.verdict {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: -0.04em;
}

.verdict:empty {
  display: none;
}

.verdict-icon {
  display: grid;
  place-items: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  font-size: 0.8em;
  color: #141018;
  animation: inflate 0.6s var(--ease) both;
}

.verdict.ok { color: var(--lime); }
.verdict.ok .verdict-icon { background: var(--lime); }
.verdict.bad { color: var(--coral); animation: shake-x 0.5s ease; }
.verdict.bad .verdict-icon { background: var(--coral); }
.verdict.late { color: var(--muted); }
.verdict.late .verdict-icon { background: var(--muted); }

.points-pill {
  display: inline-block;
  margin: 0.7rem 0 0;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--lime);
  background: rgba(198, 245, 74, 0.14);
  animation: pop 0.5s var(--ease) 0.2s both;
}

.points-pill.zero {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.points-pill:empty {
  display: none;
}

.score-pop small {
  font-family: var(--font-body);
  font-size: 0.45em;
  letter-spacing: 0;
  color: var(--muted);
}

.rank-line {
  margin: 0.3rem 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.streak-badge {
  display: inline-block;
  margin: 0.6rem 0 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 800;
  color: #141018;
  background: linear-gradient(90deg, var(--coral), var(--sun));
  animation: flame 1.2s ease-in-out infinite;
}

.result-answer {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.result-answer p {
  margin: 0.3rem 0;
}

.final-rank {
  margin: 0.6rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  letter-spacing: -0.03em;
}

.final-rank.winner {
  color: var(--sun);
  animation: celebrate 0.8s var(--ease);
}

/* ---- groot scherm (tv / beamer) --------------------------------------- */
@media (min-width: 1200px) {
  .page-host .shell { max-width: 1320px; }
  .page-host .question-text { font-size: clamp(2.4rem, 3.6vw, 3.8rem); }
  .page-host .answer-btn { min-height: 150px; font-size: 1.6rem; }
  .page-host .room-code { font-size: 6rem; }
  .page-host .bar { grid-template-rows: auto 220px auto; }
  .page-host .bar-label { font-size: 1rem; }
}

@media (max-width: 560px) {
  .bar { grid-template-rows: auto 100px auto; }
  .bar-label { font-size: 0.75rem; }
  .podium-block { font-size: 1.6rem; }
}

@keyframes count-pop {
  0% { transform: scale(1.8); opacity: 0; }
  25% { transform: scale(0.92); opacity: 1; }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 0.9; }
}

@keyframes bump {
  40% { transform: scale(1.18); }
}

@keyframes grow {
  from { transform: scaleY(0); }
}

@keyframes dim-out {
  to { opacity: 0.45; filter: saturate(0.5); }
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

@keyframes podium-rise {
  from { opacity: 0; transform: translateY(60px) scale(0.9); }
  70% { transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes shake-x {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes flame {
  50% { transform: scale(1.06) rotate(-1deg); box-shadow: 0 0 24px rgba(255, 122, 89, 0.6); }
}

@keyframes blink-soft {
  50% { opacity: 0.5; }
}

/* ---- geluid ------------------------------------------------------------ */
.audio-ctl {
  position: relative;
}

.audio-btn.needs-unlock {
  animation: ping-btn 1.6s ease-out infinite;
}

.audio-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 30;
  width: 240px;
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 30, 0.96);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: pop 0.25s var(--ease);
}

.audio-panel[hidden] {
  display: none;
}

.audio-row,
.audio-check {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.audio-row {
  display: grid;
  gap: 0.3rem;
}

.audio-row input {
  width: 100%;
}

.audio-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---- homepage: studio-link --------------------------------------------- */
.studio-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  transition: transform 0.3s var(--ease), background 0.3s;
  animation: rise 0.9s var(--ease) 0.2s both;
}

.studio-link:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.09);
}

.studio-link .role-kicker {
  display: block;
}

.studio-link strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.studio-icon {
  font-size: 1.8rem;
}

.studio-sub {
  color: var(--muted);
  font-size: 0.92rem;
}

.studio-arrow {
  margin-left: auto;
  font-size: 1.4rem;
  transition: transform 0.3s var(--ease);
}

.studio-link:hover .studio-arrow {
  transform: translateX(4px);
}

.inline-link {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.inline-link:hover {
  text-decoration: underline;
}

/* ---- editor ------------------------------------------------------------ */
.shell-wide {
  max-width: 1320px;
}

.page-editor .shell {
  padding-bottom: 2rem;
}

.page-editor .floater {
  opacity: 0.22;
}

.page-editor .mascot {
  width: min(110px, 24vw);
}

@media (max-width: 899px) {
  .page-editor .mascot {
    display: none;
  }
}

.editor-head {
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tabs button {
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button[aria-selected="true"] {
  color: #141018;
  background: var(--lime);
  border-color: transparent;
}

.studio-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .studio-grid {
    grid-template-columns: 300px 1fr;
    align-items: start;
  }

  .pack-list-card {
    position: sticky;
    top: 1rem;
  }

  .page-editor .save-bar {
    margin-right: 120px;
  }
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-small {
  width: auto;
  margin-top: 0;
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-danger {
  color: #141018;
  background: var(--coral);
}

.file-btn {
  position: relative;
  overflow: hidden;
  margin: 0;
  text-transform: none;
  letter-spacing: -0.03em;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pack-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  max-height: 60vh;
  overflow: auto;
  margin: 1rem 0 0;
  padding: 0;
}

.pack-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.pack-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.pack-item.active {
  border-color: var(--lime);
  background: rgba(198, 245, 74, 0.08);
}

.pack-icon {
  font-size: 1.3rem;
}

.pack-meta {
  display: grid;
  min-width: 0;
}

.pack-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-meta small {
  color: var(--muted);
}

.empty-editor {
  display: grid;
  place-items: center;
  gap: 0.6rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  font-size: 2.4rem;
}

.empty-editor .btn {
  width: auto;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  font: inherit;
  color: var(--ink);
  background: rgba(7, 8, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
  border-color: rgba(62, 224, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(62, 224, 255, 0.15);
}

.pe-fields {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

@media (min-width: 700px) {
  .pe-fields {
    grid-template-columns: 2fr 2fr 1fr;
  }
}

.pe-title input {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.notice {
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(62, 224, 255, 0.3);
  background: rgba(62, 224, 255, 0.08);
  font-size: 0.9rem;
}

.pe-errors {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 122, 89, 0.5);
  background: rgba(255, 122, 89, 0.1);
}

.pe-errors ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.q-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

.q-card {
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  animation: pop 0.4s var(--ease);
}

.q-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.q-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.q-tools {
  display: flex;
  gap: 0.3rem;
}

.tool {
  min-width: 2.1rem;
  height: 2.1rem;
  display: inline-grid;
  place-items: center;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--ease);
}

.tool:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.tool:disabled {
  opacity: 0.3;
  cursor: default;
}

.q-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.choice-hint {
  margin: 0.5rem 0 0.3rem;
  font-size: 0.78rem;
}

.q-choices {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 700px) {
  .q-choices {
    grid-template-columns: 1fr 1fr;
  }
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.choice-row.is-correct {
  border-color: var(--lime);
  background: rgba(198, 245, 74, 0.08);
}

.choice-mark {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.choice-mark input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-mark .shape {
  font-size: 1.25rem;
  opacity: 0.45;
  transition: opacity 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.choice-mark:hover .shape {
  opacity: 0.8;
}

.choice-row.is-correct .shape {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 0 0 3px var(--lime);
}

.choice-mark input:focus-visible + .shape {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.choice-text {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.8rem;
}

.q-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.7rem;
}

.link-btn {
  padding: 0.3rem 0;
  font: inherit;
  font-weight: 600;
  color: var(--cyan);
  background: none;
  border: 0;
  cursor: pointer;
}

.time-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.time-field input {
  width: 160px;
}

.time-field output {
  min-width: 3ch;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sun);
}

.q-extra {
  margin-top: 0.7rem;
}

.q-extra summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
}

.q-extra .field {
  margin-top: 0.6rem;
}

.add-q {
  margin-top: 1rem;
}

.save-bar {
  position: sticky;
  bottom: 0.8rem;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 30, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: rise 0.4s var(--ease);
}

.save-bar[hidden] {
  display: none;
}

.save-state {
  font-weight: 600;
  color: var(--lime);
}

.save-state.is-dirty {
  color: var(--sun);
}

.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ---- thema-editor ------------------------------------------------------ */
.theme-editor-head {
  display: grid;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 900px) {
  .theme-editor-head {
    grid-template-columns: 1fr 1.3fr;
  }
}

.preview-card {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
}

.preview-card .eyebrow {
  margin: 0;
}

.preview-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.preview-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.preview-tiles .answer-btn {
  min-height: 56px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  border-radius: 14px;
  animation: none;
  cursor: default;
}

.preview-card .btn {
  margin-top: 0.2rem;
}

.theme-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.t-group {
  padding: 0.2rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.t-group[open] {
  padding-bottom: 1rem;
}

.t-group summary {
  padding: 0.75rem 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}

.t-grid {
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 800px) {
  .t-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.t-field {
  position: relative;
}

.t-field.changed .field-label::after {
  content: " · aangepast";
  letter-spacing: 0;
  text-transform: none;
  color: var(--sun);
}

.t-reset {
  position: absolute;
  top: -0.3rem;
  right: 0;
  min-width: 1.8rem;
  height: 1.8rem;
  font-size: 0.85rem;
  visibility: hidden;
}

.t-field.changed .t-reset {
  visibility: visible;
}

.t-hint {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.t-hint code {
  padding: 0 0.3rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.06);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}

.color-field input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 8, 20, 0.55);
  cursor: pointer;
}

@keyframes ping-btn {
  0% { box-shadow: 0 0 0 0 rgba(198, 245, 74, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(198, 245, 74, 0); }
  100% { box-shadow: none; }
}

@media (max-width: 720px) {
  .f-dog, .f-octo, .f-uni { opacity: 0.55; }
  .bubble { right: 0; bottom: 108%; width: 180px; }
  .shell { padding-bottom: 7.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
