/* =====================================================================
   Montevideo amurallado · v0.5
   Los carteles son etiquetas de papel con doble filete, como la cartela de
   un plano antiguo. Estilo tomado del visor de Buenos Aires (S33,
   github.com/mormonnegro/baires-interactivo, MIT) y adaptado.
   ===================================================================== */
:root {
  --papel: #f1e6cd; --papel-claro: #fff6e2; --tinta: #2a221b; --tinta-suave: #2a221b99; --rojo: #a03220;
  --fondo: #1d1a17; --g: 22px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #f7eedb; color: var(--tinta); font: 15px/1.4 var(--serif); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
#app canvas { display: block; touch-action: none; }
.labels { position: absolute; inset: 0; z-index: 5; } /* su propio apilado: los rótulos no tapan los paneles */
button, select, input { font: inherit; color: inherit; }
.oculto { display: none !important; }
svg { fill: currentColor; }

/* ---------- los carteles ---------- */
.panel { color: var(--tinta); background: var(--papel); border: 1px solid var(--tinta); outline: 1px solid var(--tinta-suave); outline-offset: 2px; box-shadow: 0 5px 24px #0005; }

/* ---------- la cartela de arriba ---------- */
#cartela { position: fixed; left: calc(var(--g) + var(--sl)); top: calc(var(--g) + var(--st)); z-index: 20; width: min(400px, calc(100vw - 2 * var(--g))); padding: 0; }
#titulo { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 16px 9px; cursor: pointer; border-bottom: 1px solid #2a221b33; }
#titulo:hover { background: var(--papel-claro); }
#titulo strong { display: block; font-size: 23px; font-weight: 500; letter-spacing: .03em; line-height: 1.1; }
#titulo span { display: block; font-size: 13px; font-style: italic; opacity: .8; margin-top: 2px; }
#busca { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 14px; border-bottom: 1px solid #2a221b33; }
#busca svg { width: 18px; height: 18px; flex: none; opacity: .7; }
#buscar { flex: 1; min-width: 0; border: 0; background: none; padding: 6px 0; font-size: 15px; outline: none; }
#buscar::placeholder { color: #2a221b88; font-style: italic; }
#resultados { position: absolute; left: -1px; right: -1px; top: calc(100% + 1px); margin: 0; padding: 4px 0; list-style: none; background: var(--papel); border: 1px solid var(--tinta); box-shadow: 0 8px 24px #0006; max-height: 50vh; overflow: auto; z-index: 2; }
#resultados li { padding: 7px 16px; cursor: pointer; }
#resultados li b { display: block; font-weight: 500; }
#resultados li small { display: block; font-size: 12px; font-style: italic; opacity: .75; }
#resultados li.sel, #resultados li:hover { background: var(--papel-claro); }
#resultados li.vacio { cursor: default; font-size: 13px; font-style: italic; opacity: .8; }
#donde { margin: 0; padding: 7px 16px 9px; font-size: 13.5px; min-height: 1.4em; }
#donde b { font-weight: 600; font-variant: small-caps; letter-spacing: .05em; font-size: 15px; }
#donde span { opacity: .75; font-style: italic; margin-left: 4px; }
#donde i { display: block; font-size: 12.5px; opacity: .8; }

/* ---------- los botones de abajo ---------- */
#botones { position: fixed; right: calc(var(--g) + var(--sr)); bottom: calc(var(--g) + var(--sb)); display: flex; gap: 10px; align-items: stretch; z-index: 20; }
#botones .grupo { display: flex; gap: 10px; }
#botones .panel { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 15.5px; padding: 9px 16px; letter-spacing: .02em; white-space: nowrap; min-height: 44px; }
#botones .panel svg { width: 20px; height: 20px; flex: none; }
#botones .panel:hover { background: var(--papel-claro); }
#botones .panel:active { transform: translateY(1px); }
#botones .panel.on, body[data-modo="aereo"] #btn-aereo, body[data-modo="caminar"] #btn-caminar { background: var(--tinta); color: #f7eedb; }
#botones .icono { padding: 9px 12px; justify-content: center; min-width: 44px; }
#btn-hoy { color: var(--rojo) !important; border-color: var(--rojo) !important; outline-color: #a0322099 !important; }
#btn-hoy.on { background: var(--rojo) !important; color: #f7eedb !important; }
#mas { position: fixed; right: calc(var(--g) + var(--sr)); bottom: calc(var(--g) + var(--sb) + 60px); z-index: 21; display: flex; flex-direction: column; min-width: 250px; padding: 4px 0; }
#mas[hidden] { display: none; }
#mas button, #mas select { text-align: left; background: none; border: 0; padding: 10px 16px; cursor: pointer; font-size: 15px; }
#mas select { border-bottom: 1px solid #2a221b22; }
#mas button:hover { background: var(--papel-claro); }
#mas button.activo { font-weight: 600; }
#mas button.activo::before { content: '✓ '; }

/* ---------- la línea de tiempo ---------- */
#tiempo { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--g) + var(--st)); z-index: 19; width: min(620px, calc(100vw - 900px)); min-width: 380px; padding: 8px 16px 6px; display: none; }
body.con-tiempo #tiempo { display: block; }
#tiempo .fila { display: flex; align-items: center; gap: 12px; }
#anio-rotulo { font-size: 26px; font-variant-numeric: lining-nums; min-width: 62px; }
#anio { flex: 1; accent-color: var(--tinta); }
#tiempo-marcas { position: relative; height: 22px; margin: 0 8px 0 82px; }
#tiempo-marcas button { position: absolute; transform: translateX(-50%); background: none; border: 0; font-size: 11px; padding: 2px; cursor: pointer; opacity: .7; }
#tiempo-marcas button:hover { opacity: 1; text-decoration: underline; }
#tiempo-marcas button::before { content: ''; position: absolute; left: 50%; top: -3px; width: 1px; height: 5px; background: var(--tinta); }
#tiempo-marcas button.sin { color: transparent; width: 9px; }
#tiempo-marcas button.sin:hover { color: var(--tinta); background: var(--papel); z-index: 1; }
#tiempo .pie-fila { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
#tiempo-pie { flex: 1; min-width: 0; margin: 0; font-size: 13px; font-style: italic; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ver-eventos { flex: none; font: inherit; font-size: 12px; padding: 3px 10px; border: 1px solid var(--tinta); background: transparent; color: var(--tinta); cursor: pointer; border-radius: 2px; }
#ver-eventos:hover { background: var(--tinta); color: var(--papel); }
#modal .hitos { list-style: none; padding: 0; margin: 0; }
#modal .hitos button { display: block; width: 100%; text-align: left; font: inherit; font-size: 15px; line-height: 1.45; padding: 6px 4px; background: none; border: 0; border-bottom: 1px solid #2a221b1f; color: inherit; cursor: pointer; }
#modal .hitos button:hover { background: #2a221b0d; }
#modal .hitos button.actual { background: #2a221b14; }
#tiempo-pie small { font-size: 12px; opacity: .8; }

/* ---------- lo de hoy ---------- */
#leyenda-hoy { position: fixed; right: calc(var(--g) + var(--sr)); bottom: calc(var(--g) + var(--sb) + 64px); max-width: 280px; padding: 8px 12px 9px; font-size: 12.5px; line-height: 1.45; color: var(--rojo); border-color: var(--rojo); outline-color: #a0322099; z-index: 18; opacity: 0; pointer-events: none; transition: opacity .4s; }
body.hoy #leyenda-hoy { opacity: 1; }
#leyenda-hoy b { display: block; font-weight: 500; font-size: 13.5px; }
#leyenda-hoy span { display: block; }
#leyenda-hoy .l { display: inline-block; width: 22px; border-top: 2px solid var(--rojo); vertical-align: middle; margin-right: 7px; }
#leyenda-hoy small { display: block; margin-top: 3px; font-size: 11px; font-style: italic; opacity: .85; }

/* ---------- el paseo (v0.6) ---------- */
#paseo { position: fixed; left: calc(var(--g) + var(--sl)); bottom: calc(var(--g) + var(--sb) + 62px); z-index: 22; width: min(380px, calc(100vw - 2 * var(--g))); padding: 12px 18px 12px; }
#paseo[hidden] { display: none; }
#paseo h3 { margin: 2px 0 4px; font-weight: 500; font-size: 21px; font-variant: small-caps; letter-spacing: .03em; }
#paseo .ronda { margin: 0; font-size: 12.5px; font-style: italic; opacity: .8; }
#paseo .texto { margin: 0; font-size: 14px; line-height: 1.45; }
#paseo .ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#paseo button { padding: 6px 12px; min-height: 34px; border: 1px solid var(--tinta); background: var(--papel-claro); color: var(--tinta); cursor: pointer; font: inherit; font-size: 14px; }
#paseo #pz-pausa { background: var(--tinta); color: #f7eedb; }
#paseo #pz-ant, #paseo #pz-sig { min-width: 38px; font-size: 18px; line-height: 1; }
#paseo #pz-salir { margin-left: auto; }
#paseo .barra { height: 2px; margin-top: 10px; background: color-mix(in srgb, var(--tinta) 15%, transparent); }
#paseo .barra i { display: block; height: 100%; background: var(--tinta); transition: width .3s linear; }
body.paseo #minimapa, body.paseo #tiempo, body.paseo #leyenda-hoy { display: none !important; }

/* ---------- etiquetas sobre la ciudad ---------- */
.label { pointer-events: auto; }
.label.lugar { font: inherit; color: var(--tinta); background: var(--papel); border: 1px solid var(--tinta); border-radius: 0; padding: 2px 8px 3px; white-space: nowrap; cursor: pointer; box-shadow: 0 2px 10px #0004; font-size: 12.5px; letter-spacing: .06em; font-variant: small-caps; }
.ancla { width: 0; height: 0; position: relative; pointer-events: none; }
.ancla > .label.lugar { position: absolute; bottom: 30px; left: 0; transform: translateX(-50%); pointer-events: auto; }
.ancla > .palo { position: absolute; left: -0.5px; bottom: 0; width: 1px; height: 30px; background: var(--tinta); pointer-events: none; }
.ancla > .palo::after { content: ''; position: absolute; left: -2.5px; bottom: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--tinta); box-shadow: 0 0 0 1.5px var(--papel); }
.label.lugar.resaltado { background: var(--tinta); color: #f7eedb; }
.label.lugar.resaltado + .palo, .label.lugar.resaltado + .palo::after { background: #c0391b; }
.label.lugar:hover { background: var(--papel-claro); outline: 1px solid var(--tinta-suave); outline-offset: 2px; }
.label.lugar i.c { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; border: 1px solid #2a221b55; }
body:not(.certeza) .label.lugar i.c { display: none; }
.label.calle { pointer-events: none; color: var(--tinta); font-size: 12px; font-style: italic; text-shadow: 0 0 3px #f7eedb, 0 0 3px #f7eedb, 0 0 6px #f7eedb; text-align: center; white-space: nowrap; line-height: 1.1; }
.label.calle small { display: block; font-size: 10px; opacity: .8; }
body.hoy .label.calle small { color: var(--rojo); opacity: 1; }
body[data-modo="caminar"] .labels { display: none; }

/* ---------- leyenda de certeza ---------- */
#leyenda { position: fixed; left: calc(var(--g) + var(--sl)); bottom: calc(var(--g) + var(--sb)); padding: 7px 12px; font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; z-index: 15; max-width: calc(100vw - 2 * var(--g)); }
#leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid #2a221b55; }
body.certeza #minimapa { display: none; }

/* ---------- minimapa ---------- */
#minimapa { position: fixed; left: calc(var(--g) + var(--sl)); bottom: calc(var(--g) + var(--sb)); z-index: 15; padding: 0; }
#minimapa canvas { display: block; width: 240px; height: 176px; cursor: crosshair; }

/* ---------- caminata ---------- */
#mira { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #f7eedb; box-shadow: 0 0 0 1px var(--tinta); z-index: 12; display: none; }
#prompt { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); background: var(--papel); border: 1px solid var(--tinta); padding: 6px 14px; font-size: 15px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 12; white-space: nowrap; }
#prompt.visible { opacity: 1; }
kbd { background: var(--tinta); color: #f7eedb; padding: 0 6px; font-family: system-ui, sans-serif; font-size: 12px; font-weight: 700; margin-right: 4px; }
#ayuda, #ayuda-aerea { position: fixed; left: 50%; bottom: calc(var(--g) + var(--sb) + 12px); transform: translateX(-50%); margin: 0; font-size: 12.5px; font-style: italic; color: #2a221bcc; text-shadow: 0 0 4px #f7eedb, 0 0 8px #f7eedb; z-index: 12; text-align: center; pointer-events: none; max-width: calc(100vw - 1000px); min-width: 200px; }
body[data-modo="caminar"] #mira { display: block; }
#ayuda { bottom: calc(var(--g) + var(--sb) + 64px); max-width: 640px; }
body[data-modo="caminar"] .solo-aereo, body[data-modo="aereo"] .solo-caminar { display: none; }
body.tactil .solo-desktop { display: none; }
body[data-modo="caminar"] #cartela #busca, body[data-modo="caminar"] #btn-plano, body[data-modo="caminar"] #btn-paseo, body[data-modo="caminar"] #btn-tiempo { display: none; }
@media (max-width: 1350px) { #ayuda-aerea { display: none; } }

/* ---------- táctil ---------- */
#touch-capa { position: fixed; inset: 0; z-index: 10; display: none; touch-action: none; }
#joystick { position: fixed; left: calc(30px + var(--sl)); bottom: calc(40px + var(--sb)); width: 120px; height: 120px; border-radius: 50%; background: #f1e6cd33; border: 1px solid var(--tinta); outline: 1px solid #f1e6cd99; outline-offset: 2px; z-index: 11; pointer-events: none; display: none; }
#joystick.activo { background: #f1e6cd66; }
#knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: var(--papel); border: 1px solid var(--tinta); }
#acciones { position: fixed; right: calc(14px + var(--sr)); bottom: calc(24px + var(--sb)); z-index: 13; display: none; grid-template-columns: repeat(2, 64px); gap: 10px; }
#acciones button { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--tinta); background: var(--papel); color: var(--tinta); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; padding: 0; box-shadow: 0 3px 12px #0004; }
#acciones button b { font-size: 20px; line-height: 1; }
#acciones button.activo { background: var(--tinta); color: #f7eedb; }
#acciones .grande { grid-column: span 2; width: 138px; height: 64px; border-radius: 32px; }
#acciones .grande span { max-width: 124px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
#acciones .grande.listo { background: var(--tinta); color: #f7eedb; }
body.tactil[data-modo="caminar"] #touch-capa, body.tactil[data-modo="caminar"] #joystick { display: block; }
body.tactil[data-modo="caminar"] #acciones { display: grid; }
body.tactil[data-modo="caminar"] #botones, body.tactil[data-modo="caminar"] #minimapa { display: none; }
body.tactil #prompt { display: none; }

/* ---------- ficha de un lugar ---------- */
#info { position: fixed; top: calc(var(--g) + var(--st)); right: calc(var(--g) + var(--sr)); bottom: calc(var(--g) + var(--sb) + 64px); width: min(400px, calc(100% - 2 * var(--g))); padding: 16px 20px; overflow: auto; z-index: 30; transform: translateX(calc(100% + 40px)); transition: transform .25s; }
#info.abierto { transform: none; }
#info h2, #modal h2 { font-weight: 500; margin: 0 28px 8px 0; font-size: 24px; letter-spacing: .02em; line-height: 1.15; }
#info h3, #modal h3 { margin: 18px 0 6px; font-weight: 500; font-variant: small-caps; letter-spacing: .1em; font-size: 15px; border-bottom: 1px solid #2a221b33; padding-bottom: 2px; }
#info p, #modal p, #modal li { font-size: 15px; line-height: 1.5; }
.badge { display: inline-block; font-size: 12px; font-style: italic; padding: 1px 8px 2px; border: 1px solid var(--tinta); }
.badge::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #888); margin-right: 6px; vertical-align: 0; }
.fechas { font-style: italic; opacity: .85; }
.foto { margin: 12px 0; }
.foto img { display: block; width: 100%; border: 1px solid var(--tinta); filter: sepia(.25); }
.foto figcaption { font-size: 12.5px; font-style: italic; margin-top: 4px; opacity: .85; }
.foto figcaption span { opacity: .8; }
.foto.epoca { margin: 10px 0 14px; }
.foto.epoca .epoca-titulo { margin: 0 0 5px; font-variant: small-caps; letter-spacing: .06em; font-size: 14px; }
.foto.epoca img { filter: sepia(.35); max-height: 46vh; object-fit: contain; background: #2a221b; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.galeria button { padding: 0; border: 1px solid var(--tinta); background: var(--papel-claro); cursor: pointer; position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.galeria img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.35); display: block; }
.galeria span { position: absolute; left: 0; bottom: 0; background: #2a221bcc; color: #f7eedb; font-size: 11px; padding: 1px 5px; }
.nota { background: #e9dcc0; border-left: 2px solid var(--tinta); padding: 6px 10px; font-size: 14px !important; }
.tenue { opacity: .75; font-size: 13px !important; }
ul.fuentes { padding-left: 18px; font-size: 14px; line-height: 1.45; }
ul.fuentes li { margin-bottom: 6px; font-size: 14px !important; }
a { color: #7a3d14; }
ul.leyenda { list-style: none; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; border: 1px solid #2a221b55; }
#cerrar-info, #cerrar-modal { position: absolute; right: 10px; top: 6px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--tinta); line-height: 1; padding: 4px 8px; }
code { background: #e9dcc0; padding: 1px 5px; font-size: 13px; }

#modal, #pausa { position: fixed; inset: 0; background: #1d1a1799; z-index: 40; display: none; align-items: center; justify-content: center; padding: 16px; }
#modal.abierto, #pausa.abierto { display: flex; }
#modal .caja { position: relative; max-width: 760px; width: 100%; max-height: 86vh; overflow: auto; padding: 22px 28px; }
#modal.bienvenida .caja { max-width: 560px; }
#modal .autor { display: flex; gap: 16px; align-items: center; margin: 6px 0 4px; }
#modal .autor img { width: 120px; height: 120px; flex: none; border-radius: 50%; object-fit: cover; border: 1px solid var(--tinta); filter: sepia(.25); }
#modal .autor p { margin: 0; }
#modal .credito { font-size: 14px !important; border-top: 1px solid #2a221b33; padding-top: 10px; color: var(--tinta-suave); }
#modal .autor-links { display: flex; flex-wrap: wrap; gap: 8px; }
#modal .boton { display: inline-block; padding: 8px 14px; border: 1px solid var(--tinta); background: var(--papel-claro); color: var(--tinta); text-decoration: none; font: inherit; font-size: 15px; cursor: pointer; }
#modal.bienvenida .caja { padding-bottom: 0; }
#modal .empezar-pie { position: sticky; bottom: 0; margin: 12px -28px 0; padding: 12px 28px calc(14px + var(--sb, 0px)); background: linear-gradient(to bottom, transparent, var(--papel) 14px); }
@media (max-width: 480px) { #modal .empezar-pie { margin: 10px -18px 0; padding: 12px 18px 14px; } }
#modal .boton.lleno { background: var(--tinta); color: #f7eedb; width: 100%; padding: 11px; }
@media (max-width: 480px) { #modal .autor { flex-direction: column; text-align: center; } #modal .autor img { width: 104px; height: 104px; } #modal .caja { padding: 20px 18px; } }
#pausa .caja { padding: 22px; display: flex; flex-direction: column; gap: 10px; min-width: 260px; text-align: center; }
#pausa h2 { margin: 0 0 6px; font-weight: 500; }
#pausa button { padding: 10px; border: 1px solid var(--tinta); background: var(--papel-claro); cursor: pointer; }
#pausa button:first-of-type { background: var(--tinta); color: #f7eedb; }

#toast { position: fixed; left: 50%; top: calc(var(--g) + var(--st)); transform: translateX(-50%); background: var(--papel); border: 1px solid var(--tinta); padding: 8px 16px; font-size: 14px; z-index: 35; opacity: 0; transition: opacity .3s; pointer-events: none; max-width: min(520px, calc(100% - 32px)); text-align: center; box-shadow: 0 4px 16px #0004; }
#toast.visible { opacity: 1; }
body.con-tiempo #toast { top: calc(var(--g) + var(--st) + 120px); }

#cargando { position: fixed; inset: 0; display: grid; place-items: center; background: var(--fondo); z-index: 50; }
.cargando-caja { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #efe4cd; }
.cargando-caja b { font-size: 26px; font-weight: 500; letter-spacing: .06em; }
.cargando-caja span { font-style: italic; letter-spacing: .04em; opacity: .85; }
.cargando-caja i { width: 160px; height: 1px; background: linear-gradient(90deg, transparent, #efe4cd, transparent); animation: barrido 1.4s ease-in-out infinite; }
@keyframes barrido { 0%, 100% { opacity: .2; transform: scaleX(.4); } 50% { opacity: 1; transform: scaleX(1); } }

/* ---------- ventanas medianas ---------- */
@media (max-width: 1240px) {
  #tiempo { left: calc(var(--g) + var(--sl)); transform: none; top: auto; bottom: calc(var(--g) + var(--sb) + 64px); width: min(560px, calc(100vw - 2 * var(--g))); min-width: 0; }
  body.con-tiempo #minimapa { display: none; }
}
@media (max-width: 1000px) {
  #botones .rot { display: none; }
  #botones .panel { padding: 9px 12px; min-width: 44px; justify-content: center; }
}

/* ---------- teléfono ---------- */
@media (max-width: 640px) {
  :root { --g: 10px; }
  html, body { font-size: 14px; }
  #cartela { width: calc(100vw - 2 * var(--g) - var(--sl) - var(--sr)); }
  #titulo { padding: 8px 12px 6px; }
  #titulo strong { font-size: 18px; }
  #titulo span { display: none; }
  #busca { padding: 3px 10px; }
  #buscar { font-size: 16px; }
  #donde { padding: 5px 12px 6px; font-size: 12.5px; }
  #donde i { display: inline; margin-left: 4px; }
  #botones { left: calc(var(--g) + var(--sl)); right: calc(var(--g) + var(--sr)); justify-content: space-between; gap: 6px; }
  #botones .grupo { gap: 6px; }
  #botones .panel { padding: 8px 9px; min-width: 42px; font-size: 14px; }
  #mas { left: calc(var(--g) + var(--sl)); right: calc(var(--g) + var(--sr)); bottom: calc(var(--g) + var(--sb) + 60px); }
  #minimapa { display: none; }
  body.mapa-abierto #minimapa { display: block; bottom: calc(var(--g) + var(--sb) + 62px); }
  #minimapa canvas { width: 180px; height: 132px; }
  #tiempo { left: calc(var(--g) + var(--sl)); right: calc(var(--g) + var(--sr)); width: auto; bottom: calc(var(--g) + var(--sb) + 60px); padding: 6px 12px 4px; }
  #anio-rotulo { font-size: 21px; min-width: 50px; }
  #tiempo-marcas { margin-left: 62px; }
  #leyenda-hoy { right: calc(var(--g) + var(--sr)); bottom: calc(var(--g) + var(--sb) + 62px); }
  body.con-tiempo #leyenda-hoy { display: none; }
  #info { top: auto; left: var(--g); right: var(--g); bottom: calc(var(--g) + var(--sb)); width: auto; max-height: 62vh; transform: translateY(calc(100% + 40px)); }
  #info.abierto { transform: none; }
  #paseo { left: var(--g); right: var(--g); width: auto; bottom: calc(var(--g) + var(--sb) + 60px); max-height: 46vh; overflow: auto; }
  #paseo .texto { font-size: 13px; }
  #leyenda { bottom: calc(var(--g) + var(--sb) + 62px); font-size: 12px; gap: 10px; }
  .label.lugar { font-size: 11px; padding: 1px 6px 2px; }
  .label.calle { font-size: 10px; }
  #modal .caja { padding: 18px 18px; max-height: 92vh; }
  body.tactil[data-modo="caminar"] #titulo { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #titulo span, #donde i { display: none; }
  #titulo strong { font-size: 17px; }
}
/* v0.9: ficha de un personaje escondido, sólo cuando se está al lado */
/* Ficha del personaje (v0.10) */
#ficha { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(46,38,32,.35); z-index: 40; padding: 16px; }
#ficha.abierto { display: flex; }
#ficha .caja { position: relative; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 22px 16px; }
#ficha .cerrar { position: absolute; top: 6px; right: 10px; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--tinta); }
#ficha .ficha-cuerpo { display: flex; gap: 18px; align-items: flex-start; }
#ficha figure { margin: 4px 0 0; flex: 0 0 150px; }
#ficha figure img { width: 150px; display: block; border: 1px solid var(--tinta); box-shadow: 3px 4px 0 rgba(46,38,32,.25); }
#ficha figcaption { font-size: 12px; line-height: 1.35; font-style: italic; opacity: .85; margin-top: 6px; }
#ficha h2 { font-weight: 500; margin: 0 28px 2px 0; font-size: 24px; line-height: 1.15; }
#ficha .fechas { margin: 0 0 8px; opacity: .75; }
#ficha p { font-size: 15px; line-height: 1.5; }
#ficha .nota { font-size: 12.5px; font-style: italic; opacity: .8; }
#ficha .seguir { display: block; margin: 8px 0 0 auto; padding: 10px 16px; border: 1px solid var(--tinta); background: var(--tinta); color: #f7eedb; cursor: pointer; font: inherit; }
@media (max-width: 560px) { #ficha .ficha-cuerpo { flex-direction: column; align-items: center; } #ficha figure { flex-basis: auto; text-align: center; } #ficha figure img { margin: 0 auto; } }

/* Misiones (modo juego, js/juego.js) */
#misiones { position: fixed; right: 18px; top: 18px; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 140px); overflow: auto; background: var(--papel); border: 1px solid var(--tinta); box-shadow: 3px 4px 0 rgba(46,38,32,.25); padding: 10px 14px 12px; font-size: 14px; line-height: 1.4; display: none; z-index: 14; }
#misiones.abierto { display: block; }
#misiones header { display: flex; align-items: baseline; gap: 8px; }
#misiones header b { font-size: 18px; }
#misiones header span { opacity: .7; }
#misiones .cerrar { margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--tinta); }
#misiones h4 { margin: 10px 0 4px; font-variant: small-caps; letter-spacing: .04em; font-weight: normal; border-bottom: 1px solid var(--tinta-suave); }
#misiones .mision { display: flex; gap: 8px; padding: 3px 0; }
#misiones .mision small { display: block; opacity: .75; font-style: italic; }
#misiones .mision.ok { opacity: .6; }
#misiones .marca { width: 1em; flex: none; }
#misiones .nota { font-size: 12px; font-style: italic; opacity: .8; margin: 6px 0 0; }
#misiones .fin { font-weight: bold; color: var(--rojo); }
#misiones .empezar { margin-top: 10px; width: 100%; padding: 8px; background: var(--tinta); color: var(--papel); border: 0; cursor: pointer; font: inherit; }
@media (max-width: 600px) { #misiones { top: 70px; right: 16px; max-height: calc(100vh - 230px); } }

/* Formulario de contacto (Netlify Forms) */
#form-contacto { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
#form-contacto label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-variant: small-caps; letter-spacing: .06em; }
#form-contacto label small { font-variant: normal; letter-spacing: 0; font-style: italic; }
#form-contacto input, #form-contacto select, #form-contacto textarea { font: inherit; font-size: 16px; font-variant: normal; letter-spacing: 0; color: var(--tinta); background: var(--papel-claro); border: 1px solid var(--tinta); border-radius: 0; padding: 8px 10px; width: 100%; box-sizing: border-box; }
#form-contacto textarea { resize: vertical; min-height: 110px; }
#form-contacto input:focus, #form-contacto select:focus, #form-contacto textarea:focus { outline: 2px solid var(--tinta-suave); outline-offset: 1px; }
#form-contacto button[disabled] { opacity: .6; cursor: default; }
#contacto-estado { margin: 0; min-height: 1.2em; }
