/* Alegreya, Alegreya Sans y Kalam (licencia SIL Open Font), alojadas en la propia web */
@font-face {
  font-family: 'Alegreya';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fuentes/alegreya-400i-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alegreya';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fuentes/alegreya-400i-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alegreya';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/alegreya-700i-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alegreya';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/alegreya-700i-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fuentes/alegreya-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fuentes/alegreya-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/alegreya-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/alegreya-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fuentes/alegreya-sans-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fuentes/alegreya-sans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fuentes/alegreya-sans-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fuentes/alegreya-sans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/alegreya-sans-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/alegreya-sans-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kalam';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/kalam-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Kalam';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fuentes/kalam-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Los Anales de Arda. La misma hoja verdosa, el menú amarillo con letras azules y los rótulos
   rojos del mapa de siempre, ahora adaptados a cualquier pantalla. */
:root {
  color-scheme: light;
  --hoja: #e6efc6;          /* color de fondo bajo la textura original */
  --menu: #f0f6b0;          /* amarillo del menú desplegable original */
  --azul: #0a5cc9;          /* azul del menú */
  --azul-titulo: #1432d2;   /* azul de los títulos */
  --rojo: #cc3300;          /* rojo de los rótulos y avisos */
  --tinta: #1c2415;
  --tinta-suave: #4c5a3f;
  --enlace: #0058b8;
  --verde: #3d8b3d;         /* borde verde del menú */
  --globo: #f1ec8c;         /* amarillo de las explicaciones del mapa */
  --papel: rgba(255, 255, 240, .55);
  --campo: #fffff4;         /* fondo de las cajas de texto */
  --velo: none;
  --f-texto: "Alegreya", Georgia, "Times New Roman", serif;
  --f-ui: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --f-rotulo: "Kalam", "Comic Sans MS", cursive;
  --ancho: 60rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--hoja); background-image: var(--velo), url(fondo.jpg); color: var(--tinta); font-family: var(--f-texto);
  font-size: 1.14rem; line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: var(--enlace); text-underline-offset: .15em; }
a:hover { color: var(--rojo); }
:focus-visible { outline: 3px solid var(--rojo); outline-offset: 2px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.salto { position: absolute; left: -999px; top: 0; background: var(--menu); padding: .5rem 1rem; z-index: 100; }
.salto:focus { left: 0; }

/* ---------- cabecera y menú ---------- */
.cabecera { position: relative; z-index: 20; }
.cab-fila { max-width: 88rem; margin: 0 auto; padding: .5rem 1rem; display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; }
.marca { font-family: var(--f-rotulo); font-size: clamp(1.5rem, 4vw, 2.1rem); color: var(--rojo); text-decoration: none;
  line-height: 1.1; margin-right: auto; text-shadow: 0 1px 0 #fff8; }
.marca:hover { color: var(--azul-titulo); }
body.portada .marca { visibility: hidden; height: 0; overflow: hidden; }
.busca { display: flex; min-width: 0; flex: 0 1 19rem; }
.busca input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: .35rem .7rem; border: 1px solid var(--verde); border-right: 0;
  border-radius: 999px 0 0 999px; background: var(--campo); color: var(--tinta); }
.busca button { border: 1px solid var(--verde); background: var(--menu); color: var(--azul); border-radius: 0 999px 999px 0;
  padding: 0 .8rem 0 .6rem; cursor: pointer; display: grid; place-items: center; }
.busca button:hover { background: var(--azul); color: var(--menu); }
.tema { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--verde); background: var(--menu); color: var(--azul); cursor: pointer; padding: 0; }
.tema:hover { background: var(--azul); color: var(--menu); }
.hamb { display: none; font: inherit; font-weight: 700; background: var(--menu); color: var(--azul); border: 1px solid var(--verde);
  border-radius: 6px; padding: .35rem .8rem; cursor: pointer; }
.menu { background: var(--menu); border-block: 1px solid var(--verde); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a, .menu li > span { display: block; color: var(--azul); font-weight: 700; text-decoration: none; padding: .4rem .7rem; font-size: .95rem; line-height: 1.25; }
.menu a:hover, .menu a:focus-visible { background: var(--azul); color: var(--menu); outline: none; }
.menu .abre { display: none; }

@media (min-width: 62.01rem) {
  .nivel1 { display: flex; flex-wrap: wrap; justify-content: center; max-width: 88rem; margin: 0 auto; }
  .nivel1 > li { position: relative; border-right: 1px solid var(--verde); }
  .nivel1 > li:first-child { border-left: 1px solid var(--verde); }
  .nivel1 > li > a { padding: .45rem .8rem; }
  .nivel1 > li.actual > a { box-shadow: inset 0 -3px 0 var(--rojo); }
  .menu li ul { display: none; position: absolute; left: -1px; top: 100%; min-width: 13rem; width: max-content; max-width: 19rem;
    background: var(--menu); border: 1px solid var(--verde); box-shadow: 2px 3px 8px rgba(40, 60, 20, .25); z-index: 30; }
  .menu li ul li { position: relative; border-top: 1px solid rgba(61, 139, 61, .45); }
  .menu li ul li:first-child { border-top: 0; }
  .menu li ul ul { left: 100%; top: -1px; }
  .menu li:hover > ul, .menu li:focus-within > ul, .menu li.toque > ul { display: block; }
  .menu li ul .con-sub > a, .menu li ul .con-sub > span { padding-right: 1.6rem; }
  .menu li ul .con-sub > a::after, .menu li ul .con-sub > span::after { content: "▸"; position: absolute; right: .55rem; }
  .menu li ul .con-sub:hover > a, .menu li ul .con-sub:hover > span { background: var(--azul); color: var(--menu); }
  /* los últimos menús se abren hacia la izquierda para no salirse */
  .nivel1 > li:nth-last-child(-n+4) > ul { left: auto; right: -1px; }
  .nivel1 > li:nth-last-child(-n+5) ul ul { left: auto; right: 100%; }
}
@media (max-width: 62rem) {
  .hamb { display: block; }
  .busca { order: 3; flex: 1 1 100%; }
  body.portada .busca { order: 0; flex: 1 1 10rem; }
  .menu { display: none; }
  .menu.abierto { display: block; }
  .menu li { position: relative; border-top: 1px solid rgba(61, 139, 61, .45); }
  .menu a, .menu li > span { padding: .7rem 3.4rem .7rem 1rem; font-size: 1.05rem; }
  .menu li ul { display: none; background: rgba(255, 255, 255, .45); }
  .menu li ul a, .menu li ul li > span { padding-left: 2rem; }
  .menu li ul ul a { padding-left: 3rem; }
  .menu li.abierto > ul { display: block; }
  .menu .abre { display: block; position: absolute; right: 0; top: 0; width: 3.2rem; height: 2.75rem; border: 0; border-left: 1px solid rgba(61, 139, 61, .45);
    background: transparent; cursor: pointer; }
  .menu .abre::before { content: "▾"; color: var(--azul); font-size: 1.2rem; }
  .menu li.abierto > .abre::before { content: "▴"; }
}

/* ---------- contenido ---------- */
main { max-width: var(--ancho); margin: 0 auto; padding: 1rem 1rem 3rem; }
body.portada main { max-width: 88rem; padding-top: .5rem; }
.migas ol { list-style: none; margin: .25rem 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .4rem; font-size: .92rem; color: var(--tinta-suave); }
.migas li + li::before { content: "›"; margin-right: .4rem; color: var(--tinta-suave); }
h1, h2, h3, h4 { color: var(--azul-titulo); line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); margin: .2rem 0 1.2rem; text-align: center; }
h2 { font-size: 1.55rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1.25rem; margin: 1.6rem 0 .5rem; }
h4 { font-size: 1.08rem; margin: 1.3rem 0 .4rem; }
.texto { overflow-wrap: break-word; }
.texto::after { content: ""; display: block; clear: both; }
.texto p { margin: 0 0 .9em; }
.texto hr { border: 0; border-top: 2px solid var(--verde); opacity: .55; margin: 1.6rem 0; }
.texto ul, .texto ol { padding-left: 1.5rem; }
.texto li { margin: .2rem 0; }
.texto blockquote { margin: 1rem 0 1rem 1.2rem; padding-left: 1rem; border-left: 3px solid var(--verde); }
.texto pre { white-space: pre-wrap; font-family: var(--f-texto); }
.t7 { font-size: 2.3rem; line-height: 1.2; } .t6 { font-size: 1.9rem; line-height: 1.2; } .t5 { font-size: 1.5rem; line-height: 1.25; }
.t4 { font-size: 1.22rem; } .t1 { font-size: .86rem; }
.a-center { text-align: center; } .a-right { text-align: right; } .a-just { text-align: justify; }
.f-izq { float: left; margin: .2rem 1.1rem .6rem 0; } .f-der { float: right; margin: .2rem 0 .6rem 1.1rem; }
.cols { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin: 1rem 0; align-items: flex-start; }
.cols > div { flex: 1 1 14rem; min-width: 0; }
.tabla { overflow-x: auto; margin: 1rem 0; max-width: 100%; }
.tabla table { border-collapse: collapse; }
.tabla td, .tabla th { padding: .3rem .55rem; vertical-align: top; }
table.borde, table.borde td, table.borde th { border: 1px solid #7d9a62; }
.aviso { background: var(--globo); border: 1px solid #b9b23c; padding: .8rem 1rem; border-radius: 6px; }
.oir { font: inherit; font-size: .8rem; line-height: 1; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1px solid var(--verde);
  background: var(--menu); color: var(--azul); cursor: pointer; margin-right: .35rem; vertical-align: middle; }
.oir:hover { background: var(--azul); color: var(--menu); }
@media (max-width: 40rem) { .f-izq, .f-der { float: none; display: block; margin: .6rem auto; } }

/* ---------- pie ---------- */
.pie { border-top: 1px solid var(--verde); background: var(--menu); text-align: center; padding: 1rem 1rem 1.4rem; font-size: .95rem; }
.pie p { margin: .3rem 0; }

/* ---------- portada: el mapa ---------- */
.mapa-sec { margin: 0 auto; max-width: 1400px; }
.mapa { position: relative; line-height: 0; border: 1px solid #6f8f5a; border-radius: 8px; box-shadow: 0 4px 18px rgba(40, 60, 20, .28); }
.mapa > img { display: block; width: 100%; height: auto; border-radius: 7px; }
.titulo-mapa { position: absolute; left: 64.5%; top: 5.6%; transform: translate(-50%, -50%); margin: 0; white-space: nowrap; z-index: 2;
  font-family: var(--f-rotulo); font-weight: 700; color: #d92b0b; font-size: clamp(1.25rem, 4.5vw, 4.1rem); line-height: 1;
  text-shadow: 0 0 .12em #fff9c9, 0 0 .3em #f4f0a0, .03em .04em 0 rgba(90, 30, 0, .35); }
.rotulo { position: absolute; transform: translate(-50%, -50%); font-family: var(--f-rotulo); font-weight: 700; color: #d92b0b;
  font-size: clamp(.8rem, 2.05vw, 1.85rem); line-height: 1; text-decoration: none; white-space: nowrap; padding: .28em .4em; border-radius: 999px;
  text-shadow: 0 0 .15em #fffbd0, 0 0 .35em #f6f2a8, 0 0 .5em #f6f2a8; transition: transform .12s; z-index: 2; }
.rotulo:hover, .rotulo:focus-visible { color: #1432d2; background: rgba(255, 253, 208, .75); transform: translate(-50%, -50%) scale(1.12); z-index: 6; outline: none;
  box-shadow: 0 0 0 2px #d92b0b; }
.globo { display: none; position: absolute; top: calc(100% + .45rem); left: 50%; transform: translateX(-50%); width: min(17rem, 62vw);
  background: var(--globo); border: 1px solid #1c2415; color: #0b3bd0; font-family: var(--f-texto); font-weight: 400; font-size: .92rem; line-height: 1.35;
  white-space: normal; text-align: center; padding: .5rem .65rem; text-shadow: none; border-radius: 4px; box-shadow: 2px 3px 8px rgba(0, 0, 0, .25); }
.rotulo:hover .globo, .rotulo:focus-visible .globo { display: block; }
.r-relatos .globo, .r-curioso .globo, .r-peliculas .globo, .r-juegosderol .globo { left: auto; right: 0; transform: none; }
.r-cambios .globo, .r-tolkien .globo, .r-buscar .globo, .r-firmar .globo { left: 0; transform: none; }
.r-peliculas .globo, .r-enciclopedia .globo, .r-cambios .globo, .r-firmar .globo, .r-util .globo { top: auto; bottom: calc(100% + .45rem); }
/* Mapa de John Howe: lleva topónimos impresos, así que los rótulos van sobre una placa clara */
.titulo-mapa { left: 24%; top: 6.5%; font-size: clamp(1.1rem, 3.6vw, 3.3rem); text-shadow: 0 0 6px #fffbd0, 0 0 14px #fffbd0, 0 0 22px #fffbd0, 0 1px 0 #fff; }
.rotulo { text-shadow: none; }
.rotulo .nombre { display: inline-block; background: rgba(255, 251, 214, .9); border: 1px solid #b9a25a; border-radius: .35em; padding: .12em .5em .05em;
  box-shadow: 0 1px 4px rgba(60, 50, 10, .45); line-height: 1.15; }
.rotulo:hover, .rotulo:focus-visible { background: none; box-shadow: none; }
.rotulo:hover .nombre, .rotulo:focus-visible .nombre { background: #fffdd0; border-color: #1432d2; box-shadow: 0 0 0 2px #d92b0b; }
.lema { text-align: center; color: var(--rojo); margin: 1rem auto .5rem; max-width: 60rem; }
.lema .paz { display: block; font-size: 1.3rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; margin-top: .3rem; text-decoration: none; }
.intro, .secciones, .otras { max-width: 64rem; margin: 1.2rem auto 0; }
.secciones ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .8rem 1.5rem; }
.secciones li { background: var(--papel); border: 1px solid rgba(61, 139, 61, .5); border-radius: 8px; padding: .7rem .9rem; }
.secciones li a { font-weight: 700; font-size: 1.15rem; }
.secciones li p { margin: .25rem 0 0; font-size: .97rem; line-height: 1.4; }
.bolas { list-style: none; padding: 0; }
.bolas li { background: url(bola.gif) no-repeat 0 .35em; padding-left: 1.5rem; margin: .5rem 0; }

/* ---------- libro de visitas ---------- */
.libro-form { background: var(--papel); border: 1px solid rgba(61, 139, 61, .6); border-radius: 8px; padding: 1rem 1.1rem; display: grid; gap: .8rem; max-width: 40rem; }
.libro-form label { display: grid; gap: .2rem; font-weight: 700; }
.libro-form input, .libro-form textarea { font: inherit; padding: .45rem .6rem; border: 1px solid var(--verde); border-radius: 5px; background: var(--campo); color: var(--tinta); width: 100%; }
.libro-form .trampa { position: absolute; left: -5000px; }
.libro-form button { font: inherit; font-weight: 700; justify-self: start; background: var(--azul); color: #fffde0; border: 0; border-radius: 6px; padding: .55rem 1.2rem; cursor: pointer; }
.libro-form button:hover { background: var(--rojo); }
.libro-form small { font-weight: 400; color: var(--tinta-suave); }
.firmas { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .8rem; }
.firmas li { background: var(--papel); border-left: 4px solid var(--verde); padding: .6rem .9rem; border-radius: 0 6px 6px 0; }
.firmas .quien { font-weight: 700; color: var(--azul-titulo); }
.firmas .cuando { color: var(--tinta-suave); font-size: .9rem; }
.firmas p { margin: .3rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.error { color: #a31500; font-weight: 700; }
.paginas { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- buscador (Pagefind) ---------- */
#buscador { --pagefind-ui-primary: #0a5cc9; --pagefind-ui-text: #1c2415; --pagefind-ui-background: #fffff4; --pagefind-ui-border: #3d8b3d;
  --pagefind-ui-tag: #f0f6b0; --pagefind-ui-border-width: 1px; --pagefind-ui-border-radius: 8px; --pagefind-ui-font: "Alegreya Sans", "Segoe UI", sans-serif; }
#buscador mark { background: var(--globo); color: inherit; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .cabecera, .pie, .migas { display: none; } body { background: #fff; } }

/* letra sin remates para menú, buscador, migas, pie y formularios */
.menu, .busca input, .hamb, .migas, .pie, .libro-form, .firmas .cuando, .paginas, .oir, .salto { font-family: var(--f-ui); }
.menu a, .menu li > span { font-size: 1rem; }
.libro-form input, .libro-form textarea, .libro-form button { font-family: var(--f-ui); }
.secciones li p, .globo { font-family: var(--f-ui); }

/* ---------- modo oscuro (opcional, con el botón de la luna) ---------- */
:root[data-tema="oscuro"] { color-scheme: dark; --hoja: #141a0e; --menu: #26311a; --azul: #a8cbff; --azul-titulo: #b3c0ff; --rojo: #ff9d7c;
  --tinta: #e6ead9; --tinta-suave: #adb89c; --enlace: #93c3ff; --verde: #5d8a50; --globo: #3b3a17; --papel: rgba(255, 255, 240, .07); --campo: #1d2614;
  --velo: linear-gradient(rgba(17, 23, 11, .94), rgba(17, 23, 11, .94)); }
:root[data-tema="oscuro"] .texto [style^="color:"] { filter: invert(1) hue-rotate(180deg); }
:root[data-tema="oscuro"] .texto [style^="color:"] img { filter: invert(1) hue-rotate(180deg); }
:root[data-tema="oscuro"] .texto [style*="background-color"] { color: #1c2415; }
:root[data-tema="oscuro"] .texto [style*="background-color"] a { color: #0a3f8f; }
:root[data-tema="oscuro"] .aviso, :root[data-tema="oscuro"] .globo { color: #f1ecc0; border-color: #8c8640; }
:root[data-tema="oscuro"] table.borde, :root[data-tema="oscuro"] table.borde td, :root[data-tema="oscuro"] table.borde th { border-color: #4f6b43; }
:root[data-tema="oscuro"] #buscador { --pagefind-ui-primary: #a8cbff; --pagefind-ui-text: #e6ead9; --pagefind-ui-background: #1d2614; --pagefind-ui-border: #5d8a50; --pagefind-ui-tag: #26311a; }
:root[data-tema="oscuro"] .libro-form button { color: #101608; }

/* ---------- capítulos: anterior / índice / siguiente ---------- */
.capitulos { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem 1rem; align-items: center; font-family: var(--f-ui);
  border-block: 1px solid var(--verde); padding: .55rem 0; margin: .5rem 0 1.4rem; }
.texto + .capitulos { margin: 2rem 0 0; }
.capitulos a { text-decoration: none; line-height: 1.25; }
.capitulos small { display: block; color: var(--tinta-suave); font-size: .82rem; }
.capitulos .sig { text-align: right; }
.capitulos .ind { font-weight: 700; padding: .25rem .9rem; border: 1px solid var(--verde); border-radius: 999px; background: var(--menu); color: var(--azul); }
.capitulos .ind:hover { background: var(--azul); color: var(--menu); }
@media (max-width: 34rem) { .capitulos { grid-template-columns: 1fr 1fr; } .capitulos .ind { grid-column: 1 / -1; grid-row: 1; justify-self: center; } }

/* ---------- índice de apartados de las páginas largas ---------- */
.indice { font-family: var(--f-ui); font-size: .95rem; background: var(--papel); border: 1px solid var(--verde); border-radius: 8px; padding: .5rem .9rem; margin: 0 0 1.2rem; }
.indice summary { cursor: pointer; font-weight: 700; color: var(--azul-titulo); }
.indice ol { list-style: none; margin: .5rem 0 .2rem; padding: 0; }
.indice li { margin: .22rem 0; line-height: 1.3; }
.indice li.n3 { padding-left: 1rem; font-size: .93em; }
.indice a { text-decoration: none; }
.indice a:hover { text-decoration: underline; }
@media (min-width: 94rem) {
  .indice { position: fixed; top: 9.5rem; left: calc(50% + 31.5rem); width: 15rem; max-height: calc(100vh - 11rem); overflow: auto; margin: 0; }
}

/* ---------- Enciclopedia ---------- */
.subnav { font-family: var(--f-ui); margin: -.4rem 0 1.4rem; }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.subnav a { display: block; padding: .25rem .85rem; border: 1px solid var(--verde); border-radius: 999px; background: var(--menu); color: var(--azul); font-weight: 700; text-decoration: none; }
.subnav a:hover, .subnav a[aria-current] { background: var(--azul); color: var(--menu); }
.letras { display: flex; flex-wrap: wrap; gap: .3rem; font-family: var(--f-ui); font-weight: 700; }
.letras a { display: grid; place-items: center; min-width: 2rem; height: 2rem; border: 1px solid var(--verde); border-radius: 6px; background: var(--papel); text-decoration: none; }
.azeta { columns: 16rem 3; column-gap: 2rem; }
.azeta section { break-inside: avoid; }
.azeta h2 { margin: .8rem 0 .2rem; border-bottom: 1px solid var(--verde); }
.azeta ul { list-style: none; padding: 0; margin: 0 0 .6rem; }
.azeta small { color: var(--tinta-suave); font-family: var(--f-ui); }

/* ---------- galería y visor de imágenes ---------- */
.galeria { list-style: none; margin: 1rem 0; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .8rem; }
.galeria li { margin: 0; text-align: center; font-family: var(--f-ui); font-size: .82rem; line-height: 1.25; min-width: 0; }
.galeria a { display: block; text-decoration: none; background: var(--papel); border: 1px solid rgba(61, 139, 61, .5); border-radius: 6px; padding: .4rem .3rem .3rem; }
.galeria a:hover { border-color: var(--rojo); }
.galeria img { display: block; margin: 0 auto .3rem; max-height: 6rem; width: auto; }
.galeria span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.galeria small { color: var(--tinta-suave); }
body.galeria-pag main { max-width: 76rem; }
.visor { position: fixed; inset: 0; z-index: 200; background: rgba(10, 14, 6, .93); display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 1rem; }
.visor img { max-width: 100%; max-height: calc(100vh - 6.5rem); object-fit: contain; border: 2px solid #f0f6b0; background: #fff; }
.visor p { color: #f0f6b0; font-family: var(--f-ui); margin: .6rem 0 0; text-align: center; }
.visor p a { color: #a8cbff; }
.visor button { position: absolute; font: inherit; font-size: 1.6rem; line-height: 1; width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 1px solid #f0f6b0;
  background: rgba(20, 26, 14, .8); color: #f0f6b0; cursor: pointer; }
.visor button:hover { background: #0a5cc9; }
.visor .cerrar { top: .8rem; right: .8rem; }
.visor .previa { left: .8rem; top: 50%; transform: translateY(-50%); }
.visor .otra { right: .8rem; top: 50%; transform: translateY(-50%); }

/* ---------- enlaces a archive.org y enlaces caídos ---------- */
a.archivo::after { content: " (copia en archive.org)"; font-family: var(--f-ui); font-size: .8em; color: var(--tinta-suave); }
.caido { text-decoration: line-through dotted; text-decoration-color: var(--tinta-suave); cursor: help; }
.barras .barra { width: 14rem; padding: .3rem .4rem; }
.barras .barra span { display: block; height: .8rem; background: var(--azul); border-radius: 2px; min-width: 1px; }

/* ---------- mapa de la portada en móvil: más grande y deslizable ---------- */
.mapa-pista { display: none; }
@media (max-width: 40rem) {
  .mapa-desliza { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid #6f8f5a; }
  .mapa-desliza .mapa { width: 178%; border: 0; box-shadow: none; border-radius: 0; }
  .mapa-desliza .mapa > img { border-radius: 0; }
  .rotulo { font-size: 1.02rem; }
  .titulo-mapa { font-size: 1.9rem; }
  .r-enciclopedia, .r-peliculas, .r-juegosderol, .r-util { margin: 0; }
  .mapa-pista { display: block; text-align: center; font-family: var(--f-ui); font-size: .88rem; color: var(--tinta-suave); margin: .35rem 0 0; }
}

/* Foro */
.entrar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; font-family: var(--f-ui); }
.boton { display: inline-block; background: var(--azul); color: #fffde0; font-weight: 700; text-decoration: none; border-radius: 6px; padding: .55rem 1.2rem; }
.boton:hover { background: var(--rojo); color: #fffde0; }
:root[data-tema="oscuro"] .boton { color: #101608; }
.foros .cifras { color: var(--tinta-suave); font-family: var(--f-ui); font-size: .9rem; }
.r-foro .globo { left: 0; transform: none; }
/* Libro de visitas: campos en dos columnas y ficha de cada firma */
.libro-form .par { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; }
.firmas dl { margin: .4rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: .1rem .6rem; font-size: .95rem; }
.firmas dt { font-weight: 700; color: var(--tinta-suave); }
.firmas dd { margin: 0; overflow-wrap: anywhere; }
.correo-oculto { color: var(--tinta-suave); font-size: .9em; font-family: var(--f-ui); }
