/* Studienl — vrolijk, groot en duidelijk. Eerst mobiel, dan pas desktop. */
:root {
  --bg: #FFF8EC; --card: #fff; --ink: #2B2A4C; --mute: #6F6C8F; --line: #ECE6D6;
  --orange: #FF7A2F; --orange-d: #D95E16; --yellow: #FFC93C; --yellow-d: #E0A600;
  --pink: #FF5E8A; --pink-d: #D93D68; --sky: #3DB8F5; --sky-d: #1D93CE;
  --green: #4CCB6B; --green-d: #2FA24D; --purple: #8A63F2; --purple-d: #6B47D1;
  --red: #FF5252; --red-d: #D93636;
  --lv: var(--green); --lv-d: var(--green-d);
  --r: 22px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 19px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", "Nunito", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.45; overflow-x: hidden;
  background-image: radial-gradient(circle at 12% 8%, #FFE9C2 0, transparent 22%), radial-gradient(circle at 92% 30%, #FFD9E4 0, transparent 20%), radial-gradient(circle at 20% 95%, #D6F1FF 0, transparent 25%);
  background-attachment: fixed;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; font-weight: 800; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .7em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.ico { width: 1.25em; height: 1.25em; vertical-align: -.25em; flex: none; }
.hidden { display: none !important; }

#app { max-width: 720px; margin: 0 auto; padding: 14px 14px 110px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mute { color: var(--mute); }
.small { font-size: .85rem; }

/* ----- knoppen ----- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 58px; padding: 12px 22px; border: 0; border-radius: 18px;
  background: var(--green); color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: .02em;
  box-shadow: 0 5px 0 var(--green-d); transition: transform .08s, box-shadow .08s, filter .15s;
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-d); }
.btn:disabled { background: #D8D4E6; box-shadow: 0 5px 0 #BDB8D3; color: #fff; cursor: default; }
.btn.orange { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); }
.btn.sky { background: var(--sky); box-shadow: 0 5px 0 var(--sky-d); }
.btn.pink { background: var(--pink); box-shadow: 0 5px 0 var(--pink-d); }
.btn.purple { background: var(--purple); box-shadow: 0 5px 0 var(--purple-d); }
.btn.red { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn.sm { min-height: 46px; font-size: .95rem; padding: 8px 14px; width: auto; border-radius: 14px;  }
.btn.sm { box-shadow: 0 3px 0 var(--green-d); }
.btn.sm.orange { box-shadow: 0 3px 0 var(--orange-d); } .btn.sm.red { box-shadow: 0 3px 0 var(--red-d); }
.btn.sm.ghost { box-shadow: 0 3px 0 var(--line); } .btn.sm.sky { box-shadow: 0 3px 0 var(--sky-d); }
.btn.sm:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }

.card {
  background: var(--card); border-radius: var(--r); padding: 18px; margin: 0 0 16px;
  border: 2px solid var(--line); border-bottom-width: 5px;
}
.card.flat { border-bottom-width: 2px; }
input[type=text], input[type=password], input[type=email], select {
  width: 100%; min-height: 58px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 16px;
  background: #fff; font-size: 1.15rem; outline: none;
}
input:focus, select:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(61,184,245,.2); }
label { display: block; font-weight: 700; margin: 12px 0 6px; }
.msg { padding: 12px 16px; border-radius: 14px; margin: 10px 0; font-weight: 700; }
.msg.err { background: #FFE5E5; color: #B32525; } .msg.ok { background: #DDF8E4; color: #1D7A37; } .msg.info { background: #E1F4FF; color: #14648C; }

/* ----- mascotte & animaties ----- */
.mascot { width: 120px; height: 140px; }
.mascot .m-body { transform-origin: 60px 130px; animation: sway 3.4s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.hop { animation: hop 1s ease-in-out infinite; }
@keyframes hop { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-14px); } }
.spin { animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.float { animation: float 3.2s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.shake { animation: shake .45s both; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.slide-in { animation: slidein .35s ease-out both; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.fade-up { animation: fadeup .4s ease-out both; }
@keyframes fadeup { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ----- inloggen ----- */
.login { text-align: center; }
/* inlog- en wachtwoordscherm: geen menu onderaan en niet gecentreerd: korte marge boven en onder, geen schermhoogte-regels (die veroorzaakten scrollen op de telefoon) */
#app.noav { padding: 18px 14px 18px; }
.login .mascot { width: 110px; height: 128px; }
.login .langs { flex-wrap: nowrap; gap: 6px; }
.login .langs .chip { padding: 4px 10px; min-height: 38px; font-size: .85rem; }
.login p { margin-bottom: 8px; }
.login .card { padding: 4px 16px 16px; margin-bottom: 0; }
.login h1 { font-size: 1.8rem; color: var(--orange-d); margin-bottom: 2px; }
.login form { text-align: left; margin-top: 10px; }
@media (max-height: 700px) { .login .mascot { width: 80px; height: 94px; } .login .mute { display: none; } }
.langs { display: flex; gap: 8px; justify-content: center; margin: 0 0 8px; flex-wrap: wrap; }
.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 700; min-height: 44px;
}
.chip.on { background: var(--sky); border-color: var(--sky-d); color: #fff; }

/* ----- navigatie ----- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 2px solid var(--line);
  display: flex; justify-content: center; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.nav-in { display: flex; width: 100%; max-width: 720px; gap: 4px; }
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 16px;
  color: var(--mute); text-decoration: none; font-size: .78rem; font-weight: 800; min-height: 58px;
}
.nav a .ico { width: 1.7em; height: 1.7em; }
.nav a.on { background: #FFF0D6; color: var(--orange-d); }

/* ----- home ----- */
.hero { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero .mascot { width: 84px; height: 98px; flex: none; }
.hero h1 { margin: 0; font-size: 1.5rem; }
.stats { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 18px; padding: 10px 12px; text-align: center; font-weight: 800; }
.stat b { display: block; font-size: 1.35rem; }
.stat span { font-size: .78rem; color: var(--mute); font-weight: 700; }
.bar { height: 16px; background: #EFE9DA; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 99px; transition: width .6s ease; }
.bar.lv > i { background: var(--lv); }

.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
.lvbtn {
  border: 3px solid var(--line); background: #fff; border-radius: 18px; padding: 8px 2px 8px; text-align: center; font-weight: 800;
  border-bottom-width: 6px; position: relative;
}
.lvbtn b { display: block; font-size: 1.3rem; color: var(--lv-d); }
.lvbtn span { display: none; font-size: .72rem; color: var(--mute); line-height: 1.15; min-height: 2.3em; }
.lvbtn .bar { height: 7px; margin: 6px 6px 0; }
.lvbtn.on { border-color: var(--lv); background: color-mix(in srgb, var(--lv) 12%, #fff); transform: translateY(-3px); }
.lv-A1 { --lv: #4CCB6B; --lv-d: #2FA24D; } .lv-A2 { --lv: #3DB8F5; --lv-d: #1D93CE; }
.lv-B1 { --lv: #FFC93C; --lv-d: #C89400; } .lv-B2 { --lv: #FF7A2F; --lv-d: #D95E16; }
.lv-C1 { --lv: #FF5E8A; --lv-d: #D93D68; } .lv-C2 { --lv: #8A63F2; --lv-d: #6B47D1; }

.lvhead { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.lvhead .big { font-size: 2.2rem; font-weight: 900; color: var(--lv-d); }

.lesson {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line);
  border-bottom-width: 6px; border-radius: 24px; padding: 12px 14px; margin: 0 0 14px; color: inherit; transition: transform .1s;
  min-height: 92px; text-decoration: none;
}
.lesson:active:not(.locked) { transform: translateY(3px); border-bottom-width: 3px; }
.lesson .pic { width: 66px; height: 66px; flex: none; background: color-mix(in srgb, var(--lv) 18%, #fff); border-radius: 20px; display: grid; place-items: center; }
.lesson .pic .ill { width: 52px; height: 52px; }
.lesson h3 { margin: 0; font-size: 1.12rem; }
.lesson .meta { font-size: .8rem; color: var(--mute); font-weight: 700; }
.lesson .state { width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.lesson .state .ico { width: 36px; height: 36px; }
.lesson.current { border-color: var(--lv); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lv) 25%, transparent); }
.lesson.locked { opacity: .55; }
.lesson.done .pic { background: color-mix(in srgb, var(--green) 22%, #fff); }
.stars { display: inline-flex; gap: 1px; }
.stars .ico { width: 18px; height: 18px; }
.go { background: var(--lv); color: #fff; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; box-shadow: 0 3px 0 var(--lv-d); }

/* ----- les: uitleg ----- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.iconbtn { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; flex: none; color: var(--mute); }
.iconbtn .ico { width: 24px; height: 24px; }
.introhead { text-align: center; }
.introhead .ill { width: 130px; height: 130px; }
.rule { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 2px dashed var(--line); }
.rule:last-child { border: 0; }
.rule .num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--lv); color: #fff; font-weight: 900; display: grid; place-items: center; }
.tipbox { background: #FFF3C4; border: 2px solid #FFE082; border-radius: 20px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.tipbox .ill { width: 52px; height: 52px; flex: none; }
.readbox { background: #E8F6FF; border: 2px solid #BFE5FA; border-radius: 20px; padding: 14px 16px; font-size: 1.12rem; line-height: 1.55; }
.readbox .say { float: right; margin: 0 0 6px 8px; }
.say { background: var(--sky); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center; box-shadow: 0 3px 0 var(--sky-d); flex: none; }
.say .ico { width: 26px; height: 26px; }
.say.slow { background: var(--purple); box-shadow: 0 3px 0 var(--purple-d); }
.nl { font-weight: 800; color: var(--ink); background: #FFF0D6; border-radius: 8px; padding: 0 5px; white-space: nowrap; }

/* ----- les: oefeningen ----- */
.play { position: fixed; inset: 0; background: var(--bg); z-index: 30; display: flex; flex-direction: column; }
.play-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; max-width: 720px; width: 100%; margin: 0 auto; }
.play-top .bar { flex: 1; height: 18px; }
.play-main { flex: 1; overflow-y: auto; padding: 8px 14px 24px; max-width: 720px; width: 100%; margin: 0 auto; }
.has-sheet .play-main { padding-bottom: 48vh; }
.play-foot { max-width: 720px; width: 100%; margin: 0 auto; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
.instr { font-weight: 800; color: var(--mute); text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; margin: 6px 0 10px; }
.q { font-size: 1.65rem; font-weight: 800; line-height: 1.3; margin: 0 0 18px; }
.q .blank { display: inline-block; min-width: 3.2em; border-bottom: 4px solid var(--sky); color: var(--sky-d); text-align: center; padding: 0 6px; }
.q-row { display: flex; gap: 12px; align-items: flex-start; }
.opts { display: grid; gap: 12px; }
.opt {
  min-height: 70px; background: #fff; border: 3px solid var(--line); border-bottom-width: 6px; border-radius: 20px;
  font-size: 1.3rem; font-weight: 800; padding: 12px 16px; text-align: center; transition: transform .08s, border-color .15s, background .15s;
}
.opt:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 3px; }
.opt.sel { border-color: var(--sky); background: #E1F4FF; }
.opt.right { border-color: var(--green); background: #DDF8E4; }
.opt.bad { border-color: var(--red); background: #FFE5E5; }
.opt:disabled { cursor: default; }
.answer-input { font-size: 1.6rem !important; font-weight: 800; text-align: center; min-height: 72px !important; }
.answer-input.right { border-color: var(--green); background: #DDF8E4; } .answer-input.bad { border-color: var(--red); background: #FFE5E5; }
.slots { min-height: 78px; background: #fff; border: 3px dashed var(--line); border-radius: 20px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-content: flex-start; }
.bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tile { background: #fff; border: 3px solid var(--line); border-bottom-width: 6px; border-radius: 16px; padding: 10px 16px; font-size: 1.3rem; font-weight: 800; min-height: 54px; }
.tile.used { opacity: .25; pointer-events: none; }
.slots .tile { border-color: var(--sky); background: #E1F4FF; animation: pop .25s both; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .opt { min-height: 66px; font-size: 1.15rem; padding: 8px; }
.match .opt.done { visibility: hidden; }
.match .emo { font-size: 2rem; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0; animation: sheetup .3s cubic-bezier(.2,1.2,.4,1) both;
}
.sheet.good { background: #D7F7DF; } .sheet.bad { background: #FFE0E0; }
.sheet-in { max-width: 720px; margin: 0 auto; }
.sheet h3 { font-size: 1.4rem; display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.sheet.good h3 { color: #1D7A37; } .sheet.bad h3 { color: #B32525; }
.sheet .ans { font-size: 1.35rem; font-weight: 800; margin: 2px 0 10px; }
.sheet .expl { background: rgba(255,255,255,.7); border-radius: 16px; padding: 10px 14px; margin: 0 0 12px; font-size: .98rem; max-height: 34vh; overflow-y: auto; }
.sheet .expl b { color: var(--orange-d); }
.sheet .btn.good { background: var(--green); } .sheet.bad .btn { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
@keyframes sheetup { from { transform: translateY(100%); } to { transform: none; } }

/* ----- uitslag ----- */
.result { text-align: center; padding-top: 4vh; }
.result .mascot { width: 140px; height: 164px; }
.bigstars { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.bigstars .ico { width: 56px; height: 56px; }
.bigstars .ico:nth-child(2) { transform: translateY(-10px); }
.bigscore { font-size: 3rem; font-weight: 900; color: var(--orange-d); }
.xpchip { display: inline-block; background: var(--yellow); color: #5A4300; font-weight: 900; border-radius: 99px; padding: 6px 18px; margin: 6px 0 12px; }
.flowerwon { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 800; color: var(--pink-d); font-size: 1.2rem; margin-bottom: 10px; }
.flowerwon .ico { width: 44px; height: 44px; }
.reviewitem { text-align: left; padding: 10px 0; border-bottom: 2px dashed var(--line); }
.reviewitem:last-child { border: 0; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ----- voortgang ----- */
.sumgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.progrow { padding: 12px 0; border-bottom: 2px dashed var(--line); }
.progrow:last-child { border: 0; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 900; color: #fff; }
.dot.ok { background: var(--green); } .dot.no { background: var(--red); } .dot.na { background: #E5E1F0; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: #EEE9FB; color: var(--purple-d); border-radius: 99px; font-size: .75rem; font-weight: 800; padding: 2px 10px; }
.tag.g { background: #DDF8E4; color: #1D7A37; } .tag.o { background: #FFEBD6; color: var(--orange-d); }

/* ----- certificaat ----- */
.cert {
  background: #fff; border: 10px double var(--lv); border-radius: 18px; padding: 26px 18px; text-align: center; position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.cert .tulips { display: flex; justify-content: center; gap: 6px; }
.cert .tulips .ill { width: 54px; height: 54px; }
.cert h1 { font-size: 1.9rem; color: var(--lv-d); margin: 8px 0 14px; }
.cert .who { font-size: 2.2rem; font-weight: 900; color: var(--orange-d); border-bottom: 3px solid var(--yellow); display: inline-block; padding: 0 12px; margin: 6px 0 14px; }
.cert .lvbig { font-size: 3.5rem; font-weight: 900; color: var(--lv-d); line-height: 1; }
.cert .checks { text-align: left; columns: 1; margin: 16px 0 6px; font-size: .9rem; }
.cert .checks div { display: flex; align-items: center; gap: 8px; break-inside: avoid; padding: 2px 0; }
.cert .checks .ico { width: 20px; height: 20px; }

/* ----- beheer ----- */
.person { border-bottom: 2px dashed var(--line); padding: 14px 0; }
.person:last-child { border: 0; }
.person .name { font-weight: 900; font-size: 1.2rem; }
.person .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pwbox { background: #FFF3C4; border: 2px dashed #E0A600; border-radius: 16px; padding: 12px; font-size: 1.5rem; font-weight: 900; text-align: center; letter-spacing: .02em; user-select: all; word-break: break-all; }
.sel-sm { min-height: 46px; font-size: .95rem; width: auto; padding: 4px 10px; border-radius: 12px; }

.modal { position: fixed; inset: 0; background: rgba(43,42,76,.55); z-index: 70; display: grid; place-items: center; padding: 18px; }
.modal .card { max-width: 460px; width: 100%; margin: 0; text-align: center; animation: pop .3s both; }

@media (min-width: 720px) {
  html { font-size: 18px; }
  #app { padding-top: 28px; }
  .opts.two { grid-template-columns: 1fr 1fr; }
  .levels { gap: 10px; } .lvbtn span { display: block; }
  .cert .checks { columns: 2; }
}
@media print {
  body { background: #fff !important; }
  .nav, .topbar, .noprint, #confetti { display: none !important; }
  #app { padding: 0; max-width: none; }
  .cert { box-shadow: none; border-width: 12px; page-break-inside: avoid; }
}
