:root {
  /* Gleiche Farbvorgabe wie überall im Projekt + die beiden Spezifikations-
     Farben für Akkusativ/Dativ (Abschnitt 6.1). */
  --grund: #fffdf8;
  --karte: #ffffff;
  --hell: #003a4d;
  --gedaempft: #4c6b74;
  --rand: #cde9ef;
  --gold: #fdcb52;
  --gold-dunkel: #8a6a18;
  --rot: #ff6b6b;
  --rot-dunkel: #d94b4b;
  --akk: #1565C0;
  --dat: #C62828;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--grund);
  color: var(--hell);
  -webkit-tap-highlight-color: transparent;
}

.schirm { display: none; padding: 20px 16px 28px; max-width: 1100px; margin: 0 auto; }
.schirm.sichtbar { display: block; }

.oben-leiste { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: 0 auto; padding: 10px 16px 0; }
.home-knopf {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 16px; font-size: 30px;
  text-decoration: none; background: var(--karte); border: none;
  box-shadow: 0 2px 8px #00000022; flex-shrink: 0;
}
.home-knopf:hover { background: #fbf5e8; }

/* ------------------------------------------------------------ Startseite */
.kopf { text-align: center; margin-bottom: 22px; }
.kopf h1 { margin: 8px 0 4px; font-size: clamp(28px, 6vw, 46px); letter-spacing: -0.5px; }
.untertitel { margin: 0 auto; max-width: 620px; color: var(--gedaempft); font-size: 16px; }

.wahl { margin-bottom: 22px; }
.wahl h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gedaempft); margin: 0 0 10px; }

/* Nummerierte Auswahl-Schritte (1. Niveau, 2. ..., 3. ...) - Nutzer-
   Feedback: mehrere Auswahlpunkte hintereinander wirken unübersichtlich,
   eine Nummerierung schafft eine klare Reihenfolge. Zählt automatisch nur
   ".wahl"-Blöcke mit einer ECHTEN Überschrift - Kippschalter ohne eigene
   Überschrift werden dadurch NICHT mitgezählt. Reine CSS-Lösung
   (counter-reset/-increment + ::before) - der über data-i18n übersetzte
   Text selbst bleibt unangetastet. */
#start { counter-reset: schrittzahl; }
#start .wahl h2 { counter-increment: schrittzahl; }
#start .wahl h2::before { content: counter(schrittzahl) ". "; }
.umschalter { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.umschalter input { width: 20px; height: 20px; accent-color: var(--hell); cursor: pointer; flex-shrink: 0; }

.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }
.knopfreihe-klein { display: flex; gap: 8px; flex-wrap: wrap; }
.knopfreihe-klein button { padding: 9px 16px; font-size: 14px; }

/* ---------------------------------------------------- Varianten-Auswahl */
.varianten-reihe { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin: 0 0 20px; }
.variante-kachel {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  width: min(100%, 320px); padding: 24px 20px; border-radius: 18px; border: 2px solid var(--rand);
  background: var(--karte); box-shadow: 0 3px 10px #00000018;
}
.variante-kachel:hover { border-color: var(--gold); background: #fbf5e8; }
.variante-symbol { font-size: 44px; line-height: 1; }
.variante-titel { font-size: 20px; font-weight: 800; color: var(--hell); }
.variante-text { font-size: 14px; color: var(--gedaempft); }

.start-hinweis { margin: 4px 0 0; padding: 10px 14px; border-radius: 10px; background: #eaf6fa; border: 1px solid #7cc9e0; color: var(--hell); font-size: 14px; font-weight: 600; }
.prototyp-hinweis { margin: 4px 0 0; padding: 10px 14px; border-radius: 10px; background: #fff6e0; border: 1px solid #f0cf7a; color: #6b5115; font-size: 13px; }

button {
  background: #fff; color: var(--hell); border: 2px solid var(--rand); border-radius: 12px;
  padding: 10px 16px; font-size: 15px; font-family: inherit; cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s; box-shadow: 0 1px 2px #00000010;
}
button:hover:not(:disabled) { background: #fbf5e8; border-color: var(--gold); }
button:active:not(:disabled) { transform: translateY(1px); }
button.aktiv { background: var(--hell); border-color: var(--hell); color: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.gross { padding: 15px 30px; font-size: 18px; font-weight: 700; background: var(--rot); border-color: var(--rot-dunkel); color: #fff; }
button.gross:hover:not(:disabled) { background: #ff8f8f; }
button.flach { background: transparent; box-shadow: none; }
button.gefahr { border-color: var(--rot); color: var(--rot); }

.startzeile { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }

/* ------------------------------------------------------------- Spielfeld */
.hud { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 4px 12px; font-size: 15px; color: var(--gedaempft); }
.hud b { color: var(--hell); font-size: 19px; }
.hud-rechts { margin-left: auto; }

.szenen-rahmen { position: relative; }
.szene-svg {
  width: 100%; height: auto; display: block; border-radius: 18px; border: 2px solid var(--rand);
  touch-action: none; user-select: none;
}
.szene-svg.zieht { cursor: grabbing; }
.ufo-gruppe { cursor: grab; }
.ufo-gruppe.ufo-vor .ufo-innen { transform: scale(1.1); }
.ufo-gruppe.ufo-hinter .ufo-innen { transform: scale(0.9); opacity: .92; }
.ufo-gruppe .ufo-landebeine { opacity: 0; transition: opacity .2s; }
.ufo-gruppe.ufo-gelandet .ufo-landebeine { opacity: 1; }
/* Lichtschein unter dem UFO (figuren.js, ".ufo-licht-schein") - nur
   sichtbar, solange es fliegt (Gegenteil der Landebeine): aus beim Stehen/
   Landen, an sobald es abhebt (Nutzer-Wunsch: "wenn es losfliegt"). Leichtes
   Pulsieren wie die Rand-Lichter, aber langsamer/dezenter. */
.ufo-gruppe .ufo-licht-schein { opacity: 0; transition: opacity .3s ease; }
.ufo-gruppe:not(.ufo-gelandet) .ufo-licht-schein { opacity: 1; animation: ufoGlutPulsieren 1.8s ease-in-out infinite; }
@keyframes ufoGlutPulsieren { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
/* Erfolgs-Rückmeldung: Rumpf wechselt von Blau (Akkusativ/Akki) zu Rot
   (Dativ/Dati), sobald die Aufgabe richtig gelöst ist - die passenden
   roten Verläufe stehen schon in figuren.js bereit (#ufoRumpfRot/
   #ufoRandRot). CSS überschreibt hier bewusst das "fill"-Attribut (nicht
   umgekehrt versuchen, das ginge nicht - ein Attribut kann CSS nie
   schlagen, nur umgekehrt). */
.ufo-gruppe.ufo-erfolg .ufo-rumpf { fill: url(#ufoRumpfRot); transition: fill .4s; }
.ufo-gruppe.ufo-erfolg .ufo-rand { fill: url(#ufoRandRot); transition: fill .4s; }
.ufo-gruppe.ufo-erfolg .ufo-kuppel { fill: url(#ufoKuppelRot); stroke: #7a1414; transition: fill .4s, stroke .4s; }
.ufo-innen { transform-box: fill-box; transform-origin: center; transition: transform .5s ease, opacity .5s ease; }
/* "In die Schule/Kirche" fliegen: das UFO wird klein und durchsichtig, als
   verschwinde es durch die (gleichzeitig aufschwingende) Tür - siehe
   Tür-Regeln unten und szene-a.js (svgTuer). Bleibt wie bei "vor"/"hinter"
   als Dauerzustand sichtbar, bis die nächste Aufgabe gestartet wird
   (rendereAufgabe setzt über setzeUfoZOrdnung(null, null) zurück). */
.ufo-gruppe.ufo-einflug .ufo-innen { transform: scale(0.18); opacity: 0; }

/* Lichtschein an der ECHTEN Tür von Schule/Kirche (dem Foto, siehe
   szene-a.js svgTuer) - in Ruhe komplett unsichtbar (NICHTS wird dauerhaft
   über das Foto gezeichnet, die echte Tür bleibt immer sichtbar), leuchtet
   nur kurz auf, wenn das UFO richtig hineinfliegt (Klasse "tuer-offen",
   siehe game.js: setzeUfoZOrdnung). */
.tuer-licht { opacity: 0; transition: opacity .35s ease; }
.tuer.tuer-offen .tuer-licht { opacity: .85; }
/* KEIN width/height hier (ein CSS-Pixelwert auf einem VERSCHACHTELTEN
   <svg> wird uneindeutig/zu groß aufgelöst, nicht als Bruchteil der
   Szenenbreite wie gewünscht) - die Größe wird stattdessen in game.js
   direkt als SVG-ATTRIBUT aus UFO_BREITE/UFO_HOEHE gesetzt (eindeutig in
   Einheiten der Szene, siehe zonen-geometrie.js), dieselben Werte, mit
   denen auch die Position berechnet wird. */
.ufo-svg { overflow: visible; }
.ufo-lichter circle { animation: ufoLichtPulsieren 1.4s ease-in-out infinite; }
@keyframes ufoLichtPulsieren { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.hilfe-blinken { fill: #fff59d; stroke: #f5a623; stroke-width: 4; opacity: .7; animation: hilfeBlinken 1s ease-in-out infinite; }
@keyframes hilfeBlinken { 0%, 100% { opacity: .35; } 50% { opacity: .75; } }

.akki-zeigearm { transform-box: fill-box; transform-origin: 70% 50%; }
.akki-zeigearm.zeigt { animation: akkiZeigt .8s ease-in-out infinite; }
@keyframes akkiZeigt { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-12deg); } }
.dati-arm-links, .dati-arm-rechts { transform-box: fill-box; transform-origin: center; }
.dati-arm-links.jubelt, .dati-arm-rechts.jubelt { animation: datiJubelt .5s ease-in-out 2; }
@keyframes datiJubelt { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-8deg); } }

/* ---------------------------------------------------------- Sprechblasen */
.sprechblase {
  display: flex; gap: 12px; align-items: flex-start; max-width: 560px;
  background: var(--karte); border-radius: 16px; padding: 12px 16px;
  box-shadow: 0 3px 10px #00000018; margin: 14px auto;
}
.sprechblase-akki { border: 2px solid var(--akk); }
.sprechblase-dati { border: 2px solid var(--dat); }
.figur-klein { width: 46px; flex-shrink: 0; }
.figur-klein svg { width: 100%; height: auto; }
.blasen-inhalt { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.blasen-text { margin: 0; font-size: clamp(18px, 3.4vw, 22px); line-height: 1.4; }
.vorlesen-knopf { flex-shrink: 0; padding: 6px 10px; font-size: 18px; }

/* Hervorhebung - fett und ca. 130% Schriftgröße (Abschnitt 6.1). Bewusst
   KEIN text-transform (Abschnitt 6.2 - Großbuchstaben würden die
   Groß-/Kleinschreibung der Nomen verschlucken, das ist selbst Lernstoff). */
.hervorhebung { font-weight: 800; font-size: 1.3em; }
.hervorhebung.akk { color: var(--akk); }
.hervorhebung.dat { color: var(--dat); }
.hervorhebung-symbol { font-weight: 800; }

.merkzeile { text-align: center; font-size: 16px; font-weight: 700; margin: 4px 0 10px; }
.merkzeile-teil.akk { color: var(--akk); }
.merkzeile-teil.dat { color: var(--dat); }

.tutorial-hinweis { text-align: center; color: var(--gedaempft); font-size: 14px; margin: 4px 0 0; }

@media (max-width: 640px) {
  .sprechblase { flex-direction: column; align-items: center; text-align: center; }
  .blasen-inhalt { flex-direction: column; }
}

/* ---- Durchlauf 19.11.: Korrekturen (ändern das Aussehen bewusst) ---- */

/* Versteckte Sprechblasen wirklich ausblenden (display:flex oben hat das
   hidden-Attribut überstimmt - es standen leere/alte Blasen da). */
.sprechblase[hidden] { display: none; }

/* Knöpfe mindestens 48 px (Handy-Regel) */
.knopfreihe button, .knopfreihe-klein button, .startzeile button, .hud-rechts button,
body .startzeile .hell-knopf, .vorlesen-knopf { min-height: 48px; min-width: 48px; }
.umschalter { min-height: 48px; }

/* Schalter „🔊 Ton“ - gleiche Gestaltung wie im Artikel-Fresser/Steh auf!:
   mindestens 48 px hoch, Schrift 18 px, aus = Umriss, an = gefüllt. */
button.schalter {
  min-height: 48px; min-width: 48px; padding: 8px 18px; font-size: 18px; font-weight: 700;
  background: var(--karte); color: var(--hell); border: 2px solid var(--hell); border-radius: 12px;
}
button.schalter.aktiv { background: var(--hell); border-color: var(--hell); color: #fff; }
.hud-rechts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---- Spielschirm ohne Scrollen (alle Größen) ----
   Haus- und Feedback-Knopf klein oben links neben der Kopfzeile, Szene
   füllt den freien Platz im Seitenverhältnis 16:9 (Container-Einheiten),
   darunter die Sprechblase (Zeile statt Spalte) und „Weiter“. */
body[data-schirm="spiel"] .oben-leiste { position: absolute; top: 6px; left: 0; right: auto; padding: 0 12px; z-index: 5; }
body[data-schirm="spiel"] .home-knopf { width: 48px; height: 48px; font-size: 24px; border-radius: 14px; }
body[data-schirm="spiel"] .feedback-knopf {
  position: absolute; top: 6px; bottom: auto; left: 68px; right: auto;
  width: 48px; height: 48px; padding: 0; font-size: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
body[data-schirm="spiel"] .feedback-knopf::before { content: "💬"; font-size: 20px; }
body[data-schirm="spiel"] .pwa-knopf { display: none; }
body[data-schirm="spiel"] .feedback-panel { top: 60px; bottom: auto; }

body[data-schirm="spiel"] #spiel.schirm.sichtbar {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; padding: 6px 12px 8px; max-width: 1400px;
}
body[data-schirm="spiel"] .hud { flex: none; padding: 0 0 6px 180px; /* 124 + 56 für den Zurück-Knopf */ min-height: 54px; gap: 6px 12px; }
body[data-schirm="spiel"] .szenen-rahmen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.szene-flaeche { flex: 1 1 auto; min-height: 120px; container-type: size; display: flex; align-items: center; justify-content: center; }
body[data-schirm="spiel"] .szene-flaeche .szene-svg { width: 100%; width: min(100cqw, 100cqh * 16 / 9); height: auto; }
body[data-schirm="spiel"] #spiel .sprechblase {
  flex: none; flex-direction: row; align-items: center; text-align: left;
  margin: 8px auto 0; padding: 8px 12px; width: 100%; max-width: 760px;
}
body[data-schirm="spiel"] #spiel .blasen-inhalt { flex-direction: row; }
body[data-schirm="spiel"] #spiel .figur-klein { width: 40px; }
body[data-schirm="spiel"] #spiel .blasen-text { font-size: clamp(17px, 2.6vw, 22px); line-height: 1.35; }
body[data-schirm="spiel"] .merkzeile { flex: none; margin: 6px 0 0; }
body[data-schirm="spiel"] .tutorial-hinweis { flex: none; }
body[data-schirm="spiel"] #spiel .startzeile { flex: none; margin-top: 8px; }
body[data-schirm="spiel"] #weiterKnopf { padding: 10px 30px; }

/* Schmale Handys: Ton-Schalter und „Ende“ in eine Zeile */
@media (max-width: 380px) {
  body[data-schirm="spiel"] .hud-rechts button.schalter { padding: 6px 10px; font-size: 16px; }
  body[data-schirm="spiel"] .hud-rechts button.flach { padding: 6px 12px; }
}
/* Handy quer / niedrige Bildschirme: Szene links, Kopfzeile, Sprechblase
   und „Weiter“ in einer Spalte rechts. */
@media (orientation: landscape) and (max-height: 560px) {
  body[data-schirm="spiel"] #spiel.schirm.sichtbar {
    --seite: clamp(220px, 36vw, 320px);
    display: block; position: relative; max-width: none;
    padding: 6px 10px 6px calc(100% - var(--seite) - 10px);
  }
  body[data-schirm="spiel"] .szenen-rahmen { display: block; position: static; }
  body[data-schirm="spiel"] .szene-flaeche {
    position: absolute; left: 10px; top: 6px; bottom: 6px; width: calc(100% - var(--seite) - 30px); min-height: 0;
  }
  /* Haus- und Feedback-Knopf oben rechts über der Spalte */
  body[data-schirm="spiel"] .oben-leiste { left: auto; right: 0; padding: 0 10px; }
  body[data-schirm="spiel"] .feedback-knopf { left: auto; right: 122px; } /* links neben 🏠 und Zurück */
  body[data-schirm="spiel"] .hud { padding: 54px 0 4px; min-height: 0; font-size: 14px; row-gap: 4px; } /* oben 54 px: Zeile mit 💬, 🏠 und Zurück darüber */
  body[data-schirm="spiel"] .hud .hud-feld { min-height: 48px; display: inline-flex; align-items: center; gap: 4px; }
  body[data-schirm="spiel"] .hud-rechts { margin-left: 0; width: 100%; justify-content: flex-start; }
  body[data-schirm="spiel"] .hud-rechts button.schalter { padding: 6px 10px; font-size: 16px; }
  body[data-schirm="spiel"] .hud-rechts button.flach { padding: 6px 12px; }
  body[data-schirm="spiel"] #spiel .sprechblase { margin-top: 6px; padding: 6px 8px; gap: 8px; }
  body[data-schirm="spiel"] #spiel .figur-klein { width: 30px; }
  body[data-schirm="spiel"] #spiel .blasen-inhalt { gap: 6px; }
  body[data-schirm="spiel"] #spiel .blasen-text { font-size: 16px; }
  body[data-schirm="spiel"] .merkzeile { font-size: 15px; }
  body[data-schirm="spiel"] .tutorial-hinweis { display: none; }
  body[data-schirm="spiel"] #spiel .startzeile { justify-content: flex-start !important; margin-top: 6px; }
}

/* ---- Vorschau-Schirme „Zuhause“ und „Personen“ ohne Scrollen (20.11.) ----
   Wie der Spielschirm: Haus- und Feedback-Knopf klein oben, Szene füllt den
   freien Platz im Seitenverhältnis, darunter Sprechblase (Zeile), Hinweis und
   Knöpfe. Es ist immer nur EINE Sprechblase sichtbar (Akki oder Dati), beide
   teilen sich denselben Platz. */
body:is([data-schirm="zuhause"], [data-schirm="personen"]) .oben-leiste { position: absolute; top: 6px; left: 0; right: auto; padding: 0 12px; z-index: 5; }
body:is([data-schirm="zuhause"], [data-schirm="personen"]) .home-knopf { width: 48px; height: 48px; font-size: 24px; border-radius: 14px; }
body:is([data-schirm="zuhause"], [data-schirm="personen"]) .feedback-knopf {
  position: absolute; top: 6px; bottom: auto; left: 68px; right: auto;
  width: 48px; height: 48px; padding: 0; font-size: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
body:is([data-schirm="zuhause"], [data-schirm="personen"]) .feedback-knopf::before { content: "💬"; font-size: 20px; }
body:is([data-schirm="zuhause"], [data-schirm="personen"]) .pwa-knopf { display: none; }
body:is([data-schirm="zuhause"], [data-schirm="personen"]) .feedback-panel { top: 60px; bottom: auto; }

:is(#zuhause, #personen).schirm.sichtbar {
  display: grid; height: 100vh; height: 100dvh; padding: 6px 12px 8px; max-width: 1100px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto auto;
  grid-template-areas: "titel" "unter" "szene" "blase" "hinweis" "weiter" "zurueck";
}
:is(#zuhause, #personen) > .kopf { display: contents; }
:is(#zuhause, #personen) .kopf h1 {
  grid-area: titel; margin: 0; padding-left: 180px; /* 124 + 56 für den Zurück-Knopf */ min-height: 54px;
  display: flex; align-items: center; text-align: left; font-size: clamp(20px, 4.2vw, 32px); line-height: 1.2;
}
:is(#zuhause, #personen) .untertitel { grid-area: unter; margin: 4px 0 0; max-width: none; text-align: center; font-size: 15px; }
:is(#zuhause, #personen) > .szenen-rahmen {
  grid-area: szene; min-height: 0; margin-top: 8px;
  container-type: size; display: flex; align-items: center; justify-content: center;
}
#zuhause .szene-svg { width: 100%; width: min(100cqw, (100cqh - 4px) * 800 / 462); height: auto; }
#personen .szene-svg { width: 100%; width: min(100cqw, (100cqh - 4px) * 16 / 9); height: auto; }
:is(#zuhause, #personen) > .sprechblase {
  grid-area: blase; flex-direction: row; align-items: center; text-align: left;
  margin: 8px auto 0; padding: 8px 12px; width: 100%; max-width: 760px;
}
:is(#zuhause, #personen) .blasen-inhalt { flex-direction: row; }
:is(#zuhause, #personen) .figur-klein { width: 40px; }
:is(#zuhause, #personen) .blasen-text { font-size: clamp(17px, 2.6vw, 22px); line-height: 1.35; }
:is(#zuhause, #personen) > .prototyp-hinweis { grid-area: hinweis; margin: 8px 0 0; padding: 6px 10px; }
:is(#zuhause, #personen) > div.startzeile { grid-area: weiter; margin-top: 8px; }
:is(#zuhause, #personen) > div.startzeile button.gross { padding: 10px 18px; font-size: 17px; }
:is(#zuhause, #personen) > p.startzeile { grid-area: zurueck; margin: 4px 0 0; justify-content: center; }

/* Niedrige Handys hoch: Untertitel weglassen (der Hinweis darunter sagt
   dasselbe kurz). */
@media (max-height: 650px) {
  :is(#zuhause, #personen) .untertitel { display: none; }
}
/* Handy quer / niedrige Bildschirme: Szene links, Sprechblase und Knöpfe
   rechts, Haus- und Feedback-Knopf oben rechts. */
@media (orientation: landscape) and (max-height: 560px) {
  :is(#zuhause, #personen).schirm.sichtbar {
    --seite: clamp(220px, 36vw, 320px);
    max-width: none; padding: 6px 10px; column-gap: 12px;
    grid-template-columns: minmax(0, 1fr) var(--seite);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "titel ." "szene blase" "szene weiter" "hinweis zurueck";
  }
  :is(#zuhause, #personen) .untertitel { display: none; }
  :is(#zuhause, #personen) .kopf h1 { padding-left: 0; min-height: 50px; font-size: 22px; }
  :is(#zuhause, #personen) > .szenen-rahmen { margin-top: 4px; }
  :is(#zuhause, #personen) > .sprechblase { align-self: start; margin-top: 4px; padding: 6px 8px; gap: 8px; }
  :is(#zuhause, #personen) .figur-klein { width: 30px; }
  :is(#zuhause, #personen) .blasen-inhalt { gap: 6px; }
  :is(#zuhause, #personen) .blasen-text { font-size: 16px; }
  :is(#zuhause, #personen) > div.startzeile { margin-top: 6px; }
  :is(#zuhause, #personen) > div.startzeile button.gross { width: 100%; padding: 8px 12px; font-size: 16px; }
  :is(#zuhause, #personen) > .prototyp-hinweis { margin-top: 6px; align-self: end; }
  :is(#zuhause, #personen) > p.startzeile { margin-top: 6px; align-self: end; }
  body:is([data-schirm="zuhause"], [data-schirm="personen"]) .oben-leiste { left: auto; right: 0; padding: 0 10px; }
  body:is([data-schirm="zuhause"], [data-schirm="personen"]) .feedback-knopf { left: auto; right: 122px; } /* links neben 🏠 und Zurück */
}

/* ------------------------------------------------------------ Dunkelmodus
   Eigener Dunkelmodus (Muster Tanzroboter, 19.11.): Seiten mit eigenem
   Dunkeldesign werden von Android-Browsern (Samsung Internet, Chrome)
   nicht mehr selbst umgefärbt. Hellmodus bleibt unverändert - alles
   Dunkle steht nur in diesem Block. Die Szene (Fotos) und die
   Sprechblasen bleiben hell, damit Akkis Blau und Datis Rot gleich wirken. */
:root { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0e1d23;
    --karte: #17303a;
    --hell: #e8f3f6;
    --gedaempft: #a7c3cb;
    --rand: #2f5664;
  }
  .home-knopf { box-shadow: 0 2px 8px #00000060; }
  .home-knopf:hover { background: #22424e; }
  button { background: var(--karte); color: var(--hell); box-shadow: 0 1px 2px #00000040; }
  button.aktiv, button.schalter.aktiv { background: #0d6b80; border-color: #7cc9e0; color: #fff; }
  @media (hover: hover) {
    button:hover:not(:disabled) { background: #22424e; border-color: var(--gold); }
    .variante-kachel:hover { background: #22424e; }
    button.gross:hover:not(:disabled) { background: #ff8f8f; }
  }
  button.gross { background: var(--rot); border-color: var(--rot-dunkel); color: #fff; }
  button.flach { background: transparent; }
  button.gefahr { border-color: var(--rot); color: #ff8f85; }
  .variante-kachel { box-shadow: 0 3px 10px #00000060; }
  .start-hinweis { background: #143847; border-color: #3f8fa8; color: var(--hell); }
  .prototyp-hinweis { background: #3a2f12; border-color: #8a6a18; color: #f5e2b0; }
  .umschalter input { color-scheme: light; }

  /* Sprechblasen hell lassen (Hervorhebungsfarben wie im Hellmodus) */
  .sprechblase { background: #fffdf8; color: #003a4d; box-shadow: 0 3px 10px #00000060; }
  .sprechblase .vorlesen-knopf { background: #fff; color: #003a4d; border-color: #cde9ef; }
  @media (hover: hover) { .sprechblase .vorlesen-knopf:hover:not(:disabled) { background: #fbf5e8; border-color: var(--gold); } }
  /* Merkzeile steht auf dunklem Grund: hellere Fassung von Blau/Rot */
  .merkzeile-teil.akk { color: #8cc2ff; }
  .merkzeile-teil.dat { color: #ff9a94; }

  /* Gemeinsame Knöpfe (feedback.css, memo-knopf.css) – nur auf dieser Seite. */
  body .feedback-knopf, body .hell-knopf, body .memo-knopf {
    background: #143847; color: #d8eef4; border-color: #3f8fa8; box-shadow: 0 1px 5px #00000060;
  }
  /* Feedback-Fenster und „Als App installieren“-Fenster bleiben hell. */
  .feedback-panel, .pwa-fenster { color-scheme: light; }
  .feedback-panel textarea { background: #fff; color: #2a231c; }
  .feedback-panel button { background: #fff; color: #2a231c; }
  .feedback-panel .fb-senden { background: #0d2b52; color: #fff; }
  .pwa-fenster button { background: #fdcb52; color: #003a4d; }
  @media (hover: hover) {
    .feedback-panel button:hover:not(:disabled) { background: #f4efe6; border-color: #ddd4c2; }
    .feedback-panel .fb-senden:hover:not(:disabled) { background: #16407a; border-color: #16407a; }
    .pwa-fenster button:hover:not(:disabled) { background: #fedd82; border-color: #e0ac2b; }
  }
}

/* Gemeinsamer Zurück-Knopf (../zurueck.css): Im Spiel und auf den Vorschau-
   Schirmen ist die obere Leiste hier immer kompakt, deshalb nur der Pfeil
   (48 × 48 px, Name per aria-label/title). */
body:is([data-schirm="spiel"], [data-schirm="zuhause"], [data-schirm="personen"]) .oben-leiste button.memo-zurueck { width: 48px; padding: 0; }
body:is([data-schirm="spiel"], [data-schirm="zuhause"], [data-schirm="personen"]) .memo-zurueck .memo-zurueck-text { display: none; }