/* ================================
   INTRO VIDEO POPUP (Optimized)
   ================================ */

#intro-popup {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
  background: radial-gradient(circle at center, #000010 70%, #000015);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.8s ease forwards;
  transition: opacity 1s ease-out, visibility 0.6s ease;
  visibility: visible;
}

#intro-popup.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ================================
   VIDEO STYLING
   ================================ */

#intro-video {
  z-index: 2;
  width: 60vw;
  max-width: 560px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 200, 255, 0.6);
  transition: transform 1.5s ease, opacity 1.5s ease;
  transform: scale(1);
  opacity: 1;
}

#intro-popup.fade-out #intro-video {
  transform: scale(1.15);
  opacity: 0;
}

/* ================================
   PARTICLE LAYER
   ================================ */

#intro-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
}

/* ================================
   TAP TO UNMUTE TEXT
   ================================ */

#tap-to-unmute {
  position: absolute;
  bottom: 10%;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-family: "Poppins", sans-serif;
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.7);
  animation: pulse 1.2s ease-in-out infinite;
  user-select: none;
  z-index: 3;
  display: none;
  text-align: center;
  width: 100%;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ================================
   SKIP / CLOSE BUTTON
   ================================ */

#skip-intro {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 0.9rem;
  font-family: "Poppins", sans-serif;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 4;
  transition: background 0.3s ease, transform 0.2s ease, opacity 0.6s ease;
  opacity: 0;
  pointer-events: none;
}

#skip-intro.visible {
  opacity: 1;
  pointer-events: auto;
}

#skip-intro:hover {
  background: rgba(0, 200, 255, 0.85);
  transform: scale(1.05);
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ================================
   RESPONSIVE TWEAKS
   ================================ */

@media (max-width: 1024px) {
  #intro-video { width: 70vw; }
}

@media (max-width: 768px) {
  #intro-video { width: 80vw; }
  #tap-to-unmute { font-size: 0.9rem; bottom: 12%; }
  #skip-intro {
    top: 15px;
    right: 15px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  #intro-video {
    width: 90vw;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.5);
  }
  #tap-to-unmute { font-size: 0.85rem; }
}

/* ================================
   OPTIONAL SMOOTH HIDE
   ================================ */

body.popup-active {
  overflow: hidden; /* prevent scroll while popup visible */
}
