/* Andika (SIL Open Font License), lokaal meegeleverd: geen verbinding met Google */
@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 {
  --bg: #f3fbe9;
  --ink: #1f2d16;
  --muted: #5b6b52;
  --card: #ffffff;
  --line: #d6e8c4;
  --green: #4caf2e;
  --green-d: #2f7d18;
  --leaf: #8fd14f;
  --d: #e8590c;      /* kleur van de d */
  --d-bg: #fff0e3;
  --t: #1c7ed6;      /* kleur van de t */
  --t-bg: #e5f1fd;
  --gold: #fcc419;
  --bad: #e03131;
  --radius: 20px;
  --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 10% 0%, #fff 0, transparent 40%),
    radial-gradient(circle at 100% 100%, #e1f5c9 0, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "Nunito", "Segoe UI Rounded", "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", 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; }
.hidden { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; background: var(--green); color: #fff;
  position: sticky; top: 0; z-index: 20; height: 58px;
  box-shadow: 0 3px 0 var(--green-d);
}
.logo { font-weight: 900; font-size: 24px; color: #fff; white-space: nowrap; }
.top-btn { background: rgba(255,255,255,.18); color: #fff; border-radius: 14px; padding: 7px 14px; font-weight: 800; font-size: 16px; white-space: nowrap; }
.top-btn:hover { background: rgba(255,255,255,.3); }
.top-btn b { background: #fff; color: var(--green-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: 32px; margin: 6px 0 6px; line-height: 1.15; }
h2 { font-size: 24px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 18px; }

/* ---------- knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; font-weight: 900; font-size: 21px;
  border-radius: 18px; padding: 13px 26px; box-shadow: 0 5px 0 var(--green-d);
  transition: transform .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-d); }
.btn.ghost { background: #fff; color: var(--green-d); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn.big { font-size: 25px; padding: 16px 32px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.stretch { background: #9c36b5; box-shadow: 0 5px 0 #6b2380; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 16px 0; }

.say {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); font-size: 22px; box-shadow: 0 3px 0 var(--line);
  display: inline-flex; align-items: center; justify-content: center;
}
.say:active { transform: translateY(2px); box-shadow: none; }
.say.speaking { background: #fff9db; border-color: var(--gold); animation: pulse .8s infinite; }

/* ---------- uitleg-ballon van Rekkie ---------- */
.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: #fff; border: 2px solid var(--line); border-radius: 18px;
  padding: 12px 14px; flex: 1; display: flex; gap: 10px; align-items: center; font-size: 21px; font-weight: 700;
}
.bubble p { margin: 0; flex: 1; }
.bubble::before { content: ""; position: absolute; left: -11px; top: 16px; border: 10px solid transparent; border-right-color: var(--line); border-left: 0; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 4px 0 var(--line); }
.center { text-align: center; }

/* ---------- startkaart ---------- */
.hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.hero .txt { flex: 1 1 320px; }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.step {
  text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 5px 0 var(--line);
  transition: transform .1s;
}
.step:hover { transform: translateY(-2px); border-color: var(--leaf); }
.step .ico { font-size: 38px; width: 58px; height: 58px; border-radius: 16px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.step .nr { font-size: 14px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.step .nm { font-size: 21px; font-weight: 900; line-height: 1.15; }
.step .st { font-size: 15px; color: var(--muted); }
.step .stars { margin-left: auto; font-size: 18px; white-space: nowrap; }
.step.done { border-color: var(--leaf); background: #fbfff5; }
.step.is-game .ico { background: #fff3bf; }
.step.is-dip .ico { background: #ffe8cc; }
.voicebox { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center; margin-top: 20px; font-size: 16px; font-weight: 700; }
.voicebox select { font: inherit; font-size: 15px; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--line); max-width: 260px; }
.voicebox .btn { font-size: 16px; padding: 7px 14px; }
.note { color: var(--muted); font-size: 15px; margin-top: 18px; text-align: center; }

/* ---------- rups ---------- */
.rups { --sw: min(64px, calc((var(--avail, calc(min(100vw, 900px) - 80px)) - 70px - var(--g) * 16px) / var(--n))); display: inline-flex; align-items: center; justify-content: center; flex-wrap: nowrap; padding: 10px 6px 4px; max-width: 100%; }
.rups .syl { display: inline-flex; }
.rups .syl + .syl { margin-left: 16px; }
.seg {
  flex: 0 0 auto; width: var(--sw); height: calc(var(--sw) * 1.1); margin-left: calc(var(--sw) * -.09); border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 35% 30%, #c7f08c, var(--leaf) 60%, #6cb33a);
  border: 3px solid #4f8f25; display: flex; align-items: center; justify-content: center;
  font-family: var(--word); font-weight: 700; font-size: calc(var(--sw) * .66); color: #1f2d16; position: relative;
}
.seg::after { /* pootjes */
  content: ""; position: absolute; bottom: calc(var(--sw) * -.15); left: 50%; width: calc(var(--sw) * .34); height: calc(var(--sw) * .15); transform: translateX(-50%);
  border-left: 4px solid #4f8f25; border-right: 4px solid #4f8f25; border-radius: 0 0 6px 6px;
}
.syl .seg:first-child, .rups > .seg:first-child { margin-left: 0; }
.seg.tail { width: calc(var(--sw) * .62); height: calc(var(--sw) * .68); font-size: 0; }
.seg.q { background: #fff; border-style: dashed; color: #9c36b5; }
.seg.d { background: var(--d-bg); border-color: var(--d); color: var(--d); }
.seg.t { background: var(--t-bg); border-color: var(--t); color: var(--t); }
.seg.hl { animation: glow 1s 3; }
.seg.pop { animation: pop .45s backwards; }
.head {
  width: 74px; height: 78px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #b2f26b, #5fb12e);
  border: 3px solid #3f7d1b; position: relative; flex: 0 0 auto;
}
.head::before, .head::after { /* ogen */
  content: ""; position: absolute; top: 20px; width: 18px; height: 22px; background: #fff; border-radius: 50%;
  border: 2px solid #234d0e; box-shadow: inset 5px 2px 0 #1b1b1b;
}
.head::before { left: 16px; } .head::after { left: 38px; }
.head .smile { position: absolute; left: 22px; bottom: 13px; width: 28px; height: 12px; border-bottom: 4px solid #234d0e; border-radius: 0 0 20px 20px; }
.head .ant { position: absolute; top: -18px; width: 4px; height: 20px; background: #3f7d1b; border-radius: 2px; }
.head .ant::after { content: ""; position: absolute; top: -6px; left: -4px; width: 12px; height: 12px; background: #e8590c; border-radius: 50%; }
.head .ant.a1 { left: 20px; transform: rotate(-18deg); } .head .ant.a2 { left: 46px; transform: rotate(18deg); }
.rups.small { --sw: min(46px, calc((var(--avail, calc(min(100vw, 900px) - 80px)) - 56px - var(--g) * 16px) / var(--n))); }
.rups.small .head { width: 54px; height: 56px; }
.rups.small .head::before, .rups.small .head::after { top: 13px; width: 13px; height: 16px; }
.rups.small .head::before { left: 11px; } .rups.small .head::after { left: 27px; }
.rups.small .head .smile { left: 15px; bottom: 9px; width: 20px; }
.rups.small .head .ant.a1 { left: 14px; } .rups.small .head .ant.a2 { left: 33px; }

/* ---------- oefenscherm ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.topbar .back { font-weight: 800; color: var(--green-d); font-size: 17px; padding: 6px 4px; }
.progress { flex: 1; height: 16px; background: #fff; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--green)); width: 0; transition: width .4s; }
.count { font-weight: 800; color: var(--muted); font-size: 16px; white-space: nowrap; }

.word-card { text-align: center; padding: 18px 12px 22px; }
.pic { font-size: 84px; line-height: 1.1; margin-bottom: 4px; }
.pic-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pair { font-family: var(--word); font-size: 30px; margin: 8px 0 0; }
.pair b.d { color: var(--d); } .pair b.t { color: var(--t); }
.pair .arrow { color: var(--muted); margin: 0 8px; }
.ask { font-size: 22px; font-weight: 800; margin: 14px 0 4px; }
.choice { display: flex; gap: 18px; justify-content: center; margin: 12px 0 4px; }
.letter {
  width: 120px; height: 120px; border-radius: 28px; font-family: var(--word); font-size: 76px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 4px solid; box-shadow: 0 7px 0;
}
.letter:active { transform: translateY(5px); box-shadow: 0 2px 0; }
.letter.d { background: var(--d-bg); color: var(--d); border-color: var(--d); }
.letter.t { background: var(--t-bg); color: var(--t); border-color: var(--t); }
.letter[disabled] { opacity: .35; pointer-events: none; }
.letter.wrong { animation: shake .4s; }
.feedback { min-height: 34px; font-size: 21px; font-weight: 800; margin: 12px 0 0; }
b.d { color: var(--d); } b.t { color: var(--t); }
.feedback.good { color: var(--green-d); }
.feedback.bad { color: var(--bad); }
.feedback .fx { display: block; font-weight: 700; color: var(--ink); font-size: 19px; margin-top: 4px; }

/* uitleg-plaatjes */
.wordgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 10px 0; }
.wtile { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px; text-align: center; box-shadow: 0 4px 0 var(--line); }
.wtile .e { font-size: 54px; }
.wtile .w { font-family: var(--word); font-size: 36px; font-weight: 700; }
.wtile .w .d { color: var(--d); } .wtile .w .t { color: var(--t); }
.wtile.heard { border-color: var(--gold); background: #fffbea; }
.plan { counter-reset: s; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.plan li { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px; font-size: 21px; font-weight: 700; }
.plan li .n { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; flex: 0 0 auto; }
.plan li .e { font-size: 34px; }

/* bouw het woord */
.slots { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.slot { width: 64px; height: 76px; border-radius: 14px; border: 3px dashed #b9cfa5; background: #fff; font-family: var(--word); font-size: 46px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.slot.f { border-style: solid; border-color: var(--green); background: #f4fde9; animation: pop .25s; }
.slot.f.d { border-color: var(--d); color: var(--d); background: var(--d-bg); }
.slot.f.t { border-color: var(--t); color: var(--t); background: var(--t-bg); }
.slot.next { border-color: var(--green); }
.tiles { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.tile { width: 66px; height: 66px; border-radius: 16px; background: #fff; border: 3px solid var(--line); box-shadow: 0 5px 0 var(--line); font-family: var(--word); font-size: 42px; font-weight: 700; }
.tile.used { visibility: hidden; }
.tile.wrong { animation: shake .4s; border-color: var(--bad); }
.tile.d { color: var(--d); } .tile.t { color: var(--t); }

/* resultaat */
.result { text-align: center; padding: 26px 16px; }
.result .big-stars { font-size: 60px; letter-spacing: 6px; margin: 6px 0; }
.result .big-stars .off { filter: grayscale(1); opacity: .3; }

/* ---------- spel ---------- */
.game { position: relative; height: calc(100vh - 150px); min-height: 460px; max-height: 720px; border-radius: 24px; overflow: hidden;
  background: linear-gradient(#bfe8ff 0%, #e6f7ff 55%, #b6e37f 55%, #8fd14f 100%); border: 3px solid #6cb33a; touch-action: manipulation; user-select: none; }
.game .cloud { position: absolute; font-size: 54px; opacity: .9; animation: drift 30s linear infinite; }
.hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; z-index: 5; font-weight: 900; }
.hud .pill { background: rgba(255,255,255,.88); border-radius: 14px; padding: 5px 12px; font-size: 18px; white-space: nowrap; }
.hud .timebar { flex: 1; height: 14px; background: rgba(255,255,255,.7); border-radius: 8px; overflow: hidden; max-width: 260px; }
.hud .timebar i { display: block; height: 100%; background: var(--gold); width: 100%; }
.drop { position: absolute; left: 50%; transform: translateX(-50%); background: #fff; border: 4px solid #9c36b5; border-radius: 26px; padding: 8px 20px 10px; text-align: center; z-index: 4; box-shadow: 0 6px 0 rgba(0,0,0,.12); }
.drop .e { font-size: 58px; line-height: 1.1; }
.drop .w { font-family: var(--word); font-size: 44px; font-weight: 700; white-space: nowrap; }
.drop .w u { text-decoration: none; display: inline-block; min-width: 30px; border-bottom: 4px solid #9c36b5; color: #9c36b5; }
.drop.right { border-color: var(--green); }
.drop.wrongd { border-color: var(--bad); animation: shake .4s; }
.drop .hintline { font-family: var(--word); font-size: 22px; color: #9c36b5; }
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 12px 12px; z-index: 6; }
.leaf {
  width: 128px; height: 112px; border-radius: 60% 10% 60% 10%; font-family: var(--word); font-size: 70px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 4px solid; box-shadow: 0 6px 0 rgba(0,0,0,.18);
}
.leaf.d { background: var(--d-bg); border-color: var(--d); color: var(--d); }
.leaf.t { background: var(--t-bg); border-color: var(--t); color: var(--t); border-radius: 10% 60% 10% 60%; }
.leaf:active { transform: scale(.94); }
.leaf .k { position: absolute; font-family: system-ui, sans-serif; font-size: 12px; font-weight: 800; opacity: .55; margin-top: 82px; }
.game .rupsline { --avail: calc(min(100vw, 980px) - 300px); position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; z-index: 5; pointer-events: none; }
.hintbtn { position: absolute; bottom: 132px; left: 50%; transform: translateX(-50%); z-index: 7; background: #9c36b5; color: #fff; font-weight: 900; font-size: 17px; border-radius: 14px; padding: 7px 14px; box-shadow: 0 4px 0 #6b2380; }
.overlay { position: absolute; inset: 0; background: rgba(31,45,22,.55); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.overlay .card { max-width: 520px; width: 100%; text-align: center; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.lvl { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px; text-align: left; box-shadow: 0 5px 0 var(--line); }
.lvl .nm { font-weight: 900; font-size: 20px; }
.lvl .ds { font-size: 15px; color: var(--muted); }
.lvl .stars { font-size: 18px; }
.lvl.locked { opacity: .5; pointer-events: none; }
.bonus { position: absolute; z-index: 8; font-weight: 900; font-size: 30px; color: var(--green-d); pointer-events: none; animation: rise 1s forwards; }

/* ---------- diploma ---------- */
.diploma { background: #fff; border: 10px double var(--green); border-radius: 18px; padding: 30px 24px; text-align: center; max-width: 720px; margin: 0 auto; }
.diploma h1 { font-size: 42px; color: var(--green-d); margin: 4px 0; }
.diploma .name { font-family: var(--word); font-size: 40px; font-weight: 700; border-bottom: 3px solid var(--line); display: inline-block; min-width: 60%; margin: 10px 0 14px; padding: 2px 10px; }
.diploma .rule { font-size: 20px; margin: 10px 0; }
.diploma .date { color: var(--muted); font-size: 16px; margin-top: 16px; }
.name-in { font: inherit; font-size: 22px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); width: min(360px, 100%); }

.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #1f2d16; color: #fff; border-radius: 14px; padding: 10px 16px; font-size: 16px; z-index: 50; max-width: calc(100% - 32px); text-align: center; }

@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes glow { 50% { transform: translateY(-10px) scale(1.12); box-shadow: 0 0 0 8px rgba(252,196,25,.6); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pulse { 50% { transform: scale(1.1); } }
@keyframes rise { to { transform: translateY(-60px); opacity: 0; } }
@keyframes drift { from { transform: translateX(-120px); } to { transform: translateX(1100px); } }

@media (max-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 26px; }
  .bt { display: none; }
  .logo { font-size: 20px; }
  .head { width: 54px; height: 58px; }
  .head::before, .head::after { top: 14px; width: 13px; height: 16px; }
  .head::before { left: 11px; } .head::after { left: 27px; }
  .head .smile { left: 15px; bottom: 9px; width: 20px; }
  .head .ant.a1 { left: 14px; } .head .ant.a2 { left: 33px; }
  .rups .syl + .syl { margin-left: 10px; }
  .rups.small .head { width: 42px; height: 44px; }
  .rups.small .head::before, .rups.small .head::after { top: 10px; width: 10px; height: 13px; }
  .rups.small .head::before { left: 8px; } .rups.small .head::after { left: 21px; }
  .rups.small .head .smile { left: 11px; bottom: 7px; width: 16px; border-bottom-width: 3px; }
  .rups.small .head .ant.a1 { left: 10px; } .rups.small .head .ant.a2 { left: 26px; }
  .letter { width: 100px; height: 100px; font-size: 62px; }
  .pic { font-size: 70px; }
  .pair { font-size: 23px; }
  .bubble { font-size: 18px; }
  .slot { width: 50px; height: 62px; font-size: 36px; }
  .tile { width: 56px; height: 56px; font-size: 34px; }
  .leaf { width: 104px; height: 92px; font-size: 56px; }
  .leaf .k { display: none; }
  .drop .e { font-size: 46px; } .drop .w { font-size: 36px; }
  .game { height: calc(100vh - 120px); }
  .game .rupsline { --avail: calc(100vw - 50px); bottom: 128px; }
  .hintbtn { bottom: 200px; }
}

@media print {
  .top, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .diploma { border-width: 12px; margin-top: 30px; }
}
