@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url(fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url(fonts/fredoka-latin-700-normal.woff2) format('woff2'); }

:root {
  --mat: #cfdde6;
  --mat-dark: #b9cbd7;
  --ink: #23324a;
  --red: #ef5a3c;
  --red-dark: #b8381f;
  --green: #3fc35a;
  --green-dark: #23893a;
  --yellow: #ffd23f;
  --paper: #fffaf0;
  --shadow: 0 10px 0 rgba(35, 50, 74, .18), 0 18px 40px rgba(35, 50, 74, .22);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #dde8ef 0%, var(--mat) 60%, var(--mat-dark) 100%) fixed var(--mat);
  font-family: 'Fredoka', 'Segoe UI', system-ui, sans-serif; font-weight: 600;
  color: var(--ink);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: none; }
button:focus { outline: none; }
button:focus-visible { outline: 6px solid var(--yellow); outline-offset: 4px; }
[hidden] { display: none !important; }

/* Vast 1920×1080-podium, geschaald naar het scherm */
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; overflow: hidden;
}
#stage.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: var(--fit) translate(-4px, 2px); }
  20%, 80% { transform: var(--fit) translate(8px, -4px); }
  30%, 50%, 70% { transform: var(--fit) translate(-14px, 6px); }
  40%, 60% { transform: var(--fit) translate(14px, -6px); }
}
#bench { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Bovenbalk ---------- */
#topbar { position: absolute; left: 0; right: 0; top: 0; height: 150px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.logo {
  position: absolute; left: 28px; top: 22px; height: 104px; padding: 0 30px 0 22px;
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border-radius: 52px; box-shadow: var(--shadow);
  font-size: 50px; font-weight: 700; letter-spacing: 1px;
}
.logo-bolt { font-size: 52px; filter: drop-shadow(0 2px 0 #c98a00); }
.logo-txt { color: var(--red); }
.hold-ring { position: absolute; right: -14px; top: -14px; width: 60px; height: 60px; transform: rotate(-90deg); opacity: 0; }
.hold-ring circle { fill: none; stroke: var(--ink); stroke-width: 10; stroke-dasharray: 289; stroke-dashoffset: 289; }
.logo.holding .hold-ring { opacity: 1; }
.logo.holding .hold-ring circle { transition: stroke-dashoffset 1.4s linear; stroke-dashoffset: 0; }

#levels { position: absolute; left: 380px; top: 44px; display: flex; gap: 12px; pointer-events: none; }
.lv {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.55); color: rgba(35,50,74,.4); font-size: 32px; font-weight: 700;
}
.lv.on { background: var(--yellow); color: var(--ink); box-shadow: 0 5px 0 #d9a400; transform: scale(1.12); }
.lv.done { background: var(--green); color: #fff; }

#say {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%);
  min-width: 560px; max-width: 940px; height: 108px; padding: 0 44px 0 24px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: #fff; border-radius: 56px; box-shadow: var(--shadow);
  font-size: 54px; font-weight: 700; white-space: nowrap; pointer-events: none;
}
#say.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
#say.warn { background: #fff1d6; }
#say.good { background: #e3fbe1; }
#say-icon { font-size: 64px; line-height: 1; }
@keyframes pop { 0% { transform: translateX(-50%) scale(.7); } 100% { transform: translateX(-50%) scale(1); } }

#tools { position: absolute; right: 28px; top: 22px; display: flex; gap: 18px; }
.tool {
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--paper); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 50px; font-weight: 700;
  transition: transform .12s;
}
.tool:active { transform: translateY(6px) scale(.96); }
.tool svg { width: 58px; height: 58px; }
.tool.off { opacity: .55; }

/* ---------- TEST en volgende ---------- */
#btn-test {
  position: absolute; left: 50%; top: 858px; transform: translateX(-50%);
  width: 470px; height: 170px; border-radius: 85px;
  background: linear-gradient(#ff7a55, var(--red)); color: #fff;
  font-size: 92px; font-weight: 700; letter-spacing: 3px;
  box-shadow: 0 16px 0 var(--red-dark), 0 28px 50px rgba(120, 30, 10, .35);
  text-shadow: 0 4px 0 rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .1s, box-shadow .1s;
}
#btn-test .test-bolt { font-size: 80px; }
#btn-test:active, #btn-test.pressed { transform: translateX(-50%) translateY(12px); box-shadow: 0 4px 0 var(--red-dark), 0 10px 20px rgba(120,30,10,.3); }
#btn-test.pulse { animation: testPulse 1.1s ease-in-out infinite; }
@keyframes testPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.07); box-shadow: 0 16px 0 var(--red-dark), 0 0 0 22px rgba(255, 210, 63, .55); }
}
#btn-next {
  position: absolute; left: 1330px; top: 860px; width: 170px; height: 170px; border-radius: 50%;
  background: linear-gradient(#5fdc74, var(--green)); box-shadow: 0 14px 0 var(--green-dark), 0 26px 40px rgba(20,90,40,.35);
  display: grid; place-items: center; animation: nextIn .6s cubic-bezier(.2,1.6,.4,1), nextBob 1.4s 0.6s ease-in-out infinite;
}
#btn-next svg { width: 100px; height: 100px; }
#btn-next:active { transform: translateY(10px); box-shadow: 0 4px 0 var(--green-dark); }
@keyframes nextIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes nextBob { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }

/* ---------- Schermen ---------- */
.screen { position: absolute; inset: 0; z-index: 10; }
#screen-start {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#screen-start, body[data-screen="start"] { background: radial-gradient(circle at 50% 40%, #fff7d1 0%, #ffe9a8 30%, #cfdde6 75%) fixed; }
#screen-real, body[data-screen="real"] { background: radial-gradient(circle at 50% 55%, #3a4a66 0%, #1d2638 80%) fixed #1d2638; }
body[data-screen="intro"] { background: #9eabb8; }
body[data-screen="teacher"] { background: #4d5869; }
#screen-real.lit, body[data-screen="real"].real-lit { background: radial-gradient(circle at 60% 50%, #fff7c2 0%, #b8f39a 35%, #2f6b3b 100%) fixed #2f6b3b; }
.start-lamp {
  width: 330px; height: 430px; margin-bottom: -10px;
  background: center / contain no-repeat;
  animation: startGlow 2.4s ease-in-out infinite;
}
@keyframes startGlow { 0%, 100% { filter: drop-shadow(0 0 30px rgba(140, 255, 90, .6)); } 50% { filter: drop-shadow(0 0 90px rgba(140, 255, 90, 1)); } }
.start-title { margin: 0 0 30px; font-size: 200px; line-height: 1; color: var(--red); font-weight: 700; letter-spacing: 6px; text-shadow: 0 10px 0 var(--red-dark), 0 24px 40px rgba(120,30,10,.3); }
.big-round {
  width: 230px; height: 230px; border-radius: 50%; font-size: 110px; padding-left: 22px;
  background: linear-gradient(#5fdc74, var(--green)); color: #fff;
  box-shadow: 0 18px 0 var(--green-dark), 0 30px 50px rgba(20,90,40,.35);
  animation: breathe 1.6s ease-in-out infinite;
}
.big-round:active { transform: translateY(14px); box-shadow: 0 4px 0 var(--green-dark); }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

#screen-intro { display: grid; place-items: center; background: rgba(35, 50, 74, .35); }
.intro-card {
  width: 980px; padding: 50px 60px 60px; border-radius: 60px; background: var(--paper); box-shadow: var(--shadow);
  text-align: center; animation: cardIn .55s cubic-bezier(.2,1.5,.4,1);
}
@keyframes cardIn { from { transform: scale(.4) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.intro-num { display: inline-grid; place-items: center; width: 140px; height: 140px; border-radius: 50%; background: var(--yellow); box-shadow: 0 8px 0 #d9a400; font-size: 96px; font-weight: 700; }
.intro-pics { height: 230px; margin: 26px 0 10px; display: flex; justify-content: center; align-items: center; gap: 30px; }
.intro-pics svg { height: 220px; }
.intro-title { font-size: 92px; font-weight: 700; color: var(--red); }

#screen-real {
  display: flex; flex-direction: column; align-items: center;
  color: #fff;
}
#screen-real.lit .real-title { color: var(--ink); }
.real-title { margin: 56px 0 10px; font-size: 120px; letter-spacing: 4px; font-weight: 700; animation: cardIn .8s cubic-bezier(.2,1.5,.4,1); }
.real-wrap { position: relative; width: 1200px; height: 640px; }
#real-kit { width: 100%; height: 100%; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); animation: kitIn 1s .2s both cubic-bezier(.2,1.2,.4,1); }
@keyframes kitIn { from { transform: translateY(120px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.real-q {
  position: absolute; right: -130px; top: -20px; width: 200px; height: 200px; border-radius: 50%;
  display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-size: 150px; font-weight: 700;
  box-shadow: 0 12px 0 #d9a400; animation: bob 1.6s ease-in-out infinite;
}
#screen-real.lit .real-q { display: none; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-22px) rotate(6deg); } }
.real-actions { margin-top: 18px; display: flex; gap: 30px; }
.pill {
  min-width: 260px; height: 130px; padding: 0 50px; border-radius: 65px;
  background: var(--paper); box-shadow: var(--shadow); font-size: 56px; font-weight: 700;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.pill small { font-size: 26px; font-weight: 600; opacity: .7; }
.pill:active { transform: translateY(6px); }
.pill-yes { background: linear-gradient(#5fdc74, var(--green)); color: #fff; font-size: 70px; box-shadow: 0 14px 0 var(--green-dark), 0 26px 40px rgba(0,0,0,.3); }
#screen-real.lit .pill-yes { visibility: hidden; }
.tool-home { position: absolute; right: 28px; top: 22px; color: var(--ink); }

#screen-teacher { display: grid; place-items: center; background: rgba(20, 28, 44, .65); }
.teacher-card { width: 1180px; padding: 40px 50px 44px; border-radius: 48px; background: var(--paper); box-shadow: var(--shadow); }
.teacher-card h2 { margin: 0 0 24px; font-size: 56px; }
.teacher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.teacher-grid .pill { width: 100%; padding: 0 20px; font-size: 46px; }
.pill-close { background: var(--ink); color: #fff; }
.teacher-note { margin: 26px 0 0; font-size: 26px; line-height: 1.35; opacity: .8; }

#rotate {
  position: fixed; inset: 0; z-index: 100; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; font-size: 48px;
}
.rotate-icon { font-size: 140px; animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- SVG-animaties ---------- */
.term-ring { fill: none; stroke: #fff; stroke-width: 7; opacity: .0; transition: opacity .2s; }
.term.inviting .term-ring { opacity: .9; animation: ringPulse 1.4s ease-in-out infinite; }
.term.target .term-ring { opacity: 1; stroke: var(--yellow); stroke-width: 9; animation: ringPulse .8s ease-in-out infinite; }
.term.selected .term-ring { opacity: 1; stroke: var(--yellow); stroke-width: 12; animation: none; }
.term.selected .term-glow { opacity: .9; }
.term.hint .term-ring { opacity: 1; stroke: #ff8a1f; stroke-width: 12; animation: ringPulse .6s ease-in-out infinite; }
.term-glow { opacity: 0; transition: opacity .2s; }
@keyframes ringPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }
.term-ring, .term-glow { transform-box: fill-box; transform-origin: center; }

.ghost-wire { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 2 26; opacity: .85; animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -28; } }
.slot-ghost { fill: rgba(255,255,255,.18); stroke: rgba(255,255,255,.9); stroke-width: 6; stroke-dasharray: 22 16; animation: march 1.2s linear infinite; transition: fill .2s; }
.slot-ghost.near { fill: rgba(255, 220, 90, .45); stroke: var(--yellow); }

.wire-flow { fill: none; stroke: #fff7a8; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1 30; animation: flow .6s linear infinite; opacity: 0; transition: opacity .3s; }
.lit .wire-flow { opacity: .95; }
@keyframes flow { to { stroke-dashoffset: -31; } }
.wire.sooty .wire-core { stroke: #333 !important; }
.wire.popping { animation: wirePop .5s ease-in forwards; transform-box: fill-box; transform-origin: center; }
@keyframes wirePop { 40% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(.2) translateY(-60px); opacity: 0; } }
.wire.new .wire-core { animation: wireIn .35s ease-out; }
@keyframes wireIn { from { stroke-width: 26; } }

.piece { transition: filter .2s; }
.piece .shadow { transition: transform .15s, opacity .15s; transform-box: fill-box; transform-origin: center; }
.piece.lifted .shadow { transform: translate(18px, 26px) scale(1.12); opacity: .55; }
.piece.wiggle .body { animation: wiggle .5s; transform-box: fill-box; transform-origin: center; }
@keyframes wiggle { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }

.halo { opacity: 0; transition: opacity .5s; }
.lit .halo { opacity: 1; animation: flickerIn .7s; }
@keyframes flickerIn { 0% { opacity: 0; } 15% { opacity: .9; } 25% { opacity: .2; } 40% { opacity: 1; } 55% { opacity: .5; } 100% { opacity: 1; } }
.rays { transform-box: view-box; animation: raysTurn 14s linear infinite; }
@keyframes raysTurn { to { transform: rotate(360deg); } }
.bulb-on { opacity: 0; transition: opacity .35s; }
.lit .bulb-on { opacity: 1; }
#layer-dim rect { transition: opacity .6s; }

.sparkle { animation: sparkle 1s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes sparkle { 0% { transform: scale(0) rotate(0); opacity: 1; } 100% { transform: scale(1.4) rotate(90deg) translate(var(--dx), var(--dy)); opacity: 0; } }
.pats { animation: patsIn .9s cubic-bezier(.2,1.8,.4,1) forwards; transform-box: fill-box; transform-origin: center; }
@keyframes patsIn { 0% { transform: scale(0) rotate(-20deg); } 25% { transform: scale(1.25) rotate(6deg); } 40% { transform: scale(1) rotate(0); } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }
.smoke { animation: smoke 1.9s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes smoke { 0% { transform: scale(.3) translate(0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: scale(1.8) translate(var(--dx), -160px); opacity: 0; } }

.hand { pointer-events: none; transition: opacity .3s; }
.hand-tap { animation: handTap 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 30% 10%; }
@keyframes handTap { 0%, 100% { transform: translate(0, 0) scale(1); } 45% { transform: translate(0, 18px) scale(.9); } 55% { transform: translate(0, 18px) scale(.9); } }
.tap-ring { fill: none; stroke: #fff; stroke-width: 8; opacity: 0; animation: tapRing 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes tapRing { 0%, 40% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; } 100% { opacity: 0; transform: scale(1.6); } }

@media (prefers-reduced-motion: reduce) {
  .rays, .ghost-wire, .slot-ghost { animation: none; }
}
