/* ===== Tokens ===== */
/* Die Farben sind bewusst satter als früher: Die App konkurriert auf demselben Handy mit
   Duolingo, und ein blasses Lila verliert diesen Vergleich. Die drei Namensfarben bleiben –
   Purpura, Laurus, Aurum –, dazu kommt Flamma für die Serie. */
:root {
  --bg: #F3F0FF;
  --surface: #FFFFFF;
  --ink: #2A2B4A;
  --muted: #6F7096;
  --line: #E4E1F4;
  --soft: #F1EEFB;

  --purple: #8B4DE0;      /* Purpura – Hauptfarbe */
  --purple-deep: #6A34B8;
  --purple-tint: #F0E6FF;
  --purple-edge: #D9C6F5;
  --green: #43C463;       /* Laurus – richtig */
  --green-deep: #2E9E4B;
  --green-tint: #E2F8E8;
  --green-edge: #B9E9C6;
  --gold: #FFC72C;        /* Aurum – Sterne */
  --gold-deep: #E0A400;
  --gold-tint: #FFF3CC;
  --gold-edge: #F7DE8C;
  --red: #FF5D62;
  --red-deep: #D9434B;
  --red-tint: #FFE7E8;
  --sky: #1FB0F5;
  --sky-deep: #1590CC;
  --sky-tint: #E1F4FE;
  --orange: #FF8E1F;      /* Flamma – Serie */
  --orange-deep: #D9741A;
  --pink: #FF7AB6;
  --pink-deep: #C93E7E;
  --pink-tint: #FFE6F1;
  --sky-edge: #B5E3FB;

  --r-sm: 12px; --r-md: 18px; --r-lg: 24px;
  --shadow: 0 8px 24px rgba(74, 52, 130, 0.10);
  --spring: cubic-bezier(.2, 1.6, .4, 1);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.45; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
/* Farbige Lichtflecken hinter allem. Als festes Element statt background-attachment: fixed,
   weil iOS Letzteres ignoriert und der Verlauf dann mitscrollt. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 38% at 0% 0%, rgba(139, 77, 224, .16), transparent 70%),
    radial-gradient(45% 32% at 100% 12%, rgba(31, 176, 245, .13), transparent 70%),
    radial-gradient(45% 30% at 50% 100%, rgba(255, 199, 44, .16), transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 900; }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 800; }
p { margin: 0; }
a { color: var(--purple); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Layout ===== */
/* overflow-x: clip statt hidden – hidden würde einen Scroll-Container erzeugen und die
   klebende Kind-Auswahl (.childbar, position: sticky) außer Kraft setzen. Das ist das Netz
   für den Fall, dass ein einzelner Inhalt doch einmal zu breit gerät: gescrollt wird
   seitwärts nie, denn ein weggewischter Bildschirm verwirrt beim Abhaken. */
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }
main { flex: 1; padding: 20px 18px calc(84px + env(safe-area-inset-bottom)); }
main.no-tabs { padding-bottom: 32px; }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

/* ===== Gemeinsame Animationen ===== */
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes popin { from { opacity: 0; transform: scale(.5) translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes flame { from { transform: scale(1) rotate(-5deg); } to { transform: scale(1.18) rotate(5deg); } }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.8) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Tab bar ===== */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, .94); border-top: 2px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
#tabs .inner { max-width: 520px; margin: 0 auto; display: flex; }
#tabs button {
  flex: 1; background: none; border: 0; padding: 10px 4px 8px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800;
  border-radius: 0; position: relative;
}
/* Der aktive Tab bekommt eine Pille hinter dem Symbol und hüpft einmal. Die Symbole sind
   Emoji und nehmen keine Textfarbe an – ein bloßer Farbwechsel der Beschriftung bliebe
   fast unsichtbar. */
#tabs button .ico {
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 56px; max-width: 100%; height: 32px; border-radius: 999px;
  transition: background-color .15s ease, transform .15s ease;
}
#tabs button.active { color: var(--purple-deep); font-weight: 900; }
#tabs button.active .ico { background: var(--purple-tint); transform: scale(1.08); animation: tabpop .4s var(--spring); }
#tabs button:active .ico { transform: scale(0.92); }
@keyframes tabpop { 0% { transform: scale(.8); } 60% { transform: scale(1.22); } 100% { transform: scale(1.08); } }
.dot { position: absolute; top: 6px; right: calc(50% - 22px); width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); animation: pop .4s var(--spring); }

/* ===== Cards & surfaces ===== */
/* Karten haben einen Rand und eine feste Unterkante statt eines weichen Schattens – dieselbe
   „klobige“ Sprache wie die Knöpfe, damit alles aus einem Guss wirkt. */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.card.flat { box-shadow: none; }
.card.tint-purple { background: var(--purple-tint); border-color: var(--purple-edge); box-shadow: 0 4px 0 var(--purple-edge); }
.card.tint-gold { background: var(--gold-tint); border-color: var(--gold-edge); box-shadow: 0 4px 0 var(--gold-edge); }
.card.tint-green { background: var(--green-tint); border-color: var(--green-edge); box-shadow: 0 4px 0 var(--green-edge); }
.card.flat.tint-purple, .card.flat.tint-gold, .card.flat.tint-green { box-shadow: none; }

/* ===== Chunky buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-md); padding: 15px 22px; font-weight: 900; font-size: 17px;
  background: var(--purple); color: #fff; box-shadow: 0 5px 0 var(--purple-deep);
  transition: transform .06s ease, box-shadow .06s ease, filter .3s ease; user-select: none; -webkit-tap-highlight-color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--purple-deep); }
.btn.green { background: var(--green); box-shadow: 0 5px 0 var(--green-deep); }
.btn.green:active { box-shadow: 0 1px 0 var(--green-deep); }
.btn.gold { background: var(--gold); color: #5A3E00; text-shadow: none; box-shadow: 0 5px 0 var(--gold-deep); }
.btn.gold:active { box-shadow: 0 1px 0 var(--gold-deep); }
.btn.red { background: var(--red); box-shadow: 0 5px 0 var(--red-deep); }
.btn.red:active { box-shadow: 0 1px 0 var(--red-deep); }
.btn.sky { background: var(--sky); box-shadow: 0 5px 0 var(--sky-deep); }
.btn.sky:active { box-shadow: 0 1px 0 var(--sky-deep); }
.btn.ghost { background: var(--surface); color: var(--ink); text-shadow: none; box-shadow: 0 5px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.block { width: 100%; }
.btn.big { padding: 19px 24px; font-size: 20px; border-radius: var(--r-lg); }
.btn.sm { padding: 8px 14px; font-size: 14px; border-radius: var(--r-sm); }
.btn.sm { box-shadow: 0 3px 0 var(--purple-deep); }
.btn.sm.green { box-shadow: 0 3px 0 var(--green-deep); }
.btn.sm.gold { box-shadow: 0 3px 0 var(--gold-deep); }
.btn.sm.red { box-shadow: 0 3px 0 var(--red-deep); }
.btn.sm.ghost { box-shadow: 0 3px 0 var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; animation: none; filter: none; }
/* Auswahl der Buchlektionen zum gezielten Üben; der Schwerpunkt der Eltern ist golden */
.unit-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-picks small { opacity: .55; font-weight: 800; }
.unit-picks .btn.is-focus { background: var(--gold-tint); border-color: var(--gold); box-shadow: 0 3px 0 var(--gold-deep); }
/* Eine Karte, die zu einer anderen Seite führt („Dein Wortschatz“): sie gibt beim Tippen nach. */
.card.tap { cursor: pointer; transition: transform .1s, box-shadow .1s; }
.card.tap:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.say-btn.soft { flex: none; margin: 0; background: var(--purple-tint); color: var(--purple-deep); }

/* ===== Vokabelkarte (vocabCard() in core.js) ===== */
/* Lektion oben links, Wortart oben rechts, darunter die Formen in festen Feldern: drei gleich
   breite Spalten bei jeder Wortart, damit Präsens, Genitiv und feminin immer an derselben Stelle
   stehen, auch wenn ein Nomen nur zwei Felder hat. */
.vcards { display: flex; flex-direction: column; gap: 14px; }
.vcard { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 4px 0 var(--line); padding: 14px 16px; min-width: 0; }
.vc-unit, .vc-kind { position: absolute; top: -2px; height: 30px; display: grid; place-items: center; font-weight: 900; border: 2px solid; }
.vc-unit { left: -2px; min-width: 34px; max-width: 45%; padding: 0 8px; border-radius: var(--r-lg) 0 14px 0; background: var(--soft); color: var(--muted); border-color: var(--line); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vc-kind { right: -2px; padding: 0 12px; border-radius: 0 var(--r-lg) 0 14px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.k-verb  { background: var(--purple-tint); color: var(--purple-deep); border-color: var(--purple-edge); }
.k-noun  { background: var(--sky-tint); color: var(--sky-deep); border-color: var(--sky-edge); }
.k-adj   { background: var(--green-tint); color: var(--green-deep); border-color: var(--green-edge); }
.k-other { background: var(--gold-tint); color: #7A5600; border-color: var(--gold-edge); }
.vc-head { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.vc-la { font-size: 24px; font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }
.vc-de { font-weight: 800; font-size: 16px; margin-top: 2px; overflow-wrap: anywhere; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.slot { background: var(--soft); border-radius: 12px; padding: 6px 8px 7px; min-width: 0; }
.slot small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.slot b { display: block; font-size: 15px; font-weight: 900; overflow-wrap: anywhere; }
.slot.long b { font-size: 13px; letter-spacing: -.01em; }
.slot.empty { background: none; border: 2px dashed var(--line); }
.slot.empty b { color: #B9B7D3; font-weight: 800; }
/* Durchsicht: Formen, die ein Nachtrag dem Wort hinzufügt */
.slot.added { background: var(--green-tint); box-shadow: inset 0 0 0 2px var(--green-edge); }
.slot.added small::after { content: " · neu"; color: var(--green-deep); }
/* Vorschlag des Kindes auf „Heute“: was es auf der Karte geändert hat */
.vc-la.changed, .vc-de.changed { display: inline-block; background: var(--green-tint); box-shadow: inset 0 0 0 2px var(--green-edge); border-radius: 8px; padding: 0 6px; }
.vc-unit.changed { background: var(--green-tint); color: var(--green-deep); border-color: var(--green-edge); }
.vcard.proposal .slot.added small::after { content: " · geändert"; }
.report-label { margin: 0 2px -4px; font-size: 12px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.slot.genus.m { background: var(--sky-tint); } .slot.genus.m b { color: var(--sky-deep); }
.slot.genus.f { background: var(--pink-tint); } .slot.genus.f b { color: var(--pink-deep); }
.slot.genus.n { background: var(--gold-tint); } .slot.genus.n b { color: var(--gold-deep); }
.vc-extra { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; font-weight: 700; color: var(--muted); }
.vc-extra .vc-rest { color: var(--ink); }
.vc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; min-height: 28px; }
.vc-stat { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.vc-edit { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 0; background: var(--soft); color: var(--muted); font-size: 15px; display: grid; place-items: center; margin-left: auto; }
.vc-edit:hover { background: var(--line); color: var(--ink); }
/* Fehler gemeldet (Kind): statt des Fähnchens, bis die Eltern geantwortet haben. */
.vc-reported { margin-left: auto; font-size: 12px; font-weight: 900; color: var(--purple-deep); background: var(--purple-tint); border-radius: 8px; padding: 4px 8px; }
.vc-foot .vc-edit + .vc-edit { margin-left: 0; }
/* Eine Fehlermeldung auf „Heute“: Befund, Karte, Entscheidung – getrennt von der nächsten. */
.report + .report { border-top: 2px solid var(--line); padding-top: 12px; }
.report > p { margin: 0; }
.vc-group { margin: 6px 2px -4px; }
/* Durchsicht: was aus der Karte wird – neu, Ergänzung, schon da, Wiederholung, abgewählt */
.vc-status { margin: 10px -16px -14px; padding: 8px 12px 8px 16px; border-top: 2px solid var(--line); border-radius: 0 0 22px 22px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.vc-status .grow { min-width: 0; }
.vc-status .vc-edit { margin: 0; width: 28px; height: 28px; background: rgba(255, 255, 255, .75); color: inherit; }
.vc-status .vc-back { border: 0; background: rgba(255, 255, 255, .75); border-radius: 8px; padding: 4px 9px; font-weight: 900; font-size: 12px; color: inherit; }
.st-new { background: var(--green-tint); color: var(--green-deep); border-color: var(--green-edge); }
.st-extend { background: var(--sky-tint); color: var(--sky-deep); border-color: var(--sky-edge); }
.st-quiet { background: var(--soft); color: var(--muted); }
.st-out { background: var(--red-tint); color: var(--red-deep); }
/* Durchsicht: Hinweis des Wörterbuchs über der Statusleiste, mit Knopf zum Übernehmen */
.vc-lex { margin: 10px -16px 0; padding: 7px 12px 7px 16px; border-top: 2px solid var(--gold-edge); background: var(--gold-tint); color: #5A3E00; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.vc-lex .grow { min-width: 0; }
.vc-lex + .vc-lex { margin-top: 0; border-top-width: 1px; }
.vc-lex + .vc-status { margin-top: 0; }
.vc-lex .vc-back { border: 0; background: rgba(255, 255, 255, .8); border-radius: 8px; padding: 4px 9px; font-weight: 900; font-size: 12px; color: inherit; white-space: nowrap; }
.vcard.quiet { opacity: .62; box-shadow: none; }
.vcard.out { opacity: .6; }
.vcard.out .vc-la { text-decoration: line-through; }
details.vc-quiet summary { cursor: pointer; font-weight: 800; color: var(--muted); font-size: 15px; padding: 4px 2px; }
details.vc-quiet[open] summary { margin-bottom: 10px; }
/* Bearbeiten: dieselbe Karte, Felder statt Text; die Felder folgen der Wortart */
.vcard.editing { border-color: var(--purple); box-shadow: 0 4px 0 var(--purple-edge); }
.vc-form { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.vc-form label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vc-form label > span { font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.vc-form .input { padding: 9px 11px; font-size: 16px; }
.vc-grid { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vc-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vc-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.vc-pick button { flex: 1 1 auto; border: 2px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 8px; font-weight: 900; font-size: 13px; color: var(--muted); }
.vc-pick button.on { background: var(--purple-tint); border-color: var(--purple); color: var(--purple-deep); }
.vc-pick button.on.m { background: var(--sky-tint); border-color: var(--sky); color: var(--sky-deep); }
.vc-pick button.on.f { background: var(--pink-tint); border-color: var(--pink); color: var(--pink-deep); }
.vc-pick button.on.n { background: var(--gold-tint); border-color: var(--gold); color: #7A5600; }
.vc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vc-actions .vc-del { margin-left: auto; border: 0; background: var(--red-tint); color: var(--red-deep); border-radius: 10px; padding: 8px 12px; font-weight: 900; font-size: 13px; }
.voice-pick .choice { font-size: 17px; padding: 10px 14px; }
.voice-pick .choice .small { display: block; font-weight: 700; }
.vocab-pips { flex: none; display: flex; align-items: center; gap: 3px; }
.vocab-pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.vocab-pips i.on { background: var(--green); }
.vocab-pips b { color: var(--green-deep); margin-left: 2px; font-size: 14px; }
.vocab-new { flex: none; font-size: 12px; font-weight: 900; color: var(--purple-deep); background: var(--purple-tint); border-radius: 999px; padding: 2px 8px; }
.btn.link { background: none; box-shadow: none; color: var(--purple); padding: 6px 8px; font-weight: 800; text-shadow: none; }
/* Pulsierender Schein für den einen Knopf, der jetzt dran ist */
.btn.glow { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(67, 196, 99, 0)); } 50% { filter: drop-shadow(0 0 14px rgba(67, 196, 99, .75)); } }
.iconbtn { background: var(--surface); border: 2px solid var(--line); padding: 6px; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--muted); display: grid; place-items: center; }
.iconbtn:hover { background: var(--soft); }

/* ===== Forms ===== */
label.field { display: block; }
label.field > span { display: block; font-size: 14px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.input {
  width: 100%; border: 2px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface);
  font-size: 17px;
}
.input:focus { border-color: var(--purple); outline: none; box-shadow: 0 0 0 4px rgba(139, 77, 224, .15); }
.input.sm { padding: 8px 10px; font-size: 15px; border-radius: var(--r-sm); }
textarea.input { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { color: var(--red-deep); font-weight: 800; }
.help { font-size: 14px; color: var(--muted); }

/* ===== PIN pad ===== */
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 12px 0 18px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--purple); transition: background .15s, transform .15s; }
.pin-dots span.on { background: var(--purple); transform: scale(1.15); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { padding: 16px; font-size: 22px; font-weight: 900; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); }
.pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); background: var(--purple-tint); }
/* Das Kinder-Pad: Ziffern so groß, dass ein Daumen sie ohne Hinsehen trifft. */
.pad.big button { padding: 22px 16px; font-size: 30px; }

/* ===== Gesichterliste ===== */
.faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.face { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 12px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 5px 0 var(--line); animation: popin .5s var(--spring) both; }
.face:nth-child(2) { animation-delay: .08s; } .face:nth-child(3) { animation-delay: .16s; } .face:nth-child(4) { animation-delay: .24s; }
.face:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.face .ico { font-size: 48px; line-height: 1; }
.face b { font-size: 19px; }
/* Jedes Kind in seiner Farbe – so findet es sein Gesicht, ohne zu lesen. */
.face.c-purple { background: var(--purple-tint); border-color: var(--purple-edge); box-shadow: 0 5px 0 var(--purple-edge); }
.face.c-sky { background: var(--sky-tint); border-color: #B9E2FA; box-shadow: 0 5px 0 #B9E2FA; }
.face.c-green { background: var(--green-tint); border-color: var(--green-edge); box-shadow: 0 5px 0 var(--green-edge); }
.face.c-gold { background: var(--gold-tint); border-color: var(--gold-edge); box-shadow: 0 5px 0 var(--gold-edge); }

/* ===== Role chooser ===== */
.role { display: flex; align-items: center; gap: 16px; padding: 18px; width: 100%; text-align: left;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 5px 0 var(--line); }
.role:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.role .ico { font-size: 34px; }
.role b { font-size: 19px; display: block; }

/* ===== Kind-Ansicht: ruhiges Aussehen ===== */
/* Die Kind-Ansicht ist ruhiger als die der Eltern: warmes Papierweiß statt Lichtflecken, Karten
   ohne Rand, flache Knöpfe, ein tieferes Violett. Anthony hat sich am 31.10.2026 für diese
   Richtung entschieden („Ein Schritt – ruhig“ auf der Leinwand der Gestaltung); für ein Kind mit
   ADHS soll weniger auf dem Bildschirm um Aufmerksamkeit ringen. Die Klasse setzt kidLook() in
   app.js. Gewechselt werden vor allem die Farben – Komponenten bleiben dieselben. */
body.kid {
  --bg: #F6F4EF;
  --ink: #1F2430;
  --muted: #6B6F7E;
  --line: #E6E2D8;
  --soft: #EFECE5;
  --purple: #5B3CC4;
  --purple-deep: #45299E;
  --purple-tint: #EEE9FB;
  --purple-edge: #D9D0F5;
  --shadow: 0 6px 18px rgba(31, 36, 48, .06);
}
body.kid::before { display: none; }
body.kid .card { border: 0; box-shadow: var(--shadow); }
body.kid .card.flat { box-shadow: none; }
/* Doppelte Klasse, damit die Regel auch die Farbvarianten (.btn.green:active …) schlägt. */
body.kid .btn.btn { box-shadow: none; border-radius: 20px; }
body.kid .btn:active { transform: scale(.97); }
body.kid .bubble { border: 0; box-shadow: var(--shadow); }
/* Was sonst eine feste Unterkante trägt, bekommt den weichen Schatten der Karten. */
body.kid :is(.check, .choice, .vcard, .call-invite, .call-round) { box-shadow: var(--shadow); }
body.kid .check { border-color: transparent; }
body.kid .segmented { border: 0; background: var(--soft); }
body.kid .segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
body.kid #tabs { background: rgba(246, 244, 239, .94); border-top: 1px solid var(--line); }
body.kid #tabs button.active { color: var(--ink); }
body.kid #tabs button.active .ico { background: var(--surface); color: var(--purple); box-shadow: var(--shadow); animation: none; transform: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 32px; }
.date { font-weight: 800; }
.chips { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 900; line-height: 1; }
.chip .ico { font-size: 20px; line-height: 1; display: inline-block; }
.chip b { font-size: 19px; }
.chip small { font-size: 12px; color: var(--muted); font-weight: 800; }
.chip.hot .ico { animation: flame 1.1s ease-in-out infinite alternate; filter: drop-shadow(0 0 6px rgba(255, 199, 44, .9)); }

/* „Heute“: alles, was ansteht, als gleich große Kacheln – keine ist hervorgehoben. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 136px; padding: 16px;
  text-align: left; color: var(--ink); background: var(--surface); border: 0; border-radius: var(--r-lg);
  box-shadow: var(--shadow); transition: transform .06s ease; -webkit-tap-highlight-color: transparent; }
.tile:active { transform: scale(.97); }
.tile-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--purple-tint); display: flex;
  align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
.tile.done .tile-ico { background: var(--green-tint); }
.tile b { font-size: 19px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.tile small { color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.3; }
.tile .progress { width: 100%; margin-top: auto; }
.goal-row .ico { font-size: 24px; line-height: 1; }
.goal-row .progress { margin-top: 6px; }

/* „Lernen“: je Fach eine Karte; die Teile darin trennt eine feine Linie. */
.subject > * + * { margin-top: 16px; }
.subject-head { display: flex; align-items: center; gap: 14px; }
.subject-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--purple-tint); display: flex;
  align-items: center; justify-content: center; font-size: 28px; line-height: 1; flex: none; }
.subject-note { font-weight: 700; }
.subject-part { border-top: 1px solid var(--line); padding-top: 16px; }
.subject-part.tap { cursor: pointer; }
.tile .progress, .goal-row .progress { height: 8px; }
.tile .progress > i::after, .goal-row .progress > i::after { display: none; }

/* ===== Mascot & speech ===== */
.hero { display: flex; align-items: flex-end; gap: 12px; }
.hero svg { width: 126px; height: 126px; flex: none; }
.hero.small svg { width: 76px; height: 76px; }
.bubble { position: relative; background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font-weight: 800; flex: 1;
  animation: bubblein .45s var(--spring) both; transform-origin: left bottom; }
.bubble::after { content: ""; position: absolute; left: -11px; bottom: 18px; border: 10px solid transparent; border-right-color: var(--surface); border-left: 0; }
@keyframes bubblein { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
/* Felix lebt: Atmen im Stand, Blinzeln alle paar Sekunden, Hüpfen zur Feier. Die Augen sind
   im SVG als Gruppe markiert, damit sie sich unabhängig vom Kopf bewegen können. */
.mascot { transform-origin: 50% 100%; }
.mascot.idle { animation: breathe 3.4s ease-in-out infinite; }
.mascot.bounce { animation: bounce .9s ease infinite alternate; }
.mascot.jump { animation: jump 1.3s var(--spring) infinite; }
.mascot .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.03) translateY(-2px); } }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-7px); } }
@keyframes jump { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-20px) rotate(-5deg); } 55% { transform: translateY(0) rotate(0); } 72% { transform: translateY(-9px) rotate(4deg); } 88% { transform: translateY(0); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
/* Wackeln beim Klingeln und der sprechende Mund im Anruf. Der Mund ist im SVG eine eigene
   Gruppe; fill-box lässt ihn um seine eigene Mitte aufgehen statt um die des ganzen Bildes. */
.mascot.wobble { animation: wobble 1.2s ease-in-out infinite; }
.mascot .mouth { transform-box: fill-box; transform-origin: center; }
.mascot.talking .mouth { animation: talk .2s ease-in-out infinite alternate; }
@keyframes wobble { 0%, 60%, 100% { transform: rotate(0); } 12% { transform: rotate(-7deg); } 27% { transform: rotate(6deg); } 42% { transform: rotate(-4deg); } }
@keyframes talk { from { transform: scaleY(.6); } to { transform: scaleY(1.9) scaleX(.9); } }

/* ===== Goal ring ===== */
.ring { position: relative; width: 88px; height: 88px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 16px; text-align: center; line-height: 1.1; }
.ring .lbl small { font-size: 11px; color: var(--muted); }
.ring.hit { filter: drop-shadow(0 0 10px rgba(67, 196, 99, .55)); }

/* ===== Checklists ===== */
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px; }
.list-head h2 { display: flex; align-items: center; gap: 10px; }
.progress { height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #7ADB8E); border-radius: 999px; transition: width .5s var(--spring); position: relative; }
.progress > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .5); }
.progress.purple > i { background: linear-gradient(90deg, var(--purple), #B98CF0); }
.progress.gold > i { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.progress.red > i { background: linear-gradient(90deg, var(--red-deep), var(--red)); }
.check { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--r-md); padding: 13px 14px; box-shadow: 0 4px 0 var(--line); transition: background .2s, border-color .2s, box-shadow .2s; }
.check:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.check .box { width: 34px; height: 34px; border-radius: 12px; border: 3px solid var(--line); display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; flex: none; transition: all .2s; }
.check .title { flex: 1; font-weight: 800; }
.check .pts { font-size: 13px; font-weight: 900; color: #5A3E00; background: var(--gold-tint); border: 2px solid var(--gold-edge); padding: 3px 9px; border-radius: 999px; }
.check .title small { display: block; font-size: 12px; font-weight: 800; color: var(--gold-deep); }
/* Vom Kind abgehakt, wartet auf die Eltern – sichtbar anders als „fertig“, damit klar ist,
   dass die Sterne noch ausstehen. */
.check.waiting { background: var(--gold-tint); border-color: var(--gold); box-shadow: 0 4px 0 var(--gold-deep); }
.check.waiting .box { border-color: var(--gold); background: var(--gold); font-size: 16px; animation: pop .4s var(--spring); }
.check.waiting .title { color: #7A5600; }
.check.done { background: var(--green-tint); border-color: var(--green); box-shadow: 0 4px 0 var(--green-deep); }
.check.done .box { background: var(--green); border-color: var(--green); animation: pop .4s var(--spring); }
.check.done .title { color: var(--green-deep); text-decoration: line-through; text-decoration-thickness: 2px; }
.check.done .pts { background: var(--green); border-color: var(--green); color: #fff; }
.list-done-banner { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); color: #fff; font-weight: 900; font-size: 17px;
  background: linear-gradient(135deg, var(--green), #7ADB8E); box-shadow: 0 4px 0 var(--green-deep); text-shadow: 0 1px 0 rgba(0, 0, 0, .12); animation: popin .5s var(--spring) both; }

/* ===== Lesson ===== */
/* Die Abstände der Lektion sind knapp bemessen: Vier Antworten und das Blatt mit der Rückmeldung
   sollen auf ein Handy passen, ohne dass das Kind scrollen muss, um die richtige Antwort zu sehen. */
.lesson-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.lesson-top .progress { flex: 1; height: 18px; }
.lesson-top .progress.bump > i { animation: bump .5s var(--spring); }
@keyframes bump { 50% { transform: scaleY(1.35); } }
.combo { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap;
  background: linear-gradient(135deg, var(--orange), #FFB347); box-shadow: 0 3px 0 var(--orange-deep); text-shadow: 0 1px 0 rgba(0, 0, 0, .15); animation: pop .4s var(--spring); }
.combo .ico { display: inline-block; animation: flame 1s ease-in-out infinite alternate; }
/* Jede Aufgabe schiebt sich von rechts herein – ein sichtbarer Schritt weiter, kein Flackern. */
.ex { animation: exin .38s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes exin { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.prompt-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: var(--purple-deep); background: var(--purple-tint); border: 2px solid var(--purple-edge); font-size: 14px; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.prompt { font-size: 34px; font-weight: 900; letter-spacing: -.01em; word-break: break-word; }
.prompt small { display: block; font-size: 16px; font-weight: 700; color: var(--muted); margin-top: 2px; letter-spacing: 0; }
.choices { display: grid; gap: 8px; margin-top: 16px; }
.choice { text-align: left; padding: 13px 16px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); font-weight: 800; font-size: 19px;
  box-shadow: 0 4px 0 var(--line); display: flex; align-items: center; gap: 12px; transition: transform .08s, background .15s, border-color .15s, color .15s; }
.choice .key { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); background: var(--soft); display: grid; place-items: center; font-size: 13px; color: var(--muted); flex: none; transition: all .15s; }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.choice.selected { border-color: var(--sky); background: var(--sky-tint); box-shadow: 0 4px 0 var(--sky); }
.choice.right { border-color: var(--green); background: var(--green-tint); box-shadow: 0 4px 0 var(--green); color: var(--green-deep); animation: popright .5s var(--spring); }
.choice.right .key { background: var(--green); border-color: var(--green); color: #fff; }
.choice.wrong { border-color: var(--red); background: var(--red-tint); box-shadow: 0 4px 0 var(--red); color: var(--red-deep); animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
.choice.wrong .key { background: var(--red); border-color: var(--red); color: #fff; }
.choice:disabled { cursor: default; opacity: 1; }
.choice.dim { opacity: .45; }
@keyframes popright { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.typing { margin-top: 16px; }
.typing .input { font-size: 24px; font-weight: 800; padding: 16px; text-align: center; transition: background .2s, border-color .2s; }
.typing .input.right { border-color: var(--green); background: var(--green-tint); color: var(--green-deep); }
.typing .input.wrong { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
/* Ergänze die Formen: je Form eine Zeile mit Beschriftung, das Genus als drei Knöpfe. */
.forms-ex { display: grid; gap: 10px; margin-top: 16px; }
.fx-row { display: grid; gap: 4px; }
.fx-label { font-size: 13px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.forms-ex .input { font-size: 21px; font-weight: 800; padding: 12px 14px; transition: background .2s, border-color .2s; }
.forms-ex .input.right { border-color: var(--green); background: var(--green-tint); color: var(--green-deep); }
.forms-ex .input.wrong { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
.fx-genus { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fx-genus .choice { justify-content: center; font-size: 16px; padding: 10px 6px; }
/* Tabellarium: die gefragte Form als Zeile unter dem Wort, die Tabelle wie im Buch – Fall bzw.
   Person links, Singular und Plural daneben, die richtige Zelle grün. */
.tb-target { margin-top: 12px; display: inline-block; font-weight: 900; font-size: 18px; color: var(--purple-deep); background: var(--purple-tint); border-radius: var(--r-sm); padding: 6px 12px; }
.tb-table { width: 100%; border-collapse: separate; border-spacing: 0 3px; margin-top: 10px; font-size: 15px; }
.tb-table caption { text-align: left; font-weight: 900; padding-bottom: 2px; color: var(--ink); }
.tb-table caption span { color: var(--muted); font-weight: 700; }
.tb-table th { text-align: left; font-size: 12px; font-weight: 800; color: var(--muted); padding: 2px 8px 2px 0; }
.tb-table td { font-weight: 800; padding: 3px 8px; background: var(--soft); color: var(--ink); border-radius: 8px; }
.tb-table td.hit { background: var(--green-tint); color: var(--green-deep); }
.tb-lookup summary { cursor: pointer; list-style: none; display: grid; gap: 2px; }
.tb-lookup summary small { color: var(--muted); font-weight: 700; }
.tb-lookup[open] summary { margin-bottom: 8px; }
.tb-group { display: grid; gap: 6px; }
.feedback .tb-table { font-size: 14px; }
/* Die Karte für ein neues Wort: der eine Moment der Lektion ohne Frage – deshalb groß, bunt
   und mit Funkeln, damit sie sich vom Abfragen unterscheidet. */
.newword { background: linear-gradient(145deg, #7A3FD9, #A96BF2); color: #fff; border-radius: 28px; padding: 30px 22px 26px; text-align: center; box-shadow: 0 6px 0 #5A2AA6;
  position: relative; overflow: hidden; animation: popin .5s var(--spring) both; }
.newword::before, .newword::after { content: "✦"; position: absolute; color: rgba(255, 255, 255, .75); font-size: 26px; animation: twinkle 2.2s ease-in-out infinite; }
.newword::before { left: 16px; top: 12px; }
.newword::after { right: 18px; bottom: 14px; font-size: 20px; animation-delay: 1.1s; }
.newword .la { font-size: 38px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
/* Vorlesen: ein runder Lautsprecher hinter dem Wort; beim Sprechen pulsiert er. */
.say-btn { vertical-align: middle; margin-left: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .22); color: #fff; font-size: 20px; cursor: pointer; text-shadow: none; }
.say-btn:active { transform: scale(.92); }
.say-btn.playing, .mini button.playing { animation: say-pulse .9s ease-in-out infinite; }
@keyframes say-pulse { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .say-btn.playing, .mini button.playing { animation: none; outline: 2px solid currentColor; } }
.newword .forms { color: rgba(255, 255, 255, .8); font-weight: 700; margin-top: 2px; }
.newword .de { display: inline-block; font-size: 24px; font-weight: 800; margin-top: 16px; background: rgba(255, 255, 255, .18); border-radius: 14px; padding: 8px 16px; }
.newword .note { margin-top: 12px; font-size: 15px; color: rgba(255, 255, 255, .85); }
.newword .derived { margin-top: 8px; font-size: 14px; font-style: italic; color: rgba(255, 255, 255, .8); }
.lesson-actions { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.lesson-actions .inner { max-width: 520px; margin: 0 auto; }
/* Die Rückmeldung nach jeder Antwort: ein Blatt von unten, mit Häkchen-Kreis und kleinem Felix */
.feedback { position: fixed; left: 0; right: 0; bottom: 0; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  border-radius: 28px 28px 0 0; animation: slideup .32s cubic-bezier(.2, .9, .3, 1.1); }
.feedback .inner { max-width: 520px; margin: 0 auto; }
.feedback.ok { background: var(--green-tint); color: var(--green-deep); box-shadow: 0 -2px 0 var(--green-edge); }
.feedback.bad { background: var(--red-tint); color: var(--red-deep); box-shadow: 0 -2px 0 #F7C3C5; }
.feedback .head { display: flex; align-items: center; gap: 14px; }
.feedback .mark { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 900; flex: none; animation: pop .5s var(--spring); }
.feedback.ok .mark { background: var(--green); box-shadow: 0 4px 0 var(--green-deep); }
.feedback.bad .mark { background: var(--red); box-shadow: 0 4px 0 var(--red-deep); }
.feedback .felix { margin-left: auto; flex: none; }
.feedback .felix svg { width: 56px; height: 56px; display: block; }
.feedback h2 { font-size: 24px; }
.feedback .answer { margin-top: 8px; font-weight: 700; }
.feedback .btn { margin-top: 12px; }
/* Platz unten nur so viel, wie gerade verdeckt wird: die Knopfleiste, und solange die
   Rückmeldung offen ist, genau deren Höhe (--fb-h setzt grade() in js/lesson.js). Ein fester
   Rand für das Blatt ließe jede Aufgabe ein Stück scrollen, auch wenn nichts verdeckt ist. */
main.lesson { padding-bottom: 110px; }
body:has(> .feedback) main.lesson { padding-bottom: var(--fb-h, 210px); }

/* Serien-Banner: fliegt bei 3, 5, 10 … richtigen Antworten in Folge über den Bildschirm */
.burst { position: fixed; left: 50%; top: 40%; z-index: 45; pointer-events: none; white-space: nowrap;
  background: linear-gradient(135deg, var(--orange), var(--gold)); color: #fff; font-weight: 900; font-size: 26px; padding: 14px 28px; border-radius: 999px;
  box-shadow: 0 8px 0 var(--orange-deep), 0 18px 40px rgba(0, 0, 0, .18); text-shadow: 0 2px 0 rgba(0, 0, 0, .15);
  animation: burstin 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes burstin {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.12) rotate(2deg); opacity: 1; }
  32% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(.9); opacity: 0; }
}

/* Sternfunken aus einem angetippten Element (richtige Antwort, abgehakte Aufgabe) */
.sparks { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 70; }
.sparks i { position: absolute; font-style: normal; font-size: 18px; line-height: 1; animation: spark .9s cubic-bezier(.1, .8, .3, 1) forwards; will-change: transform, opacity; }
@keyframes spark { 0% { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.1) rotate(var(--rot)); opacity: 0; } }

/* ===== Felix ruft an ===== */
/* Auf der Startseite: der Anruf-Knopf, wenn ein Test fällig ist – grün, pulsierend und alle
   paar Sekunden ein kurzes Wackeln wie ein klingelndes Handy. Wartet der Test noch, steht
   stattdessen eine ruhige Karte mit den Minuten bis zum Anruf da. */
.call-invite { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; color: #fff;
  border-radius: var(--r-lg); padding: 18px 20px; font-weight: 900; text-shadow: 0 1px 0 rgba(0, 0, 0, .15);
  background: linear-gradient(135deg, var(--green), #2FB5A0); box-shadow: 0 5px 0 var(--green-deep);
  animation: glow 1.8s ease-in-out infinite, callwiggle 2.6s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.call-invite:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-deep); }
.call-invite .ico { font-size: 40px; line-height: 1; display: inline-block; animation: callshake 1.3s ease-in-out infinite; }
.call-invite b { display: block; font-size: 23px; }
.call-invite small { display: block; font-size: 15px; font-weight: 800; opacity: .92; }
.call-invite:disabled { cursor: default; animation: none; opacity: .8; }
.call-invite:disabled .ico { animation: none; }
.call-wait { gap: 14px; background: var(--sky-tint); border-color: #B9E2FA; box-shadow: 0 4px 0 #B9E2FA; }
.call-wait .ico { font-size: 30px; line-height: 1; }
@keyframes callwiggle { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(-2deg); } 78% { transform: rotate(2deg); } 82% { transform: rotate(-1.5deg); } 86% { transform: rotate(1.5deg); } 90% { transform: rotate(0); } }
@keyframes callshake { 0%, 45%, 100% { transform: rotate(0); } 5%, 15%, 25%, 35% { transform: rotate(-14deg); } 10%, 20%, 30%, 40% { transform: rotate(14deg); } }
@keyframes callpulse { from { transform: scale(1); opacity: .55; } to { transform: scale(1.55); opacity: 0; } }

/* Das Lektionsergebnis mit Test: Die Sterne sind nur vorgemerkt – gestrichelt statt fest. */
.result-grid .card.is-pending { border-style: dashed; }
.call-pending { text-align: center; }
.call-pending b { display: block; font-size: 21px; color: #7A5600; }
.call-pending p { font-weight: 800; margin-top: 4px; }

/* Der Anruf selbst: ein Bildschirm wie ein Videotelefonat, tief lila bis an den Rand. Der
   Hintergrund ist ein festes Pseudo-Element, weil #app schmaler ist als ein Tablet. */
/* Der Bildschirm füllt genau die Höhe unter einem etwaigen Umgebungsbalken – über flex statt
   über eine abgezogene Pixelzahl, die den Balken nicht kennt. Die Abstände sind knapp, damit
   Frage, Wort und Mikrofon ohne Scrollen auf ein Handy passen. */
main.call { display: flex; flex-direction: column; padding: 0 18px calc(14px + env(safe-area-inset-bottom)); }
.call-screen { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 12px; color: #fff; }
.call-screen::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 45% at 50% 18%, rgba(255, 255, 255, .16), transparent 70%), linear-gradient(165deg, #3B1F75 0%, #6E38C9 55%, #9B5DE5 100%); }
.call-screen h1 { font-size: 30px; }
.call-kicker { font-weight: 900; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.call-sub { font-weight: 800; opacity: .9; }
.call-avatar { position: relative; width: 176px; height: 176px; margin-top: 10px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); }
.call-avatar svg { width: 150px; height: 150px; position: relative; }
.call-avatar.ringing::before, .call-avatar.ringing::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .5); animation: callpulse 1.6s ease-out infinite; }
.call-avatar.ringing::after { animation-delay: .8s; }
.call-answer { display: flex; justify-content: space-around; align-items: flex-end; width: 100%; margin-top: auto; padding: 20px 0 12px; }
.call-answer > div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 900; }
.call-round { width: 84px; height: 84px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 36px; line-height: 1; color: #fff;
  background: var(--green); box-shadow: 0 5px 0 var(--green-deep); -webkit-tap-highlight-color: transparent; }
.call-round.red { background: var(--red); box-shadow: 0 5px 0 var(--red-deep); }
.call-round:active { transform: translateY(4px); box-shadow: none; }
.call-round.ringing { animation: callshake 1.3s ease-in-out infinite; }
.call-round.small { width: 60px; height: 60px; font-size: 26px; }
.call-round.confirm { width: auto; padding: 0 16px; border-radius: 999px; display: inline-flex; gap: 6px; font-size: 16px; font-weight: 900; }
.call-round:disabled { opacity: .5; }
.ico.hang { display: inline-block; transform: rotate(135deg); }

.call-top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 900; font-size: 15px; }
.call-live { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.call-live i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: livedot 1.4s ease-in-out infinite; }
@keyframes livedot { 50% { opacity: .3; } }
/* Fortschritt als Punkte: fertig golden, das aktuelle Wort weiß. Keine Farbe für „falsch“ –
   im Anruf zählt, dass es weitergeht. */
.call-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.call-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: background .2s; }
.call-dots i.done.correct { background: var(--green); }
.call-dots i.done.retry { background: var(--gold); }
.call-dots i.done.wrong { background: var(--red); }
.call-dots i.now { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .3); animation: pop .4s var(--spring); }
.call-felix { width: 116px; height: 116px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex: none; }
.call-felix svg { width: 100px; height: 100px; }
/* Beim Tippen braucht die Tastatur den Platz – Felix rückt klein zusammen. */
.call-screen:has(.call-typing:not(.hidden)) .call-felix { width: 84px; height: 84px; }
.call-screen:has(.call-typing:not(.hidden)) .call-felix svg { width: 72px; height: 72px; }
.call-say { position: relative; max-width: 100%; background: var(--surface); color: var(--ink); border-radius: var(--r-lg); padding: 12px 16px;
  font-weight: 800; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.call-say:empty { display: none; }
.call-say::before { content: ""; position: absolute; left: 50%; top: -10px; margin-left: -10px; border: 10px solid transparent; border-bottom-color: var(--surface); border-top: 0; }
.call-say.pop { animation: bubblein .4s var(--spring) both; transform-origin: center top; }
.call-word { width: 100%; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .22); border-radius: var(--r-lg); padding: 12px 14px; }
.call-word.in { animation: popin .45s var(--spring) both; }
.call-word .la { font-size: 36px; font-weight: 900; line-height: 1.1; word-break: break-word; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.call-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.call-hint { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-weight: 800; font-size: 14px; transition: background .2s, color .2s; }
.call-hint.missing { background: var(--gold); color: #5A3E00; animation: pop .4s var(--spring), hintglow 1.4s ease-in-out .4s infinite; }
.call-hint.ok { background: var(--green); }
@keyframes hintglow { 50% { box-shadow: 0 0 0 5px rgba(255, 199, 44, .35); } }
.call-solution { margin-top: 10px; background: var(--surface); color: var(--ink); border-radius: var(--r-md); padding: 8px 12px; font-weight: 700; animation: popin .4s var(--spring) both; }
.call-heard { min-height: 1.5em; font-size: 20px; font-weight: 800; word-break: break-word; }
.call-heard .interim { opacity: .6; font-style: italic; }
.call-typing { width: 100%; display: flex; gap: 8px; }
.call-typing .input { flex: 1; min-width: 0; color: var(--ink); font-size: 19px; font-weight: 800; }
.call-typing .btn { flex: none; }
.call-status { min-height: 1.4em; font-weight: 800; opacity: .85; }
/* „Später“ und „Weiß ich nicht“: zwei ruhige Knöpfe über den Anrufknöpfen, nur aktiv, solange Felix auf eine Antwort wartet. */
.call-pass { width: 100%; display: flex; gap: 10px; }
.call-pass-btn { flex: 1; min-width: 0; min-height: 48px; padding: 8px 10px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14);
  color: #fff; font-weight: 800; font-size: 16px; -webkit-tap-highlight-color: transparent; transition: opacity .2s; }
.call-pass-btn:active { transform: translateY(2px); }
.call-pass-btn:disabled { opacity: .4; }
.call-controls { width: 100%; margin-top: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding-bottom: 6px; }
.call-controls > :first-child { justify-self: start; }
.call-controls > :last-child { justify-self: end; }
.call-small { width: 56px; height: 56px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14); font-size: 24px; line-height: 1; color: #fff; }
.call-small:disabled { opacity: .45; }
/* Der große Mikrofon-Knopf: weiß im Ruhezustand, grün mit Wellen, solange Felix zuhört. */
.call-mic { position: relative; width: 96px; height: 96px; border-radius: 50%; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fff; color: var(--purple-deep); font-weight: 900; font-size: 14px; box-shadow: 0 6px 0 rgba(0, 0, 0, .22); -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s; }
.call-mic .ico { font-size: 36px; line-height: 1; position: relative; }
.call-mic .lbl { position: relative; }
.call-mic:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.call-mic.listening { background: var(--green); color: #fff; box-shadow: 0 6px 0 var(--green-deep); }
.call-mic.listening::before, .call-mic.listening::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 4px solid rgba(67, 196, 99, .7); animation: callpulse 1.4s ease-out infinite; }
.call-mic.listening::after { animation-delay: .7s; }
.call-mic.speaking, .call-mic.busy { opacity: .6; }
.call-mic:disabled { cursor: default; }
.call-screen.ended .call-answer { padding-bottom: 20px; }

@media (prefers-reduced-motion: reduce) {
  .call-invite, .call-invite .ico, .call-round.ringing, .mascot.wobble, .mascot.talking .mouth,
  .call-avatar.ringing::before, .call-avatar.ringing::after, .call-mic.listening::before, .call-mic.listening::after,
  .call-hint.missing, .call-live i, .call-dots i.now { animation: none; }
}

/* ===== Results ===== */
.result-hero { text-align: center; padding: 18px 0 6px; position: relative; }
/* Strahlenkranz hinter Felix – gedreht, weich ausgeblendet zum Rand */
.result-hero .rays { position: absolute; left: 50%; top: 96px; width: 320px; height: 320px; margin: -160px 0 0 -160px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 199, 44, .35) 0 11deg, transparent 11deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%);
  animation: spin 16s linear infinite, fadein .8s ease both; }
.result-hero svg { width: 165px; height: 165px; position: relative; }
.result-hero h1 { margin-top: 6px; font-size: 32px; color: var(--purple-deep); animation: popin .6s var(--spring) both; animation-delay: .15s; }
.result-hero .line { color: var(--muted); font-weight: 700; margin-top: 6px; animation: fadein .6s ease both; animation-delay: .4s; }
.ribbon { display: inline-block; background: linear-gradient(135deg, var(--gold), var(--orange)); color: #fff; font-weight: 900; padding: 6px 18px; border-radius: 999px;
  box-shadow: 0 3px 0 var(--orange-deep); text-shadow: 0 1px 0 rgba(0, 0, 0, .15); margin-top: 10px; animation: popin .6s var(--spring) both; animation-delay: .3s; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.result-grid .card { text-align: center; padding: 14px 6px; animation: popin .55s var(--spring) both; }
.result-grid .card:nth-child(1) { animation-delay: .45s; }
.result-grid .card:nth-child(2) { animation-delay: .6s; }
.result-grid .card:nth-child(3) { animation-delay: .75s; }
.result-grid .ico { display: block; font-size: 26px; line-height: 1; margin-bottom: 6px; }
.result-grid b { font-size: 28px; font-weight: 900; display: block; line-height: 1.1; }
.result-grid small { color: var(--muted); font-weight: 800; font-size: 12px; }
.count-up { animation: pop .5s var(--spring); }
.result-extra { animation: popin .5s var(--spring) both; animation-delay: .95s; }
.result-actions { animation: fadein .5s ease both; animation-delay: 1.1s; }
.result-actions > * + * { margin-top: 14px; }

/* Confetti – Rechtecke, Kreise, Sterne und Streifen, jedes mit eigener Drift */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -16px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; will-change: transform; }
.confetti i.round { width: 11px; height: 11px; border-radius: 50%; }
.confetti i.strip { width: 6px; height: 20px; }
.confetti i.star { width: 15px; height: 15px; border-radius: 0; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
@keyframes fall { to { transform: translate(var(--dx, 0px), 110vh) rotate(var(--rot, 720deg)); opacity: .9; } }

/* ===== Rewards ===== */
.starbank { text-align: center; padding: 24px 18px; }
.card.starbank { background: linear-gradient(160deg, #FFF6D6, #FFE08A); border-color: #F5D060; box-shadow: 0 4px 0 #E0B53E; }
.starbank .num { font-size: 60px; font-weight: 900; line-height: 1; color: #8A5A00; text-shadow: 0 2px 0 rgba(255, 255, 255, .6); }
.starbank .muted { color: #8A6A20; }
.reward { display: flex; align-items: center; gap: 14px; }
.reward .emoji { font-size: 34px; width: 54px; height: 54px; display: grid; place-items: center; background: linear-gradient(145deg, var(--purple-tint), var(--sky-tint)); border-radius: var(--r-md); flex: none; }
.reward b { display: block; }
.reward .cost { font-weight: 900; color: var(--gold-deep); font-size: 14px; }
.emojipick { display: flex; flex-wrap: wrap; gap: 6px; }
.emojipick button { font-size: 22px; line-height: 1; padding: 6px 8px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.emojipick button:active { transform: translateY(2px); }
/* Eine Zeile je wartender Aufgabe bzw. Vorschlag – Titel oben, Entscheidung darunter */
.confirmrow { gap: 8px; }
.confirmrow + .confirmrow { border-top: 1px solid rgba(36,41,62,.08); padding-top: 10px; }
.proposal + .proposal { border-top: 1px solid rgba(36,41,62,.08); padding-top: 10px; }
.proposal .row + .row { margin-top: 6px; flex-wrap: wrap; }
.proposal .field { width: 80px; flex: none; }
.proposal .btn { flex: 1 1 auto; }
.msg { display: flex; gap: 12px; align-items: flex-start; animation: popin .5s var(--spring) both; }
.msg svg { width: 56px; height: 56px; flex: none; }

/* ===== Activity feed ===== */
.feed { display: flex; flex-direction: column; }
.feed .ev { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed .ev:last-child { border-bottom: 0; }
.feed .ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); flex: none; font-size: 17px; }
.feed .txt { flex: 1; min-width: 0; font-weight: 700; }
.feed .txt small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; }
.feed .pts { font-weight: 900; }
.feed .pts.plus { color: var(--green-deep); }
.feed .pts.minus { color: var(--red-deep); }

/* ===== Parent ===== */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--soft); color: var(--muted); }
.pill.green { background: var(--green-tint); color: var(--green-deep); }
.pill.gold { background: var(--gold-tint); color: #7A5600; }
.pill.purple { background: var(--purple-tint); color: var(--purple-deep); }
.pill.red { background: var(--red-tint); color: var(--red-deep); }
.segmented { display: flex; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md); padding: 4px; gap: 4px; }
/* min-width: 0 wie bei den Balken: seit der vierten Liste („Heute extra“) passen die
   Beschriftungen auf schmalen Geräten sonst nicht mehr nebeneinander. */
.segmented button { flex: 1 1 0; min-width: 0; border: 0; background: none; padding: 9px 6px; border-radius: 12px; font-weight: 800; color: var(--muted); font-size: 15px; transition: background .15s, color .15s; }
.segmented button.active { background: var(--purple-tint); color: var(--purple-deep); font-weight: 900; }
/* Die Reiter der Listen: Symbol über dem Namen, den die Eltern frei wählen – ein zu langer wird
   gekürzt, damit vier Reiter auch auf schmalen Handys nebeneinander passen. */
.segmented.lists button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; }
.segmented.lists .ico { font-size: 18px; line-height: 1; }
.segmented.lists .lbl { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
/* Eine ausgeschaltete Liste im Editor der Eltern: noch wählbar, aber blass. */
.segmented button.off { opacity: .5; }
.segmented button.off .lbl { text-decoration: line-through; }
.list-setup.off { border-style: dashed; }
/* Die Symbolwahl einer Tagesliste: ein Raster, das auch auf schmalen Handys in zwei Zeilen passt. */
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-pick button { aspect-ratio: 1; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; font-size: 22px; line-height: 1; padding: 0; }
.icon-pick button.active { border-color: var(--purple); background: var(--purple-tint); }
.childbar { position: sticky; top: 8px; z-index: 5; }
.editrow { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.editrow:last-child { border-bottom: 0; }
.editrow .grow b { display: block; }
.editrow .grow small { color: var(--muted); }
.mini { display: flex; gap: 4px; }
.mini button { background: var(--soft); border: 0; border-radius: 8px; width: 34px; height: 34px; font-size: 16px; }
.mini button:hover { background: var(--line); }
/* min-width: 0 ist hier Pflicht: Flex-Items schrumpfen sonst nie unter die Breite ihres
   Inhalts, und 14 Balken samt Wochentagskürzel schieben die Karte auf schmalen Geräten
   nach rechts aus dem Bild. */
.bars { display: flex; gap: 6px; align-items: flex-end; height: 70px; min-width: 0; }
.bars .bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.bars .bar i { display: block; width: 100%; background: linear-gradient(to top, var(--purple-deep), var(--purple)); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bars .bar i.empty { background: var(--line); }
.bars .bar small { font-size: 10px; color: var(--muted); font-weight: 800; overflow: hidden; }
.boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.boxes div { text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--soft); }
.boxes b { display: block; font-size: 18px; }
.boxes small { font-size: 11px; color: var(--muted); font-weight: 800; }
.boxes .b5 { background: var(--green-tint); }
.word-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.word-row:last-child { border-bottom: 0; }
.word-row .grow b { font-weight: 800; }
.word-row .grow small { color: var(--muted); display: block; }
.boxdot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.boxdot.b1 { background: #FFC72C; } .boxdot.b2 { background: #FF8E1F; } .boxdot.b3 { background: #1FB0F5; } .boxdot.b4 { background: #43C463; } .boxdot.b5 { background: #2E9E4B; }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .pickers { grid-template-columns: 1fr; } }
.dropzone { display: block; position: relative; overflow: hidden; border: 2px dashed var(--purple); background: var(--purple-tint); border-radius: var(--r-lg); padding: 18px 12px; text-align: center; cursor: pointer; }
/* Nicht `display:none`: ein ausgeblendetes Dateifeld öffnet in manchen Android-WebViews
   keinen Auswahldialog. Es bleibt also im Layout und wird nur unsichtbar gemacht. */
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 8px 0 0; }
.thumb { position: relative; display: inline-block; line-height: 0; }
.thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); }
.thumb-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; line-height: 22px; cursor: pointer; padding: 0; }
button.dropzone { width: 100%; font: inherit; color: inherit; }

/* Kamera in der Seite. Sie liegt über allem, weil der Blick beim Fotografieren nur dem
   Bild gehört – und weil ein halb sichtbarer Videostrom zwischen Formularfeldern
   niemandem hilft, eine Buchseite gerade auszurichten. */
#camera { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; }
#camera video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
#camera.flash video { opacity: .25; transition: opacity .05s; }
.cam-hint { color: #fff; opacity: .75; text-align: center; font-size: 13px; margin: 0; padding: 0 16px 10px; }
.cam-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); background: #000; }
.cam-done { justify-self: start; background: none; border: 0; color: #fff; font: inherit; font-weight: 800; padding: 10px 4px; cursor: pointer; }
.cam-shot { width: 68px; height: 68px; border-radius: 50%; background: #fff; border: 5px solid rgba(255, 255, 255, .35); background-clip: padding-box; cursor: pointer; padding: 0; }
.cam-shot:disabled { opacity: .5; }
.cam-count { justify-self: end; color: #fff; font-weight: 800; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.spinner { width: 28px; height: 28px; border: 4px solid var(--line); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }

/* ===== Hilfe ===== */
/* Das Fragezeichen sitzt oben rechts neben der Überschrift jeder Eltern-Seite; das kleine i
   direkt neben einer Einstellung. Beide sind Links auf #help/…, damit der Router die Arbeit
   macht und kein Knopf einzeln verdrahtet werden muss. */
.helpbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--muted);
  font-weight: 900; font-size: 15px; text-decoration: none; }
.helpbtn:hover { border-color: var(--purple); color: var(--purple); }
.helplink { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px;
  border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 900; font-style: italic;
  text-decoration: none; vertical-align: middle; }
.helplink:hover { background: var(--purple-tint); color: var(--purple); }
.help-back { padding-left: 0; }
.help .pill { text-decoration: none; }
.help-toc { padding: 4px 18px; }
.help-toc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.help-toc-row:last-child { border-bottom: 0; }
.help-toc-row .ico { font-size: 24px; line-height: 1; flex: none; }
.help-toc-row b { display: block; }
.help-toc-row small { color: var(--muted); }
.help-toc-row .chev { color: var(--muted); font-size: 22px; }
/* Der Fließtext des Handbuchs: dieselbe Schrift, aber mit etwas mehr Luft als die Karten der App. */
.help-body { line-height: 1.55; }
.help-body > * + * { margin-top: 12px; }
.help-body h3 { margin-top: 22px; color: var(--purple-deep); scroll-margin-top: 16px; }
.help-body ul, .help-body ol { margin: 0; padding-left: 22px; }
.help-body li + li { margin-top: 6px; }
.help-body a { font-weight: 800; }
.help-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.help-table th, .help-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.help-table th { color: var(--muted); font-size: 13px; font-weight: 800; }
.help-target { background: var(--gold-tint); border-radius: 8px; padding: 4px 8px; margin-left: -8px; margin-right: -8px; }
.help-nav { display: flex; justify-content: space-between; gap: 10px; }
.help-nav .btn { text-decoration: none; text-align: center; flex: 1 1 0; min-width: 0; padding: 12px 10px; font-size: 14px; }
/* „Felix erklärt“ für das Kind: eine Karte je Gedanke, großes Symbol, wenig Text. Das
   Fragezeichen sitzt auf den Kind-Seiten neben den Zahlen oben (Lernen), neben den Listen-
   Reitern und in der Ecke der Sternenkarte – überall dort, wo es nicht mit dem Inhalt ringt. */
/* Im lila Kopfband der Kind-Startseite: Fragezeichen rechts außen, durchscheinend wie die Chips */
.chips .helpbtn { margin-left: auto; align-self: center; }
.starbank { position: relative; }
.felix-card { display: flex; align-items: flex-start; gap: 14px; }
.felix-card .ico { font-size: 30px; line-height: 1; width: 44px; flex: none; text-align: center; padding-top: 2px; }
.felix-card h3 { margin-bottom: 4px; }
.felix-card p { line-height: 1.5; }

/* ===== Toast & modal ===== */
#toasts { position: fixed; top: 14px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 800; box-shadow: 0 4px 0 rgba(0, 0, 0, .25), var(--shadow); animation: toastin .35s var(--spring); max-width: 90vw; }
.toast.gold { background: var(--gold); color: #5A3E00; box-shadow: 0 4px 0 var(--gold-deep), var(--shadow); }
.toast.green { background: var(--green); box-shadow: 0 4px 0 var(--green-deep), var(--shadow); }
.toast.red { background: var(--red); box-shadow: 0 4px 0 var(--red-deep), var(--shadow); }
@keyframes toastin { from { transform: translateY(-20px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
#modal { position: fixed; inset: 0; background: rgba(42, 43, 74, .55); display: grid; place-items: end center; z-index: 55; padding: 0; }
#modal .sheet { background: var(--surface); width: 100%; max-width: 520px; border-radius: 28px 28px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; animation: slideup .28s cubic-bezier(.2,.9,.3,1.1); }
@media (min-width: 560px) { #modal { place-items: center; padding: 20px; } #modal .sheet { border-radius: var(--r-lg); } }
.celebrate { text-align: center; padding: 10px 0; }
.celebrate svg { width: 140px; height: 140px; }
.celebrate h2 { font-size: 26px; margin-top: 6px; }
.celebrate .pts { font-size: 40px; font-weight: 900; color: var(--gold-deep); margin: 8px 0; }

.empty { text-align: center; padding: 24px 12px; color: var(--muted); font-weight: 700; }
.empty svg { width: 110px; height: 110px; margin-bottom: 8px; }
.offline-bar { background: var(--ink); color: #fff; text-align: center; padding: 6px; font-size: 13px; font-weight: 800; }
/* Kennzeichnung von Test- und lokaler Umgebung – niemand soll echte Sterne in Testdaten tippen */
.env-bar {
  background: repeating-linear-gradient(135deg, var(--gold) 0 14px, var(--gold-deep) 14px 28px);
  color: #2B2000; text-align: center; padding: 6px; font-size: 13px; font-weight: 900;
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* ===== Install-Gate: Produktseite im Browser-Tab ===== */
/* Die Weiche im Kopf von index.html setzt data-mode auf <html>, bevor irgendetwas gemalt wird.
   Ohne Attribut (JavaScript aus) bleibt die App sichtbar – die Produktseite ist die Ausnahme. */
#install { display: none; }
html[data-mode="install"] #install { display: flex; }
html[data-mode="install"] #app { display: none; }
.install { max-width: 520px; margin: 0 auto; min-height: 100dvh; flex-direction: column; gap: 22px; padding: 0 18px calc(40px + env(safe-area-inset-bottom)); }
.install .env-bar { margin: 0 -18px; }
.install-hero { text-align: center; padding-top: 28px; }
.install-hero svg { width: 150px; height: 150px; }
.install-hero h1 { font-size: 34px; margin-top: 4px; color: var(--purple-deep); }
.install-hero .lead { color: var(--muted); font-weight: 700; margin-top: 10px; }
.install-card { border: 2px solid var(--purple-edge); }
.install-card[data-state="installed"] { background: var(--green-tint); border-color: var(--green-edge); }
.install-card h2 { color: var(--purple-deep); }
.install-card[data-state="installed"] h2 { color: var(--green-deep); }
.install-steps { background: var(--soft); border-radius: var(--r-md); padding: 12px 14px; font-size: 15px; font-weight: 700; }
.install-features { display: grid; gap: 10px; }
.feat { display: grid; grid-template-columns: 44px 1fr; gap: 2px 12px; align-items: center;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; box-shadow: 0 4px 0 var(--line); }
.feat .ico { grid-row: span 2; font-size: 30px; line-height: 1; text-align: center; }
.feat b { font-size: 16px; }
.feat span:last-child { color: var(--muted); font-size: 14px; font-weight: 700; }
.install-why { text-align: center; margin-top: auto; }
