:root {
  /* Neue Farbpalette (dieselbe Vorgabe wie Portal + Artikel-Fresser):
     Petrol = Struktur, Gold = Highlight, Koralle = CTA/wichtige Aktionen,
     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; }
.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(26px, 6vw, 44px); letter-spacing: -0.5px; }
.kopf h1::before { content: "🎲 "; }
.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) ". "; }

/* Schalter "Nur Verben genau dieser Stufe" (Spezifikation 5.6). */
.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; }

.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 {
  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; }
/* Koralle statt Gold: der auslösende Haupt-Knopf ist die "wichtige
   Aktion", Gold bleibt für Highlights (aktive Auswahl, Karten-Rückseite
   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; }
.hell-knopf {
  display: inline-block; background: #fff; color: var(--hell);
  border: 2px solid var(--rand); border-radius: 12px; padding: 10px 16px;
  font-size: 15px; text-decoration: none; box-shadow: 0 1px 2px #00000010;
}
.hell-knopf:hover { background: #fbf5e8; border-color: var(--gold); }

.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-rechts { margin-left: auto; display: flex; gap: 8px; }
.hud-rechts button { min-height: 48px; padding: 7px 16px; font-size: 15px; }
/* Zeigt die aktuelle Rundenart (Präsens/Modal/Perfekt/Modal im
   Präteritum) - damit vorher klar ist, welche Karten gleich kommen
   (Spezifikation Abschnitt 2: "ein kleines Etikett zeigt die Rundenart"). */
.rundenart-anzeige {
  background: var(--gold); color: #2a1d00; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
}

/* --------------------------------------------------- Spielautomat-Rahmen -
   Casino-Spielautomat ("einarmiger Bandit", Nutzerwunsch mit Foto):
   rot-goldenes Gehäuse, Lauflichter, Krone mit Sternen, Hebel rechts,
   großer roter Knopf unten. Gehäuse und Fenster sind CSS (siehe
   index.html) - die Walzen stehen im normalen Fluss des Fensters, das
   Fenster passt sich der Walzenzahl (2-5) und der Bildschirmbreite an.
   Damit ist das frühere Problem "Karten sitzen nicht im gezeichneten
   Fenster" grundsätzlich ausgeschlossen (keine gekoppelten Prozentwerte
   mehr nötig). */
.spielautomat-rahmen {
  width: min(100%, 940px); margin: 6px auto 18px;
  /* Platz rechts für den Hebel, der neben dem Gehäuse steht */
  padding-right: clamp(34px, 7vw, 66px);
}
.automat { position: relative; }
.automat-krone { display: block; width: 100%; height: auto; margin-bottom: -2px; }
.automat-gehaeuse {
  position: relative;
  padding: clamp(18px, 3.4vw, 34px);
  border-radius: 22px;
  background:
    linear-gradient(180deg, #ffffff30 0%, #ffffff00 28%),
    linear-gradient(180deg, #ef3b36 0%, #c4161c 55%, #8e0d12 100%);
  border: clamp(5px, 1vw, 9px) solid #e8b52e;
  box-shadow:
    inset 0 0 0 3px #fff1b8,
    inset 0 -10px 18px #00000040,
    0 10px 24px #00000040;
}
/* Lauflichter rund ums Fenster: zwei Lagen Glühbirnen, um eine halbe
   Birne versetzt, blinken abwechselnd. Reine Deko (aria-hidden). */
.automat-lichter {
  --birne: radial-gradient(circle, #ffffff 0 14%, #fff2a8 30%, #f2a900 48%, transparent 54%);
  --abstand: clamp(18px, 3vw, 30px);
  position: absolute; inset: clamp(3px, .8vw, 8px); pointer-events: none;
  background: var(--birne) 0 0 / var(--abstand) var(--abstand) repeat-x,
              var(--birne) 0 100% / var(--abstand) var(--abstand) repeat-x,
              var(--birne) 0 0 / var(--abstand) var(--abstand) repeat-y,
              var(--birne) 100% 0 / var(--abstand) var(--abstand) repeat-y;
  animation: lichter-blinken 1.2s steps(1) infinite;
}
.automat-lichter-versetzt {
  background-position: calc(var(--abstand) / 2) 0, calc(var(--abstand) / 2) 100%, 0 calc(var(--abstand) / 2), 100% calc(var(--abstand) / 2);
  animation-delay: -.6s;
}
@keyframes lichter-blinken { 0% { opacity: 1; } 50% { opacity: .25; } }

.automat-fenster {
  position: relative; z-index: 1;
  padding: clamp(8px, 1.6vw, 14px);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe58a, #e0a526 50%, #a8700c);
  box-shadow: 0 0 0 3px #7a4a00, 0 4px 10px #00000055;
}
/* Dunkle Vertiefung, in der die Walzen sitzen */
.karten-reihe {
  display: flex; flex-wrap: wrap; gap: clamp(6px, 1.2vw, 12px); justify-content: center; align-items: flex-end;
  padding: clamp(8px, 1.4vw, 14px);
  border-radius: 10px;
  background: linear-gradient(180deg, #1c0606, #3a0b0b 50%, #1c0606);
  box-shadow: inset 0 4px 12px #000000aa;
  min-height: clamp(96px, 16vw, 150px);
}
.stapelbereich { flex: 1 1 0; min-width: 0; max-width: 190px; text-align: center; }
.stapelbereich h3 {
  margin: 0 0 4px; font-size: clamp(9px, 1.4vw, 12px); font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: #ffd45e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Eine Walze: weißer Zylinder mit Schattierung oben/unten. */
.stapel {
  position: relative; display: block; width: 100%;
  height: clamp(64px, 10.5vw, 104px);
  padding: 0; border: 3px solid #b8860b; border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: inset 0 0 0 2px #fff6d6;
}
.stapel::after {
  /* Wölbung der Walze */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 7px;
  background: linear-gradient(180deg, #00000055 0%, #00000000 26%, #00000000 74%, #00000055 100%);
}
.stapel:hover:not(:disabled) { background: #fff; border-color: #ffcc33; }
/* Die nächste Walze, die dran ist, leuchtet golden. */
.stapel:not(:disabled):not(.aufgedeckt) { animation: walze-dran 1.1s ease-in-out infinite; }
@keyframes walze-dran { 50% { box-shadow: inset 0 0 0 2px #fff6d6, 0 0 0 4px #ffd45e, 0 0 16px #ffd45e; } }
/* Noch nicht dran: blickdicht abgedunkelt (KEIN opacity - sonst schimmert
   der Hintergrund durch, früheres Nutzer-Feedback). */
.stapel:disabled { cursor: default; opacity: 1; } /* sonst greift "button:disabled { opacity: .45 }" */
.stapel:disabled:not(.aufgedeckt) { filter: grayscale(40%) brightness(.78); }

.stapel-innen {
  /* <span> im <button>: ohne display:block wirken width/height nicht */
  display: block;
  position: relative; width: 100%; height: 100%;
}
.stapel-seite {
  position: absolute; left: 0; right: 0; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 4px 6px; text-align: center; color: #2a1d00;
}
.stapel-rueckseite { top: 0; font-size: clamp(26px, 5vw, 44px); font-weight: 900; color: #c4161c; }
/* "haben / sein ?" ist viel länger als "?" - eigene, kleinere Schrift. */
.stapel-rueckseite-lang { font-size: clamp(11px, 2.2vw, 17px); line-height: 1.15; color: #8e0d12; }
.stapel-vorderseite { top: 100%; }
.karten-wort { display: block; width: 100%;
  font-size: clamp(14px, 2.6vw, 24px); font-weight: 800; line-height: 1.15;
  overflow-wrap: normal; word-break: normal; hyphens: manual; /* nie mitten im Wort trennen */
}
/* Aufdecken = Walze dreht kurz nach oben weiter und rastet auf dem Wort
   ein (ca. 0,5 s, abbremsend mit kleinem Nachfedern). Bewusst KEIN
   Durchrattern zufälliger Wörter - das war früher zu unruhig. */
.stapel.aufgedeckt .stapel-innen { transform: translateY(-100%); }
.stapel.dreht .stapel-innen { animation: walze-drehen .5s cubic-bezier(.2, .7, .3, 1); }
@keyframes walze-drehen {
  0%   { transform: translateY(0); filter: blur(0); }
  25%  { filter: blur(2px); }
  80%  { transform: translateY(-106%); filter: blur(0); }
  100% { transform: translateY(-100%); }
}

/* Hebel rechts neben dem Gehäuse */
.automat-hebel {
  position: absolute; top: 4%; height: 70%;
  right: calc(-1 * clamp(34px, 7vw, 66px));
  width: clamp(34px, 7vw, 66px);
  padding: 0; border: none; background: none; box-shadow: none; border-radius: 0;
}
.automat-hebel:hover:not(:disabled) { background: none; }
.automat-hebel:focus-visible, .automat-knopf:focus-visible { outline: 3px solid #003a4d; outline-offset: 3px; }
.hebel-lager {
  position: absolute; left: 0; bottom: 0; width: 60%; height: clamp(16px, 3vw, 26px);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #fff4c2, #ffcc33 45%, #b8860b);
  box-shadow: 0 2px 4px #00000055;
}
.hebel-arm {
  position: absolute; left: 34%; bottom: calc(clamp(16px, 3vw, 26px) / 2); top: 0;
  width: 36%; transform-origin: 50% 100%;
}
.hebel-stange {
  position: absolute; left: 30%; width: 40%; top: 18%; bottom: 0; border-radius: 6px;
  background: linear-gradient(90deg, #b8860b, #fff4c2 40%, #ffcc33 60%, #8a5a00);
}
.hebel-kugel {
  position: absolute; z-index: 1; left: 50%; top: 0; transform: translateX(-50%);
  width: clamp(26px, 5vw, 46px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 10%, #ff6b6b 26%, #c4161c 62%, #6e0a0e 100%);
  box-shadow: 0 3px 6px #00000066;
}
.automat-hebel.gezogen .hebel-arm { animation: hebel-ziehen .45s ease-in-out; }
@keyframes hebel-ziehen {
  0% { transform: scaleY(1); }
  45% { transform: scaleY(-.55); }
  100% { transform: scaleY(1); }
}

/* Sockel mit großem roten Knopf */
.automat-sockel {
  display: flex; justify-content: center; align-items: center;
  margin: -6px 4% 0; padding: clamp(10px, 1.8vw, 16px) 0;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, #a8100f, #6e0a0e);
  border: clamp(4px, .8vw, 7px) solid #e8b52e; border-top: none;
  box-shadow: 0 8px 18px #00000040;
}
/* Großer roter Knopf mit Text „Nächstes Wort“ (Feedback A6: das frühere
   leere Knöpfchen wurde nicht als Weiter-Knopf erkannt). Weiße Schrift auf
   dunklem Rot (Kontrast ≥ 4,5:1). */
.automat-sockel { position: relative; flex-direction: column; gap: 8px 12px; }
.automat-knopf {
  min-height: 52px; min-width: 48px; padding: 8px 26px;
  border-radius: 999px; border: 4px solid #e8b52e;
  background: linear-gradient(180deg, #e0302a 0%, #c4161c 50%, #8e0d12 100%);
  color: #fff; font-size: 19px; font-weight: 800; line-height: 1.2; white-space: nowrap;
  text-shadow: 0 1px 2px #00000080;
  box-shadow: 0 6px 0 #5a0709, 0 8px 12px #00000066;
  transition: transform .08s, box-shadow .08s;
}
.automat-knopf:hover:not(:disabled) { background: linear-gradient(180deg, #e8332d 0%, #cf1a20 50%, #8e0d12 100%); border-color: #ffcc33; }
.automat-knopf:active:not(:disabled), .automat-knopf.gedrueckt { transform: translateY(5px); box-shadow: 0 1px 0 #5a0709, 0 2px 4px #00000066; }
.automat-knopf:disabled { opacity: .5; }
/* Bei der ersten Frage jeder Runde pulsiert der Knopf, bis er gedrückt wird. */
.automat-knopf.pulsiert { animation: knopf-puls 1s ease-in-out infinite; }
@keyframes knopf-puls {
  50% { transform: scale(1.07); box-shadow: 0 6px 0 #5a0709, 0 0 0 6px #ffd45e, 0 0 22px #ffd45e; }
}
/* Hinweis mit Pfeil nach oben auf den Knopf (Handy quer: daneben, Pfeil
   nach links - siehe unten). */
.dreh-hinweis {
  position: relative; flex-basis: 100%; max-width: 340px; margin: 6px 12px 0;
  padding: 8px 14px; border-radius: 12px; border: 3px solid var(--gold);
  background: #fff; color: var(--hell); font-size: 16px; font-weight: 700;
  line-height: 1.3; text-align: center; box-shadow: 0 3px 8px #00000040;
}
.dreh-hinweis::before {
  content: ""; position: absolute; left: 50%; top: -13px; transform: translateX(-50%);
  border: 10px solid transparent; border-top: 0; border-bottom-color: var(--gold);
}
.dreh-hinweis[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .automat-lichter, .stapel:not(:disabled):not(.aufgedeckt) { animation: none; }
  .stapel.dreht .stapel-innen, .automat-hebel.gezogen .hebel-arm { animation: none; }
  .automat-knopf.pulsiert { animation: none; box-shadow: 0 6px 0 #5a0709, 0 0 0 6px #ffd45e; }
}

.loesung-text {
  text-align: center; margin: 10px 0 0; font-size: 17px; font-weight: 700;
  color: var(--hell); background: #eaf6fa; border: 1px solid #7cc9e0;
  border-radius: 10px; padding: 10px 14px; display: inline-block;
}
#loesungText[hidden] { display: none; }

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

.ergebnis { font-size: 17px; line-height: 1.7; text-align: center; }

/* Handy: höchstens drei Walzen pro Zeile, bei 4-5 Walzen zweizeilig -
   das Fenster wächst einfach mit. */
@media (max-width: 560px) {
  .karten-reihe { flex-wrap: wrap; align-items: stretch; }
  .stapelbereich { flex: 1 1 28%; max-width: 32%; }
}
/* Walzen-Überschrift darf zweizeilig werden statt „MODALV…“; die Walzen
   selbst bleiben unten bündig. */
.stapelbereich { display: flex; flex-direction: column; justify-content: flex-end; }
@media (max-width: 420px), (max-height: 500px) and (orientation: landscape) {
  .stapelbereich h3 { text-transform: none; letter-spacing: 0; font-size: 11px; line-height: 1.1;
    white-space: normal; overflow-wrap: normal; word-break: normal; }
  .automat-gehaeuse { padding: 10px; }
  .automat-fenster { padding: 6px; }
  .karten-reihe { padding: 6px; gap: 5px; }
  .stapel { height: 58px; }
  .stapel-seite { padding: 4px 2px; }
  .automat-knopf { font-size: 18px; padding: 6px 20px; }
  .dreh-hinweis { font-size: 15px; margin: 4px 8px 0; padding: 6px 10px; }
  #spiel .startzeile { gap: 8px; }
  #spiel .startzeile button.gross { padding: 10px 16px; font-size: 16px; }
  #spiel .startzeile button.flach { padding: 10px 12px; }
  .loesung-text { font-size: 16px; padding: 8px 10px; }
}

/* Tablet quer / Laptop mit wenig Höhe (z. B. 1024 × 768): Automat etwas
   flacher, damit Lösung und Knöpfe ohne Scrollen darunter passen. */
@media (min-width: 561px) and (max-height: 860px) and (orientation: landscape) {
  body[data-schirm="spiel"] .automat-krone { width: 78%; margin: 0 auto -2px; }
  body[data-schirm="spiel"] .automat-gehaeuse { padding: 18px; }
  body[data-schirm="spiel"] .stapel { height: clamp(64px, 9vh, 84px); }
  body[data-schirm="spiel"] .karten-reihe { min-height: 0; }
  body[data-schirm="spiel"] .spielautomat-rahmen { margin-bottom: 10px; }
  body[data-schirm="spiel"] .startzeile { margin-top: 10px; }
  body[data-schirm="spiel"] .fusszeile { margin-top: 10px; }
}

/* ---- Kompakte Kopfzeile im Spiel (wie Tanzroboter): schmale Handys im
   Hochformat UND niedrige Bildschirme im Querformat (Höhe bis 500 px).
   Sprachauswahl als ein Knopf „🌐 Deutsch“, Feedback-Knopf klein oben. */
@media (max-width: 560px), (max-height: 500px) and (orientation: landscape) {
  #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; }
  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: "🌐 "; }
  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: min(calc(100vw - 24px), 420px); 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"] .feedback-knopf {
    position: absolute; top: 10px; bottom: auto; left: 70px; 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; }
  /* Freiraum für den Feedback-Knopf unten (feedback.js) ist im Spiel nicht
     nötig - der Knopf sitzt hier oben. */
  body[data-schirm="spiel"] .feedback-freiraum { display: none !important; }
  body[data-schirm="spiel"] .feedback-panel { top: 60px; bottom: auto; }
  body[data-schirm="spiel"] .hud { padding: 2px 4px 6px; gap: 8px 10px; font-size: 15px; }
  body[data-schirm="spiel"] .hud-rechts button { min-height: 48px; padding: 4px 14px; font-size: 15px; }
  body[data-schirm="spiel"] .spielautomat-rahmen { margin-top: 0; margin-bottom: 10px; }
  body[data-schirm="spiel"] .startzeile { margin-top: 12px; }
  body[data-schirm="spiel"] .startzeile button { min-height: 48px; }
  body[data-schirm="spiel"] .fusszeile { margin-top: 10px; }
}
/* Niedrige Handys im Hochformat (z. B. 320 × 568): ohne Krone und
   Fußzeile, damit Automat, Knöpfe und Lösung ohne Scrollen passen. */
@media (max-width: 560px) and (max-height: 700px) and (orientation: portrait) {
  body[data-schirm="spiel"] .automat-krone { display: none; }
  body[data-schirm="spiel"] .fusszeile { display: none; }
  body[data-schirm="spiel"] .automat-gehaeuse { border-top-left-radius: 22px; }
  body[data-schirm="spiel"] .stapel { height: 50px; }
  body[data-schirm="spiel"] .karten-reihe { row-gap: 4px; }
  body[data-schirm="spiel"] .stapelbereich h3 { margin-bottom: 2px; }
  /* Alle Karten offen: der Knopf hat nichts mehr zu tun und macht Platz für die Lösung. */
  body[data-schirm="spiel"] .automat-knopf:disabled { display: none; }
}

/* ---- Handy/Tablet im Querformat (Höhe bis 500 px), während des Spiels:
   Automat links, rechts daneben Fortschritt, Knöpfe und Lösung - alles
   ohne Scrollen (740 × 375, 667 × 375). */
@media (max-height: 500px) and (orientation: landscape) {
  body[data-schirm="spiel"] #spiel.sichtbar {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 200px);
    grid-template-areas: "automat hud" "automat knoepfe" "automat loesung";
    grid-template-rows: auto auto 1fr; column-gap: 16px; align-items: start;
  }
  body[data-schirm="spiel"] .hud { grid-area: hud; }
  body[data-schirm="spiel"] .spielautomat-rahmen { grid-area: automat; width: 100%; margin: 0; }
  body[data-schirm="spiel"] #spiel .startzeile { grid-area: knoepfe; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 4px; }
  body[data-schirm="spiel"] #loesungText { grid-area: loesung; margin-top: 8px; font-size: 15px; padding: 6px 10px; }
  body[data-schirm="spiel"] .fusszeile { display: none; }
  body[data-schirm="spiel"] .automat-krone { display: none; }
  body[data-schirm="spiel"] .automat-gehaeuse { padding: 8px; }
  body[data-schirm="spiel"] .automat-fenster { padding: 6px; }
  body[data-schirm="spiel"] .karten-reihe { padding: 6px; min-height: 0; row-gap: 4px; }
  body[data-schirm="spiel"] .stapel { height: 56px; }
  body[data-schirm="spiel"] .stapel-seite { padding: 3px; }
  body[data-schirm="spiel"] .automat-sockel { padding: 6px 0; flex-direction: row; }
  body[data-schirm="spiel"] .automat-knopf { flex-shrink: 0; min-height: 48px; font-size: 17px; padding: 6px 18px; }
  body[data-schirm="spiel"] .dreh-hinweis { flex: 0 1 190px; min-width: 0; margin: 0; font-size: 15px; padding: 6px 10px; }
  body[data-schirm="spiel"] .dreh-hinweis::before {
    left: -13px; top: 50%; transform: translateY(-50%);
    border: 10px solid transparent; border-left: 0; border-right-color: var(--gold);
  }
}

/* Hinweis „Du musst nicht jede Frage beantworten.“ (Entscheidung 11f):
   Startseite unter dem Untertitel, im Spiel unter der Spielregel –
   klein und gedämpft, auf allen Bildschirmgrößen sichtbar. */
.antwort-hinweis { margin: 8px 0 0; color: var(--gedaempft); font-size: 15px; font-style: italic; text-align: center; }
.antwort-hinweis::before { content: "ℹ\FE0E  "; font-style: normal; }
.antwort-hinweis[dir="rtl"] { font-style: normal; } /* arabische Schrift nicht kursiv neigen */
#spiel .antwort-hinweis-spiel { margin-top: 6px; }
@media (max-width: 560px) and (max-height: 700px) and (orientation: portrait) {
  body[data-schirm="spiel"] .antwort-hinweis-spiel { margin-top: 2px; }
}
/* Handy hoch: sobald die Lösung steht, macht die Spielregel-Zeile Platz,
   damit der Hinweis auch bei 5 Walzen + zweizeiliger Lösung ohne Scrollen passt. */
@media (max-width: 560px) and (orientation: portrait) {
  body[data-schirm="spiel"] #spiel:has(#loesungText:not([hidden])) .fusszeile { display: none; }
}
@media (max-height: 500px) and (orientation: landscape) {
  body[data-schirm="spiel"] #spiel.sichtbar {
    grid-template-areas: "automat hud" "automat knoepfe" "automat loesung" "automat hinweis";
    grid-template-rows: auto auto 1fr auto;
  }
  body[data-schirm="spiel"] .antwort-hinweis-spiel { grid-area: hinweis; margin: 6px 0 0; text-align: start; }
}
/* Eigener Dunkelmodus (Muster Tanzroboter): Browser färben die Seite dann
   nicht selbst um (Samsung Internet ignoriert „only light“). */
:root { color-scheme: light dark; }

/* -------------------------------------------------------------- Dunkelmodus ---
   Petrol-Farbwelt wie im Tanzroboter. Nur innerhalb dieses Blocks - der
   Hellmodus bleibt unverändert. Der Spielautomat (Rot/Gold, weiße Walzen)
   bleibt wie er ist und leuchtet auf dem dunklen Grund. Hover-Regeln bewusst
   ohne (hover: hover): auf Handys bleibt :hover nach dem Tippen hängen, die
   helle Hover-Farbe käme sonst unter heller Schrift zum Vorschein. */
@media (prefers-color-scheme: dark) {
  :root { --grund: #0e1d23; --karte: #17303a; --hell: #e8f3f6; --gedaempft: #a7c3cb; --rand: #2f5664; }
  button { background: var(--karte); color: var(--hell); }
  button.aktiv, .sprach-knopf.aktiv { background: #0d6b80; border-color: #7cc9e0; color: #fff; }
  button.gefahr { border-color: var(--rot); color: #ff8f85; }
  .home-knopf { box-shadow: 0 2px 8px #00000080; }
  button:hover:not(:disabled), .home-knopf:hover { background: #22424e; border-color: var(--gold); }
  button.flach:hover:not(:disabled) { background: #22424e; }
  button.gross:hover:not(:disabled) { background: var(--rot-hell); }
  button.gefahr:hover:not(:disabled) { background: #4a1d23; }
  .umschalter input { accent-color: #7cc9e0; }
  .start-hinweis, .loesung-text { background: #143847; border-color: #3f8fa8; color: var(--hell); }
  body[data-schirm="spiel"] #sprachAuswahl.offen { background: var(--karte); box-shadow: 0 6px 20px #00000080; }
  /* Spielautomat: Schatten kräftiger und ein warmer Schein, damit er sich
     vom dunklen Grund abhebt; Walzen, Hebel und Knopf unverändert. */
  .automat-gehaeuse { box-shadow: inset 0 0 0 3px #fff1b8, inset 0 -10px 18px #00000040, 0 10px 24px #00000080, 0 0 36px #e8b52e33; }
  .automat-hebel:focus-visible, .automat-knopf:focus-visible { outline-color: #7cc9e0; }
  /* Hinweis-Sprechblase bleibt hell (wie die Sprechblase im Tanzroboter). */
  .dreh-hinweis { background: #fffdf8; color: #003a4d; }
  body .feedback-knopf, body .hell-knopf, body .memo-knopf { background: #143847; color: #d8eef4; border-color: #3f8fa8; }
  body .hell-knopf:hover { background: #22424e; border-color: var(--gold); }
  .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; }
  .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; }
}
