/* Het labo: wit papier op een lichte labotafel. Titels staan op een strook labotape in stiftschrift,
   de beloningen zijn proefbuizen die vollopen, en bovenaan ligt het meetlatje. De rest blijft rustig. */
@font-face { font-family: 'Caveat Brush'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/caveat-brush-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: italic; font-weight: 700; font-display: swap; src: url('fonts/atkinson-hyperlegible-latin-700-italic.woff2') format('woff2'); }

:root {
  --tafel: #e6eef0; /* het werkblad van de labotafel */
  --papier: #ffffff;
  --inkt: #14323c; /* donker petrol: tekst en glasranden */
  --inkt-soft: #486670;
  --glas: #9db8bf;
  --glas-licht: #d3e1e4;
  --tape: #f6e7a4; /* labotape */
  --koper: #0b6fa4; /* kopersulfaatblauw: de knoppen */
  --koper-donker: #095a86;
  --groen: #1f8a4c;
  --groen-pale: #dff3e6;
  --rood: #c7362f;
  --rood-pale: #fbe4e0;
  --geel: #ffe45c; /* aangetikt */
  --blank: #eef4f5;
  --hand: 'Caveat Brush', 'Segoe Print', 'Bradley Hand', cursive;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  color: var(--inkt);
  font: 400 1.0625rem/1.5 var(--body);
  background: var(--tafel);
  min-height: 100vh;
}
/* het meetlatje bovenaan: een streepje om de 8 px, een lang streepje om de 40 px */
body::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 15px; background-color: var(--tape); border-bottom: 1.5px solid var(--inkt);
  background-image: linear-gradient(90deg, var(--inkt) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--inkt-soft) 1px, transparent 1px);
  background-size: 40px 11px, 8px 6px; background-repeat: repeat-x; background-position: 7px 100%, 7px 100%;
}
.page { max-width: 660px; margin: 0 auto; padding: 34px 16px 72px; padding: max(34px, 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(--inkt-soft); }

h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--hand); font-weight: 400; }
h1 { font-size: 2rem; font-size: clamp(1.9rem, 7.4vw, 2.6rem); line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font: 700 1.08rem/1.25 var(--body); }
p { margin: 0; }
small, .small { font-size: 0.875rem; color: var(--inkt-soft); }
a { color: var(--koper); }

/* een strook labotape met stiftschrift: voor de grote titel en voor de score */
.tape { display: inline-block; padding: 0.12em 0.62em 0.16em; background: var(--tape); color: var(--inkt); transform: rotate(-1.4deg); box-shadow: 1px 2px 0 rgba(20, 50, 60, 0.22);
  -webkit-clip-path: polygon(0 6%, 1.2% 0, 2.4% 7%, 3.4% 0, 96.4% 0, 97.6% 8%, 98.8% 0, 100% 7%, 100% 94%, 98.8% 100%, 97.6% 92%, 96.4% 100%, 3.4% 100%, 2.4% 93%, 1.2% 100%, 0 94%);
  clip-path: polygon(0 6%, 1.2% 0, 2.4% 7%, 3.4% 0, 96.4% 0, 97.6% 8%, 98.8% 0, 100% 7%, 100% 94%, 98.8% 100%, 97.6% 92%, 96.4% 100%, 3.4% 100%, 2.4% 93%, 1.2% 100%, 0 94%); }

.sheet { background: var(--papier); border: 1.5px solid var(--glas); border-radius: 10px; padding: 18px; box-shadow: 0 3px 0 var(--glas-licht); }
.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(--inkt); border-radius: 10px; background: var(--papier); font-weight: 700; text-decoration: none; color: var(--inkt); }
@media (hover: hover) { .btn:hover { background: var(--blank); } .btn.primary:hover { background: var(--koper-donker); } }
.btn.primary { background: var(--koper); border-color: var(--inkt); color: #fff; box-shadow: 0 3px 0 var(--inkt); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--inkt); }
.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(--koper-donker); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--koper); outline-offset: 2px; }

/* kop van de startpagina */
.top .when { font-weight: 700; margin-top: 12px; }
.rank { margin-top: 12px; padding: 10px 12px; background: var(--papier); border: 1.5px solid var(--glas); border-radius: 10px; }
.rank b { font-family: var(--hand); font-weight: 400; font-size: 1.25rem; line-height: 1.1; }
/* de voortgang als een maatcilinder op zijn kant: vloeistof met een schaalverdeling erover */
.rank .bar, .qbar .progress { position: relative; border: 1.5px solid var(--inkt); border-radius: 4px 99px 99px 4px; background: var(--papier); overflow: hidden; }
.rank .bar::after, .qbar .progress::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(90deg, rgba(20, 50, 60, 0.55) 1px, transparent 1px) 0 0 / 10% 45% repeat-x; }
.rank .bar { margin-top: 6px; height: 12px; }
.rank .bar i { display: block; height: 100%; background: #6fc3e8; }

/* beloningen: vier proefbuizen met een etiket. Hoe verder ze is, hoe voller de buis. */
.prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prize { display: flex; gap: 10px; padding: 12px 10px 10px; background: var(--papier); border: 1.5px solid var(--glas); border-radius: 10px; min-height: 132px; }
.tube { position: relative; flex: 0 0 30px; align-self: stretch; min-height: 100px; display: flex; align-items: flex-end; overflow: hidden; background: #f4f9fa; border: 2px solid var(--inkt); border-top-width: 4px; border-radius: 2px 2px 15px 15px; }
.tube i { display: block; width: 100%; background-color: var(--vloeistof); border-top: 2px solid rgba(255, 255, 255, 0.75); }
.prize.v0 { --vloeistof: #4db3e6; }
.prize.v1 { --vloeistof: #4cc081; }
.prize.v2 { --vloeistof: #f5a63c; }
.prize.v3 { --vloeistof: #a56bd6; }
/* een volle buis bruist */
.prize.got .tube i { background-image: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.85) 2.5px, transparent 3px), radial-gradient(circle at 68% 48%, rgba(255, 255, 255, 0.8) 3.5px, transparent 4px), radial-gradient(circle at 36% 74%, rgba(255, 255, 255, 0.8) 2px, transparent 2.5px); }
.ptxt { flex: 1; min-width: 0; }
.ptxt b { display: inline-block; font: 400 1.6rem/1 var(--hand); padding: 2px 9px 3px; background: var(--tape); transform: rotate(-2deg); box-shadow: 1px 1px 0 rgba(20, 50, 60, 0.2); }
.ptxt strong { display: block; font-size: 0.8rem; line-height: 1.25; margin-top: 6px; }
.ptxt span { display: block; font-size: 0.8rem; line-height: 1.25; margin-top: 6px; }
.ptxt em { display: block; font-style: normal; font-size: 0.76rem; color: var(--inkt-soft); margin-top: 4px; }
.prize.got { border-color: var(--groen); background: var(--groen-pale); }
.prize.got .ptxt em { color: #17703d; font-weight: 700; }
@media (max-width: 640px) { .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(--glas-licht); }
.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(--glas-licht); }
.dots i.ok { background: var(--groen); }
.dots i.no { background: var(--rood); }
/* statuslabels: kleine etiketten in de kleuren van een indicatorstrookje, van rood naar groen */
.chip { display: inline-block; white-space: nowrap; font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 3px; border: 1px solid rgba(20, 50, 60, 0.35); background: var(--blank); }
.chip.rood { background: #f7b3ab; }
.chip.oranje { background: #fbd08a; }
.chip.goed { background: #dcefb4; }
.chip.groen { background: #93dba9; }
.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(--glas-licht); }
.focuslist li:first-child { border-top: 0; }

/* vraag */
.qbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.qbar .progress { flex: 1; height: 14px; }
.qbar .progress i { display: block; height: 100%; background: #6fc3e8; 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(--inkt); border-radius: 8px; background: var(--papier); }
.timer.low { background: var(--rood-pale); }
.where { font-size: 0.875rem; color: var(--inkt-soft); margin-bottom: 8px; }
.prompt { font-size: 1.2rem; line-height: 1.45; }
.prompt small { display: inline-block; margin-top: 6px; }
/* een zin, een situatie of een omschrijving, op een eigen regel */
.phrase { display: block; margin: 10px 0 2px; padding: 8px 12px; border-left: 4px solid var(--glas); background: var(--blank); border-radius: 0 6px 6px 0; font-size: 1.05em; line-height: 1.4; }
.gap { display: inline-block; width: 3.6em; height: 1em; vertical-align: -0.12em; margin: 0 0.12em; border-bottom: 3px dotted var(--inkt); }
/* de pijl in een voedselketen: wordt opgegeten door */
.arr { display: inline-block; width: 1.15em; height: 0.62em; margin: 0 0.12em; vertical-align: 0.04em; background: currentColor; -webkit-clip-path: polygon(0 36%, 62% 36%, 62% 0, 100% 50%, 62% 100%, 62% 64%, 0 64%); clip-path: polygon(0 36%, 62% 36%, 62% 0, 100% 50%, 62% 100%, 62% 64%, 0 64%); }
table.data { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 0.92em; line-height: 1.3; background: var(--papier); }
table.data th, table.data td { border: 1px solid var(--glas); padding: 6px 8px; text-align: left; vertical-align: top; }
table.data tr:first-child th { background: var(--blank); }
table.data td { font-variant-numeric: tabular-nums; white-space: nowrap; }
ol.steps { margin: 8px 0 12px; padding: 10px 12px 10px 2.1em; background: var(--blank); border-radius: 6px; font-size: 0.95em; line-height: 1.4; }
ol.steps li + li { margin-top: 5px; }

/* tekeningen */
.figure { margin: 14px 0 0; }
.fig { display: block; width: 100%; height: auto; margin: 0 auto; max-width: 360px; overflow: visible; }
.fig.lab { max-width: 150px; }
.fig.scale { max-width: 180px; }
.fig.chain { max-width: 215px; }
.fig.pyr { max-width: 330px; }
.fig.chart { max-width: 420px; }
.fig .gl { fill: none; stroke: var(--inkt); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fig .lq { fill: #bfe4f4; }
.fig .lqr { fill: #e2483d; }
.fig .tk { fill: none; stroke: var(--inkt); stroke-width: 1.4; }
.fig .hl { fill: #f8c56a; stroke: var(--inkt); stroke-width: 2; stroke-linejoin: round; }
.fig .hl.thick { fill: none; stroke: #e58a17; stroke-width: 6; stroke-linecap: round; }
.fig .hlf { fill: #e2483d; stroke: var(--inkt); stroke-width: 2; }
.fig .ctx { fill: none; stroke: var(--glas); stroke-width: 2; stroke-dasharray: 5 4; }
.fig .dsp { font: 700 11px var(--body); fill: var(--inkt); }
.fig .lbl { font: 700 13.5px var(--body); fill: var(--inkt); }
.fig .lbl.sm { font-size: 12px; font-weight: 400; }
.fig.cycle .lbl.sm { font-weight: 700; }
.fig .lbl.note { font-size: 11.5px; font-weight: 400; font-style: italic; fill: var(--inkt-soft); }
.fig .edge { fill: none; stroke: var(--inkt); stroke-width: 1.8; }
.fig .ah { fill: var(--inkt); }
.fig .node rect, .fig .node path { fill: var(--papier); stroke: var(--inkt); stroke-width: 1.5; }
.fig .tier.t0 path { fill: #cfeccd; }
.fig .tier.t1 path { fill: #e6f1bd; }
.fig .tier.t2 path { fill: #fbe5ae; }
.fig .tier.t3 path { fill: #f9cdbd; }
.fig .node.ask rect { fill: var(--geel); stroke-dasharray: 6 4; stroke-width: 2.5; }
.fig .node.pick { cursor: pointer; }
.fig .node.pick:focus { outline: none; }
.fig .node.pick:focus-visible rect, .fig .node.pick:focus-visible path { stroke: var(--koper); stroke-width: 4; }
.fig .node.pick[aria-pressed='true'] rect, .fig .node.pick[aria-pressed='true'] path { fill: var(--geel); stroke-width: 3; }
.fig .node.pick.right rect, .fig .node.pick.right path { fill: var(--groen-pale); stroke: var(--groen); stroke-width: 3.5; }
.fig .node.pick.wrong rect, .fig .node.pick.wrong path { fill: var(--rood-pale); stroke: var(--rood); stroke-width: 3.5; stroke-dasharray: 5 3; }
.fig .node[aria-disabled='true'] { cursor: default; }
.fig .grid { stroke: var(--glas-licht); stroke-width: 1; }
.fig .axis { fill: none; stroke: var(--inkt); stroke-width: 1.8; }
.fig .serie { fill: none; stroke-width: 2.6; stroke-linejoin: round; }
.fig .serie.s0 { stroke: #1f8a4c; }
.fig .serie.s1 { stroke: #c7362f; stroke-dasharray: 7 4; }
.fig .pt.s0 { fill: #1f8a4c; }
.fig .pt.s1 { fill: #c7362f; }
.tapnote { font-size: 0.9rem; color: var(--inkt-soft); margin-top: 8px; }

.feedback .mine { text-decoration: underline wavy var(--rood); text-underline-offset: 4px; }
.answer { margin-top: 18px; }
.txtrow { display: flex; align-items: center; gap: 10px; }
.txt { flex: 1; min-width: 0; width: 100%; font: 700 1.3rem var(--body); color: var(--inkt); min-height: 54px; padding: 8px 14px; border: 1.5px solid var(--inkt); border-radius: 8px; background: var(--papier); }
.txt:disabled { opacity: 1; color: var(--inkt); -webkit-text-fill-color: var(--inkt); background: var(--blank); }
.unit { font-weight: 700; font-size: 1.3rem; white-space: nowrap; }
.accents { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.acc { min-width: 48px; min-height: 48px; padding: 0 6px; border: 1.5px solid var(--inkt); border-radius: 8px; background: var(--papier); font: 700 1.3rem var(--body); line-height: 1; }
.acc:active { background: var(--geel); }
.acc:disabled { opacity: 0.4; }
.choices { display: grid; gap: 10px; }
.choices.short { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.choices.pics { grid-template-columns: repeat(2, 1fr); }
.choice { text-align: left; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--inkt); border-radius: 10px; background: var(--papier); font-size: 1.08rem; line-height: 1.35; }
.choices.short .choice { text-align: center; font-weight: 700; }
.choices.pics .choice { padding: 8px; }
.choices.pics .fig { max-width: 104px; pointer-events: none; }
.choice[aria-pressed='true'] { background: var(--geel); box-shadow: inset 0 0 0 1.5px var(--inkt); }
.choice.right { background: var(--groen-pale); border-color: var(--groen); box-shadow: inset 0 0 0 1.5px var(--groen); }
.choice.wrong { background: var(--rood-pale); border-color: var(--rood); box-shadow: inset 0 0 0 1.5px var(--rood); }
.choice:disabled { cursor: default; color: var(--inkt); opacity: 1; }
/* volgorde: het rondje krijgt het nummer van je tik */
.choice.ord { display: flex; align-items: center; gap: 12px; }
.choice.ord .pos { flex: 0 0 32px; height: 32px; border-radius: 50%; border: 2px dashed var(--glas); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.choice.ord[aria-pressed='true'] .pos { border: 2px solid var(--inkt); background: var(--inkt); color: #fff; }
.hint { margin-top: 10px; font-weight: 700; color: #a52a24; min-height: 1.5em; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* de feedback is een etiket: een gekleurde band, een woord in stift, dan de uitleg */
.feedback { margin-top: 18px; padding: 10px 16px 14px; border: 1.5px solid var(--inkt); border-top-width: 10px; border-radius: 4px; background: var(--papier); }
.feedback.ok { border-color: var(--groen); background: var(--groen-pale); }
.feedback.no { border-color: var(--rood); background: var(--rood-pale); }
.feedback .annot { font-family: var(--hand); font-size: 1.5rem; line-height: 1.2; }
.feedback.ok .annot { color: #17703d; }
.feedback.no .annot { color: #a52a24; }
.feedback h3 { margin-bottom: 6px; }
.feedback p + p { margin-top: 8px; }
.feedback .good .fig { margin: 6px 0 0; }
.spell { padding: 8px 12px; background: var(--papier); border: 1.5px dashed var(--inkt); border-radius: 4px; }
.tip { padding: 10px 12px; border-left: 6px solid var(--tape); background: #fffbe6; border-radius: 0 4px 4px 0; }
.feedback .tip { background: var(--papier); border: 1.5px dashed var(--inkt); border-left: 8px solid var(--tape); border-radius: 4px; }
details.more summary { cursor: pointer; color: var(--koper-donker); text-decoration: underline; min-height: 44px; display: flex; align-items: center; }
details.more p { margin-top: 8px; }

/* resultaten */
.score { font-family: var(--hand); font-size: 2.6rem; font-size: clamp(2.4rem, 11vw, 3.4rem); line-height: 1.3; margin: 6px 0 10px; }
.banner { padding: 12px 14px; border: 1.5px solid var(--inkt); border-radius: 4px; background: var(--tape); font-weight: 700; }
details.review { border-top: 1px solid var(--glas-licht); padding: 10px 0; }
details.review summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; min-height: 44px; align-items: center; }
details.review summary b { min-width: 2.2em; }
details.review .body { margin-top: 10px; padding-left: 12px; border-left: 3px solid var(--glas-licht); }
.verdict { font-weight: 700; }
.verdict.ok { color: #17703d; }
.verdict.no { color: #a52a24; }
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(--glas-licht); 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(--inkt); border-radius: 4px; background: #fbd08a; }
.sharebox { width: 100%; font: 0.85rem var(--body); padding: 8px; border: 1.5px solid var(--inkt); border-radius: 4px; }

/* 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: 44px; }
  .sheet { padding: 24px; }
  .prompt { font-size: 1.3rem; }
  .choice { min-height: 56px; }
  h2 { font-size: 1.7rem; }
  .fig { max-width: 400px; }
  .fig.lab { max-width: 170px; }
  .fig.scale { max-width: 200px; }
  .fig.chain { max-width: 235px; }
  .choices.pics { grid-template-columns: repeat(4, 1fr); }
}

/* bij een behaalde milestone bruist het: bubbels stijgen op */
.confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; bottom: -40px; border-radius: 50%; border: 2.5px solid; background: rgba(255, 255, 255, 0.45); animation: rise 2.6s ease-in forwards; }
.confetti .b0 { border-color: #2f9fd8; }
.confetti .b1 { border-color: #2fa866; }
.confetti .b2 { border-color: #f08a24; }
.confetti .b3 { border-color: #9455c9; }
@keyframes rise { 70% { opacity: 1; } to { transform: translate(18px, -112vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .qbar .progress i { transition: none; }
}
