/* ==========================================================================
   Meester Arwin zijn lessen – gedeelde huisstijl
   Eén bestand voor alle publieke pagina's: startpagina, lessen en spelletjes.
   ========================================================================== */

:root {
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Merkkleuren (afgeleid van het logo: donkerblauw + lichtblauw, met warm oranje als accent) */
  --blauw-900: #17304f;
  --blauw-700: #1f4a7a;
  --blauw-500: #2f6fb3;
  --blauw-300: #8fb6e3;
  --blauw-100: #e3edf8;
  --oranje-600: #d97b00;
  --oranje-500: #f39201;
  --oranje-100: #fff1dc;
  --groen-600: #4f9a1f;
  --groen-500: #67b42c;
  --groen-100: #e9f6dc;
  --rood-500: #d64545;
  --rood-100: #fde8e8;
  --geel-500: #fec700;
  --geel-100: #fff7d6;
  --paars-500: #612282;
  --paars-100: #f1e6f7;

  /* Tekst en vlakken */
  --ink: #1e2a3a;
  --ink-2: #4a5a6e;
  --ink-3: #7a8798;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --line: #e3e9f1;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(23, 48, 79, .06), 0 2px 8px rgba(23, 48, 79, .06);
  --shadow: 0 8px 24px rgba(23, 48, 79, .10);
  --shadow-lg: 0 18px 48px rgba(23, 48, 79, .16);
  --max: 1120px;
  --gutter: 20px;
}

/* --------------------------------------------------------------------------
   Basis
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blauw-500); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 800; color: var(--blauw-900); }
h1 { font-size: clamp(1.9em, 4vw, 2.6em); }
h2 { font-size: clamp(1.35em, 2.6vw, 1.7em); }
h3 { font-size: 1.15em; }
p { margin: 0 0 1em; }
button { font-family: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding: 0 var(--gutter); }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 2em; height: 2em; }

/* --------------------------------------------------------------------------
   Kop en voet
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--blauw-900); font-weight: 800; font-size: 1.1em;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
}
.brand-mark img { width: 40px; height: 40px; border-radius: 50%; display: block; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: .95em;
}
.site-nav a:hover { background: var(--blauw-100); color: var(--blauw-900); }
.site-nav a.active { background: var(--blauw-900); color: #fff; }
.site-nav .label { display: none; }
@media (min-width: 640px) { .site-nav .label { display: inline; } }

.site-footer {
  margin-top: 60px; padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3); font-size: .92em;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--blauw-500); }

/* --------------------------------------------------------------------------
   Knoppen, chips, velden
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 800; font-size: 1em; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--oranje-500); color: #fff; box-shadow: 0 4px 0 var(--oranje-600); }
.btn-primary:hover { background: #ff9f16; }
.btn-primary:active { box-shadow: 0 2px 0 var(--oranje-600); }
.btn-dark { background: var(--blauw-900); color: #fff; box-shadow: 0 4px 0 #0e1f36; }
.btn-dark:hover { background: var(--blauw-700); }
.btn-secondary { background: var(--surface); color: var(--blauw-900); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--blauw-300); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--blauw-100); color: var(--blauw-900); }
.btn-sm { padding: 8px 14px; font-size: .9em; }
.btn-lg { padding: 15px 30px; font-size: 1.1em; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line);
  color: var(--ink-2); font-weight: 700; font-size: .95em; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.chip:hover { border-color: var(--blauw-300); color: var(--blauw-900); }
.chip.active { background: var(--blauw-900); border-color: var(--blauw-900); color: #fff; }
.chip .cnt {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  display: grid; place-items: center; font-size: .8em;
  background: var(--blauw-100); color: var(--blauw-700);
}
.chip.active .cnt { background: rgba(255, 255, 255, .2); color: #fff; }

.field {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface);
  font-family: inherit; font-size: 1.05em; color: var(--ink);
}
.field:focus { outline: none; border-color: var(--blauw-500); box-shadow: 0 0 0 4px var(--blauw-100); }
label.lbl { display: block; font-weight: 800; color: var(--blauw-900); margin-bottom: 6px; }
.err { color: var(--rood-500); font-weight: 700; min-height: 1.4em; font-size: .95em; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: .85em; font-weight: 800;
  background: var(--blauw-100); color: var(--blauw-700);
}
.pill-green { background: var(--groen-100); color: var(--groen-600); }
.pill-orange { background: var(--oranje-100); color: var(--oranje-600); }
.pill-red { background: var(--rood-100); color: var(--rood-500); }
.pill-yellow { background: var(--geel-100); color: #9a7400; }

/* --------------------------------------------------------------------------
   Kaarten en secties
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  padding: 26px 28px;
}
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 44px 0 16px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; color: var(--ink-3); }
.eyebrow { display: inline-block; font-size: .8em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--oranje-600); margin-bottom: 6px; }

/* Lessenraster */
.lesson-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  margin-top: 18px;
}
.lesson-card {
  --cat: var(--blauw-500);
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  overflow: hidden; cursor: pointer; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.lesson-card:hover, .lesson-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--cat); outline: none; }
.lesson-card.hidden { display: none; }
.lesson-card .art {
  height: 110px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--cat) 12%, white);
  color: var(--cat);
}
.lesson-card .art .icon { width: 52px; height: 52px; stroke-width: 1.6; }
.lesson-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lesson-card .cat-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .8em; font-weight: 800; color: var(--cat); text-transform: uppercase; letter-spacing: .06em; }
.lesson-card h3 { font-size: 1.15em; }
.lesson-card p { margin: 0; color: var(--ink-2); font-size: .95em; line-height: 1.45; flex: 1; }
.lesson-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.lesson-card .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--blauw-900); font-size: .95em; }
.lesson-card .go .icon { transition: transform .15s; }
.lesson-card:hover .go .icon { transform: translateX(4px); }

/* Lege staat */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   Startpagina
   -------------------------------------------------------------------------- */
.hero {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 44px 0 36px;
}
.hero .wrap { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.hero h1 { margin-bottom: 10px; }
.hero h1 .accent { color: var(--oranje-500); }
.hero .lead { font-size: 1.15em; color: var(--ink-2); max-width: 540px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hero .stage { display: flex; justify-content: center; }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .stage { order: -1; }
}

.code-box {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  margin-top: 28px; padding: 20px 24px;
  background: var(--blauw-900); color: #fff; border-radius: var(--radius-lg);
}
.code-box .ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
.code-box h3 { color: #fff; margin-bottom: 2px; }
.code-box p { margin: 0; color: rgba(255, 255, 255, .75); font-size: .95em; }
.code-box form { display: flex; gap: 8px; }
.code-box input {
  width: 150px; padding: 11px 14px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1); color: #fff; font-family: inherit; font-weight: 800;
  font-size: 1.05em; letter-spacing: .14em; text-transform: uppercase; text-align: center;
}
.code-box input::placeholder { color: rgba(255, 255, 255, .5); letter-spacing: .1em; }
.code-box input:focus { outline: none; border-color: var(--oranje-500); background: rgba(255, 255, 255, .16); }
@media (max-width: 720px) {
  .code-box { grid-template-columns: 1fr; text-align: center; }
  .code-box .ic { margin: 0 auto; }
  .code-box form { justify-content: center; }
}

.filter-row { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.filter-row .lbl-small { font-size: .8em; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; align-self: center; }

.support {
  margin-top: 44px; padding: 24px 28px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--oranje-100); border: 1px solid #ffdca8; border-radius: var(--radius-lg);
}
.support .icon { width: 36px; height: 36px; color: var(--oranje-600); }
.support .text { flex: 1; min-width: 240px; }
.support h3 { color: var(--oranje-600); margin-bottom: 2px; }
.support p { margin: 0; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(23, 48, 79, .55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  width: 100%; max-width: 440px; background: var(--surface);
  border-radius: var(--radius-lg); padding: 30px 30px 26px;
  box-shadow: var(--shadow-lg); text-align: center;
  animation: popIn .18s ease-out;
}
@keyframes popIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 1.4em; margin-bottom: 4px; }
.modal p { color: var(--ink-2); }
.modal form { text-align: left; margin-top: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* --------------------------------------------------------------------------
   Meester Arwin (mascotte)
   Acht tekeningen liggen over elkaar; per stemming is er één zichtbaar.
   De klassen (talking, mood-*, point, wave) worden gezet door mascot.js.
   -------------------------------------------------------------------------- */
.mascot {
  display: flex; align-items: flex-end; gap: 14px;
  position: relative;
}
.mascot.mascot-left { flex-direction: row; }
.mascot.mascot-right { flex-direction: row-reverse; }
.mascot.mascot-stack { flex-direction: column-reverse; align-items: center; }
.mascot .figure { width: 150px; flex: none; position: relative; }
.mascot.mascot-sm .figure { width: 96px; }
.mascot.mascot-lg .figure { width: 220px; }
.mascot .figure .pose {
  position: absolute; left: 0; top: 0; width: 100%; height: auto;
  opacity: 0; transition: opacity .18s ease;
  user-select: none; -webkit-user-drag: none;
}
/* De rusthouding geeft de figuur zijn afmeting en is standaard zichtbaar */
.mascot .figure .pose-rust { position: relative; opacity: 1; }

/* Stemmingen: één tekening per stemming, wijzen gaat voor denken */
.mascot.mood-cheer .pose-rust,
.mascot.mood-think .pose-rust,
.mascot.mood-oops .pose-rust,
.mascot.point .pose-rust,
.mascot.wave .pose-rust { opacity: 0; }
.mascot.mood-cheer .pose-juichen { opacity: 1; }
.mascot.mood-think .pose-denken { opacity: 1; }
.mascot.mood-oops .pose-oeps { opacity: 1; }
.mascot.point .pose-denken { opacity: 0; }
.mascot.point .pose-wijzen { opacity: 1; }
.mascot.wave .pose-juichen, .mascot.wave .pose-denken, .mascot.wave .pose-oeps, .mascot.wave .pose-wijzen { opacity: 0; }
.mascot.wave .pose-zwaaien { opacity: 1; animation: wavePose 2.2s ease-in-out 1; transform-origin: 50% 85%; }
@keyframes wavePose {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(5deg); }
  40% { transform: rotate(-3deg); }
  60% { transform: rotate(4deg); }
  80% { transform: rotate(-2deg); }
}

/* Praten: in rust wisselt de mond open en dicht; in een andere stemming blijft die tekening staan */
.mascot.talking:not(.mood-cheer):not(.mood-think):not(.mood-oops):not(.point):not(.wave) .pose-praten {
  animation: talkPose .5s steps(1) infinite; transition: none;
}
@keyframes talkPose { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Knipperen: alleen in rust gaan de ogen af en toe even dicht */
.mascot:not(.talking):not(.mood-cheer):not(.mood-think):not(.mood-oops):not(.point):not(.wave) .pose-dicht {
  animation: blinkPose 5.2s steps(1) infinite; transition: none;
}
@keyframes blinkPose { 0%, 95%, 100% { opacity: 0; } 96%, 98% { opacity: 1; } }

/* Juichen: de hele figuur springt; oeps: hoofd schudt */
.mascot.mood-cheer .figure { animation: cheerJump .5s ease-out 2; }
@keyframes cheerJump {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-14px); }
}
.mascot.mood-oops .figure { animation: shake .4s ease-in-out 1; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* Rustig ademen */
.mascot .figure { animation: breathe 4s ease-in-out infinite; transform-origin: center bottom; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }

/* Spraakballon */
.bubble {
  position: relative; max-width: 420px; min-width: 200px;
  background: var(--surface); border: 2px solid var(--blauw-100);
  border-radius: 20px; padding: 14px 18px;
  box-shadow: var(--shadow-sm); color: var(--ink);
  font-size: 1.05em; line-height: 1.45;
  margin-bottom: 36px;
  transition: opacity .2s, transform .2s;
}
.bubble.empty { opacity: 0; transform: translateY(6px); pointer-events: none; }
.bubble::after, .bubble::before {
  content: ''; position: absolute; bottom: -14px; left: 32px;
  border: 8px solid transparent; border-top-color: var(--blauw-100); border-bottom: 0;
}
.bubble::after { bottom: -11px; border-top-color: var(--surface); }
.mascot-right .bubble::before, .mascot-right .bubble::after { left: auto; right: 32px; }
.mascot-stack .bubble { margin-bottom: 18px; }
.mascot-stack .voice-btn { top: auto; bottom: 0; right: 0; }
.mascot-stack .bubble::before, .mascot-stack .bubble::after { left: 50%; transform: translateX(-50%); }
.bubble .caret { display: inline-block; width: 2px; height: 1em; background: var(--oranje-500); vertical-align: -2px; margin-left: 2px; animation: caret .7s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.bubble .bubble-name { display: block; font-size: .75em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--oranje-600); margin-bottom: 2px; }
.mascot .voice-btn {
  position: absolute; top: -10px; right: -10px;
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.mascot .voice-btn.on { color: var(--groen-600); border-color: var(--groen-500); }
.mascot .voice-btn .icon { width: 18px; height: 18px; }
.mascot-right .voice-btn { right: auto; left: -10px; }

/* Vaste helper in de hoek (voor lessen en spellen) */
.mascot-corner {
  position: fixed; left: 16px; bottom: 12px; z-index: 40;
  align-items: flex-end;
}
.mascot-corner .figure { width: 110px; }
.mascot-corner .bubble { max-width: 300px; margin-bottom: 70px; font-size: .98em; }
@media (max-width: 700px) {
  .mascot-corner { left: 8px; bottom: 6px; }
  .mascot-corner .figure { width: 64px; }
  .mascot-corner .bubble { max-width: 220px; margin-bottom: 40px; font-size: .9em; padding: 9px 12px; }
  .mascot-corner .voice-btn { width: 28px; height: 28px; }
}

/* --------------------------------------------------------------------------
   Les- en spelschil (gedeelde opmaak voor /les en /games)
   -------------------------------------------------------------------------- */
.play-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; flex-wrap: wrap;
}
.play-topbar .who { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--blauw-900); background: var(--surface); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; }
.play-head { text-align: center; margin: 6px 0 18px; }
.play-head h1 { display: inline-flex; align-items: center; gap: 12px; }
.play-head h1 .icon { width: 1.1em; height: 1.1em; color: var(--oranje-500); }
.play-head .sub { color: var(--ink-3); margin: 6px 0 0; }
.play-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 28px 32px 30px; position: relative;
}
@media (max-width: 600px) { .play-card { padding: 20px 16px 22px; border-radius: var(--radius); } }
.stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.stat { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--blauw-100); color: var(--blauw-900); font-weight: 800; }
.stat .icon { width: 18px; height: 18px; color: var(--blauw-500); }
.stat.hearts { background: var(--rood-100); color: var(--rood-500); }

.progress-line { text-align: center; color: var(--ink-3); margin-bottom: 10px; }
.progress-line b { color: var(--blauw-900); }
.progress-bar { height: 10px; border-radius: 999px; background: var(--blauw-100); overflow: hidden; margin: 0 auto 18px; max-width: 520px; }
.progress-bar > span { display: block; height: 100%; background: var(--groen-500); border-radius: 999px; transition: width .3s; }

.canvas-frame { position: relative; display: inline-block; max-width: 100%; border-radius: var(--radius); overflow: hidden; border: 3px solid var(--blauw-900); box-shadow: var(--shadow); background: #fff; }
.canvas-frame canvas { display: block; max-width: 100%; height: auto; }
.game-overlay .level-picker { max-width: 100%; }
.game-overlay .level-picker .levels { gap: 6px; }
.game-stage { text-align: center; }
.game-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 24px;
  background: rgba(244, 247, 251, .94); text-align: center;
}
.game-overlay h2 { font-size: 1.8em; }
.game-overlay p { color: var(--ink-2); margin: 0; }
.game-overlay .score-big { font-size: 2.4em; font-weight: 900; color: var(--oranje-500); line-height: 1; }
.controls-hint { margin-top: 12px; color: var(--ink-3); font-size: .92em; text-align: center; }

.touch-controls {
  display: none; margin: 14px auto 0;
  grid-template-areas: ". up ." "left . right" ". down .";
  grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 54px); gap: 6px;
  width: max-content;
}
.touch-btn { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; color: var(--blauw-900); font-size: 1.4em; cursor: pointer; display: grid; place-items: center; box-shadow: 0 3px 0 var(--line); }
.touch-btn:active { transform: translateY(2px); box-shadow: none; }
.touch-btn.up { grid-area: up; } .touch-btn.down { grid-area: down; } .touch-btn.left { grid-area: left; } .touch-btn.right { grid-area: right; }
@media (pointer: coarse) { .touch-controls { display: grid; } }

/* Niveaukeuze */
.level-picker { display: flex; flex-direction: column; gap: 14px; align-items: center; width: 100%; }
.level-picker h2 { font-size: 1.5em; }
.level-picker .levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 440px; }
.level-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; transition: transform .12s, border-color .12s;
}
.level-btn:hover { transform: translateY(-3px); border-color: var(--blauw-300); }
.level-btn.active { border-color: var(--oranje-500); background: var(--oranje-100); }
.level-btn .stars { display: flex; gap: 2px; color: var(--geel-500); }
.level-btn .stars .icon { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.level-btn .stars .icon.off { color: var(--line); }
.level-btn b { font-size: 1em; color: var(--blauw-900); }
.level-btn small { color: var(--ink-3); font-size: .8em; line-height: 1.2; text-align: center; }
.level-btn .best { font-size: .78em; color: var(--oranje-600); font-weight: 800; }
@media (max-width: 480px) {
  .game-overlay { overflow: auto; padding: 12px; gap: 8px; }
  .level-picker { gap: 8px; }
  .level-picker h2 { font-size: 1.1em; }
  .level-picker .levels { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .level-btn { padding: 8px 4px; gap: 3px; border-radius: var(--radius-sm); }
  .level-btn b { font-size: .85em; }
  .level-btn small { display: none; }
  .level-btn .stars .icon { width: 12px; height: 12px; }
  .game-overlay .btn-lg { padding: 10px 22px; font-size: 1em; }
  .game-overlay h2 { font-size: 1.3em; }
  .game-overlay .score-big { font-size: 1.8em; }
}

/* Feedback in lessen */
.feedback { text-align: center; min-height: 2em; font-weight: 800; font-size: 1.15em; margin: 12px 0; }
.feedback.ok { color: var(--groen-600); }
.feedback.nok { color: var(--rood-500); }
.answer-btns { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.answer-btn {
  padding: 18px 16px; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--surface); font-size: 1.25em; font-weight: 800; color: var(--blauw-900);
  cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform .1s, border-color .1s;
}
.answer-btn:hover { border-color: var(--blauw-300); transform: translateY(-2px); }
.answer-btn:active { transform: translateY(2px); box-shadow: none; }
.answer-btn.ok { background: var(--groen-100); border-color: var(--groen-500); color: var(--groen-600); box-shadow: 0 4px 0 var(--groen-500); }
.answer-btn.nok { background: var(--rood-100); border-color: var(--rood-500); color: var(--rood-500); box-shadow: 0 4px 0 var(--rood-500); animation: shake .35s; }
.answer-btn:disabled { cursor: default; }

/* Eindscherm */
.finish { text-align: center; padding: 20px 10px; }
.finish .score { font-size: 3em; font-weight: 900; color: var(--oranje-500); line-height: 1; margin: 8px 0; }
.finish .sub { color: var(--ink-2); }
.finish .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Ranglijst */
.leaderboard { margin-top: 24px; }
.leaderboard h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.leaderboard h3 .icon { color: var(--geel-500); }
.leaderboard ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.leaderboard li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--bg); }
.leaderboard .rank { width: 28px; font-weight: 900; color: var(--ink-3); }
.leaderboard li:nth-child(1) .rank { color: #d4a017; }
.leaderboard li:nth-child(2) .rank { color: #8e9aab; }
.leaderboard li:nth-child(3) .rank { color: #b87333; }
.leaderboard .name { flex: 1; font-weight: 700; }
.leaderboard .pts { font-weight: 800; color: var(--blauw-900); }

/* Confetti */
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 200; animation: confettiFall linear forwards; }
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .2; }
}
