/* RESET + FONT */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
}

body {
  background: radial-gradient(circle at top, #111, #000);
  color: #f5f5f5;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* MAIN CONTAINER */
#gate {
  text-align: center;
  max-width: 90%;
  position: relative;
  z-index: 2;
}

/* SMALL TEXT */
.small {
  font-size: 14px;
  opacity: 0.8;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* TITLE (no animation here, JS handles it) */
#title {
  font-size: clamp(32px, 8vw, 52px);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 150, 200, 0.4);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 20px;
}

/* MESSAGE TEXT ABOVE COUNTDOWN */
#message {
  font-size: clamp(14px, 4vw, 16px);
  opacity: 0.85;
  margin-bottom: 20px;
  padding: 0 15px;
}

/* COUNTDOWN */
#countdown {
  font-size: clamp(14px, 5vw, 20px);
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 30px;
  transition: opacity 0.6s ease;
  padding: 0 10px;
}

/* BUTTON */
button {
  padding: 14px 40px;
  border-radius: 50px;
  background: rgba(255, 180, 210, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 150, 200, 0.4);
  font-size: clamp(14px, 4vw, 16px);
  letter-spacing: 1px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  cursor: not-allowed;
  opacity: 0.7;
  transition: 0.4s ease;
}

button.enabled {
  background: linear-gradient(135deg, #ff99cc, #ff69b4);
  color: #000;
  border: none;
  opacity: 1;
  cursor: pointer;
  transform: translateY(-2px);
}

/* 3D CANVAS LAYER */
#bg {
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* LIGHT BEHIND TEXT (GLOW AURA) */
#gate::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(600px, 120vw);
  height: min(600px, 120vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 150, 200, 0.2) 0%, transparent 75%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  /* FIX button clicks */
}

/* NOT YET MESSAGE */
#notYet {
  margin-top: 15px;
  font-size: 14px;
  color: #ff9acd;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.6s ease;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(255, 150, 200, 0.4);
  position: relative;
  z-index: 10;
  text-align: center;
}

/* CENTER SPOTLIGHT */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 175, 205, 0.12), transparent 70%);
  pointer-events: none;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
  #gate {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  #title {
    letter-spacing: 0.5px;
  }

  .small {
    font-size: 12px;
    letter-spacing: 2px;
  }
}

/* TRANSITION OVERLAY */
#transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  will-change: opacity;
}

#transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.loader-content {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#transition-overlay.active .loader-content {
  opacity: 1;
  transform: translateY(0);
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 216, 153, 0.2);
  border-top: 1px solid #ffd899;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(255, 216, 153, 0.1);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

.loader-progress {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  color: #ffd899;
  margin-top: 10px;
  font-weight: 300;
}

/* WARP ANIMATION FOR GATE - OPTIMIZED */
.warp-out {
  will-change: transform, opacity;
  animation: warpOut 0.8s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

@keyframes warpOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* BUTTON PULSE WHEN ENABLED - SMOOTHED */
button.enabled {
  will-change: transform, box-shadow;
  animation: pulseEnabled 2s infinite;
}

@keyframes pulseEnabled {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 150, 200, 0.5);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(255, 150, 200, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 150, 200, 0);
  }
}