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

:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #b3b3b3;
  --mx: 50vw;
  --my: 50vh;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#codeRain {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#bg {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* Retro perspective grid floor */
.grid-floor {
  position: fixed;
  left: -50%;
  bottom: -6%;
  width: 200%;
  height: 38vh;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(400px) rotateX(63deg);
  animation: gridMove 1.5s linear infinite;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 90%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 90%);
}

@keyframes gridMove {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 46px;
  }
}

/* Glow that follows the cursor */
#glow {
  position: fixed;
  left: var(--mx);
  top: var(--my);
  width: 480px;
  height: 480px;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, transparent 60%);
}

.menu {
  position: relative;
  z-index: 3;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-logo {
  margin-top: 10vh;
  width: clamp(90px, 12vw, 150px);
  height: auto;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.logo {
  margin-top: 10vh;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #fff 20%, #7a7a7a 50%, #fff 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 4s linear infinite, fadeDown 0.9s ease both;
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.logo:hover {
  animation-play-state: paused;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  transform: translateY(-4vh);
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.welcome {
  min-height: 1.6em;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--muted);
  letter-spacing: 1px;
  animation: fadeUp 0.9s ease 0.2s both;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: var(--text);
  vertical-align: -0.15em;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.start-btn {
  position: relative;
  padding: 0.95rem 4.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #000;
  background: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  animation: fadeUp 0.9s ease 0.45s both, pulse 2.6s ease-in-out 1.4s infinite;
}

.start-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.45);
}

.start-btn:active {
  transform: scale(0.97);
}

/* Shine sweep across the button */
.start-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(0, 0, 0, 0.12), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.start-btn:hover::after {
  left: 160%;
}

/* Click ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow: 0 0 26px rgba(255, 255, 255, 0.28);
  }
}

.discord {
  position: absolute;
  left: 24px;
  bottom: 20px;
  color: #fff;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.25s ease;
  animation: fadeUp 0.9s ease 0.7s both;
}

.discord:hover {
  opacity: 1;
  transform: scale(1.15) rotate(-6deg);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
