:root {
  --fondo: #F7F1E8; --tarjeta: #FFFFFF; --texto: #3B2A1E; --suave: #75604F;
  --acento: #7A4E2D; --sobre-acento: #FFF8EF; --linea: #E3D5C3; --error: #A3341F;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
:root[data-tema="noche"] {
  --fondo: #241A14; --tarjeta: #33261D; --texto: #F3E9DC; --suave: #B39C86;
  --acento: #D4A373; --sobre-acento: #241A14; --linea: #45352A; --error: #F08A6E;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--fondo); color: var(--texto);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
main {
  max-width: 480px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 96px);
}
h1 { font: 600 28px/1.2 var(--serif); margin: 8px 0 12px; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); margin: 28px 4px 8px; }
h1:focus { outline: none; }
p { margin: 0 0 12px; }
.suave { color: var(--suave); }
.ayuda { font-size: 14px; color: var(--suave); margin: -4px 4px 14px; }
.error { color: var(--error); font-size: 15px; min-height: 1.5em; margin: 4px 4px 8px; }
.error:empty { min-height: 0; margin: 0; }

.pantalla { display: flex; flex-direction: column; min-height: calc(100dvh - 140px); }
.centro { align-items: center; justify-content: center; text-align: center; }
/* El logo es una máscara: toma el color de acento de cada tema. */
.logo { width: 112px; height: 112px; margin-bottom: 12px; background: var(--acento); -webkit-mask: url(/logo.png) center / contain no-repeat; mask: url(/logo.png) center / contain no-repeat; }
.marca { font-size: 40px; margin-bottom: 8px; }
.versiculo { font: italic 19px/1.45 var(--serif); color: var(--suave); max-width: 300px; }
.versiculo span { display: block; font: 14px/2 -apple-system, sans-serif; font-style: normal; letter-spacing: .04em; }
.acciones-pie { width: 100%; display: grid; gap: 12px; margin-top: 40px; }

.tarjeta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 16px; padding: 18px; margin: 0 0 16px; }
.etiqueta { font-size: 14px; color: var(--suave); margin: 0; }
.codigo { font: 600 42px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; margin: 6px 0; color: var(--acento); }

label { display: block; font-size: 15px; font-weight: 500; margin: 0 4px 14px; }
input:not([type="checkbox"]) {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  font: inherit; font-size: 17px; color: var(--texto); background: var(--tarjeta);
  border: 1px solid var(--linea); border-radius: 12px;
}
input:focus-visible, button:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
#form-pareja input { font: 600 28px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .3em; text-align: center; }

.boton {
  display: block; width: 100%; min-height: 50px; padding: 12px 18px; border: 0; border-radius: 14px;
  font: inherit; font-weight: 600; background: var(--acento); color: var(--sobre-acento); cursor: pointer;
}
.boton.secundario { background: transparent; color: var(--acento); border: 1.5px solid var(--acento); }
.boton:disabled { opacity: .6; }
.boton:active { transform: scale(.98); }
.enlace { background: none; border: 0; font: inherit; color: var(--suave); text-decoration: underline; padding: 12px; margin: 8px auto 0; display: block; cursor: pointer; }
.volver { background: none; border: 0; font-size: 36px; line-height: 1; color: var(--acento); padding: 0 12px 0 0; align-self: flex-start; min-height: 44px; cursor: pointer; }

.lista { padding: 4px 18px; }
.lista > div, .fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; margin: 0; }
.lista > div + div { border-top: 1px solid var(--linea); }
dt { color: var(--suave); }
dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.fila { font-weight: 400; font-size: 17px; }

.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 31px; background: var(--linea); position: relative; margin: 0; cursor: pointer; transition: background .2s; }
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0004; transition: transform .2s; }
.switch:checked { background: var(--acento); }
.switch:checked::before { transform: translateX(20px); }

#barra {
  position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: var(--tarjeta); border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom);
}
#barra button {
  flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; background: none; border: 0; font: 500 11px/1.2 inherit; color: var(--suave); cursor: pointer;
}
#barra svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#barra [aria-current="page"] { color: var(--acento); }

.aviso {
  position: sticky; top: 0; z-index: 2; margin: 0; padding: calc(env(safe-area-inset-top) + 6px) 12px 6px;
  text-align: center; font-size: 14px; background: var(--acento); color: var(--sobre-acento);
}

dialog { border: 0; border-radius: 18px; padding: 22px; width: min(340px, 90vw); background: var(--tarjeta); color: var(--texto); }
dialog::backdrop { background: #0007; }
dialog p { font-size: 18px; text-align: center; margin-bottom: 20px; }
.acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Instalar */
.enlace-fila { width: 100%; background: none; border: 0; padding: 0; color: var(--texto); cursor: pointer; }
.enlace-fila span { color: var(--suave); font-size: 22px; }

.segmentos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 8px 0 20px; background: var(--linea); border-radius: 12px; }
.segmentos button { min-height: 40px; border: 0; border-radius: 9px; background: none; font: inherit; font-weight: 600; color: var(--suave); cursor: pointer; }
.segmentos [aria-selected="true"] { background: var(--tarjeta); color: var(--texto); box-shadow: 0 1px 3px #0002; }

.pasos { list-style: none; padding: 0; margin: 12px 0 0; }
.pasos li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; min-height: 360px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 20px; padding: 22px 18px; animation: paso-entra .35s ease-out; }
.pasos li.desde-izq { animation-name: paso-entra-izq; }
.pasos strong { font: 600 21px/1.25 var(--serif); }
.pasos p { font-size: 16px; color: var(--suave); margin: 8px 0 0; }
.pasos .boton { margin-top: 14px; }
.dibujo { width: 168px; height: 210px; flex: none; overflow: visible; }
.dibujo-icono { border-radius: 22px; flex: none; margin: 30px 0 10px; }
.pasos-nav { margin-top: 14px; }
.puntos { display: flex; justify-content: center; gap: 8px; }
.puntos span { width: 8px; height: 8px; border-radius: 8px; background: var(--linea); transition: width .25s, background .25s; }
.puntos span.activo { width: 22px; background: var(--acento); }
#paso-de { margin: 8px 0 10px; }
.pasos-botones { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.pasos-botones .boton { margin: 0; }
.pasos-botones #paso-atras[hidden] + #paso-sig { grid-column: 1 / -1; }

/* Animaciones del tutorial: un dedo que toca, el menú que aparece y el ícono que llega a la pantalla. */
.dibujo .dedo { fill: color-mix(in srgb, var(--texto) 35%, transparent); stroke: #fff; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: 0; animation: tocar 2.6s ease-in-out infinite; }
.dibujo .dedo.tarde { animation-delay: .7s; }
.dibujo .resalte, .dibujo .resalte-fila, .dibujo .resalte-borde { animation: parpadear 1.6s ease-in-out infinite; }
.dibujo .sube { animation: subir .6s cubic-bezier(.2,.9,.3,1) both; }
.dibujo .baja { transform-box: fill-box; transform-origin: top right; animation: abrir-menu .45s cubic-bezier(.2,.9,.3,1) both; }
.aparecer { transform-box: fill-box; transform-origin: center; animation: llegar .8s .25s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes tocar {
  0% { opacity: 0; transform: translate(14px, 22px) scale(1); }
  30% { opacity: 1; transform: translate(0, 0) scale(1); }
  42% { transform: scale(.75); }
  54% { transform: scale(1); opacity: 1; }
  80%, 100% { opacity: 0; transform: scale(1.5); }
}
@keyframes parpadear { 50% { opacity: .45; } }
@keyframes subir { from { transform: translateY(70px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes abrir-menu { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes llegar { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes paso-entra { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes paso-entra-izq { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
.dibujo .cel { fill: var(--fondo); stroke: var(--texto); stroke-width: 2.5; }
.dibujo .pantallita { fill: var(--tarjeta); stroke: var(--linea); }
.dibujo .linea-gris, .dibujo .app-gris { fill: var(--linea); }
.dibujo .hoja { fill: var(--fondo); stroke: var(--linea); stroke-width: 1.5; }
.dibujo .resalte { fill: color-mix(in srgb, var(--acento) 22%, transparent); stroke: var(--acento); stroke-width: 2; }
.dibujo .resalte-fila { fill: color-mix(in srgb, var(--acento) 22%, transparent); stroke: var(--acento); stroke-width: 1.5; }
.dibujo .resalte-borde { fill: none; stroke: var(--acento); stroke-width: 2.5; }
.dibujo .trazo { fill: none; stroke: var(--acento); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dibujo .punto { fill: var(--texto); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .boton:active { transform: none; } }

/* ═══ App principal ═══ */
:root { --letra-lectura: 18px; --alto-lectura: 1.7; --lectura: var(--serif); }
:root.fuente-moderna { --lectura: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.chico { font-size: 14px; }
.grande { font: 600 40px/1.1 var(--serif); margin: 4px 0 10px; color: var(--acento); }
.centro-texto { text-align: center; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.etiqueta-form { font-size: 15px; font-weight: 500; margin: 0 4px 8px; }
textarea, select, input.hora {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; font-size: 17px;
  color: var(--texto); background: var(--fondo); border: 1px solid var(--linea); border-radius: 12px; resize: vertical;
}
select { width: auto; max-width: 60%; margin: 0; padding: 8px 10px; background: var(--tarjeta); }
input.hora { width: auto; margin: 0; padding: 8px 10px; }
textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
button.tarjeta { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tocable:active { transform: scale(.99); }
.progreso { height: 8px; border-radius: 8px; background: var(--linea); overflow: hidden; margin: 8px 0; }
.progreso span { display: block; height: 100%; min-width: 2px; background: var(--acento); border-radius: 8px; transition: width .4s; }
.chip { min-height: 36px; padding: 6px 14px; border-radius: 18px; border: 1px solid var(--linea); background: var(--tarjeta); color: var(--texto); font: inherit; font-size: 15px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); }
.fila-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }

/* Inicio */
.racha { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.fuego { font-size: 44px; line-height: 1; transition: filter .4s; }
.racha.apagada .fuego { filter: grayscale(1) opacity(.45); }
.fuego { transform-origin: 50% 90%; }
.racha:not(.apagada) .fuego { animation: llama 2.4s ease-in-out infinite; }
.racha.encendida .racha-num { animation: pop .5s .3s cubic-bezier(.3,1.6,.5,1) both; }
.racha-num { font: 600 30px/1.1 var(--serif); margin: 0; }
.racha p.suave { margin: 0; font-size: 15px; }
.racha-datos { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--linea); }
.racha-datos div { display: flex; flex-direction: column; }
.racha-datos dt { font-size: 13px; }
.racha-datos dd { text-align: left; font-weight: 600; font-size: 18px; }
.alerta { border-color: var(--error); }
.hoy .titulo-hoy, .titulo-hoy { font: 600 22px/1.25 var(--serif); margin: 6px 0 4px; }
.hoy.hecha { border-color: var(--acento); }
.pareja-estado { margin: 12px 0 0; text-align: center; }
.pregunta-mini { font: italic 17px/1.4 var(--serif); margin: 6px 0; }
.logros-mini { font-size: 28px; letter-spacing: .1em; margin: 6px 0; }
.numeros { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 8px; }
.numeros strong { display: block; font: 600 26px/1.1 var(--serif); color: var(--acento); }
.numeros span { font-size: 13px; color: var(--suave); }

/* Lectura */
#hoja { min-height: 100dvh; }
.hoja-barra { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; margin: calc(-1 * env(safe-area-inset-top) - 24px) -20px 8px; padding: calc(env(safe-area-inset-top) + 6px) 12px 6px; background: color-mix(in srgb, var(--fondo) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--linea); }
.hoja-barra .volver { padding: 0 8px; }
#hoja-titulo { flex: 1; font-weight: 600; color: var(--suave); outline: none; }
#hoja-acciones { display: flex; gap: 8px; }
.lectura h1 { font-size: 30px; }
.ref-pasaje { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--acento); margin: 0 0 12px; }
.pasaje, .ensenanza p, .recuadro p, .muestra-lectura { font-family: var(--lectura); font-size: var(--letra-lectura); line-height: var(--alto-lectura); }
.pasaje { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 16px; padding: 18px 18px 6px; margin-bottom: 24px; }
.pasaje p { margin: 0 0 12px; }
.pasaje .bloque-q { padding-left: 1.2em; margin-bottom: 2px; }
.pasaje .bloque-d { font-style: italic; color: var(--suave); }
.subtitulo { font: 600 16px/1.3 -apple-system, sans-serif; color: var(--suave); margin: 14px 0 8px; }
.num { font: 600 .62em/1 -apple-system, sans-serif; color: var(--acento); margin: 0 .25em 0 .1em; vertical-align: .55em; }
.sin-numeros .num { display: none; }
.vs { cursor: pointer; border-radius: 3px; transition: background .15s; }
.vs.elegido { background: color-mix(in srgb, var(--acento) 22%, transparent); text-decoration: underline dotted var(--acento); }
.vs.sc { font-variant: small-caps; }
.vs.it { font-style: italic; }
.ensenanza p { margin: 0 0 16px; }
.cita { font-style: italic; }
.cita-ref { font: 600 .78em/1 -apple-system, sans-serif; color: var(--acento); font-style: normal; white-space: nowrap; }
.recuadro { background: color-mix(in srgb, var(--acento) 9%, var(--tarjeta)); border-left: 4px solid var(--acento); border-radius: 12px; padding: 14px 16px 4px; margin: 20px 0; }
.recuadro h3 { margin: 0 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--acento); }
.recuadro.juntos { border-left-style: double; border-left-width: 6px; }
.cierre { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--linea); }
.animos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 10px; }
.animos button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 76px; padding: 8px 2px; border: 1.5px solid var(--linea); border-radius: 14px; background: var(--tarjeta); color: var(--texto); font: inherit; font-size: 12px; line-height: 1.15; cursor: pointer; }
.animos .icono-animo { width: 30px; height: 30px; color: var(--acento); }
.icono-animo { width: 1.3em; height: 1.3em; vertical-align: -0.3em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.animos [aria-checked="true"] { border-color: var(--acento); background: color-mix(in srgb, var(--acento) 14%, var(--tarjeta)); font-weight: 600; }
.texto-propio { white-space: pre-wrap; font-family: var(--lectura); }
.barra-seleccion { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 16px); display: flex; align-items: center; gap: 4px; padding: 6px; max-width: calc(100vw - 24px); background: var(--texto); color: var(--fondo); border-radius: 16px; box-shadow: 0 6px 24px #0005; }
.barra-seleccion button { background: none; border: 0; color: inherit; font: inherit; font-size: 15px; font-weight: 600; padding: 10px 10px; min-height: 44px; cursor: pointer; }
.sel-ref { font-size: 13px; padding: 0 6px; opacity: .8; white-space: nowrap; }
.festejo { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; background: #0006; animation: aparecer .25s; }
.festejo-caja { background: var(--tarjeta); border-radius: 22px; padding: 28px 26px 16px; text-align: center; width: min(320px, 86vw); }
.festejo-fuego { font-size: 64px; animation: latir .9s ease-in-out infinite alternate; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes latir { to { transform: scale(1.15); } }
.toast { position: fixed; z-index: 10; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%); margin: 0; padding: 10px 18px; max-width: 88vw; border-radius: 14px; background: var(--texto); color: var(--fondo); font-size: 15px; text-align: center; box-shadow: 0 4px 16px #0004; transition: opacity .3s; }
.toast.fuera { opacity: 0; }

/* Devocionales: el camino */
.leyenda { display: flex; justify-content: flex-end; gap: 12px; margin: 0 6px 6px; }
.camino { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--linea); }
.camino-mes { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); margin: 18px 0 8px -10px; padding-left: 0; }
.camino-dia { position: relative; margin: 0 0 8px; }
.camino-dia::before { content: ""; position: absolute; left: -25px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--fondo); border: 2px solid var(--linea); }
.camino-dia.completo::before { background: var(--acento); border-color: var(--acento); }
.camino-boton { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 10px 14px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 14px; font: inherit; color: inherit; cursor: pointer; }
.camino-fecha { font-size: 13px; color: var(--suave); }
.camino-titulo { grid-column: 1; font-weight: 500; }
.camino-animos { grid-column: 2; grid-row: 1 / span 2; align-self: center; display: flex; gap: 10px; font-size: 20px; }
.camino-nota { grid-column: 1 / -1; font-size: 13px; color: var(--acento); }

/* Biblia */
.fila-progreso { display: grid; grid-template-columns: minmax(48px, auto) 1fr 52px; align-items: center; gap: 10px; font-size: 15px; }
.fila-progreso .progreso { margin: 6px 0; }
.fila-progreso span:last-child { text-align: right; color: var(--suave); font-size: 14px; }

/* Estantería: lomos de libros parados sobre tablas de madera. Vacíos (transparentes) hasta que se leen: el cuero sube desde abajo. */
.estante {
  --fila: 140px;
  display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 3px; row-gap: 22px; padding: 10px 10px 22px; margin-bottom: 8px;
  border-radius: 12px; background-color: color-mix(in srgb, var(--tarjeta) 70%, #000 30%);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--fila) + 10px), #6e4a2c calc(var(--fila) + 10px) calc(var(--fila) + 22px));
  box-shadow: inset 0 2px 10px #0006;
}
.libro-hueco { height: var(--fila); display: flex; align-items: flex-end; }
.libro {
  --tapa: #6b3f2a;
  position: relative; width: var(--ancho); height: var(--alto); padding: 0; border-radius: 3px 3px 1px 1px; cursor: pointer; overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--tapa) 45%, #f3e3c3 55%);
  background: linear-gradient(to right, #ffffff1a, #fff0 45%), color-mix(in srgb, var(--tapa) 22%, transparent);
  transition: transform .2s;
}
.libro:active { transform: translateY(-4px); }
.libro::before {
  content: ""; position: absolute; inset: 0; clip-path: inset(calc(100% - var(--leido)) 0 0 0);
  background:
    linear-gradient(to bottom, transparent 9%, #d9b26a 9% 11%, transparent 11% 13%, #d9b26a 13% 14%, transparent 14% 86%, #d9b26a 86% 87%, transparent 87% 89%, #d9b26a 89% 91%, transparent 91%),
    linear-gradient(to right, #0000004d, #ffffff1f 35%, #0000 60%, #00000059),
    var(--tapa);
}
.libro-nombre {
  position: absolute; inset: 16% 0; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap;
  font: 600 10.5px/1 var(--serif); letter-spacing: .03em; color: #f6ead2; text-shadow: 0 1px 1px #0008;
}
.libro.actual { outline: 2px solid #f3d99a; outline-offset: 1px; }
.libro.actual::after { content: ""; position: absolute; top: 0; right: 4px; width: 7px; height: 26px; background: #b23a3a; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); }
.estante .libro-hueco:nth-child(7n+2) .libro { --tapa: #4a5a3c; }
.estante .libro-hueco:nth-child(7n+3) .libro { --tapa: #7a2e2e; }
.estante .libro-hueco:nth-child(7n+4) .libro { --tapa: #3d4a5c; }
.estante .libro-hueco:nth-child(7n+5) .libro { --tapa: #8a6a3a; }
.estante .libro-hueco:nth-child(7n+6) .libro { --tapa: #5a3a4a; }
.estante .libro-hueco:nth-child(7n+7) .libro { --tapa: #2f4a48; }
.leyenda-estante { margin: 0 4px 16px; }
.capitulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.cap { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--linea); background: var(--tarjeta); color: var(--texto); font-size: 15px; }
.cap.medio { border-color: var(--acento); background: linear-gradient(to top, color-mix(in srgb, var(--acento) 30%, var(--tarjeta)) 50%, var(--tarjeta) 50%); }
.cap.lleno { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.favoritos { list-style: none; padding: 0; margin: 0; }
.fav-texto { font: italic var(--letra-lectura)/1.5 var(--lectura); margin-bottom: 6px; }
.fav-ref { font-size: 14px; font-weight: 600; color: var(--acento); margin-bottom: 4px; }

/* Preguntas */
.pregunta { font: 600 21px/1.35 var(--serif); margin: 6px 0 14px; }
.respuesta { border-top: 1px solid var(--linea); padding-top: 10px; margin-top: 10px; }
.quien { font-size: 13px; font-weight: 600; color: var(--acento); margin: 0 0 2px; }
.anterior summary { display: flex; flex-direction: column; gap: 2px; cursor: pointer; list-style: none; }
.anterior summary::-webkit-details-marker { display: none; }

/* Resumen y logros */
.resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dato { display: flex; flex-direction: column; margin: 0; padding: 14px; }
.dato-icono { font-size: 22px; }
.dato strong { font: 600 30px/1.15 var(--serif); color: var(--acento); }
.dato span:last-child { font-size: 13px; color: var(--suave); }
.versiculo-chico { font: italic 15px/1.5 var(--serif); color: var(--suave); text-align: center; margin: 20px 0; }
.logros { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.logro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin: 0; }
.logro-icono { font-size: 34px; }
.logro.bloqueado { opacity: .55; }

/* Ajustes */
.perfil { justify-content: flex-start !important; gap: 14px !important; padding: 12px 0; }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--acento); color: var(--sobre-acento); font: 600 22px/1 var(--serif); flex: none; }
.ajuste { padding: 10px 0; display: block !important; }
.ajuste-nombre { display: block; margin-bottom: 8px; }
.segmentos.chicos { margin: 0; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.segmentos.chicos button { min-height: 36px; font-size: 14px; }
.segmentos [aria-checked="true"] { background: var(--tarjeta); color: var(--texto); box-shadow: 0 1px 3px #0002; }
.muestra-lectura { margin: 4px 0 8px; padding: 10px 0; }
.lista > .fila-texto, .lista > p.fila-texto { padding: 12px 0; margin: 0; }
.lista > details + *, .lista > * + details, .lista > label + *, .lista > * + label, .lista > .ajuste + *, .lista > * + .ajuste, .lista > p + *, .lista > * + p, .lista > button + *, .lista > * + button { border-top: 1px solid var(--linea); }
.desplegable summary { list-style: none; cursor: pointer; }
.desplegable summary::-webkit-details-marker { display: none; }
.desplegable summary span { color: var(--suave); font-size: 22px; transition: transform .2s; }
.desplegable[open] summary span { transform: rotate(90deg); }
.desplegable form, .creditos { padding: 4px 0 12px; }
.creditos ul { font-size: 14px; color: var(--suave); padding-left: 18px; margin: 0 0 8px; }
@media (prefers-reduced-motion: reduce) {
  /* En el tutorial quedan animaciones quietas (aparecer y latir), sin movimientos que desplacen. */
  .dibujo .dedo { animation-name: tocar-quieto; }
  .dibujo .sube, .dibujo .baja { animation: none; }
}
@keyframes tocar-quieto { 0% { opacity: 0; } 30% { opacity: 1; transform: scale(1); } 42% { transform: scale(.75); } 54% { transform: scale(1); opacity: 1; } 80%, 100% { opacity: 0; } }
.cita-ref { background: none; border: 0; padding: 0 2px; font: 600 .8em/1 -apple-system, sans-serif; color: var(--acento); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.cita-dialogo { width: min(380px, 92vw); }
.cita-dialogo .cita-texto { font: italic 19px/1.55 var(--lectura); text-align: left; margin-bottom: 8px; }
.cita-dialogo .fav-ref { text-align: left; font-size: 14px; }
.barra-seleccion button { white-space: nowrap; }
.intro-libro { font-style: italic; color: var(--suave); margin: -4px 0 14px; }.ajuste select { width: 100%; max-width: none; }
.ajuste { font-weight: 400; margin: 0; }
.lista > div > span:last-child { white-space: nowrap; text-align: right; }

/* ═══ Animaciones ═══
   Las pantallas entran de a partes; las barras y los libros se llenan; la llama late.
   Con «reducir movimiento» las mismas animaciones quedan como fundidos, sin desplazamientos. */
.pantalla:not([hidden]) > *, .entrando > *, .entrando .camino-dia, .entrando .logro { animation: subir-suave .5s cubic-bezier(.2,.8,.2,1) both; }
.pantalla:not([hidden]) > :nth-child(2), .entrando > :nth-child(2), .entrando .camino-dia:nth-child(2), .entrando .logro:nth-child(2) { animation-delay: .06s; }
.pantalla:not([hidden]) > :nth-child(3), .entrando > :nth-child(3), .entrando .camino-dia:nth-child(3), .entrando .logro:nth-child(3) { animation-delay: .12s; }
.pantalla:not([hidden]) > :nth-child(4), .entrando > :nth-child(4), .entrando .camino-dia:nth-child(4), .entrando .logro:nth-child(4) { animation-delay: .18s; }
.pantalla:not([hidden]) > :nth-child(5), .entrando > :nth-child(5), .entrando .camino-dia:nth-child(5), .entrando .logro:nth-child(5) { animation-delay: .24s; }
.pantalla:not([hidden]) > :nth-child(6), .entrando > :nth-child(6), .entrando .camino-dia:nth-child(6), .entrando .logro:nth-child(6) { animation-delay: .3s; }
.pantalla:not([hidden]) > :nth-child(n+7), .entrando > :nth-child(n+7), .entrando .camino-dia:nth-child(n+7), .entrando .logro:nth-child(n+7) { animation-delay: .36s; }
#bienvenida:not([hidden]) .logo { animation: aparecer-logo .9s cubic-bezier(.3,1.4,.5,1) both; }
#hoja-contenido.entrando > * { animation-name: entrar-der; animation-duration: .4s; }
#cargando > * { animation: none; }
#cargando .logo { animation: respirar 1.8s ease-in-out infinite; }

#barra button { transition: color .2s; }
#barra [aria-current="page"] svg { animation: saltito .4s cubic-bezier(.3,1.6,.5,1); }
.boton, button.tarjeta, .chip, .camino-boton, .animos button, .cap { transition: transform .15s, background-color .2s, border-color .2s, color .2s; }
.camino-boton:active, .chip:active, .animos button:active { transform: scale(.96); }
.animos [aria-checked="true"] .icono-animo { animation: elegir .45s cubic-bezier(.3,1.6,.5,1); }
.progreso span { animation: llenar-barra 1s .15s cubic-bezier(.2,.8,.2,1) both; }
.libro::before { animation: llenar-libro 1.3s .25s cubic-bezier(.2,.8,.2,1) both; }
.libro.actual::after { animation: pop .5s 1.2s cubic-bezier(.3,1.6,.5,1) both; }
.cap.lleno, .cap.medio { animation: pop .35s cubic-bezier(.3,1.6,.5,1) both; }
.respuesta { animation: subir-suave .5s both; }
dialog[open] { animation: pop .25s cubic-bezier(.3,1.4,.5,1); }
dialog[open]::backdrop { animation: aparecer .25s; }
.toast { animation: subir-suave .3s cubic-bezier(.2,.8,.2,1); }
.barra-seleccion { animation: subir-centro .25s cubic-bezier(.2,.8,.2,1); }
.festejo-caja { position: relative; animation: pop .45s cubic-bezier(.3,1.5,.5,1) both; }
.chispa { position: absolute; left: 50%; top: 58px; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--acento); opacity: 0; animation: chispa 1.1s .15s cubic-bezier(.2,.8,.3,1) both; }
.chispa:nth-child(3n) { background: #e8c47a; width: 6px; height: 6px; }
.chispa:nth-child(3n+1) { border-radius: 2px; }

@keyframes subir-suave { from { opacity: 0; transform: translateY(14px); } }
@keyframes entrar-der { from { opacity: 0; transform: translateX(26px); } }
@keyframes subir-centro { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes pop { from { opacity: 0; transform: scale(.8); } }
@keyframes aparecer-logo { from { opacity: 0; transform: scale(.6) rotate(-30deg); } }
@keyframes respirar { 50% { transform: scale(.92); opacity: .6; } }
@keyframes saltito { 40% { transform: translateY(-5px) scale(1.12); } }
@keyframes elegir { 45% { transform: scale(1.3) rotate(-6deg); } }
@keyframes llenar-barra { from { width: 0; } }
@keyframes llenar-libro { from { clip-path: inset(100% 0 0 0); } }
@keyframes llama { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.1, 1.14) rotate(3deg); } }
@keyframes chispa {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d, 90px))) scale(.3); }
}
@media (prefers-reduced-motion: reduce) {
  @keyframes subir-suave { from { opacity: 0; } }
  @keyframes entrar-der { from { opacity: 0; } }
  @keyframes subir-centro { from { opacity: 0; } }
  @keyframes pop { from { opacity: 0; } }
  @keyframes aparecer-logo { from { opacity: 0; } }
  @keyframes paso-entra { from { opacity: 0; } }
  @keyframes paso-entra-izq { from { opacity: 0; } }
  .fuego, .festejo-fuego, #cargando .logo, #barra [aria-current="page"] svg, .animos [aria-checked="true"] .icono-animo { animation: none !important; }
  .chispa { display: none; }
}
.etiqueta .icono-animo, .camino-titulo .icono-animo { color: var(--acento); }
