/* ==========================================================
   planungstool event – Logo- und Lade-Animationen (Skizze)
   Nur CSS, keine Bibliothek. Funktioniert mit der CSP des Tools
   (keine Inline-Styles, keine Inline-Skripte).
   ========================================================== */

/* ---------- Grundlage: Bildzeichen als einzelne Teile ---------- */
.pz { display: block; overflow: visible; }
.pz * { transform-box: view-box; }
.pz-tisch, .pz-funke, .pz-ring, .pz-glow { transform-origin: 32px 32px; }
.pz-glow { opacity: 0; }

/* Sitzplatz jeder Person (Kopfmitte) und Richtung "von außen" */
.pz-p1 { transform-origin: 32px 11px;    --dx: 0px;    --dy: -15px; }
.pz-p2 { transform-origin: 50.19px 21.5px; --dx: 13px;  --dy: -7.5px; }
.pz-p3 { transform-origin: 50.19px 42.5px; --dx: 13px;  --dy: 7.5px; }
.pz-p4 { transform-origin: 32px 53px;    --dx: 0px;    --dy: 15px; }
.pz-p5 { transform-origin: 13.81px 42.5px; --dx: -13px; --dy: 7.5px; }
.pz-p6 { transform-origin: 13.81px 21.5px; --dx: -13px; --dy: -7.5px; }
.pz-p1 { --i: 0; } .pz-p2 { --i: 1; } .pz-p3 { --i: 2; }
.pz-p4 { --i: 3; } .pz-p5 { --i: 4; } .pz-p6 { --i: 5; }
.pz-pill { transform-origin: 301.2px 29.4px; }

/* ==========================================================
   LADE-ANIMATION A – "Die Runde füllt sich"
   Personen setzen sich nacheinander im Uhrzeigersinn an den Tisch,
   dann leuchtet der Funke auf. Endlosschleife, 2,8 s.
   ========================================================== */
.lader-a .pz-p { animation: la-setzen 2.8s cubic-bezier(.22,1,.36,1) infinite both; animation-delay: calc(var(--i) * 140ms); }
.lader-a .pz-funke { animation: la-funke 2.8s cubic-bezier(.22,1,.36,1) infinite both; }
.lader-a .pz-tisch { animation: la-tisch 2.8s ease-in-out infinite both; }
@keyframes la-setzen {
  0%   { opacity: 0; translate: var(--dx) var(--dy); scale: .7; }
  14%  { opacity: 1; translate: 0 0; scale: 1; }
  78%  { opacity: 1; translate: 0 0; scale: 1; }
  92%, 100% { opacity: 0; translate: 0 0; scale: .85; }
}
@keyframes la-funke {
  0%, 38% { scale: .4; rotate: 0deg; opacity: .3; }
  50%     { scale: 1.35; rotate: 45deg; opacity: 1; }
  60%, 82% { scale: 1; rotate: 90deg; opacity: 1; }
  100%    { scale: .4; rotate: 90deg; opacity: .3; }
}
@keyframes la-tisch { 0%, 40% { scale: .92; } 52% { scale: 1.04; } 62%, 100% { scale: 1; } }

/* ==========================================================
   LADE-ANIMATION B – "Platzwechsel"
   Die Runde rückt in Sechstel-Schritten weiter, wie beim
   Platztausch. Ruhig, gut auch für längeres Warten
   (z. B. Fehlerseite "verbinde neu …"). 4,2 s pro Umlauf.
   ========================================================== */
.lader-b .pz-ring { animation: lb-ring 4.2s cubic-bezier(.65,0,.35,1) infinite; }
.lader-b .pz-funke { animation: lb-funke .7s ease-in-out infinite; }
@keyframes lb-ring {
  0%, 9%      { rotate: 0deg; }
  16.6%, 25.6% { rotate: 60deg; }
  33.3%, 42.3% { rotate: 120deg; }
  50%, 59%    { rotate: 180deg; }
  66.6%, 75.6% { rotate: 240deg; }
  83.3%, 92.3% { rotate: 300deg; }
  100%        { rotate: 360deg; }
}
@keyframes lb-funke { 0%, 100% { scale: 1; } 50% { scale: .7; } }

/* ==========================================================
   LADE-ANIMATION C – "Leiste"
   Dünne Apricot-Leiste am oberen Rand. Für Seitenwechsel
   innerhalb des Portals, wo ein Vollbild-Lader stören würde.
   ========================================================== */
.leiste { position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--apricot); transform-origin: 0 50%; scale: 0 1; border-radius: 0 2px 2px 0; }
.leiste.laeuft { animation: lc-leiste 2.6s cubic-bezier(.3,.7,.4,1) infinite; }
@keyframes lc-leiste {
  0%   { scale: 0 1; opacity: 1; }
  55%  { scale: .72 1; opacity: 1; }
  75%  { scale: 1 1; opacity: 1; }
  90%, 100% { scale: 1 1; opacity: 0; }
}

/* ==========================================================
   LOGO-ANIMATION 1 – "Alle kommen an den Tisch"
   Einmal beim ersten Besuch (pro Sitzung), 1,5 s.
   ========================================================== */
.logo-1 .pz-tisch { animation: l1-tisch .6s cubic-bezier(.22,1,.36,1) both; }
.logo-1 .pz-p     { animation: l1-person .7s cubic-bezier(.22,1,.36,1) both; animation-delay: calc(120ms + var(--i) * 70ms); }
.logo-1 .pz-funke { animation: l1-funke .6s cubic-bezier(.34,1.56,.64,1) both; animation-delay: .72s; }
.logo-1 .pz-glow  { animation: glow .9s ease-out both; animation-delay: .8s; }
.logo-1 .pz-wort  { animation: wort .7s cubic-bezier(.22,1,.36,1) both; animation-delay: .85s; }
.logo-1 .pz-pill  { animation: pill .55s cubic-bezier(.34,1.56,.64,1) both; animation-delay: 1.2s; }
@keyframes l1-tisch  { from { scale: .5; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes l1-person { from { opacity: 0; translate: var(--dx) var(--dy); } to { opacity: 1; translate: 0 0; } }
@keyframes l1-funke  { from { scale: 0; rotate: -90deg; } to { scale: 1; rotate: 0deg; } }

/* ==========================================================
   LOGO-ANIMATION 2 – "Der Funke zündet"
   Erst der Funke, ein Lichtring läuft nach außen und weckt
   reihum die Personen. 1,5 s.
   ========================================================== */
.logo-2 .pz-tisch { animation: l1-tisch .45s ease-out both; }
.logo-2 .pz-funke { animation: l2-funke .7s cubic-bezier(.34,1.56,.64,1) both; animation-delay: .1s; }
.logo-2 .pz-glow  { animation: glow 1s ease-out both; animation-delay: .35s; }
.logo-2 .pz-p     { animation: l2-person .45s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(.45s + var(--i) * 75ms); }
.logo-2 .pz-wort  { animation: wort .7s cubic-bezier(.22,1,.36,1) both; animation-delay: .9s; }
.logo-2 .pz-pill  { animation: pill .55s cubic-bezier(.34,1.56,.64,1) both; animation-delay: 1.25s; }
@keyframes l2-funke  { 0% { scale: 0; rotate: 0deg; } 60% { scale: 1.6; rotate: 135deg; } 100% { scale: 1; rotate: 180deg; } }
@keyframes l2-person { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }

@keyframes glow { from { opacity: .9; scale: 1; stroke-width: 3; } to { opacity: 0; scale: 3.1; stroke-width: .5; } }
@keyframes wort { from { opacity: 0; clip-path: inset(0 100% 0 0); translate: -6px 0; } to { opacity: 1; clip-path: inset(0 0 0 0); translate: 0 0; } }
@keyframes pill { from { opacity: 0; scale: .5; } to { opacity: 1; scale: 1; } }

/* ---------- Hover (Maus über dem Logo): Runde rückt einen Platz weiter ---------- */
.logo-hover .pz-ring  { transition: rotate .8s cubic-bezier(.65,0,.35,1); }
.logo-hover .pz-funke { transition: rotate .8s cubic-bezier(.65,0,.35,1), scale .3s ease; }
.logo-hover:hover .pz-ring,
.logo-hover:focus-visible .pz-ring  { rotate: 60deg; }
.logo-hover:hover .pz-funke,
.logo-hover:focus-visible .pz-funke { rotate: 90deg; scale: 1.15; }

/* ---------- Weniger Bewegung: alles sofort im Endzustand ---------- */
@media (prefers-reduced-motion: reduce) {
  .pz *, .leiste { animation: none !important; transition: none !important; }
  .leiste { scale: .6 1; }
}
html.rm .pz *, html.rm .leiste { animation: none !important; transition: none !important; }
html.rm .leiste { scale: .6 1; }
