/* ============================================================
   PÁGINA DE AMOR — Estilos
   ============================================================ */

:root {
  --azul: #3a86ff;
  --cyan: #5bd1ff;
  --azul-suave: #cfe4ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  cursor: default;
}

/* Un sutil viñeteado para dar profundidad al fondo negro */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* ---- Lienzos apilados ---- */
canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#bg {
  z-index: 0;
}

#scene {
  z-index: 1;
}

/* ============================================================
   Pantalla de inicio
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: center;
  padding: 1.5rem;
  transition: opacity 1s ease, transform 1s ease;
}

.overlay.hide {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

/* ---- Botón INICIAR ---- */
.btn-iniciar {
  position: relative;
  padding: 0.95rem 3.2rem;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--azul), #4d9bff);
  color: #fff;
  font-family: inherit;
  font-size: clamp(1rem, 3.6vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(58, 134, 255, 0.55),
    0 0 0 0 rgba(58, 134, 255, 0.6);
  animation: latido 2.2s ease-in-out infinite;
  transition: transform 0.18s ease, box-shadow 0.3s ease;
}

.btn-iniciar span {
  position: relative;
  z-index: 2;
}

/* Brillo que cruza el botón */
.btn-iniciar::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-20deg);
  animation: brillo 3.2s ease-in-out infinite;
}

.btn-iniciar:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 40px rgba(58, 134, 255, 0.7);
}

.btn-iniciar:active {
  transform: translateY(0) scale(0.98);
}

/* ---- Botón Repetir ---- */
.btn-replay {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.7rem 2rem;
  border: 1px solid rgba(91, 209, 255, 0.6);
  border-radius: 50px;
  background: rgba(58, 134, 255, 0.12);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(58, 134, 255, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease, background 0.3s ease;
}

.btn-replay.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.btn-replay:hover {
  background: rgba(58, 134, 255, 0.25);
}

/* ============================================================
   Animaciones
   ============================================================ */
@keyframes latido {
  0%,
  100% {
    box-shadow: 0 8px 30px rgba(58, 134, 255, 0.55),
      0 0 0 0 rgba(58, 134, 255, 0.5);
  }
  50% {
    box-shadow: 0 8px 30px rgba(58, 134, 255, 0.55),
      0 0 0 18px rgba(58, 134, 255, 0);
  }
}

@keyframes brillo {
  0% {
    left: -120%;
  }
  60%,
  100% {
    left: 140%;
  }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .btn-iniciar {
    animation: none;
  }
  .btn-iniciar::before {
    animation: none;
  }
}
