/* Storm leert Nederlands — kid-friendly, mobile-first. */
:root {
  --orange: #ff6b35;     /* NL-ish warm accent */
  --orange-d: #e2551f;
  --blue: #1f6feb;
  --green: #2bb673;
  --red: #e94f4f;
  --ink: #1b2330;
  --muted: #6b7686;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #e6ebf2;
  --radius: 24px;
  --shadow: 0 6px 20px rgba(20,30,60,.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Trebuchet MS", "Segoe UI Rounded", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: linear-gradient(180deg, #8ed6ff 0%, #b9e6ff 45%, #d6f2ff 100%);
  min-height: 100vh;
}

/* ---------- cartoon background scene ---------- */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(180deg, #7ec8ff 0%, #aee3ff 50%, #d6f2ff 100%); }
.sun { position: absolute; top: 6%; right: 10%; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3a8, #ffd23f);
  box-shadow: 0 0 0 14px rgba(255,210,63,.25), 0 0 60px rgba(255,210,63,.6);
  animation: sunPulse 5s ease-in-out infinite; }
@keyframes sunPulse { 50% { transform: scale(1.06); } }
.cloud { position: absolute; background: #fff; border-radius: 50px; opacity: .92;
  width: 120px; height: 38px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.06)); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 55px; height: 55px; top: -22px; left: 18px; }
.cloud::after  { width: 38px; height: 38px; top: -14px; left: 64px; }
.c1 { top: 12%; left: -140px; transform: scale(1.1); animation: drift 38s linear infinite; }
.c2 { top: 26%; left: -160px; transform: scale(.8); animation: drift 52s linear infinite 6s; }
.c3 { top: 18%; left: -160px; transform: scale(1.3); animation: drift 64s linear infinite 14s; }
@keyframes drift { to { left: 115%; } }
.hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 42vh; min-height: 220px; }
.blades { transform-origin: center; animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tulip { animation: sway 4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
.tulip:nth-of-type(2) { animation-delay: .8s; } .tulip:nth-of-type(4) { animation-delay: 1.4s; }
@keyframes sway { 50% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .blades, .cloud, .sun, .tulip { animation: none; } }
#app { max-width: 620px; margin: 0 auto; padding: 14px; }
h2 { margin: 0 0 .3em; } h3 { margin: 1.2em 0 .4em; font-size: 1.02rem; }
.muted { color: var(--muted); font-size: .9rem; }
.err { color: var(--red); }

/* buttons */
.btn { border: none; border-radius: 14px; padding: 13px 18px; font-size: 1rem; font-weight: 600;
  background: #eef2f8; color: var(--ink); cursor: pointer; transition: transform .06s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--orange); color: #fff; box-shadow: 0 4px 0 var(--orange-d); }
.btn.primary:active { box-shadow: 0 1px 0 var(--orange-d); transform: translateY(3px); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.mini, .mini { padding: 6px; width: 70px; }
.btn.danger { color: var(--red); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }

/* header */
.top { display: flex; align-items: center; gap: 10px; padding: 6px 4px 14px; }
.mascot { font-size: 2.4rem; animation: bob 2.2s ease-in-out infinite; transform-origin: bottom center; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.top-stats { display: flex; gap: 10px; font-weight: 800; margin-left: auto; }
.top-stats span { background: #fff; padding: 7px 13px; border-radius: 30px; box-shadow: var(--shadow); border: 2px solid #fff; }

/* home */
.ring-card { background: var(--card); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); margin-bottom: 14px; }
.ring { --pct: 0; width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 8px;
  background: conic-gradient(var(--orange) calc(var(--pct) * 1%), #eef2f8 0);
  display: grid; place-items: center; }
.ring span { background: #fff; width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.ring span small { display: block; font-size: .7rem; color: var(--muted); font-weight: 600; }
.ring-label { font-weight: 700; margin: 4px 0; }
.level-bar { height: 9px; background: #eef2f8; border-radius: 10px; overflow: hidden; margin: 8px 0 2px; }
.level-bar i { display: block; height: 100%; background: var(--blue); }

.mission-card { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  background: linear-gradient(135deg, var(--orange), #ff9248); color: #fff; border: none;
  border-radius: var(--radius); padding: 18px; cursor: pointer; box-shadow: var(--shadow); margin-bottom: 14px; }
.mission-card:active { transform: scale(.99); }
.m-emoji { font-size: 2.4rem; }
.m-text { display: flex; flex-direction: column; flex: 1; }
.m-text b { font-size: .8rem; text-transform: uppercase; opacity: .85; letter-spacing: .5px; }
.m-text span { font-size: 1.15rem; font-weight: 700; }
.m-text small { opacity: .9; font-size: .82rem; }
.m-go { font-weight: 700; white-space: nowrap; }

.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.htile { position: relative; background: var(--card); border: none; border-radius: 14px; padding: 18px 12px;
  font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.htile:active { transform: scale(.98); }
.badge-dot { position: absolute; top: 8px; right: 10px; background: var(--red); color: #fff;
  border-radius: 20px; font-size: .75rem; padding: 1px 7px; }

/* panels & cards */
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 3px solid #fff; }
.ring-card, .mission-card, .htile, #ex, .ex-body { border: 3px solid rgba(255,255,255,.9); }
.mission-card:hover { transform: translateY(-2px) rotate(-.4deg); }
.card { background: #fbfcfe; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.card.reviewed { background: #f3fbf6; }
.card .resp { font-style: italic; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stat { background: #f6f9fd; border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.3rem; } .stat span { font-size: .78rem; color: var(--muted); }

/* skill bars */
.skill-row { display: grid; grid-template-columns: 110px 1fr 44px 50px; gap: 8px; align-items: center; margin: 6px 0; font-size: .9rem; }
.bar { height: 10px; background: #eef2f8; border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }

.act { display: grid; grid-template-columns: 110px 1fr 50px; gap: 8px; font-size: .82rem; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.stars button { background: none; border: none; font-size: 1.3rem; cursor: pointer; padding: 2px; }

/* exercise */
.ex-wrap { position: relative; }
.ex-wrap .quit { position: absolute; right: 0; top: -4px; z-index: 2; }
#ex, .ex-body { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.ex-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ex-skill { font-weight: 700; font-size: .85rem; padding: 5px 12px; border-radius: 20px; background: #eef2f8; }
.ex-skill.reading { background: #e8f0ff; color: var(--blue); }
.ex-skill.writing { background: #fdeee7; color: var(--orange-d); }
.ex-skill.listening { background: #eafaf2; color: var(--green); }
.ex-skill.speaking { background: #fdeaea; color: var(--red); }
.ex-count { color: var(--muted); font-weight: 600; }
.prompt { font-weight: 600; color: var(--muted); margin: 4px 0 14px; }
.big-nl { font-size: 1.5rem; font-weight: 800; margin: 6px 0 16px; }
.hint { color: var(--muted); margin-top: -8px; }
.speak { border: none; background: #eef2f8; border-radius: 10px; cursor: pointer; font-size: 1.1rem; padding: 4px 8px; }
.big-play { width: 100%; background: var(--blue); color: #fff; border: none; border-radius: 14px; padding: 16px; font-size: 1.1rem; font-weight: 700; cursor: pointer; margin-bottom: 14px; }
.choices { display: grid; gap: 10px; }
.choice { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 15px; font-size: 1.05rem; cursor: pointer; }
.choice:active { transform: scale(.99); }
.choice.right { border-color: var(--green); background: #eafaf2; }
.choice.wrong { border-color: var(--red); background: #fdeaea; }
.answer { width: 100%; padding: 15px; font-size: 1.1rem; border: 2px solid var(--line); border-radius: 14px; margin: 6px 0 12px; }
.answer:focus { outline: none; border-color: var(--orange); }
.tiles, .built { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; }
.built { border-bottom: 2px dashed var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.tile { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 11px 15px; font-size: 1.05rem; cursor: pointer; }
.tile.used { opacity: .3; pointer-events: none; }
.tile.chosen { background: #eef2f8; }
.say-area { text-align: center; }
.mic { width: 100%; }
.say-status { margin-top: 12px; min-height: 24px; }

/* feedback bar */
.feedback { margin-top: 16px; padding: 14px; border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.feedback.ok { background: #eafaf2; } .feedback.no { background: #fdeaea; }
.fb-msg { font-weight: 700; }

/* results */
.result { text-align: center; }
.big-score { font-size: 1.6rem; font-weight: 800; }
.xp-won { color: var(--green); font-weight: 800; font-size: 1.2rem; }
.badge-pop { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.badge-pop span { background: #fff7e6; border: 1px solid #ffe2a8; border-radius: 20px; padding: 8px 14px; font-weight: 700; }
.review-list { text-align: left; margin: 16px 0; }
.rl { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: center; }
.rl small { color: var(--muted); }

/* badges grid */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge { text-align: center; background: #fbfcfe; border: 1px solid var(--line); border-radius: 14px; padding: 16px 6px; font-size: .82rem; font-weight: 600; }
.badge .be { display: block; font-size: 2rem; margin-bottom: 4px; }
.badge.locked { opacity: .5; }
.badge.got { background: #fff7e6; border-color: #ffe2a8; }

label { font-size: .9rem; }
.note { color: var(--green); }
.stars-show b { color: var(--green); }
