:root {
  --bg: #140f2e;
  --bg2: #1e1745;
  --card: #261d55;
  --card2: #2f2566;
  --line: #3d3279;
  --text: #f6f3ff;
  --muted: #a99fd6;
  --accent: #ffc53d;
  --accent-ink: #2a1d00;
  --good: #3dd68c;
  --bad: #ff6369;
  --o0: #e5484d; --o1: #3e63dd; --o2: #e79c13; --o3: #2f9e64; --o4: #8e4ec6; --o5: #0d9b8a;
  --radius: 16px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer;
  background: var(--card2); color: var(--text); transition: transform .06s, filter .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
button:hover:not(:disabled), .btn:hover { filter: brightness(1.15); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .4; cursor: not-allowed; }
.primary { background: var(--accent); color: var(--accent-ink); }
.good { background: var(--good); color: #052e18; }
.bad { background: var(--bad); color: #3a0006; }
.ghost { background: transparent; border: 1px solid var(--line); }
.big { font-size: 1.15rem; padding: 16px 22px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 10px 0; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--card2); font-size: .8rem; font-weight: 700; color: var(--muted); }
.pill.accent { background: var(--accent); color: var(--accent-ink); }
.err { background: #4a1020; border: 1px solid var(--bad); color: #ffd6d9; padding: 10px 14px; border-radius: 12px; margin: 8px 0; }
.warn { background: #3d2f05; border: 1px solid var(--accent); color: #ffeab0; padding: 10px 14px; border-radius: 12px; margin: 8px 0; }
.ok-box { background: #0d3b26; border: 1px solid var(--good); color: #c9f7df; padding: 10px 14px; border-radius: 12px; margin: 8px 0; }

/* Meerkeuze-kleuren (zelfde op beamer en telefoon) */
.opt { --c: var(--o0); }
.opt.tf0 { --c: var(--o3); } .opt.tf1 { --c: var(--o0); }
.opt.o1 { --c: var(--o1); } .opt.o2 { --c: var(--o2); } .opt.o3 { --c: var(--o3); } .opt.o4 { --c: var(--o4); } .opt.o5 { --c: var(--o5); }
.opt .letter { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 10px; background: rgba(0,0,0,.25); font-weight: 900; flex: none; }

/* Timer-balk */
.timerbar { height: 10px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.timerbar > div { height: 100%; background: var(--accent); width: 100%; transition: width .25s linear; }
.timerbar.low > div { background: var(--bad); }

/* ---------- Telefoon ---------- */
.phone { max-width: 560px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; min-height: 100dvh; }
.phone header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 12px; }
.phone .brand { font-weight: 900; font-size: 1.1rem; }
.phone main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.phone .qtext { font-size: 1.35rem; font-weight: 800; line-height: 1.25; }
.phone .qimg { width: 100%; max-height: 32vh; object-fit: contain; border-radius: 12px; background: #0002; }
.phone .opts { display: grid; gap: 10px; }
.phone .opt { background: var(--c); color: #fff; text-align: left; justify-content: flex-start; font-size: 1.1rem; padding: 16px; min-height: 64px; }
.phone .opt.chosen { outline: 4px solid #fff; }
.phone .opts.tf { grid-template-columns: 1fr 1fr; }
.phone .opts.tf .opt { min-height: 140px; flex-direction: column; justify-content: center; font-size: 1.3rem; }
.phone .small-q { font-size: 1.05rem; font-weight: 600; }
.phone .opt.dim { opacity: .35; }
.phone .status { text-align: center; padding: 30px 10px; }
.phone .status .icon { font-size: 3.4rem; line-height: 1; margin-bottom: 10px; }
.phone .status h2 { font-size: 1.6rem; }
.result-good { color: var(--good); }
.result-bad { color: var(--bad); }
.result-ok { color: var(--good, #2ecc71); }
.phone .bigscore { font-size: 3rem; font-weight: 900; color: var(--accent); }
.phone .numinput { font-size: 1.6rem; text-align: center; font-weight: 800; }
.toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.toplist li { display: flex; gap: 10px; background: var(--card); padding: 10px 12px; border-radius: 10px; }
.toplist li.me { outline: 2px solid var(--accent); }
.toplist .r { width: 2em; color: var(--muted); font-weight: 800; }
.toplist .n { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist .s { font-weight: 800; }

/* ---------- Beamer ---------- */
.screen { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(1200px 700px at 80% -10%, #3a2a8a 0%, transparent 60%), var(--bg); }
.screen .topbar { display: flex; align-items: center; gap: 2vw; padding: 1.4vh 2.5vw; font-size: 1.6vw; background: #0004; }
.screen .topbar .join b { color: var(--accent); letter-spacing: .08em; }
.screen .stage { flex: 1; display: flex; flex-direction: column; padding: 3vh 4vw; gap: 2.5vh; min-height: 0; }
.screen .qtitle { font-size: 3.4vw; font-weight: 900; line-height: 1.15; }
.screen .qmeta { font-size: 1.4vw; color: var(--muted); display: flex; gap: 2vw; }
.screen .qbody { flex: 1; display: flex; gap: 3vw; min-height: 0; align-items: stretch; }
.screen .qimg { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.screen .qimg img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 1vw; }
.screen .opts { flex: 1.2; display: grid; grid-template-columns: 1fr 1fr; gap: 1.6vw; align-content: center; }
.screen .opt { background: var(--c); border-radius: 1.2vw; padding: 2.2vh 1.6vw; font-size: 2.2vw; font-weight: 800; display: flex; gap: 1vw; align-items: center; position: relative; overflow: hidden; }
.screen .opt.wrong { opacity: .25; }
.screen .opts.tf { grid-template-columns: 1fr 1fr; }
.screen .opts.tf .opt { justify-content: center; font-size: 3.2vw; padding: 5vh 2vw; }
.screen .qsub { font-size: 2vw; font-weight: 600; color: var(--muted); margin-top: 1vh; }
.screen .musicnote { font-size: 9vw; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-1.2vh) rotate(-6deg); } }
.screen .opt.right { outline: .5vw solid #fff; box-shadow: 0 0 4vw rgba(255,255,255,.35); }
.screen .opt .count { margin-left: auto; font-size: 2vw; background: rgba(0,0,0,.3); padding: .3vw 1vw; border-radius: 99px; }
.screen .bottom { display: flex; align-items: center; gap: 2vw; font-size: 1.8vw; }
.screen .bottom .timerbar { flex: 1; height: 1.6vh; }
.screen .timeleft { font-size: 3vw; font-weight: 900; min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
.screen .answerbox { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2vh; }
.screen .answerbox .label { font-size: 1.8vw; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.screen .answerbox .value { font-size: 5vw; font-weight: 900; color: var(--accent); }
.screen .answerbox .sub { font-size: 1.8vw; }
.screen .waiting { font-size: 2.4vw; color: var(--muted); text-align: center; }
.screen .lobby { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 4vw; align-items: center; }
.screen .lobby .qr { background: #fff; padding: 1.4vw; border-radius: 1.6vw; }
.screen .lobby .qr img { width: 32vw; height: 32vw; max-height: 62vh; max-width: 62vh; display: block; }
.screen .lobby h1 { font-size: 4.4vw; }
.screen .lobby .howto { font-size: 2vw; line-height: 1.5; }
.screen .lobby .howto b { color: var(--accent); }
.screen .lobby .code { font-size: 6vw; font-weight: 900; letter-spacing: .12em; color: var(--accent); }
.screen .names { display: flex; flex-wrap: wrap; gap: .8vw; margin-top: 2vh; max-height: 26vh; overflow: hidden; }
.screen .names span { background: var(--card2); padding: .6vh 1.2vw; border-radius: 99px; font-size: 1.5vw; font-weight: 700; animation: pop .3s ease-out; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.screen .slide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; min-height: 0; }
.screen .slide img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; flex: 1; border-radius: 1vw; }
.screen .slide h1 { font-size: 5vw; text-align: center; }
.screen .slide.round h1 { font-size: 7vw; color: var(--accent); }
.screen .slide.full { padding: 0; }
.screen .board { flex: 1; display: flex; flex-direction: column; gap: 1.2vh; min-height: 0; }
.screen .board h1 { font-size: 3.4vw; text-align: center; }
.screen .board .rows { display: grid; gap: 1vh; grid-auto-rows: minmax(0, 1fr); flex: 1; min-height: 0; }
.screen .board .r { display: flex; align-items: center; gap: 2vw; background: var(--card); border-radius: 1vw; padding: 0 2vw; font-size: 2.2vw; font-weight: 700; animation: slidein .4s ease-out backwards; }
.screen .board .r .pos { width: 3ch; color: var(--muted); font-weight: 900; }
.screen .board .r .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen .board .r .rd { color: var(--muted); font-size: 1.6vw; }
.screen .board .r .tt { color: var(--accent); font-weight: 900; min-width: 5ch; text-align: right; }
.screen .board .r.p1 { background: linear-gradient(90deg, #6b4f00, var(--card)); }
.screen .board .r.p2 { background: linear-gradient(90deg, #4a4a5e, var(--card)); }
.screen .board .r.p3 { background: linear-gradient(90deg, #5c3417, var(--card)); }
@keyframes slidein { from { transform: translateX(-4vw); opacity: 0; } to { transform: none; opacity: 1; } }
.screen .fsbtn { position: fixed; right: 12px; bottom: 12px; opacity: .25; font-size: .8rem; padding: 6px 10px; }
.screen .fsbtn:hover { opacity: 1; }
.screen .explanation { font-size: 1.8vw; color: var(--text); max-width: 70vw; }

/* ---------- Host ---------- */
.host { padding: 16px; max-width: 1500px; margin: 0 auto; }
.host .bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0 16px; }
.host .code { font-size: 1.6rem; font-weight: 900; color: var(--accent); letter-spacing: .1em; }
.host .grid { display: grid; grid-template-columns: 280px minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .host .grid { grid-template-columns: 1fr; } }
.host .items { max-height: calc(100vh - 140px); overflow: auto; padding: 8px; }
.host .items .it { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: .9rem; }
.host .items .it:hover { background: var(--card2); }
.host .items .it.cur { background: var(--accent); color: var(--accent-ink); }
.host .items .it .num { width: 2.2em; font-weight: 800; opacity: .7; flex: none; }
.host .items .it .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host .items .it.round { font-weight: 800; margin-top: 6px; }
.host .items .st { font-size: .75rem; flex: none; }
.host .controls { display: grid; gap: 10px; }
.host .controls .row button { flex: 1; min-width: 140px; }
.host .current h2 { font-size: 1.5rem; }
.host .current .answer { font-size: 1.2rem; margin-top: 8px; }
.host .current .answer b { color: var(--good); }
.host .optlist { display: grid; gap: 6px; margin-top: 10px; }
.host .optlist .opt { background: var(--c); padding: 8px 12px; border-radius: 10px; display: flex; gap: 10px; align-items: center; }
.host .optlist .opt.right { outline: 3px solid #fff; }
.host .review table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.host .review td, .host .review th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.host .review .verdict button { padding: 4px 8px; font-size: .8rem; border-radius: 8px; }
.host .review tr.overridden td { background: #3d2f0544; }
.host .review .ans { word-break: break-word; }
.host .side { display: grid; gap: 16px; }
.host .plist { max-height: 320px; overflow: auto; font-size: .9rem; }
.host .plist .p { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.host .plist .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.host .plist .dot.off { background: var(--muted); opacity: .5; }
.host .plist button { padding: 2px 8px; font-size: .75rem; }
.host .bigtime { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }

.setup { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; } /* loginpagina */
.hero { text-align: center; padding: 30px 0 10px; }
.hero h1 { font-size: 2.4rem; }
.hero h1 span { color: var(--accent); }

#who:empty { display: none; }

/* Proefafspelen: knop is een stopknop zolang het fragment speelt */
button.playing { background: var(--bad); color: #fff; border-color: var(--bad); }
