/* Ruitjesschrift, balpenblauw en fluostiften. */
:root {
  --paper: #fbfcfe;
  --rule: #dde6f6;
  --ink: #1c2a63;
  --ink-soft: #56628f;
  --pen: #2f55d4;
  --sheet: #ffffff;
  --fluo-yellow: #ffec5c;
  --fluo-green: #93e9ab;
  --fluo-mint: #d3f7dd;
  --fluo-orange: #ffc670;
  --fluo-pink: #ff9fb2;
  --blank: #e9edf7;
  --display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--body);
  background-color: var(--paper);
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 26px 26px;
  min-height: 100vh;
}
.page { max-width: 660px; margin: 0 auto; padding: 20px 16px 72px; padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(72px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.loading { color: var(--ink-soft); }

h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 2.2rem; font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }
small, .small { font-size: 0.875rem; color: var(--ink-soft); }
a { color: var(--pen); }

/* een streep fluostift achter tekst */
.mark { background: linear-gradient(transparent 52%, var(--fluo-yellow) 52%, var(--fluo-yellow) 92%, transparent 92%); padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.sheet { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 14px; padding: 18px; box-shadow: 4px 4px 0 var(--ink); }
.stack > * + * { margin-top: 18px; }
.stack-s > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* knoppen */
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
input { touch-action: manipulation; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--sheet); font-weight: 700; }
@media (hover: hover) { .btn:hover { background: #f1f4fc; } .btn.primary:hover { background: #2648b8; } }
.btn.primary { background: var(--pen); border-color: var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.btn.primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.small { min-height: 44px; padding: 6px 16px; font-size: 0.95rem; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; min-height: 44px; padding: 4px 0; color: var(--pen); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }

/* kop van de startpagina */
.top .when { font-weight: 700; margin-top: 8px; }
.rank { margin-top: 14px; }
.rank .bar { height: 10px; border: 1.5px solid var(--ink); border-radius: 99px; background: var(--sheet); overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--fluo-green); }

/* beloningen: vier bonnetjes */
.prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prize { position: relative; border: 1.5px dashed var(--ink-soft); border-radius: 10px; padding: 10px 8px 8px; background: var(--sheet); min-height: 104px; }
.prize b { display: block; font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.prize strong { display: block; font-size: 0.8rem; margin-top: 3px; }
.prize span { display: block; font-size: 0.78rem; line-height: 1.25; margin-top: 6px; }
.prize em { display: block; font-style: normal; font-size: 0.74rem; color: var(--ink-soft); margin-top: 4px; }
.prize.got { border-style: solid; border-color: var(--ink); background: var(--fluo-yellow); }
.prize.got::after { content: 'behaald'; position: absolute; right: 6px; top: 8px; font-size: 0.66rem; font-weight: 700; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0 4px; transform: rotate(-8deg); background: var(--sheet); }
@media (max-width: 480px) { .prizes { grid-template-columns: repeat(2, 1fr); } }

/* onderwerpen */
.module h3 { margin-bottom: 4px; }
.skill { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.skill .name { flex: 1; min-width: 0; line-height: 1.3; }
.skill .meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--blank); }
.dots i.ok { background: #2fae5c; }
.dots i.no { background: #e2476a; }
.chip { display: inline-block; white-space: nowrap; font-size: 0.8rem; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--blank); }
.chip.rood { background: var(--fluo-pink); }
.chip.oranje { background: var(--fluo-orange); }
.chip.goed { background: var(--fluo-mint); }
.chip.groen { background: var(--fluo-green); }
.focuslist { margin: 0; padding: 0; list-style: none; }
.focuslist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.focuslist li:first-child { border-top: 0; }

/* vraag */
.qbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.qbar .progress { flex: 1; height: 12px; border: 1.5px solid var(--ink); border-radius: 99px; background: var(--sheet); overflow: hidden; }
.qbar .progress i { display: block; height: 100%; background: var(--fluo-yellow); transition: width 0.25s; }
.qbar .count { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 8px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--sheet); }
.timer.low { background: var(--fluo-pink); }
.where { font-size: 0.875rem; color: var(--ink-soft); margin-bottom: 8px; }
.prompt { font-size: 1.2rem; line-height: 1.45; }
.prompt .big, .feedback .big { font-size: 1.3em; font-weight: 700; white-space: nowrap; }
.prompt small { display: inline-block; margin-top: 6px; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: 0.92em; line-height: 1.15; margin: 0 0.15em; }
.fr span:first-child { border-bottom: 2px solid currentColor; padding: 0 0.3em 1px; }
.fr span:last-child { padding: 1px 0.3em 0; }
.tbl { border-collapse: collapse; margin-top: 12px; font-size: 1rem; }
.tbl th, .tbl td { border: 1.5px solid var(--ink); padding: 5px 14px; text-align: center; }
.tbl th { background: var(--blank); font-weight: 700; }

.fig { display: block; width: 100%; max-width: 340px; height: auto; margin: 14px auto 2px; }
.fig .ln, .fig .axis { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; fill: none; }
.fig .axis { stroke-width: 1.6; }
.fig .axisTip { fill: var(--ink); }
.fig .grid { stroke: #cfd9ee; stroke-width: 1; }
.fig .guide { stroke: #cfd9ee; stroke-width: 1; stroke-dasharray: 3 3; }
.fig .arc { stroke: var(--pen); stroke-width: 2; fill: none; }
.fig .pt { fill: var(--pen); }
.fig .pt.soft { fill: var(--pen); opacity: 0.85; }
.fig .bar { fill: var(--fluo-green); stroke: var(--ink); stroke-width: 1.5; }
.fig .trace { stroke: var(--pen); stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.fig .lbl { font: 700 15px var(--body); fill: var(--ink); }
.fig .lbl.it { font-style: italic; font-weight: 400; }
.fig .tick { font: 400 11.5px var(--body); fill: var(--ink); }
.fig .wedge { stroke: var(--ink); stroke-width: 1.5; }
.fig .w0 { fill: var(--fluo-yellow); } .fig .w1 { fill: var(--fluo-green); } .fig .w2 { fill: var(--fluo-pink); } .fig .w3 { fill: #b9c9f5; } .fig .w4 { fill: var(--fluo-orange); }

.answer { margin-top: 18px; }
.numrow { display: flex; align-items: center; gap: 10px; }
.numrow input, .fracin input { font: 700 1.4rem var(--body); color: var(--ink); width: 9ch; min-height: 52px; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper); text-align: center; }
.numrow .unit { font-weight: 700; font-size: 1.15rem; }
.sign { min-width: 52px; min-height: 52px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--sheet); font-weight: 700; font-size: 1.25rem; }
.fracin { display: inline-flex; flex-direction: column; gap: 6px; align-items: stretch; }
.fracin hr { width: 100%; border: 0; border-top: 3px solid var(--ink); margin: 0; }
.fracin input { width: 7ch; }
.choices { display: grid; gap: 10px; }
.choices.short { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.choice { text-align: left; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--sheet); font-size: 1.08rem; line-height: 1.35; }
.choices.short .choice { text-align: center; font-weight: 700; }
.choice[aria-pressed='true'] { background: var(--fluo-yellow); box-shadow: inset 0 0 0 1.5px var(--ink); }
.choice.right { background: var(--fluo-green); }
.choice.wrong { background: var(--fluo-pink); }
.choice:disabled { cursor: default; color: var(--ink); opacity: 1; }
.hint { margin-top: 10px; font-weight: 700; color: #b3264a; min-height: 1.5em; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.feedback { margin-top: 18px; padding: 14px 16px; border-radius: 10px; border: 1.5px solid var(--ink); }
.feedback.ok { background: var(--fluo-mint); }
.feedback.no { background: #ffe3e9; }
.feedback h3 { margin-bottom: 6px; }
.feedback p + p { margin-top: 8px; }
.tip { padding: 10px 12px; border-left: 5px solid var(--fluo-yellow); background: #fffbe0; border-radius: 0 8px 8px 0; }
.feedback .tip { background: var(--sheet); border: 1.5px dashed var(--ink); border-left: 6px solid var(--fluo-yellow); border-radius: 8px; }
details.more summary { cursor: pointer; color: var(--pen); text-decoration: underline; min-height: 44px; display: flex; align-items: center; }
details.more p { margin-top: 8px; }

/* resultaten */
.score { font-family: var(--display); font-weight: 800; font-size: 3rem; font-size: clamp(2.6rem, 12vw, 4rem); line-height: 1; }
.banner { padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--fluo-yellow); font-weight: 700; }
details.review { border-top: 1px solid var(--rule); padding: 10px 0; }
details.review summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
details.review summary b { min-width: 2.2em; }
details.review .body { margin-top: 10px; padding-left: 12px; border-left: 3px solid var(--rule); }
.verdict { font-weight: 700; }
.verdict.ok { color: #1c7c40; }
.verdict.no { color: #b3264a; }
table.plain { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.plain th, table.plain td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--rule); vertical-align: top; }
table.plain th { font-weight: 700; border-top: 0; }
.foot { margin-top: 28px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.warn { padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--fluo-orange); }
.sharebox { width: 100%; font: 0.85rem var(--body); padding: 8px; border: 1.5px solid var(--ink); border-radius: 8px; }

/* tablet en groter: iets ruimer en groter, want het scherm staat verder weg */
@media (min-width: 700px) {
  body { font-size: 1.1875rem; }
  .page { max-width: 740px; padding-top: 32px; }
  .sheet { padding: 24px; }
  .prompt { font-size: 1.3rem; }
  .choice { min-height: 56px; }
  .fig { max-width: 400px; }
}

/* confetti bij een behaalde milestone */
.confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; animation: fall 2.4s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(560deg); opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .qbar .progress i { transition: none; }
}
