/* Kinderwelt: helle, freundliche Welt für Kinder von 3 bis 7. Große Flächen, ruhige Bewegung, kein Blinken. */
:root{color-scheme:light;--himmel:#bfe8ff;--himmel2:#eaf8ff;--wiese:#9be27c;--wiese2:#7fd36a;--text:#3b2a4f;--leise:#6d5f80;--weiss:#fff;
  --rot:#ff5a64;--gelb:#ffd23f;--gruen:#43c96a;--blau:#3d8bff;--lila:#a46bff;--orange:#ff9a2e;--rosa:#ff86b8;
  --schrift:ui-rounded,"SF Pro Rounded","Segoe UI Rounded","Arial Rounded MT Bold","Nunito",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --rand-o:env(safe-area-inset-top,0px);--rand-u:env(safe-area-inset-bottom,0px);--rand-l:env(safe-area-inset-left,0px);--rand-r:env(safe-area-inset-right,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html,body{height:100%;margin:0}
body{background:var(--himmel2);color:var(--text);font:18px/1.4 var(--schrift);overflow:hidden;overscroll-behavior:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;padding:0}
:focus-visible{outline:4px solid var(--blau);outline-offset:3px;border-radius:16px}

/* Himmel mit langsam ziehenden Wolken */
.himmel{position:fixed;inset:0;z-index:0;pointer-events:none;background:linear-gradient(#a9e0ff 0%,#d4f0ff 55%,#f2fbff 100%);overflow:hidden}
.wolke{position:absolute;width:180px;height:60px;border-radius:60px;background:#fff;opacity:.85;animation:ziehen 90s linear infinite}
.wolke::before,.wolke::after{content:"";position:absolute;background:#fff;border-radius:50%}
.wolke::before{width:80px;height:80px;left:28px;top:-40px}.wolke::after{width:60px;height:60px;left:90px;top:-26px}
.w1{top:9%;left:-200px}.w2{top:26%;left:-200px;transform:scale(.7);animation-duration:120s;animation-delay:-50s}.w3{top:15%;left:-200px;transform:scale(.55);animation-duration:150s;animation-delay:-100s}
@keyframes ziehen{to{translate:calc(100vw + 400px) 0}}
.wiese{position:absolute;left:-10%;right:-10%;bottom:-60px;height:200px;border-radius:50% 50% 0 0;background:var(--wiese);box-shadow:0 -14px 0 var(--wiese2) inset}
@media (prefers-reduced-motion:reduce){.wolke,.funki{animation:none!important}}

/* Start */
#start{position:relative;z-index:1;height:100%;display:flex;flex-direction:column;padding:calc(var(--rand-o) + 10px) calc(var(--rand-r) + 14px) calc(var(--rand-u) + 14px) calc(var(--rand-l) + 14px);gap:10px}
.k-kopf{display:flex;align-items:center;gap:14px;min-height:84px;padding-top:6px}
.funki-knopf{width:96px;height:84px;flex:none;display:grid;place-items:center;border-radius:28px;touch-action:manipulation}
.funki-knopf.klein{width:80px;height:72px}
.funki{display:block;width:100%;height:100%;animation:schweben 4.5s ease-in-out infinite}
.funki svg{width:100%;height:100%;overflow:visible;display:block}
.funki .mund{transform-origin:77px 59px;transform-box:view-box}
.funki.spricht .mund{animation:reden .34s ease-in-out infinite alternate}
.funki.freut{animation:huepfen .6s ease-in-out 2}
@keyframes schweben{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-6px) rotate(2deg)}}
@keyframes reden{from{transform:scaleY(.5)}to{transform:scaleY(1.25)}}
@keyframes huepfen{0%,100%{transform:translateY(0)}50%{transform:translateY(-16px) scale(1.06)}}
.blase{position:relative;flex:1;min-width:0;background:#fff;border:3px solid var(--text);border-radius:24px;padding:10px 16px;font-weight:800;font-size:clamp(17px,2.4vw,24px);box-shadow:0 6px 0 #3b2a4f22;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.25;max-height:calc(2.5em + 26px)}
.blase::before{content:"";position:absolute;left:-13px;top:50%;width:20px;height:20px;background:#fff;border-left:3px solid var(--text);border-bottom:3px solid var(--text);transform:translateY(-50%) rotate(45deg)}
.rund{width:72px;height:72px;flex:none;border-radius:50%;display:grid;place-items:center;background:#fff;border:3px solid var(--text);box-shadow:0 5px 0 #3b2a4f33;touch-action:manipulation;transition:transform .15s}
.rund:active{transform:translateY(3px) scale(.96)}
.rund svg{width:62%;height:62%}
.eltern{width:64px;height:64px;opacity:.85}

.kacheln{flex:1;min-height:0;display:grid;gap:14px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,1fr)}
@media (max-aspect-ratio:1/1){.kacheln{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(3,1fr)}}
.kachel{position:relative;min-height:72px;border-radius:30px;border:5px solid #fff;background:var(--k,#ffd23f);box-shadow:0 8px 0 #3b2a4f2e,0 14px 30px #3b2a4f22;overflow:hidden;touch-action:manipulation;transition:transform .2s ease}
.kachel:active,.kachel.tipp{transform:scale(.95) rotate(-1deg)}
.kachel canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.kachel .name{position:absolute;left:0;right:0;bottom:6px;text-align:center;font-weight:900;font-size:clamp(14px,2vw,20px);color:#3b2a4fcc;pointer-events:none}
.kachel::after{content:"";position:absolute;inset:0;border-radius:24px;background:linear-gradient(#ffffff40,transparent 45%);pointer-events:none}

/* Spiel */
#spiel{position:fixed;inset:0;z-index:2;display:flex;flex-direction:column;touch-action:none}
.s-kopf{flex:none;display:flex;align-items:center;gap:10px;padding:calc(var(--rand-o) + 8px) calc(var(--rand-r) + 12px) 6px calc(var(--rand-l) + 12px);min-height:88px}
.s-extra{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:8px}
.s-flaeche{position:relative;flex:1;min-height:0;margin:0 calc(var(--rand-r) + 10px) calc(var(--rand-u) + 10px) calc(var(--rand-l) + 10px);border-radius:28px;background:#ffffffb8;border:4px solid #fff;box-shadow:0 10px 30px #3b2a4f1f;overflow:hidden;touch-action:none}

/* Geschafft */
.geschafft{position:absolute;inset:0;z-index:10;display:grid;place-items:center;background:#bfe8ffcc;backdrop-filter:blur(4px)}
.regen{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.regen i{position:absolute;top:-40px;width:28px;height:28px;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);animation:fallen linear forwards}
@keyframes fallen{to{transform:translateY(110vh) rotate(260deg)}}
.g-karte{position:relative;display:flex;flex-direction:column;align-items:center;gap:12px;background:#fff;border:5px solid var(--text);border-radius:36px;padding:20px 28px 26px;box-shadow:0 10px 0 #3b2a4f33}
.funki.gross{width:170px;height:140px}
.g-sterne{display:flex;gap:10px}
.g-sterne i{width:46px;height:46px;background:var(--gelb);clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);animation:stern-rein .5s ease-out backwards}
.g-sterne i:nth-child(2){animation-delay:.2s;transform:translateY(-10px)}.g-sterne i:nth-child(3){animation-delay:.4s}
@keyframes stern-rein{from{transform:scale(0) rotate(-90deg)}}
.g-knoepfe{display:flex;gap:22px}
.riesig{width:96px;height:96px}
.rund.gruen{background:var(--gruen)}

/* Eltern-Tor und Einstellungen */
.tor{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:16px;background:#3b2a4f66}
.tor-karte{position:relative;width:min(420px,100%);max-height:100%;overflow:auto;background:#fff;border-radius:28px;padding:24px 22px;box-shadow:0 20px 60px #0004;text-align:center;font-size:17px}
.tor-karte>b{display:block;font-size:22px;margin:0 30px 6px}
.zu{position:absolute;top:10px;right:10px;width:48px;height:48px;border-radius:50%;font-size:22px;background:#f1ecf7}
.halten{position:relative;width:150px;height:150px;border-radius:50%;margin:8px auto 4px;display:grid;place-items:center;background:#f1ecf7;touch-action:none}
.halten span{position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--blau) calc(var(--p,0)*1turn),#0000 0);-webkit-mask:radial-gradient(circle,#0000 58%,#000 59%);mask:radial-gradient(circle,#0000 58%,#000 59%)}
.halten b{font-size:20px}
.anzeige{font-size:34px;font-weight:900;min-height:52px;border-bottom:3px solid #e3dcef;margin:0 auto 12px;width:140px;font-variant-numeric:tabular-nums}
.ziffern{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-width:300px;margin:0 auto}
.ziffern button{height:60px;border-radius:16px;background:#f1ecf7;font-size:24px;font-weight:800}
.ziffern button.ok{background:var(--gruen);color:#fff}
.tor-fehler{color:#c4303f;font-weight:700}
.schalter{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 4px;border-bottom:1px solid #eee;font-weight:700;text-align:left}
.schalter input[type=checkbox]{width:28px;height:28px;accent-color:var(--gruen)}
.schalter input[type=range]{width:50%;accent-color:var(--blau)}
.leise{color:var(--leise);font-size:14px}
.e-knoepfe{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:12px}
.knopf{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:0 22px;border-radius:999px;background:var(--gruen);color:#fff;font-weight:800;text-decoration:none}
.knopf.zwei{background:#f1ecf7;color:var(--text)}

/* Bausteine für die Spiele */
.k-ziel{display:flex;align-items:center;gap:8px;background:#fff;border:3px solid var(--text);border-radius:999px;padding:4px 14px 4px 6px;box-shadow:0 4px 0 #3b2a4f22;min-height:64px}
.k-ziel canvas{width:52px;height:56px}
.k-punkte{display:flex;gap:4px}
.k-punkte i{width:24px;height:24px;background:#e8e1f2;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);transition:background .3s,transform .3s}
.k-punkte i.an{background:var(--gelb);transform:scale(1.15)}
.k-knopf{min-width:72px;height:72px;border-radius:22px;background:#fff;border:3px solid var(--text);box-shadow:0 5px 0 #3b2a4f33;display:grid;place-items:center;touch-action:manipulation;transition:transform .15s}
.k-knopf:active{transform:translateY(3px) scale(.96)}
.k-knopf svg{width:60%;height:60%}
@media (max-height:460px){.s-kopf{min-height:76px;padding-top:calc(var(--rand-o) + 4px)}.k-kopf{min-height:76px}.funki-knopf{height:72px;width:84px}.k-punkte i{width:20px;height:20px}}
.schalter:has(input[type=checkbox]){flex-direction:row-reverse}
