:root {
  --bg-black: #0a090d;
  --card-bg: #16121e;
  --accent-purple: #8a2be2;
  --light-purple: #b388ff;
  --mustard: #e1ad01;
  --khaki: #c3b091;
  --text-light: #f5f5f5;
  --glow-purple: rgba(138, 43, 226, 0.4);
  --glow-gold: rgba(225, 173, 1, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-black);
  color: var(--text-light);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Botón Flotante de Música */
.music-toggle-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--mustard));
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.music-toggle-btn.playing {
  animation: pulseMusic 1.5s infinite alternate;
}

@keyframes pulseMusic {
  0% { transform: scale(1); box-shadow: 0 0 10px var(--accent-purple); }
  100% { transform: scale(1.1); box-shadow: 0 0 22px var(--mustard); }
}

/* Pantalla de Desbloqueo */
#lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #1a0f2e 0%, var(--bg-black) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.8s ease;
}

.lock-box {
  background: var(--card-bg);
  border: 2px solid var(--mustard);
  border-radius: 20px;
  padding: 35px 25px;
  text-align: center;
  box-shadow: 0 0 35px var(--glow-purple);
  max-width: 90%;
  width: 360px;
}

.lock-icon-wrapper {
  font-size: 2.2rem;
  color: var(--mustard);
  margin-bottom: 12px;
}

.lock-box h2 {
  font-family: 'Playfair Display', serif;
  color: var(--mustard);
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.lock-box p {
  color: var(--khaki);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.code-input {
  width: 100%;
  padding: 12px;
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 10px;
  background-color: #08060c;
  border: 2px solid var(--accent-purple);
  border-radius: 10px;
  color: var(--mustard);
  outline: none;
  margin-bottom: 18px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.code-input:focus {
  border-color: var(--mustard);
  box-shadow: 0 0 12px var(--glow-gold);
}

.unlock-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-purple), var(--mustard));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.unlock-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 18px var(--light-purple);
}

.error-msg {
  color: #ff5252;
  font-size: 0.82rem;
  margin-top: 12px;
  display: none;
}

/* Contenido Principal */
#main-content {
  width: 100%;
  max-width: 850px;
  padding: 40px 20px;
  display: none;
  opacity: 0;
  transition: opacity 1s ease;
}

header {
  text-align: center;
  margin-bottom: 45px;
}

.badge-anniversary {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(225, 173, 1, 0.15);
  border: 1px solid var(--mustard);
  border-radius: 20px;
  color: var(--mustard);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

header h1 {
  font-family: 'Playfair Display', serif;
  color: var(--mustard);
  font-size: 2.2rem;
  margin-bottom: 12px;
  text-shadow: 0 0 15px var(--glow-gold);
}

header p {
  color: var(--khaki);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

/* Contador */
.counter-container {
  margin-top: 25px;
  background: rgba(22, 18, 30, 0.7);
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 14px;
  padding: 15px;
}

.counter-container h3 {
  font-size: 0.85rem;
  color: var(--khaki);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.counter-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.counter-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.counter-unit span {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--mustard);
}

.counter-unit small {
  font-size: 0.75rem;
  color: #aaa;
}

/* Línea de Tiempo */
.timeline {
  position: relative;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-purple), var(--mustard), var(--accent-purple));
  transform: translateX(-50%);
}

.year-card {
  background-color: var(--card-bg);
  border: 1px solid rgba(138, 43, 226, 0.4);
  border-radius: 16px;
  padding: 25px;
  margin: 35px 0;
  width: 45%;
  position: relative;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.year-card:hover {
  transform: translateY(-6px);
  border-color: var(--mustard);
  box-shadow: 0 10px 30px var(--glow-gold);
}

.year-card.left { left: 0; }
.year-card.right { left: 55%; }

.year-card h3 {
  font-family: 'Playfair Display', serif;
  color: var(--mustard);
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.year-card h4 {
  color: var(--khaki);
  font-size: 0.88rem;
  margin-bottom: 14px;
  font-weight: 400;
  font-style: italic;
}

.year-card p {
  color: #d1d1d1;
  font-size: 0.92rem;
  line-height: 1.7;
}

.highlight-name {
  color: var(--mustard);
  font-size: 1rem;
}

.card-icon {
  position: absolute;
  top: 22px;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--mustard), #b8860b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-black);
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: 0 0 10px var(--glow-gold);
}

.left .card-icon { right: -50px; }
.right .card-icon { left: -50px; }

/* Galería de Fotos */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.photo-frame {
  position: relative;
  width: 100%;
  padding-top: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--khaki);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.photo-frame:hover {
  transform: scale(1.05);
  border-color: var(--mustard);
  box-shadow: 0 0 12px var(--glow-gold);
}

.photo-frame img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Carta Romántica */
.romantic-letter-section {
  margin-top: 60px;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.letter-card {
  background: linear-gradient(160deg, #1d1629 0%, #120e17 100%);
  border: 2px solid var(--mustard);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 0 40px var(--glow-purple);
  position: relative;
  max-width: 750px;
  width: 100%;
}

.flower-header {
  text-align: center;
  color: var(--khaki);
  font-size: 0.85rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.flower-tag {
  color: var(--mustard);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 0.78rem;
}

.letter-card h2 {
  font-family: 'Playfair Display', serif;
  color: var(--mustard);
  text-align: center;
  font-size: 2rem;
  margin-bottom: 6px;
  text-shadow: 0 0 10px var(--glow-gold);
}

.letter-subtitle {
  text-align: center;
  color: var(--khaki);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 25px;
}

.letter-image-wrapper {
  text-align: center;
  margin: 25px 0;
}

.letter-image-wrapper img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--accent-purple);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.letter-image-wrapper img:hover {
  transform: scale(1.02);
  border-color: var(--mustard);
}

.image-caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--khaki);
  font-style: italic;
}

.letter-body {
  color: #e2e2e2;
  font-size: 0.96rem;
  line-height: 1.85;
  background: rgba(10, 9, 13, 0.6);
  padding: 25px;
  border-radius: 14px;
  border-left: 4px solid var(--mustard);
}

.letter-body p {
  margin-bottom: 16px;
}

.letter-signature {
  text-align: right;
  margin-top: 30px !important;
  font-style: italic;
  color: var(--khaki);
}

.letter-signature span {
  color: var(--mustard);
  font-weight: 600;
  font-size: 1.1rem;
  font-style: normal;
  display: block;
  margin-top: 5px;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 6, 12, 0.95);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
}

.lightbox-modal img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 14px;
  border: 2px solid var(--mustard);
  box-shadow: 0 0 35px var(--glow-purple);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 35px;
  color: var(--mustard);
  font-size: 2.8rem;
  font-weight: bold;
  cursor: pointer;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 50px;
  padding: 25px;
  background-color: var(--card-bg);
  border-radius: 16px;
  border: 1px dashed var(--khaki);
}

footer p {
  color: var(--light-purple);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Corazón Flotante */
.floating-heart {
  position: fixed;
  color: var(--mustard);
  font-size: 1.5rem;
  pointer-events: none;
  animation: floatUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  z-index: 9999;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1.6);
  }
}

/* Animaciones de Entrada (Scroll) */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Móviles */
@media (max-width: 768px) {
  header h1 { font-size: 1.75rem; }
  
  .timeline::before {
    left: 18px;
  }

  .year-card {
    width: calc(100% - 45px);
    left: 45px !important;
    padding: 20px 16px;
  }

  .left .card-icon, .right .card-icon {
    left: -40px;
    right: auto;
  }

  .letter-card {
    padding: 25px 18px;
  }

  .counter-grid {
    gap: 12px;
  }

  .counter-unit span {
    font-size: 1.2rem;
  }
}