:root {
  --bg: #0f1b2d;
  --bg2: #16263d;
  --card: #1d3150;
  --line: #2b4469;
  --text: #f3f6fb;
  --muted: #9fb2cc;
  --accent: #ffb547;
  --ok: #3ccf8e;
  --bad: #ff5d6c;
  --o0: #ff6b6b;
  --o1: #4dabf7;
  --o2: #ffd43b;
  --o3: #51cf66;
  --o4: #cc5de8;
  --o5: #ff922b;
  --radius: 16px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(circle at 20% 0%, #1c3358 0%, var(--bg) 60%);
  background-color: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 700;
  background: var(--accent);
  color: #1a1200;
  transition: transform .08s ease, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }

input:not([type]), input[type=text], input[type=number], textarea, select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }

.opt-0 { --c: var(--o0); } .opt-1 { --c: var(--o1); } .opt-2 { --c: var(--o2); }
.opt-3 { --c: var(--o3); } .opt-4 { --c: var(--o4); } .opt-5 { --c: var(--o5); }

/* ================= Deelnemer (mobiel) ================= */

.play {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}
.play header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--muted); padding-bottom: 12px;
}
.play header b { color: var(--text); }
.play main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.play h1 { font-size: 28px; margin: 0; text-align: center; }
.play h2 { font-size: 22px; margin: 0; line-height: 1.25; }
.logo { font-size: 44px; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.pin-input { text-align: center; font-size: 30px; letter-spacing: 8px; font-weight: 800; }
.big { font-size: 20px; padding: 16px; }
.center { text-align: center; }
.error { color: var(--bad); text-align: center; min-height: 1.2em; }

.answers { display: grid; gap: 10px; }
.answers.two { grid-template-columns: 1fr 1fr; }
.answer {
  border: 0; border-radius: var(--radius);
  background: var(--c); color: #111;
  padding: 18px 14px; min-height: 74px;
  font-size: 18px; font-weight: 700; text-align: left;
  display: flex; gap: 10px; align-items: center;
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.answer .letter {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: rgba(0,0,0,.18); display: grid; place-items: center; font-weight: 800;
}
.answer.chosen { outline: 4px solid #fff; }
.answer.dim { opacity: .35; }
.answer:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button {
  aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); font-size: 24px; font-weight: 800;
}
.scale button.chosen { background: var(--accent); color: #1a1200; border-color: var(--accent); }
.scale-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

.timerbar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.timerbar > div { height: 100%; background: var(--accent); width: 100%; transition: width .25s linear; }

.feedback {
  border-radius: var(--radius); padding: 28px 20px; text-align: center;
  background: var(--card);
}
.feedback.good { background: color-mix(in srgb, var(--ok) 25%, var(--card)); }
.feedback.badf { background: color-mix(in srgb, var(--bad) 25%, var(--card)); }
.feedback .emoji { font-size: 54px; }
.feedback .pts { font-size: 28px; font-weight: 800; margin-top: 6px; }

.reactions {
  display: flex; justify-content: space-around; padding-top: 12px;
  border-top: 1px solid var(--line); margin-top: 12px;
}
.reactions button {
  background: none; border: 0; font-size: 30px; padding: 6px;
  transition: transform .1s;
}
.reactions button:active { transform: scale(1.35); }

.waiting-dots::after { content: '…'; animation: dots 1.4s infinite; }
@keyframes dots { 0%{content:'.'} 33%{content:'..'} 66%{content:'...'} }

.board { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.board li {
  display: flex; justify-content: space-between; background: var(--card);
  padding: 12px 16px; border-radius: 12px; font-weight: 600;
}
.board li .rank { color: var(--accent); margin-right: 10px; font-weight: 800; }

/* ================= Presentator ================= */

.host { min-height: 100vh; display: flex; flex-direction: column; }
.host-top {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  background: rgba(0,0,0,.2); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.host-top .title { font-weight: 800; font-size: 18px; margin-right: auto; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 99px;
  padding: 6px 12px; font-size: 14px; white-space: nowrap;
}
.chip b { color: var(--accent); }

.setup { max-width: 860px; margin: 0 auto; padding: 24px 16px 80px; width: 100%; }
.setup h1 { margin: 0 0 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-top: 12px; display: flex; flex-direction: column; gap: 10px;
}
.qcard .row select { width: auto; }
.qcard .num { font-weight: 800; color: var(--accent); }
.qcard .opts { display: flex; flex-direction: column; gap: 6px; }
.qcard .opt { display: flex; gap: 8px; align-items: center; }
.qcard .opt input[type=radio] { width: 20px; height: 20px; accent-color: var(--ok); }
.qcard .opt .sw { width: 14px; height: 36px; border-radius: 6px; background: var(--c); flex: none; }
.spacer { flex: 1; }

.stage { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
@media (max-width: 900px) { .stage { grid-template-columns: 1fr; } .side { display: none; } }
.screen { padding: 32px 40px; display: flex; flex-direction: column; gap: 24px; min-height: 0; position: relative; overflow: hidden; }
.side { border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; background: rgba(0,0,0,.15); }
.side .item {
  text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font-size: 14px;
}
.side .item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.side .item small { color: var(--muted); display: block; }

.lobby { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; justify-content: center; }
@media (max-width: 1100px) { .lobby { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.lobby img { width: min(38vh, 380px); border-radius: 20px; background: #fff; padding: 12px; }
.lobby .join-url { font-size: clamp(18px, 2.2vw, 30px); color: var(--muted); }
.lobby .join-url b { color: var(--text); }
.lobby .pin { font-size: clamp(56px, 9vw, 120px); font-weight: 900; letter-spacing: 6px; color: var(--accent); line-height: 1; }
.lobby .count { font-size: 24px; margin-top: 16px; }

.qtitle { font-size: clamp(28px, 3.6vw, 56px); font-weight: 800; margin: 0; line-height: 1.15; }
.qmeta { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 18px; }
.countdown {
  font-size: 40px; font-weight: 900; width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #1a1200; flex: none;
}

.bars { flex: 1; display: flex; align-items: flex-end; gap: 20px; min-height: 240px; padding-bottom: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: flex-end; }
.bar .fill {
  width: 100%; background: var(--c); border-radius: 12px 12px 4px 4px;
  transition: height .5s cubic-bezier(.2,.8,.2,1); min-height: 6px;
}
.bar .val { font-size: 28px; font-weight: 800; }
.bar .lab {
  font-size: clamp(14px, 1.4vw, 22px); text-align: center; font-weight: 600;
  display: flex; gap: 8px; align-items: center;
}
.bar .lab .letter {
  width: 30px; height: 30px; border-radius: 8px; background: var(--c); color: #111;
  display: grid; place-items: center; font-weight: 800; flex: none;
}
.bars.reveal .bar:not(.correct) { opacity: .3; }
.bars.reveal .bar.correct .lab { color: var(--ok); }

.avg { font-size: 64px; font-weight: 900; color: var(--accent); }

.cloud {
  flex: 1; display: flex; flex-wrap: wrap; gap: 10px 22px; align-content: center; justify-content: center;
  padding: 20px;
}
.cloud span { font-weight: 800; line-height: 1.1; transition: font-size .4s; }
.texts { display: flex; flex-wrap: wrap; gap: 10px; max-height: 30vh; overflow: hidden; }
.texts div { background: var(--card); padding: 8px 14px; border-radius: 12px; font-size: 16px; }

.controls {
  display: flex; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line);
  background: rgba(0,0,0,.2); align-items: center; flex-wrap: wrap;
}

.float-emoji {
  position: absolute; bottom: 0; font-size: 44px; pointer-events: none;
  animation: floatUp 3s ease-out forwards;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  10% { opacity: 1; transform: translateY(-40px) scale(1); }
  100% { transform: translateY(-75vh) scale(1.1); opacity: 0; }
}

.podium { list-style: none; margin: 0 auto; padding: 0; width: min(700px, 100%); display: flex; flex-direction: column; gap: 10px; }
.podium li {
  display: flex; justify-content: space-between; font-size: 26px; font-weight: 700;
  background: var(--card); padding: 14px 22px; border-radius: 14px;
}
.podium li:nth-child(1) { background: linear-gradient(90deg, #8a6a1a, var(--card)); font-size: 32px; }
.podium li:nth-child(2) { background: linear-gradient(90deg, #5d6878, var(--card)); }
.podium li:nth-child(3) { background: linear-gradient(90deg, #6e4a2c, var(--card)); }
.podium .rank { color: var(--accent); margin-right: 14px; }

/* Geen zoom bij (dubbel)tikken op telefoons */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
.reactions button, .play button { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.dia { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted, #8aa); margin-left: 8px; }

.ask { margin-top: 28px; }
.ask textarea { font-size: 16px; resize: vertical; }
.ask-label { font-size: 15px; color: var(--text); font-weight: 600; }
.answer.kaart { min-height: 56px; font-size: 16px; padding: 12px; }
.samenvatting { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 4px 0 12px; }
.samenvatting .sv-kop { font-size: 20px; font-weight: 800; color: var(--accent); margin-bottom: 8px; line-height: 1.2; }
.samenvatting ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.samenvatting li { font-size: 16px; line-height: 1.4; color: var(--text); }
.reactions.uit button { filter: grayscale(1); opacity: .35; }
.reactions.uit button:active { transform: none; }
