/* Schaaksafari: opmaak. Lettertypes: Fredoka (koppen, knoppen) en Andika (leesletter voor beginnende lezers). */
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('fonts/andika-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('fonts/andika-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --papier: #fffaf2;
  --inkt: #2b2733;
  --inkt-zacht: #6b6475;
  --oranje: #ff8a3d;
  --oranje-donker: #d9651c;
  --groen: #37b26c;
  --groen-donker: #22874d;
  --rood: #e5484d;
  --geel: #ffc933;
  --w1: #fff4c9;
  --w2: #ffd972;
  --accent: #e8a317;
  --licht: #eeeed2;
  --donker: #769656;
  --coord-licht: #769656;
  --coord-donker: #eeeed2;
  --schaduw: 0 4px 0 rgba(70, 45, 20, .10), 0 10px 26px rgba(70, 45, 20, .14);
  --bord: min(calc(100vw - 24px), calc(100vh - 330px), 720px);
}
@supports (height: 100dvh) {
  :root { --bord: min(calc(100vw - 24px), calc(100dvh - 330px), 720px); }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Andika', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--inkt);
  background: var(--papier);
  background-image: radial-gradient(circle at 15% -10%, var(--w1) 0%, transparent 55%), radial-gradient(circle at 110% 110%, var(--w2) 0%, transparent 60%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  transition: background-color .6s;
}
/* Geen inzoomen bij dubbeltikken (iPhone): overal 'manipulation', het bord zelf 'none'. Invoervelden minstens 16px,
   anders zoomt iOS in zodra je erin tikt. */
html, body { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
img { -webkit-user-drag: none; }
.verborgen { display: none !important; }

#app { min-height: 100vh; }
.scherm { min-height: 100vh; min-height: 100dvh; }

/* ---------- Algemene onderdelen ---------- */
.midden {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; text-align: center;
}
.titel { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: clamp(28px, 8vw, 40px); line-height: 1.1; color: var(--inkt); }
.ballon {
  position: relative; background: #fff; border-radius: 22px; padding: 12px 16px;
  font-size: clamp(19px, 5.1vw, 25px); line-height: 1.32; box-shadow: var(--schaduw); text-align: left;
}
.ballon.groot { font-size: clamp(21px, 5.8vw, 28px); padding: 14px 20px; text-align: center; }
.knop {
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 24px; letter-spacing: .3px;
  border: none; border-radius: 20px; padding: 14px 26px; min-height: 60px;
  background: #fff; color: var(--inkt); box-shadow: 0 5px 0 #dcd3c6, 0 8px 18px rgba(70, 45, 20, .12);
  transition: transform .08s, box-shadow .08s;
}
.knop:active { transform: translateY(4px); box-shadow: 0 1px 0 #dcd3c6; }
.knop.hoofd { background: var(--oranje); color: #fff; box-shadow: 0 6px 0 var(--oranje-donker), 0 10px 22px rgba(217, 101, 28, .3); }
.knop.hoofd:active { box-shadow: 0 2px 0 var(--oranje-donker); }
.knop.groen { background: var(--groen); color: #fff; box-shadow: 0 6px 0 var(--groen-donker); }
.knop.goed { background: var(--groen); color: #fff; box-shadow: 0 5px 0 var(--groen-donker); }
.knop.fout { background: #ffe1e1; color: var(--rood); animation: schud .4s; }
.knop.klein { font-size: 19px; min-height: 50px; padding: 10px 18px; }
.knop.terugknop { background: #fff; color: var(--inkt-zacht); font-size: 17px; padding: 10px 14px; box-shadow: 0 3px 0 #e2d8c9; }
.knoppen .terugknop ~ .knop.hoofd { min-width: min(200px, 55%); }
.knoppen.groot .terugknop { order: 99; }
.knop img { width: 30px; height: 30px; vertical-align: -7px; margin-right: 6px; }
.groot-knop { min-width: min(320px, 84vw); font-size: 30px; min-height: 72px; }
.pijl { font-size: .8em; margin-left: 6px; }
.tekstknop { background: none; border: none; color: var(--inkt-zacht); font-size: 17px; padding: 8px 14px; text-decoration: underline; text-underline-offset: 3px; }
.rond-knop {
  width: 46px; height: 46px; border-radius: 50%; border: none; background: #fff; box-shadow: var(--schaduw);
  font-size: 22px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.rond-knop img { width: 28px; height: 28px; }
.rond-knop.uit { opacity: .45; }
.invoer {
  font-family: 'Fredoka', sans-serif; font-size: 28px; text-align: center; width: min(320px, 84vw);
  padding: 12px 16px; border-radius: 18px; border: 3px solid #eadfcd; background: #fff; outline: none;
  -webkit-user-select: text; user-select: text;
}
.invoer:focus { border-color: var(--oranje); }

.vos-groot { width: 128px; height: 128px; filter: drop-shadow(0 8px 10px rgba(120, 60, 10, .25)); }
.vos-klein { width: 54px; height: 54px; flex: none; filter: drop-shadow(0 3px 4px rgba(120, 60, 10, .25)); }
.huppel { animation: huppel 2.6s ease-in-out infinite; }
@keyframes huppel { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }

/* ---------- Startscherm: het pad ---------- */
.ouderknop {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .7); opacity: .75;
  display: grid; place-items: center;
}
.ouderknop img { width: 26px; height: 26px; }
#scherm-start { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
#scherm-start.verborgen { display: none; }
.start-balk {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 560px; width: 100%; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 12px 6px;
}
.start-balk .wisselknop, .start-balk .ouderknop { position: static; flex: none; }
.start-balk .wisselknop.verborgen { display: block; visibility: hidden; }
.start-pillen { display: flex; gap: 8px; align-items: center; }
.pil {
  display: flex; align-items: center; gap: 5px; border: none; background: #fff; border-radius: 999px; padding: 5px 12px 5px 7px;
  box-shadow: var(--schaduw); font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 20px; color: var(--inkt);
}
.pil img { width: 28px; height: 28px; }
.pil.bijna img { animation: wiebel 1s ease-in-out infinite; }
#pil-rang { padding: 4px; }
.medaille.klein { width: 34px; height: 34px; box-shadow: 0 2px 0 #b77f0e; }
.medaille.klein.kroon::after { top: -12px; width: 22px; height: 22px; }
.start-inhoud {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 6px 16px calc(110px + env(safe-area-inset-bottom));
}
.wereld-banner {
  display: flex; align-items: center; gap: 12px; background: var(--accent); color: #fff; border-radius: 22px; padding: 10px 14px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .18); position: sticky; top: 0; z-index: 3;
}
.wereld-banner img { width: 46px; height: 46px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.wereld-banner { cursor: pointer; }
.wb-tekst { flex: 1; min-width: 0; }
.wb-pijl { font-family: 'Fredoka', sans-serif; font-size: 36px; font-weight: 700; opacity: .85; line-height: 1; }
.wb-naam { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 26px; line-height: 1.05; }
.wb-sub { font-size: 16px; opacity: .92; }
.start-ballon { margin: 14px auto 0; max-width: 340px; font-size: 20px; text-align: center; }
.start-ballon .ballon-dier { display: block; width: 64px; height: 64px; margin: 0 auto 6px; }
.start-ballon .ballon-knoppen { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.pad-kaart { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 26px 0 10px; }
.pk-rij { position: relative; display: flex; justify-content: center; transform: translateX(calc(var(--x, 0) * 62px)); }
.pk-knoop {
  width: 70px; height: 70px; border-radius: 50%; border: none; display: grid; place-items: center; position: relative;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 30px; color: #fff; transition: transform .1s;
}
.pk-knoop:active { transform: translateY(4px); }
.pk-knoop img { width: 60%; height: 60%; }
.pk-knoop.klaar { background: var(--groen); box-shadow: 0 6px 0 var(--groen-donker); }
.pk-knoop.klaar.perfect { background: linear-gradient(145deg, #ffd94a, #f2b705); box-shadow: 0 6px 0 #c48f00, 0 0 0 4px #fff3c4; font-size: 34px; }
.pk-knoop.open { background: #fff; color: var(--accent); box-shadow: 0 0 0 4px var(--accent), 0 6px 0 4px rgba(0, 0, 0, .12); }
.pk-knoop.open img { filter: none; }
.pk-knoop.baas.verslagen { background: linear-gradient(145deg, #fff3c4, #ffd94a); }
.pk-sterren.perfect { color: #e0a200; font-weight: 700; }
.terug-plek { display: block; margin: 12px auto 0; }
.pk-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: 340px; margin: 6px auto 0; font-size: 14px; color: var(--inkt-zacht); }
.pk-legenda span { display: inline-flex; align-items: center; gap: 4px; }
.pk-legenda img { width: 20px; height: 20px; }
.pk-knoop.dicht { background: #e8dfd2; box-shadow: 0 6px 0 #cfc3b2; }
.pk-knoop.dicht img { filter: grayscale(1) opacity(.45); }
.pk-knoop.nu { width: 96px; height: 96px; background: #fff; box-shadow: 0 0 0 6px var(--oranje), 0 9px 0 6px var(--oranje-donker); animation: pols 1.6s ease-in-out infinite; }
.pk-knoop.nu img { width: 72%; height: 72%; }
.pk-knoop.baas { background: #fff8e1; box-shadow: 0 0 0 5px #f3c64b, 0 7px 0 5px #c9951b; }
.pk-knoop.baas img { width: 70%; height: 70%; filter: none; }
.pk-knoop.baas.dicht img { filter: grayscale(.2); }
.pk-knoop.wiebel { animation: schud .4s; }
.pk-sterren { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; font-size: 14px; letter-spacing: 1px; color: #f09a2a; white-space: nowrap; }
.pk-start {
  position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); border: none; white-space: nowrap;
  background: var(--oranje); color: #fff; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 20px;
  border-radius: 14px; padding: 8px 14px; box-shadow: 0 4px 0 var(--oranje-donker); width: max-content; max-width: min(46vw, 230px); white-space: normal; line-height: 1.15; text-align: left;
}
.pk-sterregel { display: block; font-size: 16px; letter-spacing: 1px; }
.pk-opnieuw { text-align: center; }
.pk-start::before { content: ''; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: var(--oranje); border-left: 0; }
.pk-rij.links .pk-start { left: auto; right: calc(100% + 14px); }
.pk-rij.links .pk-start::before { left: auto; right: -8px; border-right-color: transparent; border-left: 8px solid var(--oranje); }
.pk-volgende { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; color: var(--inkt-zacht); font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 17px; }
.pk-volgende img { width: 44px; height: 44px; filter: grayscale(1) opacity(.45); }
@keyframes pols { 0%, 100% { scale: 1 } 50% { scale: 1.06 } }

/* Tabbalk onderaan (Spelen, Dieren, Kast) */
.tabbalk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: grid; grid-template-columns: repeat(3, 1fr);
  background: #fff; box-shadow: 0 -4px 18px rgba(70, 45, 20, .12); padding: 6px max(0px, calc((100vw - 560px) / 2)) calc(8px + env(safe-area-inset-bottom));
}
.tabbalk.verborgen { display: none; }
.tab { border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px; color: var(--inkt-zacht); }
.tab img { width: 38px; height: 38px; }
.tab.aan { color: var(--oranje-donker); }
.tab-bord {
  width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center;
  background: conic-gradient(var(--licht) 25%, var(--donker) 0 50%, var(--licht) 0 75%, var(--donker) 0) 0 0 / 19px 19px;
}
.tab-bord img { width: 30px; height: 30px; }
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9;
  background: #3a3440; color: #fff; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 18px; padding: 10px 18px; border-radius: 16px;
  max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.toast.verborgen { display: none; }
.opnieuw-knop { margin-top: 12px; background: #fff; color: var(--oranje-donker); box-shadow: 0 4px 0 #e2d8c9; }
.opnieuw-vak {
  position: fixed; left: 12px; right: 12px; margin: 0 auto; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 9;
  max-width: 520px; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px;
  padding: 12px 14px; box-shadow: 0 8px 30px rgba(70, 45, 20, .25); animation: plop .25s;
}
.opnieuw-vak.verborgen { display: none; }
.ov-tekst { flex: 1; min-width: 0; display: grid; }
.ov-tekst b { font-family: 'Fredoka', sans-serif; font-size: 19px; }
.ov-sterren { color: #f09a2a; font-size: 15px; }
.ov-knop { flex: none; font-size: 19px; min-height: 48px; padding: 8px 14px; }
/* Mijn reis */
.reis-kop { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 20px; text-align: center; margin: 4px 0 14px; }
.reis-lijst { display: grid; gap: 10px; }
.reis-kaart { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px; padding: 10px 14px; box-shadow: var(--schaduw); border: 3px solid transparent; }
.reis-kaart.hier { border-color: var(--wa); background: #fffaf2; }
.reis-kaart.nog { background: rgba(255, 255, 255, .55); box-shadow: none; }
.reis-kaart.nog .reis-icoon { filter: grayscale(1) opacity(.45); }
.reis-icoon { width: 48px; height: 48px; flex: none; }
.reis-tekst { flex: 1; min-width: 0; display: grid; }
.reis-tekst b { font-family: 'Fredoka', sans-serif; font-size: 20px; }
.reis-tekst small { color: var(--inkt-zacht); font-size: 15px; }
.reis-leer { font-size: 15px; line-height: 1.25; margin: 1px 0 2px; }
.reis-kaart.nog .reis-leer { color: var(--inkt-zacht); }
.reis-kaart.nog .reis-tekst b { color: var(--inkt-zacht); }
.reis-rechts { display: flex; align-items: center; gap: 6px; }
.reis-rechts img { width: 40px; height: 40px; }
.reis-rechts img.slot { width: 28px; height: 28px; opacity: .45; }
.reis-vink { width: 32px; height: 32px; border-radius: 50%; background: var(--groen); color: #fff; display: grid; place-items: center; font-weight: 700; }
.reis-kaart.open-baar { cursor: pointer; }
.reis-kaart.perfect { background: linear-gradient(135deg, #fff8d9, #ffe9a3); border-color: #e8b400; }
.reis-sterrij { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.reis-sterretal { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 18px; color: #d99a00; }
.reis-perfect { background: #e8b400; color: #fff; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 99px; }
.reis-balk { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .08); overflow: hidden; margin: 4px 0 2px; max-width: 220px; }
.reis-balk > div { height: 100%; background: #f2b705; border-radius: 99px; }
.reis-baas { display: grid; justify-items: center; gap: 2px; width: 64px; text-align: center; }
.reis-baas img { width: 40px; height: 40px; filter: grayscale(1) opacity(.55); }
.reis-baas.verslagen img { filter: none; }
.reis-baas small { font-size: 11px; line-height: 1.1; color: var(--inkt-zacht); font-weight: 600; }
.reis-baas.verslagen small { color: #3a8a2e; }
.reis-rechts img.reis-vos { width: 40px; height: 40px; }
.reis-open { font-size: 14px; color: var(--wa, var(--accent)); font-weight: 600; margin-top: 2px; }
.reis-sterren { color: #f0a500 !important; letter-spacing: 1px; }

/* Rang en week (in het Dieren-tabblad) */
.statuskaart { width: 100%; background: rgba(255, 255, 255, .9); border-radius: 22px; padding: 12px 14px; box-shadow: var(--schaduw); display: grid; gap: 8px; margin-bottom: 6px; }
.rang-rij { display: flex; align-items: center; gap: 12px; }
.medaille {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff6c9, #f3c64b 60%, #d89b16); box-shadow: 0 3px 0 #b77f0e, inset 0 -3px 6px rgba(0, 0, 0, .12);
}
.medaille img { width: 70%; height: 70%; }
.medaille.kroon::after { content: ''; position: absolute; top: -16px; width: 30px; height: 30px; background: url('img/ui/kroon.webp') center / contain no-repeat; }
.medaille.groot { width: 170px; height: 170px; box-shadow: 0 8px 0 #b77f0e, 0 16px 30px rgba(180, 120, 20, .35); animation: onthul .8s cubic-bezier(.3, 1.5, .5, 1) both; }
.medaille.groot.kroon::after { top: -44px; width: 80px; height: 80px; }
.rang-tekst { flex: 1; min-width: 0; }
.rang-tekst b { font-family: 'Fredoka', sans-serif; font-size: 22px; }
.rang-tekst small { display: block; color: var(--inkt-zacht); font-size: 14px; }
.rang-balk { height: 12px; background: #efe7da; border-radius: 99px; overflow: hidden; margin: 3px 0 2px; }
.rang-balk div { height: 100%; background: linear-gradient(90deg, #f3c64b, #f09a2a); border-radius: 99px; }
.ster-badge { display: flex; align-items: center; gap: 4px; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 20px; }
.ster-badge img { width: 28px; height: 28px; }
.week { display: flex; gap: 6px; justify-content: space-between; }
.weekdag { flex: 1; height: 34px; border-radius: 10px; background: #f5efe5; display: grid; place-items: center; font-family: 'Fredoka', sans-serif; font-size: 14px; color: var(--inkt-zacht); position: relative; }
.weekdag.gespeeld { background: #ffe2b8; color: #8a4f00; }
.weekdag.gespeeld::after { content: '★'; position: absolute; top: -8px; right: -2px; font-size: 14px; color: #f09a2a; }
.weekdag.vandaag { box-shadow: 0 0 0 2px var(--oranje); }
.week-tekst { color: var(--inkt-zacht); font-size: 14px; text-align: center; }
#scherm-boek .boek, #scherm-kast .boek { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- Spelers ---------- */
.wisselknop {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; z-index: 5;
  width: 54px; height: 54px; border-radius: 50%; border: 3px solid #fff; background: #fff; box-shadow: var(--schaduw); padding: 5px;
}
.wisselknop img { width: 100%; height: 100%; }
.testlint {
  display: none; position: fixed; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 5;
  background: #3a3440; color: #fff; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 15px; padding: 4px 14px; border-radius: 99px;
}
#scherm-start.testmodus .testlint { display: block; }
#scherm-start .testlint { position: static; transform: none; margin: 0 auto 8px; width: max-content; }
.wie-lijst { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.wie-knop {
  width: 146px; min-height: 164px; border: none; border-radius: 26px; background: #fff; box-shadow: var(--schaduw);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 24px; transition: transform .1s;
}
.wie-knop:active { transform: scale(.95); }
.wie-knop img { width: 96px; height: 96px; }
.dier-keuze { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(460px, calc(100vw - 32px)); }
.dier-knop { min-width: 0; aspect-ratio: 1; border: none; border-radius: 22px; background: #fff; box-shadow: var(--schaduw); padding: 8px; transition: transform .1s; }
.dier-knop:active { transform: scale(.92); }
.dier-knop img { width: 100%; height: 100%; }

/* ---------- Les ---------- */
#scherm-les { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.les-kop { display: flex; align-items: center; gap: 12px; padding: calc(8px + env(safe-area-inset-top)) 12px 6px; }
.reeks { display: flex; align-items: center; gap: 2px; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 22px; color: #e0621b; flex: none; }
.reeks img { width: 30px; height: 30px; }
.reeks.pop { animation: plop .45s; }
.voortgang { flex: 1; height: 18px; background: rgba(60, 40, 20, .1); border-radius: 99px; overflow: hidden; }
.balk { height: 100%; width: 0; background: var(--groen); border-radius: 99px; transition: width .45s ease; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .1); }
.les-body {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 2px 12px calc(10px + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;   /* past het niet, dan scrollen (nooit tekst onder de knoppen) */
}
.les-body > *, .les-links > * { flex-shrink: 0; }
.les-links { display: contents; }
.uitleg-rij { order: 1; width: var(--bord); display: flex; align-items: flex-end; gap: 8px; min-height: 70px; }
.uitleg-rij .ballon { flex: 1; }
.uitleg-rij .ballon::before {
  content: ''; position: absolute; left: -9px; bottom: 16px; border: 9px solid transparent; border-right-color: #fff; border-left: 0;
}
.les-rechts { order: 2; display: flex; flex-direction: column; align-items: center; }
.melding {
  order: 3; min-height: 32px; max-width: var(--bord); font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 22px; text-align: center;
  color: var(--inkt-zacht); transition: color .2s;
}
.melding.goed { color: var(--groen-donker); animation: plop .35s; }
.melding.fout { color: var(--rood); animation: schud .4s; }
.knoppen { order: 4; width: var(--bord); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.knoppen .knop.hoofd { min-width: min(260px, 70%); font-size: 26px; }
.knoppen .knop.optie { flex: 1 1 40%; min-width: 120px; font-size: 26px; }
.knoppen .knop.optie img { width: 54px; height: 54px; margin: 0; vertical-align: middle; }
.knoppen.groot { margin-top: 8vh; }
.knoppen.groot .knop.optie { min-height: 130px; font-size: 34px; }
.knoppen.groot .knop.optie img { width: 96px; height: 96px; }
.les-beeld { width: var(--bord); height: calc(var(--bord) * .75); display: grid; place-items: center; }
.les-beeld img.groot { width: min(62%, 260px); height: auto; animation: plop .5s; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .18)); }
.tabel { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: var(--bord); }
.tabel div { background: #fff; border-radius: 16px; padding: 8px 6px 6px; box-shadow: var(--schaduw); text-align: center; flex: 1 1 0; min-width: 56px; max-width: 96px; }
.tabel img { width: min(48px, 100%); height: auto; aspect-ratio: 1; display: block; margin: 0 auto; }
.tabel:has(b.woord) div { flex-basis: 28%; max-width: 120px; }
.tabel b { font-family: 'Fredoka', sans-serif; font-size: 26px; }
.tabel b.woord { font-size: 18px; font-weight: 600; display: block; padding: 0 4px; }
.bord-houder { position: relative; }
.spelers { display: flex; justify-content: space-between; align-items: center; width: var(--bord); margin-top: 6px; font-family: 'Fredoka', sans-serif; font-size: 18px; }
.spelers .tegen { display: flex; align-items: center; gap: 6px; }
.spelers .sterkte { font-size: 13px; opacity: .7; }
.spelers img { width: 34px; height: 34px; }
.denkt::after { content: ' denkt na…'; color: var(--inkt-zacht); animation: knipper 1s infinite; }
@keyframes knipper { 50% { opacity: .3 } }

@media (orientation: landscape) and (min-width: 700px) {
  :root { --bord: min(calc(100vh - 110px), calc(100vw - 460px), 700px); }
  @supports (height: 100dvh) { :root { --bord: min(calc(100dvh - 110px), calc(100vw - 460px), 700px); } }
  .les-body { flex-direction: row; justify-content: center; align-items: center; gap: 28px; }
  .les-links { display: flex; flex-direction: column; gap: 14px; width: min(390px, 36vw); }
  .uitleg-rij, .knoppen { width: 100%; }
}

/* ---------- Bord ---------- */
.bord {
  position: relative; width: var(--bord); height: var(--bord); border-radius: 12px; overflow: hidden;
  box-shadow: 0 6px 0 rgba(60, 40, 20, .18), 0 14px 30px rgba(60, 40, 20, .18);
  touch-action: none; -webkit-user-select: none; user-select: none; flex: none;
}
.velden { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.veld { position: relative; }
.veld.licht { background: var(--licht); }
.veld.donker { background: var(--donker); }
.veld::before { content: ''; position: absolute; inset: 0; background: transparent; transition: background .15s; }
.veld.laatste::before { background: rgba(255, 214, 10, .34); }
.veld.mark::before { background: rgba(70, 150, 230, .42); }
.veld.gevaar::before { background: rgba(229, 72, 77, .38); }
.veld.sel::before { background: rgba(255, 214, 10, .55); }
.veld.vooraf::before, .veld.goed::before { background: rgba(55, 178, 108, .62); }
.veld.goed::before { animation: plop .3s; }
.veld.fout::before { background: rgba(229, 72, 77, .7); animation: flits .6s; }
.veld.tip::before { background: rgba(255, 201, 51, .75); animation: pols 0.9s infinite; }
.veld.flits::before { background: rgba(255, 201, 51, .8); animation: pols 0.5s 3; }
#les-tekst .veldnaam { font-weight: 700; color: var(--groen-donker); border-bottom: 2px dotted currentColor; cursor: pointer; }
.veld.schaak::before { background: radial-gradient(circle, rgba(255, 40, 40, .85) 0%, rgba(255, 40, 40, .35) 45%, transparent 72%); }
.veld.doel::after { content: ''; position: absolute; left: 36%; top: 36%; width: 28%; height: 28%; border-radius: 50%; background: rgba(40, 30, 20, .25); }
.veld.slag::after { content: ''; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid rgba(40, 30, 20, .25); }
.coord { position: absolute; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: calc(var(--bord) / 34); line-height: 1; pointer-events: none; }
.coord.cijfer { left: 4%; top: 4%; }
.coord.letter { right: 5%; bottom: 3%; }
.veld.licht .coord { color: var(--coord-licht); }
.veld.donker .coord { color: var(--coord-donker); }
.geen-coord .coord { display: none; }
.laag { position: absolute; inset: 0; pointer-events: none; }
.stuk {
  position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%;
  transition: transform .23s cubic-bezier(.25, .8, .35, 1); will-change: transform; z-index: 1;
}
.stuk.sleep { z-index: 6; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .35)); }
.stuk.weg { animation: weg .26s forwards; }
.stuk.bots { animation: bots .45s; }
.item { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; padding: 1.6%; }
.item img { width: 100%; height: 100%; display: block; animation: wiebel 2.4s ease-in-out infinite; }
.item.gepakt img { animation: gepakt .45s forwards; }
.pijlen { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.labels { z-index: 4; }
.veldlabel { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; display: grid; place-items: center; }
.veldlabel span {
  width: 64%; height: 64%; border-radius: 50%; background: #ff8a3d; color: #fff; display: grid; place-items: center;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: calc(var(--bord) / 17); box-shadow: 0 3px 0 #d9651c; animation: plop .3s;
}
.stuk.hop { z-index: 5; animation: hop .32s ease-in-out; }
@keyframes hop {
  0% { scale: 1; filter: none; }
  50% { scale: 1.28; filter: drop-shadow(0 12px 8px rgba(0, 0, 0, .28)); }
  100% { scale: 1; filter: none; }
}
.promo {
  position: absolute; inset: 0; z-index: 10; background: rgba(255, 250, 242, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.promo-titel { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 24px; }
.promo-rij { display: flex; gap: 10px; }
.promo-knop { width: calc(var(--bord) * .2); height: calc(var(--bord) * .2); border-radius: 18px; border: none; background: #fff; box-shadow: var(--schaduw); padding: 6px; }
.promo-knop img { width: 100%; height: 100%; }

/* ---------- Beloning en wereld ---------- */
.sterren { display: flex; gap: 10px; align-items: flex-end; }
.sterren img { width: 74px; height: 74px; filter: grayscale(1) opacity(.25); }
.sterren img:nth-child(2) { width: 92px; height: 92px; }
.sterren img.aan { filter: none; animation: ster .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.dier-onthulling { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.dier-onthulling::before {
  content: ''; position: absolute; inset: -30px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 201, 51, .38) 0 12deg, transparent 12deg 30deg);
  animation: draai 12s linear infinite;
}
.dier-onthulling img { position: relative; width: 170px; height: 170px; animation: onthul .8s cubic-bezier(.3, 1.5, .5, 1) both; }
.goud img, img.goud { filter: drop-shadow(0 0 10px #ffd23f) drop-shadow(0 0 3px #e0a800) saturate(1.3); }
img.diamant { filter: drop-shadow(0 0 10px #8fe3ff) drop-shadow(0 0 4px #b58cff) saturate(1.4); }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; width: min(520px, 92vw); }
.album div { background: rgba(255, 255, 255, .85); border-radius: 18px; padding: 8px 4px 4px; box-shadow: var(--schaduw); font-size: 13px; }
.album img { width: 56px; height: 56px; display: block; margin: 0 auto 2px; }
.album img.nog { filter: brightness(0) opacity(.12); }
.diploma {
  background: #fffdf5; border: 6px double var(--accent); border-radius: 18px; padding: 18px 20px; box-shadow: var(--schaduw);
  font-family: 'Fredoka', sans-serif; width: min(460px, 92vw);
}
.diploma .dk { font-size: 18px; color: var(--inkt-zacht); }
.diploma .dn { font-size: 34px; font-weight: 700; margin: 4px 0; }
.diploma img { width: 70px; height: 70px; }

/* ---------- Cadeau ---------- */
.kist-knop { border: none; background: none; padding: 0; width: 190px; height: 190px; animation: wiebel 1.2s ease-in-out infinite; filter: drop-shadow(0 12px 16px rgba(120, 60, 10, .3)); }
.kist-knop.groot { width: 240px; height: 240px; }
.kist-knop img { width: 100%; height: 100%; }
.kist-knop.open { animation: kistOpen .7s forwards; }
@keyframes kistOpen { 0% { transform: scale(1) } 40% { transform: scale(1.25) rotate(-8deg) } 100% { transform: scale(0) rotate(20deg); opacity: 0 } }
.prijzen { display: flex; gap: 16px; justify-content: center; }
.prijs { width: 150px; height: 150px; display: grid; place-items: center; animation: onthul .8s cubic-bezier(.3, 1.5, .5, 1) both; }
.prijs img { width: 100%; height: 100%; }
.prijs .mini-bord { width: 120px; height: 120px; }
.knoppen-rij { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.beker-beeld { position: relative; width: 170px; height: 170px; }
.beker-beeld img { width: 100%; height: 100%; animation: onthul .8s cubic-bezier(.3, 1.5, .5, 1) both; }
.beker-beeld img.baasje { position: absolute; width: 70px; height: 70px; right: -18px; bottom: -6px; }

/* ---------- Dierenboek ---------- */
#scherm-boek { max-width: 760px; margin: 0 auto; }
.boek-kop { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 4px; position: sticky; top: 0; z-index: 3; background: var(--papier); }
.titel.klein { font-size: 26px; }
.boek { padding: 0 14px calc(30px + env(safe-area-inset-bottom)); }
.boek h2 { font-family: 'Fredoka', sans-serif; font-size: 22px; margin: 18px 0 4px; }
.boek p.zacht { margin: 0 0 8px; color: var(--inkt-zacht); font-size: 15px; }
.boek-rooster { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.boek-kaart { background: #fff; border: none; border-radius: 18px; padding: 8px 4px 6px; box-shadow: var(--schaduw); text-align: center; font-size: 13px; font-family: inherit; }
.boek-kaart img { width: 58px; height: 58px; display: block; margin: 0 auto 4px; }
.boek-kaart img.nog { filter: brightness(0) opacity(.14); }
.boek-kaart.leeg { opacity: .75; }
.boek-kaart.gekozen { box-shadow: 0 0 0 3px var(--groen), var(--schaduw); }
.ladder-knop { margin: 4px 0 12px; font-size: 20px; padding: 12px 22px; }
.ladder-label { font-size: 11px; color: var(--inkt-zacht); margin-top: 1px; }
.ladder-label.verslagen { color: var(--groen-donker); font-weight: 700; }
.ladder-label.nu { color: var(--groen-donker); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.mini-bord { display: grid; grid-template-columns: repeat(4, 1fr); width: 58px; height: 58px; margin: 0 auto 4px; border-radius: 8px; overflow: hidden; }
.boek-kaart.leeg .mini-bord { filter: grayscale(1) opacity(.35); }

/* ---------- Ouders ---------- */
.ouder { max-width: 760px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); font-size: 17px; -webkit-user-select: text; user-select: text; }
.ouder h1 { font-family: 'Fredoka', sans-serif; font-size: 30px; margin: 6px 0 12px; }
.ouder h2 { font-family: 'Fredoka', sans-serif; font-size: 22px; margin: 22px 0 8px; }
.ouder .kaart { background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: var(--schaduw); margin-bottom: 12px; }
.ouder .rij { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1eadf; }
.ouder .rij:last-child { border-bottom: none; }
.ouder label { display: flex; align-items: center; gap: 10px; }
.ouder select, .ouder input[type=text], .ouder textarea { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid #eadfcd; background: #fff; }
.ouder textarea { width: 100%; min-height: 90px; font-family: ui-monospace, monospace; font-size: 13px; }
.ouder .grote-cijfers { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ouder .grote-cijfers div { background: #fff; border-radius: 16px; padding: 12px; box-shadow: var(--schaduw); }
.ouder .grote-cijfers b { display: block; font-family: 'Fredoka', sans-serif; font-size: 30px; }
.ouder .lijst { max-height: 360px; overflow: auto; }
.ouder .lijst button { display: flex; width: 100%; text-align: left; gap: 10px; border: none; background: none; padding: 7px 4px; border-bottom: 1px solid #f4eee4; font-size: 15px; }
.ouder .lijst button.klaar { color: var(--inkt-zacht); }
.ouder .lijst button.hier { font-weight: 700; background: #fff5e6; }
.ouder .knopjes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ouder .knopjes button { border: none; border-radius: 12px; padding: 10px 14px; background: #f3ece1; font-weight: 700; }
.ouder .knopjes button.gevaar { background: #ffe1e1; color: var(--rood); }
.ouder small, .ouder .zacht { color: var(--inkt-zacht); }
.ouder a { color: var(--oranje-donker); }
.grafiek { width: 100%; height: 150px; }
.ouder .speler { flex-wrap: wrap; }
.ouder .speler-naam { display: flex; align-items: center; gap: 10px; }
.ouder .speler-naam img { width: 44px; height: 44px; }
.ouder .label-actief { font-weight: 700; color: var(--groen-donker); padding: 10px 6px; }
.ouder .nieuwe-speler { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 12px; margin-top: 8px; border-top: 1px solid #f1eadf; }
.ouder select { max-width: 100%; }
.ouder .speler.bewerkt { border-bottom: none; }
.ouder .speler.bewerkt .knopjes { display: none; }
.ouder .speler-bewerk { display: grid; gap: 10px; padding: 12px; margin: 0 -4px 10px; background: #fff8ef; border: 2px solid #f3e3cb; border-radius: 16px; animation: plop .25s; }
.ouder .speler-bewerk .veld { display: grid; gap: 4px; font-weight: 700; }
.ouder .speler-bewerk .veld input { width: 100%; font-weight: 400; }
.ouder .veld-kop { font-weight: 700; }
.ouder .knopjes button.hoofd { background: var(--oranje); color: #fff; box-shadow: 0 3px 0 var(--oranje-donker); }
.dier-keuze.klein { width: 100%; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.dier-keuze.klein .dier-knop { border-radius: 16px; padding: 6px; box-shadow: 0 2px 0 rgba(70, 45, 20, .10); border: 3px solid transparent; }
.dier-keuze .dier-knop.gekozen { border: 3px solid var(--oranje); background: #fff1e3; transform: scale(1.04); }
.ouder code { font-size: 18px; letter-spacing: 1px; background: #f7f1e8; padding: 4px 8px; border-radius: 8px; -webkit-user-select: all; user-select: all; }
.ouder .kaart > input[type=text] { width: 100%; }

/* ---------- Animaties ---------- */
@keyframes plop { 0% { transform: scale(.6); opacity: 0 } 70% { transform: scale(1.08); opacity: 1 } 100% { transform: scale(1) } }
@keyframes schud { 0%, 100% { transform: translateX(0) } 20%, 60% { transform: translateX(-7px) } 40%, 80% { transform: translateX(7px) } }
@keyframes flits { 0% { opacity: 1 } 100% { opacity: 0 } }
@keyframes weg { to { scale: .3; opacity: 0 } }
@keyframes bots { 0%, 100% { filter: none } 30% { filter: drop-shadow(0 0 8px red) } }
@keyframes wiebel { 0%, 100% { transform: rotate(-6deg) } 50% { transform: rotate(6deg) } }
@keyframes gepakt { 0% { opacity: 1 } 40% { opacity: 1; scale: 1.5 } 100% { opacity: 0; scale: .2 } }
@keyframes ster { 0% { transform: scale(0) rotate(-40deg) } 100% { transform: scale(1) rotate(0) } }
@keyframes onthul { 0% { transform: scale(0) rotate(-30deg) } 100% { transform: scale(1) rotate(0) } }
@keyframes draai { to { transform: rotate(360deg) } }
.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: val linear forwards; }
@keyframes val { to { transform: translateY(110vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.les-code { position: absolute; top: 4px; right: 10px; font-size: 11px; color: rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; pointer-events: none; }
.les-kop { position: relative; }

/* Eerste keer: waar begin je? */
.dier-keuze.begin-keuze { display: flex; flex-direction: column; gap: 10px; width: min(420px, 92vw); }
.begin-knop { font-size: 19px; min-height: 52px; padding: 10px 18px; text-align: left; }

/* Apparaten koppelen: QR-code en scannen met de camera */
.qr-vak { width: min(240px, 70vw); margin: 10px auto; background: #fff; border-radius: 12px; padding: 6px; }
.qr-vak svg { width: 100%; height: auto; display: block; }
.knop-link { display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 12px; background: #fff; box-shadow: var(--schaduw); color: var(--inkt); text-decoration: none; font-weight: 600; }
.scan-laag { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 16, 24, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; color: #fff; text-align: center; }
.scan-laag video { width: min(420px, 90vw); aspect-ratio: 1; object-fit: cover; border-radius: 18px; border: 4px solid rgba(255, 255, 255, .8); }
