:root {
  --red: #d7141a;
  --red-dark: #9c0d12;
  --orange: #e3930b;
  --green: #12901b;
  --black: #0c0c0c;
  --ink: #161616;
  --card: #1d1d1d;
  --line: #2e2e2e;
  --white: #ffffff;
  --muted: #b9b9b9;
  --brush: 'Permanent Marker', 'Marker Felt', cursive;
  --body: 'Rubik', system-ui, -apple-system, sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--body);
  color: var(--white);
  background:
    radial-gradient(circle at 50% -10%, rgba(215, 20, 26, .45), transparent 55%),
    radial-gradient(circle at 110% 110%, rgba(215, 20, 26, .25), transparent 45%),
    var(--black);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; }
input { font: inherit; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 120px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(12, 12, 12, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--red);
}
.topbar img { height: 40px; width: auto; }
.topbar .who { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.pill {
  background: var(--red); color: var(--white);
  font-weight: 800; border-radius: 999px; padding: 6px 12px; font-size: 15px;
  box-shadow: 0 3px 0 var(--red-dark);
  white-space: nowrap;
}

/* ---------- huisstijl elementen ---------- */
.ribbon {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: var(--brush);
  font-size: clamp(30px, 9vw, 46px);
  line-height: 1.05;
  padding: 8px 18px 6px;
  border-radius: 12px;
  transform: rotate(-2.5deg);
  box-shadow: 0 6px 0 var(--red-dark), 0 12px 24px rgba(0, 0, 0, .5);
  letter-spacing: .5px;
}
.brush { font-family: var(--brush); letter-spacing: .5px; }

.lights { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.lights i { width: 34px; height: 14px; border-radius: 4px; display: block; }
.lights i:nth-child(1) { background: var(--red); }
.lights i:nth-child(2) { background: var(--orange); }
.lights i:nth-child(3) { background: var(--green); }

.center { text-align: center; }
.muted { color: var(--muted); }

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.logo-big { display: block; width: min(78vw, 320px); height: auto; margin: 18px auto 6px; filter: drop-shadow(0 10px 30px rgba(215, 20, 26, .35)); }

/* ---------- knoppen & formulier ---------- */
.btn {
  display: block; width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--red);
  color: var(--white);
  font-weight: 800; font-size: 19px;
  box-shadow: 0 5px 0 var(--red-dark);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-dark); }
.btn:disabled { opacity: .45; }
.btn.ghost { background: #2a2a2a; box-shadow: 0 5px 0 #111; }
.btn.green { background: var(--green); box-shadow: 0 5px 0 #0a5c10; }
.btn.small { padding: 10px 14px; font-size: 15px; width: auto; display: inline-block; }

.field {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 3px solid var(--white);
  background: var(--white);
  color: var(--black);
  font-size: 20px; font-weight: 700;
  outline: none;
}
.field:focus { border-color: var(--red); }

.error { color: #ff7b7f; font-weight: 700; min-height: 1.3em; margin: 10px 0; }

/* ---------- slides ---------- */
.slide { padding-top: 24px; }
.slide ul { list-style: none; padding: 0; margin: 26px 0 0; }
.slide li {
  font-size: 20px; font-weight: 700;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--card); border-left: 6px solid var(--red); border-radius: 10px;
}
.slide li:nth-child(3n+2) { border-color: var(--orange); }
.slide li:nth-child(3n+3) { border-color: var(--green); }
.slide .footer { margin-top: 18px; font-weight: 800; font-size: 18px; }

.round-num {
  font-family: var(--brush);
  font-size: clamp(64px, 24vw, 120px);
  line-height: 1;
  margin: 30px 0 4px;
  text-shadow: 0 6px 0 var(--red);
}
.round-sub { font-size: 22px; font-weight: 700; margin: 18px 0 30px; }
.waiting { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); font-weight: 500; }
.dots span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin: 0 2px; animation: bounce 1s infinite; }
.dots span:nth-child(2) { background: var(--orange); animation-delay: .15s; }
.dots span:nth-child(3) { background: var(--green); animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } }

/* ---------- vraag ---------- */
.qmeta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 12px; }
.qmeta .tag { background: #2a2a2a; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }

.timer { position: relative; width: 74px; height: 74px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 8; }
.timer .bg { stroke: #2b2b2b; }
.timer .fg { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .1s linear, stroke .3s; }
.timer.warn .fg { stroke: var(--orange); }
.timer.danger .fg { stroke: var(--red); }
.timer b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--brush); font-size: 30px;
}
.timer.danger b { animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.15); color: #ff6b6f; } }

.qtext {
  font-size: clamp(21px, 5.6vw, 27px);
  font-weight: 800;
  line-height: 1.25;
  margin: 4px 0 18px;
}

.options { display: grid; gap: 12px; }
.opt {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  text-align: left;
  font-size: 18px; font-weight: 700; line-height: 1.25;
  border-radius: 14px;
  color: var(--white);
  overflow: hidden;
  transition: transform .08s, opacity .2s, box-shadow .08s;
}
.opt .letter {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(0, 0, 0, .25);
  font-family: var(--brush); font-size: 20px;
}
.opt .label { flex: 1; position: relative; z-index: 1; }
.opt .letter, .opt .meta { position: relative; z-index: 1; }
.opt.c0 { background: var(--red); box-shadow: 0 5px 0 var(--red-dark); }
.opt.c1 { background: var(--orange); box-shadow: 0 5px 0 #9c6406; }
.opt.c2 { background: var(--green); box-shadow: 0 5px 0 #0a5c10; }
.opt.c3 { background: var(--white); color: var(--black); box-shadow: 0 5px 0 #9a9a9a; }
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.opt:disabled { cursor: default; }

.options.locked .opt:not(.picked) { opacity: .3; }
.opt.picked { outline: 4px solid var(--white); outline-offset: 3px; }
.opt.c3.picked { outline-color: var(--red); }

.statusline { margin-top: 18px; text-align: center; font-weight: 700; font-size: 17px; }
.view.timeup .opt { opacity: .3; }
.view.timeup .opt.picked { opacity: 1; }

/* onthulling */
.options.reveal .opt { background: #262626; color: var(--white); box-shadow: none; opacity: 1; outline: none; border: 3px solid transparent; }
.options.reveal .opt .bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(255, 255, 255, .08);
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.options.reveal .opt.right { background: var(--green); border-color: #7cf08a; animation: pop .45s; }
.options.reveal .opt.right .bar { background: rgba(255, 255, 255, .18); }
.options.reveal .opt.wrong-mine { border-color: var(--red); }
.opt .meta { flex: none; text-align: right; font-size: 14px; font-weight: 800; }
.opt .meta em { display: block; font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .9; }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

.verdict {
  text-align: center; margin: 2px 0 16px;
  font-family: var(--brush); font-size: clamp(34px, 11vw, 52px);
  transform: rotate(-2deg);
}
.verdict.good { color: #6ff07c; }
.verdict.bad { color: #ff6b6f; }
.verdict.none { color: var(--orange); }
.verdict small { display: block; font-family: var(--body); font-size: 16px; font-weight: 700; color: var(--white); transform: none; }

/* ---------- ranglijst ---------- */
.board { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.board li {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 14px; padding: 12px 14px;
  font-weight: 700; font-size: 18px;
  animation: slideIn .4s both;
}
.board li .pos { width: 40px; text-align: center; font-weight: 800; font-size: 22px; flex: none; }
.board li .nm { flex: 1; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .sc { font-weight: 800; font-size: 22px; }
.board li.r1 { background: linear-gradient(90deg, #7a5a00, #2a2000); border-color: #f2c230; font-size: 21px; }
.board li.r2 { border-color: #c9c9c9; }
.board li.r3 { border-color: #c9772f; }
.board li.me { outline: 3px solid var(--red); outline-offset: 2px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

.mycard { margin-top: 18px; text-align: center; font-weight: 700; font-size: 18px; }
.mycard b { font-weight: 800; font-size: 28px; color: var(--white); }

.winner { font-family: var(--brush); font-size: 30px; text-align: center; margin-top: 18px; color: #f2c230; animation: pulse .6s infinite alternate; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- host ---------- */
.hostbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(12, 12, 12, .95);
  border-top: 3px solid var(--red);
}
.hostbar .row { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.hostbar .btn.prev { width: 64px; flex: none; }
.hostbar .hint { max-width: 560px; margin: 0 auto 8px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hostinfo { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.hostinfo .pill { background: #2a2a2a; box-shadow: none; }
.hostinfo .pill.live { background: var(--green); }
select.field { font-size: 15px; padding: 12px; }
.roster { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.roster li { background: #2a2a2a; border-radius: 999px; padding: 6px 6px 6px 12px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.roster button { background: #444; border-radius: 50%; width: 24px; height: 24px; font-size: 13px; line-height: 24px; padding: 0; }
.opt.answer-key { outline: 4px dashed #7cf08a; outline-offset: 3px; }
details.admin { margin-top: 26px; }
details.admin summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 8px 0; }
details.admin .btn { margin-top: 10px; }
h3 { margin: 26px 0 6px; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

.offline { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 30; background: var(--orange); color: var(--black); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; display: none; }
.offline.show { display: block; }

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