/* ==========================================================
   Novena de Navidad 2026 — estilos
   ========================================================== */
:root {
  --verde-950: #06180f;
  --verde-900: #0b2a1f;
  --verde-800: #0f3a2b;
  --verde-600: #1d5c43;
  --oro: #d6b25e;
  --oro-claro: #f1dc9f;
  --oro-oscuro: #a8843a;
  --vino: #8e1d2e;
  --crema: #f8f2e4;
  --crema-2: #efe4cc;
  --tinta: #2a2620;
  --papel:
    radial-gradient(120% 90% at 50% 35%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 60%),
    radial-gradient(150% 120% at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(140, 100, 40, .16));
  --f-script: "Great Vibes", "Snell Roundhand", cursive;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-ui: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-texto: "Lora", Georgia, "Times New Roman", serif;
  --letra: 17px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  background-color: var(--verde-900);
  background-image: radial-gradient(120% 80% at 50% 0%, var(--verde-800), var(--verde-900) 55%, var(--verde-950));
  color: var(--crema);
  font-family: var(--f-ui);
  font-variant-numeric: lining-nums;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

input { -webkit-user-select: text; user-select: text; }
button, input { font-variant-numeric: lining-nums; }

.solo-lector {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--oro-claro); outline-offset: 3px; }

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

.pantalla {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.pantalla[hidden] { display: none; }

/* ---------------- Botones ---------------- */
.boton {
  font-family: var(--f-ui); font-weight: 700; font-size: 1.05rem;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 14px 28px; min-height: 50px;
  transition: transform .15s ease, filter .15s ease;
}
.boton:active { transform: scale(.97); }
.boton-oro {
  width: 100%;
  color: var(--verde-950);
  background: linear-gradient(180deg, var(--oro-claro), var(--oro) 55%, var(--oro-oscuro));
  box-shadow: 0 10px 24px -10px rgba(214, 178, 94, .7), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.boton-oro:hover { filter: brightness(1.05); }
.boton-texto {
  background: transparent; color: var(--oro-claro);
  font-weight: 600; min-height: 42px; padding: 8px 18px;
}
.boton-chico { width: auto; min-height: 44px; padding: 10px 20px; font-size: .95rem; }
.boton[hidden] { display: none; }

.icono-boton {
  appearance: none; border: 1px solid rgba(214, 178, 94, .28);
  background: rgba(255, 255, 255, .06); color: var(--oro-claro);
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background .15s ease, opacity .15s ease;
}
.icono-boton:hover { background: rgba(255, 255, 255, .12); }
.icono-boton:disabled { opacity: .3; cursor: default; }
.icono-boton svg { width: 22px; height: 22px; }
.icono-boton-claro { color: var(--verde-800); border-color: rgba(15, 58, 43, .2); background: rgba(15, 58, 43, .05); }

/* ==========================================================
   PORTADA — tarjeta de Navidad
   ========================================================== */
#pantalla-tarjeta {
  align-items: center; justify-content: center; gap: 14px;
}

/* Fondo ilustrado de la portada (cielo de Belén) */
.portada-fondo {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background-color: var(--verde-900);
}
.portada-fondo::before {
  content: ""; position: absolute; inset: -4%;
  background-image: var(--img-portada, none);
  background-size: cover; background-position: center 30%;
  animation: acercar 40s ease-in-out infinite alternate;
}
.portada-fondo::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(70% 45% at 50% 52%, rgba(241, 220, 159, .22), rgba(241, 220, 159, 0) 70%),
    radial-gradient(60% 13% at 50% 15%, rgba(6, 24, 15, .55), rgba(6, 24, 15, 0)),
    linear-gradient(to bottom, rgba(6, 24, 15, .6) 0%, rgba(6, 24, 15, .25) 24%, rgba(6, 24, 15, .25) 55%, rgba(6, 24, 15, .88) 88%, rgba(6, 24, 15, .96) 100%);
}
body.en-libro .portada-fondo { display: none; }
@keyframes acercar { from { transform: scale(1); } to { transform: scale(1.08) translateY(-1%); } }

/* Título dorado con brillo */
.portada-titulo { position: relative; text-align: center; animation: llegar 1s cubic-bezier(.2, .8, .2, 1) both; }
.portada-kicker {
  margin: 0; color: var(--oro-claro);
  font: 700 .72rem/1.2 var(--f-ui); letter-spacing: .32em; text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.portada-h1 { margin: 2px 0 0; font-family: var(--f-script); font-weight: 400; font-size: clamp(2.5rem, 11vw, 3.6rem); line-height: 1.1; }
.oro-brillo {
  background: linear-gradient(100deg, #b8862b 0%, #f6e3a1 22%, #c99a3d 40%, #fff6d2 50%, #c99a3d 60%, #f6e3a1 78%, #b8862b 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .85)) drop-shadow(0 0 10px rgba(6, 24, 15, .7));
  animation: brillo-oro 5s linear infinite;
  padding: 0 .12em;
}
@keyframes brillo-oro { from { background-position: 110% 0; } to { background-position: -110% 0; } }
.portada-anio {
  margin: 0; color: var(--oro-claro); font: 700 .8rem/1 var(--f-ui); letter-spacing: .3em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.portada-anio span { color: var(--oro); font-size: .7em; vertical-align: .15em; }

.boton-musica-portada {
  position: absolute; z-index: 3;
  top: calc(env(safe-area-inset-top) + 12px); right: calc(env(safe-area-inset-right) + 12px);
  background: rgba(6, 24, 15, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.boton-musica[hidden] { display: none; }
.boton-musica .ico-callado { display: none; }
.boton-musica[aria-pressed="false"] .ico-sonando { display: none; }
.boton-musica[aria-pressed="false"] .ico-callado { display: block; }
.boton-musica[aria-pressed="true"] .ico-sonando { animation: nota 1.6s ease-in-out infinite; }
@keyframes nota { 50% { transform: translateY(-2px) rotate(-6deg); } }

.tarjeta-escena {
  position: relative;
  width: min(84vw, 380px, calc((100vh - 330px) * .714));
  width: min(84vw, 380px, calc((100svh - 330px) * .714));
  min-width: 230px;
  container-type: inline-size;
  perspective: 1800px;
}
/* Halo de luz detrás de la tarjeta */
.tarjeta-escena::before {
  content: ""; position: absolute; inset: -18% -22%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 236, 170, .45), rgba(255, 236, 170, .12) 55%, rgba(255, 236, 170, 0));
  animation: halo 4s ease-in-out infinite alternate;
}
@keyframes halo { from { opacity: .65; transform: scale(.97); } to { opacity: 1; transform: scale(1.03); } }

.tarjeta {
  position: relative;
  width: 100%; aspect-ratio: 5 / 7;
  display: flex; flex-direction: column; align-items: center;
  padding: 7.5cqw 8cqw 6cqw;
  text-align: center; color: var(--verde-800);
  background-color: var(--crema);
  background-image: var(--papel);
  border-radius: 6px;
  box-shadow: 0 34px 60px -24px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .45);
  transform-origin: left center;
  transition: transform .7s cubic-bezier(.6, .05, .4, 1), opacity .6s ease .1s;
}
.tarjeta-escena { animation: llegar .9s cubic-bezier(.2, .8, .2, 1) .1s both, flotar 7s ease-in-out 1.1s infinite; }
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-.4deg); } }
.tarjeta { box-shadow: 0 34px 60px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(214, 178, 94, .35), 0 0 40px rgba(255, 236, 170, .25); }

/* El botón de abrir late suavemente para invitar a tocarlo */
#abrir { animation: latido 2.6s ease-in-out 1.5s infinite; }
@keyframes latido {
  0%, 100% { box-shadow: 0 10px 24px -10px rgba(214, 178, 94, .7), inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 0 rgba(241, 220, 159, .55); }
  50% { box-shadow: 0 10px 24px -10px rgba(214, 178, 94, .7), inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 10px rgba(241, 220, 159, 0); }
}

/* Barra superior del libro: título siempre centrado */
.barra-arriba { display: grid; grid-template-columns: 1fr auto 1fr; }
.barra-arriba > :first-child { justify-self: start; }
.barra-grupo { justify-self: end; display: flex; gap: 8px; }
@media (max-width: 400px) {
  .barra-titulo { font-size: 1.45rem; }
  .barra-grupo { gap: 6px; }
  .barra-arriba .icono-boton { width: 42px; height: 42px; }
}
.tarjeta::before, .tarjeta::after {
  content: ""; position: absolute; pointer-events: none; border-radius: 3px;
}
.tarjeta::before { inset: 3.2cqw; border: 1.5px solid var(--oro); }
.tarjeta::after { inset: 4.6cqw; border: .6px solid var(--oro); opacity: .7; }
.tarjeta.abriendose { transform: rotateY(-100deg); opacity: 0; }

@keyframes llegar {
  from { transform: translateY(18px) scale(.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Orlas de las esquinas (adornos/orla.webp, la misma imagen girada abajo) */
.esquina { position: absolute; z-index: 2; width: 38cqw; height: auto; pointer-events: none; user-select: none; } /* por encima de los filetes dorados */
.esquina-sup { top: 0; left: -1cqw; }
.esquina-inf { bottom: 0; right: -1cqw; transform: rotate(180deg); }

.tarjeta-estrella { width: 7cqw; height: 7cqw; fill: var(--oro); flex-shrink: 0; }
.tarjeta-sobre {
  margin: 1.2cqw 0 3.8cqw; /* aire entre esta línea y "Feliz Navidad" */
  font-weight: 700; font-size: 2.9cqw; letter-spacing: .22em; text-transform: uppercase;
  color: var(--oro-oscuro);
}
.tarjeta-saludo {
  margin: 0 0 2cqw;
  font-family: var(--f-script); font-weight: 400; font-size: 15cqw; line-height: 1.05;
  color: var(--vino);
}

.marco-foto {
  appearance: none; border: 0; padding: 0; cursor: pointer; flex-shrink: 0;
  position: relative; width: 50cqw; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 50% 50% 3cqw 3cqw / 36% 36% 3cqw 3cqw;
  background: var(--crema-2);
  box-shadow:
    0 0 0 1.2cqw var(--crema),
    0 0 0 1.9cqw var(--oro),
    0 0 0 2.3cqw var(--crema),
    0 0 0 2.7cqw var(--oro-oscuro),
    0 6cqw 8cqw -4cqw rgba(0, 0, 0, .35);
}
.marco-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.marco-foto img[hidden] { display: none; }
.marco-vacio {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2cqw;
  padding: 6cqw; color: var(--verde-600);
  font-family: var(--f-ui); font-size: 3.5cqw; line-height: 1.3;
  background:
    repeating-linear-gradient(45deg, rgba(29, 92, 67, .045) 0 6px, transparent 6px 12px),
    var(--crema-2);
}
.marco-vacio[hidden] { display: none; }
.marco-vacio svg { width: 13cqw; height: 13cqw; margin-bottom: 1cqw; }
.marco-vacio strong { font-size: 4.6cqw; color: var(--verde-800); }
.marco-foto:hover .marco-vacio { background-color: #f3ead6; }

.tarjeta-mensaje {
  margin: 5.5cqw 2cqw 0; max-width: 66cqw;
  font-family: var(--f-serif); font-style: italic; font-weight: 500;
  font-size: 4.7cqw; line-height: 1.25; color: var(--verde-800);
}
.tarjeta-firma { margin-top: auto; margin-bottom: 1cqw; }
.tarjeta-firma input {
  width: 52cqw; padding: .6cqw 1cqw;
  font-family: var(--f-script); font-size: 7.6cqw; color: var(--vino);
  transition: font-size .15s ease;
  text-align: center; background: transparent;
  border: 0; border-bottom: 1px dashed rgba(168, 132, 58, .7); border-radius: 0;
  outline: none;
}
.tarjeta-firma input.largo { font-size: 6.2cqw; }
.tarjeta-firma input.muy-largo { font-size: 5cqw; }
.tarjeta-firma input::placeholder { color: rgba(142, 29, 46, .38); }
.tarjeta-firma input:focus { border-bottom-style: solid; }

.tarjeta-acciones {
  position: relative; z-index: 2;
  width: min(84vw, 380px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: llegar .9s cubic-bezier(.2, .8, .2, 1) .15s both;
}
.aviso-dia {
  margin: 0; text-align: center; font-size: .95rem; font-weight: 600; color: var(--oro-claro);
}
.aviso-dia[hidden] { display: none; }
.chip-hoy {
  appearance: none; cursor: pointer;
  border: 1px solid rgba(241, 220, 159, .45); border-radius: 999px;
  background: rgba(142, 29, 46, .55); color: #fff;
  font: 700 .95rem var(--f-ui); padding: 9px 16px;
}

/* ==========================================================
   EL LIBRO
   ========================================================== */
.barra {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px;
}
.barra-titulo {
  margin: 0; font-family: var(--f-script); font-weight: 400;
  font-size: 1.75rem; color: var(--oro-claro); white-space: nowrap;
}
.barra-abajo { justify-content: center; gap: 14px; padding-bottom: 12px; }
.contador {
  min-width: 86px; text-align: center;
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--crema);
}

.zona-libro {
  flex: 1; min-height: 0; position: relative;
  display: grid; place-items: center;
}
.sin-libro { max-width: 300px; text-align: center; color: var(--oro-claro); line-height: 1.5; }

#libro { touch-action: pan-y; }

.pagina {
  --encuadernado: linear-gradient(transparent, transparent);
  background-color: var(--crema);
  background-image: var(--encuadernado), var(--papel);
  overflow: hidden;
}
.zona-libro:not(.modo-doble) .pagina {
  --encuadernado: linear-gradient(to right, rgba(60, 40, 10, .16), rgba(60, 40, 10, 0) 4.5%);
}
.modo-doble .lado-izq {
  --encuadernado: linear-gradient(to left, rgba(60, 40, 10, .2), rgba(60, 40, 10, 0) 8%);
}
.modo-doble .lado-der {
  --encuadernado: linear-gradient(to right, rgba(60, 40, 10, .2), rgba(60, 40, 10, 0) 8%);
}

/* El medidor: hoja invisible donde se calcula cuánto texto cabe */
#medidor {
  position: fixed; left: -10000px; top: 0;
  visibility: hidden; pointer-events: none;
}
#medidor .pagina { position: relative; }

/* ---------- Hojas con texto ---------- */
.hoja { container-type: inline-size; }
.hoja-dentro {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 7cqw 7.5cqw 2.5cqw;
}
.hoja-cabeza { flex: none; text-align: center; margin-bottom: calc(var(--letra) * .8); }
.hoja-figura {
  position: relative;
  margin: 0 0 calc(var(--letra) * .8);
  padding: 1.4cqw;
  border: 1.5px solid var(--oro); border-radius: 5.5cqw;
  background: #fffaf0;
  box-shadow: 0 2.5cqw 5cqw -3.5cqw rgba(60, 40, 10, .45);
}
.hoja-figura::after {
  /* filete fino interior, como el de la tarjeta */
  content: ""; position: absolute; inset: .55cqw;
  border: .6px solid rgba(214, 178, 94, .55); border-radius: 5cqw;
  pointer-events: none;
}
.hoja-figura img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 4cqw; background: var(--crema-2);
  pointer-events: none; -webkit-user-drag: none;
}
.hoja-adorno {
  display: block; width: calc(var(--letra) * 4.4); height: calc(var(--letra) * 2);
  margin: calc(var(--letra) * .3) auto calc(var(--letra) * .45);
}
.hoja-kicker {
  margin: 0; color: var(--oro-oscuro);
  font: 700 calc(var(--letra) * .66)/1.3 var(--f-ui);
  letter-spacing: .2em; text-transform: uppercase;
}
.hoja-antes {
  margin: calc(var(--letra) * .35) 0 0;
  font-family: var(--f-serif); font-style: italic; font-weight: 500;
  font-size: calc(var(--letra) * 1.12); line-height: 1.2; color: var(--verde-600);
}
.hoja-titulo {
  margin: 0; font-family: var(--f-script); font-weight: 400;
  font-size: calc(var(--letra) * 2.55); line-height: 1.15; color: var(--vino);
}
.hoja-divisor {
  display: block; width: calc(var(--letra) * 7); height: calc(var(--letra) * .82);
  margin: calc(var(--letra) * .15) auto 0;
}
.hoja-corrida {
  flex: none; margin: 0 0 calc(var(--letra) * .85);
  padding-bottom: calc(var(--letra) * .45);
  border-bottom: 1px solid rgba(214, 178, 94, .5);
  text-align: center; color: var(--oro-oscuro);
  font: 700 calc(var(--letra) * .62)/1.3 var(--f-ui);
  letter-spacing: .18em; text-transform: uppercase;
}
.hoja-texto {
  flex: 1; min-height: 0; overflow: hidden;
  font-family: var(--f-texto); font-size: var(--letra); line-height: 1.6;
  color: var(--tinta);
  /* Justificado como libro impreso: guiones automáticos para que no queden huecos */
  text-align: justify; text-justify: inter-word;
  -webkit-hyphens: auto; hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
  text-wrap: pretty;
  overflow-wrap: break-word;
}
.hoja-texto > :last-child { margin-bottom: 0 !important; }
.hoja-texto em { color: var(--verde-600); }
.hoja-texto strong { color: var(--vino); font-weight: 600; }
.hoja-pie {
  flex: none; height: calc(var(--letra) * 1.6); margin-top: calc(var(--letra) * .35);
  display: flex; align-items: center; justify-content: center; gap: 2.5cqw;
  color: var(--oro-oscuro); font: 600 calc(var(--letra) * .7)/1 var(--f-ui);
}
.hoja-pie::before, .hoja-pie::after {
  content: ""; width: 8cqw; height: 1px; background: rgba(214, 178, 94, .65);
}

/* Bloques de texto */
.b-p { margin: 0 0 .75em; }
.b-capitular::first-letter {
  float: left; margin: .05em .1em 0 0;
  font-family: var(--f-serif); font-weight: 600; font-size: 3.4em; line-height: .8;
  color: var(--vino);
}
.b-linea { position: relative; margin: 0 0 .5em; padding-left: 1.15em; }
.b-linea::before {
  content: "✦"; position: absolute; left: 0; top: .2em;
  font-size: .62em; color: var(--oro);
}
.b-destacado {
  margin: .25em 0 .9em; padding: .6em .85em;
  border-left: 3px solid var(--oro); border-radius: 0 10px 10px 0;
  background: rgba(214, 178, 94, .17);
  font-style: italic; color: var(--verde-800);
}
.b-nota {
  margin: .5em 0 .9em; text-align: center;
  font-family: var(--f-serif); font-style: italic; font-weight: 600; font-size: 1.15em;
  color: var(--vino);
}
.b-nota::before, .b-nota::after {
  content: "✦"; margin: 0 .6em; font-style: normal; font-size: .55em;
  vertical-align: .25em; color: var(--oro);
}
.b-paso {
  display: flex; align-items: center; gap: .7em;
  width: 100%; margin: 0 0 .45em; padding: .45em .6em;
  border: 1px solid rgba(15, 58, 43, .1); border-radius: 12px;
  background: rgba(15, 58, 43, .04);
  font: inherit; line-height: 1.35; color: inherit; text-align: left;
}
button.b-paso { appearance: none; cursor: pointer; }
button.b-paso:hover { background: rgba(214, 178, 94, .18); }
.b-paso * { pointer-events: none; }
.b-paso-num {
  flex: none; width: 1.75em; height: 1.75em; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--vino); color: #fff; font: 700 .76em/1 var(--f-ui);
}
.b-paso-flecha { margin-left: auto; padding-left: .3em; font-size: 1.3em; line-height: 1; color: var(--oro-oscuro); }
.b-coro {
  margin: 0 0 1em; padding: .55em .8em .7em;
  border: 1.5px solid var(--oro); border-radius: 12px;
  background: rgba(142, 29, 46, .05);
  text-align: center; font-style: italic; color: var(--vino);
}
.b-coro-final { margin-top: .4em; }
.b-coro-etiqueta, .b-estrofa-coro {
  display: block; font: 700 .6em/1.4 var(--f-ui); font-style: normal;
  letter-spacing: .2em; text-transform: uppercase;
}
.b-coro-etiqueta { margin-bottom: .35em; color: var(--oro-oscuro); }
.b-verso { display: block; }
.b-coro, .b-estrofa { line-height: 1.42; }
.b-estrofa { margin: 0 0 .8em; font-size: .96em; text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.b-coro { -webkit-hyphens: manual; hyphens: manual; }
.b-paso { text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.b-estrofa .b-verso + .b-verso { margin-top: .15em; }
.b-estrofa-coro { margin-top: .3em; text-align: right; color: var(--vino); }
.b-estrofa-coro::before { content: "↻ "; }
.b-sigue {
  margin: .4em 0 0; padding-top: .8em;
  border-top: 1px dashed rgba(168, 132, 58, .55);
  text-align: center;
}
.b-sigue p { margin: 0 0 .6em; font-style: italic; font-size: .92em; color: #6b6457; }
.b-sigue button {
  appearance: none; border: 0; cursor: pointer;
  padding: .6em 1.15em; border-radius: 999px;
  background: var(--vino); color: #fff;
  font: 700 .8em/1.2 var(--f-ui);
  box-shadow: 0 6px 14px -8px rgba(142, 29, 46, .8);
}

/* Páginas especiales: dedicatoria y final */
.pagina-especial { container-type: inline-size; }
.esp-marco {
  position: absolute; inset: 5cqw;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw;
  padding: 8cqw 6cqw; text-align: center; color: var(--verde-800);
  border: 1.2px solid var(--oro); border-radius: 2px;
}
.esp-marco::after {
  content: ""; position: absolute; inset: 1.6cqw;
  border: .6px solid var(--oro); opacity: .6; pointer-events: none;
}
.esp-estrella { width: 10cqw; height: 10cqw; fill: var(--oro); flex-shrink: 0; }
.esp-sub { margin: 0; font-family: var(--f-serif); font-style: italic; font-weight: 500; font-size: 7cqw; line-height: 1.2; }
.esp-script { margin: 0; font-family: var(--f-script); font-size: 15cqw; line-height: 1.05; color: var(--vino); }
.esp-foto {
  width: 60cqw; aspect-ratio: 4 / 5; overflow: hidden; flex-shrink: 0; margin: 5cqw 0;
  border-radius: 50% 50% 3cqw 3cqw / 36% 36% 3cqw 3cqw;
  box-shadow: 0 0 0 1.4cqw var(--crema), 0 0 0 2.1cqw var(--oro);
}
.esp-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.esp-foto.sin-foto { width: 46cqw; height: 21cqw; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.esp-foto svg, .esp-adorno { width: 46cqw; height: 21cqw; flex-shrink: 0; }
.esp-adorno { margin: 4cqw 0; }
.esp-nombre { margin: 0; min-height: 1em; font-family: var(--f-script); font-size: 11cqw; line-height: 1.1; color: var(--vino); }
.esp-texto { margin: 0; font-family: var(--f-serif); font-weight: 500; font-size: 6.4cqw; line-height: 1.3; }
.esp-pie {
  margin: 2cqw 0 0; font-weight: 700; font-size: 3.6cqw;
  letter-spacing: .2em; text-transform: uppercase; color: var(--oro-oscuro);
}

/* ---------------- Índice ---------------- */
.indice-fondo {
  position: fixed; inset: 0; z-index: 15;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .55);
  animation: aparecer .2s ease both;
}
.indice-fondo[hidden] { display: none; }
.indice-hoja {
  width: min(100%, 560px); max-height: 86vh; max-height: 86svh; overflow: auto;
  background-color: var(--crema); background-image: var(--papel); color: var(--tinta);
  border-radius: 22px 22px 0 0;
  padding: 0 14px calc(env(safe-area-inset-bottom) + 20px);
  animation: subir .28s cubic-bezier(.2, .8, .2, 1) both;
  -webkit-user-select: none; user-select: none;
}
.indice-cabeza {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 8px; background: var(--crema);
}
.indice-cabeza h3 { margin: 0; font-family: var(--f-script); font-weight: 400; font-size: 2.2rem; color: var(--vino); }
.indice-seccion {
  margin: 14px 6px 4px; font-size: .75rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--oro-oscuro);
}
.indice-item {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 11px 8px; border-radius: 12px; text-align: left; color: inherit; font: inherit;
}
.indice-item:hover { background: rgba(15, 58, 43, .06); }
.indice-item.hoy { background: rgba(214, 178, 94, .25); }
.indice-chip {
  min-width: 56px; padding: 6px 4px; border-radius: 9px; text-align: center;
  font-weight: 700; font-size: .8rem; color: var(--vino); background: rgba(142, 29, 46, .08);
}
.indice-texto strong { display: block; font-family: var(--f-serif); font-size: 1.2rem; font-weight: 600; line-height: 1.15; color: var(--verde-800); }
.indice-texto span { font-size: .82rem; color: #776e5d; }
.indice-hoy {
  margin-left: auto; padding: 4px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; color: #fff; background: var(--vino);
}

/* ---------------- Editor de la foto ---------------- */
.editor-fondo {
  position: fixed; inset: 0; z-index: 25;
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 12px);
  background: rgba(4, 14, 10, .86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: aparecer .2s ease both;
}
.editor-fondo[hidden] { display: none; }
.editor {
  width: min(100%, 400px); max-height: 100%; overflow: auto;
  padding: 20px 18px 12px; border-radius: 22px; text-align: center;
  background-color: var(--crema); background-image: var(--papel); color: var(--tinta);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}
.editor h3 { margin: 0; font-family: var(--f-script); font-weight: 400; font-size: 2.3rem; line-height: 1.1; color: var(--vino); }
.editor-ayuda { margin: 4px 6px 16px; font-size: .9rem; line-height: 1.4; color: #6b6457; }
.editor-marco {
  position: relative; width: min(66vw, 250px); aspect-ratio: 4 / 5; margin: 0 auto;
  overflow: hidden; border-radius: 50% 50% 14px 14px / 36% 36% 14px 14px;
  background: var(--crema-2);
  box-shadow: 0 0 0 5px var(--crema), 0 0 0 8px var(--oro), 0 14px 30px -12px rgba(0, 0, 0, .45);
  touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none;
}
.editor-marco:active { cursor: grabbing; }
.editor-marco img {
  position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0;
  pointer-events: none; -webkit-user-drag: none;
}
.editor-zoom { display: flex; align-items: center; gap: 10px; margin: 22px 2px 4px; }
.editor-zoom input { flex: 1; min-width: 0; height: 32px; accent-color: var(--vino); }
.editor-acciones { display: flex; gap: 10px; margin-top: 14px; }
.editor-acciones .boton { flex: 1; min-height: 50px; padding: 12px 10px; font-size: 1rem; }
.boton-borde { background: transparent; color: var(--verde-800); border: 1.5px solid rgba(15, 58, 43, .3); }
.editor-cancelar {
  margin-top: 6px; padding: 10px 16px; border: 0; background: none; cursor: pointer;
  color: #6b6457; font: 600 .95rem var(--f-ui);
}

/* ---------------- Prueba gratis y descargas ---------------- */
a.indice-item { text-decoration: none; }
.indice-item.bloqueado { opacity: .62; }
.indice-candado { margin-left: auto; font-size: 1rem; }
.esp-comprar {
  margin-top: 4cqw; padding: 3.5cqw 6cqw; border-radius: 999px;
  background: linear-gradient(180deg, var(--oro-claro), var(--oro) 55%, var(--oro-oscuro));
  color: var(--verde-950); text-decoration: none; font: 800 5cqw/1.2 var(--f-ui);
  box-shadow: 0 2cqw 5cqw -2cqw rgba(168, 132, 58, .8);
}
.volver-tienda {
  position: absolute; z-index: 3;
  top: calc(env(safe-area-inset-top) + 16px); left: calc(env(safe-area-inset-left) + 14px);
  padding: 9px 14px; border-radius: 999px;
  background: rgba(6, 24, 15, .55); color: var(--oro-claro);
  font: 700 .85rem var(--f-ui); text-decoration: none;
  border: 1px solid rgba(214, 178, 94, .35);
}

/* ---------------- Tamaño de letra ---------------- */
.boton-letra span { font: 700 1.15rem/1 var(--f-texto); }
.boton-letra small { font-size: .72em; }
.panel-letra {
  position: absolute; left: 50%; bottom: calc(100% + 6px); z-index: 5;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 18px;
  background: var(--crema); color: var(--tinta);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6);
  animation: aparecer .15s ease both;
}
.panel-letra[hidden] { display: none; }
.panel-letra .icono-boton { color: var(--verde-800); border-color: rgba(15, 58, 43, .2); background: rgba(15, 58, 43, .06); }
.panel-letra-texto { display: flex; flex-direction: column; align-items: center; min-width: 116px; }
.panel-letra-texto strong { font-size: .9rem; }
.panel-letra-texto span { font-size: .78rem; color: #776e5d; }
.a-chica { font: 700 .95rem/1 var(--f-texto); }
.a-grande { font: 700 1.45rem/1 var(--f-texto); }

/* ---------------- Avisos ---------------- */
.aviso-flotante {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 30;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 14px;
  background: var(--crema); color: var(--tinta);
  font-weight: 600; font-size: .95rem; text-align: center;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6);
  animation: subir .25s ease both;
}

@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translate(var(--tx, 0), 24px); opacity: 0; } }
.aviso-flotante { --tx: -50%; }

/* Pantallas bajitas (celular acostado) */
@media (max-height: 520px) {
  .barra { padding: 4px 10px; }
  .barra-titulo { font-size: 1.35rem; }
  .icono-boton { width: 40px; height: 40px; }
  .barra-abajo { padding-bottom: 6px; }
}

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