body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000000;
  position: relative;
  cursor: none;
}

#nebula-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1; /* Deepest background */
}

.nebula-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 200% 200%; /* For animating background position */
  opacity: 0; /* Fade in via JS or animation */
  will-change: transform, opacity, background-position;
}

#nebula-layer-1 {
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(30, 0, 70, 0.4) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 30%, rgba(0, 40, 80, 0.35) 0%, transparent 60%);
  animation: slowDrift 180s linear infinite alternate, fadeInNebula 15s 0.5s ease-out forwards;
  transform: scale(1.1);
  z-index: 1;
}

#nebula-layer-2 {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(50, 20, 90, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 10%, rgba(20, 50, 70, 0.25) 0%, transparent 70%);
  animation: slowDrift 240s linear infinite reverse, fadeInNebula 15s 1s ease-out forwards;
  transform: scale(1.2) rotate(10deg);
  z-index: 2;
}

#nebula-layer-3 { /* More diffuse, distant glow */
  background-image: radial-gradient(circle at 70% 70%, rgba(10, 10, 30, 0.5) 0%, transparent 60%);
  animation: slowDrift 300s linear infinite, fadeInNebula 15s 1.5s ease-out forwards;
  transform: scale(1.3) rotate(-5deg);
  z-index: 0;
  filter: blur(10px); /* Soften distant layer */
}


@keyframes fadeInNebula {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slowDrift {
  0% { background-position: 0% 0%; transform: scale(1.1) rotate(0deg); }
  25% { background-position: 25% 50%; }
  50% { background-position: 50% 100%; transform: scale(1.15) rotate(2deg); }
  75% { background-position: 75% 50%; }
  100% { background-position: 100% 0%; transform: scale(1.1) rotate(0deg); }
}


#starfield-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0; /* Adjusted to be part of background layers */
}

.star {
  position: absolute;
  border-radius: 50%;
  background-color: white;
  will-change: opacity, transform;
  animation: twinkle 5s infinite alternate ease-in-out;
}

@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 0.8; }
  100% { opacity: 0.2; transform: scale(1); }
}

#ambient-particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1; /* Above nebula, below orbs */
}

.ambient-particle {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(200, 220, 255, 0.3); /* Faint ambient color */
  will-change: transform, opacity;
}

.ambient-particle.streak {
  width: 10px; /* Example, JS will vary */
  height: 1px; /* Example, JS will vary */
  border-radius: 1px;
}

.orb-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10; /* Orbs are prominent */
}

.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity, box-shadow;
  transition: opacity 0.5s ease-out; /* For initial fade-in */
}

.orb.agitated .orb-core-visual { /* Style for agitation visualization */
  animation: coreAgitation 0.3s ease-in-out;
}

@keyframes coreAgitation {
  0%, 100% { transform: scale(1); filter: brightness(1.5); }
  50% { transform: scale(1.15); filter: brightness(2.5); }
}

.energy-trail-segment {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 9; /* Below its orb */
}

.graviton-beam {
  position: absolute;
  height: 2px; /* Thickness of the beam */
  background: linear-gradient(90deg, rgba(180, 220, 255, 0.05), rgba(200, 230, 255, 0.7), rgba(180, 220, 255, 0.05));
  opacity: 0;
  transform-origin: left center;
  pointer-events: none;
  border-radius: 1px;
  will-change: transform, opacity, width;
  transition: opacity 0.2s ease-out;
  box-shadow: 0 0 5px rgba(200, 230, 255, 0.5), 0 0 10px rgba(200, 230, 255, 0.3);
  animation: beamPulse 1s infinite alternate;
}

@keyframes beamPulse {
  from { filter: brightness(0.8); }
  to { filter: brightness(1.2); }
}


#cursor-light {
  position: fixed;
  width: 450px; /* Increased size */
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(200, 225, 255, 0.28) 0%, /* Brighter, more defined center */
    rgba(180, 210, 255, 0.15) 30%,
    rgba(150, 180, 230, 0.08) 50%,
    rgba(120, 150, 200, 0.0) 75%
  );
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  transition: opacity 0.4s ease-out, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 5; /* Above ambient particles, potentially below some orb effects if needed */
  animation: subtlePulseCursor 4s infinite alternate ease-in-out;
}

@keyframes subtlePulseCursor { /* Renamed to avoid conflict */
  0% { transform: translate(-50%, -50%) scale(0.97); filter: brightness(0.95)}
  100% { transform: translate(-50%, -50%) scale(1.03); filter: brightness(1.05)}
}

.shockwave {
  position: fixed;
  border-radius: 50%;
  /* More energetic border */
  border: 3px solid transparent;
  background-clip: padding-box;
  background-image: linear-gradient(rgba(220, 235, 255, 0.7), rgba(180, 210, 255, 0.3));
  box-shadow: 0 0 15px rgba(200, 225, 255, 0.5), 0 0 30px rgba(180, 210, 255, 0.3), inset 0 0 10px rgba(220,235,255,0.2);
  opacity: 1;
  transform: translate(-50%, -50%) scale(0.05); /* Start smaller */
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 15; /* Highest interactive element */
}