:root {
  --bg-1: #1a0a12;
  --bg-2: #2d0f24;
  --bg-3: #3d1440;
  --glow: #ff8fd6;
  --glow-strong: #ffc5e9;
  --accent-cyan: rgba(100, 240, 255, 0.15);
  --accent-magenta: rgba(255, 80, 200, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a0c14;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.scene {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(120, 40, 100, 0.45), transparent 55%),
    radial-gradient(circle at 22% 25%, rgba(255, 121, 196, 0.38), transparent 42%),
    radial-gradient(circle at 80% 68%, rgba(100, 200, 255, 0.12), transparent 36%),
    linear-gradient(145deg, var(--bg-1) 0%, var(--bg-2) 38%, var(--bg-3) 100%);
}

.scene-aurora {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
  background: conic-gradient(
    from 200deg at 50% 50%,
    rgba(255, 100, 200, 0.22) 0deg,
    rgba(100, 60, 180, 0.18) 90deg,
    rgba(50, 200, 255, 0.2) 180deg,
    rgba(200, 50, 150, 0.2) 270deg,
    rgba(255, 100, 200, 0.22) 360deg
  );
  filter: blur(40px);
  mix-blend-mode: screen;
  opacity: 0.42;
  transform: translateZ(0);
}

.scene-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image:
    linear-gradient(rgba(255, 160, 220, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 200, 255, 0.2) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 20%, transparent 70%);
  transform: translateZ(0);
}

.scene-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow:
    inset 0 0 120px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 200px 80px rgba(20, 0, 30, 0.35);
}

.scene-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 200, 255, 0.12) 2px,
    rgba(255, 200, 255, 0.12) 3px
  );
  mix-blend-mode: overlay;
}

.bg-layer {
  position: absolute;
  inset: -12%;
  pointer-events: none;
}

.bg-layer-a {
  background:
    radial-gradient(circle at 65% 30%, rgba(255, 150, 214, 0.26), transparent 50%),
    radial-gradient(circle at 15% 80%, rgba(255, 126, 190, 0.2), transparent 46%);
  filter: blur(36px);
  transform: translateZ(0);
}

.bg-layer-b {
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 174, 228, 0.18), transparent 44%),
    radial-gradient(circle at 80% 72%, rgba(224, 118, 199, 0.16), transparent 42%);
  filter: blur(56px);
  transform: translateZ(0);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.07;
  mix-blend-mode: screen;
  background-image: radial-gradient(#fff 0.9px, transparent 0.9px);
  background-size: 3px 3px;
}

.viewport {
  position: absolute;
  inset: 0;
  z-index: 3;
  perspective: 980px;
  overflow: hidden;
  touch-action: none;
}

.world {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  transform: translate3d(-50%, -50%, 0);
}

.text-item {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--glow);
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  user-select: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  filter: blur(var(--blur, 0px));
  opacity: var(--opacity, 0.75);
  transform: translate3d(0, 0, 0);
  animation: neonPulse 3.2s ease-in-out infinite;
}

.text-item.is-strong {
  color: var(--glow-strong);
  text-shadow:
    0 0 9px rgba(255, 220, 241, 0.92),
    0 0 24px rgba(255, 160, 218, 0.68);
}

@keyframes neonPulse {
  0%,
  100% {
    opacity: var(--opacity, 0.75);
  }
  50% {
    opacity: calc(var(--opacity, 0.75) + 0.06);
  }
}

.hud {
  position: absolute;
  left: clamp(10px, 2.2vw, 16px);
  bottom: clamp(10px, 2.2vw, 14px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
}

.music-btn {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(180, 255, 255, 0.45);
  color: #ffe8fb;
  padding: clamp(6px, 1.5vw, 7px) clamp(10px, 2.5vw, 12px);
  font-size: clamp(12px, 2.7vw, 14px);
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(80, 20, 60, 0.88), rgba(30, 20, 60, 0.9));
  box-shadow:
    0 0 0 1px rgba(255, 150, 220, 0.25) inset,
    0 0 18px rgba(255, 100, 200, 0.28);
  text-shadow: 0 0 6px rgba(255, 180, 230, 0.65);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.music-btn:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(200, 255, 255, 0.7);
  box-shadow:
    0 0 0 1px rgba(255, 180, 255, 0.35) inset,
    0 0 32px rgba(120, 240, 255, 0.4),
    0 0 48px rgba(255, 100, 200, 0.25);
}

.music-btn:active {
  transform: translateY(0) scale(0.99);
}

.bg-audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .text-item {
    animation: none !important;
  }
}

@keyframes driftA {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1.02);
  }
  to {
    transform: translate3d(2%, 1.5%, 0) scale(1.05);
  }
}

@keyframes driftB {
  from {
    transform: translate3d(2.5%, -1.2%, 0) scale(1.03);
  }
  to {
    transform: translate3d(-2.5%, 1.8%, 0) scale(1.06);
  }
}

@media (min-width: 1024px) and (min-height: 600px) {
  .bg-layer-a {
    animation: driftA 28s ease-in-out infinite alternate;
  }

  .bg-layer-b {
    animation: driftB 36s ease-in-out infinite alternate;
  }
}

@media (max-width: 768px) {
  .text-item {
    animation: none;
  }
}
