/* ============================================================
   ESTILOS ROMÁNTICOS - TODO EN 1 (ANIVERSARIO 1 MES)
   ============================================================ */

:root {
  --primary-pink: #ff6584;
  --primary-rose: #ff477e;
  --soft-pink: #ffe5ec;
  --warm-gold: #f9d276;
  --deep-red: #c9184a;
  --bg-gradient: linear-gradient(135deg, #fff0f3 0%, #ffe3e8 40%, #ffd1dc 100%);
  --card-bg: rgba(255, 255, 255, 0.90);
  --card-border: rgba(255, 182, 193, 0.5);
  --shadow-soft: 0 10px 30px rgba(255, 71, 126, 0.15);
  --shadow-hover: 0 15px 40px rgba(255, 71, 126, 0.28);
  --font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Dancing Script', cursive, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: #4a2835;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 70px;
}

/* Fondo de corazones flotantes */
#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Pantalla inicial para activar música y animaciones */
.start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 240, 245, 0.96);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  text-align: center;
  padding: 24px;
}

.start-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-heart {
  font-size: 5rem;
  animation: heartbeat 1.5s infinite ease-in-out;
  margin-bottom: 20px;
  filter: drop-shadow(0 10px 25px rgba(255, 71, 126, 0.45));
}

.start-title {
  font-family: var(--font-title);
  font-size: 3.2rem;
  color: var(--deep-red);
  margin-bottom: 12px;
  line-height: 1.1;
}

.start-hint {
  font-size: 1.15rem;
  color: #724050;
  font-weight: 700;
  background: white;
  padding: 12px 28px;
  border-radius: 50px;
  box-shadow: 0 6px 20px rgba(255, 71, 126, 0.25);
  border: 1px solid #ffccd5;
}

/* Botón flotante de audio */
.top-controls {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 100;
}

.icon-btn {
  background: white;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.25s ease;
}

.icon-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.icon-btn.active {
  background: var(--primary-rose);
  color: white;
}

/* Envoltorio principal */
.main-wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ============================================================
   SECCIÓN 1: CABECERA & ÁRBOL DE AMOR (ESTILO ZEROTECH)
   ============================================================ */
.tree-hero-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 2px solid var(--card-border);
  border-radius: 30px;
  padding: 35px 25px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.tree-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffccd5;
  color: var(--deep-red);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(255, 71, 126, 0.15);
}

.tree-split-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 10px;
}

/* Columna Izquierda: Carta Máquina de Escribir y Reloj */
.tree-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tree-main-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  line-height: 1.15;
  color: var(--deep-red);
}

.typewriter-box {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid #ffd1dc;
  min-height: 140px;
}

.typewriter-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #4a2835;
  white-space: pre-wrap;
  word-wrap: break-word;
  display: inline;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.15rem;
  background-color: var(--primary-rose);
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

/* Contador de tiempo exacto */
.tree-timer-box {
  background: #fff0f3;
  border: 1px dashed #ff8fa3;
  border-radius: 18px;
  padding: 14px 18px;
  text-align: center;
}

.tree-timer-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--deep-red);
  margin-bottom: 6px;
}

.tree-timer-display {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-rose);
  font-variant-numeric: tabular-nums;
}

/* Columna Derecha: Canvas del Árbol de Corazones */
.tree-canvas-col {
  flex: 1.1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#treeCanvas {
  width: 100%;
  max-width: 460px;
  height: 420px;
  display: block;
  filter: drop-shadow(0 15px 25px rgba(255, 71, 126, 0.22));
}

/* ============================================================
   SECCIÓN 2: MINI JUEGO ("ATRAPA NUESTRO AMOR")
   ============================================================ */
.section-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 2px solid var(--card-border);
  border-radius: 30px;
  padding: 35px 24px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.section-tag {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary-rose);
  margin-bottom: 6px;
  display: block;
}

.section-title {
  font-family: var(--font-title);
  font-size: 2.4rem;
  color: var(--deep-red);
  line-height: 1.2;
}

.section-desc {
  font-size: 1rem;
  color: #724050;
  margin-top: 8px;
  margin-bottom: 20px;
}

.game-card-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(255, 71, 126, 0.2);
  border: 3px solid #ffccd5;
  background: linear-gradient(180deg, #ffeef2 0%, #fff 100%);
  touch-action: none;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 360px;
  cursor: ew-resize;
}

.progress-container {
  max-width: 500px;
  margin: 16px auto 0;
  background: #ffe3e8;
  height: 26px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid #ffccd5;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff758c 0%, #ff477e 100%);
  transition: width 0.3s ease;
  border-radius: 14px;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: #724050;
  pointer-events: none;
}

.game-msg-toast {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: white;
  color: var(--deep-red);
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(255, 71, 126, 0.25);
  border: 1px solid #ffccd5;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

.game-msg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #ff477e 0%, #ff5e7e 100%);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 71, 126, 0.35);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 71, 126, 0.45);
}

/* ============================================================
   SECCIÓN 3: CARTA EN SOBRE 3D INTERACTIVO
   ============================================================ */
.letter-section {
  position: relative;
  transition: all 0.5s ease;
}

.letter-section.locked {
  filter: blur(2px);
  opacity: 0.7;
  pointer-events: none;
}

.lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 240, 243, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 30px;
  z-index: 10;
  padding: 20px;
}

.lock-icon {
  font-size: 2.8rem;
  animation: bounce 1.5s infinite;
}

.lock-text {
  font-weight: 700;
  color: var(--deep-red);
  font-size: 1.15rem;
}

.envelope-container {
  perspective: 1000px;
  max-width: 480px;
  margin: 25px auto 0;
  cursor: pointer;
}

.envelope {
  position: relative;
  width: 100%;
  background: #ff758c;
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(255, 71, 126, 0.3);
  padding: 25px 20px;
  color: white;
  transition: transform 0.4s ease;
}

.envelope:hover {
  transform: translateY(-5px);
}

.wax-seal {
  width: 60px;
  height: 60px;
  background: #c9184a;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 12px rgba(138, 14, 50, 0.4);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  animation: heartbeat 2s infinite ease-in-out;
}

.envelope-prompt {
  font-weight: 700;
  font-size: 1.1rem;
}

.letter-paper {
  display: none;
  background: #fffdfa;
  border: 1px solid #f1e4d3;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), inset 0 0 40px rgba(255, 235, 205, 0.25);
  border-radius: 18px;
  padding: 35px 28px;
  text-align: left;
  margin-top: 25px;
  animation: unfoldLetter 0.8s ease-out forwards;
}

.letter-paper.open {
  display: block;
}

.letter-saludo {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--deep-red);
  margin-bottom: 20px;
}

.letter-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #4a2835;
  margin-bottom: 16px;
  text-indent: 1.5rem;
}

.letter-footer {
  text-align: right;
  margin-top: 25px;
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--primary-rose);
}

.letter-sign {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--deep-red);
}

/* ============================================================
   SECCIÓN 4: FOTOS POLAROID
   ============================================================ */
.photos-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.polaroid-card {
  background: white;
  padding: 14px 14px 22px 14px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  width: 275px;
  max-width: 92vw;
  transition: all 0.3s ease;
  transform: rotate(-2deg);
  cursor: pointer;
}

.polaroid-card:nth-child(2) {
  transform: rotate(2deg);
}

.polaroid-card:nth-child(3) {
  transform: rotate(-1deg);
}

.polaroid-card:hover {
  transform: scale(1.04) rotate(0deg);
  box-shadow: 0 16px 35px rgba(255, 71, 126, 0.3);
  z-index: 5;
}

.polaroid-img-wrapper {
  width: 100%;
  height: 290px;
  overflow: hidden;
  border-radius: 6px;
  background: #fdfbf7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  transition: transform 0.4s ease;
}

/* Modal Lightbox para ver foto completa sin cortes */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  cursor: pointer;
  padding: 16px;
}

.lightbox-modal.open {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.lightbox-modal img {
  max-width: 95vw;
  max-height: 85vh;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.polaroid-caption {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: #555;
  text-align: center;
  margin-top: 12px;
}

/* ============================================================
   SECCIÓN 5: CUPONES DE AMOR
   ============================================================ */
.coupons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.coupon-card {
  background: white;
  border: 2px dashed #ffb3c1;
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(255, 117, 143, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.coupon-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-rose);
}

.coupon-card.redeemed {
  opacity: 0.8;
  background: #fff5f7;
  border: 2px solid #52b788;
}

.coupon-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.coupon-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--deep-red);
  margin-bottom: 6px;
}

.coupon-desc {
  font-size: 0.9rem;
  color: #724050;
  line-height: 1.4;
  margin-bottom: 14px;
}

.coupon-btn {
  background: var(--soft-pink);
  color: var(--primary-rose);
  border: 1px solid #ffccd5;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.coupon-btn:hover {
  background: var(--primary-rose);
  color: white;
}

.coupon-card.redeemed .coupon-btn {
  background: #52b788;
  color: white;
  border-color: #52b788;
  cursor: default;
}

/* ============================================================
   SECCIÓN 6: BOTÓN ESCURRIDIZO / PREGUNTA FINAL
   ============================================================ */
.proposal-box {
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.proposal-buttons {
  position: relative;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  min-height: 60px;
}

.btn-yes {
  background: linear-gradient(135deg, #ff477e 0%, #c9184a 100%);
  color: white;
  border: none;
  padding: 14px 34px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 71, 126, 0.4);
  transition: all 0.3s ease;
  z-index: 2;
}

.btn-yes:hover {
  transform: scale(1.08);
}

.btn-no {
  background: #e0e0e0;
  color: #777;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

/* Modal de Aceptación */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: 28px;
  padding: 35px 25px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 3px solid #ffccd5;
  animation: zoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

footer {
  text-align: center;
  color: #9d5d71;
  font-size: 0.95rem;
  margin-top: 20px;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.12); }
  40% { transform: scale(1); }
  60% { transform: scale(1.08); }
}

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

/* Responsive */
@media (max-width: 820px) {
  .tree-split-layout {
    flex-direction: column-reverse;
    gap: 20px;
  }
  .tree-main-title {
    font-size: 2.2rem;
  }
  .section-title {
    font-size: 1.9rem;
  }
  #treeCanvas {
    height: 330px;
  }
  #gameCanvas {
    height: 310px;
  }
}

/* Spotify Card Section */
.spotify-card-section {
  text-align: center;
}

.spotify-player-wrapper {
  max-width: 520px;
  margin: 18px auto 0 auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(230, 57, 70, 0.18);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  padding: 4px;
}
