/* Copyright © 2026 Caelum GmbH, Kenny Looser. Alle Rechte vorbehalten.
   Bereich Pandora (/pandora/) – Hauptbild: erst jede Logo-Schicht einzeln (A Rahmen = Pandora, C Ecken + Kreis, D alle Linien =
   Schlüsselbund), jede zeichnet sich an ihrem Platz aus dem Nichts; dann der Merge: alle zusammen = Pandora, unsere Hydra.
   Wunsch Kenny 23.11.2026. KI-Beitrag (Claude, GB-7) – Freigabe durch Kenny Looser offen (GB-8). */
body.pandora main.wrap { max-width: 1040px; }

.pd-haupt { margin: 8px 0 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.pd-bild { position: relative; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 18px; padding: 6%; aspect-ratio: 1; }
.pd-bild svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pd-text h2 { font-size: 22px; margin: 0 0 12px; }
.pd-schritte { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pd-schritte li { color: var(--faint); border-left: 2px solid var(--line); padding: 4px 0 4px 14px; transition: color .6s, border-color .6s; }
.pd-schritte li b { display: block; font-size: 13px; letter-spacing: .04em; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 400; }
.pd-schritte li.an { color: var(--text-soft); }
.pd-schritte li.jetzt { color: var(--text); border-color: var(--accent); }
.pd-schritte li.an b { color: var(--accent); }
.pd-schritte li button { all: unset; cursor: pointer; display: block; width: 100%; border-radius: 6px; }
.pd-schritte li button:hover b { color: var(--accent); }
.pd-schritte li button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.pd-nochmal { all: unset; cursor: pointer; color: var(--text-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 16px; font-size: 15px; }
.pd-nochmal:hover { color: var(--text); border-color: var(--accent); }
.pd-nochmal:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


/* --- Schichten ---------------------------------------------------------------------------------------------------- */
/* Jede Schicht erscheint an ihrem Platz aus dem Nichts: eine Linie zeichnet die Umrisse, dann füllt sich die Form.
   Stufe am Bild (data-s, von hauptbild.js): 1 Rahmen · 2 Ecken + Kreis · 3 alle Linien · 4 Merge (alle, eine Farbe). */
.pd-l { transition: opacity .6s ease; }
.pd-a { --farbe: var(--accent); --lang: 3700; }
.pd-c use { --farbe: var(--sky); --lang: 3700; }
.pd-d use { --farbe: var(--text-soft); --lang: 2600; }
.pd-a, .pd-c use, .pd-d use { fill: var(--farbe); stroke: var(--farbe); stroke-width: 4; stroke-linejoin: round;
  stroke-opacity: 0; stroke-dasharray: var(--lang) var(--lang); }

/* Mit Skript (.bereit) ist nur die Schicht der aktuellen Stufe zu sehen – ohne Skript steht das fertige Logo da */
.pd-bild.bereit .pd-l { opacity: 0; }
.pd-bild:not(.bereit) .pd-c use, .pd-bild:not(.bereit) .pd-d use { fill: var(--accent); }
.pd-bild[data-s="1"] .pd-a, .pd-bild[data-s="2"] .pd-c, .pd-bild[data-s="3"] .pd-d, .pd-bild[data-s="4"] .pd-l { opacity: 1; }

/* 1–3: die Schicht allein, langsam gezeichnet */
.pd-bild[data-s="1"] .pd-a { animation: pd-zeichnen 3.4s cubic-bezier(.45, .05, .35, 1) .2s both; }
.pd-bild[data-s="2"] .pd-c1 use { animation: pd-zeichnen 3.4s cubic-bezier(.45, .05, .35, 1) .2s both; }
.pd-bild[data-s="2"] .pd-c2 use { animation: pd-zeichnen 3.4s cubic-bezier(.45, .05, .35, 1) .4s both; }
.pd-bild[data-s="2"] .pd-c3 use { animation: pd-zeichnen 3.4s cubic-bezier(.45, .05, .35, 1) .6s both; }
.pd-bild[data-s="2"] .pd-c4 use { animation: pd-zeichnen 3.4s cubic-bezier(.45, .05, .35, 1) .8s both; }
.pd-bild[data-s="3"] .pd-d use { animation: pd-zeichnen 3.8s cubic-bezier(.45, .05, .35, 1) .2s both; }

/* 4: der Merge – alle Schichten zeichnen sich gleichzeitig, decken sich, werden eine Farbe, kurzes Leuchten */
.pd-bild[data-s="4"] .pd-a { animation: pd-zeichnen 2s cubic-bezier(.45, .05, .35, 1) .2s both; }
.pd-bild[data-s="4"] .pd-c use, .pd-bild[data-s="4"] .pd-d use {
  animation: pd-zeichnen 2s cubic-bezier(.45, .05, .35, 1) .2s both, pd-eins 1.4s ease-in-out 2.6s both; }
.pd-bild[data-s="4"] .pd-alle { animation: pd-glanz 2.2s ease-in-out 3.6s both; }

@keyframes pd-zeichnen {
  from { stroke-dashoffset: var(--lang); stroke-opacity: 1; fill-opacity: 0; }
  62%  { stroke-dashoffset: 0; stroke-opacity: 1; fill-opacity: 0; }
  88%  { fill-opacity: 1; }
  to   { stroke-dashoffset: 0; stroke-opacity: 0; fill-opacity: 1; }
}
@keyframes pd-eins { to { fill: var(--accent); stroke: var(--accent); } }
@keyframes pd-glanz { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 18px rgba(217, 119, 87, .75)); } }

.pd-schritte li b i { font-style: normal; }
.pd-satz { display: block; }
.pd-jetzt { display: none; }

/* Handy: Bild oben, darunter vier Nummern-Knöpfe in einer Reihe und nur der Text des aktuellen Schritts */
@media (max-width: 760px) {
  .pd-haupt { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pd-bild { max-width: 420px; width: 100%; margin: 0 auto; }
  .pd-text h2 { font-size: 20px; margin-bottom: 10px; }
  .pd-schritte { flex-direction: row; gap: 8px; margin-bottom: 12px; }
  .pd-schritte li { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 0; transition: border-color .6s, background-color .6s; }
  .pd-schritte li.jetzt { background: var(--bg-deep); }
  .pd-schritte li button { text-align: center; padding: 10px 0; min-height: 24px; }
  .pd-schritte li b { font-size: 16px; }
  .pd-schritte li b span, .pd-satz { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pd-bild.bereit ~ .pd-text .pd-jetzt { display: block; min-height: 4.6em; margin: 0 0 16px; color: var(--text); }
  .pd-jetzt b { display: block; color: var(--accent); font-size: 13px; letter-spacing: .04em; font-weight: 400;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace; margin-bottom: 4px; }
}
/* Handy ohne Skript: Liste wie am Desktop, damit alle Texte lesbar bleiben */
@media (max-width: 760px) {
  .pd-bild:not(.bereit) ~ .pd-text .pd-schritte { flex-direction: column; }
  .pd-bild:not(.bereit) ~ .pd-text .pd-schritte li { border-width: 0 0 0 2px; border-radius: 0; padding: 4px 0 4px 14px; }
  .pd-bild:not(.bereit) ~ .pd-text .pd-schritte li button { text-align: left; padding: 0; }
  .pd-bild:not(.bereit) ~ .pd-text .pd-schritte li b { font-size: 13px; }
  .pd-bild:not(.bereit) ~ .pd-text .pd-schritte li b span, .pd-bild:not(.bereit) ~ .pd-text .pd-satz {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
}
/* Weniger Bewegung: nichts zeichnet sich, die Schichten stehen ruhig da; Stufe 4 in einer Farbe */
@media (prefers-reduced-motion: reduce) {
  .pd-bild .pd-l, .pd-bild .pd-alle, .pd-bild use { animation: none !important; transition: none; }
  .pd-bild[data-s="4"] .pd-c use, .pd-bild[data-s="4"] .pd-d use { fill: var(--accent); }
  .pd-schritte li { transition: none; }
}

/* --- P3 Schaubild „Was Pandora ist“: Rahmen in der Mitte, vier Köpfe der Hydra in den Ecken (schaubild.js) ------------- */
.pd-was { margin: 0 0 48px; }
.pd-was h2 { font-size: 22px; margin: 0 0 8px; }
.pd-lead { color: var(--text-soft); margin: 0 0 20px; max-width: 68ch; }
.pd-was-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.pd-karte { margin: 0; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 18px; padding: 5%; }
.pd-karte svg { display: block; width: 100%; height: auto; overflow: visible; }
.pd-karte text { text-anchor: middle; font-size: 14px; fill: var(--text); }
.pd-karte text.sub { font-size: 11px; fill: var(--muted); }
.pd-adern line { stroke: var(--line); stroke-width: 2; }
.pd-fluesse line { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 10; animation: pd-fluss 1.6s linear infinite; }
.pd-fluesse line.weg, .pd-adern line.weg { opacity: .15; animation: none; transition: opacity .6s; }
.pd-mitte rect { fill: none; stroke: var(--accent); stroke-width: 6; }
.pd-was.fehlt .pd-mitte rect { animation: pd-halten 1.6s ease-in-out infinite; }
.pd-kopf { cursor: pointer; transition: opacity .6s; }
.pd-kopf rect { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; transition: stroke .4s; }
.pd-kopf.an rect { stroke: var(--accent); }
.pd-kopf.weg { opacity: .3; }
.pd-kopf.weg rect { stroke-dasharray: 5 5; }
@keyframes pd-fluss { to { stroke-dashoffset: -16; } }
@keyframes pd-halten { 50% { filter: drop-shadow(0 0 10px rgba(217, 119, 87, .7)); } }

.pd-koepfe { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pd-koepfe li { border-left: 2px solid var(--line); padding: 4px 0 4px 14px; color: var(--text-soft); transition: border-color .4s; }
.pd-koepfe li button { all: unset; cursor: pointer; display: block; width: 100%; border-radius: 6px; }
.pd-koepfe li button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.pd-koepfe b { display: block; color: var(--text); }
.pd-koepfe span, .pd-koepfe em { display: block; font-style: normal; }
.pd-koepfe em { color: var(--muted); margin-top: 4px; }
/* mit Skript: nur der gewählte Kopf zeigt seinen Text, die Folge des Wegnehmens nur, wenn er fehlt */
.pd-was.lebt .pd-koepfe li:not(.an) span, .pd-was.lebt .pd-koepfe li:not(.weg) em { display: none; }
.pd-was.lebt .pd-koepfe li.an { border-color: var(--accent); }
.pd-was.lebt .pd-koepfe li.weg b { text-decoration: line-through; color: var(--muted); }
.pd-was-lage { min-height: 1.5em; margin: 0 0 12px; color: var(--text); }
.pd-regel { margin: 20px 0 0; color: var(--text-soft); }
.pd-regel b { color: var(--accent); font-weight: 600; }

@media (max-width: 760px) {
  .pd-was-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pd-karte { max-width: 420px; width: 100%; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-fluesse line, .pd-was.fehlt .pd-mitte rect { animation: none; }
}

/* --- P4 „Die 7 Schritte im Notfall“: Schritt-Spieler, Umschalter Verlust | Bedrohung (notfall.js) ------------------------ */
.pd-not { margin: 0 0 56px; border-top: 1px solid var(--line); padding-top: 32px; }
.pd-not h2 { font-size: 22px; margin: 0 0 8px; }
.pd-fall { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0 0 20px; }
.pd-fall[hidden] { display: none; }
.pd-fall button { all: unset; cursor: pointer; padding: 8px 18px; font-size: 15px; color: var(--text-soft); }
.pd-fall button[aria-pressed="true"] { background: var(--bg-deep); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.pd-fall button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pd-not-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.pd-not-bild { margin: 0; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 18px; padding: 5%; touch-action: pan-y; }
.pd-not-bild svg { display: block; width: 100%; height: auto; }
.pd-not-bild svg * { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nf-rahmen { stroke: var(--accent); stroke-width: 5; }
.nf-alt rect, .nf-alt path { stroke: var(--muted); stroke-width: 3; stroke-dasharray: 6 6; }
.nf-neu rect, .nf-neu path { stroke: var(--text); stroke-width: 3; }
.nf-kopf rect, .nf-kopf circle { stroke: var(--sky); stroke-width: 3; }
.nf-kappe, .nf-netz, .nf-zeilen { stroke: var(--text-soft); stroke-width: 3; }
.nf-kreuz { stroke: var(--accent); stroke-width: 4; }
.nf-schloss rect, .nf-schloss path { stroke: var(--accent); stroke-width: 3; }
.pd-not-bild svg .nf-punkt, .pd-not-bild svg .nf-balken, .pd-not-bild svg .nf-fuellung { fill: var(--sky); stroke: none; }
.nf-ecke { stroke: var(--sky); stroke-width: 5; }
.nf-fluss { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 10; }
.nf-haken { stroke: var(--accent); stroke-width: 6; }
/* Ohne Skript: nur das letzte Bild (bereit); mit Skript das Bild des aktuellen Schritts */
.nf-b { display: none; }
.pd-not-bild:not([data-s]) .nf-b7 { display: inline; }
.pd-not-bild[data-s="1"] .nf-b1, .pd-not-bild[data-s="2"] .nf-b2, .pd-not-bild[data-s="3"] .nf-b3, .pd-not-bild[data-s="4"] .nf-b4,
.pd-not-bild[data-s="5"] .nf-b5, .pd-not-bild[data-s="6"] .nf-b6, .pd-not-bild[data-s="7"] .nf-b7 { display: inline; animation: nf-ein .7s ease both; }
.pd-not-bild[data-s="4"] .nf-fluss { animation: pd-fluss 1.6s linear infinite; }
.pd-not-bild[data-s="3"] .nf-balken { transform-box: fill-box; transform-origin: left; animation: nf-laden 4s ease-out both; }
.pd-not-bild[data-s="5"] .nf-fuellung { transform-box: fill-box; transform-origin: left; animation: nf-laden 4s ease-out .4s both; }
.pd-not-bild[data-s="6"] .nf-haken { stroke-dasharray: 80; animation: nf-strich 1.2s ease 1s both; }
.pd-not-bild[data-s="7"] .nf-rahmen { animation: pd-glanz 2.2s ease-in-out .4s both; }
.pd-not-bild[data-s="1"] .nf-rahmen, .pd-not-bild[data-s="2"] .nf-rahmen { stroke-dasharray: 12 10; }
@keyframes nf-ein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes nf-laden { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes nf-strich { from { stroke-dashoffset: 80; } to { stroke-dashoffset: 0; } }

.pd-not-schritte { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pd-not-schritte li { border-left: 2px solid var(--line); padding: 4px 0 4px 14px; color: var(--text-soft); transition: border-color .4s, color .4s; }
.pd-not-schritte li button { all: unset; cursor: pointer; display: block; width: 100%; border-radius: 6px; }
.pd-not-schritte li button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.pd-not-schritte b { display: block; color: var(--text); font-weight: 600; }
.pd-not-schritte b i { font-style: normal; color: var(--accent); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 400; }
.nf-satz, .pd-not-schritte em { display: block; font-style: normal; margin-top: 2px; }
.pd-not-schritte em { color: var(--muted); }
.nf-wenn { font-style: normal; color: var(--accent); }
/* Mit Skript: Liste kurz (nur Titel), der Text des aktuellen Schritts steht darunter in .pd-not-jetzt */
.pd-not.lebt .nf-satz, .pd-not.lebt .pd-not-schritte em { display: none; }
.pd-not.lebt .pd-not-schritte li { color: var(--faint); }
.pd-not.lebt .pd-not-schritte li b { color: inherit; font-weight: 400; }
.pd-not.lebt .pd-not-schritte li.an { color: var(--text-soft); }
.pd-not.lebt .pd-not-schritte li.jetzt { color: var(--text); border-color: var(--accent); }
.pd-not-jetzt { display: none; }
.pd-not.lebt .pd-not-jetzt { display: block; min-height: 7.5em; margin: 0 0 16px; color: var(--text); }
.pd-not-jetzt b { display: block; color: var(--accent); font-size: 13px; letter-spacing: .04em; font-weight: 400; margin-bottom: 4px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.pd-not-jetzt span, .pd-not-jetzt em { display: block; }
.pd-not-jetzt em { font-style: normal; color: var(--muted); margin-top: 6px; }
.pd-not[data-f="bedrohung"] .pd-not-bild { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pd-not-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-not-knoepfe[hidden] { display: none; }

@media (max-width: 760px) {
  .pd-not-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pd-not-bild { max-width: 420px; width: 100%; margin: 0 auto; }
  .pd-not.lebt .pd-not-schritte { flex-direction: row; gap: 6px; }
  .pd-not.lebt .pd-not-schritte li { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 0; }
  .pd-not.lebt .pd-not-schritte li.jetzt { background: var(--bg-deep); }
  .pd-not.lebt .pd-not-schritte li button { text-align: center; padding: 10px 0; }
  .pd-not.lebt .pd-not-schritte b span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-not-bild .nf-b, .pd-not-bild .nf-fluss, .pd-not-bild .nf-balken, .pd-not-bild .nf-fuellung, .pd-not-bild .nf-haken, .pd-not-bild .nf-rahmen { animation: none !important; }
}
