/* ==========================================================
   Bühne — frei schwebende Objekte statt Folien

   Jedes Objekt liegt prozentual auf der Fläche, nicht in einem
   Raster. Dadurch bleibt die Anordnung auf jeder Bildschirm-
   größe gleich, und die Objekte können einzeln ein- und
   ausfliegen.

   Auf schmalen Bildschirmen fällt die Bühne in eine einfache
   Spalte zusammen — freies Schweben ergibt dort keinen Sinn.
   ========================================================== */

.buehne {
  position: relative; z-index: 1;
  width: 100%; height: 100svh; overflow: hidden;
}

.szene { position: absolute; inset: 0; pointer-events: none; }
.szene.ist-da { pointer-events: auto; }

/* Ein Objekt: Position und Größe in Prozent der Bühne */
.obj {
  position: absolute;
  z-index: 2;                     /* Text und Karten liegen vorn */
  transform: translate3d(var(--fx, 0), var(--fy, 0), 0) scale(var(--fs, 1)) rotate(var(--fr, 0deg));
  opacity: 0;
  transition: transform .72s var(--ease), opacity .5s var(--ease);
  will-change: transform, opacity;
}
.szene.ist-da .obj { --fx: 0; --fy: 0; --fs: 1; --fr: 0deg; opacity: 1; }
/* Ein Objekt, das nur einen leeren Bildplatz enthält, bleibt hinter
   allem anderen — es soll den Aufbau zeigen, nicht stören. */
.obj:has(> .bildplatz:not([data-bild])) { z-index: 1; }

/* Einflugrichtungen — auch die Flugbahn beim Verlassen */
.obj[data-flug="links"]  { --fx: -60vw; }
.obj[data-flug="rechts"] { --fx:  60vw; }
.obj[data-flug="oben"]   { --fy: -60vh; }
.obj[data-flug="unten"]  { --fy:  60vh; }
.obj[data-flug="tief"]   { --fs: .55; --fy: 12vh; }
.obj[data-flug="dreh"]   { --fr: -8deg; --fs: .8; --fy: 8vh; }

/* Staffelung, damit nicht alles gleichzeitig ankommt */
.szene.ist-da .obj { transition-delay: calc(var(--i, 0) * 90ms); }
.szene.geht .obj   { transition-delay: calc(var(--i, 0) * 40ms); transition-duration: .45s; }

/* Erscheinungsformen */
.karte {
  padding: clamp(.9rem, 2vw, 1.4rem) clamp(1.1rem, 2.4vw, 1.7rem);
  border-radius: var(--radius);
  background: rgba(16,54,45,.72);
  border: 1px solid rgba(239,229,210,.14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 48px rgba(0,0,0,.42);
}
.titel {
  font-family: var(--font-serif); font-weight: 700; line-height: 1.08;
  font-size: clamp(2rem, 5.5vw, 4rem); letter-spacing: -.02em; margin: 0;
}
.zeile { font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.45; margin: 0; }
.klein { font-size: clamp(1rem, 1.8vw, 1.1rem); color: var(--cream); opacity: .8; }
.blase {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 999px;
  background: rgba(62,190,147,.13); border: 1px solid rgba(62,190,147,.42);
  color: var(--smaragd); font-size: clamp(1rem, 2.1vw, 1.25rem); white-space: nowrap;
}
.marke { color: var(--smaragd); font-family: var(--font-serif); }

/* Ampel für die Situationen */
.ampel { display: flex; gap: .6rem; flex-wrap: wrap; }
.ampel button {
  flex: 1 1 6rem; padding: .7rem .6rem; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: clamp(1rem, 1.8vw, 1.1rem);
  border: 2px solid transparent; background: rgba(255,255,255,.06); color: var(--white);
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.ampel button:hover { transform: translateY(-2px); }
.ampel button[data-wert="gruen"].gewaehlt { background: var(--gruen); border-color: #fff3; }
.ampel button[data-wert="gelb"].gewaehlt  { background: var(--gelb);  border-color: #fff3; color: #221a06; }
.ampel button[data-wert="rot"].gewaehlt   { background: var(--rot);   border-color: #fff3; }

/* Steuerung */
.steuer {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  padding: .8rem clamp(.8rem, 3vw, 1.5rem);
  background: linear-gradient(to top, rgba(6,23,19,.92), transparent);
}
.steuer button {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(239,229,210,.22); background: rgba(16,54,45,.82); color: var(--cream);
  display: grid; place-items: center; transition: background-color .2s var(--ease);
}
.steuer button:hover:not(:disabled) { background: var(--panel); color: var(--white); }
.steuer button:disabled { opacity: .3; cursor: default; }
.steuer button svg { width: 20px; height: 20px; fill: none; stroke: currentColor;
                     stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.zaehler { min-width: 5rem; text-align: center; font-size: .875rem; color: var(--muted);
           font-variant-numeric: tabular-nums; }
.heim { position: fixed; z-index: 5; top: 1rem; left: 1rem; padding: .5rem .9rem;
        border-radius: 999px; border: 1px solid rgba(239,229,210,.2);
        background: rgba(10,38,32,.78); color: var(--cream); text-decoration: none;
        font-size: .8125rem; }
.heim:hover { color: var(--white); border-color: var(--messing); }

.fortschritt { position: fixed; z-index: 6; top: 0; left: 0; height: 3px;
               background: var(--smaragd); width: 0; transition: width .4s var(--ease); }

/* Schmale Bildschirme: aus dem freien Schweben wird eine Spalte */
@media (max-width: 760px), (max-height: 480px) {
  .buehne { height: auto; min-height: 100svh; overflow: visible; }
  .szene { position: relative; inset: auto; display: none;
           padding: 4.5rem 1rem 6rem; }
  .szene.ist-da, .szene.geht { display: flex; flex-direction: column; gap: 1rem; }
  .obj { position: relative !important;
         left: auto !important; top: auto !important;
         width: auto !important; max-width: 100% !important; }
  .titel { font-size: clamp(1.8rem, 8vw, 2.6rem); }
}

/* ── Ideen sammeln ─────────────────────────────────────────
   Die Blasen erscheinen einzeln, damit das Sammeln sichtbar
   wächst. Eigene Punkte lassen sich wieder entfernen.
   ────────────────────────────────────────────────────────── */
.sammeln { display: flex; flex-direction: column; gap: 1rem; }

.wolke { display: flex; flex-wrap: wrap; gap: .55rem .6rem; align-items: flex-start;
         min-height: 6rem; }
.wolke .blase {
  animation: blase-auf .5s var(--ease) both;
  animation-delay: var(--verzug, 0ms);
}
@keyframes blase-auf {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
.blase--beispiel { opacity: .72; }
.blase--eigen {
  background: rgba(62,190,147,.2); border-color: var(--smaragd); color: var(--white);
  padding-right: .55rem;
}
.blase__weg {
  margin-left: .5rem; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  border: 0; cursor: pointer; font: inherit; line-height: 1;
  background: rgba(0,0,0,.28); color: var(--cream);
}
.blase__weg:hover { background: var(--rot); color: #fff; }

.sammeln__reihe { display: flex; gap: .55rem; flex-wrap: wrap; max-width: 34rem; }
.sammeln__reihe input {
  flex: 1 1 14rem; padding: .7rem .9rem; font: inherit; color: var(--white);
  background: rgba(6,23,19,.65); border: 1px solid var(--rand); border-radius: 10px;
}
.sammeln__reihe input:focus { outline: 2px solid var(--smaragd); outline-offset: 1px; }
.sammeln__plus {
  padding: .7rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 10px; border: 1px solid rgba(62,190,147,.5);
  background: rgba(62,190,147,.16); color: var(--smaragd);
}
.sammeln__plus:hover { background: rgba(62,190,147,.28); }
.sammeln__hinweis { margin: 0; font-size: 1rem; line-height: 1.4; color: var(--muted); }

/* Eine Gruppe hält mehrere Teile zusammen: sie hängt an einem Punkt,
   ihre Teile fließen natürlich untereinander. So entstehen keine
   Lücken, wenn eine Überschrift mehr Zeilen braucht als geplant. */
.gruppe { display: flex; flex-direction: column; gap: clamp(.9rem, 2.2vh, 1.8rem); }
.gruppe > .titel { margin: 0; }
.gruppe > .zeile { margin: 0; }

/* ── Warum ist das ein Problem? ──────────────────────────────
   Der Knopf sitzt unter der Ampel, die Begründung klappt darunter auf. */
.warum { display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }

.warum__knopf {
  display: inline-flex; align-items: center; gap: .55rem;
  font: inherit; font-size: clamp(1rem, 1.7vh, 1.1rem); font-weight: 600;
  color: var(--cream); background: rgba(217, 169, 78, .12);
  border: 1px solid rgba(217, 169, 78, .45); border-radius: 999px;
  padding: .5rem 1.1rem .5rem .6rem; cursor: pointer;
  transition: background .2s, transform .2s, border-color .2s;
}
.warum__knopf:hover { background: rgba(217, 169, 78, .22); transform: translateY(-2px); }
.warum__knopf.ist-auf { background: rgba(217, 169, 78, .26); border-color: var(--messing); }

.warum__zeichen {
  width: 1.55em; height: 1.55em; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--messing); color: #221a06;
  font-weight: 800;
}

.warum__text {
  border-left: 3px solid var(--messing);
  background: rgba(23, 73, 60, .72);
  border-radius: 0 12px 12px 0;
  padding: .85rem 1.1rem;
  font-size: clamp(1.125rem, 2vh, 1.25rem); line-height: 1.48;
  color: var(--cream);
  animation: aufklappen .35s ease both;
}
.warum__text p { margin: 0; }
.warum__frage { margin-top: .6rem !important; color: var(--muted); font-size: .92em; }

@keyframes aufklappen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Die Regeln zum Durchklicken ─────────────────────────── */
.regelfolge { display: flex; flex-direction: column; gap: clamp(.8rem, 2vh, 1.6rem); }

.regeltafel {
  display: grid; grid-template-columns: 1fr minmax(0, 26%);
  gap: clamp(1rem, 3vw, 2.5rem); align-items: center;
}
.regeltafel.kommt { animation: tafelKommt .4s ease both; }
.regeltafel__text { display: flex; flex-direction: column; gap: .7rem; }
.regeltafel__text .titel { margin: 0; }
.regeltafel__text .zeile { margin: 0; }

.regeltafel__zaehler {
  margin: 0; font-size: clamp(.9rem, 1.6vh, 1rem); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--smaragd);
}
.regeltafel__bild { aspect-ratio: 1 / 1; border-radius: 18px; }

@keyframes tafelKommt {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: none; }
}

.regelfolge__punkte { display: flex; gap: .5rem; flex-wrap: wrap; }
.regelfolge__punkt {
  width: 1.6rem; height: .38rem; padding: 0; border: 0; border-radius: 999px;
  background: rgba(214, 236, 226, .22); cursor: pointer;
  transition: background .25s, width .25s;
}
.regelfolge__punkt:hover { background: rgba(62, 190, 147, .55); }
.regelfolge__punkt.ist-da { background: var(--smaragd); width: 2.6rem; }

/* ── Alle Regeln untereinander ───────────────────────────── */
.regelliste { display: flex; flex-direction: column; gap: clamp(.6rem, 1.6vh, 1.2rem); }
.regelliste__titel { margin: 0; font-size: clamp(1.3rem, 3.4vh, 2.1rem); }

.regelliste__liste {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: clamp(.25rem, .8vh, .6rem);
}
.regelliste__zeile {
  display: grid; grid-template-columns: auto auto 1fr;
  align-items: center; gap: clamp(.5rem, 1.4vw, 1rem);
  background: rgba(16, 54, 45, .62); border: 1px solid var(--rand);
  border-radius: 12px; padding: clamp(.3rem, .9vh, .6rem) clamp(.6rem, 1.4vw, 1rem);
  animation: zeileKommt .4s ease both; animation-delay: var(--verzug, 0ms);
}
/* Feste Kantenlänge statt aspect-ratio: im Raster wird das Feld sonst
   breitgezogen und das Motiv unkenntlich. */
.regelliste__bild { width: clamp(2rem, 4.4vh, 3rem); height: clamp(2rem, 4.4vh, 3rem);
                    flex: none; border-radius: 8px; }
.regelliste__nr {
  min-width: 1.7em; text-align: right;
  font-weight: 800; color: var(--smaragd);
  font-size: clamp(.95rem, 1.9vh, 1.15rem);
}
.regelliste__text { font-size: clamp(1rem, 2vh, 1.2rem); line-height: 1.3; color: var(--white); }
.regelliste__fuss { margin: 0; }

@keyframes zeileKommt {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

/* Auf schmalen Geräten stapeln sich Tafel und Bild */
@media (max-width: 760px) {
  .regeltafel { grid-template-columns: 1fr; }
  .regeltafel__bild { display: none; }
  .regelliste__bild { display: none; }
}

/* Der Nummernhinweis wäre in den winzigen Listenbildern nur ein Schnipsel */
.regelliste__bild .bildplatz__hinweis { display: none; }

/* .regeltafel hat display:grid — das schlägt sonst das eingebaute
   [hidden]{display:none}, und alle zehn Tafeln stünden übereinander. */
.regeltafel[hidden], .warum__text[hidden] { display: none !important; }

/* Objekt mit fester Höhe: Inhalt sitzt darin mittig */
.obj--mittig { display: flex; flex-direction: column; justify-content: center; }
