:root {
  --lila-claro: #f3eafd;
  --lila-suave: #e6d7f7;
  --lila-medio: #b388eb;
  --lila-fuerte: #8b5cf6;
  --lila-oscuro: #6d28d9;
  --lila-texto: #4c1d95;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #c8a8f0 0%, #a78bfa 50%, #9333ea 100%);
  background-attachment: fixed;
  color: var(--lila-texto);
  position: relative;
  overflow-x: hidden;
}

/* ===== Corazones flotantes ===== */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.heart {
  position: absolute;
  bottom: -50px;
  font-size: 1.5rem;
  opacity: 0.5;
  animation: floatUp linear infinite;
}

.heart:nth-child(1) { left: 5%;  font-size: 1.2rem; animation-duration: 12s; animation-delay: 0s; }
.heart:nth-child(2) { left: 18%; font-size: 2rem;   animation-duration: 16s; animation-delay: 2s; }
.heart:nth-child(3) { left: 30%; font-size: 1rem;   animation-duration: 10s; animation-delay: 4s; }
.heart:nth-child(4) { left: 45%; font-size: 1.6rem; animation-duration: 14s; animation-delay: 1s; }
.heart:nth-child(5) { left: 58%; font-size: 1.1rem; animation-duration: 18s; animation-delay: 5s; }
.heart:nth-child(6) { left: 70%; font-size: 2.2rem; animation-duration: 13s; animation-delay: 3s; }
.heart:nth-child(7) { left: 82%; font-size: 1.3rem; animation-duration: 15s; animation-delay: 6s; }
.heart:nth-child(8) { left: 90%; font-size: 1.7rem; animation-duration: 11s; animation-delay: 2s; }
.heart:nth-child(9) { left: 50%; font-size: 1.4rem; animation-duration: 17s; animation-delay: 7s; }

@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ===== Tarjeta de la carta ===== */
.letter-card {
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
  border: none;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  box-shadow: 0 25px 60px rgba(76, 29, 149, 0.35) !important;
  animation: cardIn 1s ease-out;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.emoji-badge {
  font-size: 3.5rem;
  animation: beat 1.6s ease-in-out infinite;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

.letter-title {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: 2.8rem;
  color: var(--lila-oscuro);
  margin-bottom: 0.2rem;
}

.letter-subtitle {
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--lila-medio);
  letter-spacing: 1px;
  margin-bottom: 0;
}

/* ===== Divisor decorativo ===== */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 1rem auto;
  max-width: 220px;
  color: var(--lila-medio);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--lila-suave), transparent);
}

.divider span {
  font-size: 0.9rem;
}

/* ===== Texto de la carta ===== */
.letter-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #3f3f5e;
  text-align: justify;
}

.letter-text .greeting {
  font-family: 'Dancing Script', cursive;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--lila-oscuro);
  text-align: left;
  margin-bottom: 1rem;
}

.letter-text strong {
  color: var(--lila-oscuro);
  font-weight: 600;
}

.letter-text em {
  color: var(--lila-fuerte);
  font-style: italic;
  font-weight: 500;
}

.letter-text .closing {
  font-family: 'Dancing Script', cursive;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--lila-fuerte);
  text-align: center;
  margin-top: 1.5rem;
}

.signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: var(--lila-medio);
  margin-bottom: 0;
}

/* ===== Responsivo ===== */
@media (max-width: 576px) {
  .letter-title { font-size: 2.2rem; }
  .letter-text { font-size: 1rem; line-height: 1.8; text-align: left; }
  .emoji-badge { font-size: 2.8rem; }
}
