/* ╔══════════════════════════════════════════════════════════════╗
   ║           ESCAPE ROOM ROMÁNTICO — ESTILOS                  ║
   ║                                                            ║
   ║  Sistema de diseño premium con paleta oscura/cálida,       ║
   ║  glassmorphism, animaciones fluidas y responsive design.   ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* ═══════════════════════════════════════════
   VARIABLES / DESIGN TOKENS
   ═══════════════════════════════════════════ */
:root {
  /* Colores de fondo */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(18, 18, 28, 0.7);
  --bg-card-hover: rgba(25, 25, 40, 0.85);
  --bg-glass: rgba(15, 15, 25, 0.6);

  /* Acentos */
  --accent-gold: #d4a853;
  --accent-gold-light: #e8c878;
  --accent-gold-dim: rgba(212, 168, 83, 0.15);
  --accent-purple: #7c5cbf;
  --accent-purple-light: #9b7ed8;
  --accent-purple-dim: rgba(124, 92, 191, 0.15);
  --accent-blue: #1a1a3e;
  --accent-rose: #c47a8a;

  /* Texto */
  --text-primary: #f0ece2;
  --text-secondary: #8a8a9a;
  --text-muted: #55556a;

  /* Glow */
  --glow-gold: 0 0 20px rgba(212, 168, 83, 0.3);
  --glow-gold-strong: 0 0 40px rgba(212, 168, 83, 0.5);
  --glow-purple: 0 0 20px rgba(124, 92, 191, 0.3);

  /* Bordes */
  --border-subtle: rgba(212, 168, 83, 0.12);
  --border-card: rgba(212, 168, 83, 0.08);

  /* Gradientes */
  --gradient-gold: linear-gradient(135deg, #d4a853, #e8c878);
  --gradient-purple: linear-gradient(135deg, #7c5cbf, #9b7ed8);
  --gradient-night: linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #1a1a3e 100%);
  --gradient-dawn: linear-gradient(180deg, #1a1a3e 0%, #2a1a3e 30%, #3d2244 60%, #d4a853 100%);

  /* Tipografía */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-accent: 'Cormorant Garamond', Georgia, serif;

  /* Espaciado */
  --section-padding: 120px 40px;
  --card-radius: 16px;
  --btn-radius: 50px;

  /* Transiciones */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-smooth: 0.6s var(--ease-out-expo);
  --transition-fast: 0.3s var(--ease-out-quart);
}


/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Selección de texto */
::selection {
  background: rgba(212, 168, 83, 0.3);
  color: var(--text-primary);
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 83, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 168, 83, 0.5);
}


/* ═══════════════════════════════════════════
   CANVAS DE PARTÍCULAS
   ═══════════════════════════════════════════ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}


/* ═══════════════════════════════════════════
   SECCIONES — BASE
   ═══════════════════════════════════════════ */
.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--section-padding);
  z-index: 1;
}

.section-inner {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-family: var(--font-accent);
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 48px;
  font-weight: 400;
}


/* ═══════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
   ═══════════════════════════════════════════ */
.reveal-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal for child items */
.reveal-item:nth-child(2) { transition-delay: 0.1s; }
.reveal-item:nth-child(3) { transition-delay: 0.2s; }
.reveal-item:nth-child(4) { transition-delay: 0.3s; }
.reveal-item:nth-child(5) { transition-delay: 0.4s; }


/* ═══════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════ */

/* --- CTA Button (principal) --- */
.cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 48px;
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--btn-radius);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.cta-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
  box-shadow: var(--glow-gold-strong);
  transform: translateY(-2px);
}

.cta-btn:active {
  transform: translateY(0);
}

.cta-btn .btn-glow {
  position: absolute;
  inset: -2px;
  border-radius: var(--btn-radius);
  background: var(--gradient-gold);
  opacity: 0;
  filter: blur(12px);
  transition: opacity var(--transition-fast);
  z-index: -1;
}

.cta-btn:hover .btn-glow {
  opacity: 0.4;
}

.cta-btn .btn-arrow {
  display: inline-block;
  transition: transform var(--transition-fast);
}

.cta-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* --- Listen Button (audio) --- */
.listen-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  border-radius: var(--btn-radius);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.listen-btn:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
}

.listen-btn .btn-glow {
  position: absolute;
  inset: -2px;
  border-radius: var(--btn-radius);
  background: var(--gradient-gold);
  opacity: 0;
  filter: blur(10px);
  transition: opacity var(--transition-fast);
  z-index: -1;
}

.listen-btn:hover .btn-glow {
  opacity: 0.2;
}


/* ═══════════════════════════════════════════
   SECCIÓN 1: HERO
   ═══════════════════════════════════════════ */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.hero-inner {
  text-align: center;
  max-width: 700px;
}

/* Decoración superior */
.hero-decoration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
  opacity: 0;
  animation: heroDecFadeIn 1.5s var(--ease-out-expo) 0.3s forwards;
}

.hero-line {
  width: 60px;
  height: 1px;
  background: var(--gradient-gold);
  opacity: 0.5;
}

.hero-diamond {
  color: var(--accent-gold);
  font-size: 0.6rem;
  opacity: 0.7;
}

/* Título con efecto typewriter */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 16px;
  min-height: 2.8em;
  letter-spacing: -0.01em;
}

.hero-title .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-gold);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

.hero-subtitle {
  font-family: var(--font-accent);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 48px;
  opacity: 0;
  transition: opacity 1s var(--ease-out-expo);
}

.hero-subtitle.visible {
  opacity: 1;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s var(--ease-out-expo);
}

.hero-actions.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pulso sutil en el CTA */
.hero-actions .cta-btn {
  animation: ctaPulse 3s ease-in-out infinite;
}

/* Transición cinematográfica al hacer clic en "Comenzar" */
.hero-section.transitioning {
  animation: heroExit 1.2s var(--ease-out-expo) forwards;
}

/* Cuando hero desaparece */
.hero-section.hidden-hero {
  display: none;
}

/* Secciones ocultas antes de "Comenzar" */
.section.awaiting {
  display: none;
}

.section.active-section {
  display: flex;
}


/* ═══════════════════════════════════════════
   SECCIÓN 2: CONTADOR
   ═══════════════════════════════════════════ */
.counter-section {
  background: transparent;
}

.counter-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 48px 0;
  flex-wrap: wrap;
}

.counter-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.counter-number-wrap {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 90px;
  transition: border-color var(--transition-fast);
}

.counter-number-wrap:hover {
  border-color: var(--accent-gold-dim);
}

.counter-number {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.02em;
  display: block;
  transition: transform 0.3s var(--ease-out-quart);
}

.counter-number.tick {
  animation: counterTick 0.4s var(--ease-out-quart);
}

.counter-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
}

.counter-separator {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--accent-gold);
  opacity: 0.4;
  padding: 0 4px;
  align-self: flex-start;
  margin-top: 20px;
  animation: blink 1.5s step-end infinite;
}

.counter-message {
  font-family: var(--font-accent);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 32px;
}


/* ═══════════════════════════════════════════
   SECCIÓN 3: PUZZLES
   ═══════════════════════════════════════════ */
.puzzles-section {
  background: transparent;
}

/* Barra de progreso con candados */
.puzzle-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 48px;
}

.puzzle-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  font-size: 1.2rem;
  transition: all var(--transition-smooth);
  position: relative;
}

.puzzle-lock.active {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}

.puzzle-lock.solved {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
  animation: lockUnlock 0.6s var(--ease-out-expo);
}

/* Líneas entre candados */
.puzzle-lock-line {
  width: 40px;
  height: 1px;
  background: var(--border-subtle);
  transition: background var(--transition-smooth);
}

.puzzle-lock-line.completed {
  background: var(--accent-gold);
}

/* Puzzle activo */
.puzzle-active {
  margin-bottom: 32px;
}

.puzzle-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--card-radius);
  padding: 48px 40px;
  max-width: 550px;
  margin: 0 auto;
  transition: all var(--transition-smooth);
}

.puzzle-card:hover {
  border-color: var(--border-subtle);
}

.puzzle-number {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.puzzle-question {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.puzzle-input-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.puzzle-input {
  width: 100%;
  max-width: 350px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: all var(--transition-fast);
}

.puzzle-input::placeholder {
  color: var(--text-muted);
}

.puzzle-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.puzzle-input.shake {
  animation: shake 0.5s var(--ease-out-quart);
  border-color: var(--accent-rose);
}

.puzzle-input.correct {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}

.puzzle-submit-btn {
  padding: 14px 36px;
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.puzzle-submit-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
  box-shadow: var(--glow-gold);
}

.puzzle-hint {
  font-family: var(--font-accent);
  font-size: 0.95rem;
  color: var(--accent-rose);
  font-style: italic;
  margin-top: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.puzzle-hint.visible {
  opacity: 1;
}

/* Recompensa del puzzle */
.puzzle-reward {
  max-width: 600px;
  margin: 0 auto;
  display: none;
}

.puzzle-reward.visible {
  display: block;
  animation: rewardReveal 0.8s var(--ease-out-expo);
}

.reward-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent-gold);
  border-radius: var(--card-radius);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.reward-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--accent-gold-dim) 0%, transparent 70%);
  pointer-events: none;
}

.reward-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212, 168, 83, 0.2), transparent);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

.reward-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.reward-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.reward-date {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.reward-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border-card);
}

.reward-content {
  font-family: var(--font-accent);
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.8;
  margin-bottom: 24px;
}

.reward-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reward-next-btn {
  margin-top: 24px;
}

/* Puzzle completado */
.puzzle-complete {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.puzzle-complete.visible {
  display: block;
  animation: rewardReveal 0.8s var(--ease-out-expo);
}

.puzzle-complete-text {
  font-family: var(--font-accent);
  font-size: 1.3rem;
  color: var(--accent-gold);
  font-style: italic;
  margin-bottom: 24px;
}


/* ═══════════════════════════════════════════
   SECCIÓN 4: RECUERDOS
   ═══════════════════════════════════════════ */
.memories-section {
  background: transparent;
}

.memories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.memory-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: default;
  transition: all var(--transition-smooth);
  opacity: 0;
  transform: translateY(30px);
}

.memory-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.memory-card:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
  transform: translateY(-4px);
}

.memory-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-card);
  transition: transform 0.6s var(--ease-out-expo);
}

.memory-card:hover .memory-card-image {
  transform: scale(1.05);
}

.memory-card-image-wrap {
  overflow: hidden;
}

.memory-card-body {
  padding: 24px;
}

.memory-card-date {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.memory-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.memory-card-content {
  font-family: var(--font-accent);
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
}


/* ═══════════════════════════════════════════
   SECCIÓN 5: FUTURO
   ═══════════════════════════════════════════ */
.future-section {
  background: var(--gradient-night);
  position: relative;
  overflow: hidden;
}

.future-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(212, 168, 83, 0.05) 0%, transparent 100%);
  pointer-events: none;
}

.future-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.future-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--card-radius);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--transition-smooth);
  opacity: 0;
  transform: translateY(30px);
  position: relative;
  overflow: hidden;
}

.future-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-gold);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.future-card:hover::before {
  opacity: 1;
}

.future-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.future-card:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
  transform: translateY(-4px);
}

.future-card-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.future-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.future-card-desc {
  font-family: var(--font-accent);
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
}


/* ═══════════════════════════════════════════
   SECCIÓN 6: FINAL EMOCIONAL
   ═══════════════════════════════════════════ */
.finale-section {
  background: transparent;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.finale-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.finale-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-gold);
  border-radius: 50%;
  opacity: 0;
  animation: finaleParticleFall linear infinite;
}

.finale-inner {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.finale-decoration {
  margin-bottom: 40px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 1s var(--ease-out-expo);
}

.finale-decoration.revealed {
  opacity: 1;
  transform: scale(1);
}

.finale-heart {
  font-size: 2.5rem;
  color: var(--accent-rose);
  animation: heartBeat 2s ease-in-out infinite;
  display: inline-block;
}

.finale-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

.finale-message-container {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  padding: 48px 40px;
  margin-bottom: 40px;
}

.finale-quote-mark {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--accent-gold);
  opacity: 0.3;
  position: absolute;
  top: 12px;
  left: 24px;
  line-height: 1;
}

.finale-message {
  font-family: var(--font-accent);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  font-style: italic;
  line-height: 2;
  white-space: pre-line;
  text-align: left;
}

.finale-listen-btn {
  margin-bottom: 48px;
  font-size: 1.05rem;
  padding: 18px 44px;
}

.finale-closing-container {
  margin-top: 16px;
}

.finale-closing {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 500;
  color: var(--accent-gold);
  line-height: 1.6;
  margin-bottom: 20px;
}

.finale-signature {
  font-family: var(--font-accent);
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
}


/* ═══════════════════════════════════════════
   OVERLAY DE AUDIO
   ═══════════════════════════════════════════ */
.audio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out-expo);
}

.audio-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.audio-overlay-inner {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

/* Ecualizador decorativo */
.audio-equalizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 60px;
  margin-bottom: 32px;
}

.eq-bar {
  width: 4px;
  background: var(--gradient-gold);
  border-radius: 2px;
  animation: eqBounce 1.2s ease-in-out infinite;
}

.eq-bar:nth-child(1) { height: 20px; animation-delay: 0s; }
.eq-bar:nth-child(2) { height: 35px; animation-delay: 0.15s; }
.eq-bar:nth-child(3) { height: 50px; animation-delay: 0.3s; }
.eq-bar:nth-child(4) { height: 30px; animation-delay: 0.45s; }
.eq-bar:nth-child(5) { height: 25px; animation-delay: 0.6s; }

.audio-overlay-text {
  font-family: var(--font-accent);
  font-size: 1.2rem;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 24px;
}

/* Barra de progreso del audio */
.audio-progress-container {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.audio-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-gold);
  border-radius: 2px;
  transition: width 0.3s linear;
}

.audio-close-btn {
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.audio-close-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}


/* ═══════════════════════════════════════════
   BOTÓN MÚSICA AMBIENTAL
   ═══════════════════════════════════════════ */
.music-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0;
  transform: translateY(20px);
}

.music-toggle.visible {
  opacity: 1;
  transform: translateY(0);
}

.music-toggle:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}

.music-toggle.playing {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.music-icon {
  display: block;
}

.music-toggle.playing .music-icon {
  display: none;
}

.music-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.music-toggle.playing .music-bars {
  display: flex;
}

.music-bars i {
  display: block;
  width: 3px;
  background: var(--accent-gold);
  border-radius: 1px;
  animation: musicBar 0.8s ease-in-out infinite;
}

.music-bars i:nth-child(1) { height: 8px; animation-delay: 0s; }
.music-bars i:nth-child(2) { height: 14px; animation-delay: 0.2s; }
.music-bars i:nth-child(3) { height: 10px; animation-delay: 0.4s; }


/* ═══════════════════════════════════════════
   NAVEGACIÓN LATERAL (DOTS)
   ═══════════════════════════════════════════ */
.side-nav {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out-expo);
  pointer-events: none;
}

.side-nav.visible {
  opacity: 1;
  pointer-events: all;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.nav-dot:hover {
  background: var(--text-secondary);
  transform: scale(1.3);
}

.nav-dot.active {
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(212, 168, 83, 0.5);
  transform: scale(1.2);
}


/* ═══════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════ */

/* Cursor parpadeante */
@keyframes blink {
  50% { opacity: 0; }
}

/* Decoración hero fade in */
@keyframes heroDecFadeIn {
  from { opacity: 0; transform: scaleX(0.5); }
  to { opacity: 1; transform: scaleX(1); }
}

/* Pulso CTA */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.2); }
  50% { box-shadow: 0 0 0 12px rgba(212, 168, 83, 0); }
}

/* Salida cinematográfica del hero */
@keyframes heroExit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); }
}

/* Tick del contador */
@keyframes counterTick {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Shake (respuesta incorrecta) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-6px); }
  30%, 70% { transform: translateX(6px); }
}

/* Desbloqueo de candado */
@keyframes lockUnlock {
  0% { transform: scale(1); }
  40% { transform: scale(1.3) rotate(-10deg); }
  70% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Revelación de recompensa */
@keyframes rewardReveal {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brillo pulsante */
@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* Ecualizador */
@keyframes eqBounce {
  0%, 100% { height: 10px; }
  50% { height: 45px; }
}

/* Barras de música */
@keyframes musicBar {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* Latido del corazón */
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
  60% { transform: scale(1); }
}

/* Partículas doradas del final */
@keyframes finaleParticleFall {
  0% {
    opacity: 0;
    transform: translateY(-20px) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(360deg);
  }
}


/* ═══════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px 20px;
  }

  .side-nav {
    display: none;
  }

  .music-toggle {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }

  .counter-display {
    gap: 4px;
  }

  .counter-number-wrap {
    padding: 12px 14px;
    min-width: 70px;
  }

  .counter-separator {
    padding: 0 2px;
    margin-top: 16px;
  }

  .puzzle-card {
    padding: 32px 24px;
  }

  .memories-grid,
  .future-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .finale-message-container {
    padding: 32px 24px;
  }

  .finale-quote-mark {
    font-size: 3rem;
    top: 8px;
    left: 16px;
  }

  .hero-actions {
    gap: 12px;
  }

  .cta-btn {
    padding: 16px 36px;
    font-size: 0.9rem;
  }

  .listen-btn {
    padding: 12px 28px;
    font-size: 0.85rem;
  }

  .audio-overlay-inner {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .counter-display {
    flex-wrap: nowrap;
  }

  .counter-number-wrap {
    min-width: 60px;
    padding: 10px 8px;
  }

  .counter-number {
    font-size: 1.8rem;
  }

  .counter-separator {
    font-size: 1.2rem;
    margin-top: 14px;
  }

  .puzzle-question {
    font-size: 1.1rem;
  }
}

/* Hover deshabilitado en touch */
@media (hover: none) {
  .memory-card:hover {
    transform: none;
    border-color: var(--border-card);
    box-shadow: none;
  }

  .future-card:hover {
    transform: none;
    border-color: var(--border-card);
    box-shadow: none;
  }

  .future-card:hover::before {
    opacity: 0;
  }
}
