/* TypTik: basis, thuis, niveaus. Spel- en resultaatschermen staan in play.css. */
:root {
  --bg: #fdf4e3;
  --ink: #1e1b3a;
  --ink-soft: #5b5778;
  --paper: #fffaf0;
  --yellow: #f7c95c;
  --green: #62c990;
  --pink: #ef93b0;
  --coral: #ef6a4a;
  --blue: #7fb5ff;
  --purple: #b79cf2;
  --line: 3px solid var(--ink);
  --radius: 22px;
  --ui: "Avenir Next Rounded", "Nunito", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  --mono: "Courier New", ui-monospace, Menlo, monospace;
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--ui); font-size: 18px; line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; border-radius: 12px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 12px; z-index: 99; }
.skip:focus { left: 8px; }

.c-yellow { --c: var(--yellow); }
.c-green { --c: var(--green); }
.c-pink { --c: var(--pink); }
.c-coral { --c: var(--coral); }
.c-blue { --c: var(--blue); }
.c-purple { --c: var(--purple); }

/* ---------- kop en voet ---------- */
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 24px; max-width: 1180px; margin: 0 auto; }
.brand { text-decoration: none; }
.brand-word { font-family: var(--mono); font-weight: 900; font-size: 28px; letter-spacing: -1px; }
.nav { display: flex; gap: 6px; flex: 1; }
.nav-link { text-decoration: none; font-weight: 800; padding: 6px 16px; border-radius: 999px; border: 3px solid transparent; transition: transform .2s var(--pop); }
.nav-link:hover { transform: translateY(-2px) rotate(-1.5deg); }
.nav-link.on { border-color: var(--ink); background: var(--yellow); }
.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: var(--line); background: var(--paper); font-size: 22px; transition: transform .2s var(--pop); }
.icon-btn:hover { transform: scale(1.12) rotate(-6deg); }
.chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 16px 4px 6px; border: var(--line); border-radius: 999px; background: var(--paper); font-weight: 800; transition: transform .2s var(--pop); }
.chip:hover { transform: translateY(-2px) rotate(1.5deg); }
.chip-av { width: 34px; height: 34px; border-radius: 50%; background: var(--pink); border: 2px solid var(--ink); display: grid; place-items: center; font-size: 20px; }
.page { max-width: 1180px; margin: 0 auto; padding: 8px 24px 48px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 0 24px 32px; color: var(--ink-soft); font-size: 15px; text-align: center; }
.foot-quiet { margin-left: 14px; font-size: 13px; color: var(--ink-soft); opacity: .55; text-decoration: none; }
.foot-quiet:hover, .foot-quiet:focus-visible { opacity: 1; text-decoration: underline; }

/* ---------- geschiedenis ---------- */
.history { max-width: 980px; margin: 0 auto; display: grid; gap: 14px; }
.history h1 { font-size: 34px; font-weight: 900; }
.hfilter { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.hfilter select { font: inherit; padding: 6px 12px; border: var(--line); border-radius: 14px; background: var(--paper); }
.hdays { background: var(--paper); border: var(--line); border-radius: 18px; padding: 12px 18px; }
.hdays h2 { font-size: 20px; font-weight: 900; }
.hdays ul { margin: 6px 0 0; padding-left: 20px; font-size: 16px; }
.htable-wrap { overflow-x: auto; }
.htable { width: 100%; border-collapse: collapse; font-size: 16px; background: var(--paper); border: var(--line); }
.htable th, .htable td { text-align: left; padding: 6px 10px; border-bottom: 2px solid rgba(30, 27, 58, .15); vertical-align: top; }
.htable th { background: var(--yellow); }
.htable tr.h-open td { color: var(--ink-soft); }
.try-note { margin-top: 10px; text-align: center; font-size: 15px; color: var(--ink-soft); }

/* ---------- knoppen, pillen, tags ---------- */
.btn { display: inline-block; text-decoration: none; text-align: center; font-weight: 900; font-size: 18px; padding: 10px 24px; border: var(--line); border-radius: 999px; background: var(--paper); box-shadow: 0 5px 0 var(--ink); transition: transform .15s var(--pop), box-shadow .15s; }
.btn:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 8px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary { background: var(--yellow); }
.btn-ghost { background: var(--paper); }
.btn-danger { background: var(--coral); color: #fff; }
.btn-big { font-size: 24px; padding: 14px 36px; }
.btn-small { font-size: 15px; padding: 4px 14px; box-shadow: 0 3px 0 var(--ink); }
.tags, .pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tag, .pill { display: inline-block; font-weight: 800; border: var(--line); border-radius: 999px; padding: 2px 14px; font-size: 16px; background: var(--paper); }
.tag-solid { background: var(--ink); color: var(--yellow); }
.tag-line { background: transparent; }
.pill-fire { background: var(--coral); color: #fff; }
.label { font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.hint { color: var(--ink-soft); font-size: 16px; }
.back { display: inline-block; font-weight: 800; text-decoration: none; margin: 6px 0 14px; padding: 4px 12px; border-radius: 999px; }
.back:hover { background: var(--yellow); }

/* ---------- mascotte ---------- */
.mascot { width: 150px; flex: none; }
.mascot svg { width: 100%; height: auto; overflow: visible; display: block; }
.mascot-hero { width: 230px; }
.mascot-coach { width: 110px; }
.mascot-res { width: 150px; }
.mascot .m-all { transform-origin: 70px 124px; animation: bob 2.6s ease-in-out infinite; }
.mascot .m-mouth, .mascot .m-sweat, .mascot .m-sparkles { display: none; }
.mascot[data-mood=idle] .m-mouth-idle, .mascot[data-mood=happy] .m-mouth-idle { display: block; }
.mascot[data-mood=happy] .m-mouth-idle { display: none; }
.mascot[data-mood=happy] .m-mouth-cheer { display: block; }
.mascot[data-mood=cheer] .m-mouth-cheer { display: block; }
.mascot[data-mood=oops] .m-mouth-oops, .mascot[data-mood=oops] .m-sweat { display: block; }
.mascot[data-mood=think] .m-mouth-think { display: block; }
.mascot[data-mood=cheer] .m-sparkles, .mascot[data-mood=happy] .m-sparkles { display: block; animation: twinkle .9s ease-in-out infinite; }
.mascot[data-mood=cheer] .m-all { animation: jump .7s var(--pop) infinite; }
.mascot[data-mood=oops] .m-all { animation: wobble .35s ease-in-out 3; }
.mascot[data-mood=cheer] .m-arm-l { transform: rotate(-150deg); transform-origin: 24px 78px; }
.mascot[data-mood=cheer] .m-arm-r { transform: rotate(150deg); transform-origin: 116px 78px; }
.mascot[data-mood=think] .m-all { animation: tilt 2.2s ease-in-out infinite; }
.m-eye { animation: blink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(1.02, .98); } }
@keyframes jump { 0%, 100% { transform: translateY(0) scale(1.05, .92); } 45% { transform: translateY(-22px) scale(.96, 1.06); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

/* ---------- thuis ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0 8px; }
.hero-text { max-width: 720px; display: grid; gap: 16px; }
.wm-t { color: var(--coral); }
.wordmark { font-family: var(--mono); font-weight: 900; font-size: clamp(48px, 10vw, 112px); line-height: .95; letter-spacing: -4px; -webkit-text-stroke: 2px var(--ink); }
.lead { font-size: 22px; max-width: 34em; }
.who { margin-top: 24px; }
.who h2, .sect { font-size: 30px; font-weight: 900; margin-bottom: 14px; }
.sect { margin-top: 36px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.pcard { position: relative; border: var(--line); border-radius: var(--radius); background: var(--c, var(--yellow)); box-shadow: 0 6px 0 var(--ink); transition: transform .2s var(--pop); }
.pcard:hover { transform: translateY(-4px) rotate(-1deg); }
.pcard.is-active { outline: 4px dashed var(--ink); outline-offset: 4px; }
.pcard-main { display: grid; gap: 4px; justify-items: start; width: 100%; padding: 18px 20px; background: none; border: 0; text-align: left; }
.pcard-av { font-size: 44px; line-height: 1.1; }
.pcard-name { font-weight: 900; font-size: 24px; }
.pcard-sub { font-size: 15px; font-weight: 700; }
.pcard-medals { font-size: 16px; font-weight: 800; white-space: pre; }
.pcard-del { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); font-size: 20px; line-height: 1; font-weight: 900; padding: 0; }
.pcard-del:hover { background: var(--coral); color: #fff; }
.pcard-new { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 190px; background: transparent; border-style: dashed; box-shadow: none; }
.plus { width: 56px; height: 56px; border-radius: 50%; background: var(--coral); color: #fff; border: var(--line); font-size: 38px; font-weight: 900; line-height: 48px; text-align: center; transition: transform .25s var(--pop); }
.pcard-new:hover .plus { transform: rotate(90deg) scale(1.15); }
.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 44px; }
.info { background: var(--c); border: var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 6px 0 var(--ink); }
.info h3 { font-size: 22px; font-weight: 900; }
.note { background: var(--paper); border: 3px dashed var(--ink); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

/* ---------- niveaus ---------- */
.greet { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--paper); border: var(--line); border-radius: var(--radius); padding: 16px 24px; box-shadow: 0 6px 0 var(--ink); margin: 8px 0 28px; }
.greet-text { display: grid; gap: 10px; flex: 1; min-width: 260px; justify-items: start; }
.greet h1 { font-size: 38px; font-weight: 900; line-height: 1.1; }
.kindbox { display: grid; gap: 6px; }
.seg { display: inline-grid; grid-template-columns: repeat(var(--n, 2), 1fr); justify-self: start; border: var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.seg-btn { border: 0; background: transparent; padding: 6px 22px; font-weight: 800; text-align: center; }
.seg-btn + .seg-btn { border-left: var(--line); }
.seg-btn.on { background: var(--yellow); }
.seg-small .seg-btn { font-size: 15px; padding: 4px 12px; }
.mods { display: grid; gap: 22px; }
.mod { background: var(--c); border: var(--line); border-radius: var(--radius); padding: 16px 20px 20px; box-shadow: 0 6px 0 var(--ink); }
.mod-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.mod-head h2 { font-size: 24px; font-weight: 900; }
.mod-count { font-weight: 900; border: var(--line); background: var(--paper); border-radius: 999px; padding: 0 12px; }
.bubbles { display: flex; flex-wrap: wrap; gap: 12px; }
.bubble { position: relative; width: 66px; height: 66px; border-radius: 50%; border: var(--line); background: var(--paper); display: grid; place-items: center; align-content: center; text-decoration: none; padding: 0; box-shadow: 0 4px 0 var(--ink); transition: transform .2s var(--pop); }
.bubble:hover { transform: translateY(-4px) scale(1.1) rotate(-4deg); }
.bubble .b-num { font-size: 22px; font-weight: 900; line-height: 1; }
.bubble .b-sub { font-size: 16px; line-height: 1; min-height: 16px; }
.bubble.passed { background: var(--green); }
.bubble.locked { background: transparent; border-style: dashed; box-shadow: none; opacity: .6; }
.bubble.current { background: var(--yellow); animation: pulse 1.4s ease-in-out infinite; }
.bubble.nope { animation: wobble .35s ease-in-out; }
.here { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--yellow); font-size: 12px; font-weight: 900; padding: 0 8px; border-radius: 999px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ---------- niveau-intro ---------- */
.intro { display: grid; gap: 22px; max-width: 860px; margin: 0 auto; }
.intro-card { background: var(--c); border: var(--line); border-radius: var(--radius); padding: 22px 26px; box-shadow: 0 6px 0 var(--ink); display: grid; gap: 12px; }
.intro-card h1 { font-size: 34px; font-weight: 900; line-height: 1.15; }
.desc { font-size: 20px; }
.newkeys { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cap { display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding: 0 10px; background: var(--paper); border: var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); font-family: var(--mono); font-weight: 900; font-size: 24px; animation: capbounce 1.6s var(--pop) infinite; }
.cap:nth-child(3n) { animation-delay: .2s; } .cap:nth-child(3n+1) { animation-delay: .4s; }
@keyframes capbounce { 0%, 60%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } }
.guide, .need { background: var(--paper); border: var(--line); border-radius: var(--radius); padding: 18px 24px; display: grid; gap: 14px; }
.guide h2, .need h2 { font-size: 24px; font-weight: 900; }
.hands { width: 100%; max-width: 560px; margin: 0 auto; display: block; }
.hands-big { max-width: 640px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 700; font-size: 15px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--ink); background: var(--ks); }
.thr { width: 100%; border-collapse: separate; border-spacing: 6px; text-align: center; font-weight: 800; }
.thr th, .thr td { padding: 6px 8px; border-radius: 12px; border: 2px solid var(--ink); }
.thr th[scope=row] { text-align: left; background: transparent; border-color: transparent; }
.thr thead td { border-color: transparent; }
.t-pass { background: #d9f2e2; } .t-bronze { background: #f7d2b3; } .t-silver { background: #e3e8f2; } .t-gold { background: #ffe9a8; }
.prev { font-weight: 800; text-align: center; }
.row-btns { display: flex; flex-wrap: wrap; gap: 14px; }
.row-center { justify-content: center; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(30, 27, 58, .55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fadein .2s; }
.dialog { background: var(--bg); border: var(--line); border-radius: 28px; padding: 26px 28px; width: min(520px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 8px 0 var(--ink); display: grid; gap: 12px; animation: popin .35s var(--pop); }
.dialog h2 { font-size: 28px; font-weight: 900; }
.dialog form { display: grid; gap: 12px; }
.dialog label { font-weight: 800; }
.dialog input[type=text] { font: inherit; font-size: 22px; padding: 10px 16px; border: var(--line); border-radius: 16px; background: #fff; width: 100%; }
.avatars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.av { width: 100%; aspect-ratio: 1; max-width: 56px; justify-self: center; font-size: 28px; border-radius: 16px; border: 3px solid transparent; background: var(--paper); transition: transform .2s var(--pop); padding: 0; }
.av:hover { transform: scale(1.15) rotate(-6deg); }
.av.on { border-color: var(--ink); background: var(--yellow); transform: scale(1.1); }
.form-error { color: #b3261e; font-weight: 800; min-height: 1.4em; }
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { transform: scale(.8) translateY(20px); opacity: 0; } }

@media (max-width: 720px) {
  .hero { flex-direction: column-reverse; align-items: flex-start; }
  .mascot-hero { width: 150px; }
  body { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
