:root {
  --ink: #2b1d2e;
  --paper: #fbf1dc;
  --paper-2: #f3e2bf;
  --accent: #e2754a;
  --accent-2: #5b6fb5;
  --glow: #fff1c9;
  --shadow: rgba(30, 14, 36, .55);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1c1322; overflow: hidden; }
body { font-family: 'VT323', monospace; color: var(--ink); font-size: 22px; }
#stage { position: fixed; inset: 0; overflow: hidden; }
#c { position: absolute; image-rendering: pixelated; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }

#tooltip {
  position: fixed; padding: 2px 10px; background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow); font-family: 'Pixelify Sans', sans-serif; font-size: 18px;
  left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .12s; white-space: nowrap; will-change: transform;
}
#tooltip.on { opacity: 1; }
#diag { position: fixed; left: 8px; top: 8px; margin: 0; padding: 6px 8px; font: 12px/1.35 ui-monospace, Consolas, monospace; color: #cfe9d3; background: rgba(10, 14, 12, .78); border-radius: 4px; pointer-events: none; z-index: 50; white-space: pre; }
#diag.mal { color: #ffd0c8; }
#hint {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); color: var(--glow);
  text-shadow: 2px 2px 0 var(--shadow); font-size: 22px; pointer-events: none; transition: opacity .4s; white-space: pre-line; text-align: center;
}
.px-btn {
  font-family: 'Pixelify Sans', sans-serif; font-size: 18px; color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--shadow); padding: 4px 14px; cursor: pointer;
}
.px-btn:hover { background: var(--glow); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow); }
#back { position: fixed; top: 18px; left: 18px; }
#plegar { position: fixed; top: 12px; right: 10px; display: none; }
/* libro 3D en el móvil en vertical: pasar página (abajo, con el número de página) */
#libroNav { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 18px; color: var(--glow); text-shadow: 2px 2px 0 var(--shadow); font-family: 'Pixelify Sans', sans-serif; font-size: 20px; }
#libroNav[hidden] { display: none; }
#libroNav .px-btn { font-size: 28px; line-height: 1; padding: 6px 20px; }
#libroNav .px-btn:disabled { opacity: .35; cursor: default; }
#libroNav span { min-width: 4.5ch; text-align: center; }
#loading {
  position: fixed; inset: 0; display: grid; place-items: center; background: #1c1322; color: var(--glow);
  font-size: 30px; transition: opacity .6s;
}

/* ------------------------------------------------ paneles */
#panel { position: fixed; animation: pop .35s steps(5) both; }
/* con `translate` (no `transform`): así la animación no pisa el centrado de cada panel (antes salían descolocados) */
@keyframes pop { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: none; } }
.card {
  background: var(--paper); border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow);
  padding: 18px 22px; max-height: 88vh; overflow: auto;
}
/* barra de desplazamiento visible, con el estilo de la web: si el contenido no cabe (Experiencia, Sobre mí en pantallas bajas) se nota que hay más */
.card { scrollbar-width: thin; scrollbar-color: #5b6bb5 #e9dcc0; }
.card::-webkit-scrollbar { width: 12px; }
.card::-webkit-scrollbar-track { background: #e9dcc0; }
.card::-webkit-scrollbar-thumb { background: #5b6bb5; border: 2px solid #e9dcc0; }
.card h2 { font-family: 'Pixelify Sans', sans-serif; font-size: 30px; margin: 0 0 10px; }
.card h3 { font-family: 'Pixelify Sans', sans-serif; font-size: 22px; margin: 11px 0 2px; }
.card p, .card li { margin: 4px 0; line-height: 1.05; }
.todo { color: #a0522d; }
.tag { display: inline-block; background: var(--paper-2); border: 2px solid var(--ink); padding: 0 6px; margin: 2px 4px 0 0; font-size: 18px; }
a { color: var(--accent-2); }

/* escritorio dentro del monitor */
.desktop {
  width: 100%; height: 100%; background: linear-gradient(#26304f, #3a2f52); padding: 3% 3%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3%; overflow: hidden; color: #f3ead6;
  font-size: clamp(12px, 1.4vw, 22px);
}
.desktop .win { background: #f3ead6; color: var(--ink); border: 2px solid #11131c; display: flex; flex-direction: column; }
.desktop .win .bar { background: var(--accent-2); color: #fff; padding: 1px 6px; font-family: 'Pixelify Sans', sans-serif; }
.desktop .win .body { padding: 4px 6px; flex: 1; overflow: hidden; }
.desktop .win .plink { display: inline-block; margin-top: 4px; color: #2b3a8c; text-decoration: underline; }
.desktop .win:hover { outline: 3px solid var(--glow); cursor: pointer; }

/* Proyectos: el VS Code de Javier (editor.js). Colores de Atom One Dark; donde el tema no dice nada, los de VS Code por defecto */
#panel.editor { overflow: hidden; background: #282C34; }
#panel.editor:not([hidden]) ~ #reloj, body.en-editor #reloj { display: none; }            /* el reloj tapaba la barra de estado */
.vsc { width: 1376px; height: 800px; transform-origin: 0 0; display: flex; flex-direction: column; overflow: hidden; background: #282C34; color: #CCCCCC;
  font: 13px 'Segoe WPC', 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: normal; -webkit-font-smoothing: antialiased; }
.vsc img, .vsc svg { display: block; flex-shrink: 0; }
.vsc button { all: unset; box-sizing: border-box; cursor: pointer; }
.vsc button:focus-visible { outline: 1px solid #528BFF; outline-offset: -1px; }
.vsc .titulo { flex: 0 0 35px; display: flex; align-items: center; background: #21252B; color: #9DA5B4; position: relative; }
.vsc .titulo .logo { width: 35px; display: grid; place-items: center; }
.vsc .menu { padding: 0 8px; line-height: 22px; border-radius: 5px; }
.vsc .menu:hover, .vsc .flecha:hover, .vsc .ventana span:hover { background: rgba(255, 255, 255, .1); }
.vsc .centro { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; }
.vsc .flecha { width: 24px; height: 22px; display: grid; place-items: center; border-radius: 5px; }
.vsc .flecha.apagada { opacity: .5; pointer-events: none; }
.vsc .buscar { width: 400px; height: 22px; box-sizing: border-box; border: 1px solid rgba(157, 165, 180, .2); border-radius: 6px; background: rgba(255, 255, 255, .05); display: flex; align-items: center; justify-content: center; gap: 6px; }
.vsc .ventana { margin-left: auto; display: flex; align-self: stretch; }
.vsc .ventana span { width: 46px; display: grid; place-items: center; }
.vsc .ventana span.x:hover { background: #e81123; }
.vsc .cuerpo { flex: 1 1 auto; min-height: 0; display: flex; }
.vsc .actividad { flex: 0 0 48px; background: #333842; display: flex; flex-direction: column; }
.vsc .actividad span { height: 48px; display: grid; place-items: center; opacity: .4; border-left: 2px solid transparent; box-sizing: border-box; padding-right: 2px; }
.vsc .actividad span.activa { opacity: 1; border-left-color: #D7DAE0; }
.vsc .actividad .abajo { margin-top: auto; }
.vsc .lateral { flex: 0 0 256px; background: #21252B; display: flex; flex-direction: column; border-right: 1px solid #181A1F; }
.vsc .lateral .cab { height: 35px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 20px; font-size: 11px; }
.vsc .accion { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; }
.vsc .accion:hover, .vsc .cerrar:hover { background: rgba(90, 93, 94, .31); }
.vsc .seccion { height: 22px; flex-shrink: 0; display: flex; align-items: center; background: #333842; font-size: 11px; font-weight: 700; }
.vsc .seccion .chev { width: 20px; display: grid; place-items: center; }
.vsc .arbol { flex: 1 1 auto; overflow: auto; }
.vsc .fila { width: 100%; height: 22px; display: flex; align-items: center; position: relative; color: #CCCCCC; white-space: nowrap; }
.vsc .fila:hover { background: rgba(44, 49, 58, .4); }
.vsc .fila.sel { background: #2C313A; color: #D7DAE0; }
.vsc .fila .chev { width: 16px; height: 22px; display: grid; place-items: center; flex-shrink: 0; }
.vsc .fila > svg { margin: 0 6px 0 2px; }
.vsc .fila.hijo { padding-left: 8px; }
.vsc .guia { position: absolute; left: 15px; top: 0; bottom: 0; width: 1px; background: #585858; opacity: 0; }   /* guías de sangría: solo al pasar el ratón por el árbol (lo de VS Code por defecto) */
.vsc .arbol:hover .guia { opacity: 1; }
.vsc .grupo { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.vsc .grupo + .grupo { border-left: 1px solid #181A1F; }
.vsc .pestanas { flex: 0 0 35px; display: flex; background: #21252B; }
.vsc .pestanas .lista { display: flex; min-width: 0; overflow: hidden; }
.vsc .pest { height: 35px; display: flex; align-items: center; box-sizing: border-box; border-right: 1px solid #181A1F; background: #21252B; color: rgba(255, 255, 255, .5); white-space: nowrap; }
.vsc .pest.activa { background: #282C34; color: #D7DAE0; }
.vsc .pest.sinfoco { color: rgba(215, 218, 224, .5); }
.vsc .pest > button, .vsc .pest .lbl { height: 100%; display: flex; align-items: center; gap: 6px; padding-left: 10px; }
.vsc .cerrar { width: 20px; height: 20px; margin: 0 4px 0 6px; display: grid; place-items: center; border-radius: 5px; visibility: hidden; }
.vsc .pest:hover .cerrar, .vsc .pest.activa .cerrar { visibility: visible; }
.vsc .acciones { margin-left: auto; display: flex; align-items: center; gap: 2px; padding: 0 8px; }
.vsc .migas { flex: 0 0 22px; display: flex; align-items: center; gap: 2px; padding-left: 14px; color: rgba(204, 204, 204, .8); }
.vsc .editor { flex: 1 1 auto; min-height: 0; display: flex; background: #282C34; }
.vsc .codigo { flex: 1 1 auto; min-width: 0; overflow: auto; font: 14px/19px Consolas, 'Courier New', monospace; }
.vsc .ln { display: flex; }
.vsc .ln.actual { background: rgba(153, 187, 255, .04); }
.vsc .ln .num { flex: 0 0 50px; text-align: right; color: #636D83; user-select: none; }
.vsc .ln.actual .num { color: #ABB2BF; }
.vsc .ln .marg { flex: 0 0 22px; position: relative; }
.vsc .cursor { position: absolute; right: -1px; top: 0; width: 2px; height: 19px; background: #528BFF; }
.vsc .ln .txt { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #ABB2BF; }
.vsc .mini { flex: 0 0 60px; position: relative; opacity: .6; }
.vsc .mini i { position: absolute; height: 2px; }
.vsc .barra { flex: 0 0 14px; box-shadow: inset 1px 0 0 rgba(127, 127, 127, .12); }
.vsc .vacio { flex: 1 1 auto; display: grid; place-items: center; }
.vsc .vacio img { filter: grayscale(1); opacity: .12; }
/* vista previa: el CSS de la vista previa de Markdown de VS Code (markdown.css) con los colores del tema */
.vsc .md { flex: 1 1 auto; min-height: 0; overflow: auto; box-sizing: border-box; background: #282C34; color: #ABB2BF; padding: 14px 26px 8px; overflow-wrap: break-word;
  font: 14px/22px -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, Ubuntu, 'Droid Sans', sans-serif; }
.vsc .md h1 { font-size: 2em; font-weight: 600; line-height: 1.25; margin: 0 0 16px; padding-bottom: .3em; border-bottom: 1px solid rgba(255, 255, 255, .18); color: inherit; font-family: inherit; }
.vsc .md p { margin: 1em 0 16px; line-height: inherit; }
.vsc .md ul { margin: 1em 0 .7em; padding-left: 40px; }
.vsc .md li { margin: 0; line-height: inherit; }
.vsc .md strong { font-weight: 600; }
.vsc .md code { font: 1em/1.357em Consolas, 'Courier New', monospace; color: #D7BA7D; background: rgba(255, 255, 255, .1); padding: 1px 3px; border-radius: 4px; }
.vsc .md a { color: #3794FF; text-decoration: none; }
.vsc .md a:hover { text-decoration: underline; }
.vsc .md img { display: block; max-width: 100%; height: auto; }
.vsc .estado { flex: 0 0 22px; display: flex; align-items: stretch; background: #21252B; color: #9DA5B4; font-size: 12px; border-top: 1px solid #181A1F; box-sizing: border-box; }
.vsc .estado .remoto { display: flex; align-items: center; padding: 0 10px; background: #16825D; }
.vsc .estado .it { display: flex; align-items: center; gap: 3px; padding: 0 5px; white-space: nowrap; }
.vsc .estado .it:hover { background: #2C313A; }
.vsc .estado .hueco { margin-left: auto; }
/* móvil: explorador y, al tocar un archivo, el archivo con dos pestañas (código / vista previa); filas más altas para el dedo */
.vsc.movil { width: 100%; height: 100%; background: #21252B; }
.vsc.movil .cab-movil { flex: 0 0 44px; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 16px; border-bottom: 1px solid #181A1F; min-width: 0; }
.vsc.movil .cab-movil .grande { flex-grow: 1; font-size: 11px; }
.vsc.movil .cab-movil .volver { width: 44px; height: 44px; margin-left: -16px; display: grid; place-items: center; }
.vsc.movil .cab-movil .tenue { color: rgba(204, 204, 204, .8); white-space: nowrap; }
.vsc.movil .cab-movil .nombre { color: #D7DAE0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vsc.movil .seccion { height: 26px; }
.vsc.movil .arbol { padding-top: 4px; }
.vsc.movil .fila { height: 40px; font-size: 14px; padding-left: 8px; }
.vsc.movil .fila.hijo { padding-left: 20px; }
.vsc.movil .fila > svg { width: 18px; height: 18px; margin: 0 8px 0 4px; }
.vsc.movil .guia { left: 23px; opacity: 1; }
.vsc.movil .pestanas-movil { flex: 0 0 40px; display: flex; }
.vsc.movil .pestanas-movil button { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border-right: 1px solid #181A1F; background: #21252B; color: rgba(255, 255, 255, .5); }
.vsc.movil .pestanas-movil button.activa { background: #282C34; color: #D7DAE0; }
.vsc.movil .pestanas-movil span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsc.movil .editor { padding-top: 4px; }
.vsc.movil .ln .num { flex-basis: 30px; }
.vsc.movil .ln .marg { flex-basis: 14px; }
.vsc.movil .ln .txt { padding-right: 14px; }
.vsc.movil .estado { flex-basis: 24px; }

/* libro abierto: dos páginas A4 (el pliego es 420 x 297), con el papel y la letra de siempre y los bordes del color de las páginas */
.book { display: grid; grid-template-columns: 1fr 1fr; width: 100%; aspect-ratio: 420 / 297; container-type: size; background: var(--paper); padding: 14px; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--shadow); }
.book .page { position: relative; background: var(--paper); padding: 18px 22px 40px; border: 2px solid #c9b48a; overflow: hidden; }
.book { position: relative; }
.book .page.medidor { position: absolute; left: 14px; top: 14px; visibility: hidden; pointer-events: none; box-sizing: border-box; }
.book .page:first-child { border-right: 4px double #c9b48a; }
.book h2 { font-family: 'Pixelify Sans', sans-serif; font-size: 30px; margin: 0 0 10px; }
.book h3 { font-family: 'Pixelify Sans', sans-serif; font-size: 22px; margin: 11px 0 2px; }
.book p, .book li { margin: 4px 0; line-height: 1.05; }
.book ul { margin: 4px 0; padding-left: 22px; }

/* menú de la pizarra */
.board-menu { font-family: 'Pixelify Sans', sans-serif; color: #1d3f8a; display: flex; flex-direction: column; justify-content: center; gap: 6%; height: 100%; padding: 8%; }
.board-menu .title { font-size: clamp(18px, 2.4vw, 40px); color: #2b1d2e; }
.board-menu button { all: unset; cursor: pointer; font-size: clamp(16px, 2vw, 34px); }
.board-menu button:hover { color: #c0392b; text-decoration: underline wavy; }

/* marcos cuando el objeto aún no tiene primer plano pintado */
#panel.monitor-frame { border: 14px solid #111219; border-bottom-width: 22px; box-shadow: 8px 8px 0 var(--shadow); background: #111219; }
#panel.board-frame { background: #f7f7f4; border: 10px solid #b9bec4; box-shadow: 8px 8px 0 var(--shadow); }
.noanim #panel { animation: none; }

/* libro: se abre */
.book { perspective: 1600px; }
.book.opening .page.right { transform-origin: left center; animation: flip .9s cubic-bezier(.3,.7,.2,1) both .1s; }
.book.opening .page.left { animation: fadein .5s both; }
@keyframes flip { from { transform: rotateY(-178deg); } to { transform: rotateY(0); } }
/* pasar página: la esquina de abajo se dobla al acercar el ratón; al pulsarla, la hoja se vuelve con texto por las dos caras (libro.js) */
.book .num { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 18px; color: #8a7a58; pointer-events: none; }
.curl { position: absolute; bottom: 0; width: 34px; height: 34px; padding: 0; border: 0; cursor: pointer; transition: width .2s, height .2s; filter: drop-shadow(-2px -2px 3px rgba(60, 40, 20, .35)); }
.curl.sig { right: 0; background: linear-gradient(to bottom right, #fffaf0 0%, #e2cf9f 49%, #bda880 50%, #bda880 100%); }
.curl.ant { left: 0; background: linear-gradient(to bottom left, #fffaf0 0%, #e2cf9f 49%, #bda880 50%, #bda880 100%); }
.curl:hover, .curl:focus-visible { width: 72px; height: 72px; outline: none; }
.book .hojagiro { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; z-index: 2; }
.book .hojagiro.der { transform-origin: left center; animation: giroDer .8s cubic-bezier(.45, .05, .35, 1) forwards; }
.book .hojagiro.izq { transform-origin: right center; animation: giroIzq .8s cubic-bezier(.45, .05, .35, 1) forwards; }
.book .hojagiro .page { position: absolute; inset: 0; margin: 0; box-sizing: border-box; backface-visibility: hidden; -webkit-backface-visibility: hidden; animation: none; }
.book .hojagiro .page.dorso { transform: rotateY(180deg); }
@keyframes giroDer { to { transform: rotateY(-180deg); } }
@keyframes giroIzq { to { transform: rotateY(180deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.noanim .book .page { animation: none !important; }
#stage canvas { display: block; }

/* enlace a la versión en texto (para quien tenga un móvil lento, use lector de pantalla o prefiera leer); solo en la vista del cuarto */
#textoLink { position: fixed; left: 18px; bottom: 18px; color: var(--glow); text-shadow: 2px 2px 0 var(--shadow); font-size: 20px;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
#textoLink:hover { color: var(--accent); }
#textoLink:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
#back:not([hidden]) ~ #textoLink, body.en-editor #textoLink { display: none; }
/* reloj: muestra la hora y el tiempo reales, no se puede tocar */
#reloj { position: fixed; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 10px; }
#relojBtn, #relojBtn:hover { cursor: default; background: var(--paper); transform: none; box-shadow: 4px 4px 0 var(--shadow); }
/* tutorial de bienvenida (tutorial.js): la tarjeta es un bocadillo como los del espejo; las etiquetas, como el cartel del ratón */
#tutoBtn { font-weight: 700; padding: 4px 13px; }
#tuto { position: fixed; width: min(440px, 38vw); z-index: 30; pointer-events: none !important; }
#tuto .tuto-card { pointer-events: auto; max-height: 78vh; }
#tuto .tuto-card.tuto-entra { animation: pop .3s steps(4) both; }
.tuto-num { font-family: 'Pixelify Sans', sans-serif; font-size: 15px; color: var(--accent-2); }
.card.bocadillo h3.tuto-titulo { margin: 2px 0 0; font-size: 27px; }
.tuto-botones { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.tuto-botones .tuto-sig { margin-left: auto; background: var(--accent); color: #fff; }
.tuto-botones .tuto-sig:hover { background: #ec8b62; }
.tuto-botones .tuto-saltar { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 17px; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tuto-botones .tuto-saltar:hover { color: var(--accent); }
/* al cerrar el tutorial, el «¿?» da un saltito (la tarjeta se ha minimizado hacia él) */
#tutoBtn.tuto-aviso { animation: tuto-aviso .7s steps(7) both; }
@keyframes tuto-aviso { 0%, 100% { transform: none; } 30% { transform: scale(1.3); background: var(--accent); color: #fff; } 60% { transform: scale(.92); } }
.tuto-botones button:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
#tutoEtiquetas { pointer-events: none !important; }
.tuto-etiqueta { position: fixed; transform: translate(-50%, calc(-100% - 10px)); padding: 2px 10px; background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow); font-family: 'Pixelify Sans', sans-serif; font-size: 18px; white-space: nowrap; animation: pop .3s steps(4) both; }
/* en el móvil (y pantallas estrechas): abajo y a todo el ancho; tutorial.js pone .movil */
#tuto.movil { left: 10px; right: 10px; top: auto; bottom: 64px; width: auto; }
#tuto.movil .tuto-card { max-height: 52vh; padding: 14px 16px; }
#tuto.movil h3.tuto-titulo { font-size: 23px; }
@media (max-aspect-ratio: 1/1), (max-width: 760px) { .tuto-etiqueta { font-size: 16px; } }
@media (max-height: 500px) { #tuto.movil { left: auto !important; right: 10px; bottom: 60px; width: min(420px, 55vw); } #tuto.movil .tuto-card { max-height: 70vh; } }
[hidden] { display: none !important; }


/* contactos de "Sobre mí": iconos pixelados con la rotulación debajo */
.contactos { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ico { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--ink); font-size: 15px; }
.ico .ico-svg { width: 44px; height: 44px; padding: 8px; box-sizing: border-box; background: var(--paper-2); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--shadow); }
.ico:hover { color: var(--accent); }
.ico:hover .ico-svg { background: var(--glow); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.ico:active .ico-svg { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }

/* Experiencia: solo las tarjetas, en un carrusel horizontal (la del centro, activa; las de los lados asoman) */
#panel.carrusel { pointer-events: none; }
.carrusel-exp { --ancho: min(540px, 78vw); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.carrusel-exp .pista { pointer-events: auto; width: 100%; display: flex; align-items: center; gap: 28px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; padding: 10px calc(50% - var(--ancho) / 2) 14px; box-sizing: border-box; scrollbar-width: none; outline: none; }
.carrusel-exp .pista::-webkit-scrollbar { display: none; }
.carrusel-exp .exp-card { flex: 0 0 var(--ancho); box-sizing: border-box; scroll-snap-align: center; max-height: 78vh; overflow-y: auto; padding: 16px 18px;
  opacity: .55; transform: scale(.94); transition: opacity .25s, transform .25s; cursor: pointer; }
.carrusel-exp .exp-card.activa { opacity: 1; transform: none; cursor: auto; }
.carrusel-exp .exp-card img { display: block; width: auto; max-width: 100%; height: auto; max-height: 34vh; border: 3px solid var(--ink); margin: 0 auto 10px; background: #fff; }
.carrusel-exp .exp-cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.carrusel-exp .exp-card h3 { margin: 0; }
.carrusel-exp .exp-cuando { white-space: nowrap; opacity: .75; }
.carrusel-exp .exp-donde { font-weight: 700; margin: 0 0 6px; }
.carrusel-exp .exp-card p { line-height: 1.12; margin: 6px 0; }
.carrusel-exp .exp-card p:not(.exp-tags) + p:not(.exp-tags) { margin-top: 1.1em; }   /* una línea en blanco entre párrafos, como en los bocadillos */
.carrusel-exp .exp-tags { margin: 8px 0 0; }
.carrusel-nav { pointer-events: auto; display: flex; align-items: center; gap: 18px; color: var(--glow); text-shadow: 2px 2px 0 var(--shadow); font-family: 'Pixelify Sans', sans-serif; font-size: 20px; }
.carrusel-nav .px-btn { font-size: 28px; line-height: 1; padding: 6px 20px; }
.carrusel-nav .px-btn:disabled { opacity: .35; cursor: default; }
.carrusel-nav span { min-width: 12ch; text-align: center; }

/* bocadillo de las fotos del espejo: una tarjeta que sustituye al panel */
.card.bocadillo { position: relative; max-height: 82vh; overflow-y: auto; }
.card.bocadillo p { line-height: 1.1; margin: 7px 0; text-align: justify; hyphens: auto; }
.card.bocadillo p + p { margin-top: 1.1em; }   /* una línea en blanco entre párrafos seguidos */
.volver-sm { margin: 0 0 8px; font-size: 16px; padding: 1px 10px; }
.card.bocadillo h3 { font-weight: 700; margin: 14px 0 0; }
.card.bocadillo ul { margin: 6px 0 0; padding-left: 22px; }
.card.bocadillo li { margin: 3px 0; }
/* fotos del bocadillo (rugby): polaroids pequeñas pegadas a un lado, con celo o con chincheta, y el texto alrededor. Enteras: sin recortar a nadie */
.foto-boc { position: relative; width: 42%; margin: 10px 0 8px; padding: 5px 5px 14px; background: #fffdf6; box-shadow: 2px 3px 0 var(--shadow), 0 0 0 1px rgba(0,0,0,.12); line-height: 0; }
.foto-boc.der { float: right; margin-left: 16px; rotate: 2.5deg; }
.foto-boc.izq { float: left; margin-right: 16px; rotate: -3deg; }
.foto-boc img { display: block; width: 100%; height: auto; }
.card.bocadillo .foto-boc { cursor: zoom-in; transition: transform .15s; }
.card.bocadillo .foto-boc:hover, .card.bocadillo .foto-boc:focus-visible { transform: scale(1.04); outline: none; }
/* la polaroid ampliada: la misma, con su celo o su chincheta, a casi toda la pantalla */
.foto-grande .foto-boc { float: none; width: min(80vw, 74vh); margin: 0; padding: 12px 12px 36px; cursor: zoom-out; animation: foto-ampliar .18s ease-out; }
.foto-grande .foto-boc.celo::before { top: -20px; height: 40px; }
.foto-grande .foto-boc.chincheta::before { top: -10px; width: 30px; height: 30px; }
@keyframes foto-ampliar { from { transform: scale(.6); opacity: 0; } }
.foto-boc.celo::before { content: ''; position: absolute; top: -10px; left: 50%; width: 48%; height: 20px; translate: -50% 0; rotate: -5deg; background: rgba(246, 232, 180, .72); box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.foto-boc.chincheta::before { content: ''; position: absolute; top: -5px; left: 50%; width: 15px; height: 15px; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a7a, #d02a1e 55%, #7c140d); box-shadow: 2px 3px 2px rgba(0,0,0,.35); }
.card.bocadillo h3 { clear: both; }
.card.bocadillo::after { content: ''; display: block; clear: both; }
img.ico-svg { object-fit: contain; padding: 9px 4px !important; }

/* móvil y pantallas estrechas o bajas (el móvil en apaisado): los paneles ocupan la pantalla y se desplazan; el libro se lee de arriba abajo, página a página */
html.movil #stage canvas { touch-action: none; }
html.movil #back:not([hidden]) ~ #reloj { display: none; }          /* en el móvil el reloj solo está en el cuarto: en las secciones tapaba el panel, la pizarra o la barra de la terminal */
@media (max-aspect-ratio: 1/1), (max-width: 760px), (max-height: 500px) {
  #panel:not(.libro3d):not(.en-monitor) { position: fixed !important; left: 10px !important; right: 10px !important; top: 64px !important; bottom: 12px !important; width: auto !important; height: auto !important; transform: none !important; translate: none; }
  #panel:not(.libro3d):not(.en-monitor) > div { display: block !important; height: 100%; }
  #panel .card, #panel .desktop, #panel .book:not(.book3d) { height: 100%; max-height: none; overflow: auto; -webkit-overflow-scrolling: touch; }
  .desktop { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); grid-auto-rows: min-content; font-size: 19px; gap: 12px; padding: 12px; }
  #panel.en-monitor .desktop { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); font-size: 13px; gap: 6px; padding: 6px; }   /* dentro del monitor: más pequeño y se desplaza con el dedo */
  #panel .card { height: auto; max-height: 100%; }                  /* la tarjeta mide lo que su texto (sin hueco vacío debajo) */
  .desktop .win .body { overflow: visible; }
  .book:not(.book3d) { display: block; aspect-ratio: auto; container-type: normal; width: auto; padding: 8px; }
  .book:not(.book3d) .page { margin-bottom: 8px; overflow: visible; padding-bottom: 18px; }
  .book:not(.book3d) .curl, .book:not(.book3d) .num, #panel.libro-movil .curl { display: none; }   /* en el móvil el libro 3D se pasa con los botones ‹ › */
  .book:not(.book3d) .page:first-child { border-right: 2px solid #c9b48a; }
  .book:not(.book3d).opening .page.right { animation: none; }
  #hint { font-size: 19px; bottom: 76px; width: 86vw; text-align: center; }
  #back { top: 12px; left: 10px; }
  #plegar:not([hidden]) { display: block; }
  #panel.plegado { display: none !important; }
  #panel.plegado ~ #reloj { display: flex; }
  #reloj { right: 10px; bottom: 12px; }
  #panel:not([hidden]) ~ #reloj { display: none; }
  .card.bocadillo { max-height: none; }
}
/* en vertical el mapa ampliado sería diminuto: va a 2,5 veces el ancho de la pantalla y se desplaza con el dedo */
@media (max-aspect-ratio: 1/1) {
  .mapa-grande .mapa-caja { overflow-x: auto; overscroll-behavior: contain; }
  .mapa-grande .mapa-svg { width: 250%; max-width: none; }
}

/* mapa de los países visitados (Viajar): pequeño en el panel y a pantalla completa al pulsarlo */
.mapa { width: 62%; margin: 8px auto; padding: 6px; background: #bcd3e8; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--shadow); cursor: pointer; }
.mapa:hover, .mapa:focus-visible { background: #c9def0; outline: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.mapa figcaption { font-size: 15px; text-align: center; margin-top: 2px; color: var(--ink); }
.mapa-svg { display: block; width: 100%; height: auto; }
.mapa-svg .t { fill: #e9dcc0; stroke: #8a7a58; stroke-width: 0.3; }
.mapa-svg .v { fill: #e2573d; stroke: #8a2a18; stroke-width: 0.3; }
.mapa-grande { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(10, 10, 20, 0.78); cursor: zoom-out; }
.mapa-caja { width: min(92vw, 720px); max-height: 94vh; overflow: auto; padding: 12px; background: #bcd3e8; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow); }
.mapa-svg .v:hover { fill: #f27a5e; }
.mapa-svg .h { fill: transparent; }
.mapa-tip { position: fixed; z-index: 60; padding: 2px 8px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--shadow); font-size: 18px; pointer-events: none; white-space: nowrap; }

/* libro 3D (Educación): las hojas de texto van sobre las del modelo; cada una tiene un tamaño fijo de diseño y se escala a pantalla */
#panel.libro3d { pointer-events: none; animation: none; }
#panel.libro3d.cerrando .hoja { pointer-events: none; }
#panel.libro3d.cerrando .curl { display: none; }
.book.book3d { position: fixed; inset: 0; width: auto; height: auto; aspect-ratio: auto; container-type: normal; background: none; border: 0; box-shadow: none; padding: 0; display: block; pointer-events: none; }
.book3d .hoja { position: absolute; left: 0; top: 0; width: 420px; height: 606px; transform-origin: 0 0; perspective: 1600px; pointer-events: auto; }
.book.book3d .page { position: absolute; inset: 0; background: var(--paper); border: 1px solid #c9b48a; padding: 28px 32px 40px; box-sizing: border-box; }
.book.book3d .page.right { box-shadow: inset 14px 0 14px -10px rgba(60, 40, 20, .28); }
.book.book3d .page.left { box-shadow: inset -14px 0 14px -10px rgba(60, 40, 20, .28); }
.book.book3d .page.medidor { visibility: hidden; pointer-events: none; inset: auto; left: 0; top: 0; }

/* Experiencia en el móvil y pantallas estrechas o bajas: el carrusel ocupa el panel; cada tarjeta se desplaza por dentro si no cabe */
@media (max-aspect-ratio: 1/1), (max-width: 760px), (max-height: 500px) {
  #panel.carrusel .carrusel-exp { height: 100%; --ancho: min(440px, 84vw); gap: 8px; }
  #panel.carrusel .pista { flex: 1 1 auto; min-height: 0; align-items: stretch; gap: 14px; padding-top: 0; padding-bottom: 6px; }
  #panel.carrusel .exp-card { height: auto; max-height: 100%; }
}
