/* Andika (SIL, Open Font License – fonts/OFL.txt): Schrift für Leseanfänger, mitgeliefert, damit jedes Gerät
   gleich aussieht und es offline geht. latin = Deutsch; latin-ext nur bei Bedarf (z. B. ş, ğ, ẞ in Namen). */
@font-face { font-family: 'Andika'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/andika-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Andika'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/andika-latin-ext-400.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Andika'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/andika-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Andika'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/andika-latin-ext-700.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Farben laut Gestaltungsrichtlinie der Nest-Familie; Akzent von Zahlennest: Petrol (Weiß darauf 5,3:1).
   Beim Ziffern-Nachspuren (später) kein Petrol – dort nur Blau (Start) und Orange (Pfeile) wie in Wortnest. */
:root {
  --bg: #fdf6ec;
  --papier: #ffffff;
  --text: #4a3f35;
  --leise: #5e5348;          /* leise-lesbar: 7,5:1 auf Weiß */
  --rand: #eadfcf;
  --akzent: #00796b;
  --akzent-hell: #dcefec;
  --gruen: #5cb85c;
  --rot: #e05d5d;
  --schatten: 0 4px 0 rgba(74, 63, 53, 0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Andika", "Nunito", system-ui, sans-serif;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.screen {
  display: none;
  flex-direction: column;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}
.topbar h2 { margin: 0; font-size: 1.3rem; }

.icon-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 20px;
  background: var(--papier);
  box-shadow: var(--schatten);
  font-size: 2rem;
  display: grid;
  place-items: center;
  transition: transform 0.1s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.small { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 14px; opacity: 0.6; }

/* Langes Drücken für Elternbereich: Fortschrittsring */
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.ring circle {
  fill: none; stroke: var(--akzent); stroke-width: 3;
  stroke-dasharray: 101; stroke-dashoffset: 101;
}
.icon-btn.halten .ring circle { stroke-dashoffset: 0; transition: stroke-dashoffset 2s linear; }

/* Startseite: große Spiel-Kacheln, ohne Scrollen (2 Spalten hochkant, 4 im Querformat) */
.spiele-raster {
  /* Spalten und Reihen setzt spieleZeigen() je nach Anzahl der Kacheln (alles passt immer auf eine Seite) */
  --spalten: 2; --reihen: 1;
  --kachel: min(180px, calc((100vw - 40px) / var(--spalten) - 18px), calc((100dvh - 140px) / var(--reihen) - 18px));
  flex: 1; display: grid; gap: 18px; padding: 10px 0 30px;
  grid-template-columns: repeat(var(--spalten), var(--kachel)); grid-auto-rows: var(--kachel);
  justify-content: center; align-content: center;
}
.spiel-btn {
  border: none; border-radius: 32px; background: var(--papier); box-shadow: var(--schatten);
  font-size: calc(var(--kachel, 170px) * 0.46); display: grid; place-items: center; padding: 0;
}
.spiel-btn:active { transform: scale(0.94); }
/* Bis Kinder/Regal geladen sind keine Spiel-Kacheln zeigen (sonst springen sie, und ein Kind trifft das falsche Spiel) */
body.laedt #home .spiele-raster { visibility: hidden; }
.home-leer { flex: 1; display: grid; place-items: center; }
.home-leer img { width: min(60vw, 280px); }

/* Spiel-Ende: großes Haus, kleineres Nochmal (kein automatisches Weiterspielen) */
.spiel-ende {
  position: fixed; left: 0; right: 0; bottom: max(40px, env(safe-area-inset-bottom)); z-index: 6;
  display: flex; justify-content: center; align-items: center; gap: 28px;
}
.spiel-ende button { border: none; border-radius: 50%; background: var(--papier); box-shadow: var(--schatten); display: grid; place-items: center; }
.spiel-ende .ende-home { width: 110px; height: 110px; font-size: 3.4rem; }
.spiel-ende .ende-nochmal { width: 76px; height: 76px; font-size: 2.2rem; }

/* Pause: ruhiges Bild, nur 🏠 */
.spiel-pause { position: fixed; inset: 0; z-index: 7; background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 40px; }
.spiel-pause .pause-bild { font-size: 8rem; animation: lauschen 4s ease-in-out infinite; }
.spiel-pause .ende-home { width: 110px; height: 110px; font-size: 3.4rem; border: none; border-radius: 50%; background: var(--papier); box-shadow: var(--schatten); }
@keyframes lauschen { 50% { transform: scale(1.12) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .spiel-pause .pause-bild { animation: none; } }

/* Wer spielt? */
.wer-kopf { justify-content: center; }
.wer-nest { height: 56px; }
.wer-liste {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  align-content: center;
  padding: 16px 0;
}
.wer-kachel {
  border: none;
  border-radius: 32px;
  background: var(--papier);
  box-shadow: var(--schatten);
  padding: 24px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.1s;
}
.wer-kachel:active { transform: scale(0.95); }
.wer-bild { font-size: 5.5rem; line-height: 1; }
.wer-name { font-size: 1.5rem; font-weight: 700; }
/* Fotos so groß wie ein Emoji in derselben Schriftgröße */
.bild-datei.foto { height: 1.15em; width: 1.15em; object-fit: cover; border-radius: 0.18em; vertical-align: -0.2em; }

/* Wer spielt gerade (oben links auf der Startseite) */
.kind-btn {
  width: 52px; height: 52px;
  border: none; border-radius: 16px;
  background: var(--papier); box-shadow: var(--schatten);
  font-size: 2rem; line-height: 1;
  display: grid; place-items: center;
}
.kind-btn:active { transform: scale(0.92); }

/* Elternbereich */
.eltern { font-family: system-ui, sans-serif; }
.eltern-inhalt { flex: 1; overflow-y: auto; padding: 16px 0 24px; display: flex; flex-direction: column; gap: 16px; }
.karte { background: var(--papier); border-radius: 16px; padding: 16px; box-shadow: var(--schatten); }
.karte[hidden] { display: none; }
.karte h3 { margin: 0 0 10px; font-size: 1.05rem; }
.karte h3 small { font-weight: normal; color: var(--leise); }
.hinweis { margin: 0 0 12px; color: var(--leise); font-size: 0.92rem; line-height: 1.4; }
.hinweis b { color: var(--text); font-weight: 600; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 8px; }

.kinder-liste { display: flex; flex-direction: column; margin-bottom: 10px; }
.kind-zeile {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  border: none; border-bottom: 1px solid var(--rand); background: none;
  padding: 10px 0; text-align: left;
}
.kind-zeile:last-child { border-bottom: none; }
.kind-zeile .kind-bild { font-size: 2.4rem; text-align: center; line-height: 1; }
.kind-zeile .w { font-size: 1rem; line-height: 1.35; }
.kind-zeile .w small { color: var(--leise); }
.kind-zeile .pfeil { font-size: 1.2rem; }

.tier-auswahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tier {
  aspect-ratio: 1; border: 2px solid var(--rand); border-radius: 14px;
  background: var(--bg); font-size: 1.7rem;
}
.tier.gewaehlt { border-color: var(--akzent); background: var(--akzent-hell); }

/* Spiele-Regal und Pausen-Wahl im Elternbereich: Name und kurze Erklärung */
.regal-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.regal-spiel {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 14px;
  border: 2px solid #e3d8c6; background: var(--papier); font: inherit; font-size: 0.95rem; text-align: left; opacity: 0.55;
}
.regal-spiel span { font-size: 1.6rem; }
.regal-spiel b { font-weight: 600; }
.regal-spiel small { flex-basis: 100%; font-size: 0.78rem; color: var(--leise); line-height: 1.3; padding-left: 2px; }
.regal-spiel.gewaehlt { border-color: var(--akzent); background: var(--akzent-hell); opacity: 1; }

.textfeld {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 10px 12px;
  border: 1px solid var(--rand); border-radius: 12px; background: var(--bg); color: var(--text);
}

.text-btn { border: 1px solid var(--rand); background: var(--bg); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
.text-btn.warnung { color: #b3261e; border-color: var(--rot); }

/* Willkommen (erster Start, für Eltern) */
.willkommen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center; max-width: 440px; margin: 0 auto; padding: 20px 8px; overflow-y: auto; }
.willkommen h2 { margin: 0; font-size: 1.8rem; }
.willkommen p { margin: 0; line-height: 1.45; }
.willkommen-bild { width: 150px; }
.willkommen-btn { width: 100%; max-width: 320px; padding: 16px; border-radius: 20px; border: 3px solid #e3d8c6;
  background: var(--papier); box-shadow: var(--schatten); font: inherit; font-size: 1.25rem; font-weight: 700; }
.willkommen-btn.haupt { border-color: var(--akzent); background: var(--akzent-hell); }
.willkommen-btn:active { transform: scale(0.97); }

/* Über die App & Datenschutz */
.info .karte p { margin: 0 0 10px; line-height: 1.5; font-size: 0.95rem; }
.info .karte a { color: #1d5fbf; }

/* ---------- Wie viele? ---------- */
/* Rundenpunkte als kleine Eier (nicht rund: sonst sähen sie aus wie die Mengen-Punkte) */
.runden-eier { display: flex; gap: 12px; }
.runden-eier .gruppe { display: flex; gap: 4px; }
.runden-eier .gruppe span { width: 11px; height: 14px; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  border: 2px solid #c7b08a; background: var(--papier); }
/* gefüllt in Petrol, nicht gelb: Gelb heißt im Spiel „dieser Punkt wird gerade gezählt“ */
.runden-eier .gruppe span.voll { background: var(--akzent); border-color: var(--akzent); }
.stufen-symbol { text-align: center; font-size: 3rem; margin: 10px 0 0; }
.stufen-symbol.huepft { animation: huepfen 0.6s ease; }

/* Karten: eine große (Stufe 1, 3, echte Welt) oder drei (Stufe 2: hochkant als Dreieck, quer als Reihe) */
.mengen-karten { flex: 1; display: grid; gap: 24px; align-content: center; justify-content: center; padding: 0 18px; }
.mengen-karten.einzeln { grid-template-columns: min(260px, 64vw, 38vh); }
.mengen-karten.drei { grid-template-columns: repeat(2, min(160px, 38vw, 22vh)); }
.mengen-karten.drei .mengen-karte:nth-child(3) { grid-column: 1 / -1; justify-self: center; width: min(160px, 38vw, 22vh); }
@media (orientation: landscape) {
  .mengen-karten.einzeln { grid-template-columns: min(300px, 50vh); }
  .mengen-karten.drei { grid-template-columns: repeat(3, min(220px, 26vw, 46vh)); }
  .mengen-karten.drei .mengen-karte:nth-child(3) { grid-column: auto; width: auto; justify-self: stretch; }
}
.mengen-karte { aspect-ratio: 1; border: none; border-radius: 28px; background: var(--papier); box-shadow: var(--schatten);
  padding: 0; display: grid; place-items: center; transition: opacity 0.3s; }
.mengen-karte svg { width: 100%; height: 100%; display: block; }
.mengen-karte.kommt { animation: aufploppen 0.4s ease-out; }
.mengen-karte.pulsiert { animation: warten-puls 1.6s ease-in-out infinite; }
.mengen-karte.huepft { animation: huepfen 0.6s ease; }
.mengen-karte.wackelt { animation: wackeln 0.6s ease; }
.mengen-karte.blass { opacity: 0.35; }
.mengen-karte.richtig { box-shadow: 0 0 0 6px var(--akzent); }
/* Punkte und Finger: dunkel auf Weiß; Leuchten = gelb, heller und größer (nicht nur andere Farbe) */
.menge-punkt { fill: #4a3f35; transform-box: fill-box; transform-origin: center; transition: fill 0.2s, transform 0.2s; }
/* kaum größer: gleich große Punkte bleiben gleich groß (sonst vergleicht das Auge Flächen) */
.menge-punkt.leuchtet { fill: #f5c518; stroke: #b07800; stroke-width: 2.5; transform: scale(1.05); }
.hand { fill: #fff1dc; stroke: #4a3f35; stroke-width: 3; stroke-linejoin: round; }
.finger { transform-box: fill-box; transform-origin: bottom; transition: fill 0.2s, transform 0.2s; }
.finger.leuchtet { fill: #f5c518; transform: scale(1.06); }

/* 👍 für Erwachsene: klein und ruhig unten rechts (kein Pulsieren – sonst hält das Kind ihn für „weiter“) */
.daumen-platz { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 7; }
.daumen-btn { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #c7b08a; background: var(--papier);
  box-shadow: var(--schatten); font-size: 2rem; opacity: 0.9; }

/* Querformat auf dem Handy (niedrig): 👍 rechts unten statt unter der Karte, Symbol kleiner */
@media (orientation: landscape) and (max-height: 600px) {
  .stufen-symbol { font-size: 2rem; margin: 0; }
}

@keyframes aufploppen { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes huepfen { 30% { transform: translateY(-24px) scale(1.08); } 60% { transform: translateY(0) scale(1); } }
@keyframes wackeln { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes warten-puls { 50% { transform: scale(1.05); box-shadow: 0 0 0 10px var(--akzent-hell); } }
@media (prefers-reduced-motion: reduce) {
  .mengen-karte.pulsiert { animation: none; box-shadow: 0 0 0 6px var(--akzent-hell); }
}

/* ---------- Mehr oder weniger? ---------- */
.kachel-bild { width: 74%; height: auto; }
.regal-spiel span .kachel-bild, .kind-zeile .kachel-bild { width: 1.6em; vertical-align: -0.35em; }
.umschalter { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 1rem; }
.umschalter input { width: 22px; height: 22px; accent-color: var(--akzent); flex: none; }

/* Zwei Teller immer übereinander (Partner beim Paaren stehen genau untereinander); Größe nach Breite und Höhe */
.teller-paar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.teller { width: min(330px, 86vw, calc((100dvh - 190px) / 2 * 300 / 180)); aspect-ratio: 300 / 180; border: none;
  background: none; padding: 0; border-radius: 50%; transition: opacity 0.3s; }
.teller svg { width: 100%; height: 100%; display: block; overflow: visible; }
.teller .rand { fill: #fff; stroke: #c7b08a; stroke-width: 4; }
.teller .mitte { fill: #f6efe3; }
.teller.kommt { animation: aufploppen 0.4s ease-out; }
.teller.wackelt { animation: wackeln 0.6s ease; }
.teller.huepft { animation: huepfen 0.6s ease; }
.teller.richtig .rand { stroke: var(--akzent); stroke-width: 8; }
.teller.pulsiert { animation: teller-puls 1.6s ease-in-out infinite; }
@keyframes teller-puls { 50% { transform: scale(1.04); } }
.ding { transition: transform 0.5s ease-in-out; }
.ding-innen { transform-box: fill-box; transform-origin: center; }
.ding-innen.huepft { animation: ding-huepfen 0.4s ease; }
@keyframes ding-huepfen { 40% { transform: translateY(-14px) scale(1.1); } }
.ding .halo { fill: #f5c518; stroke: #b07800; stroke-width: 2; opacity: 0; transition: opacity 0.2s; }
.ding.leuchtet .halo { opacity: 1; }
/* Auftrag echte Welt: zwei Bilder übereinander (z. B. 👀 und 👃) */
.welt-bild { width: min(200px, 50vw, 24dvh); aspect-ratio: 1; border-radius: 28px; background: var(--papier);
  box-shadow: var(--schatten); display: grid; place-items: center; font-size: min(6rem, 14dvh); }
.welt-bild.leuchtet { box-shadow: 0 0 0 6px #f5c518; }
.welt-bild.kommt { animation: aufploppen 0.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .ding { transition: none; } .teller.pulsiert { animation: none; } }

/* ---------- In den Korb ---------- */
/* Schieben: die ganze Spielfläche ohne Browser-Gesten (kein Scrollen, kein Zurückwischen) */
#korb, .korb-feld { touch-action: none; overscroll-behavior: none; }
.korb-feld { flex: 1; position: relative; min-height: 0; }
.korb-ding { position: absolute; left: 0; top: 0; padding: 0; border: none; background: none; touch-action: none; z-index: 2;
  transition: transform 0.28s ease-out, opacity 0.3s; }
.korb-ding svg { width: 100%; height: 100%; display: block; overflow: visible; transition: transform 0.15s; }
/* gegriffen: folgt dem Finger ohne Verzögerung, 10 % größer, über allem */
.korb-ding.greift { transition: none; z-index: 5; }
.korb-ding.greift svg { transform: scale(1.1); }
.korb-ding.huepft svg { animation: ding-huepfen 0.4s ease; }
.korb-ding.blass { opacity: 0.35; }
.korb-ding .halo { fill: #f5c518; stroke: #b07800; stroke-width: 2; opacity: 0; transition: opacity 0.2s; }
.korb-ding.leuchtet .halo { opacity: 1; }
.korb-korb { position: absolute; pointer-events: none; z-index: 1; }
/* Vorderseite des Korbs über den Dingen im Korb (z 2), unter dem gerade gezogenen Ding (z 5) */
.korb-korb.korb-vorn { z-index: 3; }
.korb-korb svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* Auftrag als Punktkarte (keine Ziffer): Ringe füllen sich bei jedem Ankommen */
.korb-karte { position: absolute; background: var(--papier); border-radius: 18px; box-shadow: var(--schatten); z-index: 3; pointer-events: none; }
.korb-karte svg { width: 100%; height: 100%; display: block; }
.korb-karte .karte-punkt { fill: var(--papier); stroke: #4a3f35; stroke-width: 4; transition: fill 0.2s; }
.korb-karte .karte-punkt.voll { fill: #4a3f35; }
.korb-karte.pulsiert { animation: warten-puls 1.6s ease-in-out 2; }
.geist-hand { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 6; opacity: 0;
  transition: transform 1.2s ease-in-out, opacity 0.3s; }
.geist-hand .geist-ding { opacity: 0.55; }
.geist-hand .geist-ding svg { width: 100%; height: 100%; display: block; overflow: visible; }
.geist-hand span { position: absolute; left: 40%; top: 45%; font-size: 3rem; line-height: 1; }
.welt-bild svg { width: 70%; height: 70%; }
.korb-welt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 24px; }
@media (prefers-reduced-motion: reduce) { .korb-ding { transition: opacity 0.3s; } .geist-hand { transition: opacity 0.3s; } }
/* Echte Welt im Korb-Spiel: kleine Bausteine neben einem großen Becher; beim Mitzählen fliegt je einer hinein */
.korb-welt .welt-kloetze { display: flex; flex-direction: column; gap: 14px; align-self: center; }
.welt-klotz { width: min(84px, 20vw, 13dvh); aspect-ratio: 1; position: relative; z-index: 1; }
.welt-klotz svg, .welt-becher svg { width: 100%; height: 100%; display: block; }
/* Becher ohne eigene Ebene (kein z-index), damit die Bausteine zwischen Öffnung (hinten) und Körper (vorn) liegen */
.welt-becher { width: min(190px, 44vw, 30dvh); aspect-ratio: 1; position: relative; }
.welt-becher .becher-hinten, .welt-becher .becher-vorn { position: absolute; inset: 0; }
.welt-becher .becher-hinten { z-index: 0; }
.welt-becher .becher-vorn { z-index: 2; }
.welt-klotz.kommt, .welt-becher.kommt { animation: aufploppen 0.4s ease-out; }
/* Flug in den Becher (eigene Animation mit Bogen; bleibt am Ziel stehen) – ausgelöst beim Mitzählen */
.welt-klotz.leuchtet { animation: in-den-becher 1s ease-in-out forwards; }
@keyframes in-den-becher {
  0% { transform: translate(0, 0); }
  55% { transform: translate(calc(var(--zx) * 0.6), calc(var(--zy) * 0.6 - 70px)) scale(0.95); }
  100% { transform: translate(var(--zx), var(--zy)) scale(0.85); }
}
@media (prefers-reduced-motion: reduce) { .welt-klotz.leuchtet { animation-duration: 0.3s; } }

/* ---------- Auftrag in der echten Welt (alle Spiele) ---------- */
/* Ruhiger Bildschirm: Hintergrund etwas gedämpft, groß 👐, darüber nur eine kleine, flache Erinnerungskarte –
   ohne Schatten und ohne Aufploppen, damit nichts greifbar aussieht */
.screen.ruhig { background: #f3ebde; }
.in-echt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  width: 100%; height: 100%; min-height: 40dvh; }
#korb-feld .in-echt { position: absolute; inset: 0; }
.in-echt-karte { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 3px solid #e3d8c6;
  border-radius: 14px; background: transparent; }
.in-echt-karte svg { height: min(76px, 11dvh); width: auto; display: block; }
.in-echt-karte .karte-bild { font-size: min(3.2rem, 9dvh); line-height: 1; border-radius: 12px; padding: 2px 6px; }
.in-echt-karte .karte-bild.leuchtet { box-shadow: 0 0 0 4px #f5c518; }
.in-echt-karte .karte-punkt { fill: none; stroke: #4a3f35; stroke-width: 5; }
.in-echt-karte .karte-punkt.leuchtet { fill: #f5c518; stroke: #b07800; }
.in-echt-karte.wackelt { animation: wackeln 0.6s ease; }
.in-echt-haende { font-size: min(8rem, 20dvh); line-height: 1; }
.karte-becher { position: relative; display: inline-block; height: min(76px, 11dvh); aspect-ratio: 1; }
.karte-becher svg { position: absolute; inset: 0; height: 100%; width: 100%; }

/* ---------- Zahlen-Trommel ---------- */
#trommel, .trommel-feld { touch-action: none; overscroll-behavior: none; }
.trommel-feld { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  min-height: 0; padding-bottom: 40px; position: relative; }
@media (orientation: landscape) { .trommel-feld { flex-direction: row; justify-content: center; gap: 8vw; padding-bottom: 0; } }
/* Auftrag als Punktkarte (keine Ziffer): je Schlag füllt sich ein Ring */
.trommel-karte { width: min(150px, 34vw, 20dvh); aspect-ratio: 1; background: var(--papier); border-radius: 22px; box-shadow: var(--schatten); }
.trommel-karte svg { width: 100%; height: 100%; display: block; }
.trommel-karte .karte-punkt { fill: var(--papier); stroke: #4a3f35; stroke-width: 4; transition: fill 0.2s; }
.trommel-karte .karte-punkt.voll { fill: #4a3f35; }
.trommel-karte .karte-punkt.leuchtet { fill: #f5c518; stroke: #b07800; }
.trommel-karte .karte-punkt.pulsiert { animation: ring-puls 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring-puls { 50% { transform: scale(1.25); } }
.trommel-wrap { position: relative; }
/* Die Trommel: ganze Fläche ist Ziel; schlafend blass, wach in voller Farbe; nach der Zahl ruht sie (sinkt leicht) */
.trommel-btn { position: relative; width: min(78vw, 330px, 44dvh); aspect-ratio: 1; border-radius: 50%; border: 6px solid #c7b08a;
  background: var(--papier); box-shadow: var(--schatten); font-size: min(36vw, 160px, 20dvh); line-height: 1; display: grid;
  place-items: center; padding: 0; opacity: 0.55; transition: opacity 0.3s, transform 0.3s; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.trommel-btn::after { content: ''; position: absolute; inset: -20px; border-radius: 50%; }
.trommel-btn.wach { opacity: 1; }
.trommel-btn.ruht { opacity: 0.75; transform: scale(0.94); }
.trommel-btn.schlag { animation: trommelschlag 0.15s ease; }
.trommel-btn.aufwachen { animation: huepfen 0.5s ease; }
.trommel-btn.wackelt { animation: wackeln 0.6s ease; }
@keyframes trommelschlag { 50% { transform: scale(0.92); } }
/* Schlegel der App (zeigt: jetzt trommelt die App, nicht du) */
.schlegel { position: absolute; right: -6%; top: -14%; width: 38%; height: 38%; pointer-events: none; opacity: 0;
  transform-origin: 90% 10%; transform: rotate(-35deg); transition: opacity 0.3s; }
.schlegel.da { opacity: 1; }
.schlegel.schlaegt { animation: schlegel-schlag 0.3s ease; }
@keyframes schlegel-schlag { 45% { transform: rotate(8deg); } }
.schlegel svg { width: 100%; height: 100%; display: block; }
/* Vormachen am Schluss: Hände klatschen */
.klatsch-haende { font-size: min(9rem, 24dvh); line-height: 1; }
.klatsch-haende.klatscht { animation: klatschen 0.35s ease; }
@keyframes klatschen { 40% { transform: scale(0.82); } }
@media (prefers-reduced-motion: reduce) { .trommel-karte .karte-punkt.pulsiert { animation: none; stroke-width: 7; } }
.trommel-btn svg { width: 72%; height: 72%; display: block; }
.trommel-btn.zuckt { animation: zucken 0.25s ease; }
@keyframes zucken { 50% { transform: scale(0.97); } }
/* wartet still auf das Kind: sanft „atmen“, damit sie nicht kaputt wirkt */
.trommel-btn.wartet { animation: warten-puls 2.4s ease-in-out infinite; }
.trommel-btn.schlaeft { opacity: 0.35; transition: opacity 1.2s; }

/* ---------- Hol mir … ---------- */
.hol-feld { flex: 1; display: flex; min-height: 0; }
/* Auftragskarte größer als beim Schluss der anderen Spiele (sie IST hier der Auftrag), weiter flach und ruhig */
.in-echt-karte.gross { padding: 16px 22px; gap: 20px; }
.in-echt-karte.gross svg { height: min(120px, 16dvh); }
.in-echt-karte .karte-ding { display: inline-block; height: min(76px, 11dvh); aspect-ratio: 1; }
.in-echt-karte.gross .karte-ding { height: min(120px, 16dvh); }
.in-echt-karte .karte-ding svg { width: 100%; height: 100%; }
.hol-dinge { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 8px; }
/* Bei 1–3: die Dinge selbst, gleich groß in gleichem Abstand; leuchten einmal still nacheinander */
.in-echt-karte .karte-dinge { display: inline-flex; gap: 14px; }
.in-echt-karte .karte-ding { border-radius: 14px; }
.in-echt-karte .karte-ding.leuchtet { box-shadow: 0 0 0 4px #f5c518; }
.in-echt-karte.gross .karte-dinge .karte-ding { height: min(96px, 13dvh); }
/* Punkte (bei 4–5) gefüllt wie ein Würfelbild: sie zeigen die gesuchte Menge, nicht „was fehlt noch“ */
.in-echt-karte.gross .karte-punkt { fill: #4a3f35; }
.in-echt-karte.gross .karte-punkt.leuchtet { fill: #f5c518; stroke: #b07800; }

/* ---------- Stimmen: Menschen, Studio ---------- */
.stimme-wahl { display: flex; flex-direction: column; }
.stimme-zeile { gap: 10px; }
.mensch-bild { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; align-items: center;
  justify-content: center; font-size: 1.4rem; background: #f3ead9; flex: none; }
.mensch-bild img { width: 100%; height: 100%; object-fit: cover; }
.mensch-bild.gross { width: 72px; height: 72px; font-size: 2.4rem; }
.mensch-foto-reihe { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.studio-reiter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.studio-reiter button { flex: 1 1 40%; border: 2px solid var(--rand); border-radius: 14px; background: var(--papier);
  padding: 8px 6px; font: inherit; font-size: 0.9rem; color: var(--text); }
.studio-reiter button.aktiv { border-color: var(--akzent); background: var(--akzent-hell); }
.studio-balken { height: 8px; border-radius: 4px; background: var(--rand); overflow: hidden; margin-bottom: 12px; }
.studio-balken span { display: block; height: 100%; width: 0; background: var(--akzent); transition: width 0.3s; }
.studio-karte { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.studio-text { font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.studio-text.eigen::after { content: ' ✓'; color: #1b7f3a; }
.studio-mikro {
  width: 104px; height: 104px; border-radius: 50%; border: 4px solid #c7b08a; background: var(--papier);
  box-shadow: var(--schatten); font-size: 3rem; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.studio-mikro.aktiv { border-color: var(--rot); background: #fde2dc; animation: mikro-pulsieren 1s infinite; }
@keyframes mikro-pulsieren { 50% { transform: scale(1.06); } }
.studio-pegel { width: 160px; height: 8px; border-radius: 4px; background: var(--rand); overflow: hidden; }
.studio-pegel span { display: block; height: 100%; width: 0; background: var(--akzent); transition: width 0.06s linear; }
.studio-meldung { min-height: 2.6em; margin: 0; }
.studio-meldung.warnung { color: #b8470b; }
.studio-gut:not(:disabled) { border-color: var(--akzent); color: var(--akzent); font-weight: 700; }
.studio-nav { opacity: 0.85; }

/* ---------- Eigene Dinge („Hol mir …“) ---------- */
.eigene-dinge { display: flex; flex-direction: column; margin-bottom: 10px; }
.ding-zeile { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--rand); }
.ding-zeile:last-child { border-bottom: none; }
.ding-zeile img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; }
.in-echt-karte .karte-ding.eigen img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.ding-zeile .icon-btn { width: 44px; height: 44px; font-size: 1.2rem; }

/* ---------- Ziffern nachspuren (kein Petrol: nur Blau für den Start und Orange für die Pfeile) ---------- */
#ziffern, .ziffern-feld { touch-action: none; overscroll-behavior: none; }
.ziffern-feld { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0 16px 96px; position: relative; }
@media (orientation: landscape) { .ziffern-feld { flex-direction: row; justify-content: center; padding: 0 96px 16px; } }
.ziffer-tafel { position: relative; flex: 1; width: 100%; min-height: 0; max-width: 720px; }
@media (orientation: landscape) { .ziffer-tafel { height: 100%; flex: 0 1 min(62vw, 100%); } }
.ziffer-tafel canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ziffer-spur { touch-action: none; }
.ziffer-start { position: absolute; border-radius: 50%; background: #1d5fbf; color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; pointer-events: none;
  box-shadow: 0 0 0 4px #fff; }
.ziffer-start.hinweis-puls { animation: ziffer-puls 0.5s ease 3; }
@keyframes ziffer-puls { 50% { transform: scale(1.3); } }
/* Menge daneben: Platz ist immer reserviert, damit die Tafel beim Erscheinen nicht springt */
.ziffer-menge { flex: none; width: min(180px, 40vw, 24dvh); aspect-ratio: 1; justify-content: center; padding: 6px;
  visibility: hidden; opacity: 0; transition: opacity 0.4s; }
.ziffer-menge.da { visibility: visible; opacity: 1; }
.ziffer-menge svg { width: 100%; height: 100%; }
.ziffer-menge.leer { border-style: dashed; }
/* Echte Welt: die Ziffer malt sich (Linie wird nach und nach sichtbar), daneben der Finger */
.ziffer-luft { display: flex; align-items: center; justify-content: center; gap: 16px; height: 100%; width: 100%; }
.ziffer-luft .ziffer-svg { height: min(50dvh, 60vw); width: auto; }
.ziffer-luft .ziffer-finger { font-size: min(5rem, 14dvh); }
.malt .ziffer-svg path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ziffer-malen 2.4s ease-in-out forwards; }
@keyframes ziffer-malen { to { stroke-dashoffset: 0; } }
.in-echt-karte .ziffer-svg { height: min(96px, 14dvh); }

/* ---------- Welche Zahl? (Ziffernkarten; Menge erscheint nur als Hilfe) ---------- */
.mengen-karten.zwei { grid-template-columns: repeat(2, min(170px, 40vw, 26vh)); }
@media (orientation: landscape) { .mengen-karten.zwei { grid-template-columns: repeat(2, min(230px, 30vw, 50vh)); } }
.ziffer-karte { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8%; }
.ziffer-karte .ziffer-svg { width: auto; height: 100%; transition: height 0.3s; }
.ziffer-karte-menge { display: none; width: 100%; height: 40%; }
.ziffer-karte-menge svg { width: 100%; height: 100%; }
.ziffer-karte.mit-menge .ziffer-svg { height: 58%; }
.ziffer-karte.mit-menge .ziffer-karte-menge { display: block; }
.ziffer-karte .karte-punkt { fill: none; stroke: #4a3f35; stroke-width: 5; }
.ziffer-karte .karte-punkt.leuchtet { fill: #f5c518; stroke: #b07800; }
.welche-vormachen { display: flex; justify-content: center; }
.welche-haus { width: min(260px, 60vw, 40vh); height: auto; }
.kachel-ziffern { display: flex; gap: 6%; width: 78%; justify-content: center; }
.kachel-ziffern .ziffer-svg { width: 44%; height: auto; background: #fff; border: 3px solid #e3d8c6; border-radius: 12px; padding: 4px; }

/* ---------- Fächer füllen (Spindelkasten): Fächer mit Ziffern, schmale Holzstäbchen ---------- */
#faecher, .faecher-feld { touch-action: none; overscroll-behavior: none; }
.faecher-feld { flex: 1; position: relative; min-height: 0; }
.fach { position: absolute; display: flex; flex-direction: column; gap: 6px; transition: opacity 0.3s; }
.fach-ziffer { display: flex; justify-content: center; }
.fach-ziffer .ziffer-svg { height: 100%; width: auto; }
.fach-raum { flex: 1; border: 4px solid #8a5a3c; border-top-width: 0; border-radius: 0 0 14px 14px; background: #f6efe3;
  box-shadow: inset 0 6px 0 rgba(74, 63, 53, 0.08); }
.fach.dran .fach-raum { background: #fff7e6; box-shadow: 0 0 0 4px #f5c518; }
.fach.null .fach-raum { background: repeating-linear-gradient(135deg, #f6efe3 0 10px, #efe5d4 10px 20px); }
.fach.huepft { animation: huepfen 0.6s ease; }
.stab { position: absolute; left: 0; top: 0; display: flex; justify-content: center; touch-action: none; z-index: 2;
  transition: transform 0.28s ease-out; }
.stab svg { height: 100%; display: block; transition: transform 0.15s; }
.stab.greift { transition: none; z-index: 5; }
.stab.greift svg { transform: scale(1.1); }
.stab.huepft svg { animation: ding-huepfen 0.4s ease; }
.stab.leuchtet svg rect:first-child { fill: #f5c518; }
@media (prefers-reduced-motion: reduce) { .stab { transition: none; } }

/* ---------- Jedem eins: Tiere am Tisch, je ein Platz davor ---------- */
#jedem, .jedem-feld { touch-action: none; overscroll-behavior: none; }
.jedem-feld { flex: 1; position: relative; min-height: 0; }
.jedem-tisch { position: absolute; left: 12px; right: 12px; background: #e9d2b0; border: 4px solid #b98a5a; border-radius: 18px; }
.jedem-tier { position: absolute; display: flex; align-items: center; justify-content: center; line-height: 1; z-index: 1; }
.jedem-tier.huepft { animation: huepfen 0.6s ease; }
.jedem-platz { position: absolute; border: 3px dashed #b98a5a; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.jedem-platz.pulsiert { animation: warten-puls 1.6s ease-in-out 2; }
.jedem-ding { position: absolute; left: 0; top: 0; touch-action: none; z-index: 2; transition: transform 0.28s ease-out; }
.jedem-ding svg { width: 100%; height: 100%; display: block; transition: transform 0.15s; }
.jedem-ding.greift { transition: none; z-index: 5; }
.jedem-ding.greift svg { transform: scale(1.1); }
.jedem-ding.huepft svg { animation: ding-huepfen 0.4s ease; }
.jedem-ding.leuchtet svg { filter: drop-shadow(0 0 6px #f5c518); }
.kachel-jedem { display: grid; grid-template-columns: 1fr 1fr; width: 76%; font-size: 0.42em; text-align: center; line-height: 1.1; }
.kachel-jedem .k-ding svg { width: 70%; height: auto; }
@media (prefers-reduced-motion: reduce) { .jedem-ding { transition: none; } }

/* ---------- Zahlen-Hüpfen: Teich mit Steinen, Frosch ---------- */
#huepfen, .huepfen-feld { touch-action: none; overscroll-behavior: none; }
.huepfen-feld { flex: 1; position: relative; min-height: 0; }
.teich { position: absolute; inset: 8px 12px 12px; border-radius: 40px; background: #cfe6f3; }
.stein { position: absolute; border-radius: 50%; background: #a9a39a; border: 3px solid #7d766c; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
  transition: background 0.3s; }
.stein.leuchtet { background: #f5c518; border-color: #b07800; }
.stein.pulsiert { animation: warten-puls 1.6s ease-in-out 2; }
.frosch { position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; line-height: 1;
  z-index: 3; touch-action: none; transition: transform 0.3s ease-out; }
.frosch.greift { transition: none; }
.frosch.huepft { animation: ding-huepfen 0.4s ease; }
.kachel-huepfen { display: grid; justify-items: center; font-size: 0.6em; line-height: 1; }
.kachel-huepfen .k-stein { width: 1.2em; height: 0.36em; border-radius: 50%; background: #a9a39a; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .frosch { transition: none; } }

/* ---------- Zahlenweg: gerade Reihe 1–10, Käfer, Würfel (1–2), Teddy ---------- */
#weg, .weg-feld-buehne { touch-action: none; overscroll-behavior: none; }
.weg-feld-buehne { flex: 1; position: relative; min-height: 0; }
.weg-feld { position: absolute; border-radius: 10px; background: var(--papier); border: 3px solid #c7b08a; display: flex;
  align-items: center; justify-content: center; padding: 4px 2px; transition: background 0.3s; }
.weg-feld .ziffer-svg { height: 100%; width: auto; max-width: 50%; }
.weg-feld.ziel { border-color: #b07800; background: #fff3c4; }
.weg-feld.besucht { background: #f6efe3; }
.weg-feld.leuchtet { background: #f5c518; }
.kaefer { position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; line-height: 1;
  z-index: 3; touch-action: none; transition: transform 0.35s ease-out; }
.kaefer.greift { transition: none; }
.kaefer.huepft { animation: ding-huepfen 0.4s ease; }
.weg-unten { position: absolute; left: 0; right: 0; bottom: 96px; display: flex; justify-content: center; align-items: center; gap: 40px; }
@media (orientation: landscape) { .weg-unten { bottom: 16px; } }
.weg-wuerfel { width: min(120px, 26vw, 22dvh); aspect-ratio: 1; border-radius: 22px; border: 4px solid #4a3f35; background: #fff;
  padding: 0; box-shadow: var(--schatten); }
.weg-wuerfel svg { width: 100%; height: 100%; display: block; }
.weg-wuerfel .menge-punkt.weg { fill: none; stroke: #c7b08a; stroke-width: 4; }
.weg-wuerfel.dran { animation: warten-puls 1.6s ease-in-out infinite; }
.weg-wuerfel.rollt { animation: wackeln 0.6s ease; }
.weg-teddy { font-size: min(4.4rem, 12dvh); opacity: 0.55; transition: opacity 0.3s, transform 0.3s; }
.weg-teddy.dran { opacity: 1; transform: scale(1.12); }
.kachel-weg { display: grid; justify-items: center; gap: 4px; width: 80%; }
.kachel-weg .k-kaefer { font-size: 0.42em; line-height: 1; }
.kachel-weg .k-felder { display: flex; gap: 3px; width: 100%; }
.kachel-weg .k-felder span { flex: 1; border: 2px solid #c7b08a; border-radius: 6px; background: #fff; padding: 2px; }
.kachel-weg .k-felder svg { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: reduce) { .kaefer { transition: none; } .weg-wuerfel.dran { animation: none; box-shadow: 0 0 0 6px var(--akzent-hell); } }

/* ---------- Zwei Nester ---------- */
#nester, .nester-feld { touch-action: none; overscroll-behavior: none; }
.nester-feld { flex: 1; position: relative; min-height: 0; }
.nest { position: absolute; border-radius: 50%; background: radial-gradient(#8a5a3c 0 55%, #b98a5a 56%); border: 4px solid #6e4a30; }
.nest.gross { opacity: 0.9; }
.ei { position: absolute; left: 0; top: 0; touch-action: none; z-index: 2; transition: transform 0.28s ease-out; }
.ei svg { width: 100%; height: 100%; display: block; transition: transform 0.15s; }
.ei.greift { transition: none; z-index: 5; }
.ei.greift svg { transform: scale(1.1); }
.ei.huepft svg { animation: ding-huepfen 0.4s ease; }
.ei.leuchtet svg ellipse:first-child { fill: #f5c518; stroke: #b07800; }

/* ---------- Zahlentreppe ---------- */
#treppe, .treppe-feld { touch-action: none; overscroll-behavior: none; }
.treppe-feld { flex: 1; position: relative; min-height: 0; }
.stufe { position: absolute; border: 3px dashed #c7b08a; border-radius: 10px; background: rgba(255, 255, 255, 0.5); }
.stufe.pulsiert { animation: warten-puls 1.6s ease-in-out 2; }
.stange { position: absolute; left: 0; top: 0; touch-action: none; z-index: 2; transition: transform 0.28s ease-out; }
.stange svg { width: 100%; height: 100%; display: block; }
.stange.greift { transition: none; z-index: 5; }
.stange.huepft { animation: ding-huepfen 0.4s ease; }
.stange .menge-punkt.leuchtet { fill: #f5c518; stroke: #b07800; stroke-width: 2.5; }
.stange.leuchtet svg rect { fill: #f5c518; }
.treppe-kaefer { position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; line-height: 1;
  z-index: 4; transition: transform 0.35s ease-out; }
@media (prefers-reduced-motion: reduce) { .ei, .stange, .treppe-kaefer { transition: none; } }
