/* Arcade-Rahmen für alle Aktivitäten (EyePlayground/kern/LAYOUT.md): DM Sans, Ziele >= 120 x 96,
   untere Leiste mit „Zurück“ unten links, Nachtblau mit Glasknöpfen. Die Werte kommen aus
   arcade-tokens.css (bauen.py zieht sie aus EyePlayground/kern/spiel.css). Die Startseite bleibt hell. */
:root, button, input, select, textarea { font-family: var(--schrift, "DM Sans", system-ui, sans-serif); }
/* Gemeinsamer Baustein „Stube“ (Review 19.11.2026, Design W1/F1): EIN Knopf, EIN Kopf, EINE Schrift.
   Werte hier, Anwendung in einheit.css (wird zuletzt geladen und zieht alle Aktivitäten darauf).
   Der alte Arcade-Akzent #ffc83d ergab mit Nachtblau eine Olivfüllung; Christmas nutzt Gold #e0a84a. */
:root {
  --akzent: #e0a84a; --akzent-dunkel: #a8500e;
  --xm-nacht: #0c1d38; --xm-nacht-hell: #1d3357; --xm-gold: #e0a84a; --xm-vanille: #fff9e9; --xm-holz: #4a3224;
  --xm-knopf-grund: var(--xm-nacht); --xm-knopf-rand: 2px solid var(--xm-gold); --xm-knopf-text: var(--xm-vanille);
  --xm-knopf-schatten: 0 5px 0 #050d1f99, 0 10px 22px #050d1f55;
  --xm-gewaehlt-grund: var(--xm-nacht-hell); --xm-gewaehlt-rand: 4px solid var(--xm-gold);
  --xm-kopf-grund: #0c1d38d9; --xm-kopf-rand: 1px solid #e0a84a8c; --xm-radius: 18px;
}
button.knopf { border-radius: var(--r-gross, 22px); }

/* ------------------------------------------------------------------ Aussehen der Aktivitäten */
/* Info und Unterstützen bleiben hell (Review 19.11.2026, B1): sonst stand dunkler Text auf Nachtblau. */
body:not(:has(.weihnachtskopf, .blatt-seite)):not(.bf-cvi) { background: var(--grund, #0b1a2a); color: var(--text, #fbf7ee); }
#app:not(:has(.weihnachtskopf)) h1 { font-size: var(--s-titel, 32px); line-height: 1.1; }
body:not(:has(.weihnachtskopf)):not(.bf-cvi) button.knopf {
  border: 3px solid var(--rand, #ffffff40); color: var(--text, #fbf7ee); box-shadow: var(--schatten, 0 5px 0 #0009);
  background: linear-gradient(180deg, #ffffff0d, #ffffff00 45%), var(--flaeche-glas, #0b1622d8);
}
body:not(:has(.weihnachtskopf)):not(.bf-cvi) button.knopf:hover { border-color: var(--akzent, #e0a84a); outline: none; }
body:not(:has(.weihnachtskopf)):not(.bf-cvi) button.knopf:focus-visible { border-color: var(--akzent, #e0a84a); outline: 3px solid var(--text, #fff); outline-offset: 2px; }
body:not(:has(.weihnachtskopf)):not(.bf-cvi) button.knopf[aria-pressed="true"] {
  border-color: var(--akzent, #e0a84a); background: color-mix(in srgb, var(--akzent, #e0a84a) 30%, var(--flaeche, #0b1622));
}
body:not(:has(.weihnachtskopf)):not(.bf-cvi) button.knopf:disabled { opacity: .55; box-shadow: none; }

/* ------------------------------------------------------------------ Untere Leiste, Zielgrößen
   Ab 451 px Höhe. Sehr niedrige Bildschirme (Handy quer) behalten die bisherige, kompakte Anordnung. */
@media (min-height: 451px) {
  button.knopf { min-width: var(--knopf-b, 120px); min-height: var(--knopf-min-h, 96px); }
  :is(.fuss:has(> [data-action="zurueck"]), .fuss:has(> [data-akt="zurueck"]), .fuss:has(> [data-musik-zurueck]),
      .band-aktionen, .backen-aktionen, .schnee-fuss, .glockenspiel-fuss, .xylophon-fuss, .malen-fuss, .stopptanz-fuss, .papier-aktionen, .karten-aktionen) {
    position: fixed; z-index: 6; left: var(--links, 10px); right: var(--rechts, 10px); bottom: var(--unten, 10px);
    display: flex; flex-wrap: nowrap; align-items: stretch; gap: var(--luecke, 8px); margin: 0; pointer-events: none;
  }
  :is(.fuss:has(> [data-action="zurueck"]), .fuss:has(> [data-akt="zurueck"]), .fuss:has(> [data-musik-zurueck]),
      .band-aktionen, .backen-aktionen, .schnee-fuss, .glockenspiel-fuss, .xylophon-fuss, .malen-fuss, .stopptanz-fuss, .papier-aktionen, .karten-aktionen) > * {
    pointer-events: auto; min-height: var(--zurueck-h, 112px); flex: 0 1 auto;
  }
  :is([data-action="zurueck"], [data-akt="zurueck"], [data-musik-zurueck], [data-karte="aktion"][data-wert="zurueck"], [data-malen="zurueck"],
      [data-backen="zurueck"], [data-papier="aktion"][data-wert="zurueck"], [data-wald="zurueck"], [data-stopptanz="zurueck"], [data-flug="zurueck"],
      [data-band="zurueck"], [data-schnee="zurueck"], [data-glockenspiel="zurueck"], [data-xylophon="zurueck"]).knopf {
    order: -1; flex: none; min-width: var(--zurueck-b, 220px); min-height: var(--zurueck-h, 112px);
  }
  /* Der Inhalt hält die Leiste frei. Wald, Flug und Festspiele haben ihre eigene Bühne mit Leiste. */
  #app:not(:has(.weihnachtskopf, .wald, .flug, .festspiel)) {
    padding-top: var(--oben, 10px);
    padding-bottom: calc(var(--zurueck-h, 112px) + var(--unten, 10px) + var(--luecke, 8px) * 2);
  }
  .wald-steuerung .knopf, .flug-aktionen .knopf { min-height: var(--knopf-min-h, 96px); }
  .wald-steuerung [data-wald="zurueck"], .flug-aktionen [data-flug="zurueck"] { flex: 0 0 var(--zurueck-b, 220px); }
  .flug-weltziel { min-width: var(--knopf-b, 120px); min-height: var(--knopf-min-h, 96px); }
}
/* Niedrige Fenster (Grid-Browser 1024 x 600): der Einleitungssatz weicht, die Bühne bleibt groß. */
@media (min-height: 451px) and (max-height: 650px) { .wald > p:not(.wald-status), .flug > p:not(.flug-status) { display: none; } .wald, .flug { grid-template-rows: auto minmax(240px, 1fr) auto auto; } }

/* Schmale Bildschirme (Handy hoch): die Leiste bricht um, „Zurück“ bleibt unten links. */
@media (min-height: 451px) and (max-width: 560px) {
  :is(.fuss:has(> [data-action="zurueck"]), .fuss:has(> [data-akt="zurueck"]), .fuss:has(> [data-musik-zurueck]),
      .band-aktionen, .backen-aktionen, .schnee-fuss, .glockenspiel-fuss, .xylophon-fuss, .malen-fuss, .stopptanz-fuss, .papier-aktionen, .karten-aktionen) { flex-wrap: wrap; }
  :is(.fuss:has(> [data-action="zurueck"]), .fuss:has(> [data-akt="zurueck"]), .fuss:has(> [data-musik-zurueck]),
      .band-aktionen, .backen-aktionen, .schnee-fuss, .glockenspiel-fuss, .xylophon-fuss, .malen-fuss, .stopptanz-fuss, .papier-aktionen, .karten-aktionen) > * { flex: 1 1 var(--knopf-b, 120px); min-height: var(--knopf-min-h, 96px); }
  :is([data-action="zurueck"], [data-akt="zurueck"], [data-musik-zurueck], [data-karte="aktion"][data-wert="zurueck"], [data-malen="zurueck"],
      [data-backen="zurueck"], [data-papier="aktion"][data-wert="zurueck"], [data-stopptanz="zurueck"],
      [data-band="zurueck"], [data-schnee="zurueck"], [data-glockenspiel="zurueck"], [data-xylophon="zurueck"]).knopf { order: 99; flex: 0 0 176px; min-width: 176px; min-height: var(--knopf-min-h, 96px); margin-inline-end: auto; }
  #app:not(:has(.weihnachtskopf, .wald, .flug, .festspiel)) { padding-bottom: calc(var(--knopf-min-h, 96px) * 2 + var(--unten, 10px) + var(--luecke, 8px) * 3); }
  .wald-steuerung [data-wald="zurueck"], .flug-aktionen [data-flug="zurueck"] { flex: 1 1 var(--knopf-b, 120px); }
}

/* ------------------------------------------------------------------ Startseite ohne Scrollen
   Kopf und Kacheln teilen sich die Höhe, Blättern und Werkzeuge bleiben in Zielgröße. */
@media (min-height: 451px) {
  #app:has(.weihnachtskopf) { box-sizing: border-box; height: 100dvh; display: grid; grid-template-rows: minmax(64px, .8fr) minmax(0, 2fr) auto auto; gap: var(--luecke, 8px);
    padding: var(--oben, 10px) var(--rechts, 10px) var(--unten, 10px) var(--links, 10px); }
  #app:has(.weihnachtskopf) .weihnachtskopf { min-height: 0; max-height: 220px; display: flex; align-items: center; padding-block: 6px; }
  #app:has(.weihnachtskopf) .weihnachtskopf h1 { font-size: clamp(1.8rem, 3vw + 3vh, 4.5rem); }
  #app:has(.weihnachtskopf) .start-kacheln { margin: 0; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
  #app:has(.weihnachtskopf) button.start-kachel { min-height: 0; overflow: hidden; }
  #app:has(.weihnachtskopf) .start-zeichen { height: auto; flex: 1 1 0; min-height: 0; }
  #app:has(.weihnachtskopf) .start-text { flex: 0 0 auto; min-height: 44px; padding-block: 6px; }
  #app:has(.weihnachtskopf) .fuss { margin: 0; }
  #app:has(.weihnachtskopf) .fuss .knopf { min-height: var(--knopf-min-h, 96px); }
  #app:has(.weihnachtskopf) .start-werkzeuge { padding-top: var(--luecke, 8px); flex-wrap: nowrap; }
  #app .start-werkzeuge .knopf { flex: 1 1 0; min-width: var(--knopf-b, 120px); }
}
@media (min-height: 451px) and (max-height: 650px) { #app:has(.weihnachtskopf) .weihnachtskopf p { display: none; } }
@media (min-height: 451px) and (max-width: 560px) {
  #app:has(.weihnachtskopf) { grid-template-rows: minmax(56px, .5fr) minmax(0, 2fr) auto auto; }
  #app:has(.weihnachtskopf) .start-werkzeuge { flex-wrap: wrap; }
  #app .start-werkzeuge .knopf { flex: 1 1 40%; }
  #app:has(.weihnachtskopf) .weihnachtskopf p { display: none; }
}
