/* El estudio del pirata: una pantalla de aventura. Pergamino para leer, objetos para pulsar, barra SCUMM abajo. */
@font-face { font-family: 'Caveat'; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/caveat-700.woff2) format('woff2'); }
:root {
  --cuarto: #120a16; --tinta: #2a180a; --tinta2: #4a2c14; --rojo: #6a1e0c; --rojo2: #8a2208; --cobre: #a0481c; --madera: #5a3a1e;
  --verbo: #b878e8; --verbo-on: #ffe060; --frase: #5ff0f0; --gris: #a39cc4; --borde2: #2a2070;
  --titulo: Georgia, 'Palatino Linotype', 'Book Antiqua', serif;
  --menu: Verdana, Tahoma, 'DejaVu Sans', sans-serif;
  --alto-scumm: 8.6rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding-bottom: calc(var(--alto-scumm) + .5rem); background: var(--cuarto); color: var(--tinta); font: 1.06rem/1.6 Georgia, 'Times New Roman', serif; }
a { color: var(--rojo2); text-underline-offset: 3px; } a:hover { color: #c03a10; }
.salto { position: absolute; left: -999px; } .salto:focus { left: 8px; top: 8px; background: #fff; color: #000; padding: .4rem .7rem; z-index: 20; }
:focus-visible { outline: 3px solid #1a6aa0; outline-offset: 2px; }

/* Pergamino y tira de menú (móvil: en flujo normal) */
.pergamino, .tira {
  background: radial-gradient(ellipse at 50% 35%, #ead2a0 0%, #dcbd86 55%, #c6a26a 100%);
  box-shadow: inset 0 0 2.4rem rgba(90, 50, 15, .5), 0 0 0 .18rem var(--madera), .3rem .4rem 0 rgba(0, 0, 0, .45);
}
.tira { position: sticky; top: .5rem; z-index: 5; display: flex; flex-wrap: wrap; gap: .1rem 1rem; align-items: center; margin: .5rem .6rem 0; padding: .45rem .9rem; font: 700 .9rem/1.4 var(--menu); }
.tira a { color: var(--tinta); text-decoration: none; padding: .1rem .2rem; } .tira a:hover, .tira a:focus-visible { color: var(--rojo2); text-decoration: underline; } .tira a[aria-current] { color: var(--rojo2); box-shadow: inset 0 -3px 0 var(--cobre); }
.tira .marca { font: italic 700 1.1rem/1.2 var(--titulo); color: var(--rojo); margin-right: auto; }
.pergamino { margin: .9rem .6rem 0; padding: 1.1rem 1.1rem 1.4rem; outline: none; scrollbar-color: #8a5a2a #dcbd86; scrollbar-width: thin; }
.punto, .vidriera, .pantalla, .silla, .loro-delante, .poste-delante, .cortina, .lomo, .hero-movil { display: none; }
.estudio { background: var(--cuarto) var(--bg, url(/img/estudio-limpio.webp)) center top / cover fixed; }
.estudio::before { content: ""; position: fixed; inset: 0; background: rgba(12, 6, 16, .72); pointer-events: none; }
.estudio > .escenario { position: relative; }

/* Escritorio: toda la pantalla es la habitación; el pergamino hace scroll por dentro */
@media (min-width: 900px) and (min-height: 520px) {
  body { height: 100vh; overflow: hidden; padding-bottom: 0; }
  .estudio { position: fixed; inset: 0 0 var(--alto-scumm) 0; display: grid; place-items: center; background: var(--cuarto); }
  .estudio::before { display: none; }
  .escenario { width: min(100vw, calc((100vh - var(--alto-scumm)) * var(--ar, 2))); aspect-ratio: var(--ar, 2); background: var(--bg, url(/img/estudio-limpio.webp)) 0 0 / 100% 100% no-repeat; container-type: size; }
  .sala-propia .escenario { background-image: var(--bg); }
  .sala-propia .tira { left: var(--tl); top: var(--tt); width: var(--tw); height: var(--th); background: none; box-shadow: none; padding: 0 2.4cqw; }
  .sala-propia .tira { gap: 0 1.3cqw; padding: 0 1.6cqw; font-size: clamp(.68rem, .9cqw, 1rem); white-space: nowrap; } .sala-propia .tira .marca { font-size: clamp(.8rem, 1.2cqw, 1.3rem); }
  .tira-propia .tira { background: radial-gradient(ellipse at 50% 35%, #ead2a0 0%, #dcbd86 55%, #c6a26a 100%); box-shadow: inset 0 0 1.2rem rgba(90, 50, 15, .45), 0 0 0 .14rem var(--madera), .25rem .3rem 0 rgba(0, 0, 0, .45); border-radius: 2px; }
  .sala-propia .pergamino { left: var(--pl); top: var(--pt); width: var(--pw); height: var(--ph); padding: 2.4cqw 3cqw calc(var(--pb, 0cqh) + .8cqw); }
  .sala-propia .texto h1 { font-size: clamp(1.4rem, 2.5cqw, 2rem); line-height: 1.1; }
  .sala-propia .entradilla { font-size: 1em; }
  .sala-propia .encabezado-juego img.portada { width: clamp(5rem, 10.5cqw, 8.4rem); }
  .sala-propia .juegos-lista .tarjetas { grid-template-columns: repeat(5, 1fr); gap: .9cqw .8cqw; margin: .4cqw 0; }
  .sala-propia .tarjetas li, .sala-propia .tarjetas li:nth-child(n) { transform: none; }
  .sala-propia .tarjetas a { padding: .5cqw; text-align: center; }
  .sala-propia .tarjetas img.portada { float: none; width: 100%; margin: 0 0 .4cqw; }
  .sala-propia .tarjetas span, .sala-propia .tarjetas em { display: none; }
  .sala-propia .tarjetas strong { margin: 0; font-size: .72em; line-height: 1.15; }
  .sala-propia .tarjetas.solo-movil { display: none; }
  .bienvenida .turno { max-width: 90%; font-size: .94em; margin: .5cqw 0; }
  .sala-propia .heroe { padding: 0; } .sala-propia .heroe h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sala-propia .heroe .lema { margin: 0 0 .5cqw; font-size: .92em; text-align: center; }
  .sala-propia .texto.ancho h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sala-propia .texto.ancho .entradilla { display: none; }
  .sala-propia .punto, .sala-propia .vidriera, .sala-propia .pantalla, .sala-propia .cortina, .sala-propia .poste-delante, .sala-propia .loro-delante, .sala-propia .silla { display: none; }
  .sala-fg { position: absolute; z-index: 5; left: var(--pl); top: var(--pt); width: var(--pw); height: var(--ph); pointer-events: none; background: no-repeat 0 0 / 100% 100%; }
  .punto { display: block; position: absolute; z-index: 4; border-radius: 3px; }
  .punto:hover { background: rgba(255, 224, 96, .1); box-shadow: inset 0 0 0 2px rgba(255, 224, 96, .55); }
  .punto.apagado { cursor: not-allowed; }
  .tira { position: absolute; z-index: 3; left: 31.7%; top: 12.1%; width: 46.2%; height: 8.2%; margin: 0; padding: 0 2cqw; flex-wrap: nowrap; gap: 0 1.6cqw; font-size: clamp(.78rem, 1cqw, 1.05rem); }
  .tira .marca { font-size: clamp(.95rem, 1.35cqw, 1.45rem); }
  .pergamino { position: absolute; z-index: 3; left: 33.3%; top: 25.7%; width: 42%; height: 53.5%; margin: 0; padding: .6cqw 1.2cqw .6cqw .4cqw; overflow-y: auto; background: none; box-shadow: none; font-size: clamp(.86rem, 1cqw, 1.14rem); }
  .vidriera, .pantalla, .silla, .loro-delante, .poste-delante, .cortina { display: block; }
  .cortina { position: absolute; z-index: 3; left: 77.80%; top: 0; width: 22.20%; height: 72.15%; pointer-events: none; background: url(/img/cortina.png) 0 0 / 100% 100% no-repeat; }
  .poste-delante { position: absolute; z-index: 4; left: 78.07%; top: 62.57%; width: 1.24%; height: 9.58%; pointer-events: none; background: url(/img/estudio-limpio.webp) 79.05% 69.2% / 8063% 1043.5% no-repeat; }
  .loro-delante { position: absolute; z-index: 4; left: 75.54%; top: 45.66%; width: 7.05%; height: 25.37%; pointer-events: none; background: url(/img/estudio-limpio.webp) 81.26% 61.18% / 1419.2% 394.2% no-repeat; clip-path: polygon(4.8% 11.6%, 8.0% 5.3%, 17.6% 2.7%, 36.0% 1.3%, 49.6% 5.3%, 57.6% 16.0%, 68.8% 25.8%, 80.0% 36.4%, 86.4% 46.2%, 89.6% 55.6%, 94.4% 66.7%, 97.6% 84.4%, 96.0% 96.9%, 88.0% 99.6%, 80.0% 87.1%, 70.4% 71.1%, 56.0% 65.8%, 48.0% 67.6%, 16.0% 67.6%, 6.4% 65.8%, 6.4% 58.7%, 17.6% 56.9%, 32.0% 56.4%, 24.0% 49.8%, 17.6% 40.9%, 19.2% 32.0%, 27.2% 24.9%, 32.0% 22.2%, 24.0% 20.4%, 6.4% 20.4%); }
  .silla { position: absolute; z-index: 4; left: 32.42%; top: 65.95%; width: 18.6%; height: 13.53%; pointer-events: none; background: url(/img/estudio-limpio.webp) 39.82% 76.27% / 537.58% 739.17% no-repeat; -webkit-mask: url(/img/silla-mascara.png) 0 0 / 100% 100% no-repeat; mask: url(/img/silla-mascara.png) 0 0 / 100% 100% no-repeat; }
  .vidriera { position: absolute; z-index: 2; left: 77.80%; top: 0; width: 22.20%; height: 72.15%; pointer-events: none; }
  .vidriera img, .pantalla img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .pantalla { position: absolute; z-index: 2; left: 14.32%; top: 53.66%; width: 7.38%; height: 13.64%; pointer-events: none; overflow: hidden; border-radius: 6% / 6%; }
  .term { padding: 6% 7%; height: 100%; font: 700 .52cqw/1.3 'Courier New', Courier, monospace; color: #b8e8ff; text-shadow: 0 0 .4cqw #4fb4ff; background: repeating-linear-gradient(0deg, rgba(0,0,20,.18) 0 1px, transparent 1px 3px); overflow: hidden; }
  .term p { margin: 0 0 .5em; } .term .gran { font-size: 1.5em; line-height: 1.15; color: #fff; word-break: break-word; }
  .term .cursor { animation: parpadeo 1s steps(1) infinite; }
  @keyframes parpadeo { 50% { opacity: 0; } }
}

@view-transition { navigation: auto; }

.txt-pc { display: none; }
@media (min-width: 900px) and (min-height: 520px) { .txt-pc { display: inline; } .txt-movil { display: none; } }

/* Contenido sobre pergamino */
.heroe { text-align: center; padding: .2rem 0 .4rem; }
.heroe h1 { margin: 0; font: italic 700 clamp(1.9rem, 5.4cqw, 3.6rem)/1.05 var(--titulo); color: var(--rojo); text-shadow: 1px 2px 0 rgba(255, 240, 200, .7); }
@media (max-width: 899px) { .heroe h1 { font-size: 2.1rem; } }
.lema { margin: .5rem auto; max-width: 34rem; color: var(--tinta2); font-size: 1.12em; font-style: italic; }
.bloque { margin-top: 1.8rem; }
h2, .texto h2 { font: italic 700 1.45em/1.2 var(--titulo); color: var(--rojo); }
.tarjetas { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.tarjetas a { display: block; height: 100%; padding: .75rem .9rem; text-decoration: none; color: var(--tinta); background: rgba(255, 244, 214, .38); border: 2px solid var(--madera); border-radius: 3px; box-shadow: .2rem .25rem 0 rgba(90, 50, 15, .35); }
.tarjetas a:hover, .tarjetas a:focus-visible { background: rgba(255, 244, 214, .72); transform: translate(-1px, -1px); }
.tarjetas strong { display: block; font: italic 700 1.1em/1.2 var(--titulo); color: var(--rojo); }
.tarjetas span { display: block; margin: .2rem 0 .35rem; color: var(--cobre); font: 700 .72em var(--menu); }
.tarjetas em { font-style: normal; color: var(--tinta2); font-size: .95em; }
.dialogo .turno { margin: .6rem 0; padding: .5rem .85rem; max-width: 86%; background: rgba(255, 248, 224, .45); border: 2px solid var(--madera); border-radius: 14px 14px 14px 3px; }
.dialogo .turno.tu { margin-left: auto; background: rgba(170, 100, 40, .2); border-radius: 14px 14px 3px 14px; }
.dialogo .turno b { color: var(--rojo); }
@media (max-width: 899px) { .dialogo .turno { max-width: 96%; } }

.texto { max-width: 46rem; margin: 0 auto; } .texto.ancho { max-width: none; }
.texto h1 { margin: .1rem 0 .4rem; font: italic 700 clamp(1.7rem, 3.4cqw, 2.6rem)/1.1 var(--titulo); color: var(--rojo); }
@media (max-width: 899px) { .texto h1 { font-size: 1.9rem; } }
.entradilla { font-size: 1.12em; color: var(--tinta2); border-left: 4px solid var(--cobre); padding-left: .85rem; }
.migas { margin: 0; font: .78em var(--menu); color: var(--tinta2); } .migas a { color: var(--rojo2); }
.ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; margin: 1rem 0; padding: .7rem; background: rgba(120, 70, 20, .12); border: 2px solid var(--madera); }
.ficha dt { font: 700 .66em var(--menu); text-transform: uppercase; color: var(--cobre); } .ficha dd { margin: 0; font-weight: 700; }
.cuerpo h2 { margin-top: 1.6rem; } .cuerpo blockquote { margin: 1rem 0; padding: .5rem .9rem; background: rgba(90, 50, 15, .09); border-left: 4px solid var(--cobre); font-style: italic; }
.paginas { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font: 700 .85em var(--menu); }
.noticias { list-style: none; padding: 0; margin: 1rem 0; } .noticias li { padding: .55rem 0; border-bottom: 1px dashed #8a6a3a; } .noticias a { font-weight: 700; } .noticias .resumen { display: block; margin-top: .25rem; font-size: .95em; color: var(--tinta); } .noticias .meta { display: block; margin-top: .15rem; font: .75em var(--menu); color: var(--tinta2); }
.nota-pie { font: .78em/1.4 var(--menu); color: var(--tinta2); } .comunidad { padding-left: 1.2rem; } .comunidad li { margin: .35rem 0; }
.noticias-ficha { margin-top: 2rem; }
.videos { margin: 1.2rem 0; } .trailer { margin: 0 0 1.2rem; }
.trailer-caja { position: relative; aspect-ratio: 16 / 9; background: radial-gradient(ellipse at 50% 40%, #3a2410, #120a06); border: 2px solid var(--madera); box-shadow: .2rem .25rem 0 rgba(90, 50, 15, .4); overflow: hidden; }
.trailer-caja iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trailer-boton { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; color: #ffe9a6; text-decoration: none; font: 700 1.05rem/1.2 var(--menu); text-shadow: 1px 1px 0 #000; }
.trailer-boton .play { display: grid; place-items: center; width: 4rem; height: 4rem; padding-left: .3rem; border-radius: 50%; background: rgba(200, 60, 30, .92); border: .2rem solid #ffe9a6; font-size: 1.6rem; color: #fff; box-shadow: 0 0 1.2rem rgba(255, 190, 60, .5); transition: transform .12s; }
.trailer-boton:hover .play, .trailer-boton:focus-visible .play { transform: scale(1.1); }
.trailer figcaption { margin-top: .5rem; font: .78em/1.4 var(--menu); color: var(--tinta2); }
.indice ol { margin: .5rem 0 0; padding-left: 1.3rem; columns: 2; column-gap: 2rem; } .indice li { break-inside: avoid; margin: .15rem 0; }
@media (max-width: 899px) { .indice ol { columns: 1; } }
.cuerpo h3 { font: italic 700 1.15em/1.2 var(--titulo); color: var(--rojo); margin: 1.2rem 0 .3rem; }
.cuerpo ul, .cuerpo ol { padding-left: 1.3rem; } .cuerpo li { margin: .35rem 0; }
.cuerpo h2[id] { scroll-margin-top: 4rem; }
.indice { background: rgba(255, 244, 214, .3); border: 2px solid var(--madera); padding: .5rem .9rem; margin: 1rem 0; } .indice summary { cursor: pointer; font: 700 .85em var(--menu); color: var(--rojo); }
.pie { margin-top: 2.2rem; padding-top: .8rem; border-top: 2px dashed #8a6a3a; color: var(--tinta2); font-size: .82em; } .pie p { margin: .4rem 0; }

/* Portadas (carátulas) */
img.portada { display: block; height: auto; border: 2px solid var(--madera); box-shadow: .2rem .25rem 0 rgba(90, 50, 15, .4); background: #2a180a; }
.tarjetas img.portada { float: left; width: 4.6rem; margin: 0 .8rem .3rem 0; }
.tarjetas a::after { content: ""; display: block; clear: both; }
.encabezado-juego { display: flex; gap: 1.1rem; align-items: stretch; }
.encabezado-juego > div { display: flex; flex-direction: column; min-width: 0; }
.encabezado-juego .entradilla { flex: 1 1 auto; margin: .4rem 0 0; }
.encabezado-juego img.portada { align-self: flex-start; }
.encabezado-juego img.portada { flex: 0 0 auto; width: clamp(5.5rem, 14cqw, 11rem); margin-top: .4rem; }
@media (max-width: 899px) { .encabezado-juego { gap: .8rem; } .encabezado-juego h1 { font-size: 1.55rem; margin-top: 0; } .encabezado-juego .entradilla { font-size: .98em; margin: .3rem 0 0; padding-left: .65rem; } }
@media (max-width: 899px) { .encabezado-juego img.portada { width: 8.2rem; margin-top: .2rem; } .encabezado-juego { gap: .9rem; } .encabezado-juego .entradilla { font-size: .94em; } }
@media (max-width: 380px) { .encabezado-juego img.portada { width: 7.2rem; } }

/* La balda de abajo: un lomo por juego, clicable. Crece sola con cada ficha nueva */
.scumm { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: .3rem 1rem 0; background: linear-gradient(#2a1608, #1a0c06 70%); border-top: .28rem solid #6a3c1c; box-shadow: 0 -.2rem 0 #1a0c06, inset 0 .25rem 0 rgba(255, 200, 120, .12); }
.frase { margin: 0 auto .25rem; max-width: 72rem; text-align: center; font: 700 .85rem/1.2 var(--menu); color: #ffe9a6; min-height: 1.2em; text-shadow: 1px 1px 0 #000; }
.libros { list-style: none; margin: 0 auto; padding: .3rem .8rem .4rem; max-width: 72rem; display: flex; align-items: flex-end; justify-content: center; gap: .6rem; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.libros li { flex: 0 0 auto; scroll-snap-align: start; }
.libro { position: relative; display: block; width: 4.4rem; height: 5.9rem; border-radius: .2rem; text-decoration: none; background: #2a1608; box-shadow: .12rem .18rem 0 rgba(0,0,0,.55); transition: transform .12s; }
.libro span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.libro .mini { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: .2rem; border: 2px solid #6a3c1c; }
.libro:hover, .libro:focus-visible { transform: translateY(-.35rem); outline: none; box-shadow: 0 0 .7rem rgba(255, 210, 90, .85); }
.libro[aria-current] { box-shadow: 0 0 0 .14rem #ffd870, 0 0 .6rem rgba(255, 210, 90, .8); transform: translateY(-.35rem); }
.scumm :focus-visible { outline-color: #ffd870; }
/* Móvil / pantallas bajas: cabecera con la habitación, menú en una fila y balda de carátulas con scroll horizontal */
@media (max-width: 899px), (max-height: 519px) {
  :root { --alto-scumm: 6.6rem; }
  .libros { justify-content: flex-start; gap: .55rem; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .libro { width: 3.5rem; height: 4.7rem; }
  .libro:hover, .libro:focus-visible, .libro[aria-current] { transform: translateY(-.2rem); }
  .escenario { display: flex; flex-direction: column; }
  .hero-movil { order: 1; display: block; position: relative; container-type: inline-size; aspect-ratio: var(--ar, 1.7768); background: center / 100% 100% no-repeat; border-bottom: .22rem solid #1a0c06; box-shadow: 0 .25rem 0 rgba(0,0,0,.4); }
  .hero-movil span { position: absolute; left: var(--pl, 33%); top: var(--pt, 19%); width: var(--pw, 44%); height: calc(var(--ph, 48%) - 3%); display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 4%; font: 700 clamp(1.5rem, 11cqw, 3.2rem)/.92 'Caveat', 'Segoe Script', 'Bradley Hand', cursive; color: #3e1204; -webkit-text-stroke: .04em #3e1204; text-shadow: 1px 1px 0 rgba(255, 240, 200, .9); overflow: hidden; text-wrap: balance; }
  .hero-movil span.medio { font-size: clamp(1.3rem, 9.2cqw, 2.8rem); }
  .hero-movil span.largo { font-size: clamp(1.1rem, 7.4cqw, 2.3rem); }
  .hero-movil span.xl { font-size: clamp(1rem, 6.3cqw, 2rem); }
  .texto h1, .heroe h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
  .encabezado-juego h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
  .encabezado-juego img.portada { margin-top: .3rem; }
  .tira { order: 0; position: sticky; top: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-radius: 0; font-size: .76rem; text-align: center; box-shadow: 0 .2rem 0 rgba(0,0,0,.5); }
  .tira .marca { display: none; }
  .tira a { padding: .75rem .3rem; border-right: 1px solid rgba(90, 50, 15, .3); } .tira a:last-child { border-right: 0; }
  .tira a[aria-current] { box-shadow: inset 0 -.28rem 0 var(--cobre); background: rgba(255, 240, 200, .35); }
  .pergamino { order: 2; margin: .8rem .6rem 0; }
  .frase { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
