/* =========================
   RESET / BASE
========================= */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #0b0b0b;
  color: #eaeaea;
  font-family: 'Poppins', sans-serif;
}

/* =========================
   SCREENS
========================= */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  padding: 24px;
  text-align: center;
  position: relative;
}

.screen.active {
  display: block;
}

/* Pantallas centradas */
.screen.centered {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* =========================
   TIPOGRAFÍA
========================= */
h1, h2 {
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  margin: 0;
}

h1 {
  font-size: 2.2rem;
}

p {
  font-size: 1rem;
  line-height: 1.7;
}

/* =========================
   BOTONES
========================= */

button, .btn-primary, .btn-secondary {
  margin-top: 20px;
  padding: 15px 30px;
  min-height: 52px;
  width: 100%;
  border-radius: 30px;
  background: #c9a24d; /* color base fijo */
  border: none;
  color: #0b0b0b;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease; /* transición suave solo */
}

button:hover, .btn-primary:hover, .btn-secondary:hover {
  /* Sutil glow en lugar de cambiar color */
  box-shadow: 0 0 15px rgba(201,162,77,0.6);
  transform: scale(1.02);
}


/* =========================
   LOADER
========================= */
#loader {
  position: fixed;
  inset: 0;
  background: #0b0b0b;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

/* =========================
   PANTALLA 1 – CARTA
========================= */
.envelope {
  border: 2px solid #f5d76e;
  padding: 40px;
  background: linear-gradient(145deg, #111 0%, #222 100%);
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(245,215,110,.5);
  animation: floatEnvelope 3s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes floatEnvelope {
  0%, 100% { transform: translateY(0px) rotateX(0deg); }
  50% { transform: translateY(-15px) rotateX(5deg); }
}

#openLetter {
  animation: glowButton 1.5s infinite alternate;
}

@keyframes glowButton {
  from { box-shadow: 0 0 10px #f5d76e; }
  to { box-shadow: 0 0 25px #ffd700; }
}

/* =========================
   PANTALLA 2 – EXPERIENCIA
========================= */
.screen-2 {
  background: radial-gradient(circle at top left, #0a0a0a, #000);
  color: #fff;
  overflow: hidden;
  cursor: pointer;
}

.screen-2 .content {
  position: relative;
  z-index: 2;
  padding: 60px 20px 80px;
  text-align: center;
  pointer-events: none;
}

/* Texto animado rainbow */
.story {
  max-width: 90%;
  margin: 60px auto;
  font-size: 1rem;
  line-height: 1.7;
  background: linear-gradient(90deg, #f5d76e, #1abc9c, #f39c12);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbowText 5s linear infinite;
}

@keyframes rainbowText {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Glow emocional */
.glow {
  display: inline-block;
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,.7);
  animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
  0%,100% { text-shadow: 0 0 6px rgba(255,255,255,.5); }
  50% { text-shadow: 0 0 16px rgba(255,255,255,.9); }
}

/* Scroll hint animado */
.scroll-hint {
  margin-top: 40px;
  font-size: 1rem;
  opacity: 0.8;
  animation: bounceGlow 1.5s infinite;
  color: #f5d76e;
  pointer-events: auto;
}

@keyframes bounceGlow {
  0%,100% { transform: translateY(0); text-shadow: 0 0 10px #f5d76e; }
  50% { transform: translateY(10px); text-shadow: 0 0 25px #1abc9c; }
}

/* =========================
   PARTÍCULAS (FONDO)
========================= */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.25;
  pointer-events: none;
}

/* =========================
   PANTALLA 3 – CONFIRMACIÓN
========================= */
.screen-3 {
  background: #0b0b0b;
  color: #fff;
}

.screen-3 .content {
  padding: 60px 20px 100px;
  text-align: center;
}

/* Título */
.section-title {
  font-size: 1.8rem;
  margin-bottom: 40px;
}

/* Detalles */
.details p {
  margin: 12px 0;
  font-size: 1rem;
  opacity: 0.9;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 16px;
  margin-top: 20px;
  border-radius: 50px;
  background: #c9a24d; /* color fijo */
  color: #0b0b0b;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(201,162,77,.5);
}


/* Caja confirmación flotante */
.confirm-box {
  margin-top: 60px;
  padding: 40px 20px;
  border: 2px solid #f5d76e;
  border-radius: 30px;
  box-shadow: 0 0 25px rgba(245,215,110,.5);
  animation: pulseBox 2s infinite;
}

@keyframes pulseBox {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* =========================
   PANTALLA 4 – FINAL
========================= */
.screen-4 {
  background: radial-gradient(circle at top, #111 0%, #000 60%);
  color: #fff;
  overflow: hidden;
}

/* Confeti */
#confetti {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Contenido */
.screen-4 .content {
  position: relative;
  z-index: 2;
  padding: 40px 20px;
  text-align: center;
}

/* Títulos y nombres */
.final-title {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.final-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 20px;
  animation: glowPulse 2s infinite alternate;
  color: #f5d76e;
}

.final-text {
  font-size: 1rem;
  line-height: 1.7;
  opacity: .95;
}

/* Acciones */
.final-actions {
  margin-top: 40px;
}

.btn-secondary {
  margin-top: 14px;
  background: linear-gradient(45deg, #f39c12, #f5d76e, #1abc9c);
  background-size: 300% 300%;
  animation: gradientBG 3s ease infinite;
  border: 2px solid #1abc9c;
  color: #fff;
}

.btn-secondary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(201,162,77,.6);
}

/* =========================
   APARICIONES Y ANIMACIONES
========================= */
.fade-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s ease;
}

.fade-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes glowPulse {
  0% { text-shadow: 0 0 5px #f5d76e, 0 0 10px #1abc9c; }
  50% { text-shadow: 0 0 20px #f39c12, 0 0 30px #1abc9c; }
  100% { text-shadow: 0 0 5px #f5d76e, 0 0 10px #1abc9c; }
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
  font-size: 2.2rem;
  font-weight: 700;

  /* Texto más claro */
  color: #fffdf0;

  /* Glow con contraste */
  text-shadow:
    0 0 6px rgba(0,0,0,0.9),
    0 0 12px rgba(201,162,77,0.9),
    0 0 24px rgba(201,162,77,0.8);
}

.countdown div {
  background: rgba(0, 0, 0, 0.55); /* más contraste */
  padding: 12px 22px;
  border-radius: 14px;
  min-width: 70px;

  /* Borde sutil dorado */
  box-shadow:
    0 0 10px rgba(201,162,77,0.4),
    inset 0 0 8px rgba(255,255,255,0.05);
}


/* =========================
   PANTALLA 5 – DETALLES
========================= */

.screen-5 {
  background: #0b0b0b;
  color: #fff;
}

.screen-5 .content {
  padding: 60px 20px 100px;
  max-width: 800px;
  margin: auto;
  text-align: left;
}

.screen-5 h3 {
  margin-top: 40px;
  margin-bottom: 14px;
  font-size: 1.3rem;
}

.details-block p {
  margin: 10px 0;
  line-height: 1.6;
}

.details-block small {
  opacity: .7;
}

.map-container {
  margin-top: 20px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
}

.map-container iframe {
  width: 100%;
  height: 260px;
  border: 0;
}

.rules-list {
  padding-left: 18px;
}

.rules-list li {
  margin-bottom: 12px;
  line-height: 1.5;
}

.final-note {
  margin: 40px 0;
  padding: 20px;
  border: 1px dashed rgba(201,162,77,.5);
  border-radius: 16px;
  text-align: center;
}
