@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg-1: #0b0a12;
  --bg-2: #1a0f2a;
  --bg-3: #20163a;
  --neon-1: #ff6b00;
  --neon-2: #52e6ff;
  --neon-3: #ff2d7a;
  --neon-4: #ffe66d;
  --panel: rgba(10, 10, 20, 0.7);
  --text: #f6f0ff;
  --muted: rgba(246, 240, 255, 0.65);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #2b133c, #100915 55%, #060409);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: -40% 0 0;
  background: conic-gradient(
    from 120deg,
    rgba(255, 107, 0, 0.18),
    rgba(82, 230, 255, 0.18),
    rgba(255, 45, 122, 0.22),
    rgba(255, 230, 109, 0.2),
    rgba(255, 107, 0, 0.18)
  );
  animation: swirl 18s linear infinite;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(82, 230, 255, 0.2), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(255, 45, 122, 0.15), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255, 230, 109, 0.18), transparent 60%);
  filter: blur(0.5px);
  z-index: -1;
  animation: drift 12s ease-in-out infinite alternate;
}

.back-link {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(10, 12, 20, 0.7);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.scene {
  width: min(1100px, 90vw);
  margin: 5rem auto 6rem;
  display: grid;
  gap: 2.5rem;
}

.hero {
  padding: 2.2rem;
  background: var(--panel);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(3, 2, 10, 0.6);
  backdrop-filter: blur(12px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  margin: 0 0 1rem;
  letter-spacing: 0.08em;
}

.intro {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
}

.stage {
  position: relative;
  padding: 2.8rem;
  border-radius: 32px;
  background: linear-gradient(140deg, rgba(10, 10, 25, 0.8), rgba(30, 18, 50, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 420px;
  overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4);
}

.glow {
  position: absolute;
  inset: -20% 10% auto 10%;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 230, 109, 0.35), transparent 70%);
  filter: blur(6px);
  animation: pulse 4s ease-in-out infinite;
  pointer-events: none;
}

.orbs span {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.6;
  mix-blend-mode: screen;
  animation: float 10s ease-in-out infinite;
}

.orbs span:nth-child(1) {
  top: 10%;
  left: 6%;
  background: rgba(82, 230, 255, 0.6);
}

.orbs span:nth-child(2) {
  top: 15%;
  right: 10%;
  background: rgba(255, 107, 0, 0.6);
  animation-delay: -2s;
}

.orbs span:nth-child(3) {
  bottom: 18%;
  left: 18%;
  background: rgba(255, 45, 122, 0.6);
  animation-delay: -4s;
}

.orbs span:nth-child(4) {
  bottom: 14%;
  right: 18%;
  background: rgba(255, 230, 109, 0.6);
  animation-delay: -6s;
}

.orbs span:nth-child(5) {
  top: 45%;
  left: 45%;
  background: rgba(120, 255, 196, 0.6);
  animation-delay: -8s;
}

.button-field {
  position: relative;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  z-index: 2;
}

.chaos-btn {
  position: relative;
  padding: 1.1rem 1.3rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0b0a12;
  background: linear-gradient(135deg, var(--neon-4), var(--neon-1));
  border: none;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(255, 107, 0, 0.25);
  transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease;
}

.chaos-btn::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  opacity: 0.4;
  pointer-events: none;
}

.chaos-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 40px rgba(255, 107, 0, 0.4);
}

.button-field .chaos-btn:nth-child(2n) {
  background: linear-gradient(135deg, var(--neon-2), var(--neon-3));
}

.button-field .chaos-btn:nth-child(3n) {
  background: linear-gradient(135deg, #6ef7c6, #4f7dff);
}

.button-field .chaos-btn:nth-child(4n) {
  background: linear-gradient(135deg, #ff8fd4, #ffe66d);
}

.drop-active .chaos-btn {
  transform: translate(var(--drop-x), var(--drop-y)) rotate(var(--drop-rot));
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}

.shuffle-active .chaos-btn {
  transform: translate(var(--shuffle-x), var(--shuffle-y)) rotate(var(--shuffle-rot)) scale(var(--shuffle-scale));
}

.chaos-btn.orbiting {
  position: absolute;
  left: 50%;
  top: 50%;
  offset-path: circle(var(--orbit-radius) at 50% 50%);
  offset-rotate: auto;
  animation: orbit 3s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 5;
}

body.mode-tilt .stage {
  transform: rotate(-4deg) skewX(-2deg);
  transition: transform 0.6s ease;
}

body.mode-strobe .stage {
  animation: strobe 0.5s steps(2) infinite;
}

body.mode-quake .stage {
  animation: quake 0.6s ease-in-out infinite;
}

body.mode-melt .stage {
  filter: saturate(1.6) blur(0.8px);
}

body.mode-melt .chaos-btn {
  animation: melt 1.2s ease-in-out infinite;
}

.notes {
  text-align: center;
  color: var(--muted);
}

.noise {
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2"/></filter><rect width="120" height="120" filter="url(%23n)" opacity="0.18"/></svg>');
  opacity: 0.25;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 9;
}

@keyframes orbit {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}

@keyframes swirl {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes drift {
  from {
    transform: translateY(-10px) translateX(-10px);
  }
  to {
    transform: translateY(10px) translateX(10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-18px);
  }
}

@keyframes strobe {
  0% {
    box-shadow: 0 0 30px rgba(255, 107, 0, 0.6);
    filter: hue-rotate(0deg);
  }
  100% {
    box-shadow: 0 0 60px rgba(82, 230, 255, 0.8);
    filter: hue-rotate(90deg);
  }
}

@keyframes quake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(4px, -2px) rotate(0.5deg);
  }
  40% {
    transform: translate(-4px, 3px) rotate(-0.4deg);
  }
  60% {
    transform: translate(3px, 2px) rotate(0.3deg);
  }
  80% {
    transform: translate(-3px, -2px) rotate(-0.2deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes melt {
  0%,
  100% {
    border-radius: 18px;
  }
  50% {
    border-radius: 32px 32px 12px 40px;
  }
}

@media (max-width: 720px) {
  .scene {
    margin: 6rem auto 4rem;
  }

  .stage {
    padding: 2rem 1.6rem;
  }

  .back-link {
    top: 1rem;
    left: 1rem;
  }
}
