:root {
  --marine: #000f4c;
  --marine-2: #0a1a63;
  --blauw: #193dca;
  --blauw-licht: #4f6ee0;
  --rood: #df1550;
  --rood-diep: #b30f40;
  --geel: #f9cb08;
  --wit: #ffffff;
  --zacht: #c3cbe8;
  --gedempt: #8a96c8;
  --lijn: #23347d;
  --display: 'Lexend Deca', 'Segoe UI', system-ui, sans-serif;
  --tekst: 'Figtree', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(25, 61, 202, .55), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(223, 21, 80, .35), transparent 60%),
    var(--marine);
  background-attachment: fixed;
  color: var(--wit);
  font-family: var(--tekst);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Kop */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 14px max(18px, env(safe-area-inset-left));
  background: rgba(0, 15, 76, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--lijn);
}
.logo { height: 38px; }
.back {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--lijn);
  background: var(--marine-2); display: grid; place-items: center;
}
.back svg { width: 22px; height: 22px; fill: none; stroke: var(--wit); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.toggle { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--zacht); cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--geel); }

.view { max-width: 980px; margin: 0 auto; padding: 22px 18px 60px; }

/* Overzicht */
.kop { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 6vw, 46px); margin: 8px 0 4px; letter-spacing: -.5px; }
.sub { color: var(--zacht); margin: 0 0 18px; max-width: 620px; line-height: 1.45; }
.groep { font-family: var(--display); font-weight: 600; font-size: 20px; display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.vlag { font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 7px; background: var(--rood); letter-spacing: .5px; }
.vlag.en { background: var(--blauw); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }

.card {
  position: relative; text-align: left; overflow: hidden;
  padding: 18px 18px 16px; min-height: 128px;
  border-radius: 18px; border: 1px solid var(--lijn);
  background: linear-gradient(150deg, var(--marine-2), #071457);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--blauw-licht); }
.card:active { transform: scale(.98); }
.card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 203, 8, .22), transparent 70%);
}
.card .nr { font-family: var(--display); font-size: 12px; color: var(--geel); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.card .naam { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.card .meta { margin-top: auto; color: var(--gedempt); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.card .mini { width: 34px; height: 34px; border-radius: 50%; background: var(--rood); display: grid; place-items: center; margin-left: auto; flex: none; }
.card .mini svg { width: 16px; height: 16px; fill: var(--wit); margin-left: 2px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(249, 203, 8, .15); color: var(--geel); text-transform: uppercase; }

/* Speler */
.cat { text-align: center; }
.cat-label { font-family: var(--display); color: var(--geel); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.cat-titel { font-family: var(--display); font-weight: 800; font-size: clamp(38px, 9vw, 64px); margin: 2px 0 4px; letter-spacing: -1px; }
.cat-opdracht { color: var(--zacht); margin: 0 auto; max-width: 560px; }

.stage { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 26px 0 18px; }
.play {
  width: min(46vw, 210px); aspect-ratio: 1; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 30% 25%, #ff3f78, var(--rood) 55%, var(--rood-diep));
  box-shadow: 0 0 0 10px rgba(223, 21, 80, .16), 0 18px 50px rgba(223, 21, 80, .45);
  display: grid; place-items: center;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
  touch-action: manipulation;
}
.play:active { transform: scale(.95); }
.play svg { width: 46%; height: 46%; fill: var(--wit); }
.play .i-play { margin-left: 8%; }
.play .i-pause { display: none; }
.playing .play { background: radial-gradient(circle at 30% 25%, #5c7cff, var(--blauw) 55%, #0f2a99); box-shadow: 0 0 0 10px rgba(25, 61, 202, .2), 0 18px 50px rgba(25, 61, 202, .5); animation: puls 1.6s ease-in-out infinite; }
.playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
@keyframes puls { 50% { box-shadow: 0 0 0 18px rgba(25, 61, 202, .12), 0 18px 50px rgba(25, 61, 202, .5); } }
.now { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--zacht); text-align: center; min-height: 24px; }
.now b { color: var(--wit); }

/* RESET-waarschuwing */
.reset {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  display: grid; place-items: center;
  background: rgba(179, 15, 64, .35);
  animation: flits .5s steps(2, jump-none) infinite;
}
.reset-in {
  background: var(--geel); color: var(--marine);
  border: 6px solid var(--marine); border-radius: 26px;
  padding: 22px 46px; text-align: center; transform: rotate(-3deg);
  box-shadow: 0 25px 80px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center;
}
.reset-let { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 5vw, 34px); letter-spacing: 4px; }
.reset-woord { font-family: var(--display); font-weight: 800; font-size: clamp(64px, 18vw, 140px); line-height: .95; letter-spacing: -2px; color: var(--rood); }
.reset-sec { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 6vw, 40px); margin-top: 4px; }
@keyframes flits { 0% { background: rgba(179, 15, 64, .55); } 100% { background: rgba(0, 15, 76, .35); } }

/* Voortgang */
.bar { display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; color: var(--zacht); font-size: 14px; margin-bottom: 18px; }
.track { position: relative; flex: 1; height: 10px; border-radius: 6px; background: var(--lijn); cursor: pointer; }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--rood), var(--geel)); }
.tick { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--marine); opacity: .9; }

/* Lijst */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--lijn);
  background: rgba(10, 26, 99, .55); cursor: pointer;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}
.row .idx { font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--gedempt); text-align: center; }
.row .t { font-weight: 700; font-size: 17px; }
.row .a { color: var(--gedempt); font-size: 14px; }
.row .tijd { color: var(--gedempt); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.row .goed { display: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: #13a35a; color: var(--wit); margin-left: 6px; vertical-align: 2px; }
.row .fout { display: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--lijn); color: var(--zacht); margin-left: 6px; vertical-align: 2px; }
.antwoorden .row .goed, .antwoorden .row .fout { display: inline-block; }
.row.done { opacity: .5; }
.row.actief { background: linear-gradient(90deg, rgba(223, 21, 80, .9), rgba(179, 15, 64, .75)); border-color: var(--rood); opacity: 1; }
.row.actief .idx, .row.actief .a, .row.actief .tijd { color: var(--wit); }
.row .eq { display: none; }
.playing .row.actief .idx { font-size: 0; }
.playing .row.actief .eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; }
.eq i { width: 4px; background: var(--geel); border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }
.row.bijna { animation: knipper .5s steps(2, jump-none) infinite; }
@keyframes knipper { 0% { background: var(--geel); } }
.row.bijna .t, .row.bijna .a, .row.bijna .idx, .row.bijna .tijd { color: inherit; }

.hint { text-align: center; color: var(--gedempt); font-size: 13px; margin-top: 18px; }

/* Geluidsuitvoer (deze telefoon / Sonos) */
.outwrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.outwrap select {
  appearance: none; -webkit-appearance: none;
  font: 600 15px var(--tekst); color: var(--wit);
  background: var(--marine-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23c3cbe8' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  border: 1px solid var(--lijn); border-radius: 999px;
  padding: 10px 40px 10px 16px; max-width: 92vw; cursor: pointer;
}
.op-sonos .outwrap select { border-color: var(--geel); box-shadow: 0 0 0 3px rgba(249, 203, 8, .15); }
.outlabel { font-size: 13px; color: var(--geel); min-height: 0; }
.outlabel:empty { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30;
  background: var(--rood); color: var(--wit); font-weight: 600;
  padding: 12px 18px; border-radius: 12px; max-width: 92vw; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* Speler vult precies het scherm; alleen de nummerlijst scrolt, en die scrolt zelf mee
   zodat het actieve nummer bovenaan staat met de komende nummers eronder. */
body.in-player { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.in-player #player { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-bottom: 0; }
.listwrap {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -6px; padding: 0 6px 24px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
}
.listwrap .list { padding-top: 6px; }
.row.done { opacity: .4; }

/* Telefoon: alles compacter, zodat er meer komende nummers in beeld passen */
@media (max-width: 700px), (max-height: 760px) {
  .top { padding-top: 10px; padding-bottom: 10px; }
  .logo { height: 32px; }
  .back { width: 38px; height: 38px; }
  #player.view { padding-top: 12px; }
  .cat-label { font-size: 11px; }
  .cat-titel { font-size: clamp(30px, 9vw, 44px); margin: 0 0 2px; }
  .cat-opdracht { font-size: 14px; }
  .stage { margin: 14px 0 12px; gap: 10px; }
  .play { width: min(38vw, 150px); box-shadow: 0 0 0 7px rgba(223, 21, 80, .16), 0 12px 34px rgba(223, 21, 80, .45); }
  .now { font-size: 16px; min-height: 20px; }
  .outwrap select { padding: 7px 36px 7px 14px; font-size: 14px; }
  .bar { margin-bottom: 8px; }
  .row { padding: 9px 12px; grid-template-columns: 32px 1fr auto; gap: 10px; }
  .row .t { font-size: 16px; }
  .row .a { font-size: 13px; }
  .hint { display: none; }
}
