:root {
  --bg: #f8f4ec;
  --paper: #fffdf8;
  --ink: #3a3330;
  --muted: #8a7f76;
  --gold: #9a7442;
  --gold-soft: #f1e7d6;
  --olive: #6b7a55;
  --wine: #8c2f3c;
  --wine-soft: #f6e6e8;
  --line: #e7dccb;
  --shadow: 0 20px 50px -20px rgba(80, 60, 30, .25), 0 2px 6px rgba(80, 60, 30, .06);
  --serif: "Playfair Display", Georgia, serif;
  --body: "Lora", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ================= JUEGO ================= */
.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 24px;
  gap: 22px;
}

.stage[hidden] { display: none; }

.topbar { width: 100%; max-width: 420px; text-align: center; }
.kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: .6; }
.progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--gold); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress-labels {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 10px;
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.progress-labels span:last-child { text-align: right; }

.card {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 420px;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 40px 26px 34px;
  overflow: hidden;
}
.card.enter { animation: cardIn .5s cubic-bezier(.2,.8,.2,1); }
.card.shake { animation: shake .5s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); }
}

.badge-icon {
  width: 74px; height: 74px; margin: 0 auto 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--line);
  display: grid; place-items: center;
  font-size: 22px; color: var(--gold);
}
.badge-icon svg { width: 26px; height: 26px; }
.badge-icon--fail { background: var(--wine-soft); color: var(--wine); border-color: #e8c9ce; box-shadow: none; }

.eyebrow {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 10px;
}
.question {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 7.4vw, 38px); line-height: 1.12;
  margin: 0 0 28px; text-align: center;
  letter-spacing: -.01em;
}

/* Sí / NO */
.yesno { display: flex; justify-content: center; align-items: center; gap: 18px; min-height: 64px; }
.btn-yes {
  border: 0; border-radius: 12px;
  background: var(--gold); color: #fff;
  font-family: var(--sans); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 13px;
  padding: 15px 40px;
  box-shadow: 0 8px 20px -8px rgba(154, 116, 66, .7);
  transition: transform .25s, background .2s;
}
.btn-yes:hover { background: #87643a; }
.btn-no {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--muted);
  font-family: var(--sans); font-weight: 600; letter-spacing: .14em; font-size: 12px;
  padding: 12px 26px;
  transition: left .28s cubic-bezier(.3,1.4,.5,1), top .28s cubic-bezier(.3,1.4,.5,1);
  touch-action: none;
  z-index: 2;
}
.btn-no.loose { position: absolute; }
.no-taunt {
  text-align: center; font-style: italic; color: var(--muted); font-size: 14px;
  min-height: 22px; margin: 18px 0 0;
}

/* Opciones */
.options { display: grid; gap: 10px; }
.option {
  text-align: left;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff;
  padding: 14px 18px;
  font-size: 15.5px;
  transition: border-color .2s, background .2s, transform .15s;
}
.option:hover { border-color: #d3c1a4; background: #fffaf2; }
.option:active { transform: scale(.985); }
.option.picked { border-color: var(--gold); background: var(--gold-soft); }
.option:disabled { cursor: default; }

/* Veredictos */
.verdict { text-align: center; }
.verdict-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(36px, 10vw, 52px); line-height: 1;
  text-transform: uppercase; color: var(--wine);
  margin: 0 0 18px;
}
.verdict-title .x { color: #d42a2a; font-family: var(--sans); font-weight: 600; }
.verdict-sub {
  font-family: var(--sans); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  font-size: 13px; margin: 0 0 8px;
}
.verdict-text { font-family: var(--serif); font-style: italic; color: var(--wine); font-size: 19px; margin: 0 0 4px; }
.verdict-text strong { font-style: normal; letter-spacing: .04em; }
.verdict-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.pill {
  border-radius: 999px; padding: 10px 18px;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.pill--status { background: var(--wine-soft); color: var(--wine); border: 1px solid #e8c9ce; }
.pill--retry { background: transparent; border: 1px solid var(--ink); color: var(--ink); }
.pill--retry:hover { background: var(--ink); color: #fff; }

.verdict--win .verdict-title { color: var(--olive); }
.win-photo {
  width: 170px; height: 220px; margin: 0 auto 24px;
  border-radius: 90px 90px 14px 14px; overflow: hidden;
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--line);
}
.win-photo img { width: 100%; height: 100%; object-fit: cover; }
.btn-open {
  margin-top: 26px;
  border: 0; border-radius: 14px; background: var(--olive); color: #fff;
  font-family: var(--sans); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: 13px;
  padding: 16px 28px;
  box-shadow: 0 10px 24px -10px rgba(107, 122, 85, .8);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { transform: scale(1.04); } }

.footnote {
  font-family: var(--sans); font-size: 10px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
  text-align: center; margin: 0; max-width: 420px;
}

/* ================= INVITACIÓN ================= */
#invitacion {
  --cream: #f8f2e8;
  --gold-ink: #8b6a3a;
  --gold-line: #c3a574;
  --text: #3d3832;
  --elegant: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", cursive;
  padding: 24px 16px 40px;
  font-family: var(--elegant);
  color: var(--text);
  font-variant-numeric: lining-nums;
}
#invitacion[hidden] { display: none; }

.paper {
  position: relative;
  max-width: 560px; margin: 0 auto;
  background: radial-gradient(120% 80% at 50% 40%, #fdfaf4 0%, var(--cream) 70%, #f2e9da 100%);
  box-shadow: 0 30px 60px -30px rgba(90, 65, 30, .35), 0 1px 3px rgba(90, 65, 30, .08);
  padding: 120px 30px 150px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.paper::before {
  content: ""; position: absolute; inset: 14px;
  border: 1px solid var(--gold-line);
  pointer-events: none; z-index: 0;
}
.flor { position: absolute; width: 190px; height: auto; pointer-events: none; z-index: 1; }
.flor--tl { top: -22px; left: -30px; }
.flor--br { bottom: -22px; right: -30px; transform: rotate(180deg); }
@media (min-width: 560px) { .flor { width: 210px; } }

.paper > :not(.flor) { position: relative; z-index: 2; }

.cross { width: 18px; height: 28px; color: var(--gold-ink); margin: 0 auto 18px; display: block; }

.verse { font-style: italic; font-size: 19px; line-height: 1.45; margin: 0 auto 34px; max-width: 360px; letter-spacing: .01em; }
.verse cite { display: block; font-style: normal; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-ink); margin-top: 10px; }

.names h1 {
  font-family: var(--elegant); font-weight: 500; color: var(--gold-ink);
  font-size: clamp(46px, 14vw, 68px); line-height: .95; margin: 0;
  letter-spacing: .14em; text-transform: uppercase; padding-left: .14em;
}
.names .surname { color: var(--gold-ink); text-transform: uppercase; letter-spacing: .38em; padding-left: .38em; font-size: 15px; font-weight: 500; margin: 8px 0 0; }
.names .amp {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 6px auto; max-width: 280px;
}
.names .amp::before, .names .amp::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line)); }
.names .amp::after { background: linear-gradient(270deg, transparent, var(--gold-line)); }
.names .amp span { font-family: var(--script); color: var(--gold-ink); font-size: 54px; line-height: 1; transform: translateY(-4px); }

.lead { font-size: 20px; line-height: 1.4; margin: 30px auto 12px; max-width: 400px; letter-spacing: .02em; }
.event {
  font-family: var(--elegant); font-weight: 500; color: var(--gold-ink); text-transform: uppercase;
  font-size: clamp(17px, 4.8vw, 22px); letter-spacing: .2em; padding-left: .2em; margin: 0 0 6px;
}

.divider { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold-ink); margin: 6px auto 26px; max-width: 240px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--gold-line); opacity: .8; }
.divider svg { width: 30px; height: 12px; flex: none; }
.divider--sm { max-width: 140px; margin: 0 auto 18px; }
.divider--heart { max-width: 160px; margin: 6px auto 14px; }
.divider--heart span { font-size: 14px; color: var(--gold-ink); }

.info { display: grid; grid-template-columns: 1.15fr .8fr 1.15fr; margin: 0 -8px 8px; }
.info > div { padding: 0 6px; }
.info > div + div { border-left: 1px solid var(--gold-line); }
.info .icon { width: 26px; height: 26px; color: var(--gold-ink); margin-bottom: 8px; }
.info p { margin: 0; font-size: 14.5px; line-height: 1.3; text-transform: uppercase; letter-spacing: .04em; }
.info strong { font-weight: 600; }
.info span { text-transform: none; letter-spacing: .02em; font-size: 15px; }

.church { margin: 10px -30px 16px; }
.church img {
  width: 100%; height: auto;
  --fade-y: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
  --fade-x: linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-image: var(--fade-y), var(--fade-x);
  -webkit-mask-composite: source-in;
          mask-image: var(--fade-y), var(--fade-x);
          mask-composite: intersect;
  filter: sepia(.18) saturate(.9) brightness(1.04);
}

.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 11px 22px; text-decoration: none;
  font-family: var(--elegant); font-size: 15px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.btn .icon { width: 17px; height: 17px; }
.btn--gold { background: var(--gold-ink); color: #fff; }
.btn--gold:hover { background: #76592f; }
.btn--ghost { border: 1px solid var(--gold-ink); color: var(--gold-ink); }
.btn--ghost:hover { background: rgba(139, 106, 58, .08); }

.note { font-size: 18.5px; line-height: 1.45; margin: 0 auto 18px; max-width: 420px; letter-spacing: .02em; }
.joy { font-size: 19px; margin: 0; letter-spacing: .03em; }

.section-kicker {
  font-family: var(--elegant); font-size: 15px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-ink); text-align: center; margin: 0 0 12px;
}
.section-title {
  font-family: var(--elegant); font-weight: 500; text-align: center;
  font-size: clamp(25px, 6.6vw, 34px); line-height: 1.2; margin: 0 auto 14px; max-width: 620px;
}
.section-title em { color: var(--gold-ink); }

.countdown-wrap { max-width: 520px; margin: 60px auto; text-align: center; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); }
.countdown div { padding: 4px; }
.countdown div + div { border-left: 1px solid var(--gold-line); }
.countdown span { display: block; font-family: var(--elegant); font-weight: 500; font-size: clamp(38px, 11vw, 52px); color: var(--gold-ink); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.countdown small { font-size: 13px; letter-spacing: .24em; text-transform: uppercase; }
.countdown.done { display: block; font-size: 30px; color: var(--gold-ink); }

.gallery-wrap { max-width: 1000px; margin: 0 auto 64px; }
.gallery { columns: 2; column-gap: 10px; }
@media (min-width: 720px) { .gallery { columns: 3; column-gap: 14px; } }
.gallery button {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  margin: 0 0 10px; break-inside: avoid; border-radius: 4px; overflow: hidden;
  box-shadow: 0 10px 24px -14px rgba(90, 65, 30, .5);
}
.gallery img { width: 100%; height: auto; transition: transform .5s; }
.gallery button:hover img { transform: scale(1.04); }

.paper--gift { padding-top: 140px; }
.gift-title {
  font-family: var(--elegant); font-weight: 500; color: var(--gold-ink); text-transform: uppercase;
  font-size: clamp(34px, 10vw, 48px); line-height: 1.05; letter-spacing: .16em; padding-left: .16em; margin: 0 0 12px;
}
.gift-title span { display: block; font-size: .5em; letter-spacing: .34em; margin-top: 8px; }
.gift-lead { font-size: 20px; line-height: 1.4; margin: 0 auto 18px; max-width: 380px; letter-spacing: .02em; }
.gift-text { font-size: 18.5px; line-height: 1.45; margin: 0 auto 14px; max-width: 400px; letter-spacing: .02em; }
.gift-box {
  border: 1px solid var(--gold-line); border-radius: 14px;
  background: rgba(255, 255, 255, .35);
  padding: 24px 16px 20px; margin: 30px 0 34px;
}
.gift-box__title { color: var(--gold-ink); text-transform: uppercase; font-size: 16px; font-weight: 600; letter-spacing: .3em; padding-left: .3em; margin: 0 0 10px; }
.icon--bank { width: 32px; height: 32px; color: var(--gold-ink); margin: 0 auto 14px; display: block; }
.alias-list { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 10px 14px; margin: 0; font-size: 18px; }
.alias-list dt { font-weight: 600; text-align: right; }
.alias-list dd { margin: 0; text-align: left; letter-spacing: .06em; display: flex; align-items: center; gap: 10px; }
.copy {
  border: 1px solid var(--gold-line); background: transparent; border-radius: 999px;
  font-family: var(--elegant); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  padding: 4px 11px; color: var(--gold-ink);
}
.copy:hover { background: rgba(139, 106, 58, .08); }
.signoff { margin: 0 0 4px; font-size: 19px; letter-spacing: .04em; }
.signature { font-family: var(--script); color: var(--gold-ink); font-size: clamp(40px, 12vw, 54px); line-height: 1.1; margin: 0; }
.signature span { font-size: .8em; }

.site-footer { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 40px 0 10px; }
.credit {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--elegant); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; opacity: .7; transition: opacity .2s;
}
.credit:hover { opacity: 1; }
.credit img { height: 20px; width: auto; }
.link-btn { background: none; border: 0; color: var(--muted); font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-decoration: underline; text-underline-offset: 4px; }

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(25, 20, 15, .9); }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 8px; object-fit: contain; }
.lb-close, .lb-nav {
  position: fixed; border: 0; background: rgba(255,255,255,.12); color: #fff;
  width: 46px; height: 46px; border-radius: 50%; font-size: 28px; line-height: 1;
  display: grid; place-items: center;
}
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; translate: 0 -50%; }
.lb-next { right: 12px; top: 50%; translate: 0 -50%; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 20px;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-family: var(--sans); font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .25s, translate .25s; z-index: 50; white-space: nowrap;
}
.toast.show { opacity: 1; translate: -50% 0; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

.eyebrow { text-align: center; }
.question, .verse, .lead, .note, .section-title, .gift-lead, .gift-text, .joy { text-wrap: balance; }
