/* =========================================================
   Plaza 25 de Mayo · San Juan 1944 · recorrido 3D / RV
   Misma paleta y tipografías que la app San Juan 1944;
   punteros y mira en #A6260C, como en la galería.
   ========================================================= */

@font-face {
  font-family: "Josefin Sans";
  src: url("../fonts/josefin-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --noche: #111a2e;
  --noche-alta: #1a2540;
  --noche-baja: #0a1020;
  --adobe: #d8c3a0;
  --papel: #f1ece2;
  --polvo: #a3abbd;
  --tinta: #e5483b;
  --puntero: #a6260c;
  --vidrio: rgba(13, 20, 37, 0.78);
  --linea: rgba(216, 195, 160, 0.18);
  --linea-fuerte: rgba(216, 195, 160, 0.34);

  --f-titulo: "Josefin Sans", "Futura", "Century Gothic", system-ui, sans-serif;
  --f-texto: "Newsreader", "Georgia", "Times New Roman", serif;

  --t-xs: 0.78rem;
  --t-s: 0.9rem;
  --t-m: 1.0625rem;
  --t-l: 1.3rem;
  --t-xl: 1.7rem;
  --t-xxl: clamp(2.2rem, 7vw, 3.4rem);

  --radio: 14px;
  --seguro-arriba: env(safe-area-inset-top, 0px);
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  --seguro-izq: env(safe-area-inset-left, 0px);
  --seguro-der: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--noche-baja);
  color: var(--papel);
  font-family: var(--f-texto);
  font-size: var(--t-m);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: var(--f-titulo); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--adobe); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

#lienzo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

/* ---------- Pantalla de entrada ---------- */
.entrada {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--seguro-arriba)) max(16px, var(--seguro-der)) calc(20px + var(--seguro-abajo)) max(16px, var(--seguro-izq));
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(10, 16, 32, 0.25), rgba(10, 16, 32, 0.82) 70%),
    linear-gradient(180deg, rgba(10, 16, 32, 0.55), rgba(10, 16, 32, 0.35));
  overflow-y: auto;
  transition: opacity 0.45s ease;
}
.entrada.saliendo { opacity: 0; pointer-events: none; }
.entrada__caja {
  width: min(540px, 100%);
  padding: 28px 26px 22px;
  border-radius: 20px;
  background: var(--vidrio);
  border: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.entrada__sobre {
  font-family: var(--f-titulo);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--adobe);
}
.entrada h1 { font-size: var(--t-xxl); margin: 10px 0 12px; }
.entrada__texto { color: rgba(241, 236, 226, 0.86); }
.entrada__nota { margin-top: 10px; font-size: var(--t-s); font-style: italic; color: var(--polvo); }

.carga { margin-top: 22px; height: 4px; border-radius: 4px; background: rgba(241, 236, 226, 0.12); overflow: hidden; }
.carga__barra { height: 100%; width: 0; background: var(--adobe); transition: width 0.25s ease; }
.carga__texto { margin-top: 8px; font-family: var(--f-titulo); font-size: var(--t-xs); letter-spacing: 0.06em; color: var(--polvo); }
.entrada.lista .carga, .entrada.lista .carga__texto { display: none; }

.entrada__botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.boton {
  flex: 1 1 200px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--f-titulo);
  font-size: var(--t-m);
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--papel);
  color: var(--noche);
  transition: transform 0.15s ease, opacity 0.2s ease, background-color 0.2s ease;
}
.boton:hover { transform: translateY(-1px); }
.boton:disabled { opacity: 0.4; cursor: progress; transform: none; }
.boton--vr { background: var(--puntero); color: var(--papel); }
.boton--vr svg { width: 22px; height: 22px; vertical-align: -5px; margin-right: 8px; }

.ayuda { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--linea); }
.ayuda h2 { font-size: var(--t-s); letter-spacing: 0.12em; text-transform: uppercase; color: var(--adobe); margin-bottom: 8px; }
.ayuda ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--t-s); color: rgba(241, 236, 226, 0.86); }
.ayuda li { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; }
.ayuda li b { font-family: var(--f-titulo); font-weight: 600; color: var(--papel); letter-spacing: 0.02em; }
.credito { margin-top: 18px; font-family: var(--f-titulo); font-size: var(--t-xs); letter-spacing: 0.08em; color: rgba(241, 236, 226, 0.6); text-align: center; }
.credito b { color: var(--papel); font-weight: 600; }

/* ---------- Interfaz durante el recorrido ---------- */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud__arriba {
  position: absolute;
  top: calc(12px + var(--seguro-arriba));
  left: max(14px, var(--seguro-izq));
  right: max(14px, var(--seguro-der));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}
.hud__arriba > * { pointer-events: auto; }
.hud__titulo {
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--vidrio);
  border: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  line-height: 1.2;
}
.hud__titulo b { display: block; font-family: var(--f-titulo); font-weight: 600; font-size: var(--t-s); letter-spacing: 0.03em; }
.hud__titulo span { font-size: var(--t-xs); font-style: italic; color: var(--polvo); }
.hud__botones { display: flex; gap: 8px; }
.circular {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--vidrio);
  border: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--f-titulo);
  font-size: var(--t-s);
  letter-spacing: 0.03em;
}
.circular svg { width: 20px; height: 20px; flex: none; }
.circular--solo { padding: 0; width: 44px; }

/* Mira (computadora) */
.mira {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid rgba(241, 236, 226, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.mira.activa { background: var(--puntero); border-color: var(--papel); transform: scale(1.5); }
.etiqueta {
  position: absolute;
  left: 50%;
  top: calc(50% + 18px);
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--vidrio);
  border: 1px solid var(--linea);
  font-family: var(--f-titulo);
  font-size: var(--t-s);
  white-space: nowrap;
  pointer-events: none;
}
.etiqueta small { color: var(--polvo); font-size: var(--t-xs); margin-left: 6px; letter-spacing: 0.02em; }

/* Joystick (celular) */
.joystick {
  position: absolute;
  left: max(22px, calc(var(--seguro-izq) + 14px));
  bottom: calc(26px + var(--seguro-abajo));
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: rgba(13, 20, 37, 0.45);
  border: 1px solid var(--linea-fuerte);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  touch-action: none;
}
.joystick__palanca {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(241, 236, 226, 0.88);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.joystick-pista {
  position: absolute;
  left: max(22px, calc(var(--seguro-izq) + 14px));
  bottom: calc(162px + var(--seguro-abajo));
  font-family: var(--f-titulo);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  color: rgba(241, 236, 226, 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.sin-tactil .joystick, .sin-tactil .joystick-pista { display: none; }
.tactil .mira, .tactil .etiqueta { display: none; }

.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--seguro-abajo));
  transform: translateX(-50%) translateY(20px);
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--vidrio);
  border: 1px solid var(--linea);
  font-family: var(--f-titulo);
  font-size: var(--t-s);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: calc(100% - 32px);
  text-align: center;
}
.aviso.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
/* en el celular, arriba: abajo está el joystick */
.tactil .aviso { bottom: auto; top: calc(70px + var(--seguro-arriba)); transform: translateX(-50%) translateY(-12px); }
.tactil .aviso.visible { transform: translateX(-50%) translateY(0); }

/* ---------- Paneles (ficha, lugares, ayuda) ---------- */
.panel {
  position: fixed;
  z-index: 30;
  top: calc(12px + var(--seguro-arriba));
  right: max(12px, var(--seguro-der));
  bottom: calc(12px + var(--seguro-abajo));
  width: min(400px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(13, 20, 37, 0.9);
  border: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: entrar-panel 0.28s ease;
}
@keyframes entrar-panel { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.panel__cabeza {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--linea);
}
.panel__cabeza h2 { font-size: var(--t-xl); }
.panel__sub { margin-top: 6px; font-style: italic; color: var(--polvo); font-size: var(--t-s); }
.panel__cuerpo { padding: 16px 20px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.panel__cuerpo p + p { margin-top: 12px; }
.cerrar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--linea-fuerte); }
.cerrar svg { width: 18px; height: 18px; }

.destino { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--f-titulo); font-size: var(--t-xs); letter-spacing: 0.04em; color: var(--polvo); }
.destino::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--adobe); }
.destino--perdido::before { background: var(--tinta); }

.datos { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: var(--t-s); }
.datos dt { font-family: var(--f-titulo); font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--adobe); padding-top: 3px; }
.datos dd { margin: 0; }
.nota { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--linea); font-size: var(--t-s); font-style: italic; color: var(--polvo); }

.lista-lugares { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lista-lugares button {
  width: 100%;
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  text-align: left;
  transition: background-color 0.15s ease;
}
.lista-lugares button:hover, .lista-lugares button:focus-visible { background: rgba(241, 236, 226, 0.08); }
.lista-lugares .n { font-family: var(--f-titulo); font-size: var(--t-xs); color: var(--polvo); }
.lista-lugares .nombre { font-family: var(--f-titulo); font-weight: 600; letter-spacing: 0.02em; }
.lista-lugares .lado { display: block; font-family: var(--f-texto); font-weight: 400; font-style: italic; font-size: var(--t-xs); color: var(--polvo); letter-spacing: 0; }
.lista-lugares svg { width: 16px; height: 16px; color: var(--polvo); }

/* Pausa de la computadora (al soltar el mouse) */
.pausa {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(10, 16, 32, 0.35);
  cursor: pointer;
}
.pausa__caja { padding: 16px 22px; border-radius: 14px; background: var(--vidrio); border: 1px solid var(--linea); font-family: var(--f-titulo); text-align: center; }
.pausa__caja small { display: block; margin-top: 4px; font-family: var(--f-texto); font-style: italic; color: var(--polvo); }

@media (max-width: 640px) {
  .panel {
    top: auto;
    left: max(8px, var(--seguro-izq));
    right: max(8px, var(--seguro-der));
    bottom: calc(8px + var(--seguro-abajo));
    width: auto;
    max-height: 72vh;
    animation-name: subir-panel;
  }
  @keyframes subir-panel { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
  .hud__titulo span { display: none; }
  .circular .txt { display: none; }
  .circular { padding: 0; width: 44px; }
  .entrada__caja { padding: 22px 18px 18px; }
  .ayuda li { grid-template-columns: 6.5em 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
