/* ============================================================
   Feliz Cumpleaños Adri — estilos
   Estética: scrapbook hecho a mano, tinta negra sobre papel.
   Los regalos del fondo se colorean (lavanda) al pasar el mouse.
   ============================================================ */

:root {
  --ink: #2b2b2b;
  --paper: #f5f4ef;
  --paper-2: #ecebe4;

  /* Paleta lavanda del regalo (imagen 2) */
  --lav-box: #cdd4f4;
  --lav-lid: #b9c2ef;
  --lav-ribbon: #8f9ee8;
  --lav-bow: #98a6ec;
  --lav-knot: #7c8ce2;
  --lav-stroke: #5d6dc0;

  /* Acentos para regalos especiales */
  --gold: #e7c463;
  --gold-stroke: #b9912f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Shantell Sans", "Caveat", cursive;
  color: var(--ink);
  background-color: var(--paper);
  /* Textura de papel arrugado: capas de degradados suaves */
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.9), transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.7), transparent 42%),
    radial-gradient(circle at 70% 12%, rgba(0,0,0,.035), transparent 30%),
    radial-gradient(circle at 30% 85%, rgba(0,0,0,.035), transparent 30%),
    linear-gradient(135deg, var(--paper), var(--paper-2));
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ============================================================
   ESCENARIO
   ============================================================ */
.stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Botón para abrir los regalos */
.cta {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: fit-content;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: "Shantell Sans", "Caveat", cursive;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--lav-ribbon);
  transition: box-shadow .2s ease, transform .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.cta:hover {
  background: var(--lav-box);
  box-shadow: 6px 6px 0 var(--lav-ribbon);
}
.cta:active { box-shadow: 2px 2px 0 var(--lav-ribbon); }
.cta__icon { font-size: 1.3rem; }

/* ============================================================
   GALERÍA DE REGALOS (overlay a pantalla completa)
   ============================================================ */
.gifts {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 20px 40px;
  overflow-y: auto;
  /* oculto hasta que se abra (GSAP cambia visibility/opacity) */
  visibility: hidden;
  opacity: 0;
}
.gifts__backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 18%, rgba(205, 212, 244, .6), transparent 45%),
    radial-gradient(circle at 82% 82%, rgba(143, 158, 232, .35), transparent 50%),
    var(--paper);
}
.gifts__back {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: "Shantell Sans", "Caveat", cursive;
  font-size: .98rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .12);
  -webkit-tap-highlight-color: transparent;
}
.gifts__back:hover { background: var(--lav-box); }
.gifts__head { text-align: center; margin-bottom: 10px; }
.gifts__title {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  margin: 0;
  color: var(--ink);
}
.gifts__sub {
  font-family: "Caveat", cursive;
  font-size: 1.2rem;
  color: #6a6a6a;
  margin: 4px 0 0;
}

/* Regalos: ocupan la pantalla y dejan aire para las tarjetitas */
.gift-field {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 84px 48px;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 30px 10px;
}

.gift {
  position: relative;
  flex: 0 0 auto;
  width: clamp(82px, 9vw, 116px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.gift-tilt {
  display: block;
  transform-origin: center bottom;
}

.gift-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .12));
}

/* Estado por defecto: line-art (papel + tinta) */
.gift-svg .g-fill { fill: #ffffff; transition: fill .35s ease; }
.gift-svg .g-line {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: stroke .35s ease;
}

/* HOVER / activo: se colorea en lavanda */
.gift:hover .g-box,
.gift.is-open .g-box   { fill: var(--lav-box); }
.gift:hover .g-lid,
.gift.is-open .g-lid   { fill: var(--lav-lid); }
.gift:hover .g-ribbon,
.gift.is-open .g-ribbon{ fill: var(--lav-ribbon); }
.gift:hover .g-bow,
.gift.is-open .g-bow   { fill: var(--lav-bow); }
.gift:hover .g-knot,
.gift.is-open .g-knot  { fill: var(--lav-knot); }
.gift:hover .g-line,
.gift.is-open .g-line  { stroke: var(--lav-stroke); }

/* Regalos especiales (Heros = dinero, Areli = paseo) en dorado */
.gift.is-special:hover .g-box,
.gift.is-special.is-open .g-box   { fill: #f6e6ad; }
.gift.is-special:hover .g-lid,
.gift.is-special.is-open .g-lid   { fill: #f0d98c; }
.gift.is-special:hover .g-ribbon,
.gift.is-special.is-open .g-ribbon,
.gift.is-special:hover .g-bow,
.gift.is-special.is-open .g-bow   { fill: var(--gold); }
.gift.is-special:hover .g-knot,
.gift.is-special.is-open .g-knot  { fill: #d8af45; }
.gift.is-special:hover .g-line,
.gift.is-special.is-open .g-line  { stroke: var(--gold-stroke); }

/* Estrellita que aparece sobre el regalo especial */
.gift .g-star { opacity: 0; transition: opacity .35s ease; }
.gift.is-special:hover .g-star,
.gift.is-special.is-open .g-star { opacity: 1; }

/* ============================================================
   TARJETITA QUE SALE EN LA ESQUINA DEL REGALO
   ============================================================ */
.tag {
  position: absolute;
  width: clamp(158px, 17vw, 190px);
  z-index: 3;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

/* Dirección en que sale la tarjetita (la fija JS según la posición) */
.tag.dir-tr { left: 64%; bottom: 64%; transform-origin: left bottom; }
.tag.dir-tl { right: 64%; bottom: 64%; transform-origin: right bottom; }
.tag.dir-br { left: 64%; top: 64%;    transform-origin: left top; }
.tag.dir-bl { right: 64%; top: 64%;   transform-origin: right top; }

/* En móvil la tarjetita es fija y centrada en la parte baja */
.tag.tag--mobile {
  position: fixed;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 24px;
  width: min(86vw, 340px);
  transform-origin: center bottom;
  z-index: 300;
}
.tag.tag--mobile .tape { display: none; }

.gift.is-open .tag { pointer-events: auto; }

.tag__paper {
  position: relative;
  background: #fffdf6;
  border: 1px solid #e2ddcd;
  border-radius: 6px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .2);
}
/* agujerito de la etiqueta */
.tag__paper::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 9px;
  height: 9px;
  border: 1.5px solid #c9c2ad;
  border-radius: 50%;
  background: #fffdf6;
}

.tag .tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 64px;
  height: 22px;
  background: rgba(168, 178, 232, .42);
  border-left: 1px dashed rgba(255, 255, 255, .6);
  border-right: 1px dashed rgba(255, 255, 255, .6);
  z-index: 1;
}
.gift.is-special .tag .tape { background: rgba(231, 196, 99, .45); }

.tag__from {
  font-family: "Caveat", cursive;
  font-size: .82rem;
  color: #9a9a9a;
  margin: 2px 0 0 18px;
  letter-spacing: .4px;
}
.tag__name {
  font-family: "Great Vibes", cursive;
  font-size: 1.7rem;
  line-height: 1;
  margin: 2px 0 6px;
  color: var(--ink);
}
.tag__msg {
  font-family: "Caveat", cursive;
  font-size: 1.02rem;
  line-height: 1.18;
  color: #444;
  margin: 0;
}
.tag__badge {
  display: inline-block;
  margin-top: 9px;
  font-family: "Shantell Sans", cursive;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lav-ribbon);
  color: #fff;
}
.gift.is-special .tag__badge { background: var(--gold-stroke); }

/* ============================================================
   TARJETA PRINCIPAL (scrapbook)
   ============================================================ */
.card {
  position: relative;
  z-index: 5;
  width: min(560px, 94vw);
  background: #ffffff;
  border-radius: 4px;
  padding: 30px 30px 34px;
  box-shadow:
    0 1px 0 rgba(0,0,0,.04),
    0 18px 40px rgba(0, 0, 0, .14);
}
/* borde tipo papel rasgado sutil */
.card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 3px;
  pointer-events: none;
}

.washi {
  position: absolute;
  width: 86px;
  height: 26px;
  background: rgba(120, 120, 120, .28);
  z-index: 6;
}
.washi--card-tl { top: -10px; left: 30px; transform: rotate(-32deg); }
.washi--card-br { bottom: -10px; right: 30px; transform: rotate(-32deg);
  background: rgba(150, 160, 220, .32); }

.card__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 10px;
  min-height: 500px;
}
/* permite que las columnas se encojan (evita desbordes en móvil) */
.card__inner > * { min-width: 0; }

.card__text { position: relative; padding-right: 6px; min-width: 0; }

/* Título */
.title-wrap { position: relative; }
.title {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 3.5rem);
  line-height: .92;
  margin: 6px 0 0;
  color: var(--ink);
}

.message {
  position: relative;
  z-index: 3;
  font-family: "Caveat", cursive;
  font-size: clamp(1.05rem, 2.4vw, 1.32rem);
  line-height: 1.32;
  color: #333;
  width: 84%;
  margin: 96px 0 0;
  transform: rotate(-5deg);
}
.message em { font-style: normal; font-weight: 700; }

/* ----- doodles tinta ----- */
.doodle .ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.doodle { position: absolute; pointer-events: none; }

.hat { width: 52px; top: -6px; left: 250px; position: absolute; }
.streaks { width: 56px; top: 84px; left: 6px; }
.cake .flame { fill: var(--ink); }
.balloon { width: 50px; }
.balloon--1 { top: 250px; right: -6px; }
.balloon--2 { top: 320px; right: 40px; width: 42px; }
.balloon--3 { top: 150px; right: 56px; width: 32px; }
.sparkle { width: 26px; }
.sparkle--1 { top: 210px; left: 30px; width: 22px; }
.sparkle--2 { bottom: 120px; left: 130px; }
.sparkle--3 { top: 150px; right: 26px; width: 18px; }
.sparkle--4 { top: 320px; left: 14px; width: 15px; }
.star { width: 18px; }
.star--1 { top: 58px; left: 158px; }

/* ----- Firma "de tu familia" + pastel ----- */
.sign-row {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin: 28px 0 0;
}
.sign {
  position: relative;
  display: flex;
  flex-direction: column;
  transform: rotate(-4deg);
  padding-bottom: 4px;
}
.sign__pre {
  font-family: "Caveat", cursive;
  font-size: 1rem;
  color: #6a6a6a;
  margin-left: 10px;
}
.sign__fam {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.7rem, 4.6vw, 2.2rem);
  line-height: .85;
  color: var(--ink);
}
.sign__heart {
  position: absolute;
  right: -14px;
  bottom: 0;
  width: 22px;
  height: 22px;
  fill: #d96f93;
}
.float-heart {
  position: absolute;
  left: 8px;
  bottom: 26px;
  font-size: 14px;
  pointer-events: none;
  z-index: 6;
  will-change: transform, opacity;
}
.sign-row .cake {
  position: relative;
  bottom: auto;
  left: auto;
  width: 94px;
  flex: 0 0 auto;
  align-self: flex-end;
}

/* ----- Lluvia de confeti dentro de la tarjeta ----- */
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  border-radius: 4px;
}
.confetti i {
  position: absolute;
  top: -18px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  opacity: .8;
  will-change: transform;
}

/* ============================================================
   TIRA DE PELÍCULA (FILMSTRIP)
   ============================================================ */
.filmstrip { position: relative; display: flex; align-items: center; min-width: 0; }
.tape {
  position: absolute;
  left: 50%;
  width: 96px;
  height: 30px;
  background: rgba(120, 120, 120, .26);
  z-index: 4;
}
.tape--top { top: -14px; transform: translateX(-60%) rotate(8deg); }
.tape--bottom { bottom: -14px; transform: translateX(-40%) rotate(-7deg); }

.film {
  position: relative;
  display: flex;
  background: #161616;
  border-radius: 4px;
  padding: 0 12px;
  width: 100%;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
  transform: rotate(1.5deg);
}
.film__holes {
  width: 14px;
  margin: 8px 0;
  background-image:
    linear-gradient(#161616 0 0),
    repeating-linear-gradient(#fff 0 9px, #161616 9px 18px);
  background-size: 100% 100%, 8px 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 2px;
}
.film__frames {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 9px 6px;
}
.frame {
  position: relative;
  margin: 0;
  flex: 1;
  min-width: 0;
  min-height: 150px;
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
}
.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05);
}
.frame figcaption {
  position: absolute;
  inset: auto 0 0 0;
  font-family: "Caveat", cursive;
  font-size: .95rem;
  text-align: center;
  color: #fff;
  padding: 14px 4px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  opacity: 0;
  transition: opacity .3s ease;
}
.frame:hover figcaption { opacity: 1; }

/* Foto faltante -> degradado de relleno */
.frame img.is-missing { display: none; }
.frame:has(img.is-missing)::before {
  content: "Adri";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Great Vibes", cursive;
  font-size: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #b9c2ef, #8f9ee8 60%, #7c8ce2);
}

/* Bloquea el scroll del fondo cuando la galería está abierta */
body.gifts-open { overflow: hidden; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .stage { min-height: 100dvh; padding: 30px 16px 96px; flex-direction: column; }
  .card__inner { grid-template-columns: 1fr; min-height: auto; }
  .card__text { min-height: 320px; }
  .message { margin-top: 88px; }
  .filmstrip { margin-top: 28px; }
  .film { transform: rotate(0deg); }
  .frame { min-height: 132px; }

  /* El botón pasa a estar en el flujo, debajo de la tarjeta */
  /* Botón fijo abajo y centrado: siempre visible y a mano */
  .cta {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    margin-inline: auto;
    width: fit-content;
    z-index: 80;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22), 4px 4px 0 var(--lav-ribbon);
  }

  .gift-field { gap: 70px 26px; max-width: 560px; }
}

/* ---------- Teléfonos ---------- */
@media (max-width: 600px) {
  .card { width: 94vw; padding: 22px 20px 26px; }
  .card__inner { gap: 4px; }

  .title { font-size: clamp(2.4rem, 13vw, 3.1rem); }
  .hat { width: 44px; left: auto; right: 6px; top: 0; }
  .message {
    width: 100%;
    margin-top: 80px;
    font-size: 1.18rem;
    transform: rotate(-3deg);
  }
  .sign-row { margin-top: 22px; }
  .sign__fam { font-size: 2rem; }
  .sign-row .cake { width: 84px; }

  /* Reduce el desorden de doodles en pantallas chicas */
  .balloon--2, .balloon--3, .sparkle--2, .sparkle--4 { display: none; }
  .balloon--1 { top: 232px; right: 0; width: 42px; }
  .sparkle--1 { top: 196px; left: 14px; }
  .sparkle--3 { top: 130px; right: 12px; }
  .star--1 { top: 50px; left: auto; right: 70px; }

  .frame { min-height: 120px; }

  /* Galería */
  .gifts { padding: 64px 14px 30px; justify-content: flex-start; }
  .gifts__head { margin-top: 6px; }
  .gifts__title { font-size: clamp(2.2rem, 11vw, 3rem); }
  .gifts__back { top: 12px; left: 12px; padding: 8px 14px; font-size: .9rem; }

  .gift-field { gap: 54px 18px; max-width: 420px; padding: 14px 6px 20px; }
  .gift { width: clamp(72px, 26vw, 96px); }
}

@media (max-width: 380px) {
  .gift-field { gap: 48px 14px; }
  .gift { width: 30vw; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
