/* =========================================================
   Нохчалла – Design-System
   Spiele füllen exakt eine Bildschirmhöhe (100dvh), nichts rutscht nach unten.
   ========================================================= */
:root {
  --bg: #FFF8EE;
  --ink: #23303D;
  --muted: #6E7787;
  --line: #EFE2CC;
  --line-2: #E4D3B6;
  --card: #FFFFFF;
  --green: #22A06B;
  --green-d: #17784F;
  --sun: #FFC83D;
  --coral: #FF6B5B;
  --sky: #3B82F6;
  --sky-d: #2563EB;
  --r-s: 14px; --r-m: 20px; --r-l: 28px;
  --sh-1: 0 1px 2px rgba(70,45,10,.06), 0 6px 16px -6px rgba(70,45,10,.12);
  --sh-2: 0 2px 4px rgba(70,45,10,.06), 0 18px 36px -12px rgba(70,45,10,.22);
  --ease: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.3,1.5,.5,1);
  --safe-b: max(14px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100dvh;
  background:
    radial-gradient(700px 420px at 0% -8%, #FFE6C0 0, transparent 62%),
    radial-gradient(620px 460px at 108% 4%, #D6EEFF 0, transparent 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: env(safe-area-inset-top) 16px 0; }
#app.enter > * { animation: enter .34s var(--ease) both; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { -webkit-user-drag: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* ---------- Grundbausteine ---------- */
.page { padding-bottom: calc(28px + var(--safe-b)); }
.sub-top { display: flex; align-items: center; gap: 12px; padding: 14px 0 12px; }
.sub-top h1 { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.back {
  width: 44px; height: 44px; flex: none; border-radius: var(--r-s); background: var(--card);
  display: grid; place-items: center; font-weight: 900; font-size: 20px; box-shadow: var(--sh-1);
  transition: transform .15s var(--ease);
}
.back:active { transform: scale(.92); }
.pill {
  background: rgba(255,255,255,.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 999px; padding: 7px 12px; font-weight: 900; font-size: 15px; white-space: nowrap; box-shadow: var(--sh-1);
}
.sound-toggle { cursor: pointer; line-height: 1; }
.push { margin-left: auto; }
.muted { color: var(--muted); }
.card { background: var(--card); border-radius: var(--r-l); padding: 20px; box-shadow: var(--sh-1); }
.mascot { display: block; height: auto; }
.stars { font-size: 15px; letter-spacing: 2px; color: #E6D7C0; }
.stars .on { color: var(--sun); text-shadow: 0 1px 0 #E0A300; }
.badge { background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; border-radius: 99px; padding: 4px 9px; letter-spacing: .02em; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #2BB57A, var(--green)); color: #fff; font-weight: 900; font-size: 19px;
  border-radius: var(--r-m); padding: 15px 26px; min-width: 200px;
  box-shadow: 0 5px 0 var(--green-d), 0 12px 22px -10px rgba(23,120,79,.55);
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-d); }
.btn:disabled { opacity: .6; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--line-2), var(--sh-1); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line-2); }
.btn.small { min-width: 0; font-size: 16px; padding: 12px 16px; }

/* ---------- Startseite ---------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0 10px; }
.logo {
  display: block; font-weight: 900; font-size: 28px; letter-spacing: -.03em; line-height: 1;
  background: linear-gradient(90deg, #17784F, #22A06B 60%, #4CC38A); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tag { display: block; font-size: 12.5px; color: var(--muted); font-weight: 800; margin-top: 3px; }
.stats { display: flex; gap: 6px; flex: none; }

.welcome {
  position: relative; overflow: hidden; border-radius: 32px; margin-top: 4px;
  min-height: clamp(220px, 40dvh, 380px); padding: 20px 18px 0;
  display: flex; align-items: flex-end; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, #BFE4FF 0%, #E3F4FF 70%, #F2FAFF 100%);
  box-shadow: var(--sh-2);
}
.welcome .mtn { position: absolute; left: 0; bottom: 0; width: 100%; height: 34%; }
.welcome .sun { position: absolute; right: 22px; top: 20px; width: 46px; height: 46px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 9px rgba(255,200,61,.25), 0 0 0 20px rgba(255,200,61,.12); }
.welcome .mascot { position: relative; width: clamp(118px, 23dvh, 200px); margin-bottom: 6px; filter: drop-shadow(0 8px 10px rgba(30,60,40,.18)); }
.wave { transform-origin: 50% 92%; animation: sway 3.2s ease-in-out infinite; }
.speech {
  position: relative; align-self: center; margin-bottom: 18%;
  background: var(--card); border-radius: 22px; padding: 12px 16px; box-shadow: var(--sh-2);
  font-weight: 900; font-size: 23px; line-height: 1.1;
}
.speech small { display: block; font-size: 14px; color: var(--muted); font-weight: 800; margin-top: 4px; }
.speech::before { content: ''; position: absolute; left: -10px; bottom: 18px; border: 10px solid transparent; border-right-color: var(--card); border-left: 0; }

.doors { display: grid; gap: 14px; margin-top: 18px; }
.door {
  position: relative; display: flex; align-items: center; gap: 14px; border-radius: 26px; padding: 16px;
  transition: transform .15s var(--ease);
}
.door:active { transform: scale(.98); }
.door.play {
  color: #fff; overflow: hidden;
  background: linear-gradient(135deg, #FF9F43 0%, #FF6B5B 55%, #F5487F 100%);
  box-shadow: 0 6px 0 #C93D57, 0 20px 34px -14px rgba(201,61,87,.6);
}
.door.play::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 45%, transparent 60%); transform: translateX(-100%); animation: shine 4.5s ease-in-out 1.2s infinite; }
.door-ico { width: 64px; height: 64px; flex: none; border-radius: 20px; display: grid; place-items: center; font-size: 34px; background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.door-txt { flex: 1; min-width: 0; }
.door b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.door small { font-size: 15px; font-weight: 800; opacity: .92; }
.door-go { width: 42px; height: 42px; flex: none; border-radius: 50%; background: #fff; color: #F5487F; display: grid; place-items: center; font-weight: 900; font-size: 20px; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.door.door-learn { background: var(--card); box-shadow: var(--sh-1); cursor: default; }
.door.door-learn .door-ico { background: #F3EDE3; box-shadow: none; filter: grayscale(.4); }
.door.door-learn b, .door.door-learn small { color: var(--muted); }
.door.door-learn:active { transform: none; }

.foot { text-align: center; padding: 22px 0 6px; }
.parent-link { font-weight: 800; color: var(--muted); background: rgba(255,255,255,.75); box-shadow: var(--sh-1); border-radius: 99px; padding: 10px 18px; display: inline-block; }

/* ---------- Spiele-Übersicht ---------- */
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game {
  position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 16px 14px 14px;
  display: flex; flex-direction: column; gap: 3px; min-height: 178px;
  background: linear-gradient(155deg, var(--c2) 0%, var(--c) 70%);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 70%, #000), 0 16px 28px -14px var(--c);
  transition: transform .15s var(--ease);
}
.game::before { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.16); }
.game:active { transform: scale(.97); }
.game-ico { position: relative; width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.95); display: grid; place-items: center; font-size: 28px; margin-bottom: 8px; box-shadow: 0 6px 14px -6px rgba(0,0,0,.35); }
.game b { font-size: 19px; font-weight: 900; letter-spacing: -.01em; }
.game small { font-size: 13px; font-weight: 800; opacity: .9; line-height: 1.3; }
.game-prog { margin-top: auto; height: 7px; border-radius: 99px; background: rgba(255,255,255,.3); overflow: hidden; }
.game-prog i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.game-lv { font-size: 12px; font-weight: 900; opacity: .95; margin-top: 4px; }

/* ---------- Level-Auswahl ---------- */
.lm-hero {
  display: flex; align-items: center; gap: 16px; color: #fff; border-radius: 26px; padding: 18px;
  background: linear-gradient(135deg, var(--c2), var(--c)); box-shadow: 0 16px 30px -16px var(--c); margin-bottom: 16px;
}
.lm-ico { width: 64px; height: 64px; flex: none; border-radius: 20px; background: rgba(255,255,255,.95); display: grid; place-items: center; font-size: 34px; }
.lm-hero p { font-weight: 900; font-size: 18px; line-height: 1.3; }
.levels { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lvl {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  background: var(--card); border-radius: 22px; padding: 16px 10px 12px; min-height: 140px; box-shadow: var(--sh-1);
  transition: transform .15s var(--ease);
}
a.lvl:active { transform: scale(.96); }
.lvl-n {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 900; color: #fff;
  background: linear-gradient(160deg, var(--c2), var(--c)); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000); margin-bottom: 4px;
}
.lvl b { font-size: 15px; font-weight: 900; line-height: 1.2; }
.lvl em { font-style: normal; font-size: 11px; font-weight: 900; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border-radius: 99px; padding: 2px 8px; }
.lvl .stars { margin-top: auto; }
.lvl.current { box-shadow: 0 0 0 3px var(--c), var(--sh-2); }
.lvl.current .lvl-n { animation: ring 1.8s infinite; }
.lvl.locked { opacity: .55; }
.lvl.locked .lvl-n { background: #E7DFD2; box-shadow: none; font-size: 20px; }

/* ---------- Spiel-Rahmen (immer genau eine Bildschirmhöhe) ---------- */
.gp { position: relative; height: 100dvh; display: flex; flex-direction: column; padding-bottom: var(--safe-b); }
.gp-top { display: flex; align-items: center; gap: 12px; padding: 10px 0 8px; flex: none; }
.gp-title { flex: 1; min-width: 0; display: grid; }
.gp-title b { font-size: 19px; font-weight: 900; letter-spacing: -.01em; line-height: 1.15; }
.gp-title small { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-ico { width: 44px; height: 44px; flex: none; border-radius: var(--r-s); display: grid; place-items: center; font-size: 24px; background: linear-gradient(160deg, var(--c2), var(--c)); box-shadow: var(--sh-1); }
.gp-prog { flex: none; height: 10px; border-radius: 99px; background: #EFE3D0; overflow: hidden; }
.gp-prog i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--c2), var(--c)); transition: width .45s var(--ease); }
.gp-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.ghint { flex: none; text-align: center; font-weight: 800; color: var(--muted); font-size: 14px; line-height: 1.35; }

.say-bubble {
  position: relative; flex: none; align-self: center; text-align: center; display: flex; flex-direction: column; align-items: center;
  background: var(--card); border-radius: 22px; padding: 10px 24px 11px; box-shadow: var(--sh-2); min-width: 140px;
}
.say-bubble .ce { font-size: clamp(26px, 8vw, 34px); font-weight: 900; line-height: 1.1; letter-spacing: -.01em; }
.say-bubble small { font-size: 14px; color: var(--muted); font-weight: 800; }
.feed .say-bubble::after { content: ''; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); border: 10px solid transparent; border-top-color: var(--card); border-bottom: 0; }

.tray { flex: none; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 10px; }
.food {
  position: relative; z-index: 2; aspect-ratio: 1; max-height: 92px; justify-self: center; width: 100%;
  display: grid; place-items: center; background: var(--card); border-radius: var(--r-m);
  box-shadow: 0 4px 0 var(--line-2), var(--sh-1); touch-action: none; cursor: grab;
  transition: transform .35s var(--spring), opacity .35s;
}
.food .pic { font-size: clamp(30px, 9vw, 46px); pointer-events: none; }
.food.dragging { transition: none; z-index: 20; cursor: grabbing; box-shadow: 0 18px 30px -8px rgba(0,0,0,.3); }
.food.eaten { opacity: 0; transition: transform .35s ease-in, opacity .35s .1s; }
.food:disabled { cursor: default; }

/* Füttern */
.feed-stage {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px;
  border-radius: var(--r-l); padding: 14px 0 10px;
  background:
    radial-gradient(60% 34px at 50% 100%, #A6DDB7 0 97%, transparent 100%) no-repeat bottom / 100% 44px,
    linear-gradient(180deg, #E7F5FF, #F6FBF1);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
}
.feed-tur { height: clamp(110px, 34dvh, 280px); width: auto; transform-origin: 50% 100%; filter: drop-shadow(0 8px 8px rgba(30,60,40,.15)); }
.feed-tur.chew { animation: chew .5s; }
.feed-tur.shake { animation: headshake .5s; }

/* Memory */
.memory .gp-main { justify-content: center; }
.mgrid {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; perspective: 1000px; margin: 0 auto;
  width: min(100%, calc((100dvh - 215px) * var(--cols) / var(--rows) * .75));
}
.mcard { position: relative; aspect-ratio: 3 / 4; transform-style: preserve-3d; transition: transform .5s var(--ease); }
.mcard.flip { transform: rotateY(180deg); }
.mface { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; }
.mface.mback { background: linear-gradient(155deg, var(--c2), var(--c)); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000), inset 0 0 0 3px rgba(255,255,255,.35); }
.mface.mback img { width: 50%; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.mface.mfront { background: var(--card); transform: rotateY(180deg); box-shadow: 0 4px 0 var(--line-2), var(--sh-1); }
.mface.mfront .pic { font-size: clamp(26px, 8.5vw, 46px); }
.mface.mfront .pic.num { font-size: clamp(26px, 8vw, 42px); }
.mface.mfront .ce { font-size: clamp(13px, 3.9vw, 19px); font-weight: 900; text-align: center; line-height: 1.1; }
.mface.mfront small { font-size: clamp(10px, 2.9vw, 12px); color: var(--muted); font-weight: 800; }
.mcard.done { animation: popflip .45s; }
.mcard.done .mface.mfront { background: #E7F7EE; box-shadow: 0 4px 0 #9BD8B7; }

/* Zählen */
.count-q { flex: none; text-align: center; font-weight: 900; font-size: 21px; line-height: 1.2; }
.count-q .q-pic { font-size: 28px; vertical-align: -3px; }
.count-q small { display: block; font-size: 13px; color: var(--muted); font-weight: 800; }
.meadow {
  position: relative; flex: 1; min-height: 0; border-radius: var(--r-l); overflow: hidden;
  background: linear-gradient(#BFE4FF 0 18%, #A9DDB5 18% 100%);
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.05), var(--sh-1);
}
.meadow::before { content: ''; position: absolute; left: -10%; right: -10%; top: 14%; height: 12%; border-radius: 50%; background: #9BD3A8; }
.critter { position: absolute; width: clamp(42px, 12vw, 58px); height: clamp(42px, 12vw, 58px); font-size: clamp(30px, 9vw, 42px); line-height: 1; display: grid; place-items: center; }
.critter i { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 99px; background: var(--sky); color: #fff; font-style: normal; font-weight: 900; font-size: 13px; display: grid; place-items: center; box-shadow: 0 2px 0 var(--sky-d); }
.critter.hop { animation: crhop .4s; }
.count-opts { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.opt {
  background: var(--card); border-radius: var(--r-m); padding: 12px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 var(--line-2), var(--sh-1); transition: transform .1s; min-height: 68px;
}
.opt:active { transform: translateY(3px); }
.opt .ce { font-size: clamp(18px, 5.6vw, 26px); font-weight: 900; line-height: 1.1; }
.opt small { color: var(--muted); font-weight: 800; font-size: 13px; }
.opt.ok { background: #E7F7EE; box-shadow: 0 4px 0 #6CCB98; animation: pop .35s; }
.opt.no { background: #FFECEA; box-shadow: 0 4px 0 #F5B1A8; animation: shake .4s; opacity: .55; }

/* Malen */
.paint-task { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 10px; padding: 10px 18px; }
.paint-task .task-de { font-weight: 800; font-size: 16px; }
.paint-task .ce { font-size: clamp(22px, 6.5vw, 28px); }
.paint-task small { align-self: center; }
.tap-now { flex-basis: 100%; font-size: 12.5px; color: var(--sky); font-weight: 900; }
.canvas-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.paint-svg [data-part="sky"], .paint-svg [data-part="water"] { filter: drop-shadow(0 10px 18px rgba(70,45,10,.16)); }
.paint-svg { display: block; width: 100%; height: 100%; }
.paint-svg [data-part] { fill: #F4EEE4; transition: fill .45s; cursor: pointer; }
.paint-svg .glow { animation: partglow 1s infinite; }
.paint-svg.done { animation: pop .5s; }
.pots { flex: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 4px 2px 0; }
.pot { aspect-ratio: 1; max-height: 54px; justify-self: center; width: 100%; border-radius: 50%; background: var(--pc); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--line-2), 0 5px 0 2px var(--line-2); transition: transform .18s var(--spring); }
.pot.sel { transform: translateY(-7px) scale(1.12); box-shadow: 0 0 0 3px var(--ink), 0 8px 0 3px rgba(0,0,0,.15); }

/* Bergsprung */
.mountain {
  position: relative; flex: 1; min-height: 0; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--sh-2);
  background:
    linear-gradient(168deg, transparent 0 58%, #7CC59B 58.2% 100%),
    linear-gradient(196deg, transparent 0 64%, #5DB083 64.2% 100%),
    linear-gradient(hsl(calc(205 - var(--alt) * 22), 82%, calc(84% - var(--alt) * 10%)), #EAF7FF);
}
.peak-flag { position: absolute; left: 50%; top: calc(-56px + var(--alt) * 72px); transform: translateX(-50%); font-size: 36px; transition: top .6s var(--ease); }
.summit .peak-flag { top: 14px; animation: bounce 1s infinite; }
.climb-pic { position: absolute; left: 50%; top: 7%; transform: translateX(-50%); background: var(--card); border-radius: 22px; padding: 6px 22px; box-shadow: var(--sh-2); }
.climb-pic .pic { font-size: clamp(40px, 8dvh, 58px); line-height: 1.15; }
.climb-pic .pic.num { font-size: clamp(38px, 7dvh, 52px); font-weight: 900; color: var(--c); }
.rocks { position: absolute; left: 0; right: 0; top: 34%; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; padding: 0 10px; transition: transform .32s var(--ease), opacity .32s; }
.rocks[style*="--n:2"] { padding: 0 34px; gap: 20px; }
.rocks.slide { transform: translateY(150px); opacity: 0; }
.rock {
  color: #fff; min-height: 78px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(#BDB3A6, #8F857A); border-radius: 40% 46% 18% 18% / 50% 50% 18% 18%;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.18), 0 6px 0 #6F665D; transform: translateY(calc(var(--i) * 14px - 14px));
}
.rock .ce { font-size: clamp(16px, 4.8vw, 20px); font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.25); line-height: 1.1; text-align: center; }
.rock small { font-size: 11.5px; font-weight: 800; opacity: .92; }
.rock.ok { background: linear-gradient(#7FD6A4, #3DBE74); box-shadow: inset 0 -8px 0 rgba(0,0,0,.15), 0 6px 0 var(--green-d); }
.rock.crumble { animation: crumble .5s forwards; }
.base-rock { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 46%; height: 26%; display: flex; justify-content: center; background: radial-gradient(ellipse at 50% 100%, #8F857A 0 62%, transparent 63%); }
.climber { position: absolute; bottom: 38%; height: clamp(84px, 15dvh, 124px); width: auto; filter: drop-shadow(0 6px 6px rgba(0,0,0,.18)); }

/* Familienfoto */
.family .gp-main { justify-content: space-between; }
.frame {
  flex: none; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; padding: 12px; border-radius: 18px;
  background: var(--card); border: 9px solid #C98B4E; box-shadow: inset 0 0 0 3px #E9B57D, 0 6px 0 #A06A35, var(--sh-2); transition: transform .4s var(--spring);
}
.slot { aspect-ratio: 3 / 4; border-radius: 12px; background: #F6F0E6; border: 3px dashed #DCCDB5; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slot span { font-size: 22px; font-weight: 900; color: #CDBFA8; }
.slot.target { border-color: var(--sky); background: #EAF1FF; animation: glowbox 1.2s infinite; }
.slot.target span { color: var(--sky); }
.slot.filled { border-style: solid; border-color: #B5E3C8; background: #E7F7EE; animation: pop .4s; }
.slot .pic { font-size: clamp(26px, 8vw, 36px); }
.slot b { font-size: 11.5px; font-weight: 900; }
.frame.complete { transform: rotate(-2deg) scale(1.03); }

/* ---------- Ergebnis ---------- */
.result {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px;
  background: rgba(255,248,238,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadein .3s both;
}
.result-card {
  width: min(100%, 380px); background: var(--card); border-radius: 32px; padding: 0 22px 20px; box-shadow: var(--sh-2);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; animation: rise .45s var(--spring) both;
}
.result-card .mascot { width: 116px; margin-top: -58px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.18)); }
.result-card h2 { font-size: 38px; font-weight: 900; color: var(--green); letter-spacing: -.02em; }
.result-card p { font-weight: 800; color: var(--muted); }
.result-card > .btn { width: 100%; margin-top: 6px; }
.result-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 6px; }
.bigstars span { font-size: 52px; line-height: 1; display: inline-block; color: #E9DFCF; }
.bigstars span.on { color: var(--sun); text-shadow: 0 3px 0 #E0A300; animation: starpop .55s var(--spring) backwards; animation-delay: var(--d); }
.jump { animation: hop 1s ease-in-out infinite; }

/* ---------- Rückmeldungen ---------- */
.toast {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%); z-index: 50; pointer-events: none; white-space: nowrap;
  background: linear-gradient(180deg, #2BB57A, var(--green)); color: #fff; font-weight: 900; font-size: 28px; padding: 10px 24px;
  border-radius: 20px; box-shadow: 0 5px 0 var(--green-d), 0 16px 28px -10px rgba(23,120,79,.6); animation: toast 1.2s forwards;
}
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
.nope { animation: shake .4s; }
.pop { animation: pop .35s; }

/* ---------- Eltern / Gate / Studio ---------- */
.legal-links { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); margin-top: 14px; }
.legal-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.legal-links .credit { text-decoration: none; white-space: nowrap; }
.legal { padding-bottom: calc(32px + var(--safe-b)); }
.legal .card { margin-bottom: 12px; -webkit-user-select: text; user-select: text; }
.legal .card h2 { font-size: 17px; }
.legal .card p, .legal .card li { font-size: 15px; line-height: 1.6; font-weight: 600; }
.legal .card a { color: var(--sky-d); text-decoration: underline; word-break: break-word; }
.legal-intro { background: linear-gradient(135deg, #E9F8EF, #FFFFFF); }
.legal-intro ul { padding-left: 20px; display: grid; gap: 6px; }
.optout { margin: 10px 0 4px; padding: 10px 14px; border-radius: var(--r-s); background: #F7F2EA; }
.optout-state { font-size: 13px !important; margin-top: 0 !important; }
.page .card { margin-bottom: 14px; }
.page h2 { font-size: 19px; font-weight: 900; margin-bottom: 8px; }
.page p { line-height: 1.5; font-weight: 700; }
.page p + p { margin-top: 8px; }
.page .card .btn { margin-top: 12px; }
.lead { margin-bottom: 16px; }
.plist { list-style: none; padding: 0; display: grid; gap: 8px; margin-top: 12px; }
.plist li { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; padding-top: 8px; border-top: 1px solid #F3EADB; }
.plist-v { color: var(--muted); white-space: nowrap; }
.switch { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-weight: 800; cursor: pointer; }
.switch input { width: 24px; height: 24px; accent-color: var(--green); flex: none; }
.gate .q { font-size: 40px; font-weight: 900; text-align: center; margin: 14px 0; }
.gate form { display: flex; gap: 10px; }
.gate input { flex: 1; min-width: 0; font: inherit; font-size: 26px; font-weight: 900; text-align: center; border: 3px solid var(--line); border-radius: 16px; padding: 10px; background: #fff; }
.gate .btn { min-width: 0; margin: 0; }
input.no { border-color: var(--coral); animation: shake .4s; }

.studio-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.count { font-weight: 900; font-size: 18px; }
.studio-bar .btn { min-width: 0; font-size: 16px; padding: 12px 18px; margin: 0; }
.srow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 2px solid var(--bg); }
.srow .w { flex: 1; min-width: 0; display: grid; }
.srow b { font-size: 20px; }
.srow.has b::after { content: ' ✓'; color: var(--green); }
.srow small { color: var(--muted); font-weight: 700; }
.srow .note { margin-top: 6px; font: inherit; font-size: 14px; border: 2px solid var(--line); border-radius: 10px; padding: 6px 8px; width: 100%; }
.act { display: flex; gap: 6px; flex: none; }
.act button { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); font-size: 18px; }
.srow .play { opacity: .3; pointer-events: none; }
.srow.has .play { opacity: 1; pointer-events: auto; }
.srow.recording .rec { background: var(--coral); color: #fff; animation: pulse 1s infinite; }

/* ---------- Lernen (im Aufbau, Code bleibt bestehen) ---------- */
.hero { position: relative; padding: 26px 24px 96px; background: linear-gradient(#BDE6FF, #E9F7FF); overflow: hidden; border-radius: 28px; }
.hero .hello { font-size: 36px; font-weight: 900; position: relative; }
.hero p { font-weight: 800; color: #3C556B; margin-top: 4px; position: relative; max-width: 70%; }
.hero .sun { position: absolute; right: 28px; top: 22px; width: 60px; height: 60px; border-radius: 50%; background: var(--sun); }
.hero .mtn { position: absolute; left: 0; bottom: -1px; width: 100%; height: 96px; }
.path { list-style: none; padding: 30px 0 8px; position: relative; display: grid; gap: 20px; }
.path::before { content: ''; position: absolute; left: 50%; top: 60px; bottom: 50px; border-left: 4px dashed #E5D3B5; transform: translateX(-50%); }
.node { display: flex; position: relative; z-index: 1; }
.node.r { justify-content: flex-end; }
.node a { display: flex; align-items: center; gap: 12px; width: min(100%, 310px); }
.node.r a { flex-direction: row-reverse; text-align: right; }
.bubble { flex: none; width: 84px; height: 84px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-size: 40px; color: #fff; font-weight: 900; box-shadow: 0 6px 0 rgba(0,0,0,.2); border: 4px solid #fff; }
.label { background: #fff; border-radius: 18px; padding: 10px 14px; display: grid; min-width: 0; box-shadow: var(--sh-1); }
.label b { font-size: 19px; line-height: 1.15; }
.label small { color: var(--muted); font-weight: 800; font-size: 14px; }
.lesson { min-height: 100dvh; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 14px; padding: 18px 0 10px; }
.close { font-size: 22px; color: var(--muted); font-weight: 900; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.progress { flex: 1; height: 18px; background: #EFE3D0; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 99px; transition: width .4s; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0 24px; }
.stage.center { justify-content: center; gap: 26px; padding-bottom: 60px; }
.hint { font-weight: 900; font-size: 22px; text-align: center; }
.learn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 20px 26px; position: relative; }
.pic { font-size: 112px; line-height: 1.1; }
.pic.num { font-size: 104px; font-weight: 900; color: var(--c); line-height: 1; }
.learn .ce { font-size: 46px; font-weight: 900; text-align: center; line-height: 1.1; margin-top: 8px; }
.lat { font-size: 21px; color: var(--muted); font-weight: 800; }
.de { font-size: 15px; color: var(--muted); font-weight: 800; background: var(--bg); border-radius: 99px; padding: 4px 14px; margin-top: 8px; }
.speak { width: 64px; height: 64px; border-radius: 50%; background: var(--sky); color: #fff; font-size: 28px; box-shadow: 0 5px 0 var(--sky-d); display: grid; place-items: center; }
.learn .speak { position: absolute; top: 16px; right: 16px; width: 58px; height: 58px; font-size: 24px; }
.speak.big { width: 128px; height: 128px; font-size: 54px; }
.speak.muted { background: #CBD3DC; box-shadow: 0 5px 0 #A9B4C0; }
.go { width: 100%; margin-top: auto; }
.opts { display: grid; gap: 12px; width: 100%; }
.opts.pics { grid-template-columns: repeat(3, 1fr); }
.opts.pics .opt { aspect-ratio: 1; }
.opts.pics .opt .pic { font-size: 62px; }
.prompt { text-align: center; }
.prompt .ce { font-size: 46px; font-weight: 900; }
.card.mini { padding: 18px 44px; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.col { display: grid; gap: 10px; align-content: start; }
.tile { background: #fff; border-radius: 18px; box-shadow: 0 4px 0 var(--line-2); min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; }
.tile .pic { font-size: 42px; }
.tile .ce { font-size: 21px; font-weight: 900; }
.tile small { font-size: 13px; color: var(--muted); font-weight: 800; }
.tile.sel { background: #EAF1FF; box-shadow: 0 4px 0 var(--sky); }
.tile.done { background: #E6F7EE; opacity: .4; pointer-events: none; }
.tile.no { animation: shake .4s; }
.finish { text-align: center; margin-top: 24px; display: grid; gap: 10px; justify-items: center; }
.trophy { font-size: 100px; }
.finish h2 { font-size: 42px; font-weight: 900; color: var(--green); }
.row-btns { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 18px; }
.abc { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.letter { background: #fff; border-radius: 18px; box-shadow: 0 4px 0 var(--line-2); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.letter b { font-size: 28px; font-weight: 900; line-height: 1; }
.letter small { font-size: 12px; color: var(--muted); font-weight: 800; }
.letter.special { background: #FFF3D6; }
.sp-key { background: #FFF3D6; border-radius: 8px; padding: 0 6px; }

/* ---------- Animationen ---------- */
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.94); } }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes ring { 0% { box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000), 0 0 0 0 color-mix(in srgb, var(--c) 45%, transparent); } 100% { box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000), 0 0 0 14px transparent; } }
@keyframes sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes chew { 30% { transform: scaleY(.92) scaleX(1.05); } 60% { transform: scaleY(1.04) translateY(-8px); } }
@keyframes headshake { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes popflip { 50% { transform: rotateY(180deg) scale(1.08); } 100% { transform: rotateY(180deg) scale(1); } }
@keyframes crhop { 40% { transform: translateY(-14px) scale(1.1); } }
@keyframes partglow { 50% { fill: #FFE7A0; } }
@keyframes crumble { 30% { transform: translateX(-6px) rotate(-4deg); } 60% { transform: translateX(6px) rotate(4deg); } 100% { transform: translateY(40px) scale(.7); opacity: 0; } }
@keyframes glowbox { 50% { box-shadow: 0 0 0 6px rgba(59,130,246,.25); } }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes starpop { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes bounce { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -10px); } }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255,107,91,.25); } }

/* ---------- Kleine / niedrige Handys ---------- */
@media (max-height: 700px) {
  .gp-top { padding: 6px 0 6px; }
  .gp-main { gap: 10px; padding-top: 10px; }
  .ghint { font-size: 13px; }
  .say-bubble { padding: 8px 20px 9px; }
  .welcome { min-height: 210px; }
  .door { padding: 13px; }
  .door-ico { width: 54px; height: 54px; font-size: 28px; }
  .doors { margin-top: 14px; }
}
@media (max-width: 360px) {
  #app { padding-left: 12px; padding-right: 12px; }
  .speech { font-size: 20px; }
  .games, .levels { gap: 10px; }
  .game { min-height: 166px; padding: 14px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
