/* Wandas Wort-Maschine - Stylesheet
 * Kinderfreundlich (8-12), farbenfroh, touch-tauglich (Buttons >= 48px),
 * keine externen Fonts (system-ui-Stack, CSP: font-src 'self').
 * Farben pro Station über CSS-Variablen (--farbe-*).
 */

:root {
  --lila: #8a4ec0;      --lila-hell: #e8d5f7;
  --rot: #d95763;       --rot-hell: #ffd7da;
  --orange: #e8871e;    --orange-hell: #ffe4c2;
  --gruen: #3a9e5c;     --gruen-hell: #c8f0d6;
  --blau: #3a7ea5;      --blau-hell: #c9e4f2;
  --gelb: #d9b23a;      --gelb-hell: #fff3c2;
  --tinte: #3a2a1a;
  --papier: #fdf9f0;
  --karte: #fff;
  --rand: 3px solid var(--tinte);
  --schatten: 4px 4px 0 rgba(58, 42, 26, 0.25);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--tinte);
  background:
    radial-gradient(circle at 10% 20%, var(--lila-hell) 0, transparent 20%),
    radial-gradient(circle at 90% 80%, var(--gelb-hell) 0, transparent 25%),
    radial-gradient(circle at 80% 10%, var(--blau-hell) 0, transparent 18%),
    var(--papier);
  min-height: 100vh;
  background-attachment: fixed;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--tinte); color: #fff; padding: 8px 16px; z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* --- Kopfzeile ------------------------------------------------------------ */
.kopf {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--lila); color: #fff;
  box-shadow: var(--schatten);
  position: sticky; top: 0; z-index: 10;
  flex-wrap: wrap;
}
.kopf .wanda-mini { width: 44px; height: 44px; flex-shrink: 0; }
.kopf .titel {
  font-size: 1.3rem; font-weight: 800; letter-spacing: 0.5px;
  text-decoration: none; color: #fff; margin-right: auto;
}
.kopf .titel:focus-visible, .sprach-knopf:focus-visible, button:focus-visible,
a:focus-visible, input:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 3px solid var(--gelb); outline-offset: 2px;
}
.sprach-knopf {
  font-size: 1rem; font-weight: 700;
  background: #fff; color: var(--lila);
  border: var(--rand); border-radius: 999px;
  min-height: 48px; min-width: 48px; padding: 6px 18px;
  cursor: pointer; box-shadow: var(--schatten);
  transition: transform 0.1s;
}
.sprach-knopf:hover { transform: scale(1.05); }
.sprach-knopf:active { transform: scale(0.97); }

/* --- Layout ---------------------------------------------------------------- */
main { max-width: 900px; margin: 0 auto; padding: 20px 16px 60px; }

.intro {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background: var(--karte); border: var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 20px; margin: 24px 0;
}
.intro .wanda-gross { flex-shrink: 0; }
.intro h1 { font-size: 1.6rem; margin: 0 0 8px; }
.intro p { margin: 0; font-size: 1.1rem; }

/* --- Stations-Karte (Startseite) ------------------------------------------ */
.karte-titel { text-align: center; font-size: 1.5rem; margin: 30px 0 6px; }
.karte-intro { text-align: center; max-width: 620px; margin: 0 auto 24px; font-size: 1.1rem; }

.karte {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-bottom: 30px;
}
.kart-1 .karte { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto 30px; }
.kart-2 .karte { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.stations-karte {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--karte); border: var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 16px;
  text-decoration: none; color: var(--tinte);
  position: relative; overflow: hidden;
  transition: transform 0.12s;
}
.stations-karte:hover { transform: translateY(-4px) rotate(-0.5deg); }
.stations-karte:active { transform: scale(0.98); }
.stations-karte .nummern-kreis {
  position: absolute; top: -6px; right: 10px;
  font-size: 2.6rem; font-weight: 900; opacity: 0.14;
}
.stations-karte .icon { font-size: 2.2rem; }
.stations-karte .st-nr {
  font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--lila);
}
.stations-karte .st-titel { font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.stations-karte .st-these { font-size: 0.92rem; font-style: italic; opacity: 0.8; }
.stations-karte .badge {
  align-self: flex-start; margin-top: 4px;
  background: var(--gruen); color: #fff; font-size: 0.78rem; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
}
.stations-karte.f-rot    { background: var(--rot-hell); }
.stations-karte.f-orange { background: var(--orange-hell); }
.stations-karte.f-gruen  { background: var(--gruen-hell); }
.stations-karte.f-blau   { background: var(--blau-hell); }
.stations-karte.f-gelb   { background: var(--gelb-hell); }
.stations-karte.f-lila   { background: var(--lila-hell); }

/* --- Stationseite ---------------------------------------------------------- */
.station-kopf {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 20px 0 12px;
}
.station-kopf .icon { font-size: 3rem; }
.station-kopf .st-nr {
  font-size: 0.85rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--lila);
}
.station-kopf h1 { font-size: 1.55rem; margin: 4px 0 0; }

.f-rot    { --farbe: var(--rot);    --farbe-hell: var(--rot-hell); }
.f-orange { --farbe: var(--orange); --farbe-hell: var(--orange-hell); }
.f-gruen  { --farbe: var(--gruen);  --farbe-hell: var(--gruen-hell); }
.f-blau   { --farbe: var(--blau);   --farbe-hell: var(--blau-hell); }
.f-gelb   { --farbe: var(--gelb);   --farbe-hell: var(--gelb-hell); }
.f-lila   { --farbe: var(--lila);   --farbe-hell: var(--lila-hell); }

.these-kasten {
  background: var(--farbe-hell, var(--lila-hell));
  border: var(--rand); border-left: 10px solid var(--farbe, var(--lila));
  border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 14px 18px; margin: 18px 0;
  font-size: 1.12rem; font-weight: 600;
}
.these-kasten .these-label {
  display: block; font-size: 0.78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--farbe, var(--lila)); margin-bottom: 4px;
}

.station-text {
  background: var(--karte); border: var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 20px 22px; margin: 18px 0;
  font-size: 1.08rem;
}
.station-text p { margin: 0 0 12px; }
.station-text p:last-child { margin-bottom: 0; }

.wichtig-kasten {
  background: var(--gelb-hell); border: 3px dashed var(--gelb);
  border-radius: var(--radius); padding: 14px 18px; margin: 18px 0;
}
.wichtig-kasten .wichtig-label {
  font-weight: 900; color: var(--orange); font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 1px;
}
.wichtig-kasten ul { margin: 8px 0 0; padding-left: 22px; }
.wichtig-kasten li { margin: 4px 0; }

.frag-kasten {
  background: var(--blau-hell); border: 3px dotted var(--blau);
  border-radius: var(--radius); padding: 14px 18px; margin: 18px 0;
  font-style: italic;
}
.frag-kasten .frag-label {
  font-style: normal; font-weight: 900; color: var(--blau);
  font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px;
  display: block; margin-bottom: 4px;
}

/* --- Experimente ------------------------------------------------------------ */
.experiment {
  background: var(--gruen-hell); border: var(--rand); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 18px 20px; margin: 24px 0;
}
.experiment .exp-label {
  display: inline-block; background: var(--gruen); color: #fff;
  font-weight: 900; font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 1.5px; padding: 4px 14px; border-radius: 999px;
  margin-bottom: 10px;
}
.experiment h2 { font-size: 1.3rem; margin: 0 0 8px; }
.experiment .anleitung { font-size: 1.02rem; margin: 0 0 14px; }

.experiment form, .exp-bereich form { display: flex; flex-direction: column; gap: 10px; }
.experiment input[type=text], .exp-bereich input[type=text] {
  font-size: 1.05rem; font-family: inherit; color: var(--tinte);
  border: var(--rand); border-radius: 12px; padding: 12px 14px;
  background: #fff; min-height: 48px;
}
.experiment button, .exp-bereich button, .chat-feld button {
  font-size: 1.05rem; font-weight: 800; font-family: inherit;
  background: var(--gruen); color: #fff; border: var(--rand);
  border-radius: 999px; padding: 12px 24px; min-height: 48px;
  cursor: pointer; box-shadow: var(--schatten);
  transition: transform 0.1s; align-self: flex-start;
}
.experiment button:hover, .exp-bereich button:hover, .chat-feld button:hover { transform: scale(1.04); }
.experiment button:disabled { opacity: 0.6; cursor: wait; transform: none; }
.experiment button.neben { background: #fff; color: var(--gruen); }

.antwort-kasten {
  background: #fff; border: 3px solid var(--gruen); border-radius: 12px;
  padding: 12px 16px; margin-top: 12px; font-size: 1.05rem;
}
.antwort-kasten .wanda-zeile { display: flex; gap: 10px; align-items: flex-start; }
.antwort-kasten .wanda-zeile .wanda-mini { width: 40px; height: 40px; flex-shrink: 0; margin-top: 2px; }
.antwort-kasten .wanda-zeile .wer {
  font-weight: 900; color: var(--lila); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 1px; display: block;
}

.exp-fehler { color: var(--rot); font-weight: 700; }
.exp-laeuft { opacity: 0.7; font-style: italic; }

/* E1 Detektiv */
.e1-behalf { background: #fff; border: var(--rand); border-radius: 12px; padding: 14px; margin-top: 10px; }
.e1-satz { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; }
.e1-knöpfe { display: flex; gap: 10px; flex-wrap: wrap; }
.e1-knöpfe button { background: var(--blau); }
.e1-knöpfe button.falsch { background: var(--rot); }
.e1-stand { font-weight: 900; color: var(--lila); margin-top: 10px; }
.e1-erklaerung { margin-top: 8px; font-style: italic; }

/* E2 Temperatur */
.e2-regler { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.e2-regler button { background: #fff; color: var(--tinte); }
.e2-regler button.aktiv { background: var(--orange); color: #fff; }
.e2-vergleich { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .e2-vergleich { grid-template-columns: 1fr 1fr; } }
.e2-feld { border: var(--rand); border-radius: 12px; padding: 12px; background: #fff; }
.e2-feld.eis { border-color: var(--blau); background: var(--blau-hell); }
.e2-feld.feuer { border-color: var(--rot); background: var(--rot-hell); }
.e2-feld .e2-label { font-weight: 900; display: block; margin-bottom: 6px; }

/* E3 Ja-Sager */
.e3-vergleich { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .e3-vergleich { grid-template-columns: 1fr 1fr; } }
.e3-feld { border: var(--rand); border-radius: 12px; padding: 12px; background: #fff; }
.e3-feld.ja { border-color: var(--gruen); background: var(--gruen-hell); }
.e3-feld.ehrlich { border-color: var(--rot); background: var(--rot-hell); }
.e3-feld .e3-label { font-weight: 900; display: block; margin-bottom: 6px; }

/* E4 Kandidaten-Balken */
.e4-lympo { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.e4-zeile { display: grid; grid-template-columns: 110px 1fr 48px; gap: 10px; align-items: center; }
.e4-wort { font-weight: 900; text-align: right; }
.e4-balken-rahmen { background: #fff; border: 2px solid var(--tinte); border-radius: 999px; overflow: hidden; height: 26px; }
.e4-balken { height: 100%; background: linear-gradient(90deg, var(--gruen), var(--gelb)); width: 0; transition: width 0.8s ease-out; border-radius: 999px; }
.e4-p { font-weight: 900; }

/* E0 Warm-Up */
.e0-hinweis-deg { font-size: 1.5rem; font-weight: 900; margin-top: 8px; }
.e0-hinweis-deg.warm { color: var(--orange); }
.e0-hinweis-deg.heiss { color: var(--rot); }
.e0-hinweis-deg.kalt { color: var(--blau); }
.e0-hinweis-deg.eiskalt { color: var(--blau); }
.e0-richtig { background: var(--gruen-hell); border: 3px solid var(--gruen); border-radius: 12px; padding: 12px; margin-top: 10px; font-weight: 700; }

/* E6 Chat */
.chat-gesamt { display: flex; flex-direction: column; gap: 12px; }
.chat-modell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-modell label { font-weight: 800; }
.chat-modell select {
  font-size: 1rem; font-family: inherit; border: var(--rand);
  border-radius: 12px; padding: 10px; background: #fff; min-height: 48px; color: var(--tinte);
}
.chat-fenster {
  background: #fff; border: var(--rand); border-radius: var(--radius);
  min-height: 220px; max-height: 420px; overflow-y: auto;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.chat-nachricht { max-width: 85%; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--tinte); }
.chat-nachricht .wer-klein { font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; display: block; opacity: 0.7; }
.chat-nachricht.kind { align-self: flex-end; background: var(--blau-hell); border-bottom-right-radius: 4px; }
.chat-nachricht.wanda { align-self: flex-start; background: var(--lila-hell); border-bottom-left-radius: 4px; }
.chat-regeln { font-size: 0.9rem; font-style: italic; color: var(--rot); font-weight: 700; }
.chat-feld { display: flex; gap: 10px; flex-wrap: wrap; }
.chat-feld input[type=text] { flex: 1; min-width: 200px; }

/* Galerie Station 1 */
.galerie-bereich { margin-top: 12px; }
.galerie-bilder { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 12px; }
.galerie-bild { background: #fff; border: var(--rand); border-radius: 12px; padding: 12px; text-align: center; box-shadow: var(--schatten); }
.galerie-bild .g-icon { font-size: 2.6rem; display: block; }
.galerie-bild .g-txt { font-size: 0.92rem; margin-top: 6px; display: block; }
.galerie-intro { background: #fff; border: var(--rand); border-radius: 12px; padding: 12px; margin-top: 10px; }

/* --- Eltern-Ecke ------------------------------------------------------------ */
details.eltern-ecke {
  background: var(--grau, #eee); border: 3px solid #999; border-radius: var(--radius);
  padding: 0; margin: 24px 0 8px;
}
details.eltern-ecke summary {
  cursor: pointer; padding: 12px 18px; font-weight: 800; color: #555;
  min-height: 48px; display: flex; align-items: center; gap: 8px;
  list-style: none;
}
details.eltern-ecke summary::-webkit-details-marker { display: none; }
details.eltern-ecke summary::before { content: '👩‍🏫'; font-size: 1.4rem; }
details.eltern-ecke[open] summary { border-bottom: 2px solid #999; }
.eltern-inhalt { padding: 14px 18px; font-size: 0.95rem; color: #444; }
.eltern-inhalt p { margin: 0 0 10px; }
.eltern-inhalt .eltern-hinweis { font-size: 0.85rem; font-style: italic; }
.eltern-inhalt a { color: var(--blau); }

/* --- Navigation Stationen ----------------------------------------------------- */
.station-nav { display: flex; justify-content: space-between; gap: 10px; margin: 30px 0 10px; flex-wrap: wrap; }
.station-nav a {
  text-decoration: none; font-weight: 800; color: var(--tinte);
  background: var(--gelb-hell); border: var(--rand); border-radius: 999px;
  padding: 12px 20px; min-height: 48px; display: inline-flex; align-items: center;
  box-shadow: var(--schatten); transition: transform 0.1s;
}
.station-nav a:hover { transform: scale(1.04); }
.station-nav a.zurueck-karte { background: var(--lila-hell); }
.station-nav a.weiter { background: var(--gruen-hell); margin-left: auto; }

/* --- Wartung/Fehler ------------------------------------------------------------- */
.status-banner {
  background: var(--gelb-hell); border: 3px dashed var(--orange);
  border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; font-weight: 700;
}

/* --- Fusszeile -------------------------------------------------------------------- */
.fuss { text-align: center; font-size: 0.85rem; opacity: 0.7; margin-top: 40px; }

/* --- 404 ---------------------------------------------------------------------------- */
.ziel-verfehlt { text-align: center; padding: 40px 0; }
.ziel-verfehlt .wanda-gross { margin: 0 auto; }
.ziel-verfehlt h1 { font-size: 3rem; margin: 10px 0; }
.ziel-verfehlt p { font-size: 1.2rem; }
.ziel-verfehlt a { font-weight: 900; font-size: 1.1rem; }

/* --- Screensreader-/Keyboard-Freundlichkeit ---------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

@media (max-width: 480px) {
  .kopf .titel { font-size: 1.05rem; }
  .e4-zeile { grid-template-columns: 80px 1fr 40px; }
  .intro { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
