/* ============================================
   SPLASH SCREEN — Pantalla de carga PWA (revisado)
   ============================================ */

/* Contenedor del splash screen */
#splash-screen {
  position: fixed;
  inset: 0;
  /* top/left/right/bottom */
  width: 100%;
  height: 100%;
  padding: env(safe-area-inset-top, 0)
           env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 0)
           env(safe-area-inset-left, 0);
  background: linear-gradient(-45deg, #0b0b0c, #121317, #1a1b1f, #0b0c10);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity .5s ease, visibility .5s ease;
  will-change: opacity;
}

/* Estado oculto */
#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo del splash */
.splash-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  animation: fadeInScale .8s ease-out both;
  will-change: transform, opacity;
}

.splash-logo svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(212,175,55,.4));
}

/* Título y subtítulo */
.splash-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: #d4af37;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: .5rem;
  animation: fadeInUp 1s ease-out .3s both;
}

.splash-subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: #888;
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInUp 1s ease-out .5s both;
}

/* Loader animado */
.splash-loader {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(212,175,55,.2);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  will-change: transform;
}

/* Puntos alternativos */
.splash-dots {
  display: flex;
  gap: 10px;
  margin-top: 2rem;
}

.splash-dot {
  width: 12px;
  height: 12px;
  background: #d4af37;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

.splash-dot:nth-child(2) { animation-delay: .2s; }
.splash-dot:nth-child(3) { animation-delay: .4s; }

/* Animaciones */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: scale(1); }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50%      { opacity: 1; transform: scale(1.2); }
}

/* Tema claro */
body[data-theme="light"] #splash-screen {
  background: linear-gradient(-45deg, #fafafa, #f5f5f5, #ffffff, #f8f8f8);
}

body[data-theme="light"] .splash-title { color: #6d5a45; }
body[data-theme="light"] .splash-subtitle { color: #555; }

body[data-theme="light"] .splash-loader {
  border-color: rgba(139,115,85,.2);
  border-top-color: #6d5a45;
}

body[data-theme="light"] .splash-dot {
  background: #6d5a45;
}

/* Responsive */
@media (max-width: 768px) {
  .splash-logo {
    width: 100px;
    height: 100px;
  }

  .splash-title {
    font-size: 1.5rem;
  }

  .splash-subtitle {
    font-size: .9rem;
    padding: 0 1rem;
  }
}

/* Accesibilidad: reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  #splash-screen,
  .splash-logo,
  .splash-title,
  .splash-subtitle,
  .splash-loader,
  .splash-dot {
    animation: none !important;
    transition: none !important;
  }
}