/* ==========================================================================
   Calendario de Adviento — sitio
   Usa SOLO los tokens de brand.css · Desarrollado por analize
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
/* El espacio de la barra de desplazamiento queda reservado: al abrir o cerrar
   una tarjeta la grilla no cambia de ancho y la ventana no salta. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-text);
  font-size: var(--fs-body);
  color: var(--blanco);
  background: var(--rosa);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Fondo de marca: rosa + lunares blancos + viñeta frambuesa */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(130% 90% at 50% 0%, transparent 55%, rgba(142, 15, 67, .45) 100%),
    radial-gradient(circle, rgba(255, 255, 255, .14) 1.6px, transparent 2px) 0 0 / 30px 30px,
    var(--rosa);
}

body.cover-on, html:has(body.cover-on), html.modal-open { overflow: hidden; }
button { font: inherit; }

/* ------------------------------------------------------------------ */
/* Capas                                                               */
/* ------------------------------------------------------------------ */
.layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.layer[hidden] { display: none; }
.layer--snow { z-index: 35; }
.layer--warp { z-index: 60; }
.layer--fx { z-index: 70; }
.flash {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(60% 50% at 50% 45%, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 75%);
}

/* ------------------------------------------------------------------ */
/* Moño (mismo dibujo en portada y tablero)                            */
/* ------------------------------------------------------------------ */
.bow__loop { fill: var(--palo); }
.bow__tail { fill: var(--palo); }
.bow__knot { fill: var(--palo); }
.bow__shade { fill: var(--frambuesa); opacity: .16; }
.bow__light { fill: var(--blanco); opacity: .6; }
.bow { filter: drop-shadow(0 12px 16px rgba(142, 15, 67, .35)); }

/* ------------------------------------------------------------------ */
/* PORTADA                                                             */
/* ------------------------------------------------------------------ */
.cover {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  will-change: transform;
  --p: 0;
  box-shadow: 0 30px 80px rgba(142, 15, 67, .6);
}
.cover__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 50%, rgba(142, 15, 67, .35) 100%),
    radial-gradient(circle, rgba(255, 255, 255, .2) 1.8px, transparent 2.3px) 0 0 / 28px 28px,
    var(--rosa);
}
.cover__bg::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .16) 48%, transparent 56%);
  animation: cover-sheen 6.5s ease-in-out infinite;
}
@keyframes cover-sheen {
  0%, 35% { transform: translateX(-60%); }
  75%, 100% { transform: translateX(60%); }
}

.cover__ribbon {
  position: absolute;
  top: -4%;
  bottom: -4%;
  left: 50%;
  width: clamp(70px, 16vw, 124px);
  translate: -50% 0;
  background:
    linear-gradient(90deg, rgba(142, 15, 67, .12), transparent 25%, rgba(255, 255, 255, .45) 45%, transparent 65%, rgba(142, 15, 67, .12)),
    var(--palo);
}
.cover__ribbon::before,
.cover__ribbon::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: var(--stitch) var(--blanco);
}
.cover__ribbon::before { left: 8px; }
.cover__ribbon::after { right: 8px; }

.cover__sparkles { position: absolute; inset: 0; pointer-events: none; }
.cover__sparkles i {
  position: absolute;
  width: var(--sz, 14px);
  aspect-ratio: 1;
  background: var(--dorado);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: twinkle 3s ease-in-out var(--d, 0s) infinite;
}

.cover__center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  scale: calc(1 - var(--p) * .05);
  padding-bottom: 40px;
}
.cover__bow {
  position: relative;
  z-index: 2;
  width: clamp(170px, 44vw, 240px);
  margin-bottom: -42px;
  animation: bow-float 3.6s ease-in-out infinite;
}
@keyframes bow-float {
  0%, 100% { translate: 0 0; rotate: -2deg; }
  50% { translate: 0 -6px; rotate: 2deg; }
}

.cover__label {
  position: relative;
  width: min(84vw, 380px);
  padding: 60px 28px 34px;
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: 0 30px 60px -20px rgba(142, 15, 67, .6);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cover__label::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: var(--stitch) var(--palo);
  pointer-events: none;
}
.cover__kicker { color: var(--rosa); }
.cover__title {
  margin: 10px 0 0;
  font-size: clamp(40px, 11vw, 54px);
  color: var(--frambuesa);
  text-wrap: balance;
}
.cover__rule { width: 48px; height: 2px; margin: 18px 0 14px; border-radius: 2px; background: var(--palo); }
.cover__sub { color: var(--frambuesa-70); letter-spacing: .16em; }

.cover__hint {
  position: absolute;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--blanco);
  opacity: calc(1 - var(--p) * 2);
}
.cover__chev {
  width: 16px;
  height: 16px;
  border-left: 3px solid var(--blanco);
  border-top: 3px solid var(--blanco);
  rotate: 45deg;
  border-radius: 2px;
  animation: chev 1.6s ease-in-out infinite;
}
.cover__chev:nth-child(2) { animation-delay: .18s; margin-top: -6px; }
.cover__hint-text {
  margin-top: 6px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  background: var(--blanco-18);
  box-shadow: inset 0 0 0 1px var(--blanco-40);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@keyframes chev {
  0%, 100% { opacity: .25; translate: 0 6px; }
  50% { opacity: 1; translate: 0 -4px; }
}
.cover.is-dragging .cover__bow, .cover.is-launching .cover__bow { animation-play-state: paused; }

/* ------------------------------------------------------------------ */
/* APP                                                                 */
/* ------------------------------------------------------------------ */
.app { position: relative; z-index: 1; min-height: 100vh; transform-origin: 50% 40vh; }
body.cover-on .app:not(.revealed) { transform: scale(.94); filter: brightness(.9); }
.app.revealed { transition: transform .9s var(--ease-out), filter .9s var(--ease-out); }

/* Guirnalda: luces blancas y doradas */
.garland { position: absolute; top: 0; left: 0; right: 0; height: 70px; z-index: 3; pointer-events: none; }
.garland svg { position: absolute; inset: 0 0 auto; width: 100%; height: 64px; overflow: visible; }
.garland path { fill: none; stroke: var(--frambuesa); stroke-opacity: .55; stroke-width: 2; vector-effect: non-scaling-stroke; }
.garland .bulb {
  position: absolute;
  width: 12px;
  height: 17px;
  margin-left: -6px;
  border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
  background: var(--c);
  rotate: var(--r);
  transform-origin: 50% -4px;
  box-shadow: 0 0 12px 4px var(--glow);
  opacity: .25;
}
.garland .bulb::before {
  content: '';
  position: absolute;
  left: 3px;
  top: -5px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--frambuesa);
}
.app.revealed .garland .bulb { opacity: 1; animation: bulb 2.4s ease-in-out var(--d) infinite; }
@keyframes bulb {
  0%, 100% { opacity: 1; box-shadow: 0 0 14px 5px var(--glow); }
  50% { opacity: .5; box-shadow: 0 0 3px 0 var(--glow); }
}

/* Encabezado */
.hero {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: calc(92px + env(safe-area-inset-top)) 16px 56px;
}
.hero__kicker { margin: 0; color: var(--palo); }
.hero__title {
  margin: 10px auto 0;
  max-width: 12ch;
  font-size: var(--fs-hero);
  color: var(--blanco);
  text-wrap: balance;
  text-shadow: 0 16px 40px rgba(142, 15, 67, .45);
}
.hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 14px;
  color: var(--blanco);
  background: var(--blanco-18);
  box-shadow: inset 0 0 0 1px var(--blanco-40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chip[hidden] { display: none; }
.chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dorado);
  box-shadow: 0 0 10px 2px rgba(242, 193, 78, .9);
  animation: dot 1.6s ease-in-out infinite;
}
@keyframes dot { 50% { opacity: .35; } }
.hero__help { max-width: 420px; margin: 14px auto 0; font-weight: 600; font-size: var(--fs-small); line-height: 1.5; color: var(--blanco-85); }

/* Tablero */
.board {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, 1000px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px);
  border-radius: clamp(24px, 3.2vw, 34px);
  background: var(--palo);
  box-shadow: inset 0 0 0 6px var(--blanco), 0 40px 90px -30px rgba(142, 15, 67, .85);
  container-type: inline-size;
}
.board::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: clamp(16px, 2.4vw, 26px);
  border: var(--stitch) var(--rosa-30);
  pointer-events: none;
}
.board__bow {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: -42px;
  width: clamp(110px, 22vw, 146px);
  translate: -50% 0;
  pointer-events: none;
}

.grid {
  --cols: var(--cols-m, 3);
  --gap: clamp(10px, 1.8vw, 16px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));
  gap: var(--gap);
  perspective: 650px;
  perspective-origin: 50% 40%;
}
@media (min-width: 720px) {
  .grid { --cols: var(--cols-d, 6); perspective: 1000px; }
  .board--p7 { width: min(100% - 32px, 700px); }
  .board--p14 { width: min(100% - 32px, 860px); }
}

/* ------------------------------------------------------------------ */
/* VENTANAS 3D                                                         */
/* ------------------------------------------------------------------ */
.door {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-md);
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  grid-column: var(--mc);
  grid-row: var(--mr);
  opacity: .4;
  transform: scale(.86);
}
@media (min-width: 720px) {
  .door { grid-column: var(--dc); grid-row: var(--dr); }
}
.app.revealed .door { opacity: 1; transform: none; animation: door-in .9s var(--ease-spring) var(--delay, 0ms) backwards; }
@keyframes door-in {
  0% { opacity: .2; transform: translateY(26px) translateZ(-120px) rotateX(-35deg); }
  100% { opacity: 1; transform: none; }
}

/* Cuerpo: se inclina siguiendo el puntero */
.door__body {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(var(--lift, 0px));
  transition: transform .45s var(--ease-out);
}
.door:hover .door__body { --lift: 16px; }
.door:active .door__body { --lift: 4px; transition-duration: .12s; }

/* Grosor: láminas apiladas hacia atrás */
.door__slab, .card3d__slab { position: absolute; inset: 0; border-radius: inherit; transform-style: preserve-3d; pointer-events: none; }
.door__slab i, .card3d__slab i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(rgba(142, 15, 67, .3), rgba(142, 15, 67, .3)), var(--bg);
  transform: translateZ(calc(var(--k) * var(--step) * -1));
}
.door__slab { --step: 2.6px; }
.door__slab i:last-child { box-shadow: 0 18px 26px -12px rgba(142, 15, 67, .7); }

.door__cavity {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--frambuesa);
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, .45);
  transform: translateZ(-1px);
}
.door__cavity img { width: 100%; height: 100%; object-fit: cover; display: block; }

.door__leaf {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  transition: transform .75s var(--ease-spring);
}
/* Reverso de la puerta */
.door__leaf::after, .box__door::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .5) 0 8px, transparent 8px 18px), var(--palo);
  transform: rotateY(180deg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.door.is-unlocked:not(.is-open):hover .door__leaf { transform: rotateY(-18deg); }
.door.is-open .door__leaf { transform: rotateY(-110deg); opacity: 0; visibility: hidden; }
.door.is-open .door__cavity { background: none; box-shadow: none; }
.door.is-open:hover .opened__icon { scale: 1.1; }
.door.is-open:hover .opened__img { scale: 1.06; }
.door:focus-visible { outline: 3px solid var(--blanco); outline-offset: 5px; }
.door.is-zoomed { visibility: hidden; }
.door.is-locked .face__lock { display: grid; }

/* Lista para abrir: brillo que recorre */
.door.is-ready .face__shine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .6) 46%, transparent 62%);
  background-size: 300% 100%;
  animation: shine-sweep 3.2s ease-in-out infinite;
}
@keyframes shine-sweep {
  0%, 30% { background-position: 120% 0; }
  70%, 100% { background-position: -20% 0; }
}

/* Hoy */
.door.is-today::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--r-md) + 6px);
  border: 2.5px solid var(--blanco);
  box-shadow: 0 0 22px 6px rgba(242, 193, 78, .8);
  animation: today 1.8s ease-in-out infinite;
  pointer-events: none;
}
.door__badge {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: -12px;
  translate: -50% 0;
  padding: 5px 11px 4px;
  border-radius: var(--r-pill);
  font-family: var(--font-text);
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: 0 6px 14px -4px rgba(142, 15, 67, .55);
  pointer-events: none;
  transform: translateZ(30px);
}
@keyframes today {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* Movimiento de los íconos al pasar el mouse o al ampliar */
.door:hover .ic .swing, .box .ic .swing { transform-box: view-box; transform-origin: 32px 10px; animation: swing 1.2s ease-in-out infinite; }
.door:hover .ic .spin, .box .ic .spin { transform-box: view-box; transform-origin: 32px 32px; animation: spin 6s linear infinite; }
.door:hover .ic .beat, .box .ic .beat { transform-box: fill-box; transform-origin: center; animation: beat 1s ease-in-out infinite; }
.door:hover .ic .pulse, .box .ic .pulse { transform-box: fill-box; transform-origin: center; animation: beat 1.6s ease-in-out infinite; }
.door:hover .ic .float, .box .ic .float { transform-box: fill-box; animation: float 2s ease-in-out infinite; }
.door:hover .ic .float2, .box .ic .float2 { transform-box: fill-box; animation: float 2s ease-in-out .5s infinite; }
@keyframes swing { 0%, 100% { rotate: -12deg; } 50% { rotate: 12deg; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes beat { 0%, 100% { scale: 1; } 15% { scale: 1.1; } 30% { scale: .97; } 45% { scale: 1.06; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

/* ------------------------------------------------------------------ */
/* TARJETA AMPLIADA (3D)                                               */
/* ------------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: calc(70px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(142, 15, 67, .82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal__close {
  position: fixed;
  z-index: 3;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--blanco);
  cursor: pointer;
  background: var(--blanco-18);
  box-shadow: inset 0 0 0 1px var(--blanco-40);
  transition: background .2s, transform .2s;
}
.modal__close:hover { background: rgba(255, 255, 255, .3); transform: rotate(90deg); }
.modal__close svg { width: 22px; height: 22px; }
.modal__stage { position: relative; z-index: 2; display: grid; place-items: center; width: 100%; }

.box {
  position: relative;
  width: min(84vw, 400px, 60dvh);
  aspect-ratio: 3 / 4;
  border-radius: 26px;
  perspective: 1400px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.box__tilt, .box__float, .card3d {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-style: preserve-3d;
}
.box__tilt {
  transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform .5s var(--ease-out);
}
.box__float { animation: card-float 8s ease-in-out infinite; }
/* Empieza y termina en reposo: así entra y sale sin saltos */
@keyframes card-float {
  0%, 100% { rotate: 1 -1.6 0 0deg; translate: 0 0; }
  30% { rotate: 1 -1.6 0 7deg; translate: 0 -6px; }
  70% { rotate: -.6 -1 0 5deg; translate: 0 -3px; }
}

/* ---- Transformación de forma (abrir / volver a su lugar) ---- */
.box.is-morphing { position: fixed; margin: 0; aspect-ratio: auto; z-index: 3; }
/* Durante el aterrizaje la tarjeta adopta el aspecto exacto de la ventana de la grilla */
.box.is-landing .box__door { transition-duration: .76s; transition-timing-function: cubic-bezier(.45, 0, .15, 1); }
.box.is-landing.is-open .box__door { transform: rotateY(-120deg); opacity: 0; }
.box.is-landing .door-hint { opacity: 0; }
.box.is-landing .box__door,
.box.is-landing .ic .swing, .box.is-landing .ic .spin, .box.is-landing .ic .beat,
.box.is-landing .ic .pulse, .box.is-landing .ic .float, .box.is-landing .ic .float2 { animation: none; }
.door-hint { transition: opacity .35s ease; }
.card3d__slab i:last-child { transition: box-shadow .6s ease; }
.box.is-landing .card3d__slab i:last-child { box-shadow: 0 18px 26px -12px rgba(142, 15, 67, .7); }
.gift__cavity {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease-out;
}
.box.is-landing .gift__cavity { opacity: 1; }

/* Ventana de la grilla: se prepara sin transiciones mientras está oculta */
.door.no-anim .door__leaf, .door.no-anim .door__body { transition: none !important; }
.door.is-arriving::before { animation: none; opacity: 0; }
.door.is-arriving .door__badge { opacity: 0; }
.door__badge { transition: opacity .4s ease; }

.card3d {
  --depth: 22px;
  transform-origin: 50% 50% calc(var(--depth) / -2);
  transition: transform .85s cubic-bezier(.3, 1.3, .4, 1);
}
.card3d.is-flipped { transform: rotateY(180deg); }
.card3d__slab { --step: 1.6px; }
.card3d__slab i:last-child { box-shadow: 0 40px 70px -24px rgba(40, 0, 18, .8); }

.card3d__front { position: absolute; inset: 0; border-radius: inherit; transform-style: preserve-3d; }
.card3d__back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  color: var(--frambuesa);
  background:
    radial-gradient(circle, rgba(255, 255, 255, .6) 22%, transparent 25%) 0 0 / 26px 26px,
    var(--palo);
  transform: translateZ(calc(var(--depth) * -1)) rotateY(180deg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.card3d__back::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: var(--stitch) var(--rosa-30);
  pointer-events: none;
}
.back__bow { position: absolute; left: 50%; top: 50%; width: 46%; translate: -50% -50%; opacity: .9; }

/* Mensaje del candado (reverso, solo al voltear) */
.back__msg {
  position: absolute;
  inset: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  text-align: center;
  border-radius: 16px;
  background: var(--blanco);
  opacity: 0;
  transition: opacity .3s;
}
.card3d.is-flipped .back__msg { opacity: 1; transition-delay: .25s; }
.back__lock {
  margin-top: auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blanco);
  background: var(--rosa);
  box-shadow: 0 0 0 5px var(--palo);
}
.back__lock svg { width: 24px; height: 24px; }
.back__title { margin: 0 0 4px; max-width: 15ch; color: var(--frambuesa); text-wrap: balance; }
.back__text { margin: 0; font-weight: 600; font-size: var(--fs-body); line-height: 1.45; color: var(--frambuesa-70); }
.back__date {
  margin: -6px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  color: var(--rosa);
}
.back__date::first-letter { text-transform: uppercase; }
.back__hint {
  margin: 2px 0 0;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--frambuesa);
  background: var(--palo);
}
.back__hint .t-label { display: block; margin-bottom: 3px; color: var(--rosa); }
.back__tap { margin-top: auto; color: var(--frambuesa-40); }

.countdown { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.countdown span {
  min-width: 56px;
  padding: 8px 4px 6px;
  border-radius: var(--r-sm);
  background: var(--palo);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.countdown b { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1; color: var(--frambuesa); font-variant-numeric: tabular-nums; }
.countdown i { font-style: normal; font-weight: 800; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--rosa); margin-top: 4px; }

/* Interior + puerta del frente */
.box__inside {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--blanco);
  color: var(--frambuesa);
  transform: translateZ(-.5px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.box.is-locked .box__inside { background: var(--frambuesa); }
.box__door {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: inherit;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(.25, 1.2, .35, 1);
  -webkit-tap-highlight-color: transparent;
}
.box__door:focus-visible { outline: 3px solid var(--blanco); outline-offset: 6px; }
.box.is-locked .box__door .face__lock {
  display: grid;
  width: 22cqmin;
  height: 22cqmin;
  top: 6cqmin;
  right: 6cqmin;
  animation: lock-pulse 2.2s ease-in-out infinite;
  transition: width .5s ease, height .5s ease, top .5s ease, right .5s ease;
}
/* Al aterrizar, el candado vuelve al tamaño de la grilla */
.box.is-landing.is-locked .box__door .face__lock {
  width: max(20px, 13cqmin);
  height: max(20px, 13cqmin);
  top: 7cqmin;
  right: 7cqmin;
  animation: none;
}
@keyframes lock-pulse {
  0%, 100% { scale: 1; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); }
  50% { scale: 1.06; box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}
.box.is-open .box__door {
  transform: rotateY(-120deg);
  opacity: 0;
  pointer-events: none;
  transition: transform 1.15s cubic-bezier(.25, 1.2, .35, 1), opacity .45s ease .5s;
}
.box.is-unlocked:not(.is-open) .box__door { animation: door-tease 2.6s ease-in-out 1.4s infinite; }
@keyframes door-tease {
  0%, 70%, 100% { transform: rotateY(0); }
  78% { transform: rotateY(-9deg); }
  86% { transform: rotateY(0); }
  92% { transform: rotateY(-4deg); }
}

.door-hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  padding: 11px 18px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: 0 12px 24px -8px rgba(142, 15, 67, .55);
  animation: hint-bounce 1.6s ease-in-out infinite;
}
@keyframes hint-bounce { 0%, 100% { translate: -50% 0; } 50% { translate: -50% -5px; } }

/* Contenido del regalo ----------------------------------------------
   Arriba la foto (o el ícono del día en un medallón con rayos de luz), un sello con el número
   que une ambas partes y abajo el texto. Todo aparece en cascada cuando la puerta se abre.   */
.gift { position: absolute; inset: 0; display: flex; flex-direction: column; }
.gift__photo {
  position: relative;
  flex: 0 0 50%;
  min-height: 0;
  margin: 10px 10px 0;
  overflow: hidden;
  border-radius: 18px 18px 10px 10px;
  background: var(--palo);
  container-type: size;
}
.gift__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  opacity: 0;
  scale: 1.12;
  transition: opacity .7s .5s, scale 2.4s .5s var(--ease-out);
}
.box.is-open .gift__photo img { opacity: 1; scale: 1; }

/* Sin foto: rayos de luz que giran detrás de un medallón con el ícono */
.gift__photo--none {
  --fg: var(--rosa);
  --ac: var(--frambuesa);
  --bg: var(--blanco);
  display: grid;
  place-items: center;
  color: var(--rosa);
  background: radial-gradient(circle at 50% 50%, var(--blanco) 0 18%, var(--palo) 70%);
}
.gift__rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160cqmax;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .75) 0 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 58%);
  mask: radial-gradient(circle, #000 12%, transparent 58%);
  opacity: 0;
  scale: .6;
  transition: opacity .8s ease .45s, scale 1.2s var(--ease-out) .45s;
  animation: rays-spin 40s linear infinite;
}
.box.is-open .gift__rays { opacity: 1; scale: 1; }
@keyframes rays-spin { to { rotate: 360deg; } }
.gift__medal {
  position: relative;
  display: grid;
  place-items: center;
  width: min(62cqmin, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--blanco);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .55), 0 18px 36px -16px rgba(142, 15, 67, .6);
  opacity: 0;
  scale: .5;
  rotate: -14deg;
  transition: opacity .3s ease .5s, scale .9s var(--ease-spring) .5s, rotate .9s var(--ease-spring) .5s;
}
.gift__medal::before {
  content: '';
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 1.5px dashed var(--rosa-30);
}
.gift__medal .ic { width: 62%; height: auto; overflow: visible; }
.box.is-open .gift__medal { opacity: 1; scale: 1; rotate: 0deg; }
.gift__glints i {
  position: absolute;
  width: var(--s, 14px);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: var(--dorado);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: 0;
  transition: opacity .4s ease .9s;
}
.box.is-open .gift__glints i { opacity: 1; animation: face-twinkle 2.6s ease-in-out var(--d, 0s) infinite; }

/* Sello con el número del día */
.gift__seal {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  flex: none;
  width: 62px;
  height: 62px;
  margin: -32px auto -6px;
  border-radius: 50%;
  color: var(--rosa);
  background: var(--blanco);
  box-shadow: 0 0 0 4px var(--palo), 0 12px 22px -10px rgba(142, 15, 67, .65);
  opacity: 0;
  scale: .4;
  rotate: -20deg;
  transition: opacity .3s ease .72s, scale .8s var(--ease-spring) .72s, rotate .8s var(--ease-spring) .72s;
}
.gift__seal::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.5px dashed var(--rosa-30);
}
.gift__seal small { font-weight: 800; font-size: 8.5px; letter-spacing: .2em; text-transform: uppercase; line-height: 1; margin-bottom: 1px; }
.gift__seal b { font-family: var(--font-display); font-weight: 700; font-size: 25px; line-height: .95; letter-spacing: -.03em; font-variant-numeric: lining-nums; }
.box.is-open .gift__seal { opacity: 1; scale: 1; rotate: 0deg; }

/* Texto */
.gift__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 22px 20px;
  text-align: center;
  scrollbar-width: thin;
  scrollbar-color: var(--palo) transparent;
}
.gift__text > * { opacity: 0; translate: 0 12px; transition: opacity .5s ease, translate .7s var(--ease-out); }
.box.is-open .gift__text > * { opacity: 1; translate: 0 0; }
.box.is-open .gift__text > :nth-child(1) { transition-delay: .82s; }
.box.is-open .gift__text > :nth-child(2) { transition-delay: .9s; }
.box.is-open .gift__text > :nth-child(3) { transition-delay: .98s; }
.box.is-open .gift__text > :nth-child(4) { transition-delay: 1.06s; }
.box.is-open .gift__text > :nth-child(5) { transition-delay: 1.14s; }
.gift__day { margin: 0; color: var(--rosa); }
/* Centrado vertical que no recorta cuando el mensaje es largo */
.gift__text > :first-child { margin-top: auto; }
.gift__text > :last-child { margin-bottom: auto; }
.gift__title {
  margin: 6px 0 0;
  color: var(--frambuesa);
  text-wrap: balance;
}
.gift__rule {
  display: block;
  width: 64px;
  height: 0;
  margin: 12px auto 0;
  border-top: 1.5px dashed var(--rosa-30);
}
.gift__msg {
  margin: 12px 0 0;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--frambuesa-70);
  white-space: pre-wrap;
  text-wrap: pretty;
}
.gift__from {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
  padding: 7px 14px 7px 11px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: var(--fs-small);
  color: var(--rosa);
  background: var(--rosa-12);
}
.gift__from svg { width: 14px; height: 14px; flex: none; }

/* Foto ampliada */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(142, 15, 67, .94);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }

/* ------------------------------------------------------------------ */
/* Pie, vista previa y avisos                                          */
/* ------------------------------------------------------------------ */
.foot { position: relative; z-index: 2; text-align: center; padding: 56px 16px calc(36px + env(safe-area-inset-bottom)); }

.preview-pill {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  translate: -50% 0;
  padding: 11px 16px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: 0 12px 30px -10px rgba(142, 15, 67, .7);
}
.preview-pill[hidden] { display: none; }
a.preview-pill--demo { color: var(--blanco); background: var(--frambuesa); text-decoration: none; }

/* Calendario no disponible (enlace incorrecto, sin pagar o vencido) */
.state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(36px, 8vw, 64px) 20px;
  text-align: center;
}
.state[hidden] { display: none; }
.state__lock {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--rosa);
  background: var(--blanco);
  box-shadow: 0 0 0 6px var(--rosa-12);
}
.state__lock svg { width: 30px; height: 30px; }
.state__title { margin: 0; color: var(--frambuesa); }
.state__text { max-width: 340px; margin: 0; font-weight: 600; line-height: 1.5; color: var(--frambuesa-70); }
.state__btn {
  margin-top: 10px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--blanco);
  background: var(--rosa);
}
.foot__cta {
  display: block;
  width: max-content;
  margin: 18px auto 0;
  font-weight: 800;
  font-size: var(--fs-small);
  color: var(--blanco-85);
  text-underline-offset: 4px;
}
.foot__cta:hover { color: var(--blanco); }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top));
  translate: -50% calc(-100% - 60px);
  visibility: hidden;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-weight: 800;
  font-size: 14px;
  color: var(--frambuesa);
  background: var(--blanco);
  box-shadow: 0 20px 40px -14px rgba(142, 15, 67, .7);
  transition: translate .45s var(--ease-spring), visibility 0s .45s;
}
.toast.show { translate: -50% 0; visibility: visible; transition: translate .45s var(--ease-spring), visibility 0s; }

@keyframes twinkle {
  0%, 100% { scale: .4; opacity: .3; }
  50% { scale: 1; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
