/* ═══════════ FUENTES (locales) ═══════════ */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/fraunces-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/fraunces-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/caveat-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/quicksand-latin.woff2') format('woff2');
}

/* ═══════════ TOKENS ═══════════ */
:root {
  --night: #191734;
  --night-2: #241f4d;
  --coral: #ff6b8b;
  --coral-soft: #ffa7b9;
  --gold: #f7c56b;
  --gold-deep: #e8a63d;
  --sea: #3ec6b8;
  --sea-deep: #0e6f74;
  --paper: #fff8ef;
  --ink: #3a3450;
  --serif: 'Fraunces', Georgia, serif;
  --hand: 'Caveat', cursive;
  --sans: 'Quicksand', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body.locked { overflow: hidden; height: 100svh; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--night);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }

/* ═══════════ INTRO · REGALO ═══════════ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  background: radial-gradient(120% 90% at 50% 10%, #322a63 0%, var(--night) 55%, #0e0c20 100%);
  overflow: hidden;
  transition: opacity .9s ease, visibility .9s;
}
.intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* estrellitas con box-shadow múltiple */
.stars, .stars::after {
  content: '';
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    8vw 12vh 0 0 #fff8, 22vw 32vh 1px 0 #fff6, 34vw 8vh 0 0 #ffd9a8aa,
    47vw 25vh 1px 0 #fff7, 61vw 14vh 0 0 #fff5, 74vw 30vh 1px 0 #ffd9a877,
    88vw 10vh 0 0 #fff8, 15vw 55vh 1px 0 #fff5, 30vw 68vh 0 0 #ffd9a866,
    52vw 62vh 1px 0 #fff6, 70vw 74vh 0 0 #fff7, 86vw 58vh 1px 0 #fff5,
    6vw 82vh 0 0 #fff6, 42vw 88vh 1px 0 #ffd9a888, 63vw 92vh 0 0 #fff5,
    92vw 85vh 1px 0 #fff7, 79vw 45vh 0 0 #fff4, 12vw 38vh 1px 0 #fff5;
  animation: twinkle 3.5s ease-in-out infinite alternate;
}
.stars::after { animation-delay: -1.7s; transform: translate(3vw, 2vh) scale(.8); }
@keyframes twinkle { from { opacity: .4; } to { opacity: 1; } }

.intro-kicker {
  font-family: var(--hand);
  font-size: clamp(1.5rem, 6vw, 2rem);
  color: var(--coral-soft);
  letter-spacing: .5px;
  animation: fadeDown 1.2s ease both;
}
.intro-hint {
  font-size: .95rem;
  font-weight: 600;
  color: #cfc8ff;
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: pulseHint 1.8s ease-in-out infinite;
}
@keyframes pulseHint { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

/* caja de regalo en CSS */
.gift-wrap {
  position: relative;
  cursor: pointer;
  animation: floaty 3s ease-in-out infinite;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.gift { position: relative; width: 170px; height: 150px; }
.gift-box {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 150px; height: 108px;
  background: linear-gradient(160deg, var(--coral) 0%, #e2496e 70%);
  border-radius: 8px;
  box-shadow: inset 0 -14px 24px #0003, inset 0 6px 12px #fff3;
}
.ribbon-v {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 0 10px #0002;
}
.gift-lid {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 170px; height: 34px;
  background: linear-gradient(160deg, #ff85a1 0%, var(--coral) 80%);
  border-radius: 7px;
  box-shadow: 0 6px 12px #0004, inset 0 4px 8px #fff4;
  z-index: 2;
  transition: transform .65s cubic-bezier(.34, 1.3, .5, 1), opacity .6s;
}
.bow { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); }
.bow-loop {
  position: absolute;
  top: 0;
  width: 34px; height: 26px;
  border: 8px solid var(--gold);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: transparent;
}
.bow-left  { left: -34px; transform: rotate(-28deg); }
.bow-right { left: 2px;  transform: rotate(28deg); }
.bow-knot {
  position: absolute;
  top: 8px; left: -9px;
  width: 18px; height: 16px;
  background: radial-gradient(circle at 35% 30%, var(--gold), var(--gold-deep));
  border-radius: 50%;
  z-index: 2;
}
.gift-tag {
  position: absolute;
  top: -34px; right: -44px;
  z-index: 3;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 1.25rem;
  line-height: 1.1;
  padding: .45rem .8rem .5rem;
  border-radius: 6px;
  transform: rotate(10deg);
  box-shadow: 0 6px 14px #0005;
}
.gift-tag span { color: #9b93b4; font-size: .95rem; display: block; }
.gift-tag::before {
  content: '';
  position: absolute;
  left: -14px; top: 16px;
  width: 20px; height: 2px;
  background: #d9cfa9;
  transform: rotate(30deg);
}
.gift-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff6b8b33 0%, transparent 65%);
  z-index: -1;
  animation: glowPulse 2.6s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { opacity: .6; transform: scale(.95);} 50% { opacity: 1; transform: scale(1.08);} }

/* apertura */
.gift-wrap.shaking { animation: shake .5s ease-in-out; }
@keyframes shake {
  0%,100% { transform: rotate(0); }
  20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); } 80% { transform: rotate(4deg); }
}
.gift-wrap.open { animation: none; }
.gift-wrap.open .gift-lid {
  transform: translateX(-50%) translateY(-190px) rotate(-24deg);
  opacity: 0;
}

/* ═══════════ ESCENAS BASE ═══════════ */
.story { display: block; }
.scene {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(4rem, 10vh, 6rem) 1.4rem;
  overflow: hidden;
}
.scene > * { width: 100%; max-width: 520px; }

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1);
}
.reveal.visible { opacity: 1; transform: none; }

.scene-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 7vw, 2.3rem);
  text-align: center;
  margin-bottom: 2.2rem;
}
.scene-title.light { color: #fff; }

/* ═══════════ HERO ═══════════ */
.hero {
  background:
    radial-gradient(100% 60% at 50% 0%, #45307a 0%, transparent 60%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night) 70%);
  color: #fff;
  text-align: center;
}
.hero-top {
  font-size: 1.02rem;
  color: #cfc8ff;
  font-weight: 500;
  margin-bottom: 1.4rem;
}
.hero-title { display: flex; flex-direction: column; line-height: 1; }
.line-small {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 550;
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  color: var(--coral-soft);
}
.big-24 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(9rem, 42vw, 15rem);
  background: linear-gradient(120deg, var(--gold) 10%, var(--coral) 55%, #b48cff 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 30px #ff6b8b44);
  margin: .5rem 0 .2rem;
}
.line-name {
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(3.2rem, 14vw, 4.6rem);
  color: #fff;
  text-shadow: 0 4px 24px #f7c56b55;
}
.hero-sub {
  margin-top: 1.6rem;
  font-family: var(--hand);
  font-size: clamp(1.45rem, 6vw, 1.9rem);
  color: #efeaff;
}
.scroll-hint {
  position: absolute;
  bottom: max(1.6rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  color: #bdb4e8;
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.chevron {
  width: 12px; height: 12px;
  border-right: 2px solid #bdb4e8;
  border-bottom: 2px solid #bdb4e8;
  transform: rotate(45deg);
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: rotate(45deg) translate(0,0); opacity:.5; } 50% { transform: rotate(45deg) translate(4px,4px); opacity:1; } }

/* ═══════════ CARTA ═══════════ */
.letter-scene {
  background: linear-gradient(180deg, var(--night) 0%, #2b1f45 55%, #4a2b55 100%);
}
.letter {
  background: var(--paper);
  border-radius: 14px;
  padding: 2.1rem 1.7rem 1.8rem;
  box-shadow: 0 24px 60px -18px #000a, 0 2px 0 #fff inset;
  font-size: 1.06rem;
  line-height: 1.75;
  font-weight: 500;
}
.letter p + p { margin-top: 1rem; }
.letter em { font-family: var(--serif); font-style: italic; }
.letter strong { color: #c94f6d; }
.letter-hand { font-family: var(--hand); font-size: 1.7rem; color: #c94f6d; }
.letter-sign { text-align: right; font-size: 1.45rem; margin-top: 1.3rem; }

/* ═══════════ FOTOS ═══════════ */
.photos-scene {
  background: linear-gradient(180deg, #4a2b55 0%, #6d3a58 50%, #a05561 100%);
  gap: 2.4rem;
}
.photos-scene .scene-title { color: #ffe9ec; margin-bottom: 0; }
.polaroid {
  background: #fff;
  padding: 12px 12px 0;
  border-radius: 4px;
  box-shadow: 0 18px 44px -14px #0008;
  max-width: 320px;
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1);
}
.polaroid img { border-radius: 2px; aspect-ratio: 3/4; object-fit: cover; }
.polaroid figcaption {
  font-family: var(--hand);
  font-size: 1.5rem;
  text-align: center;
  padding: .7rem .3rem .9rem;
  color: #4a4160;
}
.polaroid.p-left  { transform: translateY(34px) rotate(-3.5deg); }
.polaroid.p-right { transform: translateY(34px) rotate(3deg); align-self: flex-end; }
.polaroid.p-left.visible  { transform: rotate(-3.5deg); opacity: 1; }
.polaroid.p-right.visible { transform: rotate(3deg); opacity: 1; }
.polaroid:active { transform: scale(1.04) rotate(0deg) !important; transition: transform .25s; }

/* ═══════════ SUSPENSE ═══════════ */
.tease-scene {
  background: radial-gradient(100% 80% at 50% 100%, #2c1436 0%, #14101f 70%);
  color: #fff;
  text-align: center;
  gap: 1.1rem;
}
.tease { font-family: var(--serif); }
.t1 { font-size: clamp(1.5rem, 6vw, 2rem); color: #b9aee0; font-style: italic; }
.t2 { font-size: clamp(2.1rem, 9vw, 3rem); font-weight: 700; }
.t3 { font-family: var(--sans); font-size: 1.1rem; color: #ffd9a8; margin-top: 1rem; }
.t3 strong { color: var(--gold); }

/* ═══════════ BILLETE ═══════════ */
.ticket-scene {
  background: linear-gradient(180deg, #14101f 0%, #1d2a3a 60%, #0e3d46 100%);
}
.ticket {
  -webkit-user-select: none; user-select: none;
  background: var(--paper);
  border-radius: 18px;
  padding: 1.5rem 1.4rem 1.3rem;
  box-shadow: 0 30px 70px -20px #000c;
  position: relative;
}
/* muescas laterales de billete */
.ticket::before, .ticket::after {
  content: '';
  position: absolute;
  top: 61%;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #16222e;
}
.ticket::before { left: -13px; }
.ticket::after  { right: -13px; }
.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700;
  margin-bottom: 1.1rem;
}
.ticket-logo { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .04em; color: var(--sea-deep); }
.ticket-class { font-size: .8rem; background: #ffe9c9; color: #9c6b1f; padding: .3rem .6rem; border-radius: 99px; }
.ticket-row {
  display: flex; justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}
.ticket-row small {
  display: block;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #9b93b4;
  margin-bottom: .1rem;
}
.ticket-row b { font-size: 1.02rem; }
.ticket-divider {
  border-top: 2px dashed #d8cfc0;
  margin: 1.2rem -1.4rem 1.2rem;
}
.ticket-dest-label {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9b93b4;
  text-align: center;
  margin-bottom: .6rem;
}
.scratch-zone {
  position: relative;
  height: 130px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px #e5dccb;
}
.scratch-secret {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .3rem;
  background: linear-gradient(135deg, #0e6f74, #16977f 60%, #3ec6b8);
}
.secret-place {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.6rem, 13vw, 3.6rem);
  letter-spacing: .06em;
  color: #fff;
  text-shadow: 0 4px 18px #0006;
}
.secret-sub { color: #d8fff6; font-weight: 600; font-size: 1rem; }
#scratchCanvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: grab;
  transition: opacity .8s ease;
}
#scratchCanvas.done { opacity: 0; pointer-events: none; }
.scratch-zone.celebrate .secret-place { animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes popIn { from { transform: scale(.6); } to { transform: scale(1); } }
.ticket-foot {
  margin-top: 1.1rem;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--sea-deep);
}

/* ═══════════ GALICIA ═══════════ */
.galicia-scene {
  background: linear-gradient(180deg, #0e3d46 0%, #0b4d54 45%, #063b47 100%);
  color: #eafffb;
  gap: 1.6rem;
  padding-top: 0;
}
.wave-top {
  max-width: none;
  width: 100%;
  margin: 0 -1.4rem 1rem;
  color: #16222e;
  line-height: 0;
}
.wave-top svg { width: 100%; height: 46px; transform: rotate(180deg); }
.galicia-intro { text-align: center; font-size: 1.05rem; line-height: 1.6; color: #bdeee5; margin-top: -0.6rem; }
.gcard {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px -16px #000a;
  position: relative;
}
.gcard img { width: 100%; height: 230px; object-fit: cover; }
.gcard-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.6rem 1rem .8rem;
  background: linear-gradient(0deg, #000c 0%, #0000 100%);
  color: #fff;
}
.gcard-label b { font-family: var(--serif); font-size: 1.15rem; display: block; }
.gcard-label span { font-size: .85rem; color: #cde; }
.plan {
  list-style: none;
  background: #ffffff12;
  border: 1px solid #ffffff2a;
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.plan li {
  display: flex; align-items: center; gap: .8rem;
  padding: .45rem 0;
  font-weight: 600;
  font-size: 1rem;
}
.plan li span { font-size: 1.3rem; }

/* ═══════════ FINAL ═══════════ */
.final-scene {
  background:
    radial-gradient(120% 80% at 50% 100%, #43265c 0%, transparent 60%),
    linear-gradient(180deg, #063b47 0%, var(--night) 45%);
  color: #fff;
  text-align: center;
  gap: 1.3rem;
}
.final-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.3rem, 10vw, 3.4rem);
  line-height: 1.12;
}
.final-sign { font-family: var(--hand); font-size: 1.9rem; color: var(--gold); }
.confetti-btn {
  margin-top: 1.2rem;
  align-self: center;
  width: auto;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--night);
  background: linear-gradient(120deg, var(--gold), #ffde9e);
  border: none;
  border-radius: 99px;
  padding: .95rem 1.9rem;
  cursor: pointer;
  box-shadow: 0 12px 30px -8px #f7c56b88;
  transition: transform .2s;
}
.confetti-btn:active { transform: scale(.94); }
.credits {
  margin-top: 3.2rem;
  font-size: .68rem;
  color: #8d86ad;
  line-height: 1.7;
}
.credits a { color: #a89fd0; }

/* ═══════════ ACCESIBILIDAD ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .2s !important; }
  html { scroll-behavior: auto; }
}
