/* Le cahier d'écolier: Frans schoolschrift met Seyès-lijnen, titels in Frans schoolschrift
   (onderstreept met de rode balpen), blauwe inkt, en verbeteringen in rood en groen. */
@font-face { font-family: 'Playwrite FR Moderne'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/playwrite-fr-moderne-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 {
  --papier: #fdfdfb;
  --ligne: #c9cff2; /* de hoofdlijnen van het Seyès-papier */
  --ligne-fine: #eceefa; /* de fijne tussenlijnen */
  --encre: #1b2b85; /* vulpeninkt, bleu roi */
  --encre-soft: #5560a0;
  --bleu: #2743c9;
  --rouge: #d7263d; /* de rode balpen van de leerkracht */
  --vert: #1f8a4c; /* de groene balpen om te verbeteren */
  --buvard: #fbdde2; /* roze vloeipapier */
  --vert-pale: #dff3e6;
  --jaune: #ffe45c; /* markeerstift */
  --orange: #ffc670;
  --feuille: #ffffff;
  --blank: #eceefa;
  --hand: 'Playwrite FR Moderne', 'Segoe Script', '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(--encre);
  font: 400 1.0625rem/1.5 var(--body);
  background-color: var(--papier);
  /* Seyès: een hoofdlijn om de 32 px, drie fijne lijnen ertussen, verticale lijnen om de 32 px */
  background-image: linear-gradient(var(--ligne) 1px, transparent 1px), linear-gradient(var(--ligne-fine) 1px, transparent 1px), linear-gradient(90deg, var(--ligne-fine) 1px, transparent 1px);
  background-size: 100% 32px, 100% 8px, 32px 100%;
  background-position: 0 14px, 0 14px, 0 0;
  min-height: 100vh;
}
/* de driekleur als lint bovenaan de bladzijde */
body::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: linear-gradient(90deg, #0055a4 33.33%, #ffffff 33.33%, #ffffff 66.66%, #ef4135 66.66%); }
.page { max-width: 660px; margin: 0 auto; padding: 26px 16px 72px; padding: max(26px, 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(--encre-soft); }

h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--hand); font-weight: 400; }
h1 { font-size: 1.7rem; font-size: clamp(1.55rem, 6.2vw, 2.2rem); line-height: 2; }
h2 { font-size: 1.2rem; line-height: 1.75; }
h3 { font: 700 1.08rem/1.25 var(--body); }
p { margin: 0; }
small, .small { font-size: 0.875rem; color: var(--encre-soft); }
a { color: var(--bleu); }

/* een titel onderstrepen met de rode balpen en de lat */
.mark { text-decoration: underline; text-decoration-color: var(--rouge); text-decoration-thickness: 2px; text-underline-offset: 0.38em; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; }

/* een werkblad dat in het schrift gekleefd is */
.sheet { background: var(--feuille); border: 1px solid #a9b2e2; border-radius: 3px; padding: 18px; box-shadow: 3px 4px 0 var(--ligne); }
.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(--encre); border-radius: 8px; background: var(--feuille); font-weight: 700; text-decoration: none; color: var(--encre); }
@media (hover: hover) { .btn:hover { background: var(--blank); } .btn.primary:hover { background: #1f37ad; } }
.btn.primary { background: var(--bleu); border-color: var(--encre); color: #fff; box-shadow: 3px 3px 0 var(--rouge); }
.btn.primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--rouge); }
.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(--bleu); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

/* kop van de startpagina */
.top .when { font-weight: 700; }
.top .courage { font-family: var(--hand); font-size: 0.95rem; line-height: 2; color: var(--vert); }
.rank { margin-top: 10px; padding: 10px 12px; background: var(--feuille); border: 1px solid #a9b2e2; border-radius: 3px; }
.rank b { font-family: var(--hand); font-weight: 400; font-size: 0.95rem; }
.rank .bar { margin-top: 6px; height: 10px; border: 1.5px solid var(--encre); border-radius: 99px; background: var(--feuille); overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--vert); }

/* beloningen: vier "bons points", de beloningskaartjes van de Franse school */
.prizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prize { position: relative; border: 1.5px solid var(--encre); border-radius: 3px; outline: 1px solid var(--ligne); outline-offset: -5px; padding: 12px 11px 11px; background: var(--feuille); min-height: 118px; }
.prize::before { content: 'Bon point'; display: block; font-family: var(--hand); font-size: 0.68rem; line-height: 1.7; margin-bottom: 3px; color: var(--encre-soft); }
.prize b { display: block; font-weight: 700; font-size: 1.55rem; line-height: 1.05; }
.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(--encre-soft); margin-top: 4px; }
.prize.got { background: var(--vert-pale); outline-color: #9fd3b3; }
/* de stempel van de leerkracht */
.prize.got::after { content: 'Bravo !'; position: absolute; right: 7px; top: 9px; font-family: var(--hand); font-size: 0.66rem; line-height: 1.6; color: var(--rouge); border: 1.5px solid var(--rouge); border-radius: 99px; padding: 0 7px; transform: rotate(-9deg); background: var(--feuille); }
@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(--ligne); }
.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: var(--vert); }
.dots i.no { background: var(--rouge); }
/* gommettes: de gekleurde stickertjes */
.chip { display: inline-block; white-space: nowrap; font-size: 0.8rem; font-weight: 700; padding: 3px 11px; border-radius: 99px; background: var(--blank); }
.chip.rood { background: #f7aab7; }
.chip.oranje { background: var(--orange); }
.chip.goed { background: #cdeed8; }
.chip.groen { background: #8fdcaa; }
.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(--ligne); }
.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(--encre); border-radius: 99px; background: var(--feuille); overflow: hidden; }
.qbar .progress i { display: block; height: 100%; background: var(--bleu); transition: width 0.25s; }
.qbar .count { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--papier); padding: 0 4px; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 8px; border: 1.5px solid var(--encre); border-radius: 8px; background: var(--feuille); }
.timer.low { background: var(--buvard); }
.where { font-size: 0.875rem; color: var(--encre-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; }
/* een Franse zin of een woord om te vertalen, op een eigen regel */
.phrase { display: block; margin: 8px 0 2px; font-size: 1.15em; font-weight: 700; line-height: 1.45; }
/* de puntjeslijn van een invuloefening */
.gap { display: inline-block; width: 3.6em; height: 1em; vertical-align: -0.12em; margin: 0 0.12em; border-bottom: 3px dotted var(--encre); }
.feedback .mine { text-decoration: underline wavy var(--rouge); text-underline-offset: 4px; }
.answer { margin-top: 18px; }
.txtrow { display: flex; }
.txt { flex: 1; min-width: 0; width: 100%; font: 700 1.3rem var(--body); color: var(--encre); min-height: 54px; padding: 8px 14px; border: 1.5px solid var(--encre); border-radius: 6px; background: var(--feuille); }
.txt:disabled { opacity: 1; color: var(--encre); -webkit-text-fill-color: var(--encre); background: var(--blank); }
.accents { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.acc { min-width: 46px; min-height: 46px; padding: 0 6px; border: 1.5px solid var(--encre); border-radius: 8px; background: var(--feuille); font: 700 1.25rem var(--body); line-height: 1; }
.acc:active { background: var(--jaune); }
.acc:disabled { opacity: 0.4; }
.accents .sep { width: 8px; }
.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(--encre); border-radius: 8px; background: var(--feuille); font-size: 1.08rem; line-height: 1.35; }
.choices.short .choice { text-align: center; font-weight: 700; }
.choice[aria-pressed='true'] { background: var(--jaune); box-shadow: inset 0 0 0 1.5px var(--encre); }
.choice.right { background: var(--vert-pale); border-color: var(--vert); box-shadow: inset 0 0 0 1.5px var(--vert); }
.choice.wrong { background: var(--buvard); border-color: var(--rouge); box-shadow: inset 0 0 0 1.5px var(--rouge); }
.choice:disabled { cursor: default; color: var(--encre); opacity: 1; }
.hint { margin-top: 10px; font-weight: 700; color: #b01f33; min-height: 1.5em; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* de verbetering: groene balpen voor juist, rode balpen voor fout */
.feedback { margin-top: 18px; padding: 12px 16px 14px; border-radius: 3px; border-left: 5px solid var(--encre); }
.feedback.ok { background: var(--vert-pale); border-left-color: var(--vert); }
.feedback.no { background: var(--buvard); border-left-color: var(--rouge); }
.feedback .annot { font-family: var(--hand); font-size: 1rem; line-height: 1.9; }
.feedback.ok .annot { color: var(--vert); }
.feedback.no .annot { color: #b01f33; }
.feedback h3 { margin-bottom: 6px; }
.feedback p + p { margin-top: 8px; }
.tip { padding: 10px 12px; border-left: 5px solid var(--jaune); background: #fffbe0; border-radius: 0 3px 3px 0; }
.feedback .tip { background: var(--feuille); border: 1.5px dashed var(--encre); border-left: 6px solid var(--jaune); border-radius: 3px; }
details.more summary { cursor: pointer; color: var(--bleu); text-decoration: underline; min-height: 44px; display: flex; align-items: center; }
details.more p { margin-top: 8px; }

/* resultaten: het cijfer zoals de leerkracht het bovenaan schrijft */
.score { font-family: var(--hand); font-size: 2.2rem; font-size: clamp(2rem, 9.5vw, 3rem); line-height: 1.9; color: var(--rouge); }
.banner { padding: 12px 14px; border: 1.5px solid var(--encre); border-radius: 3px; background: var(--jaune); font-weight: 700; }
details.review { border-top: 1px solid var(--ligne); 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(--ligne); }
.verdict { font-weight: 700; }
.verdict.ok { color: #17703d; }
.verdict.no { color: #b01f33; }
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(--ligne); 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; }
.foot .linkbtn { background: var(--papier); padding: 4px 6px; }
.warn { padding: 10px 14px; border: 1.5px solid var(--encre); border-radius: 3px; background: var(--orange); }
.sharebox { width: 100%; font: 0.85rem var(--body); padding: 8px; border: 1.5px solid var(--encre); border-radius: 3px; }

/* 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: 36px; }
  .sheet { padding: 24px; }
  .prompt { font-size: 1.3rem; }
  .choice { min-height: 56px; }
  h2 { font-size: 1.3rem; }
}
/* breed scherm: de rode kantlijn van het schrift, links van de tekst */
@media (min-width: 880px) {
  body {
    background-image: linear-gradient(90deg, transparent calc(50% - 398px), #ef8f9c calc(50% - 398px), #ef8f9c calc(50% - 396px), transparent calc(50% - 396px)), linear-gradient(var(--ligne) 1px, transparent 1px), linear-gradient(var(--ligne-fine) 1px, transparent 1px), linear-gradient(90deg, var(--ligne-fine) 1px, transparent 1px);
    background-size: 100% 100%, 100% 32px, 100% 8px, 32px 100%;
    background-position: 0 0, 0 14px, 0 14px, 0 0;
  }
}

/* confetti in de driekleur 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; box-shadow: 0 0 0 1px var(--ligne); 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; }
}
