/* ==========================================================================
   NUESTRO LIBRO (/libro): un libro de Minecraft con los colores de Imaginitycraft
   (negro y oro), el emblema en la tapa y una foto del servidor en cada capítulo.
   ========================================================================== */
.es-libro { background: #0d0b0f; }
.lb { position: relative; overflow: hidden; min-height: 100vh; padding: clamp(2.5rem, 6vw, 4.5rem) 1rem 4rem; color: #efe6d2;
  background: radial-gradient(ellipse at 50% 58%, rgba(224, 178, 82, .16), transparent 55%), radial-gradient(ellipse at 50% -10%, rgba(224, 178, 82, .08), transparent 50%), #0d0b0f; }
.lb::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(224, 178, 82, .35) 1px, transparent 1.5px); background-size: 46px 46px; -webkit-mask-image: radial-gradient(ellipse at 50% 55%, #000, transparent 70%); mask-image: radial-gradient(ellipse at 50% 55%, #000, transparent 70%); }
.lb-cab { text-align: center; position: relative; z-index: 2; }
.lb-cab .lb-marca { width: 64px; height: 64px; margin: 0 auto .6rem; display: block; filter: drop-shadow(0 0 18px rgba(224, 178, 82, .5)); }
.lb-cab .lb-kicker { letter-spacing: .35em; text-transform: uppercase; font-size: .78rem; color: #c9a85e; }
.lb-cab h1 { font-family: "Big Shoulders Stencil", system-ui, sans-serif; font-size: clamp(2.6rem, 8vw, 5rem); line-height: .95; margin: .5rem 0 .6rem;
  background: linear-gradient(180deg, #fff3c4 0%, #e0b252 55%, #a8741f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(224, 178, 82, .25)); }
.lb-cab p { color: #d9cdb2; max-width: 36rem; margin: 0 auto; }

/* letras de la mesa de encantamientos que vuelan hacia el libro, doradas */
.lb-runas { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.lb-runas span { position: absolute; font-size: 18px; color: #ffe9a8; text-shadow: 0 0 8px #e0b252; opacity: 0; animation: lb-runa 7s linear infinite; font-family: serif; }
@keyframes lb-runa { 0% { opacity: 0; transform: translate(0, 0) } 15% { opacity: .85 } 85% { opacity: .6 } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) } }

/* el escenario y el libro */
.lb-mesa { position: relative; z-index: 2; margin: 2.2rem auto 0; width: min(980px, 100%, calc((100vh - 170px) * 1.42)); min-width: min(100%, 560px); perspective: 2200px; }
.lb-libro { position: relative; width: 100%; aspect-ratio: 1.42; perspective: 2600px; transition: transform .8s cubic-bezier(.3, .7, .2, 1); }
.lb-libro.lb-cerrado { transform: translateX(-25%); }
.lb-libro.lb-cerrado:hover { transform: translateX(-25%) rotateY(-10deg) rotateX(5deg); }
.lb-libro.lb-acabado { transform: translateX(25%); }
/* el lomo: una sombra en el centro cuando está abierto */
.lb-libro:not(.lb-cerrado):not(.lb-acabado)::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 22px); width: 44px; z-index: 999; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(60, 40, 15, .28) 42%, rgba(30, 18, 6, .45) 50%, rgba(60, 40, 15, .28) 58%, transparent); }
.lb-hoja { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; transform-origin: left center; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.45, .05, .25, 1); cursor: pointer; }
.lb-hoja.lb-girada { transform: rotateY(-180deg); }
.lb-cara { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.lb-cara.lb-dorso { transform: rotateY(180deg); }

/* el papel: pergamino con borde, cabecera con la marca y pie con un rombo */
.lb-pag { background: #f4e9cb; color: #2b1d0e; padding: 7% 9% 8%; display: flex; flex-direction: column;
  box-shadow: inset 0 0 0 3px #e2d2a4, inset 0 0 0 6px #f4e9cb, inset 0 0 0 8px #d4b46a, inset 0 0 60px rgba(120, 86, 40, .22); }
.lb-dorso.lb-pag { background-image: linear-gradient(270deg, rgba(0, 0, 0, .09), transparent 9%); }
.lb-frente.lb-pag { background-image: linear-gradient(90deg, rgba(0, 0, 0, .11), transparent 9%); }
.lb-cabeza { display: flex; align-items: center; gap: .45em; margin-bottom: 5%; padding-bottom: .5em; border-bottom: 1px solid #d9c592; font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; color: #a07a35; }
.lb-cabeza img { width: 1.6em; height: 1.6em; object-fit: contain; }
.lb-cabeza .lb-num { margin-left: auto; letter-spacing: .03em; text-transform: none; color: #8a7350; font-variant-numeric: tabular-nums; }
.lb-pie { margin-top: auto; text-align: center; color: #c9a45a; font-size: .7rem; padding-top: .4em; }
.lb-pag h3 { font-family: "Big Shoulders Stencil", system-ui, sans-serif; font-size: clamp(1.1rem, 2.4vw, 1.7rem); margin: 0 0 .8em; color: #4a2c0e; letter-spacing: .02em; }
.lb-pag p { margin: 0 0 .85em; font-size: clamp(.86rem, 1.5vw, 1.06rem); line-height: 1.55; }
.lb-pag .lb-gritar { font-weight: 700; letter-spacing: .04em; color: #6b3f0e; }
.lb-pag .lb-capital::first-letter { float: left; font-family: "Big Shoulders Stencil", system-ui, sans-serif; font-size: 3.1em; line-height: .9; margin: .05em .12em 0 0; padding: .05em .12em; color: #fff3c4;
  background: linear-gradient(180deg, #e0b252, #8f5f14); box-shadow: 0 0 0 2px #5a3a0a; }
.lb-pag .lb-fin { margin-top: auto; text-align: center; color: #8a7350; font-size: .8rem; letter-spacing: .3em; }

/* la foto de cada capítulo, en un marco dorado */
.lb-foto { margin: 0 0 4%; padding: 5px; background: linear-gradient(135deg, #f0cf7a, #a8741f 50%, #f0cf7a); box-shadow: 0 6px 14px rgba(60, 40, 15, .35); transform: rotate(-.8deg); }
.lb-frente .lb-foto { transform: rotate(.8deg); }
.lb-foto img { display: block; width: 100%; aspect-ratio: 16 / 8.2; object-fit: cover; border: 2px solid #3b2508; }
.lb-foto figcaption { font-size: .66rem; color: #4a2c0e; text-align: center; padding-top: 4px; font-style: italic; }
.lb-titulo { display: flex; align-items: baseline; gap: .5em; }
.lb-titulo h3 { margin-bottom: .55em; }
.lb-romano { font-family: "Big Shoulders Stencil", system-ui, sans-serif; font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1; color: #c99838; }

/* la portadilla: el emblema grande */
.lb-frontis { margin: auto 0; text-align: center; display: grid; justify-items: center; gap: .5em; }
.lb-frontis img { width: 62%; height: auto; filter: drop-shadow(0 10px 18px rgba(90, 60, 10, .45)); }
.lb-frontis b { font-family: "Big Shoulders Stencil", system-ui, sans-serif; font-size: clamp(1.4rem, 3vw, 2.2rem); letter-spacing: .12em; color: #6b4410; }
.lb-frontis span { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: #a07a35; }
.lb-frontis em { color: #6b4b20; }

/* tapa: cuero negro, marco dorado, esquinas de oro, grosor de páginas y el emblema en relieve */
.lb-tapa { background: #1a140f; color: #f0cf7a; display: grid; place-items: center; text-align: center; padding: 10%; overflow: visible;
  box-shadow: inset 0 0 0 7px #120d09, inset 0 0 0 10px #c99838, inset 0 0 0 14px #1a140f, inset 0 0 0 15px #8f6420, inset 0 0 90px rgba(0, 0, 0, .7), 6px 8px 0 -1px #efe3c4, 11px 14px 0 -3px #d9c897, 18px 22px 30px rgba(0, 0, 0, .55);
  background-image: radial-gradient(ellipse at 50% 40%, rgba(224, 178, 82, .14), transparent 60%), repeating-linear-gradient(45deg, rgba(255, 255, 255, .02) 0 4px, transparent 4px 9px); }
.lb-tapa::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(190, 130, 255, .28) 45%, rgba(255, 240, 200, .22) 50%, transparent 65%); background-size: 300% 100%; mix-blend-mode: screen; animation: lb-brillo 5s linear infinite; pointer-events: none; }
@keyframes lb-brillo { from { background-position: 150% 0 } to { background-position: -150% 0 } }
.lb-tapa-in { position: relative; z-index: 1; }
.lb-emblema { width: 58%; height: auto; margin: 0 auto 6%; display: block; filter: drop-shadow(0 6px 0 #0a0705) drop-shadow(0 0 24px rgba(224, 178, 82, .35)); }
.lb-tapa h2 { font-family: "Big Shoulders Stencil", system-ui, sans-serif; font-size: clamp(1.5rem, 4.2vw, 2.8rem); margin: 0; letter-spacing: .08em;
  background: linear-gradient(180deg, #fff3c4, #e0b252 60%, #9a6a1c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lb-tapa small { display: block; margin-top: .5rem; letter-spacing: .4em; text-transform: uppercase; font-size: .72rem; color: #c99838; }
.lb-tapa .lb-abre { margin-top: 8%; font-size: .8rem; color: #f0cf7a; opacity: .85; animation: um-latido 2.4s ease-in-out infinite; }
.lb-esq { position: absolute; width: 11%; aspect-ratio: 1; z-index: 1; background: linear-gradient(135deg, #f0cf7a, #8f6420);
  clip-path: polygon(0 0, 100% 0, 100% 22%, 22% 22%, 22% 100%, 0 100%); }
.lb-e1 { left: 4%; top: 3%; }
.lb-e2 { right: 4%; top: 3%; transform: scaleX(-1); }
.lb-e3 { left: 4%; bottom: 3%; transform: scaleY(-1); }
.lb-e4 { right: 4%; bottom: 3%; transform: scale(-1); }
.lb-contra { background: #1a140f; box-shadow: inset 0 0 0 7px #120d09, inset 0 0 0 10px #8f6420, inset 0 0 90px rgba(0, 0, 0, .7); }

/* índice */
.lb-indice { list-style: none; margin: 0; padding: 0; display: grid; gap: .05em; }
.lb-indice button { all: unset; display: flex; justify-content: space-between; gap: .5em; width: 100%; padding: .2em 0; cursor: pointer; font-size: clamp(.78rem, 1.4vw, .98rem); color: #2b1d0e; border-bottom: 1px dotted #c9b582; }
.lb-indice button:hover, .lb-indice button:focus-visible { color: #a8741f; }
.lb-indice span { color: #8a7350; font-variant-numeric: tabular-nums; }

/* mandos: flechas doradas en píxeles */
.lb-mandos { display: flex; align-items: center; justify-content: center; gap: 1.4rem; margin-top: 1.4rem; }
.lb-flecha { width: 54px; height: 40px; border: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 0; border-radius: 0; cursor: pointer; padding: 0; color: #e0b252; filter: drop-shadow(0 2px 0 #5a3008); }
.lb-flecha:hover:not(:disabled), .lb-flecha:focus-visible { color: #fff3c4; transform: translateY(-1px); }
.lb-flecha:disabled { opacity: .25; cursor: default; }
.lb-flecha svg { width: 100%; height: 100%; shape-rendering: crispEdges; }
.lb-pos { min-width: 9rem; text-align: center; font-variant-numeric: tabular-nums; color: #d9cdb2; font-size: .9rem; }
.lb-sonido { border: 1px solid #4a3c22 !important; background: #17120c !important; color: #d9cdb2 !important; border-radius: 6px; padding: .35rem .6rem; cursor: pointer; font-size: .8rem; font-family: inherit !important; text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; min-height: 0; }
.lb-ayuda { text-align: center; color: #9c8f78; font-size: .82rem; margin-top: .8rem; }
.lb-ayuda a { color: #e0b252; }
.lb-mesa::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -28px; height: 30px; background: radial-gradient(ellipse, rgba(0, 0, 0, .75), transparent 70%); z-index: -1; }

/* móvil: una sola página que gira */
@media (max-width: 760px) {
  .lb-mesa { width: min(100%, calc((100vh - 170px) * .72)); min-width: min(100%, 300px); }
  .lb-libro { aspect-ratio: .72; perspective: 1800px; }
  .lb-libro.lb-cerrado, .lb-libro.lb-acabado, .lb-libro.lb-cerrado:hover { transform: none; }
  .lb-libro::after { display: none; }
  .lb-hoja { left: 0; width: 100%; }
  .lb-hoja .lb-dorso { display: none; }
  .lb-hoja.lb-girada { transform: rotateY(-100deg); opacity: 0; transition: transform .7s cubic-bezier(.45, .05, .25, 1), opacity .25s .45s; pointer-events: none; }
  .lb-pag { padding: 8% 9% 8%; }
  .lb-pag p { font-size: .98rem; }
  .lb-tapa { box-shadow: inset 0 0 0 7px #120d09, inset 0 0 0 10px #c99838, inset 0 0 0 14px #1a140f, inset 0 0 0 15px #8f6420, inset 0 0 90px rgba(0, 0, 0, .7); }
}
@media (prefers-reduced-motion: reduce) {
  .lb-hoja, .lb-libro { transition: none; }
  .lb-runas, .lb-tapa::after { display: none; }
}
