:root {
  --bg: #05040b;
  --bg-alt: #0b0820;
  --neon-cyan: #45f9ff;
  --neon-magenta: #ff3df0;
  --neon-purple: #8b5bff;
  --text: #f1f1ff;
  --muted: #b8b3d9;
  --glow: 0 0 12px rgba(69, 249, 255, 0.4), 0 0 28px rgba(255, 61, 240, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: radial-gradient(1200px 900px at 20% 20%, rgba(69, 249, 255, 0.08), transparent 60%),
    radial-gradient(900px 700px at 80% 0%, rgba(255, 61, 240, 0.1), transparent 55%),
    radial-gradient(900px 700px at 80% 90%, rgba(139, 91, 255, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Chakra Petch", "Audiowide", "Space Mono", monospace;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

#glCanvas,
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#glCanvas {
  z-index: 0;
  background: #05040b;
}

#starfield {
  z-index: 1;
}

body.webgl-enabled #starfield {
  display: none;
}

body.webgl-fallback #glCanvas {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.backdrop {
  background: radial-gradient(900px 600px at 50% 15%, rgba(5, 4, 11, 0.2), rgba(5, 4, 11, 0.7) 65%),
    linear-gradient(180deg, rgba(4, 4, 10, 0.5), rgba(5, 4, 12, 0.85));
  opacity: 0.7;
  mix-blend-mode: multiply;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: soft-light;
  opacity: 0.6;
}

.vignette {
  background: radial-gradient(circle at center, transparent 40%, rgba(3, 2, 8, 0.85) 100%);
}

.noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.14;
  animation: noise-drift 2.5s steps(2) infinite;
  mix-blend-mode: overlay;
}

@keyframes noise-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-8px, 4px, 0);
  }
  100% {
    transform: translate3d(6px, -6px, 0);
  }
}

.content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding: 32px 24px;
  max-width: 680px;
}

.title-wrap {
  display: grid;
  gap: 12px;
}

.title {
  position: relative;
  font-size: clamp(3rem, 10vw, 6.5rem);
  letter-spacing: 0.45rem;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(69, 249, 255, 0.25);
  animation: title-flicker 5s infinite;
}

.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 0.5;
  pointer-events: none;
}

.title::before {
  transform: translate(2px, -2px);
  color: var(--neon-cyan);
  text-shadow: 0 0 16px rgba(69, 249, 255, 0.55);
  mix-blend-mode: screen;
}

.title::after {
  transform: translate(-3px, 2px);
  color: var(--neon-magenta);
  text-shadow: 0 0 18px rgba(255, 61, 240, 0.55);
  mix-blend-mode: screen;
}

@keyframes title-flicker {
  0%,
  100% {
    opacity: 1;
  }
  45% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.65;
  }
  52% {
    opacity: 0.95;
  }
  60% {
    opacity: 0.8;
  }
}

.subtitle {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  letter-spacing: 0.2rem;
  text-transform: uppercase;
}

.discord-button {
  position: relative;
  text-decoration: none;
  color: var(--text);
  padding: 16px 38px;
  border: 1px solid rgba(69, 249, 255, 0.55);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(69, 249, 255, 0.12), rgba(255, 61, 240, 0.15));
  box-shadow: var(--glow);
  text-transform: uppercase;
  letter-spacing: 0.22rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  isolation: isolate;
}

.discord-button::before,
.discord-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.discord-button::before {
  border: 1px solid rgba(255, 61, 240, 0.6);
  transform: translate(3px, -3px);
}

.discord-button::after {
  border: 1px solid rgba(69, 249, 255, 0.7);
  transform: translate(-3px, 2px);
}

.discord-button:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 61, 240, 0.7);
  box-shadow: 0 0 18px rgba(69, 249, 255, 0.55), 0 0 32px rgba(255, 61, 240, 0.45);
}

.discord-button:hover::before,
.discord-button:hover::after {
  opacity: 0.8;
  animation: button-glitch 0.6s steps(2) infinite;
}

@keyframes button-glitch {
  0% {
    clip-path: inset(0 0 80% 0);
  }
  33% {
    clip-path: inset(20% 0 40% 0);
  }
  66% {
    clip-path: inset(50% 0 20% 0);
  }
  100% {
    clip-path: inset(10% 0 70% 0);
  }
}

.message {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  padding: 14px 22px;
  border: 1px solid rgba(139, 91, 255, 0.35);
  border-radius: 12px;
  background: rgba(5, 4, 11, 0.6);
  backdrop-filter: blur(4px);
  min-width: min(360px, 90vw);
}

.message-label {
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  color: rgba(241, 241, 255, 0.6);
  font-size: 0.75rem;
}

#message-text {
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(69, 249, 255, 0.45);
}

@media (max-width: 600px) {
  .title {
    letter-spacing: 0.25rem;
  }

  .discord-button {
    padding: 14px 28px;
    letter-spacing: 0.14rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title {
    animation: none;
  }

  .noise {
    animation: none;
  }

  .discord-button:hover::before,
  .discord-button:hover::after {
    animation: none;
  }
}
