:root {
  --indigo: #3b2bd6;
  --indigo-deep: #2a1ca8;
  --indigo-ink: #1b1270;
  --lilac: #e9e5ff;
  --teal: #35d0bd;
  --yellow: #ffd34d;
  --pink: #ff6fa8;
  --purple-line: #6c4dff;
  --paper: #fffdf8;
  --ink: #1d1b2e;
  --radius: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--indigo); }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; padding: 0; }
a { color: inherit; text-decoration: none; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
img.thumb { display: block; object-fit: contain; }

/* ---------- Shell ---------- */
.shell { height: 100dvh; display: grid; grid-template-columns: 96px 1fr; background: var(--indigo); color: #fff; }
.rail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: calc(16px + var(--safe-t)) 0 calc(16px + var(--safe-b)); }
.rail a { width: 74px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-radius: 16px; font-size: 12px; font-weight: 700; opacity: .85; }
.rail a svg { width: 30px; height: 30px; }
.rail a.on { background: #fff8d9; color: var(--indigo-ink); opacity: 1; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.rail .sep { width: 36px; height: 2px; background: rgba(255,255,255,.25); border-radius: 2px; }
.content { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(20px + var(--safe-t)) 28px calc(40px + var(--safe-b)) 8px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 30px; }
.head .hello { margin: 4px 0 0; font-size: 17px; opacity: .85; }
.me { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.12); border-radius: 22px; padding: 8px 16px 8px 8px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--pink); display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.18); flex: none; }
.me-info { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.me-info b { font-size: 16px; }
.me-info span { font-size: 13px; opacity: .9; }
.me-stats { display: flex; flex-direction: column; gap: 2px; font-weight: 800; font-size: 15px; }
.xpbar { height: 8px; background: rgba(255,255,255,.25); border-radius: 5px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--yellow); border-radius: 5px; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.xpbar.big { height: 14px; border-radius: 8px; }
.stars { display: inline-flex; gap: 2px; margin-left: 6px; font-size: .8em; vertical-align: 1px; }
.stars i { font-style: normal; color: rgba(255,255,255,.35); }
.stars i.on { color: var(--yellow); text-shadow: 0 1px 0 rgba(0,0,0,.2); }

/* ---------- Speeltuin ---------- */
.idea-banner { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, #ff8fc0, #ffb36b); color: var(--indigo-ink); border-radius: 26px; padding: 18px 22px; margin-bottom: 18px; box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.idea-banner .ib-ico { width: 58px; height: 58px; border-radius: 18px; background: #fff; display: grid; place-items: center; color: #ff6a3d; flex: none; }
.idea-banner .ib-ico svg { width: 34px; height: 34px; }
.idea-banner b { display: block; font-size: 23px; }
.idea-banner small { font-size: 15px; opacity: .85; }
.cats { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.cat .ball { width: 70px; height: 70px; border-radius: 50%; background: var(--c, #fff); display: grid; place-items: center; border: 4px solid transparent; font-size: 32px; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.cat.on .ball { border-color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.card { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); background: var(--paper); overflow: hidden; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.18); transition: transform .12s; }
.card:active { transform: scale(.97); }
.card img.thumb { position: absolute; inset: 4% 4% 16% 4%; width: 92%; height: 80%; }
.card .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; font-weight: 800; font-size: 19px; line-height: 1.15; background: linear-gradient(transparent, rgba(59,43,214,.78)); text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.card .tag { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; background: #ffe1c2; color: #8a3c00; padding: 4px 8px; border-radius: 8px; }
.card .tag.own { background: var(--yellow); color: var(--indigo-ink); }
.card .polaroid { position: absolute; top: 10px; right: 10px; width: 64px; padding: 4px 4px 12px; background: #fff; border-radius: 4px; transform: rotate(6deg); box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.card .polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: #eee; }
.card.free { background: linear-gradient(140deg, #ffd34d, #ff9b4d); }
.card.free .big-ico { position: absolute; inset: 16% 22% 30%; display: grid; place-items: center; }
.card.free .big-ico svg { width: 100%; height: 100%; }
.card.free .label { background: none; color: var(--indigo-ink); text-shadow: none; }
.section-title { font-size: 21px; margin: 28px 0 12px; }
.section-title small { font-size: 15px; opacity: .7; margin-left: 6px; }
.hint { margin: -4px 0 14px; opacity: .8; }

/* ---------- Leer (path) ---------- */
.chapter { background: rgba(255,255,255,.08); border-radius: 28px; padding: 18px 18px 8px; margin-bottom: 18px; }
.chapter .ch-tag { display: inline-block; background: var(--teal); color: var(--indigo-ink); border-radius: 14px; padding: 8px 16px; margin-bottom: 10px; }
.chapter .ch-tag small { display: block; font-size: 12px; font-weight: 700; opacity: .8; }
.chapter .ch-tag b { font-size: 20px; }
.drawing-row { margin-bottom: 14px; }
.dr-title { font-weight: 800; font-size: 18px; margin: 6px 4px 8px; }
.path { display: flex; align-items: flex-start; overflow-x: auto; padding: 4px 4px 6px; scrollbar-width: none; }
.path::-webkit-scrollbar { display: none; }
.node { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 160px; position: relative; font-weight: 700; }
.node::before { content: ""; position: absolute; top: 60px; left: -50%; width: 100%; height: 8px; background: rgba(255,255,255,.25); z-index: 0; }
.node:first-child::before { display: none; }
.node.done::before { background: var(--teal); }
.node .disc { width: 124px; height: 124px; border-radius: 50%; background: var(--paper); border: 7px solid rgba(255,255,255,.35); position: relative; z-index: 1; overflow: hidden; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.node.done .disc { border-color: var(--teal); }
.node.next .disc { border-color: var(--yellow); animation: pulse 1.6s ease-in-out infinite; }
.node .disc img { width: 100%; height: 100%; }
.node .check { position: absolute; z-index: 2; top: 0; right: 20px; width: 32px; height: 32px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; color: #fff; }
.node .check svg { width: 18px; height: 18px; }
@keyframes pulse { 50% { transform: scale(1.05); } }

/* ---------- Stickers ---------- */
.level-card { display: flex; align-items: center; gap: 18px; background: #fff; color: var(--ink); border-radius: 26px; padding: 18px 22px; box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.level-card .lv-ico { font-size: 54px; }
.level-card .lv-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.level-card b { font-size: 24px; }
.level-card small { opacity: .65; font-size: 15px; }
.level-card .xpbar { background: var(--lilac); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { background: rgba(255,255,255,.08); border-radius: 18px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; opacity: .45; filter: grayscale(1); }
.badge.got { background: #fff; color: var(--ink); opacity: 1; filter: none; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.badge span { font-size: 36px; }
.badge small { font-size: 12px; opacity: .7; }
.sticker-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px; background: #f6efe1; border-radius: 26px; padding: 22px; }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); font-weight: 800; font-size: 14px; text-align: center; }
.sticker img.thumb { width: 108px; height: 108px; border-radius: 26px; background: #fff; border: 6px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.18); transform: rotate(var(--r, 0deg)); filter: grayscale(1) brightness(1.15) opacity(.28); }
.sticker.got img.thumb { filter: none; background: var(--paper); }
.sticker span { opacity: .55; }
.sticker.got span { opacity: 1; }

/* ---------- Tijdschrift ---------- */
.journal { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.jcard { background: #fff; color: var(--ink); border-radius: 18px; padding: 10px 10px 12px; box-shadow: 0 5px 0 rgba(0,0,0,.18); transform: rotate(var(--r, 0deg)); text-align: left; }
.jcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--paper); }
.jcard .meta { padding: 8px 4px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.jcard b { font-size: 15px; }
.jcard small { opacity: .6; font-size: 12px; }
.empty { background: rgba(255,255,255,.1); border-radius: 24px; padding: 40px 28px; text-align: center; font-size: 19px; line-height: 1.4; }
.empty .big { font-size: 56px; display: block; margin-bottom: 8px; }

/* ---------- Buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 22px; border-radius: 18px; font-weight: 800; font-size: 18px; background: var(--yellow); color: var(--indigo-ink); box-shadow: 0 4px 0 rgba(0,0,0,.2); cursor: pointer; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.btn.light { background: #fff; color: var(--indigo-ink); }
.btn.purple { background: var(--indigo); color: #fff; }
.btn.red { background: #ff5d5d; color: #fff; }
.btn.small { min-height: 48px; padding: 0 16px; font-size: 16px; }
.btn.big { min-height: 66px; font-size: 22px; padding: 0 28px; }
.btn svg { width: 24px; height: 24px; flex: none; }
.link-btn { font-weight: 700; text-decoration: underline; opacity: .7; padding: 10px; font-size: 15px; }
.field { width: 100%; font: inherit; font-size: 20px; padding: 14px 16px; border-radius: 14px; border: 2px solid #d9d4f5; margin-top: 6px; color: var(--ink); background: #fff; }
.lbl { display: block; font-weight: 800; margin: 14px 0 4px; }
.lbl small { font-weight: 600; opacity: .6; }
.seg-pick { display: flex; gap: 8px; margin-top: 6px; }
.seg-pick button { flex: 1; padding: 12px; border-radius: 14px; background: var(--lilac); font-weight: 800; }
.seg-pick button.on { background: var(--indigo); color: #fff; }
.note { font-size: 13px; opacity: .65; margin: 12px 0 0; }

/* ---------- Player ---------- */
.player { position: fixed; inset: 0; background: #17142e; display: flex; flex-direction: column; color: #fff; }
.stage-row { flex: 1; min-height: 0; display: flex; gap: 12px; padding: calc(12px + var(--safe-t)) 12px 10px; }
.paper { flex: 1; min-width: 0; position: relative; border-radius: 18px; overflow: hidden; background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .46 0 0 0 0 .38 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }
.paper canvas.art, .paper svg.overlay { position: absolute; inset: 3% 7%; width: 86%; height: 94%; }
.paper svg.overlay { overflow: visible; pointer-events: none; }
.overlay .guide { fill: none; stroke: var(--purple-line); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(59,43,214,.88); color: #fff; display: grid; place-items: center; z-index: 5; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.arrow svg { width: 32px; height: 32px; }
.arrow.prev { left: 12px; }
.arrow.next { right: 12px; }
.arrow:active { transform: translateY(-50%) scale(.94); }
.p-back { position: absolute; top: calc(22px + var(--safe-t)); left: 24px; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--indigo-ink); display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.18); z-index: 6; }
.p-back svg { width: 28px; height: 28px; }
.caption { position: absolute; left: 50%; transform: translateX(-50%); top: calc(20px + var(--safe-t)); width: min(640px, calc(100% - 200px)); background: rgba(23,20,46,.82); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 18px; line-height: 1.35; text-align: center; z-index: 4; pointer-events: none; }
.card-pop { position: absolute; top: calc(24px + var(--safe-t)); right: 24px; width: min(370px, 70%); background: #1e1650; border: 3px solid var(--purple-line); border-radius: 20px; padding: 18px 18px 14px; z-index: 7; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.card-pop p { margin: 0 0 14px; font-size: 21px; font-weight: 800; line-height: 1.25; }
.card-pop .row { display: flex; gap: 10px; flex-wrap: wrap; }
.card-pop .btn { min-height: 52px; font-size: 18px; }
.card-pop .btn.go { flex: 1; background: var(--indigo); color: #fff; border: 2px solid #8f78ff; }
.card-pop .btn.go svg { width: 20px; height: 20px; }
.card-pop .btn.again { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; padding: 0 16px; }
.card-pop .camera { width: 100%; min-height: 70px; font-size: 20px; background: var(--yellow); }
.card-pop .link-btn { color: #fff; display: block; margin: 6px auto 0; }
.card-pop.part-done { text-align: center; }
.card-pop.part-done p { font-size: 26px; margin-bottom: 4px; }
.pd-stars .stars { font-size: 40px; margin: 0; gap: 6px; }
.xp-gain { display: block; color: var(--yellow); font-weight: 800; margin-bottom: 14px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.bar { flex: none; display: flex; align-items: center; gap: 10px; margin: 0 auto calc(12px + var(--safe-b)); padding: 8px 10px; background: #2d2466; border-radius: 22px; width: min(900px, calc(100% - 24px)); }
.bar button.ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff; }
.bar button.ic svg { width: 26px; height: 26px; }
.bar button.ic.on { background: var(--yellow); color: var(--indigo-ink); }
.segs { flex: 1; display: flex; gap: 12px; align-items: flex-end; min-width: 0; }
.seg-group { flex: var(--n, 1); display: flex; flex-direction: column; gap: 5px; min-width: 0; opacity: .7; }
.seg-group.active { opacity: 1; }
.seg-label { font-size: 12px; font-weight: 800; letter-spacing: .3px; padding-left: 2px; }
.seg-row { display: flex; gap: 4px; }
.seg-row button { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,.25); position: relative; }
.seg-row button::after { content: ""; position: absolute; inset: -16px 0; }
.seg-row button.done { background: var(--yellow); }
.seg-row button.cur { background: linear-gradient(90deg, var(--yellow) var(--p, 0%), rgba(255,255,255,.25) var(--p, 0%)); }
.start { position: absolute; inset: 0; z-index: 8; background: rgba(23,20,46,.6); display: grid; place-items: center; overflow-y: auto; padding: 20px; }
.start-box { background: #fff; color: var(--ink); border-radius: 30px; padding: 22px 28px 24px; text-align: center; width: min(460px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.start-box img.thumb { width: 200px; height: 160px; margin: 0 auto; }
.start-box h2 { margin: 6px 0 12px; font-size: 30px; }
.part-pick { display: flex; gap: 6px; background: var(--lilac); padding: 6px; border-radius: 18px; margin-bottom: 14px; }
.part-pick button { flex: 1; padding: 12px 6px; border-radius: 13px; font-weight: 800; font-size: 16px; color: var(--indigo-ink); }
.part-pick button.on { background: var(--indigo); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.start-box .btn[data-b="start"] { width: 100%; min-height: 66px; font-size: 22px; background: var(--indigo); color: #fff; }
.start-box .btn svg { width: 28px; height: 28px; }
.mode-pick { display: flex; gap: 10px; margin-top: 12px; }
.mode-pick .btn { flex: 1; min-height: 52px; font-size: 16px; background: var(--lilac); color: var(--indigo-ink); box-shadow: none; border: 3px solid transparent; }
.mode-pick .btn.sel { border-color: var(--indigo); background: #fff; }
.my-photos { margin-top: 16px; text-align: left; }
.my-photos small { font-weight: 800; opacity: .6; }
.my-photos div { display: flex; gap: 8px; margin-top: 6px; overflow-x: auto; }
.my-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; background: #eee; }

/* ---------- Drawing pad ---------- */
.padbox { flex: 1.25; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.player.screen .paper { flex: .8; }
.player.screen .arrow { width: 52px; height: 52px; }
.pad-area { flex: 1; min-height: 0; display: grid; place-items: center; }
.pad-paper { position: relative; background: var(--paper); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.pad-paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pad-paper canvas.draw { touch-action: none; }
.pad-paper canvas.trace { opacity: .22; pointer-events: none; }
.pad-tools { flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; padding: 8px; background: #2d2466; border-radius: 20px; }
.pad-tools .t { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.pad-tools .t svg { width: 28px; height: 28px; }
.pad-tools .t.on { background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px #fff; }
.pad-tools .sw { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid rgba(255,255,255,.25); }
.pad-tools .sw.on { border-color: #fff; transform: scale(1.18); }
.pad-tools .div { width: 2px; height: 30px; background: rgba(255,255,255,.2); flex: none; }
.pad-tools .t.danger.armed { background: #ff5d5d; }
.kladblok { position: fixed; inset: 0; background: #17142e; display: flex; flex-direction: column; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); gap: 10px; }
.kladblok .top { display: flex; align-items: center; gap: 12px; color: #fff; }
.kladblok .top h2 { margin: 0; flex: 1; font-size: 24px; }
.round { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--indigo-ink); display: grid; place-items: center; flex: none; }
.round svg { width: 28px; height: 28px; }

/* ---------- Nieuw (AI lesson maker) ---------- */
.nieuw { position: fixed; inset: 0; background: radial-gradient(circle at 30% 20%, #5b47f0, var(--indigo) 60%); display: grid; place-items: center; padding: 20px; overflow-y: auto; color: #fff; }
.nieuw .back { position: absolute; top: calc(20px + var(--safe-t)); left: 20px; }
.nieuw-box { width: min(680px, 100%); text-align: center; }
.nieuw-ico { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 26px; background: #fff; color: #ff7a3d; display: grid; place-items: center; box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.nieuw-ico svg { width: 50px; height: 50px; }
.nieuw h1 { font-size: 34px; margin: 8px 0; }
.nieuw p { font-size: 18px; opacity: .9; margin: 0 0 18px; }
.big-input { width: 100%; font: inherit; font-size: 28px; font-weight: 700; padding: 20px 22px; border-radius: 22px; border: 0; box-shadow: 0 6px 0 rgba(0,0,0,.2); color: var(--ink); text-align: center; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.chip { background: rgba(255,255,255,.16); padding: 10px 16px; border-radius: 30px; font-weight: 800; font-size: 16px; }
.chip:active { background: rgba(255,255,255,.3); }
.nieuw .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.photo-wish { margin: 0 auto 14px; display: flex; flex-direction: column; align-items: center; }
.photo-wish img { width: 160px; height: 120px; object-fit: cover; border-radius: 14px; border: 4px solid #fff; }
.photo-wish .link-btn { color: #fff; }
.err { color: #ffd2d2; font-weight: 700; }
.making { padding: 30px 10px; }
.making h2 { font-size: 30px; margin: 10px 0; }
.making-svg { width: 260px; height: 156px; }
.making .scribble { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 400; animation: scribble 2.2s ease-in-out infinite; }
@keyframes scribble { 0% { stroke-dashoffset: 400; } 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -400; } }

/* ---------- Overlays ---------- */
#overlay:empty { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15,10,40,.6); display: grid; place-items: center; padding: 20px; animation: fade .2s; overflow-y: auto; }
.modal-box { background: #fff; color: var(--ink); border-radius: 30px; padding: 24px; width: min(580px, 100%); max-height: 94dvh; overflow: auto; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.modal-box.left { text-align: left; }
.modal-box img.big-photo { width: 100%; border-radius: 16px; display: block; background: var(--paper); max-height: 56dvh; object-fit: contain; }
.modal-box h2 { font-size: 30px; margin: 4px 0 6px; }
.modal-box p { margin: 0 0 14px; font-size: 18px; opacity: .75; }
.modal-box .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.modal-box.left .row { justify-content: flex-start; }
.big-stars { display: flex; justify-content: center; gap: 10px; font-size: 64px; line-height: 1; }
.big-stars i { font-style: normal; color: var(--yellow); text-shadow: 0 3px 0 #e0a800; animation: starpop .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
.compare { display: flex; gap: 14px; justify-content: center; margin: 8px 0 12px; }
.compare figure { margin: 0; flex: 1; max-width: 240px; }
.compare .fig-paper { display: block; background: var(--paper); border-radius: 14px; aspect-ratio: 1; padding: 6px; border: 2px solid #eee; }
.compare .fig-paper img { width: 100%; height: 100%; }
.compare img.photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 4px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.2); transform: rotate(2deg); }
.compare figcaption { font-weight: 800; font-size: 14px; opacity: .6; margin-top: 6px; }
.new-sticker { display: flex; align-items: center; justify-content: center; gap: 14px; background: #f6efe1; border-radius: 20px; padding: 12px; margin: 6px 0 12px; }
.new-sticker b { font-size: 22px; }
.new-sticker .sticker img.thumb { width: 84px; height: 84px; }
.flip { animation: flip .9s .5s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes flip { from { transform: rotateY(180deg) scale(.4); opacity: 0; } }
.xp-row { display: flex; align-items: center; gap: 10px; font-weight: 800; margin: 6px 0; }
.xp-row .xpbar { flex: 1; background: var(--lilac); }
.xp-row b { color: #e08a00; }
.level-up { background: var(--yellow); border-radius: 14px; padding: 10px; font-weight: 800; font-size: 20px; margin: 10px 0; animation: pop .5s 1s both; }
.badge-won { background: var(--lilac); border-radius: 14px; padding: 10px; margin: 8px 0; font-size: 18px; }
.badge-won small { opacity: .6; }
@keyframes fade { from { opacity: 0; } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.toast { position: fixed; left: 50%; top: calc(20px + var(--safe-t)); transform: translateX(-50%); background: #fff; color: var(--indigo-ink); padding: 12px 20px; border-radius: 16px; font-weight: 800; z-index: 70; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: pop .3s; }

.player.screen .card-pop { right: auto; left: 92px; width: min(300px, 34%); }
.player.screen .card-pop p { font-size: 18px; }
@media (orientation: portrait) {
  .player.screen .stage-row { flex-direction: column; }
  .player.screen .paper { flex: .55; }
  .player.screen .card-pop { left: auto; right: 24px; width: min(340px, 60%); }
}
@media (max-width: 760px) {
  .seg-label { font-size: 10px; }
  .segs { gap: 6px; }
  .bar button.ic { width: 42px; height: 42px; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { flex-direction: row; order: 2; padding: 8px 0 calc(8px + var(--safe-b)); gap: 4px; }
  .rail .sep { display: none; }
  .rail a { width: 70px; }
  .content { padding: calc(16px + var(--safe-t)) 16px 24px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card .label { font-size: 16px; }
  .node { width: 120px; }
  .node .disc { width: 96px; height: 96px; }
  .node::before { top: 46px; }
  .caption { font-size: 15px; width: calc(100% - 110px); left: auto; right: 16px; transform: none; }
  .card-pop p { font-size: 18px; }
  .arrow { width: 48px; height: 48px; }
  .nieuw h1 { font-size: 26px; }
  .big-input { font-size: 22px; }
}
.ideas-left { font-weight: 800; color: var(--yellow); }
