/* ==========================================================================
   FLORES AMARILLAS PARA BABY - RESPONSIVE & MOBILE FIRST
   Con todo mi amor, Erik 🌻💛
   ========================================================================== */

:root {
  --primary-gold: #FFD200;
  --secondary-amber: #FFA000;
  --accent-sun: #FFF066;
  --dark-gold: #B7791F;
  --warm-leaf: #488A3E;
  --deep-leaf: #23521B;
  
  /* Ambiente cálido de atardecer íntimo */
  --bg-gradient: radial-gradient(circle at 50% 10%, #421828 0%, #270E1C 45%, #120611 100%);
  --bg-card: rgba(45, 16, 28, 0.78);
  --card-border: rgba(255, 205, 75, 0.32);
  --text-main: #FFF8EB;
  --text-muted: #EAD0C0;
  --shadow-gold: 0 10px 30px -5px rgba(255, 170, 50, 0.35);
  --shadow-strong: 0 18px 40px rgba(0, 0, 0, 0.55);
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-script: 'Dancing Script', cursive;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Canvas de Fondo para Pétalos */
#petalCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.ambient-glow {
  position: fixed;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: min(650px, 90vw);
  height: min(650px, 90vw);
  background: radial-gradient(circle, rgba(255, 190, 40, 0.14) 0%, rgba(255, 130, 0, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   LAYOUT PRINCIPAL RESPONSIVE
   ========================================================================== */
.page-container.compact-layout {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 6.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.22;
  margin-bottom: 1.25rem;
  letter-spacing: -0.5px;
  padding: 0 0.5rem;
}

.highlight-name {
  font-family: var(--font-script);
  font-weight: 700;
  color: var(--primary-gold);
  background: linear-gradient(135deg, #FFF6A4 0%, #FFD000 50%, #FFA000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding: 0 0.1em;
}

/* ==========================================================================
   SOBRE INTERACTIVO (TOTALMENTE RESPONSIVE EN CUALQUIER PANTALLA)
   ========================================================================== */
.envelope-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1000px;
  width: 100%;
}

.compact-envelope {
  position: relative;
  width: 260px;
  height: 160px;
  background: #FFF8EA;
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 210, 0, 0.3);
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.compact-envelope:hover, .compact-envelope:focus-visible {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 18px 40px rgba(255, 200, 50, 0.25), 0 0 0 2px var(--primary-gold);
}

.compact-envelope .envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 130px solid transparent;
  border-right: 130px solid transparent;
  border-top: 92px solid #F6E6C5;
  transform-origin: top;
  transition: transform 0.6s var(--ease-smooth), z-index 0.2s;
  z-index: 5;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.12));
}

.compact-envelope.open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.compact-envelope .envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 130px solid #EEDBBE;
  border-right: 130px solid #EEDBBE;
  border-bottom: 92px solid #DFCAA9;
  border-radius: 0 0 10px 10px;
  z-index: 4;
}

.compact-seal {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFEAA7 0%, #FDCB6E 50%, #D4A017 85%, #966708 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.6), inset 0 -2px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.seal-heart {
  font-size: 1.25rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.compact-peek {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  height: 105px;
  background: #FFFDF9;
  border-radius: 5px;
  padding: 0.75rem;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 2;
  transition: transform 0.4s var(--ease-smooth);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.compact-envelope:hover .compact-peek {
  transform: translateY(-14px);
}

.compact-peek .peek-title {
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--dark-gold);
  font-weight: 700;
}

.envelope-hint {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: var(--primary-gold);
  opacity: 0.9;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   MODAL DE LA CARTA (ADAPTABLE A CUALQUIER CELULAR)
   ========================================================================== */
.letter-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(14, 5, 11, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.35s ease-out, display 0.35s ease-out;
  transition-behavior: allow-discrete;
}

@starting-style {
  .letter-modal-backdrop {
    opacity: 0;
  }
  .letter-modal-card {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}

.letter-modal-backdrop[hidden] {
  display: none;
  opacity: 0;
}

.letter-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  background: #FFFDF9;
  color: #2D2214;
  border-radius: 18px;
  padding: 1.75rem 1.25rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 210, 0, 0.4);
  transform: scale(1) translateY(0);
  transition: transform 0.35s var(--ease-spring), opacity 0.3s ease;
  overscroll-behavior: contain;
}

.modal-close-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  touch-action: manipulation;
}

.modal-close-btn:hover, .modal-close-btn:active {
  background: rgba(212, 160, 23, 0.25);
  color: #111;
}

.letter-header {
  text-align: center;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

.letter-recipient {
  font-family: var(--font-script);
  font-size: clamp(2rem, 6vw, 2.6rem);
  color: #8C5400;
  font-weight: 700;
  line-height: 1.2;
}

.letter-body {
  text-align: center;
  margin: 1rem 0;
}

.letter-clean-text {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 4vw, 1.28rem);
  line-height: 1.75;
  color: #382813;
  font-style: italic;
  padding: 0.85rem 0.5rem;
}

.letter-signature {
  margin-top: 1.25rem;
  text-align: right;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.signature-intro {
  font-size: 0.9rem;
  color: #7D6B55;
  font-style: italic;
}

.signature-name {
  font-family: var(--font-script);
  font-size: clamp(2rem, 5vw, 2.3rem);
  font-weight: 700;
  color: #A35E00;
  line-height: 1.1;
}

.letter-interactive-footer {
  margin-top: 1.75rem;
  text-align: center;
}

.btn-love-burst {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, #FFD200 0%, #FFA000 100%);
  color: #2D1700;
  font-family: var(--font-sans);
  font-size: clamp(0.88rem, 3.4vw, 0.98rem);
  font-weight: 600;
  line-height: 1.35;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 175, 0, 0.4);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
  user-select: none;
  touch-action: manipulation;
  word-break: break-word;
}

.btn-love-burst:hover, .btn-love-burst:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 22px rgba(255, 175, 0, 0.55);
}

.btn-love-burst.squeeze-anim {
  animation: hugSqueeze 0.5s var(--ease-spring);
}

@keyframes hugSqueeze {
  0% { transform: scale(1); }
  35% { transform: scale(0.94); }
  65% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Animación visual de Abrazo tierno */
.hug-floating-embrace {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: warmEmbrace 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hug-emojis {
  font-size: clamp(3.2rem, 14vw, 5rem);
  filter: drop-shadow(0 8px 20px rgba(255, 200, 0, 0.6));
}

.hug-halo-ring {
  position: absolute;
  width: min(130px, 40vw);
  height: min(130px, 40vw);
  border-radius: 50%;
  border: 3px solid rgba(255, 210, 0, 0.7);
  box-shadow: 0 0 25px rgba(255, 210, 0, 0.8);
  animation: ringExpand 1.2s ease-out forwards;
}

@keyframes warmEmbrace {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  65% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

@keyframes ringExpand {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ==========================================================================
   JARDÍN INFINITO RESPONSIVE
   ========================================================================== */
.garden-interactive-section {
  width: 100%;
}

.compact-garden {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.25rem 0.85rem 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-strong);
  text-align: center;
  width: 100%;
}

.garden-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 4.5vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  line-height: 1.3;
}

.compact-garden p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 0.6rem;
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
}

.garden-counter {
  display: inline-block;
  background: rgba(255, 210, 0, 0.12);
  border: 1px solid rgba(255, 210, 0, 0.35);
  color: var(--primary-gold);
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.compact-canvas {
  position: relative;
  width: 100%;
  height: clamp(250px, 42vh, 320px);
  background: radial-gradient(circle at 50% 100%, rgba(72, 138, 62, 0.3) 0%, rgba(30, 12, 22, 0.5) 70%);
  border: 2px dashed rgba(255, 210, 0, 0.35);
  border-radius: 14px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  touch-action: manipulation;
}

.garden-soil {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 24px;
  background: linear-gradient(to top, #1c1308 0%, #2e200e 100%);
  border-top: 2px solid #5a4221;
}

.garden-prompt-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-gold);
  font-family: var(--font-script);
  font-size: clamp(1.25rem, 4.5vw, 1.55rem);
  font-weight: 700;
  pointer-events: none;
  opacity: 0.8;
  width: 90%;
  text-align: center;
}

.planted-flower {
  position: absolute;
  bottom: 20px;
  transform-origin: bottom center;
  pointer-events: auto;
  cursor: pointer;
  animation: plantGrowth 0.7s var(--ease-spring) forwards;
  touch-action: manipulation;
}

@keyframes plantGrowth {
  0% { transform: scale(0) translateY(25px); opacity: 0; }
  70% { transform: scale(1.12) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.planted-flower:hover, .planted-flower:active {
  filter: drop-shadow(0 0 10px rgba(255, 210, 0, 0.85));
}

.flower-stem-div {
  width: 3.5px;
  background: linear-gradient(to top, #2D5A27, #6BBF59);
  margin: 0 auto;
  border-radius: 3px;
}

.flower-head-div {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  margin-top: -6px;
  animation: flowerSway 3s ease-in-out infinite alternate;
}

@keyframes flowerSway {
  from { transform: rotate(-5deg); }
  to { transform: rotate(5deg); }
}

.flower-love-note {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: #FFFDF5;
  color: #2D1A00;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: clamp(0.72rem, 2.8vw, 0.8rem);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 20;
}

/* ==========================================================================
   FOOTER LIMPIO
   ========================================================================== */
.compact-footer {
  text-align: center;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid rgba(255, 210, 0, 0.12);
  display: flex;
  justify-content: center;
  width: 100%;
}

.footer-signature {
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  color: var(--text-muted);
  opacity: 0.85;
}

/* ==========================================================================
   PARTÍCULAS Y TOAST RESPONSIVE
   ========================================================================== */
.fx-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2000;
  overflow: hidden;
}

.burst-particle {
  position: absolute;
  pointer-events: none;
  font-size: clamp(1rem, 4vw, 1.3rem);
  will-change: transform, opacity;
  animation: particleFly 1.5s ease-out forwards;
}

@keyframes particleFly {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(1.3) rotate(var(--rot));
    opacity: 0;
  }
}

.toast {
  position: fixed;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: calc(100% - 2rem);
  max-width: 360px;
  text-align: center;
  background: rgba(255, 210, 0, 0.96);
  color: #2B1500;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  line-height: 1.35;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 3000;
}

/* ==========================================================================
   MEDIA QUERIES PARA CELULARES (SMARTPHONES < 480px Y < 360px)
   ========================================================================== */
@media (max-width: 480px) {
  .page-container.compact-layout {
    padding: 1.25rem 0.75rem 2rem;
    gap: 1.75rem;
  }

  .compact-envelope {
    width: 220px;
    height: 135px;
  }

  .compact-envelope .envelope-flap {
    border-left-width: 110px;
    border-right-width: 110px;
    border-top-width: 78px;
  }

  .compact-envelope .envelope-pocket {
    border-left-width: 110px;
    border-right-width: 110px;
    border-bottom-width: 78px;
  }

  .compact-seal {
    top: 68px;
    width: 42px;
    height: 42px;
  }

  .seal-heart {
    font-size: 1.05rem;
  }

  .compact-peek {
    height: 90px;
    padding: 0.65rem;
  }

  .compact-peek .peek-title {
    font-size: 1.15rem;
  }

  .compact-canvas {
    height: 260px;
  }

  .letter-modal-card {
    padding: 1.5rem 1rem 1.75rem;
  }
}

@media (max-width: 360px) {
  .compact-envelope {
    width: 190px;
    height: 118px;
  }

  .compact-envelope .envelope-flap {
    border-left-width: 95px;
    border-right-width: 95px;
    border-top-width: 68px;
  }

  .compact-envelope .envelope-pocket {
    border-left-width: 95px;
    border-right-width: 95px;
    border-bottom-width: 68px;
  }

  .compact-seal {
    top: 58px;
    width: 36px;
    height: 36px;
  }

  .seal-heart {
    font-size: 0.95rem;
  }

  .compact-canvas {
    height: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #petalCanvas {
    display: none;
  }
}
