/* Gedeelde stijl voor de spellingtools van Mijn Leerplein (Klankvanger, Lettersprinter, Verkleinfabriek, dt-Detective).
   Kleuren per tool staan in index.html (--acc, --acc-d, --bg). Andika (SIL Open Font License) zit lokaal in de map. */
@font-face { font-family: "Andika"; font-weight: 400; font-display: swap; src: url("andika-400.woff2") format("woff2"); }
@font-face { font-family: "Andika"; font-weight: 700; font-display: swap; src: url("andika-700.woff2") format("woff2"); }
:root {
  --acc: #1c7ed6; --acc-d: #1259a0; --acc-l: #e7f2fd; --bg: #eef6ff;
  --ink: #1d2533; --muted: #5d6779; --card: #fff; --line: #d8e2ef;
  --good: #2f9e44; --good-l: #ebfbee; --bad: #e03131; --bad-l: #fff0f0; --gold: #fcc419;
  --word: "Andika", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(circle at 8% 0%, #fff 0, transparent 40%), var(--bg);
  color: var(--ink); font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 19px; line-height: 1.4; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
.hidden { display: none !important; }
.w { font-family: var(--word); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--acc); color: #fff; position: sticky; top: 0; z-index: 30; height: 58px; box-shadow: 0 3px 0 var(--acc-d); }
.logo { font-weight: 900; font-size: 23px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-btn { background: rgba(255,255,255,.2); color: #fff; border-radius: 14px; padding: 7px 14px; font-weight: 800; font-size: 16px; white-space: nowrap; }
.top-btn b { background: #fff; color: var(--acc-d); border-radius: 8px; padding: 1px 7px; margin-left: 4px; font-size: 14px; }
.top-btn.off b { background: rgba(0,0,0,.25); color: #fff; }
main { max-width: 980px; margin: 0 auto; padding: 18px 16px 60px; }
h1 { font-size: 31px; margin: 6px 0; line-height: 1.15; }
h2 { font-size: 24px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.note { color: var(--muted); font-size: 15px; text-align: center; margin-top: 26px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--acc); color: #fff; font-weight: 900; font-size: 20px; border-radius: 18px; padding: 12px 24px; box-shadow: 0 5px 0 var(--acc-d); transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--acc-d); }
.btn.ghost { background: #fff; color: var(--acc-d); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn.big { font-size: 24px; padding: 15px 30px; }
.btn.hint { background: #f59f00; box-shadow: 0 5px 0 #b87400; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 16px 0; }
.say { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: #fff; border: 2px solid var(--line); font-size: 21px; box-shadow: 0 3px 0 var(--line); display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.say.speaking { background: #fff9db; border-color: var(--gold); animation: pulse .8s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.card { background: var(--card); border-radius: 24px; padding: 22px; box-shadow: 0 6px 0 var(--line), 0 10px 30px rgba(30,60,120,.07); margin-bottom: 18px; }
.talk { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 16px; }
.talk .mascot { font-size: 46px; line-height: 1; flex: 0 0 auto; }
.bubble { position: relative; background: var(--acc-l); border-radius: 20px; padding: 12px 56px 12px 16px; flex: 1; min-height: 52px; }
.bubble p { margin: 0; }
.bubble .say { position: absolute; right: 6px; top: 6px; }

/* start */
.hero { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero .txt { flex: 1 1 420px; }
.hero .art { font-size: 74px; line-height: 1; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 10px; }
.step { background: #fff; border-radius: 20px; padding: 16px; text-align: left; display: flex; gap: 12px; align-items: center; box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); position: relative; min-height: 96px; }
.step:hover { border-color: var(--acc); }
.step .ico { font-size: 36px; }
.step .nr { font-size: 13px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.step .nm { font-weight: 900; font-size: 19px; }
.step .st { font-size: 14px; color: var(--muted); }
.step .stars { position: absolute; right: 10px; top: 8px; font-size: 14px; }
.step.done { border-color: var(--good); }
.step.is-game { background: linear-gradient(135deg, #fff 60%, #fff4d6); }
.step.is-dip { background: linear-gradient(135deg, #fff 60%, #f3e8ff); }
.voicebox { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 22px; font-size: 15px; color: var(--muted); }
.voicebox select { font-size: 15px; max-width: 260px; }

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.back { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px; font-weight: 800; font-size: 16px; }
.progress { flex: 1; height: 14px; background: #fff; border-radius: 10px; border: 2px solid var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .3s; }
.count { font-weight: 800; color: var(--muted); font-size: 16px; min-width: 56px; text-align: right; }

/* vraag */
.q { text-align: center; }
.q .pic { font-size: 64px; line-height: 1.1; }
.q .vraag { font-family: var(--word); font-size: 44px; font-weight: 700; margin: 8px 0; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.q .vraag.zin { font-size: 30px; line-height: 1.35; }
.q .klein { color: var(--muted); font-size: 18px; }
.gap { display: inline-block; min-width: 1.4em; border-bottom: 4px solid var(--acc); color: var(--acc); padding: 0 4px; line-height: 1.1; }
.gap.vol { border-bottom-color: var(--good); color: var(--good); }
.opts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 18px 0 8px; }
.opt { font-family: var(--word); font-size: 30px; font-weight: 700; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 10px 22px; min-width: 96px; box-shadow: 0 5px 0 var(--line); }
.opt:hover { border-color: var(--acc); }
.opt.good { background: var(--good-l); border-color: var(--good); }
.opt.wrong { background: var(--bad-l); border-color: var(--bad); animation: shake .4s; }
.opt[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback { min-height: 30px; margin-top: 8px; font-size: 20px; text-align: center; }
.feedback.good { color: var(--good); font-weight: 800; }
.feedback.bad { color: var(--ink); background: var(--bad-l); border-radius: 16px; padding: 12px 14px; text-align: left; }
.feedback .fx { display: block; margin-top: 6px; font-family: var(--word); font-size: 26px; font-weight: 700; text-align: center; }
.hintbox { background: #fff8e6; border: 2px dashed #f59f00; border-radius: 16px; padding: 10px 14px; margin-top: 10px; text-align: left; font-size: 18px; }
.kn { font-family: var(--word); font-weight: 700; }
.kl-k { color: #e8590c; } .kl-l { color: #1c7ed6; } .mk { color: #9c36b5; font-weight: 900; }

/* uitleg */
.beeld { margin: 10px 0 6px; text-align: center; }
.tegels { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.tegel { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; min-width: 110px; text-align: center; box-shadow: 0 4px 0 var(--line); }
.tegel .e { font-size: 40px; line-height: 1.1; }
.tegel .t { font-family: var(--word); font-size: 26px; font-weight: 700; }
.tegel .s { font-size: 14px; color: var(--muted); }
.plan { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 10px; }
.plan li { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; }
.plan .n { background: var(--acc); color: #fff; border-radius: 50%; width: 34px; height: 34px; flex: 0 0 34px; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.plan .e { font-size: 28px; }
.regel { background: var(--acc-l); border-radius: 16px; padding: 12px 16px; margin: 8px 0; font-size: 20px; }
table.rt { border-collapse: collapse; margin: 10px auto; font-size: 18px; background: #fff; border-radius: 12px; overflow: hidden; }
table.rt th, table.rt td { border: 2px solid var(--line); padding: 6px 12px; text-align: center; }
table.rt th { background: var(--acc-l); }
table.rt td .w { font-size: 22px; font-weight: 700; }

/* resultaat */
.result { text-align: center; }
.big-stars { font-size: 46px; letter-spacing: 4px; }
.off { filter: grayscale(1); opacity: .3; }
.fouten { text-align: left; max-width: 560px; margin: 10px auto; font-size: 17px; }
.fouten li { margin: 4px 0; }

/* levels */
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.lvl { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; text-align: left; box-shadow: 0 4px 0 var(--line); }
.lvl .ln { font-weight: 900; }
.lvl .ls { font-size: 14px; color: var(--muted); }
.lvl .lst { float: right; font-size: 14px; }
.lvl.locked { opacity: .45; }
.lvl.done { border-color: var(--good); }

/* spelveld */
.hud { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; font-weight: 800; }
.hud .hearts { font-size: 22px; letter-spacing: 2px; }
.hud .pts { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 2px 10px; }
.banner { background: #fff; border-radius: 18px; border: 3px solid var(--acc); padding: 8px 12px; text-align: center; margin-bottom: 8px; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.banner .pic { font-size: 36px; }
.banner .vraag { font-family: var(--word); font-size: 32px; font-weight: 700; }
.banner .vraag.zin { font-size: 23px; }
.banner .klein { color: var(--muted); font-size: 16px; width: 100%; margin-top: -4px; }
.veld { position: relative; height: min(430px, 58vh); min-height: 300px; border-radius: 22px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: inset 0 0 0 3px rgba(0,0,0,.06); }
.veld .lane { position: absolute; }
.tok { position: absolute; left: 0; top: 0; font-family: var(--word); font-weight: 700; display: flex; align-items: center; justify-content: center; will-change: transform; }
.pop-txt { position: absolute; font-weight: 900; font-size: 28px; color: var(--good); pointer-events: none; animation: rise 0.9s forwards; z-index: 6; text-shadow: 0 2px 0 #fff; }
.pop-txt.bad { color: var(--bad); }
@keyframes rise { to { transform: translateY(-50px); opacity: 0; } }
.overlay { position: absolute; inset: 0; background: rgba(20,30,50,.45); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 14px; }
.overlay .box { background: #fff; border-radius: 22px; padding: 18px 20px; max-width: 520px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); max-height: 100%; overflow: auto; }
.overlay .box .fx { font-family: var(--word); font-size: 30px; font-weight: 700; margin: 6px 0; }
.overlay .box .ux { text-align: left; font-size: 18px; }
.ctrl-help { text-align: center; color: var(--muted); font-size: 14px; margin-top: 6px; }
.knoppen { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.knoppen .opt { font-size: 26px; min-width: 90px; }
.knoppen .opt kbd { font-size: 12px; color: var(--muted); display: block; font-family: system-ui; }
.flash-bad { animation: flashbad .5s; }
@keyframes flashbad { 30% { box-shadow: inset 0 0 0 8px var(--bad); } }

/* diploma */
.diploma { background: #fff; border: 10px double var(--acc); border-radius: 26px; padding: 30px; text-align: center; max-width: 720px; margin: 0 auto; }
.diploma h1 { font-size: 46px; color: var(--acc-d); }
.diploma .naam { font-family: var(--word); font-size: 38px; font-weight: 700; border-bottom: 3px solid var(--line); min-height: 52px; margin: 10px auto; max-width: 460px; }
.diploma .art { font-size: 70px; }
.naamveld { font-size: 20px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 14px; z-index: 50; font-size: 16px; max-width: 92vw; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 25px; }
  .logo { font-size: 19px; }
  .top-btn .bt { display: none; }
  .card { padding: 16px; }
  .q .vraag { font-size: 36px; }
  .q .vraag.zin { font-size: 24px; }
  .banner .vraag { font-size: 26px; }
  .banner .vraag.zin { font-size: 19px; }
  .opt { font-size: 25px; padding: 8px 16px; min-width: 76px; }
  .btn.big { font-size: 20px; padding: 13px 22px; }
}
@media print {
  body { background: #fff; }
  .top, .no-print, .topbar { display: none !important; }
  .diploma { border-color: #555; }
}
