:root {
  /* Neue Farbpalette (dieselbe Vorgabe wie Portal + Artikel-Fresser):
     Petrol = Struktur, Gold = Highlight, Koralle = CTA/wichtige Aktionen,
     Mint = Erfolg (richtige Antwort), Creme = Hintergrund. */
  --grund: #fffdf8;
  --karte: #ffffff;
  --hell: #003a4d;
  --gedaempft: #4c6b74;
  --rand: #cde9ef;
  --gold: #fdcb52;
  --gold-hell: #fedd82;
  --gold-dunkel: #8a6a18;
  --rot: #ff6b6b;
  --rot-hell: #ff8f8f;
  --rot-dunkel: #d94b4b;
  --gruen: #2ec4b6;
}

* { 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;
}
/* Einheitliche Größe in allen Spielen (vorher unterschiedlich groß je
   nach Spiel, auf Nutzer-Feedback hin jetzt überall gleich), ohne
   Umrandung - der Hintergrund + Schatten reicht als Abgrenzung. */
.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; }
/* Nur in der Testversion sichtbar (game.js, TESTVERSION) */
.test-etikett {
  flex-shrink: 0; align-self: center; margin: 0 8px; padding: 2px 8px; border-radius: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
  background: var(--gold-hell); color: var(--gold-dunkel); border: 1px solid var(--gold);
}
.sprach-auswahl { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sprach-knopf { padding: 5px 12px; font-size: 13px; }
.sprach-knopf.aktiv { background: var(--hell); border-color: var(--hell); color: #fff; font-weight: 700; }

/* ------------------------------------------------------------ Startseite */
.kopf { text-align: center; margin-bottom: 22px; }
.kopf h1 { margin: 8px 0 4px; font-size: clamp(28px, 6vw, 46px); letter-spacing: -0.5px; }
/* Titelzeichen: Kopf des neuen ROBERTO (erzeugt mit tools/kachel-bild.html). Pseudo-Element ohne Text -> wird nicht vorgelesen. */
.kopf h1::before {
  content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .25em; vertical-align: -0.14em;
  background: url("data:image/svg+xml,%3Csvg viewBox='47 -10 106 106' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='titelkopf-schale' x1='0' y1='0' x2='0.35' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23e3edf0'/%3E%3C/linearGradient%3E%3CradialGradient id='titelkopf-glanz' cx='0.35' cy='0.3' r='0.8'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23e3edf0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg%3E%3Cg transform='translate(100 186)'%3E%3Cg transform='translate(0 -96)'%3E%3Cg transform='translate(0 -62)'%3E%3Cpath d='M0 0 v-16' stroke='%230a4152' stroke-width='4' stroke-linecap='round'/%3E%3Ccircle cy='-21' r='11' fill='%23fdcb52' opacity='0.35'/%3E%3Ccircle cy='-21' r='6' fill='%23fdcb52' stroke='%230a4152' stroke-width='1.5'/%3E%3C/g%3E%3Crect x='-51' y='-44' width='12' height='24' rx='5' fill='%230d6b80'/%3E%3Crect x='39' y='-44' width='12' height='24' rx='5' fill='%230d6b80'/%3E%3Crect x='-43' y='-66' width='86' height='66' rx='26' fill='url(%23titelkopf-glanz)' stroke='%230a4152' stroke-width='2'/%3E%3Cg%3E%3Crect x='-34' y='-57' width='68' height='38' rx='16' fill='%230f2f3a'/%3E%3Cg transform='translate(0 -38) translate(0 38)'%3E%3Cg%3E%3Cpath d='M-21 -36 q7 -10 14 0 M7 -36 q7 -10 14 0' stroke='%235ee6d8' stroke-width='4.5' fill='none' stroke-linecap='round'/%3E%3C/g%3E%3C/g%3E%3Cellipse cx='-27' cy='-12' rx='6' ry='3.5' fill='%23ff8f8f' opacity='0.55'/%3E%3Cellipse cx='27' cy='-12' rx='6' ry='3.5' fill='%23ff8f8f' opacity='0.55'/%3E%3Cg%3E%3Cpath d='M-12 -14 h24 a12 11 0 0 1 -24 0 z' fill='%230a4152'/%3E%3Cpath d='M-6 -6 q6 -5 12 0' fill='%23ff8f8f'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.untertitel { margin: 0; color: var(--gedaempft); font-size: 16px; }
.kopf::after {
  content: ""; display: block; height: 3px; width: 160px; margin: 14px auto 0;
  border-radius: 2px; opacity: .85;
  background: linear-gradient(90deg, var(--hell) 0 33.3%, var(--rot) 33.3% 66.6%, var(--gold) 66.6% 100%);
}

.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 (z.B. "Nur aktuelle Stufe") 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) ". "; }
.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;
}

.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; }

button {
  min-height: 48px; min-width: 48px;
  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;
}
/* Hover nur bei Maus/Trackpad – auf dem Handy bliebe der Zustand nach dem
   Antippen hängen (hellgelb, wirkte wie „ausgewählt“). */
@media (hover: hover) {
  button:hover:not(:disabled) { background: #fbf5e8; border-color: var(--gold); }
  /* „Senden“ im Feedback-Fenster (feedback.css) behält beim Überfahren seine
     dunkle Farbe – sonst weiße Schrift auf Creme. */
  .feedback-panel .fb-senden:hover:not(:disabled) { background: #16407a; border-color: #16407a; color: #fff; }
}
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; }
/* Koralle statt Gold: der auslösende Haupt-Knopf ist die "wichtige
   Aktion", Gold bleibt für Highlights (aktive Auswahl etc.) reserviert. */
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: var(--rot-hell); }
button.flach { background: transparent; box-shadow: none; }
button.gefahr { border-color: var(--rot); color: var(--rot); }
button.gefahr:hover:not(:disabled) { background: #fdeef0; }

.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; display: flex; gap: 8px; }
.hud-rechts button { padding: 7px 13px; font-size: 14px; }
/* Schalter „🌐 Übersetzung“ (wie Artikel-Fresser/Münzwurf): an = Petrol */
button.schalter[hidden] { display: none; }
/* Bedeutung des Befehls über den Antworten (nur bei Schalter an) */
.befehl-uebersetzung {
  margin: 0 0 8px; padding: 6px 12px; border-radius: 10px;
  background: #eaf6fa; border: 1px solid #7cc9e0; color: var(--hell);
  font-size: 16px; font-weight: 600; line-height: 1.35;
}
.befehl-uebersetzung[hidden] { display: none; }

/* Die Szene: Spieler links am Tisch, ROBERTO rechts davor. */
.szene {
  position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 6vw;
  height: clamp(260px, 42vh, 380px);
  border-radius: 18px; margin-bottom: 12px; padding: 14px 10px 0;
  background: linear-gradient(180deg, #fdf6e8 0%, #f3ede0 70%, #e3d7bf 100%);
  border: 2px solid var(--rand); overflow: hidden;
}
/* Spielende Person = Bild (figuren.js). Größe (Wunsch 20.11.2026): ROBERTO
   bleibt die Hauptfigur, der Kopf der Person liegt etwa auf Höhe von
   ROBERTOs Bauch/Hüfte – Breite der Person ≈ 0,48 × Breite des
   Roboter-Blocks (gilt für alle Ansichten unten). Das Bild ist fast
   quadratisch (600 × 593). Die Figur bewegt sich nicht. */
.spieler-block { position: relative; flex-shrink: 0; width: clamp(86px, 16.3vw, 154px); }
.szene:has(.roboter-bereich.duo) .spieler-block { width: clamp(64px, 11.5vw, 115px); }
.spieler-bild { position: relative; }
.spieler-foto { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
/* Blume im Glas auf dem Tisch (Lage passend zum Bild, siehe figuren.js) */
.spieler-tischblume { position: absolute; left: 4.055%; top: 48.03%; width: 14.6%; height: 30.79%; overflow: visible; }
/* Die Blume verschwindet, sobald ROBERTO sie nimmt (siehe
   #szene.aktion-blume-nehmen weiter unten); die Vase bleibt stehen. */
.spieler-blume { opacity: 1; transition: opacity .25s .7s; }
/* Sternchen bei „richtig“ */
.spieler-stern { position: absolute; width: 9%; aspect-ratio: 1; opacity: 0; pointer-events: none; }
.spieler-stern svg { display: block; width: 100%; height: 100%; }
.spieler-stern.s1 { left: 9%; top: 6%; }
.spieler-stern.s2 { left: 63%; top: 0; width: 7%; }
.spieler-stern.s3 { left: 66%; top: 26%; width: 6%; }

/* Nur bei „richtig“: die Sternchen neben der Figur funkeln kurz. */
.spieler-bild[data-zustand="freude"] .spieler-stern { animation: sternFunkeln 1.1s ease-out; }
.spieler-bild[data-zustand="freude"] .spieler-stern.s2 { animation-delay: .12s; }
.spieler-bild[data-zustand="freude"] .spieler-stern.s3 { animation-delay: .24s; }
@keyframes sternFunkeln {
  0% { opacity: 0; transform: scale(.3) rotate(0); }
  30% { opacity: 1; transform: scale(1.15) rotate(25deg); }
  70% { opacity: 1; transform: scale(.95) rotate(50deg); }
  100% { opacity: 0; transform: scale(.6) rotate(70deg); }
}
/* „Bewegung reduzieren“: die Sternchen leuchten nur kurz auf */
@media (prefers-reduced-motion: reduce) {
  .spieler-bild[data-zustand="freude"] .spieler-stern { animation: sternLeuchten 1.1s ease-out; }
  @keyframes sternLeuchten { 0%, 100% { opacity: 0; } 25%, 70% { opacity: 1; } }
}
.sprechblase {
  position: absolute; top: -6px; left: 50%; transform: translate(-50%, -100%);
  background: #fff; border: 2px solid var(--rand); border-radius: 12px;
  /* Schrift: mind. 15 px (Handy), 17 px (Tablet/Desktop), 600 statt 700 und
     1.35 Zeilenhöhe – sonst wirkt das „g“ klein und fett wie abgeschnitten.
     Die Breite begrenzt game.js (platziereBlase) auf den Platz in der Szene. */
  padding: 8px 14px; font-size: 17px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 2px 6px #00000018; max-width: 46vw; white-space: normal; text-align: center;
  width: max-content; /* sonst bricht der Satz auf der Breite des Spieler-Blocks um */
  z-index: 5; /* immer vor ROBERTO/ROBERTA, falls sie sich überschneiden */
}
.sprechblase::after {
  content: ""; position: absolute; bottom: -8px; left: var(--spitze, 50%); transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: #fff;
}
/* Falscher Satz: rot und durchgestrichen. */
.sprechblase.falsch {
  border-color: var(--rot); color: var(--rot-dunkel);
  text-decoration: line-through; text-decoration-thickness: 2px;
}

/* Umhüllt einen (Modus "du"/"sie") oder zwei (Modus "ihr": ROBERTO UND
   ROBERTA) Roboter-Blöcke nebeneinander. */
.roboter-bereich { display: flex; align-items: flex-end; gap: 3vw; }
.roboter-bereich.duo .roboter-block { width: clamp(126px, 24vw, 240px); }

.roboter-block { position: relative; flex-shrink: 0; width: clamp(180px, 34vw, 320px); }
.roboter-svg { width: 100%; height: auto; display: block; overflow: visible; }

/* --------------------------------------------------------- ROBERTO */
/* Bewegung: animator.js setzt transform/opacity der Gelenke per JS. Hier
   nur Leerlauf (Wippen, Antenne, Display), Schleifen der Requisiten
   (Dampf, Noten, Tropfen ...) und Einmal-Effekte (Klatschen, Pling).
   Alles nur über transform und opacity. */

.roboter-svg .r-wippen { transform-box: view-box; }
.roboter-svg.leerlauf .r-wippen { animation: wippen 2.6s ease-in-out infinite; }
@keyframes wippen { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }

.roboter-svg .loop-antenne { animation: antenneLeuchten 1.8s ease-in-out infinite; }
@keyframes antenneLeuchten { 0%, 100% { opacity: .15; } 50% { opacity: .6; } }
.roboter-svg .loop-puls { animation: displayPuls 1.6s ease-in-out infinite; }
@keyframes displayPuls { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.roboter-svg .loop-versatz-1 { animation-delay: -.45s !important; }
.roboter-svg .loop-versatz-2 { animation-delay: -.9s !important; }

/* Schleifen laufen nur, solange die Requisite sichtbar ist (.an). */
.req.an .loop-dampf { animation: dampf 1.4s ease-in-out infinite; }
@keyframes dampf { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-12px); } }
.req.an .loop-gluehen { animation: gluehen 1.2s ease-in-out infinite; }
@keyframes gluehen { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.req.an .loop-flackern { animation: flackern .9s ease-in-out infinite; }
@keyframes flackern { 0%, 100% { opacity: .75; } 40% { opacity: 1; } 70% { opacity: .85; } }
.req.an .loop-flamme { transform-box: fill-box; transform-origin: 50% 100%; animation: flamme .5s ease-in-out infinite alternate; }
@keyframes flamme { from { transform: scale(1, 1); } to { transform: scale(.8, 1.2); } }
.req.an .loop-note { animation: note 1.6s ease-in-out infinite; }
@keyframes note { 0% { opacity: 0; transform: translateY(8px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }
.req.an .loop-zzz { animation: zzz 1.8s ease-in-out infinite; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -14px); } }
.req.an .loop-tropfen { animation: tropfen .8s ease-in infinite; }
@keyframes tropfen { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(46px); } }
.req.an .loop-wasserstrahl { animation: gluehen .5s ease-in-out infinite; }
.req.an .loop-blase { transform-box: fill-box; transform-origin: center; animation: blase 1.2s ease-in-out infinite; }
@keyframes blase { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-10px) scale(1.1); } }
.req.an .loop-schweben { animation: schweben 1.2s ease-in-out infinite; }
@keyframes schweben { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.req.an .loop-rad { animation: rad .6s linear infinite; }
@keyframes rad { to { transform: rotate(360deg); } }
/* Vorderrad von vorn: Profilstollen laufen über die Reifenmitte nach unten. */
.req.an .loop-reifen { animation: reifen .45s linear infinite; }
.roboter-svg .req.an .loop-reifen.loop-versatz-1 { animation-delay: -.15s !important; }
.roboter-svg .req.an .loop-reifen.loop-versatz-2 { animation-delay: -.3s !important; }
@keyframes reifen { 0% { opacity: 0; transform: translateY(-19px); } 15%, 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(19px); } }

/* Schrittweise gemalte/geschriebene Requisiten: Teil für Teil sichtbar. */
.req.schrittweise .teil { opacity: 0; }
.req.schrittweise.an .teil { transform-box: fill-box; transform-origin: center; animation: teilZeigen .25s ease-out forwards; }
.req.schrittweise.an .teil:nth-child(2) { animation-delay: .25s; }
.req.schrittweise.an .teil:nth-child(3) { animation-delay: .5s; }
.req.schrittweise.an .teil:nth-child(4) { animation-delay: .75s; }
.req.schrittweise.an .teil:nth-child(5) { animation-delay: 1s; }
@keyframes teilZeigen { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
.roboter-svg.standbild .req.schrittweise .teil { animation: none; opacity: 1; }

/* Einmal-Effekte */
.fx { opacity: 0; }
.fx.los { transform-box: fill-box; transform-origin: center; animation: fxPlopp .45s ease-out forwards; }
@keyframes fxPlopp { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }

/* Ruhigere Fassung bei "Bewegung reduzieren": keine Schleifen, kein Wippen. */
@media (prefers-reduced-motion: reduce) {
  .roboter-svg *, .roboter-svg.leerlauf .r-wippen { animation: none !important; }
  .req.schrittweise .teil { opacity: 1; }
  .spieler-blume { transition: none; }
}

#szene.aktion-blume-nehmen .spieler-blume { opacity: 0; }

.satz-optionen { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 18px; }
.satz-optionen button {
  text-align: left; padding: 14px 18px; font-size: clamp(15px, 3.4vw, 18px); font-weight: 700;
  border-radius: 14px;
}
/* Antwortknöpfe: alle Zustände ohne Transparenz, Kontrast ≥ 4,5 : 1 (WCAG AA),
   auch im Sonnenlicht lesbar. Gesperrte Knöpfe werden nicht blass, sondern
   bekommen eine gedämpfte, aber klar lesbare Schrift. */
.satz-optionen button:disabled { opacity: 1; cursor: default; background: #f4f2ee; border-color: #d9d4ca; color: #3f5560; }
.satz-optionen button.richtig, .satz-optionen button.richtig:disabled { border-color: #1f9e92; background: #e3f7f4; color: #003a4d; opacity: 1; }
.satz-optionen button.falsch, .satz-optionen button.falsch:disabled {
  border-color: var(--rot); background: #fde8ea; color: #8c1d24; opacity: 1;
  animation: schuetteln .35s ease-in-out;
}
@keyframes schuetteln {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.meldungszeile { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 40px; }
.meldung {
  text-align: center; font-size: 18px; font-weight: 700;
  opacity: 0; transition: opacity .15s;
}
.meldung.zeigen { opacity: 1; }
/* Kontrast ≥ 4,5 : 1 auf dem Creme-Hintergrund (vorher Grün 4,4, Koralle 2,7) */
.meldung.gut { color: #17702c; }
.meldung.schlecht { color: #b42318; }
#weiterKnopf { font-weight: 700; }

.bereich {
  background: var(--karte); border: 2px solid var(--rand); border-radius: 16px;
  padding: 18px 22px 22px; margin-top: 10px;
}
.bereich h2 {
  font-size: 14px; text-transform: uppercase; letter-spacing: 1.3px;
  color: var(--gedaempft); margin: 0 0 10px;
}
.geloeste-saetze { display: flex; flex-direction: column; gap: 4px; }
.geloester-satz {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 4px; border-bottom: 1px solid var(--rand); font-size: 15px;
}
.geloester-satz:last-child { border-bottom: none; }
.geloester-satz-nummer { color: var(--gedaempft); font-size: 14px; font-weight: 700; flex-shrink: 0; }

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

.ergebnis { font-size: 17px; line-height: 1.7; }
.ergebnis .zahl { font-size: 40px; font-weight: 800; color: var(--gold); }

.wackelig-titel { font-weight: 700; margin: 16px 0 6px; }
.wackelig-liste { margin: 0; padding-left: 20px; color: var(--gedaempft); }

@media (max-width: 560px) {
  .szene { gap: 4vw; padding: 10px 6px 0; }
  .spieler-block { width: 86px; }
  /* ihr-Modus (zwei Roboter): Person passend zu den kleineren Robotern */
  .szene:has(.roboter-bereich.duo) { gap: 0; }
  .szene:has(.roboter-bereich.duo) .spieler-block { width: clamp(56px, 9vw, 74px); }
  .roboter-bereich { gap: 1.5vw; }
  .roboter-bereich.duo .roboter-block { width: clamp(98px, 18vw, 154px); }
  .bereich { padding: 14px 14px 18px; }
}

/* Kompakte Kopfzeile im Spiel: schmale Handys (Hochformat) UND niedrige
   Bildschirme im Querformat (Höhe bis 500 px). */
@media (max-width: 560px), (max-height: 500px) and (orientation: landscape) {
  /* ---- Handy im Hochformat, während des Spiels: alles ohne Scrollen ----
     Szene, Sprechblase und alle Antwortknöpfe sollen bei 375 × 740 px auf
     einen Bildschirm passen. Dafür: kompaktere Kopfzeile, Sprachauswahl als
     ein Knopf, Feedback-Knopf oben statt unten, niedrigere Szene. */
  #sprachAuswahl { --sprach-einklappen: 1; }
  body[data-schirm="spiel"] .oben-leiste { padding: 6px 12px 0; align-items: flex-start; }
  body[data-schirm="spiel"] .home-knopf { width: 48px; height: 48px; font-size: 24px; border-radius: 14px; }
  body[data-schirm="spiel"] #spiel.schirm { padding-top: 6px; padding-bottom: 14px; }

  /* Sprachauswahl: nur der aktive Knopf, mit Weltkugel */
  body[data-schirm="spiel"] #sprachAuswahl { flex-wrap: nowrap; }
  body[data-schirm="spiel"] #sprachAuswahl .sprach-knopf { min-height: 48px; }
  body[data-schirm="spiel"] #sprachAuswahl .sprach-knopf:not(.aktiv) { display: none; }
  body[data-schirm="spiel"] #sprachAuswahl .sprach-knopf.aktiv::before { content: "🌐 "; }
  /* aufgeklappt: alle Sprachen als Feld über dem Spiel */
  body[data-schirm="spiel"] #sprachAuswahl.offen {
    position: absolute; top: 6px; right: 12px; z-index: 9999;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    width: calc(100vw - 24px); padding: 8px; background: #fff;
    border: 2px solid var(--rand); border-radius: 16px; box-shadow: 0 6px 20px #00000030;
  }
  body[data-schirm="spiel"] #sprachAuswahl.offen .sprach-knopf { display: block; padding: 4px 6px; }
  body[data-schirm="spiel"] #sprachAuswahl.offen .sprach-knopf.aktiv::before { content: "🌐 "; }

  /* Feedback-Knopf: im Spiel klein in die Kopfzeile (neben dem Haus-Knopf),
     damit er unten nie einen Antwortknopf verdeckt. */
  body[data-schirm="spiel"] .feedback-knopf {
    position: absolute; /* scrollt mit der Kopfzeile weg, liegt nie über den Antworten */
    top: 12px; 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: 19px; }
  /* „Als App installieren“ (pwa.js) sitzt neben dem Haus-Knopf - genau unter
     dem kleinen Feedback-Knopf. Im Spiel ausblenden (Startseite: sichtbar). */
  body[data-schirm="spiel"] .pwa-knopf { display: none; }
  /* Feedback-Fenster im Spiel: oben unter der Kopfzeile statt unten */
  body[data-schirm="spiel"] .feedback-panel { top: 60px; bottom: auto; }

  body[data-schirm="spiel"] .hud { padding: 2px 4px 6px; gap: 10px; font-size: 14px; }
  body[data-schirm="spiel"] .hud b { font-size: 17px; }
  body[data-schirm="spiel"] .hud-rechts button { min-height: 48px; padding: 4px 12px; }
}

@media (max-width: 560px) {
  body[data-schirm="spiel"] .szene { height: clamp(190px, 29vh, 260px); margin-bottom: 8px; }
  /* Sprechblase linksbündig über dem Spieler, bricht lange Sätze in 2–3 Zeilen
     um und ragt nicht aus der Szene (die Spitze zeigt auf den Spieler). */
  body[data-schirm="spiel"] .sprechblase { transform: translateY(-100%); max-width: calc(100vw - 48px); font-size: 15px; padding: 6px 11px; left: -4px; }
  body[data-schirm="spiel"] .sprechblase::after { left: var(--spitze, 36px); }
  body[data-schirm="spiel"] .befehl-uebersetzung { font-size: 15px; padding: 4px 10px; margin: 0 0 6px; }
  body[data-schirm="spiel"] .satz-optionen { gap: 8px; margin: 2px 0 8px; }
  body[data-schirm="spiel"] .satz-optionen button { padding: 10px 14px; font-size: 15px; min-height: 48px; }
  body[data-schirm="spiel"] .meldungszeile, body[data-schirm="spiel"] .meldung { min-height: 28px; font-size: 16px; }
}

/* Niedrige Handys (Höhe bis 600 px): Hinweiszeile unten ausblenden, damit
   Szene, Antworten und Meldung ohne Scrollen sichtbar bleiben. */
@media (max-height: 600px) {
  body[data-schirm="spiel"] .fusszeile { display: none; }
}
/* Übersetzungszeile an (Schalter „🌐 Übersetzung“) auf niedrigen Handys im
   Hochformat: Kopfzeile ist dann zweizeilig – Szene etwas flacher, damit
   Antworten und Meldung ohne Scrollen sichtbar bleiben. */
/* Tablet/Laptop mit wenig Höhe: Szene flacher, solange die Zeile da ist –
   sonst rutscht der unterste Antwortknopf unter den Feedback-Knopf. */
@media (min-width: 561px) and (min-height: 501px) and (max-height: 820px) {
  body.ueb-zeile[data-schirm="spiel"] .szene { height: clamp(220px, 36vh, 340px); }
}
@media (max-width: 560px) and (max-height: 600px) and (orientation: portrait) {
  body.ueb-zeile[data-schirm="spiel"] .szene { height: 172px; }
  body.ueb-zeile[data-schirm="spiel"] .roboter-bereich:not(.duo) .roboter-block { width: 138px; }
  body.ueb-zeile[data-schirm="spiel"] .szene:not(:has(.roboter-bereich.duo)) .spieler-block { width: 66px; }
}

/* Sehr schmale Handys (z. B. 320 px): etwas höhere Szene und kleinerer
   ROBERTO, damit über ihm Platz für eine zweizeilige Sprechblase bleibt,
   ohne sein Gesicht zu verdecken. */
@media (max-width: 360px), (max-width: 560px) and (max-height: 700px) and (orientation: portrait) {
  body[data-schirm="spiel"] .szene { height: clamp(205px, 34vh, 260px); }
  body[data-schirm="spiel"] .roboter-bereich:not(.duo) .roboter-block { width: 150px; }
  body[data-schirm="spiel"] .szene:not(:has(.roboter-bereich.duo)) .spieler-block { width: 72px; }
}

/* ---- Handy/Tablet im Querformat (Höhe bis 500 px), während des Spiels ----
   Szene links über die volle Höhe, rechts daneben Fortschritt und Antworten:
   Szene, Sprechblase, ganzer ROBERTO und alle Antworten ohne Scrollen
   (740 × 375, 667 × 375 usw.). Die Kopfzeile ist dort schon kompakt. */
@media (max-height: 500px) and (orientation: landscape) {
  body[data-schirm="spiel"] #spiel.sichtbar {
    display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    grid-template-areas: "szene hud" "szene ue" "szene opt" "szene meld" "gel gel" "fuss fuss";
    grid-template-rows: auto auto auto auto auto auto;
    column-gap: 12px; align-content: start; padding: 4px 12px 10px;
  }
  body[data-schirm="spiel"] .hud { grid-area: hud; padding: 0 2px 4px; }
  body[data-schirm="spiel"] .szene {
    grid-area: szene; align-self: start; margin: 0;
    height: calc(100vh - 72px); min-height: 220px; max-height: 340px; padding: 8px 6px 0; gap: 2vw;
  }
  body[data-schirm="spiel"] .befehl-uebersetzung { grid-area: ue; align-self: start; margin: 0 0 6px; font-size: 15px; padding: 4px 10px; }
  body[data-schirm="spiel"] .satz-optionen { grid-area: opt; gap: 6px; margin: 0 0 4px; }
  body[data-schirm="spiel"] .satz-optionen button { padding: 8px 12px; font-size: 15px; min-height: 48px; }
  body[data-schirm="spiel"] .meldung { grid-area: meld; min-height: 24px; font-size: 15px; }
  body[data-schirm="spiel"] #geloesteBereich { grid-area: gel; }
  body[data-schirm="spiel"] .fusszeile { grid-area: fuss; font-size: 13px; margin-top: 8px; }
  /* Figuren nach der Höhe der Szene bemessen (das SVG ist quadratisch) */
  body[data-schirm="spiel"] .spieler-block,
  body[data-schirm="spiel"] .szene:has(.roboter-bereich.duo) .spieler-block { width: clamp(58px, 30vh, 110px); }
  /* ROBERTO allein: sein SVG hat seitlich viel Luft – etwas näher an den Tisch,
     damit Person und ROBERTO ganz in die Szene passen (667/740 × 375) */
  body[data-schirm="spiel"] .roboter-bereich:not(.duo) .roboter-block { margin-left: calc(-0.2 * clamp(120px, 62vh, 230px)); }
  body[data-schirm="spiel"] .roboter-block { width: clamp(120px, 62vh, 230px); }
  /* ihr-Modus: beide Roboter so groß wie ROBERTO allein. Das SVG hat links
     und rechts viel Luft (für Requisiten), daher dürfen sich die Blöcke
     überlappen; ROBERTA steht etwas hinter ROBERTO. */
  body[data-schirm="spiel"] .roboter-bereich.duo .roboter-block { width: clamp(120px, 62vh, 230px); }
  body[data-schirm="spiel"] .roboter-bereich.duo .roboter-block + .roboter-block { margin-left: calc(-0.44 * clamp(120px, 62vh, 230px)); }
  body[data-schirm="spiel"] .roboter-bereich.duo .roboter-block:first-child { margin-left: calc(-0.16 * clamp(120px, 62vh, 230px)); position: relative; z-index: 1; }
  body[data-schirm="spiel"] .roboter-bereich { gap: 0; }
  body[data-schirm="spiel"] .sprechblase { left: 0; transform: translateY(-100%); max-width: 50vw; font-size: 15px; padding: 5px 10px; }
  body[data-schirm="spiel"] .sprechblase::after { left: var(--spitze, 30px); }
}

/* ------------------------------------------------------------ Dunkelmodus
   Eigener, gestalteter Dunkelmodus (Auftrag 19.11.2026): Mit „only light“
   färbte Samsung Internet die Seite trotzdem selbst um – Ergebnis: fast
   schwarz, ROBERTO kaum sichtbar. Seiten, die selbst „light dark“ anbieten,
   werden von Chrome/Samsung nicht mehr umgefärbt. Gleiche Farbwelt (Petrol,
   Gold, Koralle, Mint), Texte mit Kontrast ≥ 4,5 : 1. Die Szene bleibt eine
   mittelhelle „Abendbühne“, damit der weiße ROBERTO und dunkle Requisiten
   (Pfanne, Reifen …) gut sichtbar bleiben. Die Roboter-SVGs färben sich
   nicht um (feste Farben in roboter-svg.js). */
:root { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0e1d23;
    --karte: #17303a;
    --hell: #e8f3f6;      /* Haupttext (im Hellmodus: Petrol) */
    --gedaempft: #a7c3cb;
    --rand: #2f5664;
    --gold-hell: #5a4613;
    --gold-dunkel: #fedd82;
    --petrol-knopf: #0d6b80; /* aktive Auswahl: Petrol mit weißer Schrift */
  }
  .home-knopf:hover { background: #22424e; }
  .sprach-knopf.aktiv, button.aktiv { background: var(--petrol-knopf); border-color: #7cc9e0; color: #fff; }
  button { background: var(--karte); color: var(--hell); box-shadow: 0 1px 2px #00000040; }
  @media (hover: hover) {
    button:hover:not(:disabled) { background: #22424e; border-color: var(--gold); }
  }
  button.gross { background: var(--rot); border-color: var(--rot-dunkel); color: #fff; }
  button.gross:hover:not(:disabled) { background: var(--rot-hell); }
  button.flach { background: transparent; }
  button.gefahr { border-color: var(--rot); color: var(--rot-hell); }
  button.gefahr:hover:not(:disabled) { background: #3a1f24; }
  .start-hinweis, .befehl-uebersetzung { background: #143847; border-color: #3f8fa8; color: var(--hell); }

  /* Szene: Abendbühne in Petrol mit hellem Lichtkegel, Boden warm. Hell
     genug, dass auch der dunkelgraue HERR ROBO und dunkle Requisiten
     sichtbar bleiben. */
  .szene {
    background:
      radial-gradient(ellipse 70% 80% at 65% 55%, #6d97a2 0%, #6d97a200 70%),
      linear-gradient(180deg, #3d6875 0%, #4a6c73 62%, #6e6852 100%);
    border-color: var(--rand);
  }
  /* Sprechblase bleibt hell (gut lesbar, hebt sich von der Bühne ab) */
  .sprechblase { background: #fffdf8; color: #003a4d; border-color: #7cc9e0; box-shadow: 0 2px 8px #00000050; }
  .sprechblase::after { border-top-color: #fffdf8; }
  .sprechblase.falsch { border-color: var(--rot); color: #b42318; }

  .satz-optionen button:disabled { background: #142830; border-color: #2a4652; color: #b9cdd3; }
  .satz-optionen button.richtig, .satz-optionen button.richtig:disabled { border-color: #2ec4b6; background: #0f3f3a; color: #d9fbf6; }
  .satz-optionen button.falsch, .satz-optionen button.falsch:disabled { border-color: var(--rot); background: #4a1d23; color: #ffd9dc; }
  .meldung.gut { color: #6ee08f; }
  .meldung.schlecht { color: #ff8f85; }

  /* Sprachauswahl aufgeklappt (Handy, im Spiel) */
  body[data-schirm="spiel"] #sprachAuswahl.offen { background: var(--karte); box-shadow: 0 6px 20px #00000080; }

  /* Gemeinsame Knöpfe (feedback.css, memo-knopf.css) – nur auf dieser Seite.
     „body“ davor, weil die gemeinsamen Dateien nach style.css geladen werden. */
  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;
     Eingabefeld und Knöpfe darin ausdrücklich hell, damit nichts
     dunkle Systemfarben oder die hellen Seitentexte erbt. */
  .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) {
    /* sonst greift die dunkle Hover-Farbe der Spielknöpfe auch in den hellen Fenstern */
    .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; }
  }
}
