/* ==========================================================================
   Cena 3 — Carta do convite
   ========================================================================== */
#scene-letter {
  position: fixed;
  inset: 0;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(48, 173, 121, 0.16), transparent 55%),
    var(--forest-deep);
  padding: calc(28px + var(--sat)) 16px calc(40px + var(--sab));
  display: flex;
  justify-content: center;
}

#scene-letter.scene-active {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.5s var(--ease-soft);
}

.letter-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(175deg, #faf7ec 0%, var(--cream) 55%, #f0ead2 100%);
  border-radius: 18px;
  padding: 34px 22px 30px;
  box-shadow:
    0 20px 45px var(--shadow-deep),
    0 0 0 1px rgba(217, 184, 63, 0.35),
    inset 0 0 0 6px rgba(255,255,255,0.5);
  color: var(--forest-deep);
  opacity: 0;
  transform: scale(0.96) translateY(14px);
}

#scene-letter.scene-active .letter-card {
  animation: soft-appear 0.7s var(--ease-magic) forwards;
}

.letter-border-frame {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(217, 184, 63, 0.55);
  border-radius: 12px;
  pointer-events: none;
}

.corner-flourish {
  position: absolute;
  width: 30px;
  height: 30px;
  opacity: 0.8;
  color: var(--gold);
}
.corner-flourish.tl { top: 6px; left: 6px; }
.corner-flourish.tr { top: 6px; right: 6px; transform: scaleX(-1); }
.corner-flourish.bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.corner-flourish.br { bottom: 6px; right: 6px; transform: scale(-1); }

.letter-kicker {
  position: relative;
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--emerald);
  font-weight: 600;
  opacity: 0;
}

#scene-letter.scene-active .letter-kicker {
  animation: fade-in-up 0.8s var(--ease-magic) 0.5s forwards;
}

.letter-title {
  position: relative;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 7.6vw, 32px);
  line-height: 1.25;
  margin: 10px 0 6px;
  color: var(--forest);
}

.letter-title .word {
  display: inline-block;
  overflow: visible;
}

.letter-title .word-inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(70%) rotate(2deg);
  filter: blur(3px);
  animation: word-write 0.65s var(--ease-magic) forwards;
  animation-delay: var(--delay, 0s);
}

.letter-title .word-inner.name-highlight {
  color: var(--emerald);
  font-style: italic;
}

@keyframes word-write {
  0% { opacity: 0; transform: translateY(70%) rotate(2deg); filter: blur(3px); }
  60% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) rotate(0); filter: blur(0); }
}

.letter-sparkle {
  position: absolute;
  width: 14px;
  height: 14px;
  color: var(--gold);
  opacity: 0;
  pointer-events: none;
  animation: sparkle-pop 0.6s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.letter-divider {
  width: 64px;
  height: 2px;
  margin: 16px auto 22px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
}

#scene-letter.scene-active .letter-divider {
  animation: fade-in-up 0.8s var(--ease-magic) 1.6s forwards;
}

/* --- Itens de informação --- */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 26px;
}

.info-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(48,173,121,0.08), rgba(217,184,63,0.08));
  border: 1px solid rgba(48, 173, 121, 0.22);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
}

.info-item.reveal {
  animation: info-reveal 0.7s var(--ease-magic) forwards;
}

@keyframes info-reveal {
  0% { opacity: 0; transform: translateY(16px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.info-item::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.75), transparent);
  transform: translateX(-150%) skewX(-12deg);
  opacity: 0;
}

.info-item.reveal::after {
  animation: shimmer-sweep 1.1s ease-out 0.35s;
  opacity: 1;
}

.info-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(217,184,63,0.35);
}

.info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald);
  font-weight: 700;
}

.info-value {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--forest-deep);
  line-height: 1.3;
}

.letter-deadline {
  display: block;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--forest);
  background: rgba(217, 184, 63, 0.18);
  border: 1px solid rgba(217, 184, 63, 0.5);
  border-radius: 999px;
  padding: 6px 14px;
  width: fit-content;
  margin: 0 auto 18px;
  opacity: 0;
  transform: translateY(10px);
}

.letter-deadline.reveal {
  animation: fade-in-up 0.6s var(--ease-magic) forwards;
}

/* --- CTA --- */
.cta-wrap {
  display: flex;
  justify-content: center;
  padding-top: 4px;
  opacity: 0;
}

.cta-wrap.reveal {
  animation: fade-in-up 0.8s var(--ease-magic) forwards;
}

.confirm-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--emerald), var(--forest) 70%);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 26px rgba(37, 144, 97, 0.45), 0 0 0 1px rgba(217,184,63,0.4);
  overflow: hidden;
  animation: gentle-pulse 2.6s ease-in-out infinite;
  min-height: 52px;
}

.confirm-btn:active {
  transform: scale(0.96);
}

.confirm-btn .btn-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

.letter-footnote {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--leaf-green);
  opacity: 0;
}

.cta-wrap.reveal + .letter-footnote,
.letter-footnote.reveal {
  animation: fade-in-up 0.8s var(--ease-magic) 0.2s forwards;
}
