:root {
  --crema: #FBF6EF;
  --papel: #FFFDF8;
  --rosa: #F4D9D8;
  --rosa-medio: #EBC3C1;
  --lavanda: #E6DDF3;
  --cielo: #DCEBF7;
  --menta: #DDF0E6;
  --durazno: #FBE3D3;
  --vino: #8C4A62;
  --vino-oscuro: #6E3449;
  --dorado: #C9A46A;
  --tinta: #3B2A2E;
  --suave: #8A7175;
  --linea: rgba(122, 46, 58, .14);
  --sombra: 0 10px 30px -12px rgba(90, 31, 41, .28);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mano: 'Dancing Script', cursive;
  --radio: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--tinta);
  background:
    radial-gradient(ellipse at top, rgba(244, 217, 216, .55), transparent 60%),
    var(--crema);
  min-height: 100vh;
  line-height: 1.6;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--vino); margin: 0; line-height: 1.15; }
img { max-width: 100%; display: block; }
button { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Botones y formularios ---------- */
.btn {
  border: none; cursor: pointer;
  background: var(--vino); color: var(--papel);
  padding: .7rem 1.4rem; border-radius: 999px;
  font-weight: 500; letter-spacing: .02em;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--vino-oscuro); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-texto { background: none; border: none; color: var(--suave); cursor: pointer; padding: .4rem .6rem; }
.btn-texto:hover { color: var(--vino); }
.btn-borrar { background: none; border: none; color: var(--suave); cursor: pointer; font-size: .85rem; margin-top: 1.5rem; }
.btn-borrar:hover { color: #b3261e; }
.error { color: #b3261e; font-size: .9rem; min-height: 1.2em; margin: .4rem 0 0; }
.nota, .ayuda { color: var(--suave); font-size: .85rem; }
.ayuda { text-align: center; margin: -.5rem 0 1rem; }

input, textarea, select {
  width: 100%; font: inherit; color: var(--tinta);
  background: var(--papel); border: 1px solid var(--linea);
  border-radius: 10px; padding: .65rem .8rem; margin-top: .3rem;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--dorado); outline-offset: 1px; }
textarea { font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; resize: vertical; }
.formulario { display: grid; gap: .9rem; }
.formulario label { font-size: .85rem; color: var(--suave); }
.formulario .fila { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.formulario .check { display: flex; gap: .5rem; align-items: center; }
.formulario .check input { width: auto; margin: 0; }

/* ---------- Trenza (Dios, tú y yo) ---------- */
.trenza { width: 120px; margin: 0 auto 1rem; }
.trenza.grande { width: 180px; }
.trenza.mini { display: inline-block; width: 46px; margin: 0; vertical-align: middle; }
.trenza svg { width: 100%; height: auto; overflow: visible; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 16px;
  background: url('../imagenes/decoracion/fondo-pastel.svg') center / cover;
}
.login-card {
  width: min(420px, 100%); text-align: center;
  background: rgba(255, 253, 248, .85); backdrop-filter: blur(6px);
  border: 1px solid var(--linea); border-radius: 24px;
  padding: 2.5rem 1.75rem; box-shadow: var(--sombra);
}
.login-card h1 { font-size: 2.6rem; }
.login-card form { display: grid; gap: .8rem; margin-top: 1.5rem; }
.login-card input { text-align: center; }
.versiculo { font-family: var(--serif); font-style: italic; color: var(--suave); font-size: 1.15rem; margin: .6rem 0 0; }
.versiculo span { display: block; font-style: normal; font-family: var(--sans); font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; color: var(--dorado); margin-top: .2rem; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 16px;
  background: rgba(251, 246, 239, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.marca { font-family: var(--serif); font-size: 1.35rem; color: var(--vino); text-decoration: none; white-space: nowrap; }
#nav { display: flex; gap: .25rem; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
#nav a {
  text-decoration: none; color: var(--suave); white-space: nowrap;
  padding: .4rem .85rem; border-radius: 999px; font-size: .9rem; transition: .2s;
}
#nav a:hover { color: var(--vino); }
#nav a.activo { background: var(--rosa); color: var(--vino); }
@media (max-width: 760px) {
  .cabecera { flex-wrap: wrap; gap: .4rem; }
  .marca { flex: 1; }
  #nav { order: 3; width: 100%; margin: 0; }
}

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 4rem; }
.vista { position: relative; animation: aparecer .5s ease; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.titulo-vista { text-align: center; padding: 3rem 0 2rem; position: relative; z-index: 1; }
.titulo-vista h2 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.eyebrow { font-size: .75rem; letter-spacing: .25em; text-transform: uppercase; color: var(--dorado); margin: 0 0 .5rem; }
.frase { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--suave); max-width: 560px; margin: .8rem auto 0; }
.subtitulo { font-size: 1.8rem; text-align: center; margin: 3rem 0 1.25rem; }

/* ---------- Inicio ---------- */
.hero { text-align: center; padding: 4rem 0 2.5rem; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 5rem); }
.contador { display: flex; justify-content: center; gap: clamp(.75rem, 4vw, 2.5rem); margin-top: 2.5rem; }
.contador div { display: grid; }
.contador b { font-family: var(--serif); font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 500; color: var(--vino); font-variant-numeric: tabular-nums; }
.contador span { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--suave); }
.contador-nota { font-family: var(--serif); font-style: italic; color: var(--suave); font-size: 1.1rem; }
.accesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 1rem; }
.acceso {
  display: grid; gap: .2rem; text-decoration: none; color: var(--tinta);
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.4rem; transition: transform .25s, box-shadow .25s;
}
.acceso:hover { transform: translateY(-3px); box-shadow: var(--sombra); }
.acceso span { font-size: 1.6rem; }
.acceso b { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; color: var(--vino); }
.acceso small { color: var(--suave); }

/* ---------- Sobre ella ---------- */
.polaroids { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.polaroid { background: #fff; padding: .7rem .7rem 2.2rem; box-shadow: var(--sombra); width: 210px; transition: transform .3s; }
.polaroid:nth-child(odd) { transform: rotate(-3deg); }
.polaroid:nth-child(even) { transform: rotate(2.5deg); }
.polaroid:hover { transform: rotate(0) scale(1.04); }
.polaroid img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.favoritos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; }
.favorito { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.1rem; text-align: center; }
.favorito span { font-size: 1.6rem; }
.favorito small { display: block; color: var(--suave); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; margin-top: .3rem; }
.favorito b { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; color: var(--vino); }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; perspective: 1000px; }
.tarjeta { height: 170px; border: none; background: none; padding: 0; cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.4, .2, .2, 1); }
.tarjeta.volteada { transform: rotateY(180deg); }
.tarjeta > span {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radio);
  display: grid; place-items: center; padding: 1.25rem; text-align: center;
}
.tarjeta .frente { background: linear-gradient(135deg, var(--rosa), var(--rosa-medio)); font-family: var(--serif); font-size: 1.6rem; color: var(--vino); }
.tarjeta .reverso { background: var(--vino); color: var(--papel); transform: rotateY(180deg); font-family: var(--serif); font-size: 1.25rem; font-style: italic; }

/* ---------- Barra de acciones ---------- */
.barra { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.barra.fin { justify-content: flex-end; }
.chips { display: flex; gap: .4rem; }
.chips button { border: 1px solid var(--linea); background: var(--papel); color: var(--suave); border-radius: 999px; padding: .45rem 1rem; cursor: pointer; }
.chips button.activo { background: var(--rosa); color: var(--vino); border-color: transparent; }

/* ---------- Sobres ---------- */
.sobres { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; position: relative; z-index: 1; }
.sobre {
  position: relative; aspect-ratio: 4 / 3; border: none; padding: 0; cursor: pointer;
  border-radius: 10px; overflow: hidden; text-align: left; color: var(--tinta);
  background: linear-gradient(160deg, #F8E8E4, #F0D3CF);
  box-shadow: var(--sombra); transition: transform .3s, box-shadow .3s;
}
.sobre:hover { transform: translateY(-5px) rotate(-.6deg); box-shadow: 0 18px 36px -14px rgba(90, 31, 41, .38); }
.sobre::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: #EBC6C1; clip-path: polygon(0 100%, 50% 48%, 100% 100%);
}
.sobre-portada { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; mix-blend-mode: multiply; }
.sobre-solapa {
  position: absolute; inset: 0 0 auto 0; height: 58%; z-index: 2;
  background: linear-gradient(#EFCFCA, #E7BDB7); clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .5s ease;
}
.sobre:hover .sobre-solapa { transform: scaleY(.9); }
.sello {
  position: absolute; left: 50%; top: 36%; z-index: 3; transform: translate(-50%, -50%);
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #A84553, var(--vino) 55%, var(--vino-oscuro));
  color: #F3D9A9; font-family: var(--serif); font-size: 1.4rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3), inset 0 -3px 6px rgba(0, 0, 0, .25);
}
.sobre-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: .8rem 1rem; display: grid; text-align: center; }
.sobre-de { font-family: var(--mano); color: var(--vino); font-size: 1.05rem; }
.sobre-titulo { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--tinta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sobre-fecha { font-size: .72rem; color: var(--suave); letter-spacing: .05em; }
.sobre.cerrado { cursor: default; filter: saturate(.5); }
.sobre.cerrado:hover { transform: none; }
.sobre.cerrado .sello { background: radial-gradient(circle at 35% 30%, #9a8a8c, #6f5f62); font-size: 1.1rem; }
.sobre.abierto-anim .sobre-solapa { transform: rotateX(180deg); }
.vacio { grid-column: 1 / -1; text-align: center; color: var(--suave); font-family: var(--serif); font-style: italic; font-size: 1.25rem; padding: 2rem; }

/* ---------- Modal y papel ---------- */
.modal.sobre-editor { z-index: 150; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-fondo { position: absolute; inset: 0; background: rgba(59, 42, 46, .55); backdrop-filter: blur(3px); animation: fundido .3s; }
.modal-contenido {
  position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--papel); border-radius: 16px; padding: 2rem 1.5rem; box-shadow: 0 30px 60px rgba(0, 0, 0, .3);
  animation: abrir .45s cubic-bezier(.2, .8, .2, 1);
}
.modal-cerrar { position: absolute; top: .6rem; right: .8rem; border: none; background: none; font-size: 1.8rem; color: var(--suave); cursor: pointer; line-height: 1; }
@keyframes fundido { from { opacity: 0; } }
@keyframes abrir { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.modal-contenido h3 { font-size: 1.8rem; margin-bottom: 1rem; }

.papel {
  background:
    repeating-linear-gradient(transparent 0 31px, rgba(122, 46, 58, .08) 31px 32px),
    var(--papel);
  padding: .5rem .25rem;
}
.papel .p-fecha { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dorado); }
.papel h3 { font-size: 2rem; margin: .3rem 0 1rem; }
.papel .p-foto { margin: 0 0 1.25rem; border-radius: 8px; box-shadow: var(--sombra); }
.papel .p-texto { font-family: var(--serif); font-size: 1.3rem; line-height: 32px; white-space: pre-wrap; margin: 0; }
.papel .p-firma { font-family: var(--mano); font-size: 1.6rem; color: var(--vino); text-align: right; margin-top: 1.5rem; }

/* ---------- Fechas ---------- */
.proxima {
  text-align: center; background: linear-gradient(135deg, var(--vino), var(--vino-oscuro)); color: var(--papel);
  border-radius: 20px; padding: 2rem 1.5rem; margin-bottom: 2rem; box-shadow: var(--sombra);
}
.proxima small { letter-spacing: .2em; text-transform: uppercase; font-size: .72rem; color: var(--dorado); }
.proxima h3 { color: var(--papel); font-size: 2rem; margin: .4rem 0; }
.proxima b { font-family: var(--serif); font-size: 3rem; font-weight: 500; display: block; line-height: 1; }
.linea-tiempo { list-style: none; padding: 0; margin: 0; position: relative; }
.linea-tiempo::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--rosa-medio), var(--dorado)); }
.hito { position: relative; padding: 0 0 2rem 64px; }
.hito-icono {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%;
  background: var(--papel); border: 2px solid var(--rosa-medio); display: grid; place-items: center; font-size: 1.3rem;
}
.hito-tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.1rem 1.25rem; }
.hito-tarjeta time { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dorado); }
.hito-tarjeta h4 { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; color: var(--vino); margin: .2rem 0; }
.hito-tarjeta p { margin: .3rem 0 0; color: var(--tinta); white-space: pre-wrap; }
.hito-tarjeta img { margin-top: .8rem; border-radius: 10px; max-height: 320px; object-fit: cover; width: 100%; }
.hito-tarjeta .btn-borrar { margin-top: .6rem; }
.btn-editar { background: none; border: none; color: var(--suave); cursor: pointer; font-size: .85rem; margin: 1.5rem .8rem 0 0; }
.btn-editar:hover { color: var(--vino); }
.hito-tarjeta .btn-editar { margin-top: .6rem; }
.proposito { max-width: 560px; margin: .8rem auto 0; color: var(--tinta); font-size: .95rem; }
.proposito b { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--vino); margin-bottom: .2rem; }
.album-nuevo { border: 1px dashed var(--linea); border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1rem; }
.album-nuevo legend { color: var(--vino); padding: 0 .4rem; }
.foto-actual { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.foto-actual img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.foto-actual label { display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.foto-actual input { width: auto; margin: 0; }

/* ---------- Proyecto Princesa ---------- */
#princesita-vista { min-height: 80vh; }
#decoraciones { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
#decoraciones img { position: absolute; width: 110px; opacity: .55; animation: flotar 9s ease-in-out infinite; }
@keyframes flotar { 50% { transform: translateY(-14px) rotate(4deg); } }
.falta { display: block; font-size: .72rem; color: var(--vino); font-weight: 500; }

.final {
  position: relative; z-index: 1; margin: 3rem auto 0; max-width: 560px; text-align: center;
  background: url('../imagenes/decoracion/noche.svg') center / cover;
  color: #F6E7D0;
  border-radius: 24px; padding: 2.5rem 1.75rem; box-shadow: 0 25px 50px -15px rgba(20, 10, 13, .6);
  overflow: hidden;
}
.final::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(1px 1px at 20% 30%, #fff8, transparent), radial-gradient(1px 1px at 70% 20%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, #fff7, transparent), radial-gradient(1px 1px at 85% 65%, #fff5, transparent),
    radial-gradient(1px 1px at 10% 75%, #fff6, transparent), radial-gradient(1.5px 1.5px at 55% 45%, #fff4, transparent);
}
.final h3 { color: #F3D9A9; font-size: 2.1rem; }
.final p { font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: #E9D3C6; }
.final .sello { position: static; transform: none; margin: 0 auto 1.25rem; width: 64px; height: 64px; font-size: 1.6rem; }
.final form { display: grid; gap: .7rem; margin-top: 1.25rem; position: relative; z-index: 1; }
.final input { text-align: center; background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(243, 217, 169, .35); }
.final input::placeholder { color: rgba(246, 231, 208, .5); }
.final .btn { background: var(--dorado); color: #2a161b; }
.final .error { color: #ffb4ab; }
.final.temblor { animation: temblor .4s; }
@keyframes temblor { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.autor { position: relative; z-index: 1; margin: 3.5rem auto 0; max-width: 640px; background: var(--papel); border: 1px dashed var(--linea); border-radius: var(--radio); padding: 1rem 1.25rem; }
.autor summary { cursor: pointer; color: var(--suave); font-size: .95rem; }
.autor[open] summary { margin-bottom: 1rem; }

/* ---------- Revelación ---------- */
.revelacion {
  position: fixed; inset: 0; z-index: 100; background: #0f0809;
  display: grid; place-items: center; padding: 24px; text-align: center; overflow-y: auto;
  animation: fundido 1.5s;
}
.revelacion .linea {
  font-family: var(--serif); color: #F6E7D0; font-size: clamp(1.6rem, 5vw, 2.6rem);
  opacity: 0; transition: opacity 1.6s ease, transform 1.6s ease; transform: translateY(10px); margin: .6rem 0;
}
.revelacion .linea.ver { opacity: 1; transform: none; }
.revelacion .linea:last-of-type { color: #F3D9A9; }
.revelacion .papel { text-align: left; border-radius: 14px; padding: 1.75rem 1.5rem; max-width: 620px; margin: 2rem auto 0; opacity: 0; transition: opacity 2s; }
.revelacion .papel.ver { opacity: 1; }
.revelacion .btn-texto { color: rgba(246, 231, 208, .6); margin-top: 2rem; opacity: 0; transition: opacity 1s; }
.revelacion .btn-texto.ver { opacity: 1; }

/* ---------- Pétalos ---------- */
#petalos { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.petalo {
  position: absolute; top: -30px; width: 14px; height: 12px; border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, #F4C7C9, #E89FA6); opacity: .7;
  animation: caer linear infinite;
}
@keyframes caer {
  0% { transform: translate(0, -30px) rotate(0); }
  100% { transform: translate(80px, 105vh) rotate(540deg); }
}

.pie { text-align: center; color: var(--suave); font-size: .85rem; padding: 2rem 16px 3rem; font-family: var(--serif); font-style: italic; }
.cargando { grid-column: 1 / -1; text-align: center; color: var(--suave); }

@media (max-width: 520px) {
  .formulario .fila { grid-template-columns: 1fr; }
  .sobres { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .sello { width: 40px; height: 40px; font-size: 1rem; top: 30%; }
  .sobre-de { font-size: .9rem; }
  .sobre-fecha { font-size: .65rem; }
  .sobre-titulo { font-size: 1rem; }
  .sobre-info { padding: .5rem .6rem; }
}
@media (max-width: 360px) { .sobres { grid-template-columns: 1fr; } }

/* ---------- Fechas: línea del tiempo ---------- */
.linea-tiempo.vacia::before { display: none; }
.hito-icono { background: var(--tono, var(--papel)); }
.hito-cabeza { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.etiqueta { background: var(--tono); color: var(--vino); border-radius: 999px; padding: .1rem .65rem; font-size: .7rem; font-weight: 500; }
.hito-collage { margin-top: .8rem; max-width: 260px; }
.hito-collage .collage { box-shadow: var(--sombra); }
.hito-collage small { display: block; margin-top: .3rem; color: var(--suave); }
.hito .hito-tarjeta { transition: box-shadow .4s, transform .4s; }
.hito.resaltar .hito-tarjeta { box-shadow: 0 0 0 4px #F6C9D4, var(--sombra); transform: scale(1.02); }
.marca-anio { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; margin: .5rem 0 1.25rem; }
.marca-anio span {
  font-family: var(--serif); font-size: 2rem; color: var(--vino); line-height: 1.2;
  background: linear-gradient(135deg, var(--lavanda), var(--rosa)); padding: .15rem 1.3rem; border-radius: 999px; box-shadow: var(--sombra);
}
.marca-anio small { color: var(--suave); font-size: .8rem; margin: .35rem 0 0 .6rem; }
.marca-mes {
  position: relative; z-index: 1; width: fit-content; margin: 0 0 1rem 40px; padding: .15rem .9rem; border-radius: 999px;
  background: var(--crema); border: 1px solid var(--linea); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--dorado);
}
@media (min-width: 760px) {
  .linea-tiempo:not(.simple)::before { left: 50%; transform: translateX(-1px); }
  .linea-tiempo:not(.simple) .hito { width: 50%; padding: 0 44px 2rem 0; }
  .linea-tiempo:not(.simple) .hito.der { margin-left: 50%; padding: 0 0 2rem 44px; }
  .linea-tiempo:not(.simple) .hito.izq .hito-icono { left: auto; right: -23px; }
  .linea-tiempo:not(.simple) .hito.der .hito-icono { left: -23px; }
  .linea-tiempo:not(.simple) .marca-anio { align-items: center; }
  .linea-tiempo:not(.simple) .marca-anio small { margin-left: 0; }
  .linea-tiempo:not(.simple) .marca-mes { margin: 0 auto 1rem; }
}

/* ---------- Fechas: calendario ---------- */
.migas { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.migas button { border: none; background: var(--lavanda); color: var(--vino); border-radius: 999px; padding: .35rem 1rem; cursor: pointer; font-size: .9rem; }
.migas button:hover { background: #d9cdee; }
.migas span { color: var(--vino); font-weight: 500; }
.migas i { color: var(--suave); font-style: normal; }
.cal-anios { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.cal-anio {
  border: none; cursor: pointer; border-radius: 22px; padding: 1.75rem 1rem; display: grid; gap: .3rem; text-align: center;
  background: linear-gradient(145deg, var(--rosa), var(--lavanda)); box-shadow: var(--sombra); transition: transform .3s;
}
.cal-anio:hover { transform: translateY(-5px) rotate(-1deg); }
.cal-anio b { font-family: var(--serif); font-size: 2.8rem; font-weight: 500; color: var(--vino); line-height: 1; }
.cal-anio small { color: var(--suave); font-size: .8rem; }
.cal-anio.con-foto { background: linear-gradient(rgba(255, 253, 248, .5), rgba(255, 253, 248, .82)), var(--portada) center / cover; }
.cal-iconos { font-size: 1.1rem; letter-spacing: .12em; min-height: 1.4em; }
.migas small { color: var(--suave); }

/* Momentos de un año: foto de vista previa, fecha, título y descripción */
.momentos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.momento {
  display: flex; flex-direction: column; padding: 0; border: none; cursor: pointer; text-align: left; color: var(--tinta);
  background: var(--papel); border-radius: 20px; overflow: hidden; box-shadow: var(--sombra); transition: transform .3s, box-shadow .3s;
}
.momento:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: 0 18px 36px -14px rgba(90, 31, 41, .38); }
.momento-foto { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: linear-gradient(145deg, var(--tono, var(--rosa)), #fff); }
.momento-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.momento:hover .momento-foto img { transform: scale(1.06); }
.momento-dibujo { font-size: 3.4rem; animation: balanceo 4.5s ease-in-out infinite; }
.momento-foto .etiqueta { position: absolute; top: .7rem; left: .7rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }
.momento-info { display: grid; gap: .25rem; padding: 1rem 1.1rem 1.2rem; }
.momento-info time { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dorado); }
.momento-info b { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--vino); line-height: 1.2; }
.momento-desc { color: var(--suave); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.momento-grande { width: 100%; max-height: 60vh; object-fit: cover; border-radius: 14px; margin-bottom: 1rem; }
.momento-detalle h3 { margin: .4rem 0 .6rem; }
.momento-texto { font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; white-space: pre-wrap; margin: 0; }

/* ---------- Buscadores ---------- */
.buscador { position: relative; max-width: 560px; margin: 0 auto 1.5rem; }
.buscador::before { content: '🔎'; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .7; pointer-events: none; }
.buscador input {
  margin: 0; padding: .75rem 1rem .75rem 2.6rem; border-radius: 999px; border: 1px solid var(--linea);
  background: rgba(255, 253, 248, .9); box-shadow: 0 6px 18px -12px rgba(140, 74, 98, .35);
}
.buscador input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 3px var(--lavanda), 0 6px 18px -12px rgba(140, 74, 98, .35); }
.buscador.grande { max-width: 680px; margin: 0 auto 1.25rem; }
.buscador.grande input { padding-top: .95rem; padding-bottom: .95rem; font-size: 1.02rem; }
.buscador.mini { margin: 0; flex: 1 1 220px; max-width: 360px; }
.buscador.mini input { padding-top: .55rem; padding-bottom: .55rem; font-size: .9rem; }
mark { background: #F7DC94; color: inherit; border-radius: 3px; padding: 0 2px; }

/* Resultados del buscador global */
.resultados { max-width: 820px; margin: 0 auto 2rem; display: grid; gap: 1rem; }
.res-grupo { background: var(--papel); border: 1px solid var(--linea); border-radius: 18px; padding: .9rem 1rem; box-shadow: var(--sombra); }
.res-grupo h4 { margin: 0 0 .5rem; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--vino); }
.res-grupo h4 small { font-family: var(--sans); font-size: .75rem; color: var(--suave); font-weight: 400; }
.res-item {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
  padding: .5rem .6rem; border-radius: 12px; color: var(--tinta); transition: background .2s;
}
.res-item:hover { background: var(--rosa); }
.res-item img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; }
.res-item span { display: grid; }
.res-item b { font-weight: 500; }
.res-item small { color: var(--suave); font-size: .8rem; }

/* ---------- Grupos de cartas ---------- */
.grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.grupo {
  position: relative; overflow: hidden; border: none; cursor: pointer; text-align: center; color: var(--tinta);
  border-radius: 24px; padding: 1.75rem 1.1rem 1.25rem; display: grid; justify-items: center; gap: .35rem;
  background: linear-gradient(160deg, #fff, var(--tapa)); box-shadow: var(--sombra); transition: transform .3s, box-shadow .3s;
}
.grupo:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 18px 36px -14px rgba(90, 31, 41, .38); }
.grupo b { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--vino); line-height: 1.15; position: relative; }
.grupo small { color: var(--suave); position: relative; }
.grupo-libro { font-size: .75rem; color: var(--vino); background: rgba(255, 255, 255, .7); border-radius: 999px; padding: .15rem .7rem; margin-top: .3rem; position: relative; }
.grupo-portada { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
/* Fajo de sobres dibujado */
.grupo-sobres { position: relative; width: 86px; height: 62px; margin-bottom: .4rem; }
.grupo-sobres i {
  position: absolute; left: 8px; width: 70px; height: 46px; border-radius: 6px; background: #F8E8E4;
  box-shadow: 0 3px 8px rgba(140, 74, 98, .2); transition: transform .35s;
}
.grupo-sobres i::before { content: ''; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 58%); background: #EBC6C1; border-radius: 6px 6px 0 0; }
.grupo-sobres i::after { content: '♥'; position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 50%; background: var(--vino); color: #F3D9A9; font-size: 9px; display: grid; place-items: center; }
.grupo-sobres i:nth-child(1) { top: 14px; transform: rotate(-10deg); background: var(--lavanda); }
.grupo-sobres i:nth-child(2) { top: 8px; transform: rotate(7deg); background: var(--cielo); }
.grupo-sobres i:nth-child(3) { top: 2px; }
.grupo:hover .grupo-sobres i:nth-child(1) { transform: rotate(-18deg) translateX(-8px); }
.grupo:hover .grupo-sobres i:nth-child(2) { transform: rotate(14deg) translateX(8px); }
.grupo:hover .grupo-sobres i:nth-child(3) { transform: translateY(-6px); }
.grupo.especial { background: linear-gradient(140deg, #E6DDF3, #F8E1E7, #DCEBF7); background-size: 200% 200%; animation: cieloPastel 10s ease-in-out infinite; }
.grupo.especial::before { content: '✦ ✧ ✦'; position: absolute; top: .7rem; right: 1rem; color: #C9A46A; letter-spacing: .3em; font-size: .8rem; animation: titilar 3s ease-in-out infinite; }
.grupo-cabeza { border-radius: 28px; background: linear-gradient(160deg, transparent, var(--tapa, var(--rosa))); padding: 2.25rem 1rem 2rem; margin: .5rem 0 1.5rem; }
#cartas-resultados { margin-top: 2rem; }
#cartas-resultados .subtitulo small { font-family: var(--sans); font-size: .9rem; color: var(--suave); }
.mover-grupo { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--linea); }
.mover-grupo label { font-size: .85rem; color: var(--suave); flex: 1 1 220px; }
#princesita-vista { position: relative; }
.princesita-barra { position: relative; z-index: 1; padding-top: 1.25rem; }
.fila-desc { margin-top: .5rem; }
.fila-desc .error { color: var(--vino); }

/* ---------- Libros: portadas y hojas de documento ---------- */
.libro-tapa.con-portada { background: linear-gradient(to top, rgba(40, 20, 30, .65), rgba(40, 20, 30, 0) 55%), var(--portada) center / cover; justify-content: flex-end; }
.libro-tapa.con-portada b { color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.libro-tapa.con-portada small { color: rgba(255, 255, 255, .85); }
.hoja.portada.con-imagen { background: linear-gradient(to top, rgba(40, 20, 30, .7), rgba(40, 20, 30, .05) 60%), var(--portada) center / cover; justify-content: flex-end; padding-bottom: 3.5rem; }
.hoja.portada.con-imagen h2, .hoja.portada.con-imagen .dedicatoria, .hoja.portada.con-imagen .hoja-marca { color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.hoja.hoja-imagen { padding: .6rem .6rem 2.2rem; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.hoja.hoja-imagen img { width: 100%; height: 100%; max-height: none; object-fit: contain; margin: 0; border-radius: 4px; }
.hoja.hoja-imagen .btn-borrar { position: absolute; top: .4rem; right: .6rem; margin: 0; background: rgba(255, 255, 255, .85); border-radius: 999px; padding: .1rem .6rem; }
.lector-barra .buscador.mini { order: 0; }
#impresion .hoja.hoja-imagen img { max-height: 88vh; }

/* ---------- Tonos pastel ---------- */
.tono-rosa { --tono: var(--rosa); }
.tono-lavanda { --tono: var(--lavanda); }
.tono-cielo { --tono: var(--cielo); }
.tono-menta { --tono: var(--menta); }
.tono-durazno { --tono: var(--durazno); }

/* ---------- Orquídea y citas ---------- */
.orquidea { width: 64px; margin: 0 auto .5rem; filter: drop-shadow(0 4px 8px rgba(140, 74, 98, .18)); }
.orquidea svg { width: 100%; height: auto; display: block; }
.apodo { font-family: var(--mano); font-size: 1.6rem; color: var(--vino); margin: .2rem 0 0; }
.cita-biblica {
  max-width: 620px; margin: 2rem auto 0; padding: 1.25rem 1.5rem; text-align: center;
  background: linear-gradient(135deg, var(--lavanda), var(--cielo)); border-radius: var(--radio);
  font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--tinta);
}
.cita-biblica cite { display: block; margin-top: .4rem; font-family: var(--sans); font-style: normal; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; color: var(--vino); }
.titulo-vista .cita-biblica { margin-top: 1.25rem; }

/* Favoritos y tarjetas con su tono pastel */
.favorito { background: linear-gradient(160deg, var(--papel), var(--tono, var(--papel))); }
.favorito em { display: block; font-size: .8rem; color: var(--suave); }
.favorito-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto; border: 3px solid #fff; box-shadow: var(--sombra); }
.tarjeta .frente { background: linear-gradient(135deg, var(--tono, var(--rosa)), #fff); }

/* ---------- Frutos del Espíritu ---------- */
.frutos { list-style: none; padding: 0; margin: 1.5rem auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; max-width: 640px; }
.frutos li {
  padding: .3rem .8rem; border-radius: 999px; font-size: .8rem; color: var(--suave);
  border: 1px dashed var(--linea); background: transparent; transition: .4s;
}
.frutos li.visto { background: var(--tono); color: var(--vino); border-color: transparent; font-weight: 500; }
.elegir-frutos { border: 1px solid var(--linea); border-radius: 10px; padding: .6rem .8rem; }
.elegir-frutos legend { font-size: .85rem; color: var(--suave); padding: 0 .3rem; }
#form-frutos { display: flex; flex-wrap: wrap; gap: .4rem; }
.fruto-check { display: inline-flex !important; align-items: center; gap: .3rem; background: var(--tono); color: var(--tinta) !important; border-radius: 999px; padding: .25rem .7rem; cursor: pointer; }
.fruto-check input { width: auto; margin: 0; }
/* ---------- Etiquetas de las cartas (mismo estilo que los frutos) ---------- */
.etiquetas-cartas { margin: 1rem auto 1.5rem; position: relative; z-index: 1; }
.etiquetas-cartas li { padding: 0; border: none; }
.etiqueta-chip, .etiqueta-nueva { padding: .3rem .8rem; border-radius: 999px; font: inherit; font-size: .8rem; cursor: pointer; transition: .25s; }
.etiqueta-chip { border: 1px solid transparent; background: var(--tono); color: var(--vino); font-weight: 500; }
.etiqueta-chip small { opacity: .6; font-size: .72rem; margin-left: .15rem; }
.etiqueta-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -6px rgba(90, 31, 41, .5); }
.etiqueta-chip.activo { border-color: var(--vino); box-shadow: 0 0 0 2px var(--vino); }
.etiqueta-nueva { border: 1px dashed var(--linea); background: transparent; color: var(--suave); }
.etiqueta-nueva:hover { border-color: var(--vino); color: var(--vino); }
.etiquetas-elegir { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.sobre-etiquetas { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; margin-top: .3rem; }
.sobre-etiquetas i { font-style: normal; background: var(--tono); color: var(--vino); border-radius: 999px; padding: .05rem .5rem; font-size: .68rem; font-family: var(--sans); }
.carta-etiquetas { justify-content: center; flex-wrap: wrap; margin: 0 0 .8rem; }
.etiquetas-filas { display: grid; gap: .5rem; }
.etiqueta-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem; border: 1px solid var(--linea); border-radius: 10px; }
.etiqueta-fila input[type="text"] { margin: 0; flex: 1 1 140px; }
.etiqueta-fila input.etiqueta-emoji { flex: 0 0 3.2rem; text-align: center; }
.etiqueta-fila .btn-borrar { margin: 0; }
.etiqueta-tonos { display: inline-flex; gap: .3rem; }
.etiqueta-tonos label { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--tono); box-shadow: 0 0 0 1px var(--linea); cursor: pointer; }
.etiqueta-tonos label:has(input:checked) { box-shadow: 0 0 0 2px var(--vino); }
.etiqueta-tonos input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.p-frutos { display: flex; gap: .4rem; margin: -.4rem 0 1rem; }
.p-frutos span { background: var(--tono); color: var(--vino); border-radius: 999px; padding: .15rem .7rem; font-size: .75rem; font-family: var(--sans); }
.final-falta { font-style: normal !important; font-family: var(--sans) !important; font-size: .85rem !important; color: #F3D9A9 !important; }

/* ---------- Respuesta final ---------- */
.respuesta { opacity: 0; transition: opacity 1.2s; margin-top: 1.5rem; }
.respuesta.ver { opacity: 1; }
.btn-si { background: #F6C9D4; color: #4a2433; font-size: 1.3rem; padding: .8rem 2.4rem; }
.btn-si:hover { background: #fff; }
.corazon { position: fixed; top: -40px; pointer-events: none; animation: caer linear forwards; z-index: 101; }

/* ---------- Botones extra ---------- */
.btn-sec { background: var(--lavanda); color: var(--vino); }
.btn-sec:hover { background: #d9cdee; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
label.btn { display: inline-block; }
.chips.envolver { flex-wrap: wrap; }

/* ---------- Libros: estante ---------- */
.estante { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.5rem; }
.libro-tapa {
  position: relative; aspect-ratio: 3 / 4; border: none; cursor: pointer; border-radius: 4px 12px 12px 4px;
  background: linear-gradient(100deg, rgba(0, 0, 0, .08) 0 6%, transparent 9%), var(--tapa);
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, .5), 6px 8px 18px -6px rgba(90, 40, 60, .35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 1rem;
  color: var(--tinta); text-align: center; transition: transform .3s, box-shadow .3s;
}
.libro-tapa:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: inset 4px 0 0 rgba(255, 255, 255, .5), 10px 16px 26px -8px rgba(90, 40, 60, .4); }
.libro-tapa b { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--vino); line-height: 1.15; }
.libro-tapa small { font-size: .75rem; color: var(--suave); }
.tapa-orquidea { width: 54px; }
.tapa-orquidea svg { width: 100%; height: auto; display: block; }

/* ---------- Libros: lector ---------- */
.lector-barra { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: 1.5rem 0 1rem; }
.lector-acciones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.libro-escena { display: flex; align-items: center; justify-content: center; gap: .5rem; perspective: 2000px; }
.pasar-pagina {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linea); background: var(--papel);
  font-size: 1.6rem; line-height: 1; color: var(--vino); cursor: pointer;
}
.pasar-pagina:disabled { opacity: .3; cursor: default; }
/* Todas las hojas miden lo mismo (proporción 3:4) y el libro cabe en el alto de la pantalla */
.libro { display: grid; grid-template-columns: 1fr; width: min(460px, 100%, 54vh); transform-style: preserve-3d; }
.libro.doble { grid-template-columns: 1fr 1fr; width: min(920px, 100%, 108vh); }
.libro .hoja { height: auto; aspect-ratio: 3 / 4; min-height: 0; }
.libro.doble .hoja:first-child { border-radius: 12px 0 0 12px; box-shadow: inset -18px 0 24px -18px rgba(90, 40, 60, .25), var(--sombra); }
.libro.doble .hoja:last-child { border-radius: 0 12px 12px 0; box-shadow: inset 18px 0 24px -18px rgba(90, 40, 60, .25), var(--sombra); }
.hoja {
  position: relative; height: min(620px, 72vh); overflow-y: auto; padding: 2.25rem 2rem 2.75rem;
  background: var(--papel); border-radius: 12px; box-shadow: var(--sombra);
}
.hoja h3 { font-size: 1.7rem; margin-bottom: .8rem; }
.hoja img { border-radius: 8px; margin-bottom: 1rem; max-height: 260px; width: 100%; object-fit: cover; }
.hoja-meta { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dorado); margin-bottom: .4rem; }
.hoja-texto { font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; white-space: pre-wrap; }
.hoja-num { position: absolute; bottom: .9rem; left: 0; right: 0; text-align: center; font-family: var(--serif); color: var(--suave); font-size: .9rem; }
.hoja.portada {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .8rem;
  background: linear-gradient(rgba(255, 253, 248, .55), rgba(255, 253, 248, .75)), var(--tapa);
}
.hoja.portada .orquidea { width: 90px; }
.hoja.portada h2 { font-size: 2.4rem; }
.dedicatoria { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--suave); max-width: 320px; margin: 0; }
.hoja-marca { position: absolute; bottom: 1.2rem; font-family: var(--mano); color: var(--vino); font-size: 1.2rem; margin: 0; }
.lector-indicador { text-align: center; color: var(--suave); font-size: .85rem; }
.libro.sale-izq { animation: salirIzq .26s ease-in forwards; }
.libro.sale-der { animation: salirDer .26s ease-in forwards; }
.libro.entra-der { animation: entrarDer .32s ease-out; }
.libro.entra-izq { animation: entrarIzq .32s ease-out; }
@keyframes salirIzq { to { transform: rotateY(-25deg) translateX(-30px); opacity: 0; } }
@keyframes salirDer { to { transform: rotateY(25deg) translateX(30px); opacity: 0; } }
@keyframes entrarDer { from { transform: rotateY(25deg) translateX(30px); opacity: 0; } }
@keyframes entrarIzq { from { transform: rotateY(-25deg) translateX(-30px); opacity: 0; } }
.elegir-color { display: flex; gap: .6rem; border: none; padding: 0; margin: 0; }
.elegir-color legend { font-size: .85rem; color: var(--suave); margin-bottom: .4rem; }
.elegir-color input { position: absolute; opacity: 0; }
.elegir-color span { display: block; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--linea); cursor: pointer; }
.elegir-color input:checked + span { box-shadow: 0 0 0 3px var(--vino); }
.elegir-color input:focus-visible + span { outline: 2px solid var(--dorado); outline-offset: 2px; }
@media (max-width: 520px) {
  .pasar-pagina { position: fixed; bottom: 1rem; z-index: 10; box-shadow: var(--sombra); }
  .pasar-pagina[data-dir="-1"] { left: 16px; }
  .pasar-pagina[data-dir="1"] { right: 16px; }
  .hoja { padding: 1.75rem 1.25rem 2.5rem; height: 70vh; }
}

/* ---------- Álbum ---------- */
.galeria { columns: 3 220px; column-gap: 1rem; }
.foto { display: block; width: 100%; margin: 0 0 1rem; padding: 0; border: none; background: #fff; border-radius: 10px; overflow: hidden; cursor: zoom-in; box-shadow: var(--sombra); break-inside: avoid; }
.foto img { width: 100%; transition: transform .4s; }
.foto:hover img { transform: scale(1.04); }
.foto-grande { margin: 0; }
.foto-grande img { border-radius: 10px; max-height: 70vh; margin: 0 auto; }
.foto-grande figcaption { text-align: center; color: var(--suave); margin-top: .6rem; font-size: .9rem; }
.collages { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.collage { position: relative; aspect-ratio: 1; background: var(--papel); border-radius: 12px; overflow: hidden; }
.celda { position: absolute; padding: 4px; }
.celda img, .celda span { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.celda span { display: grid; place-items: center; background: var(--lavanda); color: var(--vino); font-family: var(--serif); font-size: 1.4rem; }
.collage-tarjeta { margin: 0; background: var(--papel); padding: .6rem; border-radius: 16px; box-shadow: var(--sombra); }
.collage-tarjeta figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .2rem 0; }
.collage-tarjeta b { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--vino); }
#collage-vista .collage { max-width: 360px; margin: 0 auto; box-shadow: var(--sombra); }
/* Collages con formas (js/collages.js) */
.collage-svg svg { display: block; width: 100%; height: 100%; }
.collage-abrir { display: block; width: 100%; padding: 0; border: none; background: none; cursor: pointer; border-radius: 12px; }
.collage-abrir:hover .collage { box-shadow: 0 0 0 3px var(--rosa); }
.collage-tarjeta figcaption { flex-wrap: wrap; }
.collage-tarjeta figcaption small { display: block; color: var(--suave); font-size: .75rem; }
.collage-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }
.collage-ed-vista #collage-vista .collage { max-width: none; }
.collage-ed-vista .ayuda { text-align: center; margin-top: .4rem; }
.collage-ed-disenos .chips { margin-bottom: .6rem; gap: .3rem; }
.collage-ed-disenos .chips button { padding: .3rem .7rem; font-size: .78rem; }
.collage-disenos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; max-height: 340px; overflow-y: auto; padding: .2rem; }
.collage-disenos button { display: grid; gap: .2rem; padding: .25rem; border: 1px solid var(--linea); border-radius: 10px; background: #fff; cursor: pointer; color: var(--suave); font-size: .66rem; line-height: 1.2; text-align: center; }
.collage-disenos button .collage { border-radius: 6px; }
.collage-disenos button:hover { border-color: var(--vino); }
.collage-disenos button.activo { box-shadow: 0 0 0 2px var(--vino); border-color: transparent; color: var(--vino); }
.collage-fotos-cabeza { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .4rem; }
.collage-fotos-cabeza .btn { padding: .45rem .9rem; font-size: .85rem; }
@media (max-width: 700px) { .collage-ed { grid-template-columns: 1fr; } }
.elegir-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: .4rem; max-height: 240px; overflow-y: auto; }
.elegir-fotos button { position: relative; padding: 0; border: 3px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: none; }
.elegir-fotos img { width: 100%; height: 100%; object-fit: cover; }
.elegir-fotos .elegida { border-color: var(--vino); }
.elegir-fotos span:not(:empty) { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--vino); color: #fff; font-size: .75rem; display: grid; place-items: center; }

/* ---------- Imprimir libro / PDF ---------- */
#impresion { display: none; }
@media print {
  body.imprimiendo > *:not(#impresion) { display: none !important; }
  body.imprimiendo { background: #fff; }
  body.imprimiendo #impresion { display: block; }
  #impresion .hoja { height: auto; min-height: 92vh; overflow: visible; box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; }
  #impresion .hoja img { max-height: 40vh; }
}

/* ---------- Asistentes: Hiro, Roma y Bruno ---------- */
#asistente { position: fixed; right: 10px; bottom: 6px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
#asistente > * { pointer-events: auto; }
.personajes { display: flex; align-items: flex-end; }
.personaje {
  width: 92px; height: 100px; margin-left: -10px; padding: 0; border: none; background: none; cursor: pointer;
  animation: flotarGato 3.2s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(140, 74, 98, .25));
  transition: transform .3s;
}
.personaje.hiro { width: 112px; height: 122px; }
.personaje.roma { animation-delay: -1.1s; }
.personaje.bruno { animation-delay: -2.2s; }
.personaje svg { width: 100%; height: 100%; overflow: visible; }
.personaje.hablando { animation: hablandoCuerpo .5s ease-in-out infinite alternate; }
.personaje.salto { animation: saltoGato .6s cubic-bezier(.3, 1.6, .5, 1), flotarGato 3.2s ease-in-out .6s infinite; }
.personaje .ojo { transform-box: fill-box; transform-origin: center; animation: parpadeo 4.5s infinite; }
.personaje.bruno .ojo { animation-delay: 1.3s; }
.personaje .oreja { transform-box: fill-box; transform-origin: 50% 100%; }
.personaje .oreja-izq { animation: oreja 5s ease-in-out infinite; }
.personaje .oreja-der { animation: oreja 5s ease-in-out 2.5s infinite; }
.personaje .oreja-perro { transform-box: fill-box; transform-origin: 50% 10%; animation: orejaPerro 2.4s ease-in-out infinite; }
.personaje .oreja-perro.oreja-der { animation-delay: .3s; }
.personaje .cola { transform-box: view-box; transform-origin: 84px 106px; animation: cola 1.4s ease-in-out infinite alternate; }
.personaje.bruno .cola { animation-duration: .35s; }
.personaje.roma .cola { animation-duration: 3s; }
.personaje .boca, .personaje .lengua { transform-box: fill-box; transform-origin: center top; }
.personaje.hablando .boca { animation: hablar .22s ease-in-out infinite alternate; }
.personaje.bruno .lengua { animation: jadeo .5s ease-in-out infinite alternate; }
.personaje.bruno.hablando .lengua { animation-duration: .2s; }
.personaje .corona { transform-box: fill-box; transform-origin: center bottom; animation: corona 3.2s ease-in-out infinite; }
/* Roma duerme con los ojitos cerrados hasta que le hablan */
.personaje.roma .ojos-abiertos { display: none; }
.personaje.roma.hablando .ojos-abiertos, .personaje.roma.salto .ojos-abiertos { display: inline; }
.personaje.roma.hablando .ojos-cerrados, .personaje.roma.salto .ojos-cerrados { display: none; }
.personaje.roma .zzz text { animation: zzz 2.6s ease-in-out infinite; }
.personaje.roma .zzz text + text { animation-delay: 1.3s; }
.personaje.roma.hablando .zzz { display: none; }
@keyframes flotarGato { 50% { transform: translateY(-6px); } }
@keyframes hablandoCuerpo { to { transform: translateY(-4px) rotate(-2deg); } }
@keyframes saltoGato { 40% { transform: translateY(-28px) rotate(-6deg); } 70% { transform: translateY(0) scale(1.08, .92); } }
@keyframes parpadeo { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes oreja { 0%, 85%, 100% { transform: rotate(0); } 90% { transform: rotate(-12deg); } 95% { transform: rotate(6deg); } }
@keyframes orejaPerro { 50% { transform: rotate(6deg); } }
@keyframes cola { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
@keyframes hablar { to { transform: scaleY(1.9); } }
@keyframes jadeo { to { transform: scaleY(1.2); } }
@keyframes corona { 50% { transform: rotate(-4deg) translateY(-1px); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(4px, -8px); } }
.burbuja {
  position: relative; max-width: min(300px, calc(100vw - 32px)); margin-bottom: 4px; padding: .9rem 1.1rem .9rem;
  background: #fff; border-radius: 20px 20px 6px 20px; box-shadow: 0 12px 30px -10px rgba(140, 74, 98, .35);
  border: 2px solid var(--rosa); font-size: .95rem; line-height: 1.45;
}
.burbuja[data-quien="roma"] { border-color: var(--lavanda); }
.burbuja[data-quien="bruno"] { border-color: #F6D88A; }
.burbuja b { display: block; font-family: var(--mano); color: var(--vino); font-size: 1.15rem; font-weight: 500; }
.burbuja p { margin: .15rem 0 0; color: var(--tinta); }
.burbuja-cerrar { position: absolute; top: .2rem; right: .45rem; border: none; background: none; color: var(--suave); font-size: 1.2rem; cursor: pointer; }
.burbuja.entra { animation: burbujaEntra .35s cubic-bezier(.3, 1.5, .5, 1); transform-origin: bottom right; }
.burbuja.sale { animation: burbujaSale .3s ease-in forwards; transform-origin: bottom right; }
@keyframes burbujaEntra { from { transform: scale(.4); opacity: 0; } }
@keyframes burbujaSale { to { transform: scale(.4); opacity: 0; } }
/* En el celular solo se ve quien está hablando, para no tapar la página */
@media (max-width: 520px) {
  .personaje, .personaje.hiro { width: 70px; height: 76px; }
  .personaje:not(.activo) { display: none; }
  body:has(#lector:not([hidden])) #asistente { bottom: 70px; }
}

/* ---------- Animaciones tiernas por todo el sitio ---------- */
.flotante { position: absolute; bottom: -30px; opacity: .55; animation: subir linear infinite; }
@keyframes subir {
  0% { transform: translate(0, 0) rotate(0); }
  50% { transform: translate(24px, -55vh) rotate(20deg); }
  100% { transform: translate(-10px, -112vh) rotate(-10deg); }
}
.chispa { position: fixed; z-index: 200; pointer-events: none; font-size: 15px; transform: translate(-50%, -50%); animation: chispa .9s ease-out forwards; }
@keyframes chispa { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3); opacity: 0; } }
.aparece { animation: aparecerSuave .6s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes aparecerSuave { from { opacity: 0; transform: translateY(18px) scale(.96); } }

.hero h1 {
  background: linear-gradient(90deg, var(--vino), #C77D9B, #9A86C9, var(--vino)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: brilloTexto 8s linear infinite;
}
@keyframes brilloTexto { to { background-position: 300% 0; } }
#c-seg.tic { animation: tic .35s ease-out; }
@keyframes tic { from { transform: translateY(-6px) scale(1.15); color: #C77D9B; } }
.orquidea svg, .tapa-orquidea svg { transform-origin: 50% 90%; animation: balanceo 4.5s ease-in-out infinite; }
@keyframes balanceo { 50% { transform: rotate(-6deg); } }
.acceso:hover span { display: inline-block; animation: rebote .6s; }
@keyframes rebote { 40% { transform: translateY(-8px) scale(1.15); } 70% { transform: translateY(0) scale(.95); } }
.hito-icono { animation: latidoSuave 3s ease-in-out infinite; }
@keyframes latidoSuave { 50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(246, 201, 212, .35); } }
.tarjeta:not(.volteada) { animation: insinuar 7s ease-in-out infinite; }
.tarjeta:nth-child(2):not(.volteada) { animation-delay: 1.5s; }
.tarjeta:nth-child(3):not(.volteada) { animation-delay: 3s; }
.tarjeta:nth-child(4):not(.volteada) { animation-delay: 4.5s; }
@keyframes insinuar { 0%, 88%, 100% { transform: rotateY(0); } 93% { transform: rotateY(18deg); } }

/* Sobres: el sello late, al abrir salta y la solapa se dobla */
.sobre .sello { animation: latidoSello 2.6s ease-in-out infinite; }
@keyframes latidoSello { 50% { transform: translate(-50%, -50%) scale(1.08); } }
.sobre.abriendo { transform: translateY(-8px) scale(1.04); box-shadow: 0 0 0 6px rgba(246, 201, 212, .5), var(--sombra); }
.sobre.abriendo .sobre-solapa { transform: scaleY(.12); transition-duration: .45s; }
.sobre.abriendo .sello { animation: saltaSello .5s ease-in forwards; }
@keyframes saltaSello { 40% { transform: translate(-50%, -80%) scale(1.3); } 100% { transform: translate(-50%, -160%) scale(.6); opacity: 0; } }
.sobre.cerrado { cursor: pointer; }
.sobre.cerrado .sello { animation: none; }
.sobre.temblor { animation: temblor .4s; }
.final .sello { animation: latidoSuave 2.6s ease-in-out infinite; }

/* Proyecto Princesa: panel pastel con cielo animado */
#princesita-vista {
  margin-top: 1.25rem; padding: 0 16px 3rem; border-radius: 28px; overflow: hidden;
  background: linear-gradient(125deg, #E6DDF3, #F8E1E7, #DCEBF7, #DDF0E6, #E6DDF3); background-size: 400% 400%;
  animation: aparecer .5s ease, cieloPastel 24s ease-in-out infinite;
}
@keyframes cieloPastel { 50% { background-position: 100% 50%; } }
#ambiente-proyecto { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.estrella { position: absolute; font-size: 12px; animation: titilar 3.5s ease-in-out infinite; }
@keyframes titilar { 50% { opacity: .2; transform: scale(.6) rotate(45deg); } }
.orquidea-flota { position: absolute; bottom: -80px; width: 46px; opacity: .8; animation: subir linear infinite; }
.orquidea-flota svg { width: 100%; height: auto; display: block; }
.frutos li.visto { animation: brilloFruto 3s ease-in-out infinite; }
@keyframes brilloFruto { 50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .7), 0 0 16px rgba(199, 125, 155, .35); } }
#princesita-vista .autor { background: rgba(255, 253, 248, .85); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #petalos { display: none; }
}

/* ============================================================
   Repaso de diseño: fondo, cabecera, inicio, botones y títulos
   ============================================================ */
body {
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(244, 217, 216, .55), transparent 60%),
    radial-gradient(800px 600px at 100% 10%, rgba(230, 221, 243, .55), transparent 60%),
    radial-gradient(900px 700px at 50% 100%, rgba(220, 235, 247, .45), transparent 60%),
    var(--crema);
  background-attachment: fixed;
}
.cabecera { background: rgba(255, 253, 248, .72); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 6px 24px -18px rgba(90, 31, 41, .5); }
.marca { font-weight: 600; letter-spacing: .01em; }
.marca::before { content: '♡ '; color: var(--dorado); }
#nav a.activo { background: linear-gradient(135deg, var(--rosa), var(--lavanda)); color: var(--vino-oscuro); font-weight: 500; box-shadow: 0 4px 12px -8px rgba(140, 74, 98, .6); }
.btn { background: linear-gradient(135deg, var(--vino), #A85C7A); box-shadow: 0 8px 18px -10px rgba(140, 74, 98, .7); }
.btn:hover { background: linear-gradient(135deg, var(--vino-oscuro), var(--vino)); transform: translateY(-2px); box-shadow: 0 12px 22px -10px rgba(140, 74, 98, .75); }
.btn.btn-sec { background: linear-gradient(135deg, var(--lavanda), var(--rosa)); color: var(--vino-oscuro); box-shadow: 0 6px 14px -10px rgba(140, 74, 98, .5); }
.btn.btn-sec:hover { background: linear-gradient(135deg, var(--rosa), var(--lavanda)); }
.btn.btn-video { background: linear-gradient(135deg, #E07A9B, #9B6BB5); color: #fff; }
.btn.btn-video.pendiente { animation: pendiente 1.6s ease-in-out infinite; }
@keyframes pendiente { 50% { box-shadow: 0 0 0 6px rgba(224, 122, 155, .25), 0 8px 18px -10px rgba(140, 74, 98, .7); } }
.titulo-vista h2, .hero h1 { background: linear-gradient(120deg, var(--vino-oscuro), #B05F80 55%, var(--dorado)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.titulo-vista::after { content: '✦ ♡ ✦'; display: block; margin-top: 1rem; color: var(--dorado); letter-spacing: .6em; font-size: .8rem; opacity: .8; }

/* Tarjetas del inicio: cada una con su color pastel */
.accesos { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; }
.acceso { position: relative; overflow: hidden; border: none; border-radius: 22px; padding: 1.5rem 1.4rem 1.3rem; background: linear-gradient(150deg, #fff, var(--t, var(--rosa))); box-shadow: 0 10px 26px -18px rgba(90, 31, 41, .5); }
.acceso:nth-child(1) { --t: var(--durazno); } .acceso:nth-child(2) { --t: var(--rosa); } .acceso:nth-child(3) { --t: var(--lavanda); }
.acceso:nth-child(4) { --t: var(--cielo); } .acceso:nth-child(5) { --t: var(--menta); } .acceso:nth-child(6) { --t: #F7E6C4; }
.acceso span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: rgba(255, 255, 255, .8); font-size: 1.7rem; margin-bottom: .6rem; box-shadow: 0 6px 14px -10px rgba(90, 31, 41, .6); transition: transform .3s; }
.acceso::after { content: ''; position: absolute; inset: -40% auto auto -60%; width: 60%; height: 180%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); transform: rotate(20deg) translateX(-150%); transition: transform .8s; }
.acceso:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 0 18px 32px -18px rgba(90, 31, 41, .55); }
.acceso:hover span { transform: scale(1.12) rotate(-6deg); }
.acceso:hover::after { transform: rotate(20deg) translateX(420%); }
.contador div { background: rgba(255, 255, 255, .6); border-radius: 18px; padding: .6rem 1rem .5rem; min-width: 84px; box-shadow: 0 8px 20px -16px rgba(90, 31, 41, .6); backdrop-filter: blur(4px); }

/* Versículo del día (inicio) */
.verso-dia { display: flex; gap: 1rem; align-items: center; max-width: 640px; margin: 2rem auto 0; padding: 1.2rem 1.4rem; text-align: left; border-radius: 22px; background: linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(230, 221, 243, .7)); box-shadow: 0 14px 34px -22px rgba(90, 31, 41, .6); }
.verso-dia-quien { flex: none; width: 84px; height: 92px; }
.verso-dia-quien svg { width: 100%; height: 100%; }
.verso-dia blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.2rem; line-height: 1.45; color: var(--tinta); }
.verso-dia cite { display: block; margin-top: .3rem; font-style: normal; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dorado); }
.verso-dia .eyebrow { margin-bottom: .2rem; }
.verso-dia-acciones { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .7rem; }
.verso-dia-acciones .btn { padding: .5rem 1rem; font-size: .85rem; }
@media (max-width: 520px) { .verso-dia { flex-direction: column; text-align: center; } .verso-dia-acciones { justify-content: center; } }

/* ============================================================
   Mascotas: menú, ánimos, versículos y chat
   ============================================================ */
.burbuja { max-width: min(340px, calc(100vw - 24px)); }
.burbuja-extra:empty { display: none; }
.burbuja-extra { margin-top: .6rem; }
.burbuja-menu, .burbuja-animos { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.burbuja-menu button, .burbuja-animos button { border: 1px solid var(--linea); background: var(--crema); color: var(--vino-oscuro); border-radius: 999px; padding: .3rem .7rem; font-size: .8rem; cursor: pointer; transition: .2s; }
.burbuja-menu button:hover, .burbuja-animos button:hover { background: var(--rosa); transform: translateY(-1px); }
.burbuja-animos { max-height: 150px; overflow-y: auto; }
.burbuja-verso { margin: .3rem 0 .2rem; padding: .6rem .8rem; border-left: 3px solid var(--dorado); background: linear-gradient(135deg, #FFFBF2, #F7F0FB); border-radius: 0 12px 12px 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; line-height: 1.4; color: var(--tinta); }
.burbuja-verso cite { display: block; margin-top: .25rem; font-family: var(--sans); font-style: normal; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dorado); }
.burbuja-chat { display: flex; gap: .3rem; margin-top: .5rem; }
.burbuja-chat input { margin: 0; padding: .45rem .7rem; border-radius: 999px; font-size: .88rem; }
.burbuja-chat button { flex: none; width: 36px; height: 36px; border: none; border-radius: 50%; background: var(--vino); color: #fff; cursor: pointer; }
.burbuja-ia { display: block; margin-top: .3rem; font-size: .7rem; color: var(--suave); }
.burbuja-pensando { margin: .2rem 0 0; color: var(--suave); font-size: .85rem; animation: titilarTexto 1.2s ease-in-out infinite; }
@keyframes titilarTexto { 50% { opacity: .35; } }
body.viendo-video #asistente { display: none; }

/* ============================================================
   Video del libro
   ============================================================ */
body.viendo-video { overflow: hidden; }
.video { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #1E1622; color: #fff; }
.video-escenario { position: relative; overflow: hidden; cursor: pointer; }
.video-fondo { position: absolute; inset: 0; transition: background 1.2s; }
.video-corazones i { position: absolute; bottom: -30px; font-style: normal; color: rgba(255, 255, 255, .75); font-size: 18px; animation: subirVideo linear infinite; text-shadow: 0 0 8px rgba(224, 122, 155, .6); }
@keyframes subirVideo { to { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }
.video-capas { position: absolute; inset: 0; }
.video-capa { position: absolute; inset: 0; display: grid; place-items: center; padding: 3vh 0 15vh; }
.video-capa.entra { animation: capaEntra 1.1s ease both; }
.video-capa.sale { animation: capaSale 1.1s ease both; }
@keyframes capaEntra { from { opacity: 0; transform: scale(.96); filter: blur(6px); } }
@keyframes capaSale { to { opacity: 0; transform: scale(1.04); filter: blur(6px); } }
.video-pagina { height: 100%; aspect-ratio: 3 / 4; max-width: 92vw; animation: kenBurns var(--dur, 8s) ease-in-out both; filter: drop-shadow(0 30px 40px rgba(60, 30, 40, .35)); }
.video.pausado .video-pagina, .video.pausado .video-corazones i { animation-play-state: paused; }
@keyframes kenBurns { from { transform: scale(1) translateY(6px); } to { transform: scale(1.06) translateY(-6px); } }
.video .libro.video-libro { width: 100%; height: 100%; display: block; color: var(--tinta); }
.video .libro.video-libro .hoja { width: 100%; height: 100%; border-radius: 14px; overflow: hidden; }
.video .hoja-botones, .video .btn-editar, .video .btn-borrar { display: none !important; }
.video-titulo { text-align: center; color: var(--vino-oscuro); max-width: 80vw; }
.video-titulo h2 { font-size: clamp(2.4rem, 7vw, 5rem); background: linear-gradient(120deg, var(--vino-oscuro), #B05F80 55%, var(--dorado)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.video-titulo p { font-family: var(--mano); font-size: clamp(1.4rem, 3vw, 2.2rem); color: var(--vino); margin: .6rem 0 0; }
.video-titulo .trenza { animation: capaEntra 2s ease both; }
.video-sub { position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%); width: min(820px, 92vw); display: flex; gap: .9rem; align-items: center; padding: .8rem 1.1rem; border-radius: 20px; background: rgba(255, 253, 248, .92); color: var(--tinta); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .55); }
.video-sub.entra { animation: subEntra .6s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes subEntra { from { opacity: 0; transform: translate(-50%, 20px); } }
.video-quien { flex: none; width: 64px; height: 70px; display: grid; place-items: center; font-size: 2rem; }
.video-quien svg { width: 100%; height: 100%; }
.video-sub b { display: block; font-family: var(--mano); font-size: 1.2rem; color: var(--vino); font-weight: 500; }
.video-sub p { margin: 0; font-family: var(--serif); font-size: clamp(1rem, 1.8vw, 1.3rem); line-height: 1.35; max-height: 4.2em; overflow-y: auto; }
.video-marca { position: absolute; top: 2vh; right: 2vw; font-family: var(--mano); color: var(--vino); opacity: .7; font-size: 1.2rem; }
.video-controles { display: flex; align-items: center; gap: .35rem; padding: .5rem 1rem; background: #1E1622; }
.video-controles > button { border: none; background: rgba(255, 255, 255, .1); color: #fff; border-radius: 10px; min-width: 38px; height: 36px; padding: 0 .6rem; cursor: pointer; font-size: .9rem; }
.video-controles > button:hover { background: rgba(255, 255, 255, .22); }
.video-tocar { background: linear-gradient(135deg, #E07A9B, #9B6BB5) !important; min-width: 46px !important; }
.video-progreso { flex: 1; display: flex; gap: 3px; min-width: 60px; }
.video-progreso button { flex: 1; height: 14px; padding: 4px 0; border: none; background: none; cursor: pointer; }
.video-progreso i { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.video-progreso .hecha i { background: #E07A9B; }
.video-progreso .actual i { background: linear-gradient(90deg, #E07A9B, #F7DC94); }
.video-cuenta { font-size: .8rem; opacity: .7; min-width: 44px; text-align: center; }
.video.grabando .video-controles { display: none; }
.video.grabando .video-escenario { cursor: none; }
@media (max-width: 640px) {
  .video-controles { flex-wrap: wrap; justify-content: center; }
  .video-progreso { flex-basis: 100%; order: -1; }
  .video-quien { width: 46px; height: 50px; }
}

/* ============================================================
   Mascotas por turnos, con trajes, accesorios y cohete
   ============================================================ */
/* Después del saludo se turnan: solo se ve el que está de turno */
#asistente.turno .personaje:not(.activo) { display: none; }
#asistente.turno .personaje.activo { width: 112px; height: 122px; }
.personaje.entra { animation: personajeEntra .8s cubic-bezier(.3, 1.45, .5, 1) both !important; }
.personaje.en-cohete { margin-bottom: 26px; animation: cohetear 1.6s ease-in-out infinite; }
.personaje.en-cohete.entra { animation: personajeCohete 2s cubic-bezier(.22, .8, .3, 1) both !important; }
.personaje .llama { transform-box: fill-box; transform-origin: right center; animation: llama .14s ease-in-out infinite alternate; }
@keyframes personajeEntra { 0% { transform: translateY(130%) scale(.5); opacity: 0; } 60% { opacity: 1; } }
@keyframes personajeCohete {
  0% { transform: translate(115vw, -45vh) rotate(-14deg); }
  55% { transform: translate(-30px, -20px) rotate(-4deg); }
  80% { transform: translate(8px, 4px) rotate(3deg); }
  100% { transform: none; }
}
@keyframes cohetear { 50% { transform: translateY(-9px) rotate(-2deg); } }
@keyframes llama { to { transform: scaleX(1.45); opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .personaje.entra, .personaje.en-cohete { animation: none !important; } }

/* ============================================================
   Usuarios: cuenta, permisos y avisos
   ============================================================ */
.boton-cuenta { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .3rem .8rem .3rem .35rem !important; background: linear-gradient(135deg, var(--rosa), var(--lavanda)) !important; color: var(--vino-oscuro) !important; font-weight: 500; }
.cuenta-avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; font-size: .95rem; }
body[data-usuario="el"] .cuenta-avatar::after { content: ''; }
.cuenta-pie { display: flex; justify-content: flex-end; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--linea); }
.campo-permiso { border: 1px solid var(--linea); border-radius: 12px; padding: .7rem .9rem; background: rgba(230, 221, 243, .25); }
.campo-permiso legend { font-size: .82rem; color: var(--vino); padding: 0 .3rem; }
.campo-permiso .ayuda { text-align: left; margin: .4rem 0; }
.quien-creo { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .3rem 0 .6rem; font-size: .78rem; color: var(--suave); }
.quien-creo .btn-texto { padding: .1rem .4rem; font-size: .78rem; color: var(--vino); text-decoration: underline; }
#lector > .quien-creo { justify-content: center; }
#aviso-flotante { position: fixed; left: 50%; top: 76px; z-index: 400; max-width: min(520px, calc(100vw - 32px)); padding: .8rem 1.1rem; border-radius: 16px; background: #fff; color: var(--tinta); box-shadow: 0 16px 40px -18px rgba(60, 30, 40, .55); border: 2px solid var(--rosa); font-size: .92rem; opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: .35s; }
#aviso-flotante.ver { opacity: 1; transform: translate(-50%, 0); }
.dialogo-credenciales { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px; background: rgba(59, 42, 46, .5); backdrop-filter: blur(3px); }
.dialogo-credenciales form { width: min(380px, 100%); padding: 1.4rem; border-radius: 20px; background: var(--papel); box-shadow: var(--sombra); }
.dialogo-credenciales p { margin: 0; color: var(--tinta); }
#form-login #olvide { margin-top: -.3rem; font-size: .85rem; }

/* ---------- Sobre ella / Sobre él: quién la escribe y su editor ---------- */
.acceso:nth-child(7) { --t: #E3E9F7; }
.perfil-escribe { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; margin: .4rem 0 1.4rem; color: var(--suave); font-size: .85rem; text-align: center; }
.perfil-form fieldset { border: 1px solid var(--linea); border-radius: 14px; padding: .6rem .8rem; margin: .8rem 0; }
.perfil-fila { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .45rem; }
.perfil-fila input { flex: 1 1 120px; min-width: 0; }
.perfil-fila .perfil-icono { flex: 0 0 3.2rem; text-align: center; }
.perfil-fila select { flex: 0 0 auto; }
.perfil-fila .btn-borrar { margin: 0; }
.perfil-fotos { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.perfil-fotos figure { position: relative; margin: 0; }
.perfil-fotos img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; display: block; }
.perfil-fotos button { position: absolute; top: 3px; right: 3px; border: none; border-radius: 999px; background: rgba(255, 255, 255, .9); cursor: pointer; font-size: .75rem; padding: .1rem .4rem; }

/* =================== Pulido final (2026-10-19) =================== */
/* Nada se sale de la pantalla (pétalos, adornos) */
html, body { overflow-x: clip; }
::selection { background: rgba(232, 180, 200, .55); color: var(--vino-oscuro); }
html { scrollbar-color: rgba(140, 74, 98, .35) transparent; }
:focus-visible { outline: 2px solid var(--dorado); outline-offset: 3px; border-radius: 10px; }
/* El pie siempre abajo, aunque la sección tenga poco */
#app:not([hidden]) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
#app > main { flex: 1; }
/* La galería en columnas: el aviso de vacía ocupa todo el ancho */
.galeria > .vacio, .galeria > .cargando { column-span: all; }
.vacio { display: block; padding: 2.5rem 1rem; border: 2px dashed rgba(140, 74, 98, .18); border-radius: 22px; background: rgba(255, 255, 255, .45); }
/* Íconos de la cabecera */
.cabecera .icono-cab { font-size: 1.05rem; }
#salir { display: inline-flex; align-items: center; gap: .3rem; }
/* Transición suave entre secciones */
.vista:not([hidden]) { animation: aparecer .55s cubic-bezier(.2, .7, .2, 1); }
/* Tarjetas con un brillo leve al pasar el mouse */
.favorito, .tarjeta, .sobre, .grupo, .momento { transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }
@media (hover: hover) {
  .favorito:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -20px rgba(90, 31, 41, .55); }
}

@media (max-width: 760px) {
  /* Cabecera en celular: una sola línea arriba, menú deslizable abajo */
  .cabecera { padding: .55rem 12px .35rem; row-gap: .3rem; }
  .cabecera .txt-pc { display: none; }
  .cabecera #abrir-busqueda, .cabecera #salir { padding: .35rem .45rem; }
  .boton-cuenta { padding: .25rem .65rem .25rem .3rem !important; font-size: .88rem; }
  #nav { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent); padding: 0 12px; scroll-padding: 0 40px; }
  #nav a { padding: .35rem .75rem; }
}
@media (max-width: 520px) {
  /* Contador: los cuatro cuadritos caben siempre */
  .contador { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; width: 100%; }
  .contador div { min-width: 0; padding: .55rem .2rem .45rem; border-radius: 16px; }
  .contador b { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .contador span { font-size: .6rem; letter-spacing: .06em; }
  .titulo-vista h2 { font-size: clamp(2rem, 9vw, 2.6rem); }
  /* Los globos de las mascotas no tapan tanto en el celular */
  .burbuja { max-width: min(78vw, 300px); font-size: .88rem; }
}
