/* CELINA Mathe mit Bibbo (12.11.2026) – kindgerecht, ruhig, große Bedienflächen */
:root {
  --grund: #f4f8f6; --karte: #ffffff; --text: #1b2227; --leise: #5d6b70; --rand: #d5dbe0;
  --petrol: #1d5c63; --kupfer: #b86b3a; --gruen: #2e7d32; --gruen-hell: #e3f3e4; --rot: #c62828; --rot-hell: #fdecea;
  --gelb: #f9a825; --blau: #1e88e5; --schatten: 0 4px 14px rgba(29, 92, 99, .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --grund: #10191b; --karte: #18252a; --text: #eef3f4; --leise: #a9b8bc; --rand: #2c3d43; --gruen-hell: #173a1c; --rot-hell: #3d1a18; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); color: var(--text); font-family: "Nunito", "Segoe UI", system-ui, sans-serif; font-size: 18px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 16px; background: var(--karte); color: var(--text); box-shadow: var(--schatten); touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 4px solid var(--gelb); outline-offset: 2px; }
[hidden] { display: none !important; }

.kopf { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--petrol); color: #fff; }
.marke { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.kopf-rechts { display: flex; gap: 10px; align-items: center; }
.heute { font-size: .9rem; opacity: .9; }
button.klein { padding: 8px 14px; font-size: .9rem; border-radius: 12px; }
.kopf button.klein { background: rgba(255,255,255,.15); color: #fff; box-shadow: none; }

main { max-width: 860px; margin: 0 auto; padding: 16px; }
.schirm { animation: rein .25s ease; }
@keyframes rein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.buehne { display: flex; align-items: flex-end; gap: 10px; margin: 8px 0 18px; }
.bibbo { width: 150px; height: auto; flex: none; transform-origin: 50% 92%; will-change: transform; filter: drop-shadow(0 4px 6px rgba(0,0,0,.15)); }
.bibbo.gross { width: 230px; }
.klein-buehne .bibbo { width: 130px; }
.bibbo.hops { animation: hops .5s ease; }
@keyframes hops { 30% { transform: translateY(-14px) rotate(-4deg); } 60% { transform: translateY(0); } }
.blase { position: relative; background: var(--karte); border: 2px solid var(--rand); border-radius: 20px; padding: 12px 16px; box-shadow: var(--schatten); flex: 1; }
.blase::before { content: ""; position: absolute; left: -12px; bottom: 22px; border: 10px solid transparent; border-right-color: var(--rand); }
.blase p { margin: 0; font-size: 1.1rem; line-height: 1.45; }

.knoepfe { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 14px 0; }
.knoepfe.zwei button { flex: 1 1 200px; }
button.gross { padding: 16px 26px; font-size: 1.15rem; font-weight: 700; min-height: 60px; }
button.riesig { padding: 34px 20px; font-size: 1.6rem; font-weight: 800; }
button.haupt { background: var(--kupfer); color: #fff; }
button:active { transform: scale(.97); }
.fein { text-align: center; color: var(--leise); font-size: .9rem; }
.fehler { color: var(--rot); text-align: center; font-weight: 700; }
.code-gross { text-align: center; font-size: 2.6rem; font-weight: 800; letter-spacing: .12em; color: var(--petrol); background: var(--karte); border: 3px dashed var(--kupfer); border-radius: 18px; padding: 18px; font-family: ui-monospace, monospace; }
.code-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.code-form input { font: inherit; font-size: 1.8rem; letter-spacing: .1em; text-transform: uppercase; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--rand); width: 260px; text-align: center; background: var(--karte); color: var(--text); font-family: ui-monospace, monospace; }

/* Karte */
.karte { display: grid; gap: 18px; }
.bereich h3 { margin: 6px 0 8px; color: var(--petrol); font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.kachel { text-align: left; padding: 12px 14px; border: 2px solid transparent; }
.kachel b { display: block; font-size: 1rem; }
.kachel small { color: var(--leise); display: block; margin-top: 3px; font-size: .82rem; }
.kachel .sterne { margin-top: 6px; display: block; }
.kachel.gemeistert { border-color: var(--gelb); }
.klassen-kopf { margin: 4px 0 -6px; font-weight: 800; color: var(--kupfer); }
.sterne { font-size: 1.1rem; letter-spacing: 2px; }
.eltern { margin-top: 26px; background: var(--karte); border-radius: 14px; padding: 10px 16px; color: var(--leise); font-size: .92rem; }
.eltern summary { cursor: pointer; font-weight: 700; color: var(--text); }
.eltern select { font: inherit; padding: 4px 8px; border-radius: 8px; }

/* Üben */
.leiste { display: flex; justify-content: space-between; align-items: center; color: var(--leise); font-weight: 700; margin-bottom: 4px; gap: 10px; }
.karte-aufgabe { position: relative; background: var(--karte); border-radius: 24px; padding: 66px 18px 18px; box-shadow: var(--schatten); text-align: center; }
.bild svg { max-width: 100%; max-height: 240px; height: auto; }
.bild svg.gross { max-height: 360px; width: 360px; }   /* Koordinatensystem: Zahlen müssen lesbar bleiben */
.bild:empty { display: none; }
.frage { font-size: 2rem; font-weight: 800; margin: 10px 4px 12px; line-height: 1.3; }
.frage.lang { font-size: 1.3rem; font-weight: 700; text-align: left; margin-left: 4px; }
.vorlesen { position: absolute; top: 10px; right: 12px; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; padding: 0; }
.eingabe { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 6px 0 10px; }
.antwort { min-width: 160px; min-height: 66px; display: inline-flex; align-items: center; justify-content: center; font-size: 2.3rem; font-weight: 800; border: 3px solid var(--rand); border-radius: 16px; padding: 4px 16px; background: var(--grund); }
.einheit { font-size: 1.5rem; font-weight: 700; color: var(--leise); }
.ziffern { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 360px; margin: 0 auto; }
.ziffern button { font-size: 1.8rem; font-weight: 800; padding: 12px 0; min-height: 62px; }
.ziffern .loeschen { background: var(--rot-hell); }
.wahl { display: flex; justify-content: center; gap: 14px; margin: 8px 0 14px; }
.wahl button { font-size: 2.6rem; font-weight: 800; width: 96px; height: 96px; }
.wahl button.gewaehlt { background: var(--petrol); color: #fff; }
.wahl.mittel { flex-wrap: wrap; }
.wahl.mittel button { font-size: 1.5rem; font-weight: 700; width: auto; min-width: 96px; height: auto; min-height: 72px; padding: 12px 22px; }
.wahl.lang { flex-direction: column; align-items: stretch; max-width: 560px; margin-left: auto; margin-right: auto; gap: 10px; }
.wahl.lang button { font-size: 1.15rem; font-weight: 600; width: 100%; height: auto; min-height: 56px; padding: 12px 18px; line-height: 1.35; text-align: left; }

.karte-aufgabe.richtig .antwort { border-color: var(--gruen); background: var(--gruen-hell); }
.karte-aufgabe.falsch .antwort { border-color: var(--rot); background: var(--rot-hell); }
.rueckmeldung { margin-top: 8px; text-align: left; }
.hinweis { font-weight: 700; font-size: 1.1rem; }
.schritte { background: var(--grund); border-radius: 14px; padding: 12px 12px 12px 36px; font-size: 1.1rem; line-height: 1.6; }
.schritte:empty { display: none; }
.anders { background: #fff7e8; color: #3d2a12; border-radius: 14px; padding: 12px 16px; font-size: 1.1rem; line-height: 1.5; border-left: 5px solid var(--kupfer); }
.konfetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.konfetti i { position: absolute; width: 10px; height: 14px; top: -20px; animation: fall 1.6s linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }

.fuss { text-align: center; color: var(--leise); font-size: .8rem; padding: 24px 16px; }
@media (max-width: 560px) {
  .heute { display: none; } .marke { font-size: 1rem; }
  html, body { font-size: 16px; }
  .bibbo.gross { width: 160px; } .bibbo { width: 110px; } .klein-buehne .bibbo { width: 96px; }
  .frage { font-size: 1.6rem; margin: 8px 4px 10px; }
  .code-gross { font-size: 1.9rem; }
  button.riesig { padding: 24px 10px; font-size: 1.3rem; }
  .ziffern button { min-height: 56px; }
}

.vorlesen.laedt { animation: puls 1s ease-in-out infinite; }
@keyframes puls { 50% { transform: scale(1.12); opacity: .6; } }
.bericht-link { display: inline-block; font-weight: 700; color: var(--kupfer); }

.bibbo.spricht + .blase { border-color: var(--kupfer); }

/* Üben: Bibbo groß links, Aufgabe rechts */
main { max-width: 1140px; }
#s-ueben .aufgabe-feld { display: grid; grid-template-columns: minmax(230px, 330px) 1fr; gap: 22px; align-items: start; }
#s-ueben .buehne { flex-direction: column-reverse; align-items: center; position: sticky; top: 12px; margin: 0; gap: 18px; }
#s-ueben .buehne .bibbo { width: 100%; max-width: 310px; }
#s-ueben .blase { width: 100%; text-align: center; min-height: 64px; display: flex; align-items: center; justify-content: center; }
#s-ueben .blase::before { left: 50%; bottom: -20px; transform: translateX(-50%); border-right-color: transparent; border-top-color: var(--rand); }
#s-ueben .blase p { font-size: 1.25rem; font-weight: 700; }
.blase:has(+ .bibbo.spricht), .bibbo.spricht + .blase { border-color: var(--kupfer); }
@media (max-width: 760px) {
  #s-ueben .aufgabe-feld { grid-template-columns: 1fr; gap: 10px; }
  #s-ueben .buehne { flex-direction: row; position: static; align-items: flex-end; gap: 10px; }
  #s-ueben .buehne .bibbo { width: 120px; }
  #s-ueben .blase { text-align: left; justify-content: flex-start; }
  #s-ueben .blase::before { left: -12px; bottom: 22px; transform: none; border-top-color: transparent; border-right-color: var(--rand); }
  #s-ueben .blase p { font-size: 1.05rem; }
}

/* ALEX + Bibbo als Duo */
.figuren { position: relative; display: flex; align-items: flex-end; flex: none; width: 260px; }
.figuren .alex { position: relative; width: 66%; transform-origin: 50% 90%; will-change: transform; filter: drop-shadow(0 6px 8px rgba(0,0,0,.18)); }
.figuren .alex img { width: 100%; display: block; }
.figuren .alex svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.figuren .bibbo, .figuren .bibbo.gross { width: 46%; margin-left: -12%; position: relative; z-index: 1; }
.buehne > .figuren + .blase { flex: 1; }
.figuren:has(.gross) { width: 360px; }
.blase .sprecher { display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.blase.wer-alex .sprecher { color: var(--petrol); } .blase.wer-bibbo .sprecher { color: var(--kupfer); }
.blase.aktiv.wer-alex { border-color: #26a69a; } .blase.aktiv.wer-bibbo { border-color: var(--kupfer); }
#s-ueben .buehne .figuren { width: 100%; max-width: 330px; }
#s-ueben .buehne .bibbo { width: 46%; max-width: none; }
#s-ueben .blase { flex-direction: column; }
.klein-buehne .figuren { width: 200px; }
@media (max-width: 760px) {
  .figuren, .figuren:has(.gross) { width: 190px; }
  #s-ueben .buehne .figuren { width: 170px; }
  .klein-buehne .figuren { width: 150px; }
}

/* Gemeinsam lösen */
.foerder { background: #e8f5f3; border-left: 5px solid var(--petrol); border-radius: 12px; padding: 10px 14px; text-align: left; font-weight: 700; margin: 0 0 8px; }
.gemeinsam { background: var(--grund); border-radius: 18px; padding: 12px 14px; margin: 6px 0 12px; text-align: left; }
.gemeinsam-kopf { margin: 0 0 6px; font-weight: 800; color: var(--petrol); }
.frage.klein { font-size: 1.3rem; color: var(--leise); }
.strahl svg { width: 100%; height: auto; max-height: 170px; display: block; }
.teilschritte { margin: 6px 0; padding-left: 26px; font-size: 1.15rem; line-height: 1.7; }
.teilschritte li.verraten { color: var(--leise); }
.teilfrage { font-size: 1.9rem; font-weight: 800; text-align: center; margin: 8px 0 4px; color: var(--text); }
.gespraech-box { margin-top: 14px; text-align: left; color: var(--leise); font-size: .95rem; }
.gespraech-box summary { cursor: pointer; font-weight: 700; }
.gespraech { padding-left: 20px; line-height: 1.55; }
.gespraech b.alex { color: var(--petrol); } .gespraech b.bibbo { color: var(--kupfer); }
.bibbo.huepf { animation: huepf .38s ease-out; }
@keyframes huepf { 40% { transform: translateY(-26px) rotate(-6deg); } 100% { transform: translateY(0); } }
@media (max-width: 560px) { .teilfrage { font-size: 1.5rem; } }

/* ---------- Hilfesprachen, Gegenprobe, Wörterkarten (12.11.2026) ---------- */
.mehrsprachig { display: grid; gap: 4px; text-align: center; color: var(--leise, #5d6b70); margin: 4px 0 12px; }
.knoepfe.sprachen .riesig { font-size: 1.25rem; }
.vorlese-leiste { position: absolute; top: 10px; right: 12px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.vorlese-leiste .vorlesen { position: static; }
.fremd-knopf { border: 2px solid #26a69a; background: #e8f6f4; color: #0d5c55; border-radius: 999px; padding: 8px 14px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.fremd-knopf.laedt { opacity: .6; }
.fremd-knopf.winkt { animation: winken 0.9s ease-in-out 5; }
@keyframes winken { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(38,166,154,.25); } }
.fremd { background: #e8f6f4; border-left: 5px solid #26a69a; border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: 1.15rem; }
.fremd p { margin: 4px 0; } .fremd p.fehlt { color: #5d6b70; font-style: italic; } .fremd small { color: #5d6b70; }
.geschichte { background: #fff7ef; border: 1px dashed #b86b3a; border-radius: 10px; padding: 8px 12px; font-size: .98rem; color: #5d4030; }
.w-reiter { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 10px; }
.w-reiter button { border: 2px solid #d5dbe0; background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 1rem; cursor: pointer; }
.w-reiter button.aktiv { border-color: #1d5c63; background: #1d5c63; color: #fff; }
.w-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wkarte { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid #d5dbe0; border-radius: 16px; background: #fff; padding: 12px 8px; cursor: pointer; font-size: 1rem; }
.wkarte:hover { border-color: #26a69a; } .wkarte .wbild { font-size: 2.6rem; line-height: 1.1; min-height: 3rem; white-space: nowrap; }
.wkarte .wbild.lang { font-size: 1.7rem; }
.wkarte b { font-size: 1.08rem; } .wkarte small { color: #0d5c55; font-size: .98rem; }
.w-quiz { text-align: center; } .w-frage { font-size: 1.3rem; font-weight: 700; }
.w-wahl { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.wkarte.gross-bild { font-size: 3.6rem; width: 130px; height: 130px; justify-content: center; }
.wkarte.richtig { border-color: #2e7d32; background: #e8f5e9; } .wkarte.falsch { border-color: #c62828; background: #ffebee; }
@media (max-width: 520px) { .w-karten { grid-template-columns: repeat(2, 1fr); } .wkarte.gross-bild { width: 96px; height: 96px; font-size: 2.8rem; } }

/* Hilfen (12.11.2026): große Schrift, starker Kontrast, ruhiger Modus */
body.h-schrift { font-size: 23px; }
body.h-schrift .frage { font-size: 2.3rem; }
body.h-kontrast { --grund: #ffffff; --karte: #ffffff; --text: #000000; --leise: #1b1b1b; --rand: #000000; }
body.h-kontrast .karte-aufgabe, body.h-kontrast .blase { border: 3px solid #000; }
body.h-kontrast button { border: 2px solid #000; }
body.h-ruhig *, body.h-ruhig *::before, body.h-ruhig *::after { animation: none !important; transition: none !important; }
.schulformen button { min-height: 3.2rem; }
.bundesland-zeile, .hilfen-wahl label { display: block; margin: .5rem 0; }
.hilfen-wahl { border: 1px solid var(--rand); border-radius: 10px; padding: .6rem .9rem; margin: .8rem 0; }
.kachel .zusatz { display: inline-block; font-size: .75rem; background: #fff3cd; color: #6b4e00; border-radius: 6px; padding: 0 .35rem; margin-left: .3rem; }

/* Fach-Umschaltung (12.11.2026) */
.faecher{display:flex;gap:.5rem;justify-content:center;margin:.6rem 0 .2rem;flex-wrap:wrap}
.faecher .fach{font:inherit;font-weight:700;padding:.55rem 1.1rem;border-radius:999px;border:2px solid #1d5c63;background:#fff;color:#1d5c63;cursor:pointer}
.faecher .fach.an{background:#1d5c63;color:#fff}

/* lange Themennamen (Reaktionsgleichungen) sauber trennen */
.kachel b{hyphens:auto;-webkit-hyphens:auto;overflow-wrap:break-word}
