/* Palanca — stijl. Mobiel eerst (staand), grote knoppen, rustige kleuren, veel "juice". */
:root {
  --bg: #EEF4FA;
  --card: #FFFFFF;
  --card-2: #F6F9FD;
  --ink: #1E2A3A;
  --muted: #5B6B7F;
  --line: #D8E2EE;
  --accent: #F5B400;
  --accent-ink: #4A3600;
  --coral: #FF6B57;
  --coral-dark: #D94D3A;
  --goed: #2FAE60;
  --goed-bg: #E4F7EA;
  --fout: #E5533F;
  --fout-bg: #FFECE8;
  --blauw: #3FA9E0;
  --sky-1: #CFE9FF;
  --sky-2: #F3F9FF;
  --shadow: 0 10px 28px rgba(30, 42, 58, .10);
  --shadow-sm: 0 3px 10px rgba(30, 42, 58, .08);
  --radius: 22px;
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --tabbar-h: 72px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1722; --card: #1A2433; --card-2: #202C3D; --ink: #EEF3F9; --muted: #A2B2C5; --line: #2C3A4E;
    --accent-ink: #2B2000; --goed-bg: #14371F; --fout-bg: #3A1A16; --sky-1: #1B2C44; --sky-2: #14202F;
    --shadow: 0 10px 28px rgba(0, 0, 0, .4); --shadow-sm: 0 3px 10px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.45;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  touch-action: manipulation;
}
.screen { max-width: 560px; margin: 0 auto; padding: 12px 16px 40px; min-height: 100vh; }
body.has-tabs .screen { padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
input, select { font: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
svg { display: block; }
.center { text-align: center; }

/* --- kop van een scherm --- */
.top { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 8px; }
.top h1 { font-size: 24px; flex: 1; min-width: 0; }
.top .sub { font-size: 14px; color: var(--muted); font-weight: 700; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--line); background: var(--card);
  display: grid; place-items: center; padding: 0; flex: none;
}
.iconbtn svg { width: 22px; height: 22px; }
.brand { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 12vw, 60px); line-height: 1; letter-spacing: -.01em; }
.brand span { color: var(--accent); }

/* --- kaarten en knoppen --- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card.flat { box-shadow: var(--shadow-sm); }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px; border-radius: 16px; border: 0;
  background: var(--coral); color: #fff; font-family: var(--display); font-weight: 800; font-size: 19px;
  box-shadow: 0 5px 0 var(--coral-dark); width: 100%; text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--coral-dark); }
.btn.secondary { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.btn.secondary:active { box-shadow: 0 1px 0 var(--line); }
.btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 5px 0 #C99300; }
.btn.accent:active { box-shadow: 0 2px 0 #C99300; }
.btn.goed { background: var(--goed); box-shadow: 0 5px 0 #23884A; }
.btn.goed:active { box-shadow: 0 2px 0 #23884A; }
.btn.blauw { background: var(--blauw); box-shadow: 0 5px 0 #2C82B0; }
.btn.blauw:active { box-shadow: 0 2px 0 #2C82B0; }
.btn[disabled] { opacity: .5; box-shadow: none; transform: none; cursor: not-allowed; }
.btn.slim { min-height: 44px; font-size: 16px; padding: 8px 14px; width: auto; }
.btn svg { width: 22px; height: 22px; }
.link { background: none; border: 0; padding: 8px 0; color: var(--muted); font-weight: 700; text-decoration: underline; }
.label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* --- tabbalk onderin --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--card); border-top: 2px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  box-shadow: 0 -6px 20px rgba(30, 42, 58, .08);
}
.tab {
  display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 0; background: none; border-radius: 14px;
  color: var(--muted); font-family: var(--display); font-weight: 800; font-size: 13px; min-height: 56px;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--ink); background: var(--card-2); }
.tab[aria-current="page"] svg { color: var(--coral); }
.tab:active { transform: scale(.94); }

/* --- spelers --- */
.hero-start { text-align: center; padding: 24px 0 8px; }
.hero-start .art { width: min(62vw, 240px); margin: 6px auto 0; }
.playerlist { display: grid; gap: 10px; }
.playerbtn {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow-sm);
}
.playerbtn .mini { width: 64px; height: 64px; flex: none; }
.playerbtn b { font-family: var(--display); font-size: 20px; display: block; line-height: 1.1; }
.playerbtn .meta { font-size: 14px; color: var(--muted); font-weight: 700; }

/* --- nieuwe speler --- */
.preview { width: min(58vw, 230px); margin: 0 auto; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--line); padding: 0; position: relative; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); }
.swatch::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.55), rgba(255,255,255,0) 55%); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select { min-height: 48px; border: 2px solid var(--line); border-radius: 14px; padding: 8px 14px; background: var(--card-2); color: var(--ink); width: 100%; }

/* --- lessen: speel-verder-kaart --- */
.playerchip { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; background: none; border: 0; padding: 0; text-align: left; border-radius: 14px; }
.playerchip .mini { width: 46px; height: 46px; flex: none; }
.playerchip b { font-family: var(--display); font-size: 19px; display: block; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-weight: 800; font-size: 18px; padding: 6px 10px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); }
.streak svg { width: 20px; height: 20px; }
.streak.on { border-color: #FFB84D; background: #FFF3DF; color: #9A4B00; }
@media (prefers-color-scheme: dark) { .streak.on { background: #3A2A0E; color: #FFD08A; } }
.hero {
  display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center;
  background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%);
  border: 3px solid var(--accent); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.hero .art { width: 120px; height: 126px; }
.hero .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero h2 { font-size: 22px; margin: 2px 0 4px; }
.hero .btn { grid-column: 1 / -1; margin-top: 4px; }
.thema { display: grid; gap: 8px; }
.thema h2 { font-size: 20px; padding-top: 6px; }
.thema h2 span { color: var(--muted); font-weight: 700; font-size: 15px; margin-right: 6px; }
.lescard {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.lescard.current { border-color: var(--accent); }
.lescard .medal { width: 48px; height: 48px; }
.lescard b { font-family: var(--display); font-size: 18px; display: block; line-height: 1.1; }
.lescard .next { font-size: 14px; color: var(--muted); font-weight: 700; }
.lescard .stars { display: flex; gap: 2px; }
.lescard .stars svg { width: 16px; height: 16px; }

/* --- spelletjes-tab --- */
.gamecard {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.gamecard .icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; }
.gamecard .icon svg { width: 40px; height: 40px; }
.gamecard b { font-family: var(--display); font-size: 19px; display: block; line-height: 1.1; }
.gamecard .sub { font-size: 14px; color: var(--muted); font-weight: 700; }
.gamecard[disabled] { opacity: .55; cursor: default; }
.icon.regen { background: #E3F2FF; color: #2C82B0; }
.icon.teken { background: #FFE9E4; color: #D94D3A; }
.icon.duel { background: #FFF3D6; color: #B37D00; }
.icon.lastig { background: #E9F7EE; color: #23884A; }
@media (prefers-color-scheme: dark) {
  .icon.regen { background: #16344A; color: #8FD0F5; } .icon.teken { background: #45221C; color: #FFB4A6; }
  .icon.duel { background: #3F3110; color: #FFD27A; } .icon.lastig { background: #163B25; color: #8FE0AE; }
}
.leskiezer { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.leskeuze { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--card-2); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.leskeuze[aria-pressed="true"] { border-color: var(--accent); background: var(--card); }

/* --- pad --- */
.bubble { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; font-weight: 700; }
.bubble::before { content: ""; position: absolute; left: -12px; top: 18px; border: 6px solid transparent; border-right-color: var(--line); }
.bubble::after { content: ""; position: absolute; left: -9px; top: 18px; border: 6px solid transparent; border-right-color: var(--card); }
.pad { display: grid; gap: 0; position: relative; }
.node {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 12px; box-shadow: var(--shadow-sm); position: relative;
}
.node + .node { margin-top: 14px; }
.node + .node::before { content: ""; position: absolute; left: 39px; top: -18px; width: 4px; height: 18px; background: var(--line); border-radius: 2px; }
.node .num { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 800; font-size: 24px; }
.node.done .num { background: var(--goed); color: #fff; }
.node.locked { opacity: .6; }
.node.locked .num { background: var(--line); color: var(--muted); }
.node.locked .num svg { width: 24px; height: 24px; }
.node b { font-family: var(--display); font-size: 20px; display: block; line-height: 1.1; }
.node .sub { font-size: 14px; color: var(--muted); font-weight: 700; }
.node .stars { display: flex; gap: 2px; }
.node .stars svg { width: 20px; height: 20px; }
.node.next { border-color: var(--accent); animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 3px rgba(245, 180, 0, .18); } 50% { box-shadow: 0 0 0 7px rgba(245, 180, 0, .32); } }

/* --- kijken (kaartjes) --- */
.flash { min-height: 300px; display: grid; align-content: center; gap: 14px; text-align: center; padding: 26px 18px; animation: slidein .3s ease-out; }
.flash .lid { font-size: 16px; color: var(--muted); font-weight: 800; letter-spacing: .04em; }
.flash .woord { font-family: var(--display); font-size: clamp(30px, 9vw, 44px); font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.flash .omschrijving { font-size: 20px; line-height: 1.4; }
.speak { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card-2); font-weight: 700; font-size: 15px; }
.speak svg { width: 20px; height: 20px; }
.speakrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.navrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dots { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }

/* --- rondje --- */
.progress { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; flex: 1; }
.progress b { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .35s ease; }
.gerbilrow { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 10px; min-height: 104px; }
.gerbilrow .art { width: 104px; height: 110px; cursor: pointer; }
.gerbilrow .art svg { overflow: visible; }
.seeds { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--muted); position: relative; }
.seeds svg { width: 18px; height: 22px; }
.seeds.bump { animation: bump .4s ease; }
.combo { display: inline-flex; align-items: center; gap: 4px; color: #E05A00; font-family: var(--display); font-weight: 800; }
.combo svg { width: 18px; height: 18px; }
.vraag { text-align: center; padding: 20px 16px; display: grid; gap: 8px; animation: slidein .3s ease-out; }
.vraag .eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.vraag .prompt { font-size: 22px; line-height: 1.35; font-weight: 700; }
.vraag .prompt.big { font-family: var(--display); font-size: clamp(30px, 9vw, 42px); font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.opties { display: grid; gap: 10px; }
.opties.woorden { grid-template-columns: 1fr 1fr; }
.optie {
  min-height: 60px; padding: 12px 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--card);
  font-weight: 700; font-size: 18px; text-align: center; box-shadow: 0 4px 0 var(--line); line-height: 1.3; overflow-wrap: anywhere;
  transition: transform .08s ease;
}
.opties.woorden .optie { font-family: var(--display); font-weight: 800; font-size: 20px; }
.optie:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.optie.correct { background: var(--goed-bg); border-color: var(--goed); box-shadow: 0 4px 0 var(--goed); animation: pulse .45s ease; }
.optie.wrong { background: var(--fout-bg); border-color: var(--fout); box-shadow: 0 4px 0 var(--fout); animation: shakex .45s ease; }
.optie[disabled] { cursor: default; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; min-height: 56px; }
.slots .lid { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--muted); margin-right: 4px; }
.slot { width: 38px; height: 46px; border-radius: 10px; border-bottom: 4px solid var(--line); background: var(--card-2); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 24px; text-transform: lowercase; }
.slot.filled { background: var(--card); border-bottom-color: var(--accent); animation: slotpop .25s ease; }
.slot.hint { border-bottom-color: var(--blauw); color: var(--blauw); }
.slots.correct .slot { background: var(--goed-bg); border-bottom-color: var(--goed); animation: pulse .45s ease; }
.slots.wrong { animation: shakex .45s ease; }
.slots.wrong .slot { background: var(--fout-bg); border-bottom-color: var(--fout); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile { width: 46px; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); box-shadow: 0 4px 0 var(--line); font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: lowercase; padding: 0; transition: transform .08s ease; }
.tile:active { transform: translateY(3px) scale(.96); box-shadow: 0 1px 0 var(--line); }
.tile.used { visibility: hidden; }
.tilerow { display: flex; gap: 10px; justify-content: center; }
.feedback { position: fixed; inset: 0; display: grid; place-items: end center; padding: 16px; background: rgba(30,42,58,.35); z-index: 20; }
.feedback .panel { width: min(100%, 528px); background: var(--card); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 12px; margin-bottom: env(safe-area-inset-bottom, 0px); animation: slideup .3s cubic-bezier(.34,1.3,.64,1); }
.feedback .panel.fout { border-top: 6px solid var(--fout); }
.feedback .panel.goed { border-top: 6px solid var(--goed); }
.feedback h2 { font-size: 22px; }
.feedback .woord { font-family: var(--display); font-weight: 800; font-size: 26px; }
.feedback .fout-antwoord { color: var(--fout); text-decoration: line-through; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; z-index: 30; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
body.has-tabs .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); }

/* --- schermflits, schudden, zwevende punten --- */
.flashfx { position: fixed; inset: 0; pointer-events: none; z-index: 12; animation: flashout .5s ease-out forwards; }
.flashfx.goed { background: rgba(47, 174, 96, .22); }
.flashfx.fout { background: rgba(229, 83, 63, .22); }
@keyframes flashout { from { opacity: 1; } to { opacity: 0; } }
.screen.schud { animation: schud .45s ease; }
@keyframes schud { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.floatfx { position: fixed; pointer-events: none; z-index: 13; font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--goed); animation: floatup 1s ease-out forwards; display: flex; align-items: center; gap: 4px; text-shadow: 0 2px 0 rgba(255,255,255,.6); }
.floatfx svg { width: 22px; height: 26px; }
@keyframes floatup { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-8px) scale(1.15); } 100% { transform: translateY(-70px) scale(1); opacity: 0; } }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shakex { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
@keyframes slotpop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes slidein { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* --- de gerbil: knipperen, kwispelen, springen, dansen, treuren --- */
.gerbil .g-eye { transform-box: fill-box; transform-origin: center; animation: blink 4.6s ease-in-out infinite; }
.gerbil.expr-blij .g-eye, .gerbil.expr-juichen .g-eye { animation: none; }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(1); } 94%, 97% { transform: scaleY(.08); } }
.gerbil.expr-blij .g-tail, .gerbil.expr-juichen .g-tail { transform-box: view-box; transform-origin: 150px 170px; animation: wag .5s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }
.gerbil .g-tear { animation: tear 1.7s ease-in infinite; transform-box: fill-box; }
@keyframes tear { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(28px); opacity: 0; } }
.gerbil.expr-juichen .g-confetti { animation: confettispin 2.4s linear infinite; transform-box: view-box; transform-origin: 100px 100px; }
@keyframes confettispin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.art.pop { animation: pop .5s cubic-bezier(.34,1.56,.64,1); transform-origin: 50% 90%; }
@keyframes pop { 0% { transform: scale(.9) translateY(4px); } 60% { transform: scale(1.06) translateY(-3px); } 100% { transform: scale(1); } }
.art.spring { animation: spring .6s cubic-bezier(.34,1.56,.64,1); transform-origin: 50% 100%; }
@keyframes spring { 0% { transform: translateY(0) scaleY(1); } 25% { transform: translateY(6px) scaleY(.88); } 55% { transform: translateY(-26px) scaleY(1.06); } 100% { transform: translateY(0) scaleY(1); } }
.art.wiebel { animation: wiebel .55s ease; transform-origin: 50% 90%; }
@keyframes wiebel { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg); } 45% { transform: rotate(8deg); } 70% { transform: rotate(-5deg); } }
.art.dans { animation: dans .7s ease-in-out infinite; transform-origin: 50% 95%; }
@keyframes dans { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-10px); } }
.art.treur { animation: treur 2.6s ease-in-out infinite; transform-origin: 50% 95%; }
@keyframes treur { 0%, 100% { transform: rotate(-2deg) translateY(2px); } 50% { transform: rotate(2deg) translateY(0); } }
.art.draai { animation: draai .7s cubic-bezier(.34,1.3,.64,1); transform-origin: 50% 60%; }
@keyframes draai { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.art.idle { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.018); } }

/* regenwolkje boven de treurige gerbil */
.regenwolk { position: relative; width: min(60vw, 240px); margin: 36px auto 0; }
.regenwolk .wolk { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); width: 110px; height: 40px; background: #B8C4D3; border-radius: 30px; box-shadow: 30px -12px 0 -2px #B8C4D3, -28px -8px 0 -4px #B8C4D3; animation: zweef 3s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { .regenwolk .wolk { background: #6C7A8C; box-shadow: 30px -12px 0 -2px #6C7A8C, -28px -8px 0 -4px #6C7A8C; } }
.regenwolk .drup { position: absolute; top: 34px; width: 6px; height: 12px; border-radius: 50% 50% 60% 60%; background: #7CC4F5; opacity: 0; animation: drup 1.4s linear infinite; }
@keyframes drup { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(70px); opacity: 0; } }
@keyframes zweef { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-5px); } }

/* --- resultaat --- */
.result { text-align: center; display: grid; gap: 12px; justify-items: center; padding-top: 8px; }
.result .art { width: min(60vw, 240px); }
.result h1 { font-size: 30px; animation: slidein .4s ease-out; }
.result .score { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; }
.bigstars { display: flex; gap: 6px; }
.bigstars svg { width: 48px; height: 48px; opacity: 0; transform: scale(0); animation: starpop .5s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes starpop { 0% { opacity: 0; transform: scale(0) rotate(-40deg); } 70% { opacity: 1; transform: scale(1.25) rotate(8deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.bigmedal { width: 116px; height: 116px; animation: medaldrop .8s cubic-bezier(.34,1.56,.64,1); }
@keyframes medaldrop { 0% { transform: translateY(-60px) scale(.6); opacity: 0; } 60% { transform: translateY(6px) scale(1.08); opacity: 1; } 100% { transform: none; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.6s linear forwards; opacity: .95; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .7; } }
.record { display: inline-flex; align-items: center; gap: 6px; background: #FFF3DF; color: #9A4B00; border-radius: 999px; padding: 6px 12px; font-family: var(--display); font-weight: 800; animation: pulse .6s ease; }
@media (prefers-color-scheme: dark) { .record { background: #3A2A0E; color: #FFD08A; } }

/* --- prijzenkast --- */
.medalgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.medalcell { display: grid; justify-items: center; gap: 2px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.medalcell svg { width: 54px; height: 54px; }
.accs { display: flex; flex-wrap: wrap; gap: 8px; }
.acc { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card-2); font-weight: 700; }
.acc[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.acc[disabled] { opacity: .5; cursor: default; }
.records { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.recordcell { background: var(--card-2); border-radius: 14px; padding: 10px; text-align: center; }
.recordcell b { font-family: var(--display); font-size: 24px; display: block; line-height: 1; }
.recordcell span { font-size: 12px; font-weight: 700; color: var(--muted); }

/* --- instellingen --- */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting b { font-family: var(--display); font-size: 18px; display: block; }
.toggle { width: 60px; height: 34px; border-radius: 17px; border: 0; background: var(--line); position: relative; flex: none; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle[aria-checked="true"] { background: var(--goed); }
.toggle[aria-checked="true"]::after { left: 30px; }
.danger { color: var(--fout); }

/* --- overlay (bevestigen, les kiezen) --- */
.overlay { position: fixed; inset: 0; background: rgba(30,42,58,.45); display: grid; place-items: center; padding: 20px; z-index: 40; }
.overlay .panel { width: min(100%, 440px); background: var(--card); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); display: grid; gap: 12px; animation: slideup .3s cubic-bezier(.34,1.3,.64,1); max-height: 90vh; overflow-y: auto; }
.overlay h2 { font-size: 22px; }

/* --- Woordregen --- */
.regen { position: relative; height: min(52vh, 460px); border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, var(--sky-1), var(--sky-2)); border: 2px solid var(--line); }
.regen .grond { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--goed); opacity: .6; }
.wolk { position: absolute; left: 6%; right: 6%; top: -30%; background: var(--card); border-radius: 20px; padding: 12px 14px; font-weight: 700; font-size: 17px; line-height: 1.3; text-align: center; box-shadow: var(--shadow); border: 2px solid var(--line); animation: val linear forwards; will-change: transform; }
@keyframes val { from { transform: translateY(0); } to { transform: translateY(var(--dist, 180vh)); } }
.wolk.gevangen { animation: gevangen .4s ease-out forwards !important; }
@keyframes gevangen { to { transform: scale(1.3); opacity: 0; } }
.wolk.gemist { animation: gemist .4s ease-in forwards !important; }
@keyframes gemist { to { transform: translateY(20px) scale(.8); opacity: 0; } }
.emmers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.emmer { min-height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-family: var(--display); font-weight: 800; font-size: 17px; box-shadow: 0 4px 0 var(--line); padding: 8px 6px; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.emmer.lang { font-size: 14px; }
.emmer.correct { background: var(--goed-bg); border-color: var(--goed); animation: pulse .4s ease; }
.emmer.wrong { background: var(--fout-bg); border-color: var(--fout); animation: shakex .4s ease; }
.levens { display: inline-flex; gap: 4px; }
.levens svg { width: 16px; height: 20px; }
.levens svg.weg { opacity: .2; }
.hud { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; }
.hud .score { font-size: 26px; }
.regen .gerbil-klein { position: absolute; bottom: 8px; left: 8px; width: 64px; height: 68px; }
.regen .tempo { position: absolute; top: 8px; right: 10px; font-family: var(--display); font-weight: 800; color: var(--muted); font-size: 13px; }

/* --- Duel --- */
.duelveld { position: fixed; inset: 0; display: grid; grid-template-rows: 1fr auto 1fr; background: var(--bg); z-index: 8; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.helft { padding: 10px 12px; display: grid; grid-template-rows: auto 1fr; gap: 8px; min-height: 0; }
.helft.boven { transform: rotate(180deg); }
.helft .kop { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 18px; }
.helft .kop .mini { width: 40px; height: 42px; }
.helft .kop .punten { margin-left: auto; font-size: 24px; }
.helft .opties { grid-template-columns: 1fr 1fr; align-content: center; }
.helft .optie { min-height: 54px; font-size: 17px; padding: 8px 10px; }
.helft.klaar .optie { pointer-events: none; opacity: .55; }
.helft.gewonnen { background: var(--goed-bg); }
.helft.mis { background: var(--fout-bg); }
.duel-mid { background: var(--card); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 10px 14px; text-align: center; display: grid; gap: 4px; }
.duel-mid .prompt { font-weight: 700; font-size: 17px; line-height: 1.3; }
.duel-mid .prompt.spiegel { transform: rotate(180deg); }
.duel-mid .stop { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.duel-mid { position: relative; }

/* --- Teken en raad --- */
.tekenvlak { position: relative; width: 100%; aspect-ratio: 4 / 4.6; max-height: 58vh; background: #fff; border-radius: 20px; border: 3px solid var(--line); overflow: hidden; touch-action: none; }
.tekenvlak canvas { width: 100%; height: 100%; display: block; }
.palet { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.kleur { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--line); padding: 0; }
.kleur[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.timer { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.timer b { display: block; height: 100%; background: var(--blauw); border-radius: 5px; transition: width 1s linear; }
.timer.rood b { background: var(--fout); }
.geefdoor { text-align: center; display: grid; gap: 12px; justify-items: center; padding-top: 24px; }
.geefdoor .art { width: min(50vw, 200px); }
.geefdoor h1 { font-size: 28px; }
.tekening-klein { width: 100%; border-radius: 16px; border: 2px solid var(--line); background: #fff; }

@media (prefers-reduced-motion: reduce) {
  .confetti, .flashfx { display: none; }
  .art, .gerbil .g-eye, .gerbil .g-tail, .gerbil .g-tear, .gerbil .g-confetti, .node.next, .bigstars svg, .bigmedal, .regenwolk .wolk, .regenwolk .drup, .seeds.bump { animation: none !important; }
  .bigstars svg { opacity: 1; transform: none; }
  .progress b, .timer b { transition: none; }
  .screen.schud { animation: none; }
}
