:root {
  --ink: #263238;
  --muted: #607d8b;
  --paper: #ffffff;
  --sky: #e3f2fd;
  --cream: #fffaf0;
  --green: #43a047;
  --green-d: #2e7d32;
  --orange: #fb8c00;
  --red: #e53935;
  --blue: #1e88e5;
  --yellow: #fdd835;
  --purple: #8e24aa;
  --line: #cfd8dc;
  --radius: 20px;
  --shadow: 0 4px 0 rgba(38, 50, 56, .12), 0 6px 18px rgba(38, 50, 56, .08);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: "Andika", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  font-size: 19px;
  color: var(--ink);
  background: var(--cream);
  -webkit-user-select: none;
  user-select: none;
}
input, select { user-select: text; -webkit-user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible { outline: 4px solid #90caf9; outline-offset: 2px; }

#app { min-height: 100vh; min-height: 100dvh; padding: 12px 16px 140px; }
#app.bg-home { background: linear-gradient(180deg, #e1f5fe 0%, #fffde7 70%, #fff8e1 100%); }
#app.bg-book { background: linear-gradient(180deg, #f3e5f5 0%, #fffaf0 40%); }
#app.bg-play { background: linear-gradient(180deg, #e8f5e9 0%, #fffaf0 35%); }

.page, .play { max-width: 860px; margin: 0 auto; }
.center { text-align: center; }
h1, h2 { margin: .4em 0; line-height: 1.15; }
h2 { font-size: 24px; }
.lead { font-size: 21px; max-width: 560px; margin: 8px auto 14px; }
.note { color: var(--muted); font-size: 16px; line-height: 1.45; }
.note.fine { font-size: 13px; max-width: 520px; margin: 28px auto 0; }
.sponsor { text-align: center; font-size: 15px; color: var(--muted); margin: 18px 0 0; }
.sponsor a { color: var(--blue); font-weight: 700; text-decoration: none; }
.sponsor .ver { white-space: nowrap; }
.updbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; width: calc(100% - 32px); max-width: 520px;
  display: flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); border: 3px solid var(--blue); border-radius: 16px;
  padding: 8px 8px 8px 14px; box-shadow: var(--shadow); font-size: 16px; }
.updbar span { flex: 1; }
.parents .sponsor { text-align: left; }
.row { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 14px; }
.row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 18px; }

/* ---------- Knoppies ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; font-weight: 700; font-size: 21px;
  background: var(--paper); box-shadow: var(--shadow); transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(38, 50, 56, .15); }
.btn.go { background: var(--green); color: #fff; }
.btn.big { font-size: 26px; padding: 16px 40px; margin-top: 18px; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.ghost { background: transparent; box-shadow: none; border: 3px solid var(--line); }
.btn.small { font-size: 16px; padding: 8px 16px; }
.btn.danger { color: var(--red); }
.btn.review { background: #fff3e0; }
.icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow);
  font-size: 24px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
span.icon { background: none; box-shadow: none; }

/* ---------- Kopstrook ---------- */
.hbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.hbar h1 { font-size: 28px; margin: 0; }
.me { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; background: var(--paper); padding: 6px 16px 6px 6px; border-radius: 999px; box-shadow: var(--shadow); }
.me .av { font-size: 30px; }
.total { font-weight: 700; font-size: 22px; background: #fff8e1; padding: 6px 14px; border-radius: 999px; }

.logo { font-size: clamp(40px, 9vw, 64px); margin-top: 24px; letter-spacing: 1px; }
.logo { background: linear-gradient(90deg, var(--red), var(--orange), #f9a825, var(--green), var(--blue), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo span { display: inline-block; font-size: .45em; color: #fff; background: var(--blue); -webkit-text-fill-color: #fff; padding: 4px 14px; border-radius: 12px; vertical-align: middle; }

.strip { display: flex; justify-content: center; gap: clamp(6px, 2.4vw, 22px); margin: 36px auto 0; font-size: clamp(24px, 6vw, 38px); font-weight: 700; }

/* ---------- Spelers ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 18px; }
.person { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 22px; }
.person .av { font-size: 64px; line-height: 1; }
.person small { color: #f9a825; font-size: 18px; }
.person.add { background: transparent; border: 3px dashed var(--line); box-shadow: none; color: var(--muted); }
.namein { font-size: 28px; padding: 12px 18px; border-radius: 16px; border: 3px solid var(--line); width: min(360px, 100%); text-align: center; background: #fff; }
.namein.short { width: 110px; }
.avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 560px; margin: 0 auto; }
.avpick { font-size: 40px; width: 64px; height: 64px; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow); }
.avpick.on { outline: 5px solid var(--green); }

/* ---------- Tuis ---------- */
.hello { font-size: clamp(30px, 6vw, 42px); margin: 14px 0; }
.nextbtn {
  width: 100%; display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--paper); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); border: 4px solid var(--c);
}
.nextbtn .nb { flex: none; width: 76px; height: 76px; border-radius: 50%; background: var(--c); color: #fff; font-size: 32px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nextbtn .nt { flex: 1; font-size: 24px; font-weight: 700; line-height: 1.2; }
.nextbtn .nt small { display: block; font-size: 16px; color: var(--muted); font-weight: 400; }
.nextbtn .play { font-size: 40px; color: var(--c); }
.books { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.bookcard { border-radius: 24px; padding: 18px; color: #fff; text-align: left; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.bookcard.b1 { background: linear-gradient(135deg, #e53935, #fb8c00); }
.bookcard.b2 { background: linear-gradient(135deg, #43a047, #1e88e5); }
.bookcard .bk { font-size: 34px; font-weight: 700; }
.bookcard .bt { font-size: 20px; font-weight: 700; }
.bookcard .bw, .bookcard .bs { font-size: 16px; opacity: .95; }
.bar { display: block; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .35); overflow: hidden; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: #fff; border-radius: 99px; }

/* ---------- Boek ---------- */
.tabs { display: flex; gap: 10px; margin: 8px 0 16px; }
.tab { flex: 1; padding: 12px; border-radius: 16px; font-weight: 700; font-size: 20px; background: var(--paper); border: 3px solid var(--c); color: var(--c); }
.tab.on { background: var(--c); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; border-top: 8px solid var(--c); min-height: 170px; }
.tile .tnum { width: 54px; height: 54px; border-radius: 50%; background: var(--c); color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tile .ttitle { font-size: 15px; line-height: 1.25; text-align: center; flex: 1; }
.st { color: #fbc02d; font-size: 22px; letter-spacing: 2px; }
.st i { color: #e0e0e0; font-style: normal; }

.bigbadge { width: 130px; height: 130px; border-radius: 50%; background: var(--c); color: #fff; font-size: 52px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 10px auto 0; box-shadow: var(--shadow); }
.wtitle { font-size: clamp(28px, 6vw, 40px); }
.meta { color: var(--muted); margin: 0; }
.skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0; }
.skills span { background: #ede7f6; border-radius: 999px; padding: 6px 14px; font-size: 16px; }
.best { font-size: 20px; }

/* ---------- Speel ---------- */
.topbar { display: flex; align-items: center; gap: 10px; }
.dots { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: #cfd8dc; }
.dots i.extra { width: 11px; height: 11px; margin-top: 2px; }
.dots i.now { background: var(--blue); box-shadow: 0 0 0 4px #bbdefb; }
.dots i.good { background: var(--green); }
.dots i.help { background: var(--orange); }
.wsline { margin: 12px auto 0; width: fit-content; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; color: var(--muted); background: #fff; padding: 4px 12px 4px 4px; border-radius: 999px; }
.wsline b { display: inline-block; min-width: 28px; padding: 0 6px; text-align: center; border-radius: 99px; background: var(--c); color: #fff; margin-right: 4px; }
.prompt { font-size: clamp(23px, 4.6vw, 32px); font-weight: 700; text-align: center; margin: 14px auto 10px; max-width: 720px; line-height: 1.25; }
.visual { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0; }
.answer { margin-top: 12px; display: flex; flex-direction: column; align-items: center; }

svg.vis { max-width: 100%; height: auto; display: block; }
svg.shape { width: 140px; }
svg.solid { width: 90px; }

.objs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; max-width: 560px; }
.objs.rows { flex-direction: column; gap: 4px; }
.orow { display: flex; gap: 8px; }
.objs .o { display: inline-block; line-height: 1.1; position: relative; }
.objs.xl .o { font-size: 64px; }
.objs.lg .o { font-size: 50px; }
.objs.md .o { font-size: 40px; }
.objs.sm .o { font-size: 30px; }
.objs.line { flex-wrap: wrap; }
.o.crossed { opacity: .45; }
.o.crossed::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 5px; background: var(--red); border-radius: 3px; transform: rotate(-35deg); }
.o.ringed { background: #fff59d; border-radius: 10px; }
.groups { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 640px; }
.grp { border: 3px dashed #64b5f6; border-radius: 22px; padding: 6px 10px; display: flex; gap: 4px; font-size: 36px; background: #fff; }
.groups.sm .grp { font-size: 28px; }
.grp.loose { border-color: transparent; background: none; }
.twobox { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 640px; }
.box { background: #fff; border-radius: 18px; padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 120px; }
.boxlbl { font-size: 15px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.seq { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.seq span { min-width: 64px; height: 64px; padding: 0 8px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.seq span.q, .pat .q { background: #fff59d; border: 3px dashed var(--orange); }
.seq.emo span { font-size: 44px; min-width: 78px; height: 78px; }
.bigword { font-size: clamp(48px, 12vw, 76px); font-weight: 700; color: var(--purple); }
.bignum { font-size: clamp(80px, 22vw, 130px); font-weight: 700; color: var(--blue); line-height: 1; }
.wpic { font-size: 96px; line-height: 1.1; }
.cal { font-size: 72px; }
.steps { font-size: 24px; font-weight: 700; background: #fff8e1; border-radius: 14px; padding: 8px 16px; }
.sum { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.sum > b { font-size: 48px; color: var(--orange); }
.kids { font-size: 46px; letter-spacing: 6px; }
.caption { font-size: 15px; color: var(--muted); }
.halves .objs { padding: 8px; border-radius: 16px; background: #fff; }
.pv { display: flex; gap: 16px; align-items: flex-start; }
.pvcol { background: #fff; border-radius: 16px; padding: 8px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; }
.pvten svg { width: 300px; }
.ngrid { border-collapse: collapse; background: #fff; box-shadow: var(--shadow); }
.ngrid td { border: 1.5px solid #b0bec5; width: clamp(28px, 8vw, 46px); height: clamp(26px, 6.5vw, 38px); text-align: center; font-size: clamp(13px, 3.4vw, 18px); font-weight: 700; }
.ngrid td.hl { background: #c5e1a5; }
.ngrid td.q { background: #fff59d; color: var(--orange); }
.pgtitle { font-weight: 700; font-size: 18px; }
.pgraph { border-collapse: separate; border-spacing: 0 6px; }
.pgraph th { text-align: left; font-size: 34px; padding-right: 10px; white-space: nowrap; }
.pgraph th small { font-size: 15px; margin-left: 6px; color: var(--muted); vertical-align: middle; }
.pgraph td { background: #fff; border-radius: 12px; padding: 2px 8px; font-size: 28px; letter-spacing: 2px; min-width: 160px; }
.stage { position: relative; width: min(100%, 420px); background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.stage span { position: absolute; transform: translate(-50%, -50%); line-height: 1; }
.erow { display: flex; gap: 10px; justify-content: center; }
.erow span { font-size: clamp(38px, 10vw, 58px); line-height: 1.1; border-radius: 12px; }
.erow.spaced { gap: 0; width: min(100%, 320px); justify-content: space-around; }
.erow span.mark { background: #fff59d; outline: 3px dashed var(--orange); }
.queue { display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 14px; border-radius: 18px; box-shadow: var(--shadow); }
.queue .front { font-weight: 700; color: var(--red); font-size: 18px; }
.queue .front.flag { font-size: 40px; }
.queue .front:only-child, .queue .front { white-space: nowrap; }
table.grid { border-collapse: collapse; background: #fff; }
table.grid td { width: 54px; height: 54px; border: 2px solid #b0bec5; text-align: center; font-size: 36px; }
.pat { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; }
.pat svg.shape { width: 62px; }
.pat .q { width: 62px; height: 62px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; }
.emo { font-size: 56px; line-height: 1.1; }
.emo.sm { font-size: 44px; }
.symq { display: flex; align-items: center; }
.symblank { width: 98px; height: 128px; border: 3px dashed var(--line); border-left: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--muted); background: #fff; }
.symline { position: relative; display: inline-block; }
.symline::after { content: ""; position: absolute; top: -6px; bottom: -6px; left: 50%; border-left: 4px dashed var(--red); }
.symline .wpic { font-size: 120px; }
.shop { display: flex; align-items: center; gap: 10px; }
.tag { display: inline-block; background: var(--yellow); border-radius: 8px; padding: 2px 10px; font-weight: 700; font-size: 20px; }

/* ---------- Antwoorde ---------- */
.choices { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; width: 100%; }
.ch { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); font-weight: 700; transition: transform .1s; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ch:active { transform: scale(.96); }
.choices.nums .ch, .choices.big .ch { width: 100px; height: 100px; font-size: 46px; }
.choices.big .ch { width: 120px; height: 120px; font-size: 54px; }
.choices.words .ch { min-width: 150px; padding: 16px 22px; font-size: 25px; }
.choices.pics .ch { min-width: 120px; min-height: 120px; padding: 10px 12px; }
.choices.pics .ch small { font-size: 15px; font-weight: 400; margin-top: 4px; max-width: 140px; }
.choices.pics svg.shape { width: 100px; }
.choices.pics svg.glass { width: 80px; }
.choices.pics .objs.sm .o { font-size: 32px; }
.choices.stack { flex-direction: column; align-items: stretch; max-width: 560px; }
.choices.stack .ch { padding: 10px 14px; align-items: flex-start; }
.ch.right { background: #c8e6c9; box-shadow: 0 0 0 5px var(--green); animation: pop .35s; }
.ch.wrong { background: #ffebee; opacity: .55; animation: shake .4s; }
.chwrap { position: relative; }
.sayopt { position: absolute; top: -10px; right: -10px; width: 36px; height: 36px; border-radius: 50%; background: #e3f2fd; font-size: 17px; box-shadow: var(--shadow); }

.numin { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.display { min-width: 170px; height: 84px; padding: 0 18px; border-radius: 18px; background: #fff; border: 4px solid #90caf9; font-size: 54px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.display .cur { color: #b0bec5; }
.display.wrong { border-color: var(--orange); animation: shake .4s; }
.display.right { border-color: var(--green); background: #e8f5e9; }
.pad { display: grid; grid-template-columns: repeat(3, 78px); gap: 10px; }
.pad button { height: 70px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font-size: 34px; font-weight: 700; }
.pad .ok { background: var(--green); color: #fff; }
.pad .del { background: #fff3e0; }

.colgrid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 520px; margin-bottom: 14px; }
.cshape { width: 72px; height: 72px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.cshape svg.shape { width: 62px; }

.slots, .pool { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.slots { margin-bottom: 18px; }
.slot { width: 84px; height: 84px; border-radius: 16px; border: 3px dashed #90a4ae; font-size: 22px; color: #b0bec5; background: rgba(255, 255, 255, .6); }
.slot.full { border-style: solid; border-color: var(--blue); color: var(--ink); background: #fff; font-size: 38px; font-weight: 700; }
.slot.right { border-color: var(--green); background: #e8f5e9; }
.ptile { width: 84px; height: 84px; border-radius: 16px; background: #fff3e0; box-shadow: var(--shadow); font-size: 38px; font-weight: 700; }
.slots.emo .slot.full, .pool.emo .ptile { font-size: 46px; }

.tracehost { width: 100%; display: flex; justify-content: center; }
.tracebox { position: relative; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.tracebox canvas { position: absolute; left: 0; top: 0; border-radius: 20px; }
.tracebox canvas.tguide { position: relative; display: block; }
.tdraw { touch-action: none; }

/* ---------- Terugvoer ---------- */
.feedback { position: fixed; left: 0; right: 0; bottom: 0; transform: translateY(110%); transition: transform .25s ease-out; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.feedback.show { transform: translateY(0); }
.fbin { max-width: 860px; margin: 0 auto; padding: 18px 20px; font-size: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: center; text-align: center; }
.feedback.good { background: #c8e6c9; color: var(--green-d); font-weight: 700; font-size: 26px; }
.feedback.good .big { font-size: 36px; }
.feedback.good .done { display: inline-block; margin-top: 4px; font-size: 20px; font-weight: 600; }
.feedback.retry { background: #ffe0b2; }
.feedback.reveal { background: #e3f2fd; }
.feedback.reveal .btn { margin-left: auto; }

/* ---------- Resultate ---------- */
.results h1 { font-size: clamp(28px, 6vw, 40px); }
.bigstars { margin-top: 30px; }
.bigstars span { font-size: clamp(70px, 18vw, 110px); color: #e0e0e0; display: inline-block; }
.bigstars span.on { color: #fbc02d; animation: starpop .6s both; text-shadow: 0 4px 0 #f57f17; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -40px; font-size: 28px; font-style: normal; animation: fall 2.6s ease-in forwards; }

/* ---------- Ouerhoek ---------- */
.parents section { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 14px 18px; margin: 14px 0; }
.ptable { width: 100%; border-collapse: collapse; font-size: 17px; }
.ptable td { padding: 6px 4px; vertical-align: middle; border-bottom: 1px solid #eceff1; }
.ptable td:first-child { width: 34%; }
.ptable td:nth-child(2) { width: 36%; }
.ptable .bar { background: #eceff1; }
.ptable small { color: var(--muted); }
.flag { display: inline-block; font-size: 13px; background: #ffe0b2; color: #e65100; border-radius: 99px; padding: 1px 8px; }
.flag.ok { background: #c8e6c9; color: var(--green-d); }
.weak { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fafafa; border-left: 6px solid var(--c); border-radius: 12px; padding: 8px 12px; font-size: 16px; text-align: left; box-shadow: var(--shadow); }
.chip .st { font-size: 15px; }
.set { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 18px; }
.set input[type=checkbox] { width: 24px; height: 24px; flex: none; }
.set select { font-size: 18px; padding: 4px 8px; border-radius: 8px; }
.gateq { font-size: 34px; font-weight: 700; }

.modal { position: fixed; inset: 0; background: rgba(38, 50, 56, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.mbox { background: #fff; border-radius: 24px; padding: 22px; max-width: 420px; text-align: center; font-size: 22px; font-weight: 700; }

/* ---------- Animasies ---------- */
.shake { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes pop { 50% { transform: scale(1.12); } }
@keyframes starpop { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Klein skerms ---------- */
@media (max-width: 560px) {
  body { font-size: 17px; }
  #app { padding: 10px 16px 150px; }
  .books { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { min-height: 150px; }
  .choices.nums .ch { width: 84px; height: 84px; font-size: 40px; }
  .choices.big .ch { width: 100px; height: 100px; }
  .choices.words .ch { min-width: 120px; font-size: 22px; padding: 14px 16px; }
  .choices.pics .ch { min-width: 96px; min-height: 96px; }
  .pad { grid-template-columns: repeat(3, 70px); }
  .pad button { height: 62px; }
  .objs.xl .o { font-size: 52px; }
  .objs.lg .o { font-size: 42px; }
  .objs.md .o { font-size: 34px; }
  .grp { font-size: 28px; }
  .twobox { gap: 8px; }
  .pvten svg { width: 200px; }
  .pgraph td { min-width: 0; font-size: 22px; }
  .slot, .ptile { width: 70px; height: 70px; }
}

/* ---------- Juffrou Padda (tutor) ---------- */
.helprow { display: flex; justify-content: center; margin: -4px 0 6px; }
.helpbtn { background: #fff8e1; border: 2px solid #ffca28; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 17px; }
.btn.learn { margin-top: 12px; background: #e8f5e9; }
.tutor-ov { position: fixed; inset: 0; z-index: 60; background: rgba(38, 50, 56, .5); display: flex; align-items: center; justify-content: center; padding: 10px; }
.tutor { background: var(--cream); border-radius: 26px; width: min(760px, 100%); max-height: 100%; overflow: auto; padding: 12px 14px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: 10px; }
.thead { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.thead .padda { font-size: 40px; }
.thead b { flex: 1; }
.tbubble { position: relative; background: #fff; border: 3px solid #81c784; border-radius: 20px; padding: 12px 16px; font-size: clamp(20px, 4.4vw, 26px); font-weight: 700; text-align: center; min-height: 64px; }
.tvis { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; gap: 8px; }
/* Die getallesin onder die prentjie: '?' terwyl ons werk, groen en ingevul op die laaste raam */
.tvis .steps { font-size: 26px; text-align: center; max-width: 100%; overflow-wrap: anywhere; }
.tvis .steps.done { background: #e8f5e9; color: var(--green-d); box-shadow: 0 0 0 3px #a5d6a7 inset; }
.tdots { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.tdots i { width: 9px; height: 9px; border-radius: 50%; background: #cfd8dc; }
.tdots i.done { background: #81c784; }
.tdots i.now { background: var(--green); transform: scale(1.3); }
.tctrl { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.objs.counted .o { position: relative; }
.objs .o .badge { position: absolute; top: -6px; right: -10px; background: var(--blue); color: #fff; font-size: 14px; line-height: 20px; min-width: 22px; padding: 0 5px; border-radius: 999px; text-align: center; font-style: normal; }
.objs .o.cur { transform: scale(1.18); filter: drop-shadow(0 0 6px #ffca28); }
.pairs { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 10px; }
.prow, .plinks { display: flex; gap: 6px; }
.pc { width: 46px; height: 46px; font-size: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.pc.extra { background: #fff59d; outline: 3px dashed var(--orange); }
.plinks i { width: 46px; height: 14px; display: flex; justify-content: center; }
.plinks i::after { content: ""; width: 3px; height: 14px; background: #90a4ae; }
.pile { min-height: 46px; display: flex; justify-content: center; }
.kidsrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kidbox { background: #fff; border-radius: 16px; padding: 6px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; min-width: 76px; }
.kidbox .kid { font-size: 34px; }
.kidgot { font-size: 24px; max-width: 150px; text-align: center; min-height: 30px; }
.parents h3 { font-size: 18px; margin: 14px 0 6px; }
.roots, .misl { margin: 0; padding-left: 20px; font-size: 17px; }
.roots li, .misl li { margin: 6px 0; }
.smap { display: flex; flex-direction: column; gap: 10px; }
.sgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 15px; }
.sgroup b { width: 100%; }
.snode { border-radius: 999px; padding: 3px 10px; background: #eceff1; color: var(--muted); }
.snode.green { background: #c8e6c9; color: #1b5e20; }
.snode.orange { background: #ffe0b2; color: #e65100; }
.snode.red { background: #ffcdd2; color: #b71c1c; font-weight: 700; }

/* ---------- Installeer die app? ---------- */
.installbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; text-align: left; background: #e3f2fd; border: 2px solid #90caf9; border-radius: 18px; padding: 12px 14px; margin: 18px auto 0; max-width: 560px; }
.installbar.ok { background: #e8f5e9; border-color: #a5d6a7; }
.installbar .ib-ic { font-size: 30px; line-height: 1; }
.installbar .ib-t { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; font-size: 18px; }
.installbar .ib-t small { font-size: 15px; color: var(--muted); line-height: 1.35; }
.installbar .ib-b { display: flex; gap: 8px; margin-left: auto; }
.installbar .btn.ghost { border-width: 2px; }
.shareic { vertical-align: -3px; color: var(--blue); }
.muted { color: var(--muted); }

/* ---------- Help om die app te verbeter ---------- */
.wsrow { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 12px auto 0; max-width: 100%; }
.wsrow .wsline { margin: 0; min-width: 0; }
.wsnote { flex: none; border: 0; background: #fff; border-radius: 999px; width: 34px; height: 30px; font-size: 16px; opacity: .75; cursor: pointer; }
.wsnote:active { opacity: 1; }
.notebox { max-width: 520px; width: 100%; text-align: left; font-size: 17px; font-weight: 400; max-height: calc(100vh - 32px); overflow-y: auto; }
.notebox h2 { margin: 0 0 6px; font-size: 22px; }
.notebox .nb-lead { margin: 0 0 10px; line-height: 1.4; }
.notebox .nb-q { margin: 0 0 10px; font-size: 15px; color: var(--muted); background: var(--sky); border-radius: 12px; padding: 8px 10px; }
.notebox textarea { width: 100%; font: inherit; font-size: 18px; padding: 10px 12px; border-radius: 14px; border: 3px solid var(--line); resize: vertical; background: #fff; color: var(--ink); }
.notebox textarea:focus { outline: none; border-color: var(--blue); }
.notebox .privacy { font-size: 15px; line-height: 1.4; background: #fff8e1; border: 2px solid #ffe082; border-radius: 12px; padding: 8px 10px; margin: 10px 0 0; }
.notebox .nb-warn { font-size: 15px; color: #b71c1c; background: #ffebee; border-radius: 12px; padding: 8px 10px; margin: 10px 0 0; }
.notebox .row { justify-content: flex-end; }
.notebox .nb-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.notebox .nb-opt { font: inherit; font-size: 16px; padding: 6px 14px; border-radius: 999px; border: 3px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.notebox .nb-opt[aria-pressed="true"] { border-color: var(--blue); background: var(--sky); font-weight: 700; }
.notebox .nb-ref { display: block; margin: 0 0 10px; font-size: 15px; }
.notebox .nb-ref input { display: block; width: 100%; font: inherit; font-size: 17px; padding: 8px 12px; margin-top: 4px; border-radius: 12px; border: 3px solid var(--line); background: #fff; color: var(--ink); }
.notebox .nb-ref input:focus { outline: none; border-color: var(--blue); }
