:root {
  --sun: #ffd23f;
  --orange: #ff9326;
  --leaf: #7fcf4f;
  --forest: #1f7a45;
  --ink: #2a3b2f;
  --bg: #f5fbff;
  --card: #ffffff;
  --radius: 24px;
  --font: ui-rounded, "Nunito", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 18px; line-height: 1.55;
}
main { outline: none; min-height: 70vh; padding: 0 16px 40px; max-width: 1040px; margin: 0 auto; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
a { color: inherit; }
.small { font-size: .85rem; opacity: .75; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; border-radius: 8px; }

:focus-visible { outline: 4px solid #3b82f6; outline-offset: 3px; border-radius: 12px; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1040px; margin: 0 auto; padding: 14px 16px;
}
.logo { text-decoration: none; font-weight: 900; font-size: 1.7rem; letter-spacing: .5px; display: flex; gap: 8px; align-items: baseline; }
.logo-n { color: #6cb83a; }
.logo-amp { color: var(--orange); font-size: 1.3rem; }
.logo-t { color: var(--forest); }
.site-header nav { display: flex; gap: 8px; }
.site-header nav a { text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.site-header nav a:hover { background: #e4f6d6; }

.site-footer { text-align: center; padding: 24px 16px 40px; opacity: .8; }
.site-footer p { margin: 2px 0; }

/* ---------- knoppen ---------- */
.btn, .round, .option, .goal, .item, .tap, .mode button {
  font: inherit; cursor: pointer; border: 0; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  background: var(--leaf); color: #12361f; font-weight: 800; padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 5px 0 #56a22e; transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #56a22e; }
.btn.alt { background: var(--sun); box-shadow: 0 5px 0 #d9a91a; }
.btn.alt:active { box-shadow: 0 2px 0 #d9a91a; }
.btn.ghost { background: #fff; box-shadow: 0 3px 0 #d6e3d0; padding: 8px 16px; }
.btn.big { font-size: 1.25rem; padding: 16px 30px; }

/* ---------- startpagina ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; padding: 8px 0 28px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.c-n { color: #6cb83a; } .c-t { color: var(--forest); }
.lead { font-size: 1.15rem; margin: 0 0 22px; }

.sky {
  position: relative; border-radius: 36px; overflow: hidden;
  background: linear-gradient(#9fdcff, #e6f7ff 75%, #d6f2b8 75.1%);
  box-shadow: 0 10px 0 rgba(0,0,0,.06);
}
.hero-birds { position: relative; padding: 12px 12px 0; }
.hero-birds svg, .birds svg { width: 100%; height: auto; display: block; overflow: visible; }
.hero-scene .hint { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; margin: 0; font-size: .85rem; font-weight: 700; opacity: .65; }
.sun { position: absolute; top: 18px; right: 22px; width: 56px; height: 56px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 10px rgba(255, 210, 63, .3); }
.cloud { position: absolute; background: #fff; border-radius: 999px; height: 26px; width: 80px; opacity: .9; animation: drift 40s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 34px; height: 34px; left: 12px; top: -16px; }
.cloud::after { width: 44px; height: 44px; left: 34px; top: -22px; }
.cloud.c1 { top: 30px; left: -100px; }
.cloud.c2 { top: 80px; left: -250px; transform: scale(.7); animation-duration: 55s; animation-delay: -20s; }
@keyframes drift { to { transform: translateX(700px); } }
.cloud.c2 { animation-name: drift2; }
@keyframes drift2 { to { transform: translateX(800px) scale(.7); } }

.stories h2 { font-size: 1.8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.story-card {
  background: var(--card); border-radius: var(--radius); padding: 22px; border-top: 10px solid var(--c);
  box-shadow: 0 6px 0 rgba(0,0,0,.06); display: flex; flex-direction: column;
  transition: transform .15s;
}
.story-card:hover { transform: translateY(-4px) rotate(-.4deg); }
.story-card h3 { font-size: 1.3rem; }
.story-card p { margin: 0 0 8px; }
.story-card .meta { font-size: .85rem; opacity: .7; }
.story-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.story-card .btn { padding: 10px 16px; font-size: .95rem; }
.story-emoji { font-size: 3rem; margin-bottom: 4px; }

/* ---------- ouders ---------- */
.plain { max-width: 680px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px 24px; box-shadow: 0 6px 0 rgba(0,0,0,.06); margin-bottom: 18px; }
.plain .card h2 { font-size: 1.3rem; }

/* ---------- verhaal ---------- */
.reader { max-width: 760px; margin: 0 auto; }
.reader-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mode { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: 0 3px 0 #d6e3d0; }
.mode button { background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 800; }
.mode button[aria-pressed="true"] { background: var(--c); }
.story-title { font-size: clamp(1.5rem, 4vw, 2.2rem); text-align: center; margin: 10px 0; }

.stage {
  position: relative; border-radius: 32px; overflow: hidden; min-height: 250px;
  background: linear-gradient(var(--sky1), var(--sky2));
  box-shadow: 0 8px 0 rgba(0,0,0,.07);
}
.items { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 76px; padding: 14px 14px 0; position: relative; z-index: 2; }
.item {
  font-size: 2.6rem; line-height: 1; background: rgba(255,255,255,.55); border-radius: 22px; padding: 8px 14px;
  animation: pop-in .5s both; animation-delay: var(--d, 0s);
}
.item:hover { background: rgba(255,255,255,.85); }
.birds { margin-top: -30px; padding: 0 8px; }

.textcard { margin-top: 18px; padding: 22px 26px; }
.text { font-size: clamp(1.25rem, 3.4vw, 1.65rem); line-height: 1.6; font-weight: 600; }
.s { border-radius: 8px; padding: 1px 3px; transition: background .2s; }
.s.reading { background: #fff0a8; }
.end-title { font-size: 2rem; }
.tap {
  background: #fff0a8; border-radius: 10px; padding: 0 8px; font-weight: 800; color: #8a4b00;
  border-bottom: 3px dashed #ffb347; font-size: inherit;
}
.tap:hover { background: #ffe36b; }

.interact { margin-top: 12px; }
.q { font-weight: 800; font-size: 1.2rem; color: var(--forest); margin: 4px 0 10px; }
.options { display: flex; flex-wrap: wrap; gap: 12px; }
.option {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  background: #f1f8ea; border-radius: 22px; padding: 14px 18px; min-width: 110px; font-weight: 800;
  box-shadow: 0 5px 0 #cfe3c0; transition: transform .1s;
}
.option:hover { transform: translateY(-3px); }
.option .oe { font-size: 2.2rem; line-height: 1.1; }
.option.right { background: #c9f0a8; box-shadow: 0 5px 0 #8fd45c; }
.option.wrong { background: #ffe0d6; box-shadow: 0 5px 0 #f0b3a0; }
.option.dim { opacity: .45; }
.reply { margin: 14px 0 0; font-size: 1.2rem; font-weight: 700; padding: 10px 14px; border-radius: 16px; background: #fff7d6; }

.goal {
  display: block; margin: 8px auto; font-size: 5rem; line-height: 1; background: #e8f6ff; border-radius: 50%;
  width: 150px; height: 150px; box-shadow: 0 8px 0 #bfe0f3; transition: transform .1s;
}
.goal:hover { transform: scale(1.05); }
.goal:disabled { opacity: .8; cursor: default; }
.pips { display: flex; gap: 10px; justify-content: center; margin: 12px 0 4px; }
.pips span { width: 20px; height: 20px; border-radius: 50%; background: #dfe9d8; transition: transform .2s, background .2s; }
.pips span.on { background: var(--sun); transform: scale(1.25); }

.listen-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.listen-bar .btn { background: var(--sun); box-shadow: 0 5px 0 #d9a91a; font-size: 1.1rem; padding: 14px 26px; }
.voice-pick { display: flex; gap: 8px; align-items: center; font-size: .9rem; font-weight: 700; }
.voice-pick select { font: inherit; padding: 6px 8px; border-radius: 10px; border: 2px solid #cfe3c0; max-width: 220px; }
.notice { background: #fff3cd; border-radius: 14px; padding: 10px 14px; margin: 12px 0 0; font-size: .95rem; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.round {
  width: 68px; height: 68px; border-radius: 50%; font-size: 1.6rem; font-weight: 900; background: var(--leaf);
  color: #12361f; box-shadow: 0 6px 0 #56a22e; transition: transform .1s;
}
.round:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 3px 0 #56a22e; }
.round:disabled { background: #dfe9d8; box-shadow: 0 6px 0 #c4d3bb; color: #9bb08f; cursor: default; }
.round.pulse { animation: pulse 1.4s ease-in-out infinite; }
.dots { display: flex; gap: 8px; justify-content: center; flex: 1; flex-wrap: wrap; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: #d3e4c8; }
.dots span.past { background: #9fd877; }
.dots span.on { background: var(--orange); transform: scale(1.35); }

.reader.dark .stage { box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.reader.dark .items .item { background: rgba(255,255,255,.2); }

/* ---------- animaties ---------- */
.boing { animation: boing .45s; }
@keyframes boing { 0% { transform: scale(1); } 30% { transform: scale(1.25) rotate(-6deg); } 60% { transform: scale(.92) rotate(4deg); } 100% { transform: scale(1); } }
@keyframes pop-in { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

@media (max-width: 760px) {
  body { font-size: 17px; }
  .hero { grid-template-columns: 1fr; }
  .hero-scene { order: -1; }
  .round { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- personages ---------- */
.char { display: block; width: 100%; height: auto; overflow: visible; animation: idle 3.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.char .vw { transform: rotate(-52deg); }
.char .ws { transform: rotate(-42deg); }
.char .pupil { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; animation-delay: var(--d, 0s); }
@keyframes idle { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-1.5deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

.meet { margin-top: 40px; }
.meet h2 { font-size: 1.8rem; margin-bottom: .2em; }
.hint-line { margin: 0 0 16px; opacity: .75; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.char-card {
  position: relative; font: inherit; color: inherit; cursor: pointer; border: 0; text-align: center;
  background: var(--card); border-radius: var(--radius); padding: 18px 14px 16px; box-shadow: 0 6px 0 rgba(0,0,0,.06);
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .15s;
}
.char-card:hover { transform: translateY(-4px); }
.char-card strong { font-size: 1.2rem; }
.char-card .desc { font-size: .9rem; opacity: .8; line-height: 1.35; }
.char-wrap { display: block; width: 130px; }
.bubble {
  font-style: normal; font-weight: 800; font-size: .95rem; background: #fff7d6; border-radius: 16px; padding: 8px 12px;
  margin-top: 6px; box-shadow: 0 3px 0 #f0e2a8; animation: pop-in .3s both;
}

.cast { display: flex; justify-content: center; align-items: flex-end; gap: 6px; flex-wrap: wrap; padding: 0 10px; position: relative; z-index: 2; }
.cast[hidden] { display: none; }
.cast-char { background: transparent; border: 0; font: inherit; color: inherit; cursor: pointer; width: 92px; text-align: center; padding: 0; }
.cast-char .char { width: 92px; }
.cast-char.flip .char { transform: scaleX(-1); animation: none; }
.cast-char.flip { transform-origin: center; }
.cast-name { display: block; font-size: .78rem; font-weight: 800; background: rgba(255,255,255,.75); border-radius: 999px; padding: 0 8px; margin-top: -2px; }
.cast-char.talking .char { animation: talk .35s ease-in-out infinite; }
.cast-char.flip.talking .char { animation: talkflip .35s ease-in-out infinite; }
@keyframes talk { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.06); } }
@keyframes talkflip { 0%, 100% { transform: scaleX(-1) translateY(0) scale(1); } 50% { transform: scaleX(-1) translateY(-6px) scale(1.06); } }
.reader.dark .cast-name { background: rgba(255,255,255,.85); }

[hidden] { display: none !important; }
.cast-char { width: 118px; }
.cast-char .char { width: 118px; }
.cast-name { font-size: .85rem; }

/* grootte per personage: volwassenen zijn groter dan Nono en Tobbe */
.char-wrap { width: calc(100px * var(--s, 1)); }
.cast-char { width: calc(84px * var(--s, 1)); }
.cast-char .char { width: 100%; }
.cast-name { font-size: .75rem; white-space: nowrap; }
.chars { align-items: end; }

/* geen blauwe/grijze tikmarkering op telefoons, geen tekstselectie bij tikken */
* { -webkit-tap-highlight-color: transparent; }
.char-card, .char-card *, .hero-birds, .hero-birds *, .cast-char, .cast-char * {
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.char-card, .cast-char, .btn, .round, .item, .option, .goal { touch-action: manipulation; }
.char-card:focus:not(:focus-visible), .hero-birds *:focus, .hero-birds svg:focus { outline: none; }

/* ---------- boom met alle vogels ---------- */
.hero2 { text-align: center; padding-bottom: 8px; }
.hero2 h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero2 .lead { max-width: 640px; margin: 0 auto 20px; }
.tree-wrap { max-width: 900px; margin: 0 auto; border-radius: 36px; overflow: hidden; box-shadow: 0 10px 0 rgba(0,0,0,.07); background: #8fd6ff; }
.tree svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.tree svg text { user-select: none; -webkit-user-select: none; }
.tree svg g:focus { outline: none; }
.tree .birds > g:focus-visible { filter: drop-shadow(0 0 6px #ffb347) drop-shadow(0 0 6px #ffb347); outline: none; }
.flower.wiggle { animation: wiggle .7s ease-in-out; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 45% { transform: rotate(12deg); } 70% { transform: rotate(-7deg); } }

.speech {
  max-width: 900px; margin: 16px auto 8px; background: #fff; border-radius: 22px; padding: 12px 20px;
  box-shadow: 0 5px 0 rgba(0,0,0,.07); font-size: 1.25rem; min-height: 3.4rem; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.speech .sp-name { color: var(--forest); border-bottom: 5px solid var(--c, #ffd23f); line-height: 1.1; }
.speech.pop { animation: pop-in .3s both; }
.stars { display: flex; justify-content: center; gap: 12px; margin: 10px 0 6px; }
.dotc { width: 28px; height: 28px; border-radius: 50%; border: 3px dashed #c4d4bb; background: transparent; transition: transform .25s, background .25s; }
.dotc.on { background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 3px var(--c); transform: scale(1.2); }
.hero2 .hint-line { margin: 4px 0 0; }

/* kaarten even hoog en vogels op één lijn */
.chars { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 18px; }
.char-card { height: 100%; justify-content: flex-start; }
.char-box { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 135px; margin-bottom: 6px; }
.intro-grid .char-box { height: 160px; }
.char-card .desc { margin-top: 2px; }

/* verhaaltjes-overzicht */
.stories-title { font-size: clamp(2rem, 5vw, 3rem); text-align: center; margin-top: .2em; }
.stories-lead { text-align: center; max-width: 620px; margin: 0 auto 26px; }
.stories-adult { text-align: center; margin-top: 28px; }
.stories-adult a { font-weight: 800; }
.site-header nav a { white-space: nowrap; }
@media (max-width: 560px) { .site-header nav { gap: 2px; } .site-header nav a { padding: 8px 10px; font-size: .92rem; } }

/* les per verhaaltje */
.leert { display: inline-block; background: #e4f6d6; color: #1f5a2b; border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: .85rem; margin: 0 0 8px !important; align-self: flex-start; }
.lesson { background: #fff7d6; border-radius: 16px; padding: 12px 16px; font-size: 1.15rem; margin: 10px 0 14px; box-shadow: 0 4px 0 #f0e2a8; }

/* landingspagina: interactief lezen */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seo { max-width: 860px; margin: 0 auto; }
.crumbs { font-size: .9rem; margin: 6px 0 14px; opacity: .85; }
.crumbs a { text-decoration: underline; }
.seo h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); }
.seo-hero { display: grid; grid-template-columns: 1.5fr .8fr; gap: 20px; align-items: center; margin-bottom: 18px; }
.seo-birds { display: flex; gap: 6px; align-items: flex-end; justify-content: center; }
.seo-birds span { display: block; width: 48%; }
.seo-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; }
.seo .card h2 { font-size: 1.35rem; }
.seo .card h3 { font-size: 1.1rem; margin-top: 1.1em; }
.seo .card p, .seo .card ul, .seo .card ol { margin: 0 0 .8em; }
.seo .card li { margin-bottom: .35em; }
.facts ul { list-style: none; padding: 0; margin: 0 !important; }
.facts li { padding: 7px 0; border-bottom: 1px dashed #d9e5d2; margin: 0 !important; }
.facts li:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 6px 0 14px; }
.seo table { width: 100%; border-collapse: collapse; font-size: 1rem; min-width: 520px; }
.seo th, .seo td { text-align: left; padding: 10px 12px; vertical-align: top; border-bottom: 1px solid #e3ecdc; }
.seo thead th { background: #eef7e6; }
.note { background: #fff7d6; border-radius: 14px; padding: 10px 14px; }
.seo details { border-bottom: 1px solid #e3ecdc; padding: 8px 0; }
.seo details:last-child { border-bottom: 0; }
.seo summary { cursor: pointer; font-weight: 800; font-size: 1.05rem; }
.seo details p { margin: 8px 0 4px !important; }
.story-list { padding-left: 1.2em; }
.seo .back { text-align: center; margin: 26px 0 6px; }
@media (max-width: 640px) { .seo-hero { grid-template-columns: 1fr; } .seo-birds { order: -1; max-width: 260px; margin: 0 auto; } }

/* vaste tekst (wordt door het script vervangen als dat draait) */
.plainlist { max-width: 700px; margin: 0 auto 1em; padding-left: 1.2em; }
.plainlist li { margin-bottom: .4em; }

/* teller bij het tellen */
.countnum { text-align: center; font-weight: 900; color: var(--forest); margin: 6px 0 0; }
.countnum .cn { font-size: 3rem; line-height: 1; }
.countnum .cw { font-size: 1.3rem; margin-left: 8px; }

/* beschrijving en zinnetje delen dezelfde plek, zodat een kaart niet groeit als je tikt */
.say { display: grid; width: 100%; }
.say > * { grid-area: 1 / 1; }
.say .desc { transition: opacity .2s; }
.say .bubble { margin: 0; align-self: start; opacity: 0; visibility: hidden; transition: opacity .2s; animation: none; font-size: .95rem; line-height: 1.35; }
.char-card.speaking .desc { opacity: 0; visibility: hidden; }
.char-card.speaking .bubble { opacity: 1; visibility: visible; }

/* naam op één regel, zodat de kaarten niet hoger worden door "Buurvrouw Zuzu" */
.chars:not(.intro-grid) .char-card strong { font-size: 1.1rem; white-space: nowrap; }
