/* Lettertype Nunito wordt lokaal meegeleverd (geen verbinding met externe servers nodig). Licentie: fonts/OFL-LICENSE.txt */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 900; font-display: swap; src: url('../fonts/nunito-latin-900-normal.woff2') format('woff2'); }
:root {
  --black: #0b0b0b;
  --coal: #151515;
  --coal-2: #1e1e1e;
  --coal-3: #2a2a2a;
  --line: #333;
  --yellow: #ffd100;
  --yellow-2: #ffe14d;
  --yellow-dark: #b89400;
  --text: #f4f1e8;
  --muted: #9b968a;
  --good: #52c96b;
  --good-dark: #2f8f45;
  --bad: #ff5a4f;
  --bad-dark: #b8322a;
  --radius: 16px;
  --font: 'Nunito', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --hazard: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--black) 14px 28px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--black);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 209, 0, .05), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 209, 0, .04), transparent 45%);
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  background-attachment: fixed;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; border-right: 2px solid var(--coal-3); padding: 22px 14px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; background: var(--black);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand .name { font-size: 25px; font-weight: 900; color: var(--yellow); letter-spacing: -.5px; line-height: 1; }
.brand .name small { display: block; white-space: nowrap; font-size: 10.5px; color: var(--muted); letter-spacing: .5px; font-weight: 800; margin-top: 3px; }
.nav-btn {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; border: 2px solid transparent;
  background: none; color: var(--muted); font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; text-align: left;
}
.nav-btn .ic { font-size: 26px; }
.nav-btn:hover { background: var(--coal-2); color: var(--text); }
.nav-btn.active { border-color: var(--yellow); background: rgba(255, 209, 0, .08); color: var(--yellow); }
.main { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 40px; padding: 0 20px; }
.column { width: 100%; max-width: 600px; padding-bottom: 120px; }
.rightbar { width: 330px; flex: none; padding-top: 18px; position: sticky; top: 0; height: 100vh; overflow: auto; }
@media (max-width: 1100px) { .rightbar { display: none; } }
@media (max-width: 760px) {
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: 100%; height: auto; flex-direction: row;
    justify-content: space-around; border-right: 0; border-top: 2px solid var(--coal-3); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
  .brand { display: none; }
  .nav-btn { flex-direction: column; gap: 2px; font-size: 10px; padding: 6px 10px; }
  .nav-btn span { display: none; }
  .main { padding: 0 12px; }
}

/* ---------- top stats bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--black); display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; border-bottom: 2px solid var(--coal-3); margin-bottom: 18px;
}
.topbar .mini-brand { display: none; color: var(--yellow); font-weight: 900; font-size: 20px; }
@media (max-width: 760px) { .topbar .mini-brand { display: flex; align-items: center; gap: 6px; } }
.stats { display: flex; gap: 18px; margin-left: auto; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 900; color: var(--muted); background: none; border: 0; padding: 4px 6px; border-radius: 10px; }
.stat .ic { font-size: 24px; }
.stat.fire.on { color: #ff9a1f; }
.stat.coal { color: var(--text); }
.stat.coal .ic { color: #26262a; }
.stat.lamps { color: var(--yellow); }
.stat:hover { background: var(--coal-2); }

/* ---------- side cards ---------- */
.card { background: var(--coal); border: 2px solid var(--coal-3); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 900; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.rank-card { display: flex; gap: 14px; align-items: center; }
.rank-name { color: var(--yellow); font-size: 22px; font-weight: 900; }
.bar { height: 14px; border-radius: 99px; background: var(--coal-3); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; transition: width .5s; box-shadow: inset 0 -3px rgba(0, 0, 0, .18); }
.bar.hazard > i { background: var(--hazard); background-size: 40px 40px; animation: slide 1.2s linear infinite; transition: width .7s cubic-bezier(.22, 1, .36, 1); will-change: width; }
@keyframes slide { to { background-position: 40px 0; } }

/* ---------- section + unit headers ---------- */
.section-head {
  margin: 34px 0 18px; padding: 22px; border-radius: 20px; position: relative; overflow: hidden;
  background: var(--coal); border: 2px solid var(--coal-3);
}
.section-head::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--hazard); }
.section-head .label { color: var(--muted); font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 900; margin-top: 4px; }
.section-head h2 { margin: 4px 0 6px; font-size: 28px; font-weight: 900; color: var(--yellow); }
.section-head p { margin: 0; color: var(--muted); max-width: 400px; font-size: 15px; line-height: 1.4; }
.section-head .schachtbok { position: absolute; right: 18px; bottom: 0; opacity: .9; }
.section-head .sec-progress { margin-top: 12px; max-width: 360px; font-size: 13px; color: var(--muted); }
.section-head.locked h2 { color: var(--muted); }
@media (max-width: 520px) { .section-head .schachtbok { height: 54px; opacity: .35; right: 10px; } .section-head p { max-width: 100%; } }

.unit { position: relative; padding-bottom: 10px; }
.unit-head {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-radius: var(--radius); margin: 26px 0 72px;
  background: var(--yellow); color: var(--black); box-shadow: 0 5px 0 var(--yellow-dark);
}
.unit-head.dark { background: var(--coal-2); color: var(--yellow); box-shadow: 0 5px 0 #000; border: 2px solid var(--yellow); }
.unit-head.locked { background: var(--coal-2); color: var(--muted); box-shadow: 0 5px 0 #000; border: 2px solid var(--coal-3); }
.unit-head .u-label { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; font-weight: 900; opacity: .75; }
.unit-head .u-title { font-size: 22px; font-weight: 900; line-height: 1.15; }
.unit-head .u-kr { font-size: 15px; font-weight: 800; font-style: italic; opacity: .85; }
.guide-btn {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; font-weight: 900; font-size: 14px;
  text-transform: uppercase; letter-spacing: .5px; border: 2px solid rgba(0, 0, 0, .25); background: rgba(0, 0, 0, .08); color: inherit;
}
.unit-head.dark .guide-btn, .unit-head.locked .guide-btn { border-color: var(--coal-3); background: var(--coal); }
.guide-btn .ic { font-size: 20px; }
@media (max-width: 500px) { .guide-btn span { display: none; } .unit-head .u-title { font-size: 19px; } }

/* ---------- the path ---------- */
.path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 6px 0 8px; }
.node-wrap { position: relative; }
.node-wrap.has-pop { z-index: 12; }
.node {
  width: 74px; height: 70px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 32px; position: relative;
  background: var(--yellow); color: var(--black); box-shadow: 0 8px 0 var(--yellow-dark); transition: transform .08s, box-shadow .08s;
}
.node:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--yellow-dark); }
.node.done { background: var(--yellow); }
.node.done .ic { color: var(--black); }
.node.locked { background: var(--coal-3); color: #5b5b5b; box-shadow: 0 8px 0 #111; }
.node.t-review { border-radius: 22px; }
.node.current::after {
  content: ''; position: absolute; inset: -11px -11px -17px; border-radius: 50%; border: 6px solid var(--coal-3);
  border-top-color: var(--yellow); animation: spin 2.4s linear infinite;
}
.node.t-review.current::after { border-radius: 28px; animation: none; border-color: var(--yellow); opacity: .5; }
@keyframes spin { to { transform: rotate(360deg); } }
.start-tip {
  position: absolute; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--coal); border: 2px solid var(--coal-3); color: var(--yellow); font-weight: 900; padding: 10px 14px; border-radius: 12px;
  font-size: 15px; letter-spacing: .5px; animation: bob 1.4s ease-in-out infinite; pointer-events: none; z-index: 2;
}
.start-tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 9px solid transparent; border-top-color: var(--coal-3); }
@keyframes bob { 50% { transform: translate(-50%, -6px); } }
.path-mascot { position: absolute; top: 50%; transform: translateY(-50%); opacity: .95; pointer-events: none; }
.path-mascot.left { left: 4%; } .path-mascot.right { right: 4%; }
@media (max-width: 520px) { .path-mascot { display: none; } }

/* popover on node click */
.pop {
  position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%); width: 290px; z-index: 15;
  background: var(--yellow); color: var(--black); border-radius: 16px; padding: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
.pop.dark { background: var(--coal-2); color: var(--text); border: 2px solid var(--coal-3); }
.pop::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border: 10px solid transparent; border-bottom-color: var(--yellow); }
.pop.dark::before { border-bottom-color: var(--coal-3); }
.pop h4 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.pop p { margin: 0 0 14px; font-size: 14px; opacity: .85; }
.pop .btn { width: 100%; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 14px 22px; font-weight: 900; font-size: 16px; letter-spacing: .8px; text-transform: uppercase;
  background: var(--yellow); color: var(--black); box-shadow: 0 5px 0 var(--yellow-dark); transition: transform .06s, box-shadow .06s, filter .1s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--yellow-dark); }
.btn.dark { background: var(--black); color: var(--yellow); box-shadow: 0 5px 0 #000; }
.btn.ghost { background: var(--coal-2); color: var(--text); box-shadow: 0 5px 0 #000; border: 2px solid var(--coal-3); }
.btn.good { background: var(--good); color: #062b10; box-shadow: 0 5px 0 var(--good-dark); }
.btn.bad { background: var(--bad); color: #2b0606; box-shadow: 0 5px 0 var(--bad-dark); }
.btn:disabled { background: var(--coal-3); color: #6b6b6b; box-shadow: 0 5px 0 #111; cursor: default; filter: none; transform: none; }
.btn.small { padding: 10px 14px; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .8px; font-size: 14px; padding: 10px; }
.linkbtn:hover { color: var(--text); }

/* ---------- lesson ---------- */
.lesson { min-height: 100vh; display: flex; flex-direction: column; }
.lesson-top { display: flex; align-items: center; gap: 16px; max-width: 1000px; width: 100%; margin: 0 auto; padding: 26px 20px 10px; }
.lesson-top .x { background: none; border: 0; color: var(--muted); font-size: 26px; padding: 4px; display: flex; }
.lesson-top .x:hover { color: var(--text); }
.lesson-top .bar { flex: 1; height: 18px; margin: 0; }
.lesson-top .lamps-count { color: var(--yellow); font-weight: 900; font-size: 19px; display: flex; gap: 6px; align-items: center; }
.lesson-top .lamps-count .ic { font-size: 26px; }
.lesson-top .lamps-count.inf { color: var(--muted); }
.lesson-body { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 20px 200px; }
.ex-kicker { color: var(--yellow); font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.ex-title { font-size: 28px; font-weight: 900; margin: 0 0 24px; line-height: 1.2; }
.prompt-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 26px; }
.bubble {
  position: relative; background: var(--coal); border: 2px solid var(--coal-3); border-radius: 16px; padding: 14px 18px; font-size: 22px; font-weight: 900; margin-bottom: 40px;
}
.bubble::before { content: ''; position: absolute; left: -12px; bottom: 18px; border: 10px solid transparent; border-right-color: var(--coal-3); border-left: 0; }
.bubble.kr { color: var(--yellow); }
.bubble .note { display: block; font-size: 13px; color: var(--muted); font-weight: 800; margin-top: 4px; }

.options { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; border-radius: 14px; font-size: 18px; font-weight: 800;
  background: var(--coal); color: var(--text); border: 2px solid var(--coal-3); box-shadow: 0 4px 0 var(--coal-3); transition: transform .05s;
}
.opt:hover { background: var(--coal-2); }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--coal-3); }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--coal-3); display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.opt.sel { border-color: var(--yellow); background: rgba(255, 209, 0, .1); box-shadow: 0 4px 0 var(--yellow-dark); color: var(--yellow); }
.opt.sel .k { border-color: var(--yellow); color: var(--yellow); }
.opt.right { border-color: var(--good); color: var(--good); box-shadow: 0 4px 0 var(--good-dark); background: rgba(82, 201, 107, .08); }
.opt.wrong { border-color: var(--bad); color: var(--bad); box-shadow: 0 4px 0 var(--bad-dark); background: rgba(255, 90, 79, .08); animation: shake .3s; }
.opt.gone { opacity: .25; pointer-events: none; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.opt.kr-opt { color: var(--yellow); }
.opt.kr-opt.sel { color: var(--yellow); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .col { display: grid; gap: 12px; }
.match .opt { justify-content: center; text-align: center; min-height: 62px; font-size: 17px; }

.type-area {
  width: 100%; min-height: 130px; border-radius: 14px; background: var(--coal); border: 2px solid var(--coal-3); color: var(--text);
  font-family: var(--font); font-size: 22px; font-weight: 800; padding: 16px; resize: none; outline: none;
}
.type-area:focus { border-color: var(--yellow); }
.chars { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chars button { min-width: 44px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--coal-3); background: var(--coal); color: var(--text); font-size: 18px; font-weight: 800; box-shadow: 0 3px 0 var(--coal-3); }
.chars button:active { transform: translateY(2px); box-shadow: none; }

.tiles-answer { min-height: 70px; border-bottom: 2px solid var(--coal-3); border-top: 2px solid var(--coal-3); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; margin-bottom: 26px; }
.tiles-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tile { padding: 10px 14px; border-radius: 12px; border: 2px solid var(--coal-3); background: var(--coal); color: var(--yellow); font-size: 18px; font-weight: 800; box-shadow: 0 4px 0 var(--coal-3); }
.tile.nl { color: var(--text); }
.modal .guide-sub { margin: 22px 0 0; font-size: 18px; font-weight: 900; color: var(--text); }
.tile.used { color: transparent; background: var(--coal-3); box-shadow: none; pointer-events: none; }

.intro-card { text-align: center; padding: 30px 20px; background: var(--coal); border: 2px solid var(--coal-3); border-radius: 22px; position: relative; overflow: hidden; }
.intro-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--hazard); }
.intro-card .big { font-size: 46px; font-weight: 900; color: var(--yellow); margin: 10px 0 6px; word-break: break-word; }
.intro-card .mean { font-size: 22px; font-weight: 800; }
.intro-card .alt { color: var(--muted); font-size: 15px; margin-top: 14px; }
.intro-card .alt b { color: var(--text); }
.intro-card .note { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 99px; background: var(--coal-3); color: var(--muted); font-size: 13px; }

/* footer check bar */
.check-bar { position: fixed; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--coal-3); background: var(--black); z-index: 40; }
.check-inner { max-width: 1000px; margin: 0 auto; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.check-bar .btn { min-width: 170px; }
.check-bar.good { background: #0f2414; border-top-color: #0f2414; }
.check-bar.bad { background: #2a0f0d; border-top-color: #2a0f0d; }
.fb { display: flex; align-items: center; gap: 14px; }
.fb .badge { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; flex: none; }
.check-bar.good .badge { background: var(--good); color: #0f2414; }
.check-bar.bad .badge { background: var(--bad); color: #2a0f0d; }
.fb h3 { margin: 0; font-size: 23px; font-weight: 900; }
.check-bar.good h3 { color: var(--good); }
.check-bar.bad h3 { color: var(--bad); }
.fb p { margin: 3px 0 0; font-size: 16px; }
.check-bar.good .fb p { color: #bdf0c8; }
.check-bar.bad .fb p { color: #ffcdc9; }
@media (max-width: 600px) {
  .check-inner { flex-direction: column; align-items: stretch; }
  .check-bar .btn { width: 100%; }
  .fb .badge { display: none; }
  .ex-title { font-size: 23px; }
}

/* result screen */
.result { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 20px 140px; }
.result h1 { color: var(--yellow); font-size: 36px; font-weight: 900; margin: 18px 0 6px; }
.result .sub { color: var(--muted); margin-bottom: 28px; font-size: 17px; }
.result-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.rstat { width: 150px; border-radius: 16px; border: 2px solid var(--yellow); overflow: hidden; background: var(--yellow); }
.rstat .t { color: var(--black); font-size: 13px; font-weight: 900; padding: 6px; text-transform: uppercase; letter-spacing: 1px; }
.rstat .v { background: var(--black); margin: 0 2px 2px; border-radius: 13px; padding: 16px 6px; font-size: 24px; font-weight: 900; color: var(--yellow); display: flex; gap: 8px; justify-content: center; align-items: center; }
.rstat.alt { border-color: #8f8f8f; background: #8f8f8f; } .rstat.alt .v { color: var(--text); }
.big-fire { font-size: 120px; color: #ff9a1f; line-height: 1; }
.streak-num { font-size: 80px; font-weight: 900; color: #ff9a1f; line-height: 1; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: 86vh; overflow: auto; background: var(--coal); border: 2px solid var(--coal-3); border-radius: 22px; padding: 26px; position: relative; }
.modal h2 { margin: 0 0 6px; font-size: 25px; font-weight: 900; color: var(--yellow); }
.modal .muted { color: var(--muted); font-size: 15px; }
.modal .x { position: absolute; top: 16px; right: 16px; background: none; border: 0; color: var(--muted); font-size: 22px; }
.modal-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.wordlist { display: grid; gap: 8px; margin-top: 16px; }
.wl-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--coal-2); border: 2px solid var(--coal-3); }
.wl-row .kr { color: var(--yellow); font-weight: 900; }
.wl-row .nl { color: var(--text); text-align: right; }
.wl-row small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; }

/* pages */
.page-title { font-size: 30px; font-weight: 900; margin: 6px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.practice-card { display: flex; align-items: center; gap: 18px; text-align: left; width: 100%; color: var(--text); }
.practice-card .pc-icon { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 34px; background: var(--yellow); color: var(--black); flex: none; box-shadow: 0 4px 0 var(--yellow-dark); }
.practice-card h3 { margin: 0 0 4px; }
.practice-card[disabled] { opacity: .5; cursor: default; }
.search-box { width: 100%; font-size: 19px; font-weight: 800; padding: 16px 18px; border-radius: 14px; border: 2px solid var(--coal-3); background: var(--coal); color: var(--text); outline: none; }
.search-box:focus { border-color: var(--yellow); }
.seg { display: flex; gap: 8px; margin: 12px 0 16px; }
.seg button { flex: 1; padding: 10px; border-radius: 12px; border: 2px solid var(--coal-3); background: var(--coal); color: var(--muted); font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.seg button.on { border-color: var(--yellow); color: var(--yellow); }
.dict-count { color: var(--muted); font-size: 13px; margin: 10px 2px; }
.ranks { display: grid; gap: 10px; }
.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--coal-3); background: var(--coal); }
.rank-row .rn { font-weight: 900; font-size: 18px; }
.rank-row .rd { color: var(--muted); font-size: 13px; }
.rank-row .rx { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.rank-row.reached { border-color: var(--yellow); }
.rank-row.reached .rn { color: var(--yellow); }
.rank-row .num { width: 36px; height: 36px; border-radius: 10px; background: var(--coal-3); display: grid; place-items: center; font-weight: 900; flex: none; }
.rank-row.reached .num { background: var(--yellow); color: var(--black); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.stat-box { display: flex; gap: 12px; align-items: center; padding: 14px; border: 2px solid var(--coal-3); border-radius: 14px; background: var(--coal); }
.stat-box .ic { font-size: 28px; }
.stat-box b { display: block; font-size: 20px; font-weight: 900; }
.stat-box span { color: var(--muted); font-size: 13px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 2px solid var(--coal-3); }
.toggle-row:first-of-type { border-top: 0; }
.switch { width: 54px; height: 30px; border-radius: 99px; background: var(--coal-3); border: 0; position: relative; flex: none; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch.on { background: var(--yellow); }
.switch.on::after { left: 28px; background: var(--black); }
.hero { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 20px; background: var(--yellow); color: var(--black); margin-bottom: 22px; box-shadow: 0 6px 0 var(--yellow-dark); }
.hero h2 { margin: 0; font-size: 26px; font-weight: 900; }
.hero p { margin: 4px 0 0; font-weight: 800; opacity: .8; }
.footer-note { color: #5c5a54; font-size: 12px; text-align: center; margin-top: 40px; line-height: 1.5; }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--yellow); color: var(--black); padding: 12px 20px; border-radius: 12px; font-weight: 900; z-index: 200; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); animation: fade .2s; }
.rank-row .rank-face { flex: none; width: 52px; height: 52px; display: grid; place-items: center; }
.rank-row:not(.reached) .rank-face { filter: grayscale(.85) brightness(.7); }
/* geluid */
.lesson-top .sound-btn { background: none; border: 0; color: var(--muted); font-size: 24px; padding: 4px; display: flex; }
.lesson-top .sound-btn:hover { color: var(--text); }
.lesson-top .sound-btn.off { color: #5b5b5b; }
.toggle-row.dim > div:first-child { opacity: .45; }
.vol-wrap { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 20px; flex: none; }
.vol-wrap input[type=range] { width: 150px; accent-color: var(--yellow); }
.switch:disabled { opacity: .4; cursor: default; }

/* ---------- eenheid: kop + mijntafereel als één blok ---------- */
.unit { margin: 30px 0 0; padding-bottom: 0; border: 3px solid var(--yellow); border-radius: 20px; background: #17130f; box-shadow: 0 6px 0 #000; }
.unit.u-dark { border-color: var(--yellow); }
.unit.u-locked { border-color: var(--coal-3); }
.unit .unit-head { margin: 0; border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.unit .unit-head.dark { border: 0; border-bottom: 3px solid var(--yellow); }
.unit .unit-head.locked { border: 0; border-bottom: 3px solid var(--coal-3); }
.unit .path { padding: 92px 0 56px; gap: 22px; isolation: isolate; border-radius: 0 0 17px 17px; }
.path > svg.scene { position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; border-radius: 0 0 17px 17px; }
.path .node-wrap { z-index: 2; }
.path .node-wrap.has-pop { z-index: 12; }
.path-mascot { z-index: 1; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); }
.path-mascot.left { left: 26px; } .path-mascot.right { right: 26px; }
.path.locked > svg.scene { filter: grayscale(.85) brightness(.5); }
.path .lamp { animation: swing 4.5s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .path .lamp { animation: none; } }

/* animaties lopen in fase door, ook als de pagina opnieuw wordt opgebouwd */
.node.current::after, .start-tip, .path .lamp, .bar.hazard > i { animation-delay: calc(var(--now, 0s) * -1); }
.start-tip[hidden] { display: none; }
.path .lamp.still { animation: none; }

/* START-wolkje naast de les in plaats van erboven (bedekt dan geen andere les) */
.start-tip { bottom: auto; top: 50%; left: auto; right: calc(100% + 16px); transform: translateY(-50%); animation-name: bob-side; }
.start-tip::after { top: 50%; left: 100%; transform: translateY(-50%); border: 9px solid transparent; border-left-color: var(--coal-3); }
@keyframes bob-side { 50% { transform: translate(-6px, -50%); } }

/* bovengronds: horizon boven de eerste les, lessen staan op het pad */
.unit .path.surface { padding-top: 250px; }
.path.surface .node.locked { background: #a49c8b; color: #efe9dc; box-shadow: 0 8px 0 #77705f; }
.path.surface .node.current::after { border-color: rgba(0, 0, 0, .25); border-top-color: var(--yellow); }
.path.surface.locked > svg.scene { filter: saturate(.55) brightness(.8); }

.path.under .path-mascot.left { left: 58px; }
.unit.pop-open { position: relative; z-index: 25; }

/* goed/fout bij meerkeuze: ook het cijfer en de rand kleuren mee */
.opt.right, .opt.sel.right, .opt.kr-opt.right, .opt.kr-opt.sel.right { border-color: var(--good); color: var(--good); box-shadow: 0 4px 0 var(--good-dark); background: rgba(82, 201, 107, .1); }
.opt.right .k { border-color: var(--good); color: var(--good); background: rgba(82, 201, 107, .12); }
.opt.wrong, .opt.sel.wrong, .opt.kr-opt.wrong, .opt.kr-opt.sel.wrong { border-color: var(--bad); color: var(--bad); box-shadow: 0 4px 0 var(--bad-dark); }
.opt.wrong .k { border-color: var(--bad); color: var(--bad); }

/* zinnen: typen bij de blokjes */
.tile.ghost { display: inline-flex; align-items: center; min-width: 14px; border-style: dashed; box-shadow: none; background: transparent; }
.tile.ghost.empty { border-color: transparent; padding-left: 2px; padding-right: 2px; }
.tile.ghost.bad { border-color: var(--bad); color: var(--bad); animation: shake .3s; }
.tile.ghost .caret { display: inline-block; width: 2px; height: 22px; margin-left: 2px; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.type-hint { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 18px; }
.mode-row { display: flex; justify-content: center; margin-top: 14px; }
.mode-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 2px solid var(--coal-3); color: var(--muted); border-radius: 12px; padding: 8px 14px; font-weight: 900; font-size: 14px; letter-spacing: .4px; text-transform: uppercase; }
.mode-btn:hover { color: var(--text); border-color: var(--muted); }
.mode-btn .ic { font-size: 20px; }

/* koempels op een eenheid die nog op slot zit: net zo kleurloos als het tafereel */
.path.locked .path-mascot { filter: grayscale(1) brightness(.5) drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); }
.path.surface.locked .path-mascot { filter: grayscale(.8) brightness(.8) drop-shadow(0 4px 4px rgba(0, 0, 0, .5)); }

/* wind en beweging in de taferelen */
.scene .sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite alternate; }
.scene .sway.s2 { animation-duration: 6.5s; animation-delay: -2s; }
.scene .sway.s3 { animation-duration: 4.2s; animation-delay: -3.3s; }
@keyframes sway { from { transform: skewX(2.2deg); } to { transform: skewX(-2.2deg); } }
.scene .sway-soft { transform-box: fill-box; transform-origin: 50% 100%; animation: sway-soft 6s ease-in-out infinite alternate; }
@keyframes sway-soft { from { transform: skewX(1deg); } to { transform: skewX(-1.2deg); } }
.scene .blades { transform-box: fill-box; transform-origin: 50% 100%; animation: blades 3.6s ease-in-out infinite alternate; }
.scene .blades.b2 { animation-duration: 4.4s; animation-delay: -1.5s; }
.scene .blades.b3 { animation-duration: 3.1s; animation-delay: -2.4s; }
@keyframes blades { from { transform: skewX(4deg); } to { transform: skewX(-3deg); } }
.scene .cloud { animation: drift 70s linear infinite alternate; }
.scene .cloud.c2 { animation-duration: 95s; animation-delay: -30s; }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(40px); } }
.scene .flag { transform-box: fill-box; transform-origin: 0 50%; animation: flag 1.6s ease-in-out infinite alternate; }
@keyframes flag { from { transform: skewY(5deg) scaleX(.94); } to { transform: skewY(-5deg) scaleX(1); } }
.scene .peck { transform-box: fill-box; transform-origin: 30% 90%; animation: peck 3.2s ease-in-out infinite; }
@keyframes peck { 0%, 55%, 100% { transform: rotate(0); } 65%, 75% { transform: rotate(24deg); } 70% { transform: rotate(18deg); } }
.scene .walk { animation: walk 14s ease-in-out infinite alternate; }
@keyframes walk { 0%, 10% { transform: translateX(0); } 45%, 55% { transform: translateX(-14px); } 90%, 100% { transform: translateX(6px); } }
.scene .graze { transform-box: fill-box; transform-origin: 80% 50%; animation: graze 7s ease-in-out infinite; }
@keyframes graze { 0%, 40%, 100% { transform: rotate(0); } 50%, 80% { transform: rotate(22deg); } }
.scene .bob { animation: bob-horse 1.8s ease-in-out infinite alternate; }
.scene .bob.o2 { animation-delay: -.9s; }
@keyframes bob-horse { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
.scene .flap { transform-box: fill-box; transform-origin: 50% 0; animation: flap 2.4s ease-in-out infinite alternate; }
.scene .flap.f2 { animation-delay: -1.1s; animation-duration: 2s; }
@keyframes flap { from { transform: skewX(6deg); } to { transform: skewX(-6deg); } }
.scene .smoke { animation: smoke 6s linear infinite; }
.scene .smoke.k2 { animation-delay: -3s; }
@keyframes smoke { from { transform: translate(0, 6px) scale(.6); opacity: 0; } 20% { opacity: .55; } to { transform: translate(26px, -26px) scale(1.5); opacity: 0; } }
.scene .ripple { animation: ripple 3.5s ease-in-out infinite alternate; }
@keyframes ripple { from { transform: translateX(-6px); opacity: .4; } to { transform: translateX(6px); opacity: .85; } }
.path.locked .scene *, .path.offscreen .scene * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .scene * { animation: none !important; } }

.scene .smoke { transform-box: fill-box; transform-origin: center; }
.scene .wing { transform-box: fill-box; transform-origin: 50% 100%; animation: wing .45s ease-in-out infinite alternate; }
.scene .wing.w2 { animation-delay: -.2s; animation-duration: .5s; }
@keyframes wing { from { transform: scaleY(1); } to { transform: scaleY(-.4); } }

/* kermislampjes knipperen, botsautootjes botsen */
.scene .blink { animation: blink-bulb 1.2s steps(1) infinite; }
.scene .blink.b1 { animation-delay: -.4s; } .scene .blink.b2 { animation-delay: -.8s; }
@keyframes blink-bulb { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .35; } }
.scene .bump { animation: bump 3s ease-in-out infinite alternate; }
.scene .bump.k1 { animation-duration: 2.3s; animation-direction: alternate-reverse; } .scene .bump.k2 { animation-duration: 3.6s; }
@keyframes bump { 0%, 20% { transform: translateX(-10px); } 80%, 100% { transform: translateX(10px); } }

/* eenheden met een groot herkenningspunt (kerk, Markt) krijgen meer ruimte boven de eerste les */
.unit .path.surface.tall-bg { padding-top: 360px; }

/* dieren (eenheid 12): lichte animaties */
.scene .wag, .scene .pant, .scene .swish, .scene .nod, .scene .ear, .scene .crawl, .scene .scurry, .scene .tongue, .scene .peckb,
.scene .crow, .scene .bobw, .scene .headbob, .scene .blinkeye, .scene .hop, .scene .webbob, .scene .buzz, .scene .flutter { transform-box: fill-box; }
.scene .wag { animation: wag .5s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.scene .pant { animation: pant .6s ease-in-out infinite alternate; }
@keyframes pant { from { transform: scaleY(.6); } to { transform: scaleY(1.15); } }
.scene .swish { animation: swish 3s ease-in-out infinite alternate; }
@keyframes swish { 0%, 30% { transform: rotate(-6deg); } 70%, 100% { transform: rotate(8deg); } }
.scene .nod { animation: nod 4s ease-in-out infinite; }
@keyframes nod { 0%, 60%, 100% { transform: rotate(0); } 75% { transform: rotate(7deg); } 85% { transform: rotate(-3deg); } }
.scene .ear { animation: ear 3.4s ease-in-out infinite; }
@keyframes ear { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-12deg); } 92% { transform: rotate(6deg); } }
.scene .crawl { animation: crawl 10s ease-in-out infinite alternate; }
.scene .crawl.slow { animation-duration: 22s; }
@keyframes crawl { from { transform: translateX(-6px); } to { transform: translateX(6px); } }
.scene .scurry { animation: scurry 6s ease-in-out infinite; }
@keyframes scurry { 0%, 40% { transform: translateX(0); } 50%, 85% { transform: translateX(10px); } 95%, 100% { transform: translateX(0); } }
.scene .tongue { animation: tongue 1.6s steps(1) infinite; }
@keyframes tongue { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.scene .peckb { animation: peck 3s ease-in-out infinite; transform-origin: 30% 90%; }
.scene .crow { animation: crow 6s ease-in-out infinite; }
@keyframes crow { 0%, 70%, 100% { transform: rotate(0); } 78%, 90% { transform: rotate(-16deg); } }
.scene .bobw { animation: bobw 3s ease-in-out infinite alternate; }
@keyframes bobw { from { transform: translateY(-1px) rotate(-2deg); } to { transform: translateY(1.5px) rotate(2deg); } }
.scene .headbob { animation: headbob .9s ease-in-out infinite alternate; }
@keyframes headbob { from { transform: translateX(-1.5px); } to { transform: translateX(1.5px); } }
.scene .blinkeye { animation: blinkeye 4s ease-in-out infinite; }
@keyframes blinkeye { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
.scene .hop { animation: hop 2.6s ease-in-out infinite; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 68% { transform: translateY(-4px); } 76% { transform: translateY(0); } 84% { transform: translateY(-3px); } }
.scene .webbob { animation: webbob 2.2s ease-in-out infinite alternate; }
@keyframes webbob { from { transform: translateY(-.8px); } to { transform: translateY(.8px); } }
.scene .buzz { animation: buzz1 5s ease-in-out infinite; }
.scene .buzz.b2 { animation-name: buzz2; animation-duration: 3.2s; }
.scene .buzz.b3 { animation-name: buzz3; animation-duration: 4s; }
@keyframes buzz1 { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(14px, -8px); } 50% { transform: translate(26px, 2px); } 75% { transform: translate(10px, 8px); } }
@keyframes buzz2 { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(8px, -6px); } 40% { transform: translate(-4px, -10px); } 60% { transform: translate(10px, -2px); } 80% { transform: translate(-6px, 4px); } }
@keyframes buzz3 { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(-10px, -6px); } 60% { transform: translate(6px, -12px); } }
.scene .flutter { transform-origin: 50% 50%; animation: flutter .25s ease-in-out infinite alternate; }
.scene .flutter.fast { animation-duration: .06s; }
@keyframes flutter { from { transform: scaleX(1); } to { transform: scaleX(.35); } }

.scene .dab { transform-box: fill-box; transform-origin: 0% 100%; animation: dab 2.4s ease-in-out infinite; }
@keyframes dab { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 30% { transform: rotate(2deg); } 40% { transform: rotate(-5deg); } 55% { transform: rotate(0); } }

/* Wilhelminaberg: de lichtpalen gloeien blauw/groen; watermolen: vallend water */
.scene .glowpulse { animation: glowpulse 3s ease-in-out infinite alternate; }
.scene .glowpulse.g1 { animation-delay: -1s; } .scene .glowpulse.g2 { animation-delay: -2s; }
@keyframes glowpulse { from { opacity: .55; } to { opacity: 1; } }
.scene .fall { animation: fall .5s linear infinite; }
@keyframes fall { to { stroke-dashoffset: -7; } }

.guide-btn.is-locked { opacity: .55; cursor: not-allowed; }

/* Over Koelingo / privacy */
.about-card .btn { margin-top: 12px; }
.modal .about-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; font-size: 16px; font-weight: 900; color: var(--text); }
.modal .about-h svg { width: 18px; height: 18px; color: var(--yellow); }
.modal .muted b { color: var(--text); }
.about-mail { color: var(--yellow); font-weight: 800; word-break: break-all; }
