/* Content/biblia.css (LIMPIO)
   - Panel izquierdo y libro ocupan TODO el alto disponible
   - Libro se adapta al tamaño de pantalla y sube (sin espacio vacío arriba)
   - Se eliminan reglas duplicadas: .topBar/.mainLayout/.navLists/min-height:100vh, etc.
*/

:root {
    --bg0: #05070c;
    --bg1: #0a1020;
    --ink: #0f172a;
    --paper: #faf7ef;
    --paper2: #f3efe5;
    --accent: #00ACC1;
    --shadow: rgba(0,0,0,.55);
    --shadow2: rgba(0,0,0,.25);
    --verseFont: 12px;
    --verseLine: 1.36;
    /* Alturas de barras superiores (solo informativas; el layout usa flex) */
    --titlebarH: 54px;
    --toolbarH: 58px;
    /* Margen de seguridad inferior dentro de cada página (evita corte de la última línea) */
    --safeBottom: 64px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:#e5e7eb;
  background:
    radial-gradient(1200px 600px at 50% 15%, rgba(0,172,193,.20), transparent 60%),
    radial-gradient(900px 500px at 15% 70%, rgba(255,255,255,.05), transparent 60%),
    linear-gradient(180deg,var(--bg1),var(--bg0));
  overflow:hidden; /* la app controla su propio scroll */
}

/* Por defecto: iOS lists ocultas */
.iosList {
    display: none;
}

/* Cuando sea iOS: ocultar listbox y mostrar listas custom */
html.is-ios .nativeListbox {
    display: none !important;
}

html.is-ios .iosList {
    display: block !important;
}

/* UI iOS: look similar + scroll táctil */
.iosList {
    height: var(--iosListH, 360px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 4px; /* antes 6px */
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.12);
}


/* items */
.iosItem {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 6px 8px; /* ✅ antes 10px 10px */
    margin: 1px 0; /* ✅ antes 2px 0 */
    border-radius: 8px;
    font-size: 14px; /* ✅ un poco más compacto */
    line-height: 1.15; /* ✅ menos alto */
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

    .iosItem.selected {
        background: rgba(0, 200, 255, .28) !important; /* ✅ fuerza el fondo */
        outline: 1px solid rgba(0, 200, 255, .35);
    }

    .iosItem:active {
        transform: scale(.99);
    }
/* ===== App layout ===== */
.app{
  height: 100dvh; /* mejor que 100vh en Chrome/Windows */
  display:flex;
  flex-direction:column;
}

/* ===== Header (2 filas) ===== */
.header{
  flex: 0 0 auto;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:rgba(8,12,20,.55);
  backdrop-filter:blur(8px);
}

.titlebar{
  height: var(--titlebarH);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 16px;
}

.toolbar{
  height: var(--toolbarH);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 16px;
  border-top:1px solid rgba(255,255,255,.06);
}

.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brandIcon{ width:34px; height:34px; object-fit:contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.brandTitle{ font-weight:900; font-size:16px; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.ctrl{ display:flex; flex-direction:column; gap:6px; font-size:12px; opacity:.9; }

.select{
  min-width:80px;
  padding:10px;
  border-radius:10px;
  outline:none;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.25);
  color:#fff;
}

.btn{
  height:40px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.25);
  color:#fff;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(0,172,193,.60); }

/* Botones de navegación (mismo look que .btn, pero compactos) */
.navToggle,
.navHide{
  height:40px;
  width:44px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.25);
  color:#fff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.navToggle:hover,
.navHide:hover{ border-color: rgba(0,172,193,.60); }

/* Contenido (panel + libro) ocupa todo el alto restante */
.content{
  flex: 1 1 auto;
  min-height: 0; /* CLAVE para overflow en hijos */
  display:flex;
  height:auto;
}

/* ===== Left panel ===== */
.navPanel{
  width:380px;
  max-width:45vw;
  min-width:320px;
  border-right:1px solid rgba(255,255,255,.08);
  background:rgba(8,12,20,.35);
  backdrop-filter:blur(8px);
  padding:12px;

  /* full height */
  height: 100%;
  display:none; /* mobile default */
  flex-direction:column;
  min-height:0;
}

.navHeader{ display:flex; align-items:center; justify-content:center; margin-bottom:10px; }
.navHeader span{ font-weight:700; }
.btnNavHide{ height:34px; padding:0 10px; }

/* Grid 3 columnas: [LIBROS][CAP][VERS] */
.navGrid{
  display:grid;
  grid-template-columns: 1.6fr .6fr .8fr;
  gap:10px;

  /* full height */
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.navCol{ display:flex; flex-direction:column; min-height:0; }
.navLabel{ font-size:12px; opacity:.85; margin-bottom:6px; }

.listbox{
  width:100%;
  flex:1 1 auto;
  min-height:0;
  height:100%;

  border-radius:10px;
  outline:none;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.25);
  color:#fff;
  padding:8px;
}

/* Colapsado por botón */
.content.nav-collapsed .navPanel{ display:none; }

/* ===== Stage / book ===== */
.stage{
  flex: 1 1 auto;
  min-height:0;
  min-width:0;
  height:100%;

  display:flex;
  align-items:stretch;   /* en vez de center: así sube y ocupa */
  justify-content:center;
  padding:12px;          /* recupera espacio arriba */
}

.bookShell{
  position:relative;
  width: min(1100px, 100%);
  height: 100%;
  max-height: 100%;
  border-radius:0px;
  background:radial-gradient(900px 600px at 50% 40%, rgba(255,255,255,.06), rgba(0,0,0,.25));
  box-shadow:0 22px 60px var(--shadow), inset 0 0 0 1px rgba(255,255,255,.08);
  overflow:hidden;
  perspective:1600px;
}

.bookGlow{
  position:absolute;
  inset:-80px;
  background:radial-gradient(600px 260px at 50% 30%, rgba(0,172,193,.20), transparent 70%);
  filter:blur(18px);
  pointer-events:none;
}

.fxCanvas{
  position:absolute;
  inset:0;
  pointer-events:none;
  mix-blend-mode:multiply;
  opacity:.9;
}

/* Wrapper para que el JS pueda recrear #book sin romper layout */
.bookWrap{
  position:absolute;
  inset:12px;             /* antes 18px */
  border-radius:0px;
  overflow:hidden;
  transform: rotateX(2.2deg) rotateY(0deg);
  transform-origin:center;
  box-shadow:0 18px 50px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.10);
  background:rgba(0,0,0,.15);
}

.book{
  position:absolute;
  inset:0;
  border-radius:0;
  overflow:hidden;
  background:transparent;
}

.hint {
    border-radius: 30px 30px 0 0;
    background-color: #070a10;
    width: 190px;
    height: 58px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 3px;
    opacity: 1;
    display: flex;
    justify-content: center;
    align-items: center; /* centro vertical */
    gap: 8px;
    line-height: 1; /* evita alineación por línea de texto */
}


.footer{
  padding:10px 16px;
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(8,12,20,.55);
  backdrop-filter:blur(8px);
  font-size:12px;
  opacity:.85;
}

/* ====== PageFlip HTML pages (FIX corte inferior + footer siempre visible) ====== */
/* ====== PageFlip HTML pages (FOOTER FIXED BOTTOM sin overlay) ====== */



.verseRow {
    line-height: var(--verseLine);
    font-size: var(--verseFont);
    margin: 0 0 8px 0;
    display: flex;
    gap: 8px;
}

.verseNum {
    font-size: calc(var(--verseFont) * 0.7);
    min-width: 34px;
    font-weight: 800;
    color: rgba(0,0,0,.45);
    text-align: right;
}

.verseText {
    flex: 1;
    color: #0f172a;
}


/* Si StPageFlip marca lado izquierdo/derecho */
.stf__item.--left  {
    left: 18px;
    right: 28px;
}
/* más espacio hacia el lomo */
.stf__item.--right  {
    left: 28px;
    right: 18px;
}
/* más espacio hacia el lomo */

/* Fallback si tu build no trae --left/--right (por orden de páginas) */
#book .page:nth-child(odd)  {
    left: 18px;
    right: 28px;
}

#book .page:nth-child(even) .pageFooter {
    left: 28px;
    right: 18px;
}

/* Y el body reserva igual ese gutter para que el texto y el footer alineen */
.stf__item.--left .pageBody {
    padding-left: 18px;
    padding-right: 28px;
}

.stf__item.--right .pageBody {
    padding-left: 28px;
    padding-right: 18px;
}
/* Evita gaps inesperados entre páginas */
#book, #book *{ box-sizing:border-box; }
#book{ overflow:hidden; }
#book .page{ margin:0 !important; }

/* Durante el flipping: elimina sombras/bordes para que el lomo se vea “pegado” */
body.is-flipping #book .page{
  border-radius:0 !important;
  box-shadow:none !important;
  filter:none !important;
}
body.is-flipping .stf__item,
body.is-flipping .stf__block{ box-shadow:none !important; }

/* ===== Responsive rules ===== */
@media (min-width:1024px){
  .navPanel{ display:flex; }
  .ctrlLibro, .ctrlCap{ display:block; }
}

@media (max-width:1023.98px){
  .navPanel{ display:none; }
}

@media (max-width:720px){
  .select{ min-width:58px; }
  .bookWrap{ inset:12px; }
  .page{ padding:14px; }
}
/* ===== Libro montado sobre imagen real (solo desktop landscape) ===== */

.bookBG {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

/* Base: en móvil/tablet (o portrait) se ve como antes */
.bookShell {
    position: relative;
    width: min(1100px, 100%);
    height: 100%;
}

/* Desktop + Landscape: usa la imagen del libro como base */
/* ===== Book BG robusto contra ZOOM ===== */
.bookBG {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

/* Desktop landscape */
@media (min-width:1024px) and (orientation:landscape) {

    .stage {
        height: 100%;
        display: flex;
        align-items: stretch;
        justify-content: center;
        padding: 8px 12px;
    }

    /* Contenedor del libro: ocupa TODO el alto disponible (evita “corte” abajo en iPad/zoom) */
    .bookShell {
        position: relative;
        height: 100%;
        max-height: 100%;
        width: min(1200px, 96vw);
        /* background-image: url("../images/bglibro.png"); */
        background-repeat: no-repeat;
        background-position: center;
        background-size: 100% 100%;
        border-radius: 18px!important;
        overflow: hidden;
    }

    /* El área donde va el flip: % para que escale junto al PNG */
        .bookWrap {
        position: absolute;
        left: 8.2%;
        right: 8.2%;
        top: 5.8%;
        bottom: 8.0%; /* más altura para que la página llegue más abajo */
        overflow: hidden;
        border-radius: 0 !important;
    }

    /* Anti-gaps por sub-pixel en zoom (muy común) */
    #book.stf__parent {
        width: calc(100% + 2px) !important;
        height: calc(100% + 2px) !important;
        margin-left: -1px !important;
        margin-top: -1px !important;
        transform: translateZ(0);
    }
}
/* ===== FIX: #book no llega abajo (StPageFlip wrapper con padding-bottom) ===== */
#book.stf__parent {
    height: 100% !important;
    width: 100% !important;
}

    #book.stf__parent > .stf__wrapper {
        height: 100% !important;
        width: 100% !important;
    }

        /* En landscape StPageFlip usa padding-bottom (inline) para ratio: lo anulamos */
        #book.stf__parent > .stf__wrapper.--landscape {
            height: 100% !important;
            padding-bottom: 0 !important;
        }

    /* Asegura que el bloque interno también estire */
    #book.stf__parent .stf__block {
        height: 100% !important;
    }

    /* Si hay algún contenedor extra, que herede el alto */
    #book.stf__parent .stf__item,
    #book.stf__parent .stf__container {
        height: 100% !important;
    }
/* =========================================================
   LIBRO PRO SOLO LANDSCAPE (sin PNG)
   - tapa dura negra debajo
   - cantos de hojas apiladas (líneas)
   - lomo/sombra central
   ========================================================= */
@media (min-width:1024px) and (orientation:landscape) {

    /* 1) Geometría única (TODO en %) para que el zoom no desplace nada */
    :root {
        --pgL: 8.2%;
        --pgR: 8.2%;
        --pgT: 5.8%;
        --pgB: 8.0%;
        /* Distancia del cover al borde de hojas (más cerca = menor valor) */
        --coverGap: 1.5%;
    }

    .bookShell {
        position: relative;
        border-radius: 0px!important;
        overflow: hidden;
        /* tu rojo, pero más elegante (puedes ajustar) */
        background: radial-gradient(900px 600px at 50% 30%, rgba(255,0,0,.35), rgba(120,0,0,.55) );
        transform: translateZ(0);
    }

        /* 2) COVER (tapa) – pegada a las hojas usando la MISMA geometría */
        .bookShell::before {
            content: "";
            position: absolute;
            /* cover = un poquito más grande que el bloque de hojas */
            left: calc(var(--pgL) - var(--coverGap));
            right: calc(var(--pgR) - var(--coverGap));
            top: calc(var(--pgT) - var(--coverGap));
            bottom: calc(var(--pgB) - var(--coverGap));
            border-radius: 18px;
            /* tapa dura roja con profundidad */
            background: radial-gradient(900px 420px at 50% 10%, rgba(255,255,255,.16), transparent 55%), linear-gradient(180deg, rgba(160,0,0,.95), rgba(70,0,0,.92));
            box-shadow: 0 26px 70px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.16), inset 0 18px 40px rgba(255,255,255,.06);
            z-index: 0;
            pointer-events: none;
        }

        /* 3) HOJAS APILADAS (más líneas, más visibles) */
        .bookShell::after {
            content: "";
            position: absolute;
            left: var(--pgL);
            right: var(--pgR);
            top: var(--pgT);
            bottom: var(--pgB);
            pointer-events: none;
            z-index: 1;
            /* un poco de redondeo para que se sienta “bloque” */
            border-radius: 12px;
            /* Capas: brillo arriba + sombra abajo + volumen izq/der + líneas + color papel */
            background:
            /* brillo superior (canto iluminado) */
            linear-gradient(180deg, rgba(255,255,255,.70), rgba(255,255,255,0) 22px),
            /* sombra inferior (peso del bloque) */
            linear-gradient(0deg, rgba(0,0,0,.18), rgba(0,0,0,0) 28px),
            /* volumen lateral izquierdo */
            linear-gradient(90deg, rgba(0,0,0,.22), rgba(0,0,0,0) 18px),
            /* volumen lateral derecho */
            linear-gradient(-90deg, rgba(0,0,0,.18), rgba(0,0,0,0) 18px),
            /* líneas finas de hojas */
            repeating-linear-gradient( 180deg, rgba(255,255,255,.22) 0px, rgba(255,255,255,.22) 1px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 3px ),
            /* tono papel */
            linear-gradient(180deg, rgba(250,247,239,.98), rgba(240,235,224,.98));
            /* Sombras para “cuerpo” sin crear el cuadro oscuro del fondo */
            box-shadow: 0 10px 24px rgba(0,0,0,.18), 0 26px 60px rgba(0,0,0,.14), inset 0 0 0 1px rgba(0,0,0,.12), inset 0 14px 26px rgba(0,0,0,.10);
        }

    /* 4) bookWrap usa EXACTAMENTE la misma geometría */
    .bookWrap {
        left: var(--pgL);
        right: var(--pgR);
        top: var(--pgT);
        bottom: var(--pgB);
        z-index: 3;
        background: transparent;
        box-shadow: 0 22px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.18);
    }

    /* Lomo/sombra central (opcional, se ve más real) */
    .bookGlow {
        inset: 0;
        background: linear-gradient( 90deg, transparent 0%, rgba(0,0,0,.12) 48%, rgba(0,0,0,.35) 50%, rgba(0,0,0,.12) 52%, transparent 100% );
        filter: none;
        opacity: .85;
        z-index: 2;
        pointer-events: none;
    }
}
/* =========================================================
   NAV OFF-CANVAS SIEMPRE (sin depender de resolución)
   ========================================================= */

.content {
    position: relative;
}

/* Backdrop SIN capa visual (no oscurece ni desenfoca) */
.navBackdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    z-index: 80;
}

/* Panel flotante SIEMPRE */
.navPanel {
    opacity: 0.99;
    background: radial-gradient(1200px 600px at 50% 15%, rgba(0, 172, 193, .20), transparent 60%), radial-gradient(900px 500px at 15% 70%, rgba(255, 255, 255, .05), transparent 60%), linear-gradient(180deg, var(--bg1), var(--bg0));
    position: fixed;
    top: calc(var(--titlebarH) + var(--toolbarH));
    left: 0;
    height: calc(100dvh - (var(--titlebarH) + var(--toolbarH)));
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    min-height: 0;
    transform: translateX(-105%);
    transition: transform .26s ease;
    border-right: 1px solid rgba(255,255,255,.10);
    box-shadow: 20px 0px 12px 1px rgba(0, 0, 0, .55);
    z-index: 90;
}

/* Estado abierto */
.app.nav-open .navPanel {
    transform: translateX(0);
}

/* Importante: aunque no tenga “capa visual”, sí debe poder capturar click para cerrar */
.app.nav-open .navBackdrop {
    pointer-events: auto; /* SOLO cuando está abierto */
}

/* (Opcional) bloquear scroll del body cuando está abierto */
body.nav-lock {
    overflow: hidden;
}

/* NUEVO BOTON PIN PARA ANCLAR MENU FLOTANTE */
/* Botón pin: mismo look que navHide */
.navPin {
    height: 40px;
    width: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.25);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .navPin:hover {
        border-color: rgba(0,172,193,.60);
    }

/* Estado visual cuando está anclado */
.app.nav-pinned .navPin {
    border-color: rgba(0,172,193,.75);
    box-shadow: 0 0 0 2px rgba(0,172,193,.20) inset;
}

/* Si está anclado: el menú queda siempre abierto */
.app.nav-pinned .navPanel {
    transform: translateX(0) !important;
}

/* Si está anclado: NO uses backdrop para no “tapar” el libro */
.app.nav-pinned .navBackdrop {
    pointer-events: none !important;
}

/* Si quieres que al anclar el contenido se corra a la derecha (recomendado) */
.app.nav-pinned .content {
    padding-left: min(420px, 92vw);
}

/* RESALTANDO VERSICULO CLICKEADO  */
/* Resaltado del versículo seleccionado (cyan claro casi transparente, sin afectar el layout) */
.verseRow.is-selected {
    position: relative;
}

    .verseRow.is-selected::before {
        content: "";
        position: absolute;
        left: -6px;
        right: -6px;
        top: -2px;
        bottom: -2px;
        background: rgba(0, 172, 193, .18);
        border-radius: 10px;
        pointer-events: none;
    }

    .verseRow.is-selected > * {
        position: relative;
        z-index: 1;
    }
/* =========================================================
   FIX DEFINITIVO: footer SIEMPRE visible (sin position:absolute)
   Pegar al FINAL del biblia.css
   ========================================================= */

/* ====== PageFlip HTML pages (SIN footer + sin corte abajo) ====== */
.page {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,var(--paper),var(--paper2));
    color: var(--ink);
    border-radius: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.07), inset 0 18px 24px rgba(0,0,0,.04);
    padding: 18px 18px 22px 18px; /* más aire abajo */
    display: flex;
    flex-direction: column;
}

.pageHeader {
    font-weight: 800;
    font-size: 14px;
    color: #0b1324;
    letter-spacing: .2px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

:root {
    /* ...tus variables... */
    /* Margen de seguridad inferior dentro de cada página (evita corte de la última línea) */
    --safeBottom: 64px;
}

/* ... */

.pageBody {
    flex: 1;
    padding-top: 12px;
    overflow: hidden;
    padding-bottom: var(--safeBottom); /* 👈 margen real abajo */
    box-sizing: border-box;
}

/* ✅ ELIMINAR footer definitivamente */
.pageFooter {
    display: none !important;
}

/* Botón comparar versiones (al lado del pin) */
.btnCompare {
    height: 40px;
    width: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.25);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

    .btnCompare:hover {
        border-color: rgba(0,172,193,.60);
    }

    .btnCompare:active {
        transform: translateY(1px);
    }

/* Estilos del modo comparación dentro de páginas */
.cmpWrap,
.cmpWrap * {
    color: #111 !important;
    text-shadow: none !important;
}

/* Título */
.cmpTitle {
    color: #0b0b0b !important;
    font-weight: 800;
}

/* Tarjetas */
.cmpItem {
    background: rgba(255,255,255,.92) !important;
    border: 1px solid rgba(0,0,0,.18) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    padding: 14px 16px !important; /* padding general */
    border-radius: 14px !important;
    margin-bottom: 5px;
}

/* Etiqueta versión */
.cmpVersion {
    font-size: small;
    color: #0022a7 !important;
    font-weight: 500;
    margin: 0 0 10px 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(0,0,0,.10) !important;
}

/* Texto del versículo */
.cmpText {
    color: #111 !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    padding: 2px 4px !important;
    margin: 0 !important;
}

/* Hint */
.cmpHint {
    color: #222 !important;
    opacity: .85 !important;
    font-weight: 600;
    margin-top: 16px !important;
    padding-top: 10px !important;
    border-top: 1px dashed rgba(0,0,0,.18) !important;
}
/* separación entre tarjetas */
.cmpList {
    gap: 16px !important;
}

/* Si algún estilo global te baja la opacidad, lo anulamos */
.cmpWrap {
    position: relative;
    opacity: 1 !important;
    filter: none !important;
    padding: 18px 20px !important;
}
/* Botón Volver (arriba a la derecha) */
.cmpBackBtn {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 5;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.18);
    background: rgba(255,255,255,.92);
    color: #111;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.10);
}

    .cmpBackBtn:hover {
        border-color: rgba(0,0,0,.35);
        transform: translateY(-1px);
    }

    .cmpBackBtn:active {
        transform: translateY(0);
    }

/* Para que el título no choque con el botón */
.cmpTitle {
    padding-right: 110px; /* reserva espacio a la derecha */
}
/* =========================================================
   RESTORE: Versiones rápidas (pills) al lado del dropdown
   (Tu CSS actual no las incluía; esto NO rompe nada existente)
   ========================================================= */
.versionPills{
  display:flex;
  align-items:stretch;
  border-radius:999px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.25);
}

.verPill{
  height:40px;
  min-width:70px;
  padding:0 18px;
  border:0;
  cursor:pointer;
  color:#fff;
  font-weight:800;
  letter-spacing:.6px;
  background:transparent;
}

.verPill:not(:first-child){
  border-left:1px solid rgba(255,255,255,.10);
}

.verPill:hover{ background:rgba(255,255,255,.06); }
.verPill:active{ transform:translateY(1px); }

    .verPill.active {
        background: rgb(0 172 193 / 30%);
        box-shadow: inset 0 0 0 1px rgb(0 172 193 / 26%);
    }

.verPill:focus-visible{
  outline:2px solid rgba(0,172,193,.95);
  outline-offset:2px;
}

@media (max-width: 560px){
  .versionPills{ transform:scale(.95); transform-origin:right center; }
  .verPill{ min-width:62px; padding:0 14px; font-size:13px; }
}

/* =========================================================
   TABLET PORTRAIT: aprovechar ancho útil del papel
   - Quita "gutter" izquierdo/derecho (lomo) pensado para 2 páginas
   - Mantiene un margen limpio para verse profesional
   ========================================================= */
@media (min-width: 700px) and (orientation: portrait){

  /* Asegura que el wrapper portrait no use padding-bottom para ratio */
  #book.stf__parent > .stf__wrapper.--portrait{
    height: 100% !important;
    width: 100% !important;
    padding-bottom: 0 !important;
  }

  /* En portrait queremos el contenido centrado y sin lomo exagerado */
  #book.stf__parent > .stf__wrapper.--portrait .stf__item.--left,
  #book.stf__parent > .stf__wrapper.--portrait .stf__item.--right{
    left: 12px !important;
    right: 12px !important;
  }

  /* El body de la página usa padding simétrico */
  #book.stf__parent > .stf__wrapper.--portrait .pageBody{
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}
/* ======================================
   SCROLL VERTICAL SOLO EN MODO COMPARAR
   (compatible con iOS/Safari)
   ====================================== */

/* Cuando el pageContent está en modo comparar */
.pageBody.isCompareScroll {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: 100% !important;
}

/* Importante: permitir que el contenido pueda scrollear (sin esto a veces no funciona) */
.pageContent.isCompareScroll {
    max-height: 100% !important;
}
/* =========================
   MODO COMPARAR: OCULTAR PÁGINA DERECHA Y USAR ANCHO COMPLETO
   ========================= */

/* Ajusta el selector #book si tu contenedor se llama distinto */
#book.compareModeOn .stf__page,
#book.compareModeOn .stf__item {
    /* no tocamos todas, solo actuamos sobre las visibles con :nth */
}

    /* Ocultar la "página derecha" visible */
    #book.compareModeOn .stf__item:nth-child(2),
    #book.compareModeOn .stf__page:nth-child(2) {
        display: none !important;
    }

    /* Estirar la página izquierda a ancho completo */
    #book.compareModeOn .stf__item:nth-child(1),
    #book.compareModeOn .stf__page:nth-child(1) {
        width: 100% !important;
        left: 0 !important;
    }

        /* Asegurar que el body de la página use todo */
        #book.compareModeOn .stf__item:nth-child(1) .pageBody,
        #book.compareModeOn .stf__page:nth-child(1) .pageBody {
            width: 100% !important;
        }
/* Asegura que el libro pueda contener un overlay absoluto */
#book {
    position: relative;
}

/* Capa que cubre el libro completo */
#compareOverlay {
    position: absolute;
    inset: 0;
    z-index: 9999;
    display: none;
    pointer-events: auto;
}

/* Visible */
#book.compareOverlayOn #compareOverlay {
    display: block;
}

/* Fondo tipo página */
#compareOverlay .cmpOverlayInner {
    background-color: white;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* ✅ scroll vertical */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px 18px;
    box-sizing: border-box;
}

/* Si quieres que el flip NO responda a clics mientras comparas */
#book.compareOverlayOn {
    /* no hace falta, pero ayuda */
}
/* ============================= */
/* 📱 DISEÑO OPTIMIZADO MÓVIL */
/* ============================= */
@media (max-width: 768px) {

    .top-bar {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    /* Versiones en scroll horizontal */
    .version-tabs {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

        .version-tabs button {
            flex: 0 0 auto;
            padding: 6px 12px;
            font-size: 14px;
            border-radius: 10px;
        }

    /* Selectores Libro y Capítulo */
    .selector-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

        .selector-row select {
            width: 100%;
            font-size: 16px;
            padding: 8px;
            border-radius: 10px;
        }

    /* Controles inferiores */
    .control-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

        .control-row button {
            flex: 1;
            padding: 10px;
            font-size: 16px;
            border-radius: 12px;
        }

    /* Botones A- A+ */
    .font-controls {
        display: flex;
        gap: 8px;
        justify-content: center;
    }

        .font-controls button {
            padding: 8px 12px;
            font-size: 15px;
            border-radius: 10px;
        }
}
/* ================================
   📱 TOPBAR: 2 filas limpias en móvil
   (no rompe desktop)
   ================================= */

/* =========================================================
   ✅ MÓVIL: Toolbar en UNA SOLA FILA (carrusel horizontal)
   Objetivo: que NO se vaya a 2 líneas.
   Igual que la fila del título: el usuario desliza a la derecha.
   ========================================================= */
@media (max-width: 420px) {

    /* La toolbar completa se vuelve “carrusel” */
    .toolbar {
        display: flex !important;
        flex-wrap: nowrap !important; /* 👈 NO permitir salto */
        align-items: center;
        gap: 10px;
        padding: 6px 10px 10px;
        overflow-x: auto; /* 👈 scroll horizontal */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        white-space: nowrap;
    }

        .toolbar::-webkit-scrollbar {
            display: none;
        }

        /* Cada bloque .controls se mantiene en una sola línea */
        .toolbar > .controls {
            display: inline-flex !important;
            flex: 0 0 auto !important; /* 👈 no estirar, no encoger */
            flex-wrap: nowrap !important; /* 👈 no permitir salto */
            align-items: center;
            gap: 8px;
            white-space: nowrap;
        }

            /* Si hay estilos previos que fuerzan width:100% en .controls, lo anulamos */
            .toolbar > .controls:first-child,
            .toolbar > .controls:last-child {
                width: auto !important;
                min-width: 0 !important;
            }

        /* Oculta labels “Libro/Cap.” para ganar espacio */
        .toolbar label.ctrl span {
            display: none;
        }

    /* Botón menú */
    #btnNavToggle.navToggle {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    /* Selects con ancho fijo (para que el carrusel funcione) */
    .ctrlLibro select.select {
        width: 100px;
    }
    /* ajusta */
    .ctrlCap select.select {
        width: 78px;
    }
    /* ajusta */

    .toolbar .select {
        height: 40px;
        padding: 6px 10px;
        font-size: 14px;
        border-radius: 12px;
        box-sizing: border-box;
        flex: 0 0 auto; /* 👈 clave */
    }

    /* Botones */
    .toolbar .btn {
        height: 40px;
        min-width: 44px;
        padding: 0 10px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        flex: 0 0 auto; /* 👈 clave */
    }
}
/* =========================================================
   ✅ Quitar el espacio vacío arriba del libro en móvil
   Causa típica: el contenedor “stage/bookWrap” está centrando verticalmente
   (align-items:center) o tiene padding-top/margin-top.
   Solución: en móvil, alinear arriba (flex-start) y resetear paddings/margins.
   ========================================================= */

/* =========================================================
   ✅ ELIMINAR el espacio vacío arriba del libro (MÓVIL)
   Causa: el contenedor del book (o el wrapper de PageFlip)
          está centrando verticalmente o tiene padding-top.
   Fix: forzar “pegado arriba” + que el wrapper ocupe 100% del alto.
   ========================================================= */

@media (max-width: 900px) {

    /* 1) El contenedor principal donde vive el libro: pegado arriba */
    .stage, main.stage, #stage, #viewer, #bookStage, .bookStage, .flipHost, .viewer {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* 👈 clave */
        align-items: center !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        overflow: hidden;
    }

    /* 2) Los wrappers típicos de StPageFlip / PageFlip: que NO centren */
    .stf__wrapper,
    .stf__parent,
    .stf__block,
    .stf__container {
        display: flex !important;
        justify-content: flex-start !important; /* 👈 clave */
        align-items: flex-start !important; /* 👈 clave */
        padding-top: 0 !important;
        margin-top: 0 !important;
        height: 100% !important;
        min-height: 100% !important;
    }

    /* 3) El elemento book: sin offset vertical */
    #book, .book, #flipbook, .flipbook {
        margin-top: 0 !important;
        top: 0 !important;
        transform: none !important; /* por si hay translateY(...) */
    }

    /* 4) Si el hueco viene de un “padding-top” que pusimos antes para el header,
        aquí lo anulamos (porque ya estás usando carrusel y no se monta). */
    .stage, main.stage, #stage, #viewer, #bookStage, .bookStage {
        padding-top: 0 !important;
    }
}
/* ✅ 2) Estilo del botón (no interfiere con tus estilos actuales) */
/* ✅ Botón circular moderno estilo iOS (flotante) */
/* ✅ Botón circular iOS (SIN amarrar posición: JS lo posiciona y lo arrastra) */
#btnFullscreen.btnFullscreenFloating {
    position: fixed;
    z-index: 2147483647;
    /* Importante: NO poner top/left/right/bottom aquí */
    left: 12px; /* fallback si JS no cargara */
    top: 120px; /* fallback si JS no cargara */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 3px solid rgb(218 218 218 / 60%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.10) inset;
    color: #fff;
    font-size: large;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* 👈 clave para drag en móvil */
}

    /* ✅ Efecto iOS SIN mover posición */
    #btnFullscreen.btnFullscreenFloating:active {
        transform: scale(0.96);
    }



    #btnFullscreen.btnFullscreenFloating.dragging {
        opacity: .92;
    }

    .btnFullscreenFloating:active {
        cursor: grabbing;
        transform: scale(0.98);
    }

    /* (Opcional) cuando está “arrastrando” */
    .btnFullscreenFloating.dragging {
        opacity: 0.9;
    }
/* ✅ Solo para que el ícono se comporte como el SVG y no rompa estilos */
.btnGames img {
    
    height: 30px;
    display: block;
    object-fit: contain;
    pointer-events: none; /* evita clicks sobre la imagen */
}
/* ===== Overlay similar a comparar (sin flip) ===== */
.srOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: none;
    z-index: 99999;
}

    .srOverlay[aria-hidden="false"] {
        display: block;
    }

.srOverlayHeader {
    height: 56px;
    background: #7a0f14;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
}

.srOverlayTitle {
    font-weight: 800;
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.srOverlayMeta {
    font-weight: 600;
    opacity: .75;
    font-size: 12px;
}

.srBackBtn, .srCloseBtn {
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 800;
    padding: 8px 10px;
}

.srOverlayInner {
    background: #fff;
    width: 100%;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 20px;
    box-sizing: border-box;
}

/* ===== Barra pestañas ===== */
.sr-scopebar {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 6px 0 10px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    margin-bottom: 10px;
}

.sr-tab {
    border: 0;
    background: transparent;
    font-weight: 900;
    letter-spacing: .5px;
    color: rgba(0,0,0,.55);
    padding: 8px 2px;
}

    .sr-tab.active {
        color: #000;
        border-bottom: 3px solid #000;
    }

/* ===== Search row (no flotante) ===== */
.sr-searchrow {
    display: flex;
    width: 100%;
    gap: 0;
    align-items: stretch;
    margin-top: 6px;
}

.sr-searchinput {
    flex: 1;
    border: 1px solid rgba(0,0,0,.18);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    padding: 12px 14px;
    font-size: 18px;
    outline: none;
}

.sr-searchbtn {
    width: fit-content;
    border: 1px solid rgba(0,0,0,.18);
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    font-weight: 900;
    background: #fff;
}

/* ===== Cards ===== */
.sr-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.sr-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 16px 16px 14px;
    cursor: pointer;
}


.sr-title {
    font-size: 20px; /* antes estaba muy grande */
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.3px;
    margin: 0 0 10px 0;
    /* color y fuente */
    color: #111; /* negro suave */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    text-shadow: 0 1px 0 rgba(255,255,255,.7); /* leve para que se vea “premium” */
}

/* móvil */
@media (max-width: 420px) {
    .sr-title {
        font-size: 24px;
    }
}

.sr-text {
    font-size: 16px;
    line-height: 1.3;
    color: rgba(0,0,0,.55);
    margin: 0;
}

    .sr-text .hl {
        color: #3b82f6;
        font-weight: 900;
    }
/* (extra) evita scroll del body mientras overlay está abierto */
body.sr-noscroll {
    overflow: hidden;
}

/* (extra) por si quieres “bloquear” visualmente algo */
.sr-lock {
}

/* ===== Utilidades mínimas (para overlay búsqueda, sin Bootstrap) ===== */
.d-flex{display:flex;}
.justify-content-between{justify-content:space-between;}
.align-items-center{align-items:center;}
.mt-2{margin-top:.5rem;}
.my-2{margin-top:.5rem;margin-bottom:.5rem;}
.small{font-size:12px;}
.text-muted{color:rgba(0,0,0,.55);}
.form-check{display:flex;align-items:center;gap:8px;}
.form-check-input{width:16px;height:16px;}
/* ✅ Loader flotante “Buscando…” */
.srLoading {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 105px;
    background: rgba(255,255,255,.55);
    backdrop-filter: blur(2px);
    z-index: 100001; /* por encima del overlay */
    pointer-events: none; /* no bloquea clics (si quieres bloquear, cambia a auto) */
}

    .srLoading[aria-hidden="true"] {
        display: none;
    }

.srLoadingBox {
    background: #111;
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
    font-weight: 800;
}

.srSpinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    animation: srspin .8s linear infinite;
}

@keyframes srspin {
    to {
        transform: rotate(360deg);
    }
}
/* =========================================================
   ✅ MOBILE / S23 FIX UNIFICADO (máx ancho, sin bordes, sin corte, top gap, fullscreen btn)
   Pegar AL FINAL del CSS (último bloque @media)
   ========================================================= */
@media (max-width: 600px) {

    :root {
        --topbarH: 124px;
        --safeBottom: 64px;
    }

    /* 0) Base */
    html, body, .app, .stage, main.stage {
        box-sizing: border-box;
    }

    /* 1) Stage pegado arriba y con alto correcto */
    .stage, main.stage, #stage, #bookStage, .bookStage {
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important; /* 👈 clave */
        padding-top: 0 !important;
        margin-top: 0 !important;
        height: calc(100dvh - var(--topbarH) - var(--safeBottom)) !important;
        min-height: calc(100dvh - var(--topbarH) - var(--safeBottom)) !important;
        overflow: hidden !important;
    }

    /* 2) Quita padding/margen lateral en wrappers */
    #bookWrap, .bookWrap, .flipContainer, .bookFrame, .frame,
    .stage, main.stage {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    /* 3) bookShell sin marco (aprovecha todo el ancho) */
    .bookShell {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: hidden !important; /* el flip lo suele necesitar */
        perspective: 1600px;
    }

    /* 4) StPageFlip: alinear arriba (evita top grande tipo 139px) */
    .stf__wrapper, .stf__parent, .stf__container {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* 5) El book ocupa todo el ancho */
    #book, .book, #flipbook, .flipbook,
    .stf__wrapper, .stf__parent {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-top: 0 !important;
        top: 0 !important;
    }

    /* 6) Quitar “gutter/lomo” y forzar top 0 en páginas */
    .stf__item.--left,
    .stf__item.--right {
        left: 0 !important;
        right: 0 !important;
    }

    #book .page.stf__item,
    #flipbook .page.stf__item,
    .page.stf__item {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
    }

        /* 7) Papel: sin esquinas redondas + ancho casi total */
        #book .page,
        #flipbook .page,
        .page, .sheet,
        .page.stf__item,
        .page.stf__item .pageBody,
        .page.stf__item .pageHeader,
        .page.stf__item .pageFooter {
            border-radius: 0 !important;
        }

    /* 8) Evitar recortes por subpíxeles en Android real */
    .page, .sheet, .stf__item > div {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .pageBody {
        /* 👇 “papel” casi a borde (deja 6px por lado para evitar artefactos) */
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px) !important;
        margin: 0 auto !important;
        padding: 3px 3px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* 9) Contenedores de texto */
    .pageContent, .pageInner, .page-body, .content, .pageText,
    .page .content, .sheet .content {
        padding: 3px 3px !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

        /* 10) Texto: que envuelva y no se corte */
        .pageBody *, .pageContent *, .pageInner *, .page-body *, .content *, .pageText *,
        .verseText {
            overflow-wrap: anywhere !important;
            word-break: normal !important;
            max-width: 100% !important;
        }

    /* Si tus versos usan flex, evita clipping */
    .verseRow, .verseLine, .verseItem {
        min-width: 0 !important;
    }

    /* Número más compacto */
    .verseNum {
        min-width: 28px !important;
    }

    /* 11) Fullscreen button (no amarrar posición, solo tamaño/estilo base) */
    #btnFullscreen.btnFullscreenFloating {
        width: 38px !important;
        height: 38px !important;
        z-index: 2147483647 !important;
        pointer-events: auto !important;
        /* posición fija abajo-derecha (tu preferencia) */
        right: 20px !important;
        bottom: 20px !important;
        left: auto !important;
        top: auto !important;
        margin: 0 !important;
        transform: none !important;
        touch-action: none !important;
        border: 3px solid rgba(255,255,255,.12) !important;
        border-radius: 50% !important;
    }
}
@media (max-width: 600px) {

    /* 1) Reduce padding izquierdo del “papel” */
    .pageBody {
        padding-left: 10px !important; /* antes 14px */
        padding-right: 10px !important; /* deja simétrico */
    }

    /* 2) Columna del número: más estrecha */
    .verseNum {
        min-width: 22px !important; /* antes 28px */
        width: 22px !important;
        margin-right: 8px !important;
        text-align: right !important;
        flex: 0 0 22px !important;
    }
}
@media (max-width: 600px) {

    /* El renglón del verso: flex correcto */
    .verseRow, .verseLine, .verseItem {
        display: flex !important;
        align-items: flex-start !important;
        gap: 0 !important;
        min-width: 0 !important; /* 👈 clave */
        overflow: visible !important;
    }

    /* Texto del verso: permite encoger y envolver */
    .verseText {
        flex: 1 1 auto !important;
        min-width: 0 !important; /* 👈 clave */
        max-width: 100% !important;
        overflow: visible !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }
}
/* Anti-corte por zoom (subpíxeles) */
.pageBody, .pageText, .verseText {
    max-width: 100%;
    overflow: visible;
    overflow-wrap: anywhere;
}

.verseRow, .verseLine, .verseItem {
    min-width: 0;
}
/* ===== MODO FONDO FOTO: sin “cuadro” oscuro detrás ===== */
@media (min-width:1024px) and (orientation:landscape) {

    /* Este es el “cuadro” principal (fondo + sombra del contenedor) */
    .bookShell {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Este es el “marco” rectangular del flip (también oscurece) */
    .bookWrap {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* (Opcional) si todavía ves halo/sombra alrededor del libro “PRO” */
    .bookShell::before,
    .bookShell::after {
        box-shadow: none !important;
    }

    /* (Opcional) si el lomo/efecto oscurece el fondo */
    .bookGlow,
    .fxCanvas {
        opacity: 0 !important;
    }
}
@media (min-width:1024px) and (orientation:landscape) {
    .stage {
        background-image: url("../bg/bg01.jpg");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
}
.bgSelect {
    min-width: 160px;
}

@media (max-width: 720px) {
    .bgSelect {
        min-width: 120px;
    }
}
#hint button {
    border: 0;
    background: transparent;
    padding: 0;
    width: 45px;
    height: 40px;
    cursor: pointer;
}

    #hint button img {
        width: 45px;
        height: 45px;
        display: block;
        margin: auto;
    }
/* Efecto neon suave al pasar el mouse por la barra */
.hint {
    transition: box-shadow .18s ease, transform .12s ease, filter .18s ease;
}

    .hint button img {
        display: block;
    }

    /* Botones: hover/press con glow azul */
    .hint button {
        border: 0;
        background: transparent;
        cursor: pointer;
        border-radius: 10px;
        padding: 6px 8px;
        transition: box-shadow .15s ease, transform .12s ease, filter .15s ease;
    }

        .hint button:hover {
            box-shadow: 0 0 10px rgba(0, 170, 255, .45), 0 0 18px rgba(0, 170, 255, .25);
            filter: brightness(1.12);
        }

        .hint button:active {
            box-shadow: 0 0 14px rgba(0, 170, 255, .65), 0 0 28px rgba(0, 170, 255, .35);
            transform: scale(0.96);
        }
    .hint button {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
    }
/* =========================
   Modal Favoritos
========================= */
.favOverlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.favModal {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(980px, calc(100vw - 22px));
    max-height: min(78vh, 780px);
    background: rgba(255,255,255,0.98);
    color: #111;
    border-radius: 14px;
    box-shadow: 0 18px 55px rgba(0,0,0,0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.favHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.favTitle {
    font-size: 18px;
    font-weight: 800;
}

.favSubtitle {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
}

.favIconBtn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(0,0,0,0.06);
    cursor: pointer;
}

.favToolbar {
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.favSelect, .favInput {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.favInput {
    flex: 1 1 280px;
}

.favBtn {
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
}

.favBtnPrimary {
    background: rgba(0,180,255,0.9);
    color: #061018;
    font-weight: 700;
}

.favBtnSecondary {
    background: rgba(0,0,0,0.06);
    color: #111;
}

.favBtnDanger {
    background: rgba(255,80,80,0.9);
    color: #180808;
    font-weight: 700;
}

.favList {
    padding: 10px 14px;
    overflow: auto;
    flex: 1 1 auto;
}

.favItem {
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 10px;
}

.favChk {
    width: 18px;
    height: 18px;
    margin-top: 6px;
}

.favRefRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.favRef {
    font-weight: 800;
}

.favMeta {
    font-size: 12px;
    opacity: .7;
}

.favText {
    margin-top: 6px;
    line-height: 1.35;
    font-size: 14px;
}

.favActions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.favActionBtn {
    border: 0;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(0,0,0,0.06);
}

.favFooter {
    padding: 10px 14px;
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Mobile: modal más alto */
@media (max-width: 600px) {
    .favModal {
        max-height: 86vh;
    }
}

/* Verso seleccionado */
.v.is-selected {
    background: rgba(0, 255, 255, 0.22);
    outline: 1px solid rgba(0, 255, 255, 0.45);
    border-radius: 6px;
    padding: 2px 3px;
}

/* Capa para bloquear el flip (captura swipe fuera de versos) */
#flipLockLayer {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    background: transparent;
    touch-action: none; /* importantísimo: bloquea gestos */
}

/* Menú flotante */
#verseActionMenu {
    position: fixed;
    z-index: 9999;
    display: none;
    background: rgba(20,20,20,0.92);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
}

    #verseActionMenu .row {
        display: flex;
        gap: 8px;
    }

    #verseActionMenu button {
        border: 0;
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 14px;
        line-height: 1;
        cursor: pointer;
    }

    #verseActionMenu .btnSecondary {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

    #verseActionMenu .btnPrimary {
        background: rgba(0,180,255,0.85);
        color: #081018;
        font-weight: 600;
    }

    #verseActionMenu .btnDanger {
        background: rgba(255,80,80,0.85);
        color: #180808;
        font-weight: 600;
    }

/* Mini toast */
#miniToast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 10000;
    display: none;
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
}
.btnFavs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btnFavs:hover {
        background: rgba(0, 200, 255, 0.18);
        box-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
    }

    .btnFavs:active {
        background: rgba(0, 200, 255, 0.35);
        transform: scale(0.95);
    }


/* =========================
   Modal Guardar en Favoritos (Pro)
========================= */
.favSaveModal{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    width:min(520px, calc(100vw - 22px));
    max-height:min(78vh, 560px);
    background: rgba(255,255,255,0.98);
    color:#111;
    border-radius:14px;
    box-shadow:0 18px 55px rgba(0,0,0,0.35);
    overflow:hidden;
    display:flex;
    flex-direction:column;
}

.favSaveBody{
    padding: 12px 14px 14px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.favSaveLabel{
    font-size: 12px;
    font-weight: 800;
    opacity: .75;
    margin-top: 2px;
}

.favSaveNewWrap .favInput{
    width:100%;
}

.favSaveHint{
    font-size: 12px;
    opacity: .7;
    margin-top: -6px;
}

.favSavePreview{
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 12px;
    background: rgba(0,0,0,0.02);
    max-height: 240px;
    overflow:auto;
}

.favSavePreviewTitle{
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 8px;
}

.favSaveLine{
    font-size: 13px;
    line-height: 1.35;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.10);
}

.favSaveLine:last-child{ border-bottom:0; }

.favSaveRef{
    font-weight: 800;
}

.favSaveMore{
    margin-top: 6px;
    font-size: 12px;
    opacity: .75;
}



/* ====== Perícopas (títulos) + concordancia ====== */
.b3dPericopeTitle {
    font-weight: 800;
    margin: 10px 0 4px 0;
    font-size: calc(var(--verseFont) * 1.02);
    color: #570000;
}

.b3dPericopeMeta {
    border-bottom: 2px solid rgba(11, 98, 214, .22);
    padding: 8px 10px;
    border-left: 1px solid rgba(11, 98, 214, .22);
    background: antiquewhite;
    border-radius: 10px 10px 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.b3dPericopeXref{
    margin: 0;
    font-size: calc(var(--verseFont) * 0.88);
    line-height: 1.45;
    color: rgba(17,24,39,0.82);
}

.b3dPericopeXrefLabel{
    font-weight: 700;
    color: #334155;
}

.b3dPericopeComment{
    margin-top: 6px;
    font-size: calc(var(--verseFont) * 0.93);
    line-height: 1.52;
    color: #4b5563;
    text-align: justify;
}

.b3dXrefLink{
    color: #0b62d6;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.b3dXrefLink:hover{
    text-decoration: none;
}

/* ====== Overlay concordancia ====== */
#xrefOverlay{
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
}

#xrefOverlay .xrefPanel{
    width: min(720px, 92vw);
    max-height: min(78vh, 720px);
    background: rgba(255,255,255,0.97);
    border-radius: 14px;
    box-shadow: 0 18px 55px rgba(0,0,0,0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#xrefOverlay .xrefHead{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

#xrefOverlay .xrefActions{
    display:flex;
    gap: 10px;
    padding: 10px 14px 0;
}

#xrefOverlay .xrefGo{
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(0,180,255,0.85);
    color: #081018;
    font-weight: 800;
    cursor: pointer;
}

#xrefOverlay .xrefGo:active{
    transform: translateY(1px);
}

    #xrefOverlay .xrefTitle {
        font-weight: 800;
        font-size: 18px;
        color: #0037b9;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

#xrefOverlay .xrefClose{
    border: 0;
    background: rgba(0,0,0,0.06);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

#xrefOverlay .xrefBody{
    padding: 14px 14px 16px 14px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#xrefOverlay .xrefVerse{
    display:flex;
    gap:10px;
    align-items:flex-start;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
}

#xrefOverlay .xrefNum{
    min-width: 32px;
    text-align: right;
    font-weight: 800;
    color: rgba(0,0,0,0.45);
}

#xrefOverlay .xrefTxt{
    flex: 1;
    color: #0f172a;
}

#xrefOverlay .xrefMsg{
    color: rgba(0,0,0,0.72);
    font-style: italic;
}

body.xref-noscroll{
    overflow: hidden;
}
.btnIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

    .btnIcon img {
        width: 22px; /* prueba 18–22 */
        height: 22px;
        object-fit: contain;
        display: block;
    }
.historyPanel {
    height: calc(100% - 52px);
    display: flex;
    flex-direction: column;
    padding: 8px;
    box-sizing: border-box;
}

.historyTitleBar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.historyTitle {
    font-size: 13px;
    font-weight: 700;
    color: #dfefff;
}

.historyClearBtn {
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.08);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

    .historyClearBtn:hover {
        background: rgba(255,255,255,.14);
    }

.historyList {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 2px;
}

.historyItem {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.07);
    color: #fff;
    border-radius: 10px;
    padding: 9px 10px;
    cursor: pointer;
    transition: .18s ease;
}

    .historyItem:hover {
        background: rgba(125, 220, 255, .16);
        border-color: rgba(125, 220, 255, .40);
    }

.historyRef {
    display: block;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
}

.historyMeta {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    opacity: .8;
}

.historyEmpty {
    padding: 14px 8px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,.72);
}

#btnHistory.active,
#btnHistory[aria-pressed="true"] {
    box-shadow: 0 0 0 1px rgba(87, 205, 255, .65), 0 0 10px rgba(87, 205, 255, .35);
    background: rgba(87, 205, 255, .12);
    border-radius: 8px;
}
.historyRowTop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.historyRef {
    display: block;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
}

.historyDate {
    color: darkgrey;
    display: block;
    margin-left: auto;
    text-align: right;
    font-size: 11px;
    opacity: .78;
    white-space: nowrap;
    flex-shrink: 0;
}

.historyMeta {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: .8;
}
.b3dCommentRef {
    color: #1d5fbf;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

    .b3dCommentRef:hover {
        text-decoration: none;
    }