/* ============================================================
   VARIABLES Y RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Paleta rosa-blanco */
  --rosa-profundo:   #c2185b;
  --rosa-fuerte:     #e91e8c;
  --rosa-medio:      #f48fb1;
  --rosa-suave:      #fce4ec;
  --rosa-palido:     #fff0f5;
  --blanco:          #ffffff;
  --dorado:          #d4a0b0;
  --texto-oscuro:    #4a1030;
  --texto-medio:     #7b3055;
  --texto-claro:     #fff8fb;

  /* Gradientes */
  --grad-fondo:      linear-gradient(135deg, #fff0f5 0%, #fce4ec 30%, #f8bbd9 60%, #f48fb1 100%);
  --grad-portada:    linear-gradient(160deg, rgba(255,240,245,0.92) 0%, rgba(244,143,177,0.7) 60%, rgba(194,24,91,0.6) 100%);
  --grad-final:      linear-gradient(160deg, #fff0f5 0%, #fce4ec 50%, #f48fb1 100%);
  --grad-btn:        linear-gradient(135deg, #e91e8c, #c2185b);
  --grad-nav:        linear-gradient(135deg, #f48fb1, #e91e8c);

  /* Tipografía */
  --font-titulo:     'Playfair Display', Georgia, serif;
  --font-cuerpo:     'Lato', sans-serif;

  /* Espaciado base */
  --gap:   clamp(12px, 2vw, 28px);
  --radio: 20px;

  /* Sombras */
  --sombra-suave: 0 8px 40px rgba(194,24,91,0.18);
  --sombra-forte: 0 16px 60px rgba(194,24,91,0.32);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-cuerpo);
  background: var(--grad-fondo);
  min-height: 100vh;
  overflow: hidden;
  color: var(--texto-oscuro);
}

/* ============================================================
   PARTÍCULAS
   ============================================================ */
#particles-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.particle {
  position: absolute;
  font-size: clamp(14px, 2vw, 28px);
  animation: floatUp linear infinite;
  opacity: 0;
  user-select: none;
}
@keyframes floatUp {
  0%   { opacity: 0;   transform: translateY(110vh) rotate(0deg) scale(0.6); }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.5; }
  100% { opacity: 0;   transform: translateY(-10vh) rotate(360deg) scale(1.2); }
}

/* ============================================================
   PANTALLAS (SCREENS)
   ============================================================ */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
  z-index: 1;
  overflow: hidden;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}
.screen.saliendo { opacity: 0; transform: scale(0.96); }
.screen.entrando { animation: entrar 0.9s ease forwards; }
@keyframes entrar {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   PORTADA
   ============================================================ */
#portada {
  background: var(--grad-fondo);
  gap: var(--gap);
  padding: clamp(24px, 5vh, 60px) clamp(16px, 4vw, 60px);
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* Layout TV: lado a lado */
@media (min-width: 900px) {
  #portada { flex-wrap: nowrap; gap: clamp(30px, 5vw, 80px); }
}

.portada-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(248,187,217,0.4) 0%, transparent 70%);
  pointer-events: none;
}

/* Marco foto portada */
.portada-img-wrap {
  position: relative;
  flex-shrink: 0;
  width:  clamp(220px, 30vw, 480px);
  height: clamp(220px, 30vw, 480px);
}
.portada-foto {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--blanco);
  box-shadow: var(--sombra-forte), 0 0 0 12px rgba(244,143,177,0.25), 0 0 0 22px rgba(244,143,177,0.1);
  animation: latido 3.5s ease-in-out infinite;
}
@keyframes latido {
  0%,100% { box-shadow: var(--sombra-forte), 0 0 0 12px rgba(244,143,177,0.25), 0 0 0 22px rgba(244,143,177,0.1); }
  50%      { box-shadow: var(--sombra-forte), 0 0 0 18px rgba(233,30,140,0.2),  0 0 0 32px rgba(233,30,140,0.08); }
}
.portada-marco {
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 2px dashed rgba(233,30,140,0.35);
  animation: girar 18s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* Texto portada */
.portada-contenido {
  text-align: center;
  max-width: 520px;
  z-index: 2;
}
.portada-sub {
  font-family: var(--font-cuerpo);
  font-size: clamp(13px, 1.6vw, 20px);
  color: var(--rosa-profundo);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: clamp(8px, 1.5vh, 18px);
  font-weight: 700;
}
.portada-titulo {
  font-family: var(--font-titulo);
  font-size: clamp(32px, 6vw, 88px);
  color: var(--rosa-profundo);
  line-height: 1.1;
  margin-bottom: clamp(10px, 2vh, 22px);
  text-shadow: 0 2px 20px rgba(194,24,91,0.15);
  animation: brillar 4s ease-in-out infinite;
}
@keyframes brillar {
  0%,100% { text-shadow: 0 2px 20px rgba(194,24,91,0.15); }
  50%      { text-shadow: 0 2px 40px rgba(194,24,91,0.4), 0 0 60px rgba(233,30,140,0.2); }
}
.portada-subtitulo {
  font-size: clamp(15px, 2vw, 26px);
  color: var(--texto-medio);
  margin-bottom: clamp(24px, 4vh, 44px);
  font-style: italic;
  font-weight: 300;
}

/* Botón inicio */
.btn-inicio {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--grad-btn);
  color: var(--blanco);
  border: none; border-radius: 50px;
  padding: clamp(12px, 2vh, 20px) clamp(28px, 4vw, 52px);
  font-family: var(--font-cuerpo);
  font-size: clamp(14px, 1.8vw, 22px);
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 6px 30px rgba(233,30,140,0.4);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative; overflow: hidden;
}
.btn-inicio::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.btn-inicio:hover::before { opacity: 1; }
.btn-inicio:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 40px rgba(233,30,140,0.5); }
.btn-inicio:active { transform: translateY(0) scale(0.98); }
.btn-icono { font-size: 1.3em; animation: girar 4s linear infinite; }

.flores-deco {
  position: absolute; bottom: clamp(8px, 2vh, 20px); left: 0; right: 0;
  text-align: center;
  font-size: clamp(18px, 2.5vw, 32px);
  opacity: 0.5;
  letter-spacing: 0.5em;
  animation: flotar 3s ease-in-out infinite;
}
@keyframes flotar {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ============================================================
   CARRUSEL
   ============================================================ */
#carrusel-screen {
  background: var(--grad-fondo);
  flex-direction: column;
  padding: clamp(16px, 3vh, 36px) clamp(16px, 3vw, 48px);
  gap: var(--gap);
}

/* Layout TV carrusel: imagen grande a la izquierda, frase a la derecha */
@media (min-width: 900px) {
  #carrusel-screen { flex-direction: column; }
  .carrusel-main {
    flex-direction: row !important;
    align-items: center !important;
    gap: clamp(30px, 5vw, 80px) !important;
  }
  .foto-frame {
    width: clamp(320px, 38vw, 600px) !important;
    height: clamp(320px, 38vw, 600px) !important;
    flex-shrink: 0 !important;
  }
  .frase-wrap { flex: 1; text-align: left !important; }
  .frase-wrap .frase-linea { display: none; }
}

/* Contador */
.contador {
  font-family: var(--font-cuerpo);
  font-size: clamp(13px, 1.5vw, 20px);
  color: var(--rosa-profundo);
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.75;
}

/* Área principal */
.carrusel-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
  flex: 1;
  width: 100%;
  max-width: 1200px;
}

/* Marco de foto */
.foto-frame {
  position: relative;
  width:  clamp(180px, 40vw, 400px);
  height: clamp(180px, 40vw, 400px);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra-forte);
  flex-shrink: 0;
}
.carrusel-foto {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease, transform 0.5s ease;
  border-radius: var(--radio);
}
.carrusel-foto.fade-out { opacity: 0; transform: scale(0.97); }
.foto-brillo {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  border-radius: var(--radio);
  pointer-events: none;
}

/* Frase */
.frase-wrap {
  text-align: center;
  max-width: 600px;
  width: 100%;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.frase-linea {
  width: 60px; height: 2px;
  background: var(--grad-btn);
  border-radius: 2px;
  opacity: 0.5;
}
.carrusel-frase {
  font-family: var(--font-titulo);
  font-size: clamp(16px, 2.2vw, 30px);
  color: var(--texto-oscuro);
  font-style: italic;
  line-height: 1.55;
  padding: 0 clamp(8px, 2vw, 20px);
  transition: opacity 0.5s ease;
  min-height: 3em;
}
.carrusel-frase.fade-out { opacity: 0; }

/* Navegación */
.carrusel-nav {
  display: flex; align-items: center; gap: clamp(12px, 3vw, 32px);
  margin-top: auto;
}
.nav-btn {
  background: var(--grad-nav);
  border: none; border-radius: 50%;
  width:  clamp(42px, 6vw, 72px);
  height: clamp(42px, 6vw, 72px);
  color: var(--blanco);
  font-size: clamp(18px, 2.5vw, 32px);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(233,30,140,0.35);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-btn:hover:not(:disabled) { transform: scale(1.12); box-shadow: 0 8px 30px rgba(233,30,140,0.5); }
.nav-btn:active:not(:disabled) { transform: scale(0.95); }
.nav-btn:disabled { opacity: 0.35; cursor: default; }

/* Dots */
.dots-wrap { display: flex; gap: clamp(6px, 1vw, 12px); flex-wrap: wrap; justify-content: center; }
.dot {
  width:  clamp(8px, 1.2vw, 16px);
  height: clamp(8px, 1.2vw, 16px);
  border-radius: 50%;
  background: rgba(194,24,91,0.25);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  border: none;
}
.dot.active {
  background: var(--rosa-profundo);
  transform: scale(1.35);
}
.dot:hover:not(.active) { background: rgba(194,24,91,0.5); transform: scale(1.15); }

/* ============================================================
   PANTALLA FINAL
   ============================================================ */
#final-screen {
  background: var(--grad-final);
  gap: clamp(16px, 3vh, 36px);
  padding: clamp(24px, 5vh, 60px) clamp(24px, 5vw, 80px);
  text-align: center;
}
.final-deco {
  position: absolute; top: clamp(12px, 2vh, 30px); right: clamp(12px, 2vw, 40px);
  font-size: clamp(30px, 5vw, 70px);
  opacity: 0.15;
  animation: girar 20s linear infinite;
}
.final-contenido {
  display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 3vh, 32px);
  max-width: 780px;
  z-index: 2;
}
.corazon-anim {
  font-size: clamp(60px, 10vw, 130px);
  animation: corazonLatir 1.2s ease-in-out infinite;
  line-height: 1;
}
@keyframes corazonLatir {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}
.final-frase {
  font-family: var(--font-titulo);
  font-size: clamp(18px, 2.8vw, 40px);
  color: var(--texto-oscuro);
  font-style: italic;
  line-height: 1.55;
  animation: aparecer 1.2s ease forwards;
}
.separador-final {
  font-size: clamp(18px, 2.5vw, 32px);
  color: var(--rosa-medio);
  letter-spacing: 0.3em;
}
.final-firma {
  font-family: var(--font-cuerpo);
  font-size: clamp(14px, 1.8vw, 24px);
  color: var(--texto-medio);
  letter-spacing: 0.08em;
  font-weight: 300;
}
.btn-reiniciar { margin-top: clamp(8px, 2vh, 20px); }

.flores-final {
  position: absolute; bottom: clamp(10px, 2vh, 24px); left: 0; right: 0;
  text-align: center;
  font-size: clamp(20px, 3vw, 42px);
  opacity: 0.4;
  letter-spacing: 0.4em;
  animation: flotar 4s ease-in-out infinite;
}

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

/* ============================================================
   BOTÓN DE AUDIO
   ============================================================ */
.audio-btn {
  position: fixed; bottom: clamp(14px, 2.5vh, 28px); right: clamp(14px, 2.5vw, 32px);
  background: rgba(255,255,255,0.8);
  border: 2px solid rgba(194,24,91,0.3);
  border-radius: 50%;
  width:  clamp(40px, 5vw, 64px);
  height: clamp(40px, 5vw, 64px);
  font-size: clamp(16px, 2.2vw, 28px);
  cursor: pointer;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(194,24,91,0.2);
  transition: transform 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.audio-btn:hover { transform: scale(1.12); background: rgba(255,255,255,0.95); }
.audio-btn:active { transform: scale(0.95); }

/* ============================================================
   RESPONSIVE MOBILE (< 480px)
   ============================================================ */
@media (max-width: 480px) {
  #portada { padding: 20px 14px; gap: 16px; }
  .portada-img-wrap { width: 180px; height: 180px; }
  .portada-titulo { font-size: 34px; }
  .foto-frame { width: 75vw; height: 75vw; }
}

/* ============================================================
   RESPONSIVE TV (>= 1600px)
   ============================================================ */
@media (min-width: 1600px) {
  .portada-img-wrap { width: 500px; height: 500px; }
  .portada-titulo { font-size: 96px; }
  .foto-frame { width: 52vw; height: 52vh; }
  .carrusel-frase { font-size: 34px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--rosa-palido); }
::-webkit-scrollbar-thumb { background: var(--rosa-medio); border-radius: 6px; }
