/* ============================================================
   REGALO CUMPLE ALBA
   Paleta: crema #faf7f2 | burdeos #8b3a52 | dorado #c9a96e
   ============================================================ */

:root {
  --cream:         #faf7f2;
  --cream-dark:    #f0ebe0;
  --cream-shadow:  rgba(44, 24, 16, 0.06);
  --burgundy:      #8b3a52;
  --burgundy-dk:   #6b2c3e;
  --burgundy-faint:rgba(139, 58, 82, 0.08);
  --gold:          #c9a96e;
  --gold-faint:    rgba(201, 169, 110, 0.18);
  --text:          #2c1810;
  --text-mid:      #5a3a2e;
  --text-soft:     #9a7a6e;
  --white:         #ffffff;
  --shadow-lg:     0 12px 48px rgba(44, 24, 16, 0.13);
  --shadow-sm:     0 3px 18px rgba(44, 24, 16, 0.08);
  --radius-card:   22px;
  --radius-btn:    100px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden; /* screens handle their own scroll */
}

body {
  background: var(--cream);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ── Grain overlay ──────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 250px 250px;
}

/* ── Typography helpers ─────────────────────────────────── */
.label-small {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.gold { color: var(--gold); }

/* ── Gold divider ───────────────────────────────────────── */
.gold-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
}

.gold-divider::before,
.gold-divider::after {
  content: '';
  flex: 1;
  height: 1px;
}

.gold-divider::before { background: linear-gradient(to right,  transparent, var(--gold)); }
.gold-divider::after  { background: linear-gradient(to left,   transparent, var(--gold)); }

.gold-divider span { color: var(--gold); font-size: 0.9rem; }

/* ── Screens ────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   SCREEN 1 — INTRO
   ============================================================ */

#screen-intro {
  background:
    radial-gradient(ellipse 70% 60% at 15% 85%, rgba(139,58,82,0.07) 0%, transparent 100%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(201,169,110,0.09) 0%, transparent 100%),
    var(--cream);
  padding: 24px 20px;
}

/* Floating background hearts */
.floating-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-hearts span {
  position: absolute;
  bottom: -10%;
  color: var(--burgundy);
  opacity: 0;
  font-size: 1.4rem;
  animation: float-up linear infinite;
}

.floating-hearts span:nth-child(1) { left:  8%; font-size: 0.9rem;  animation-duration: 9s;  animation-delay: 0.0s; }
.floating-hearts span:nth-child(2) { left: 22%; font-size: 1.8rem;  animation-duration: 13s; animation-delay: 2.2s; }
.floating-hearts span:nth-child(3) { left: 45%; font-size: 0.75rem; animation-duration: 10s; animation-delay: 4.5s; }
.floating-hearts span:nth-child(4) { left: 67%; font-size: 1.5rem;  animation-duration: 11s; animation-delay: 1.1s; }
.floating-hearts span:nth-child(5) { left: 82%; font-size: 1.1rem;  animation-duration:  8s; animation-delay: 3.3s; }
.floating-hearts span:nth-child(6) { left: 58%; font-size: 2rem;    animation-duration: 14s; animation-delay: 6.0s; }

@keyframes float-up {
  0%   { transform: translateY(0)   rotate(-12deg); opacity: 0; }
  8%   { opacity: 0.07; }
  90%  { opacity: 0.07; }
  100% { transform: translateY(-115vh) rotate(12deg); opacity: 0; }
}

/* Intro card */
.intro-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 44px 32px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gold-faint);
  text-align: center;
  animation: rise-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 0.05s;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.name-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(4rem, 18vw, 5.5rem);
  color: var(--burgundy);
  line-height: 0.95;
  margin: 10px 0 0;
  letter-spacing: -0.02em;
}

.intro-text {
  font-size: 0.925rem;
  color: var(--text-mid);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 30px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--burgundy);
  color: var(--white);
  border: none;
  padding: 16px 30px;
  border-radius: var(--radius-btn);
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 54px;
  box-shadow: 0 6px 24px rgba(139, 58, 82, 0.32);
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}

.btn-cta:hover  { background: var(--burgundy-dk); transform: translateY(-2px); box-shadow: 0 10px 32px rgba(139, 58, 82, 0.38); }
.btn-cta:active { transform: translateY(0); box-shadow: 0 4px 16px rgba(139, 58, 82, 0.28); }

.btn-arrow {
  flex-shrink: 0;
  transition: transform 0.25s;
}

.btn-cta:hover .btn-arrow { transform: translateX(4px); }

.intro-hint {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-soft);
  font-style: italic;
  letter-spacing: 0.03em;
}

/* ============================================================
   SCREEN 2 — QUIZ
   ============================================================ */

#screen-quiz {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background:
    radial-gradient(ellipse 80% 50% at 80% 90%, rgba(139,58,82,0.05) 0%, transparent 100%),
    var(--cream);
  overflow: hidden;
}

/* Top bar */
.quiz-topbar {
  flex-shrink: 0;
  padding: 20px 24px 14px;
  background: var(--cream);
  border-bottom: 1px solid var(--gold-faint);
}

.progress-track {
  height: 3px;
  background: rgba(201, 169, 110, 0.22);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 11px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--gold), var(--burgundy));
  border-radius: 100px;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.counter-text { text-align: center; }

/* Quiz body (scrollable) */
.quiz-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 32px;
}

/* Question card */
.question-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 30px 26px 26px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gold-faint);
}

.card-ornament {
  display: block;
  text-align: center;
  color: var(--gold);
  font-size: 0.65rem;
  opacity: 0.75;
  margin-bottom: 18px;
  letter-spacing: 0.4em;
}

.question-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 5vw, 1.45rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  text-align: center;
  margin-bottom: 26px;
}

/* Options */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.opt-btn {
  width: 100%;
  min-height: 54px;
  padding: 14px 18px;
  background: var(--cream);
  border: 1.5px solid rgba(201, 169, 110, 0.28);
  border-radius: 14px;
  font-family: 'Lato', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.4;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.opt-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(201, 169, 110, 0.13);
  border: 1px solid rgba(201, 169, 110, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

/* Hover solo en dispositivos con ratón — evita el hover "pegajoso" en móvil */
@media (hover: hover) and (pointer: fine) {
  .opt-btn:hover:not(:disabled) {
    background: var(--burgundy-faint);
    border-color: var(--burgundy);
    transform: translateX(4px);
  }

  .opt-btn:hover:not(:disabled) .opt-letter {
    background: var(--burgundy);
    border-color: var(--burgundy);
    color: var(--white);
  }
}

.opt-btn:disabled { cursor: default; }

/* State: correct */
.opt-btn.is-correct {
  background: rgba(34, 139, 34, 0.07);
  border-color: #3a9e3a;
  color: #1a5c1a;
}

.opt-btn.is-correct .opt-letter {
  background: #3a9e3a;
  border-color: #3a9e3a;
  color: var(--white);
}

/* State: wrong */
.opt-btn.is-wrong {
  background: var(--burgundy-faint);
  border-color: var(--burgundy);
  color: var(--burgundy-dk);
}

.opt-btn.is-wrong .opt-letter {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--white);
}

/* Feedback message */
.feedback-msg {
  min-height: 22px;
  margin-top: 18px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--burgundy);
  font-style: italic;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feedback-msg.show { opacity: 1; }

/* Card animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%  { transform: translateX(-7px); }
  35%  { transform: translateX(7px); }
  55%  { transform: translateX(-4px); }
  75%  { transform: translateX(4px); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}

.question-card.shake     { animation: shake 0.48s ease; }
.question-card.slide-in  { animation: slide-in-right 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ============================================================
   SCREEN 3 — REVEAL
   ============================================================ */

#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

#screen-reveal {
  align-items: flex-start;
  justify-content: flex-start;
  background:
    radial-gradient(ellipse 65% 50% at 15% 20%, rgba(201,169,110,0.13) 0%, transparent 100%),
    radial-gradient(ellipse 60% 60% at 85% 85%, rgba(139,58,82,0.09) 0%, transparent 100%),
    var(--cream);
  overflow: hidden;
}

.reveal-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.reveal-content {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 52px 22px 72px;
  text-align: center;
}

.reveal-eyebrow {
  margin-bottom: 26px;
  letter-spacing: 0.5em;
}

.reveal-pre {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.reveal-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 13vw, 4.2rem);
  font-weight: 700;
  color: var(--burgundy);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.reveal-title em {
  font-style: italic;
  font-weight: 400;
}

/* Animaciones del reveal — se activan al aparecer la pantalla */
#screen-reveal.active .reveal-eyebrow { animation: fade-down 1s ease both 0.3s; }
#screen-reveal.active .reveal-pre     { animation: fade-down 1s ease both 1.0s; }
#screen-reveal.active .reveal-title   { animation: fade-down 1.1s cubic-bezier(0.22, 1, 0.36, 1) both 1.9s; }
#screen-reveal.active .reveal-divider { animation: fade-in  0.9s ease both 3.0s; }

/* Gift blocks */
.gift-block {
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gold-faint);
  margin-bottom: 20px;
  text-align: left;
}

#screen-reveal.active .gift-block              { animation: fade-up 1s ease both 3.7s; }
#screen-reveal.active .gift-block + .gift-block { animation-delay: 4.5s; }

.gift-photo-wrap {
  width: 100%;
  height: 190px;
  overflow: hidden;
  background: var(--cream-dark);
}

.gift-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-soft);
  background: linear-gradient(135deg, var(--cream-dark), var(--cream));
}

.placeholder-glyph {
  font-size: 2.6rem;
  filter: grayscale(0.3);
}

.placeholder-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.gift-copy {
  padding: 20px 22px 24px;
}

.gift-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.gift-desc {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.7;
  font-weight: 300;
}

/* Final message */
.final-message {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 28px 26px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gold-faint);
  margin-bottom: 32px;
}

#screen-reveal.active .final-message { animation: fade-up 1s ease both 5.4s; }

.final-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 16px;
}

.final-sign {
  font-size: 0.875rem;
  color: var(--burgundy);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bottom-ornament {
  letter-spacing: 0.5em;
}

#screen-reveal.active .bottom-ornament { animation: fade-in 0.9s ease both 6.2s; }

/* ── Reveal keyframes ──────────────────────────────────── */
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive tweaks ─────────────────────────────────── */
@media (max-height: 680px) {
  .intro-card { padding: 32px 26px 30px; }
  .name-title  { font-size: 3.5rem; }
  .gold-divider { margin: 14px 0; }
  .intro-text  { margin-bottom: 22px; }
}

@media (max-width: 360px) {
  .intro-card  { padding: 36px 22px 32px; }
  .question-text { font-size: 1.1rem; }
  .opt-btn     { font-size: 0.875rem; padding: 13px 15px; }
}
