/* =========================================================
   COSMIC EXPANSION WIDGET
   VERSION 2.0
   style.css
   ========================================================= */


/* ---------------------------------------------------------
   SEITE / EINBETTUNG
   --------------------------------------------------------- */

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: #20242b;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}


/* ---------------------------------------------------------
   WIDGET
   --------------------------------------------------------- */

#dark-energy-animation {
  width: min(500px, 100vw);
  aspect-ratio: 1 / 1;
  background: transparent;
}

#universe {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}


/* ---------------------------------------------------------
   MEHRSCHICHTIGES ZENTRUM
   --------------------------------------------------------- */

#center-outer-glow,
#center-inner-glow {
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
}

#center-outer-glow {
  animation: outerGlowPulse 6s ease-in-out infinite;
}

#center-inner-glow {
  animation: innerGlowPulse 4.5s ease-in-out infinite;
}

#center-core {
  fill: #fffdf0;
  pointer-events: none;

  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 6px rgba(255, 232, 160, 0.90))
    drop-shadow(0 0 13px rgba(255, 205, 100, 0.55));

  animation: corePulse 3.8s ease-in-out infinite;
}


/* ---------------------------------------------------------
   GALAXIEN
   Die konkrete Farbe wird später durch script.js gesetzt.
   --------------------------------------------------------- */

.galaxy {
  pointer-events: none;

  filter:
    drop-shadow(0 0 1.5px rgba(220, 232, 255, 0.45))
    drop-shadow(0 0 4px rgba(190, 210, 255, 0.20));

  will-change: transform, opacity;
}


/* ---------------------------------------------------------
   LICHTSPUREN
   Werden durch script.js erzeugt und aktualisiert.
   --------------------------------------------------------- */

.galaxy-trail {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  pointer-events: none;

  filter:
    drop-shadow(0 0 2px rgba(205, 220, 255, 0.18));

  will-change: opacity;
}


/* ---------------------------------------------------------
   ANIMATIONEN DES ZENTRUMS
   --------------------------------------------------------- */

@keyframes outerGlowPulse {

  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.55;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.82;
  }

}


@keyframes innerGlowPulse {

  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.82;
  }

  50% {
    transform: scale(1.06);
    opacity: 1;
  }

}


@keyframes corePulse {

  0%,
  100% {
    opacity: 0.88;
  }

  50% {
    opacity: 1;
  }

}


/* ---------------------------------------------------------
   BARRIEREARMUT:
   Bei reduzierter Bewegung bleibt das Zentrum ruhig.
   Die spätere script.js berücksichtigt diese Einstellung
   zusätzlich für die Galaxienbewegung.
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  #center-outer-glow,
  #center-inner-glow,
  #center-core {
    animation: none;
  }

}
