/* Modo historia: el juego. HUD inspirado en los mundos abiertos de consola,
   con letras y colores propios (la tipografía del juego solo va en imágenes). */
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/web/herramientas/fonts/Inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/web/herramientas/fonts/Inter-700.woff2') format('woff2'); }

:root {
  --fondo: #0b0714;
  --texto: #fdfbff;
  --suave: rgba(253, 251, 255, 0.72);
  --magenta: #ff2d9b;
  --verde: #6fd36b;
  --azul: #49a3ff;
  --amarillo: #f2b705;
  --panel: rgba(8, 6, 16, 0.78);
  --borde: rgba(255, 255, 255, 0.14);
  --sombra-texto: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--fondo); color: var(--texto); font-family: 'Inter', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body { touch-action: none; user-select: none; -webkit-user-select: none; }
#escena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; transition: filter 0.5s ease; }
#escena.gris { filter: grayscale(1) blur(2px) brightness(0.8); }
.oculto { display: none !important; }
button { font-family: inherit; }

/* ---------- pantallas completas ---------- */
.pantalla { position: fixed; inset: 0; display: none; z-index: 30; background: var(--fondo); }
.pantalla.visible { display: block; }
.menu-fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.7); }
.menu-caja { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85) 45%); }
.menu-gancho { margin: 0 0 6px; font-size: clamp(16px, 3.6vw, 22px); font-weight: 700; color: var(--suave); text-shadow: var(--sombra-texto); }
.menu-titulo { width: min(560px, 92vw); height: auto; display: block; margin: 0 auto 18px; }
.menu-ayuda { margin: 14px 0 0; font-size: 13px; color: var(--suave); }
.btn-juego { appearance: none; border: 2px solid #fff; background: var(--magenta); color: #fff; font-weight: 700; font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; padding: 14px 44px; border-radius: 6px; cursor: pointer; box-shadow: 0 6px 0 #000; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.btn-juego:active { transform: translateY(4px); box-shadow: 0 2px 0 #000; }
.btn-juego:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; }
.btn-juego.secundario { background: transparent; font-size: 15px; padding: 10px 22px; }

.carga-arte { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }
.carga-pie { position: absolute; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); }
.carga-consejo { margin: 0 0 10px; max-width: 560px; font-size: 15px; font-weight: 500; text-shadow: var(--sombra-texto); }
.carga-consejo b { color: var(--magenta); }
.carga-barra { height: 6px; background: rgba(255, 255, 255, 0.2); border-radius: 3px; overflow: hidden; max-width: 560px; }
.carga-barra span { display: block; height: 100%; width: 0; background: #fff; transition: width 0.3s ease; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud-aviso { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px; max-width: min(340px, 70vw); padding: 10px 14px; background: var(--panel); border-radius: 4px; font-size: 14px; line-height: 1.4; opacity: 0; transform: translateY(-8px); transition: opacity 0.3s ease, transform 0.3s ease; }
.hud-aviso.visible { opacity: 1; transform: none; }
.hud-aviso b { color: var(--magenta); }
.hud-puntaje { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 16px; text-align: right; }
.hud-puntos { font-size: clamp(26px, 5vw, 38px); font-weight: 700; text-shadow: var(--sombra-texto); font-variant-numeric: tabular-nums; }
.hud-puntos small { font-size: 0.45em; margin-left: 4px; color: var(--suave); }
.hud-estrellas { display: flex; gap: 4px; justify-content: flex-end; margin-top: 2px; }
.hud-estrellas i { width: 20px; height: 20px; background: rgba(255, 255, 255, 0.25); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); filter: drop-shadow(0 1px 0 #000); transition: background 0.3s ease, transform 0.3s ease; }
.hud-estrellas i.on { background: var(--amarillo); transform: scale(1.15); }
.hud-mapa { position: absolute; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 220px; }
#minimapa { width: 220px; height: 140px; display: block; border-radius: 10px; border: 2px solid rgba(0, 0, 0, 0.7); background: #1b2a22; }
.hud-barras { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4px; margin-top: 4px; }
.barra { height: 6px; background: rgba(0, 0, 0, 0.6); border-radius: 1px; overflow: hidden; }
.barra b { display: block; height: 100%; width: 100%; transition: width 0.4s ease; }
.barra.verde b { background: var(--verde); }
.barra.azul b { background: var(--azul); }
.barra.amarilla b { background: var(--amarillo); }
.hud-objetivo { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; width: min(560px, calc(100vw - 280px)); text-align: center; font-size: clamp(14px, 2.4vw, 18px); font-weight: 500; text-shadow: var(--sombra-texto); }
.hud-objetivo b { color: var(--magenta); }
.hud-accion { position: absolute; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 30px; background: var(--panel); border: 1px solid var(--borde); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.hud-accion kbd { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #000; font: 700 13px 'Inter', sans-serif; }
.joystick { position: absolute; left: 0; top: 0; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.2); }
.joystick span { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, 0.7); }

/* ---------- cinemática ---------- */
.franja { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 15; transition: height 0.6s ease; }
.franja.arriba { top: 0; }
.franja.abajo { bottom: 0; }
body.cine .franja { height: 11vh; }
body.cine #hud { opacity: 0; }
.dialogo { position: fixed; left: 50%; bottom: calc(13vh + 8px); transform: translateX(-50%); width: min(680px, calc(100vw - 32px)); z-index: 16; text-align: center; cursor: pointer; }
.dialogo-quien { margin: 0 0 4px; font-weight: 700; color: var(--amarillo); text-shadow: var(--sombra-texto); letter-spacing: 0.04em; }
.dialogo-texto { margin: 0; font-size: clamp(16px, 2.8vw, 21px); line-height: 1.4; text-shadow: var(--sombra-texto); }
.dialogo-texto b { color: var(--magenta); }
.dialogo-seguir { margin: 8px 0 0; font-size: 12px; color: var(--suave); }

/* ---------- pregunta ---------- */
.pregunta { position: fixed; z-index: 20; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; background: rgba(250, 248, 240, 0.97); color: #15121c; border-radius: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
.pregunta-tope { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: #6b6478; }
.pregunta-tiempo { flex: 1; max-width: 220px; height: 6px; background: #e1dde8; border-radius: 3px; overflow: hidden; }
.pregunta-tiempo b { display: block; height: 100%; width: 100%; background: var(--azul); }
.pregunta-eje { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--magenta); text-transform: uppercase; letter-spacing: 0.06em; }
.pregunta-enunciado { margin: 0 0 14px; font-size: clamp(17px, 3vw, 21px); line-height: 1.35; }
.pregunta-opciones { display: grid; gap: 8px; }
.pregunta-opciones button { appearance: none; text-align: left; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 2px solid #d7d2df; border-radius: 6px; background: #fff; color: inherit; font-size: 16px; cursor: pointer; min-height: 48px; }
.pregunta-opciones button span { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: 13px; }
.pregunta-opciones button:hover:not(:disabled) { border-color: #15121c; }
.pregunta-opciones button.bien { border-color: #1f9d4c; background: #e6f6ec; }
.pregunta-opciones button.mal { border-color: #c62828; background: #fdeaea; }
.pregunta-opciones button.descartada { opacity: 0.3; text-decoration: line-through; }
.pregunta-pie { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn-guia { appearance: none; border: 2px solid var(--amarillo); background: #fff7d6; color: #5c4400; font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 20px; cursor: pointer; }
.btn-guia:disabled { opacity: 0.4; cursor: default; }
.pregunta-explica { margin: 0; flex: 1 1 260px; font-size: 14px; color: #3d3747; }

/* ---------- grandes títulos ---------- */
.gran-titulo { position: fixed; inset: 0; z-index: 25; display: grid; place-content: center; text-align: center; pointer-events: none; animation: aparece 0.6s ease; }
.gran-titulo img { width: min(820px, 94vw); height: auto; }
.gran-titulo p { margin: 8px auto 0; max-width: 520px; padding: 0 16px; font-size: 17px; font-weight: 700; text-shadow: var(--sombra-texto); }
#gran-passed p { color: var(--amarillo); letter-spacing: 0.1em; }
@keyframes aparece { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* ---------- cierre ---------- */
#final { overflow-y: auto; touch-action: pan-y; user-select: text; }
#final .menu-fondo { position: fixed; } /* el fondo cubre todo el alto aunque se baje bajo el formulario */
.final-caja { position: relative; min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 12px; padding: 40px 16px calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.88) 38%); text-align: center; }
.final-titulo { margin: 0; font-size: clamp(30px, 6vw, 52px); line-height: 1.05; text-shadow: var(--sombra-texto); }
.final-titulo span { color: var(--magenta); }
.final-texto { margin: 0; max-width: 520px; color: var(--suave); line-height: 1.5; }
.final-caja [data-tesla-formulario] { width: min(480px, 100%); text-align: left; color: #15121c; }
.final-botones { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.final-nota { margin: 0; font-size: 12px; color: var(--suave); }

@media (max-width: 640px) {
  /* el aviso de cookies del sitio ocupa el pie: el botón queda por encima */
  .menu-caja { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
  .final-caja { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
  .hud-mapa { width: 140px; bottom: auto; top: calc(124px + env(safe-area-inset-top)); left: auto; right: 16px; }
  #minimapa { width: 140px; height: 90px; }
  .hud-objetivo { width: calc(100vw - 32px); bottom: calc(92px + env(safe-area-inset-bottom)); }
  .hud-aviso { max-width: calc(100vw - 150px); }
}
@media (prefers-reduced-motion: reduce) {
  .carga-arte, .gran-titulo { animation: none; }
}
/* ---------- v3: reloj, apuntes, celular, foto ---------- */
.hud-reloj { margin-top: 4px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: var(--sombra-texto); }
.hud-apuntes { margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--amarillo); text-shadow: var(--sombra-texto); }
.hud-apuntes.completo { color: var(--verde); }
.hud-celular { position: absolute; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); pointer-events: auto; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--borde); background: var(--panel); color: #fff; cursor: pointer; }
.hud-celular svg { width: 24px; height: 24px; }
.hud-celular kbd { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #000; font: 700 10px Inter, sans-serif; }
.hud-saltar { display: none; position: absolute; right: 74px; bottom: calc(76px + env(safe-area-inset-bottom)); pointer-events: auto; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--borde); background: var(--panel); color: #fff; cursor: pointer; place-items: center; }
.hud-saltar svg { width: 24px; height: 24px; }
@media (pointer: coarse) { .hud-saltar { display: grid; } .hud-celular kbd { display: none; } }
.hud-carga { position: absolute; right: 16px; top: 50%; margin: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; background: var(--panel); font-size: 13px; }
.hud-carga span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; animation: gira 0.8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.pregunta-apunte { margin: 0 0 10px; padding: 8px 10px; border-left: 4px solid var(--amarillo); background: #fff7d6; border-radius: 4px; font-size: 14px; color: #3d3200; }
.pregunta-apunte b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #7a5a00; }

.celular { position: fixed; inset: 0; z-index: 22; display: grid; place-items: end center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: rgba(0, 0, 0, 0.35); }
@media (min-width: 641px) { .celular { place-items: center end; padding-right: 40px; } }
.cel-equipo { width: min(320px, 100%); height: min(560px, calc(100vh - 32px)); display: flex; flex-direction: column; padding: 14px; border-radius: 34px; border: 6px solid #15121c; background: linear-gradient(160deg, #2a1d4a, #0b0714 70%); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); animation: sube 0.28s ease; overflow: hidden; }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cel-barra { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--suave); padding: 0 8px 10px; }
.cel-app { display: none; flex: 1; overflow-y: auto; touch-action: pan-y; }
.cel-app.activa { display: block; }
.cel-app h3 { margin: 4px 4px 10px; font-size: 20px; }
.cel-app h3 small { font-size: 13px; color: var(--suave); font-weight: 500; }
.cel-grilla { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; padding-top: 10px; }
.cel-grilla button { appearance: none; border: 0; background: none; color: #fff; font-size: 12px; font-weight: 500; display: grid; justify-items: center; gap: 6px; cursor: pointer; }
.cel-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; color: #fff; }
.cel-ico svg { width: 28px; height: 28px; }
.cel-ico.rosa { background: var(--magenta); }
.cel-ico.azul { background: #2f6fe0; }
.cel-ico.amarillo { background: #c99500; }
.cel-ico.verde { background: #2c9a4a; }
.cel-ico.gris { background: #555068; }
.cel-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cel-lista li { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); font-size: 14px; line-height: 1.35; display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; }
.cel-lista li span { color: var(--suave); }
.cel-lista li.falta { opacity: 0.55; }
#cel-apuntes-lista li b, #cel-apuntes-lista li span { flex: 1 1 100%; }
#cel-misiones-lista li { flex-wrap: nowrap; }
.cel-check { width: 16px; height: 16px; flex: none; border-radius: 4px; border: 2px solid var(--suave); }
.cel-lista li.hecha .cel-check { background: var(--verde); border-color: var(--verde); }
.cel-lista li.hecha { color: var(--suave); text-decoration: line-through; }
.cel-lista li.gana { background: rgba(242, 183, 5, 0.16); }
#cel-medallas-lista li span { flex: 1 1 100%; padding-left: 38px; }
.cel-lista li .medalla { width: 28px; height: 28px; }
.cel-boton { appearance: none; border: 1px solid var(--borde); background: rgba(255, 255, 255, 0.08); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 12px; cursor: pointer; min-height: 44px; }
.cel-boton.activa { background: var(--magenta); border-color: var(--magenta); }
.cel-fila { display: flex; gap: 6px; margin-bottom: 12px; }
.cel-fila .cel-boton { flex: 1; }
.cel-nota { margin: 8px 4px; font-size: 13px; color: var(--suave); }
.cel-app > .cel-boton { margin-top: 10px; width: 100%; }
.cel-pie { display: flex; gap: 8px; padding-top: 10px; }
.cel-pie .cel-boton { flex: 1; }

.medalla { display: inline-block; width: 44px; height: 44px; border-radius: 50%; flex: none; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(255, 255, 255, 0.25); }
.medalla.bronce { background: radial-gradient(circle at 35% 30%, #f0b27a, #9a5a2a); }
.medalla.plata { background: radial-gradient(circle at 35% 30%, #ffffff, #9aa3b0); }
.medalla.oro { background: radial-gradient(circle at 35% 30%, #fff1a8, #c99500); }
.medalla.diamante { background: radial-gradient(circle at 35% 30%, #e8fbff, #49a3ff 60%, #7a4cff); }
.final-medalla { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); text-align: left; }
.final-medalla p { margin: 0; display: grid; }
.final-medalla span { font-size: 13px; color: var(--suave); }

.foto { position: fixed; inset: 0; z-index: 21; pointer-events: none; }
.foto-tope { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; pointer-events: auto; }
.foto-filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.foto-filtros button { appearance: none; border: 1px solid var(--borde); background: var(--panel); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 20px; cursor: pointer; }
.foto-filtros button.activa { background: #fff; color: #000; }
.foto-hora { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; background: var(--panel); font-size: 13px; font-weight: 700; }
.foto-hora input { width: 130px; accent-color: var(--magenta); }
.foto-pie { position: absolute; left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; pointer-events: auto; }
.foto-disparo { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, 0.25); cursor: pointer; }
.foto-disparo:active { background: #fff; }
.foto-zoom { display: flex; gap: 6px; }
.foto-zoom .cel-boton { width: 44px; font-size: 20px; padding: 0; }
.foto-ayuda { position: absolute; left: 0; right: 0; bottom: calc(100px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 12px; color: var(--suave); text-shadow: var(--sombra-texto); }
.foto-flash { position: fixed; inset: 0; z-index: 26; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.foto-flash.on { opacity: 0.85; transition: none; }
.foto-vista { position: fixed; inset: 0; z-index: 27; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; background: rgba(0, 0, 0, 0.85); }
.foto-vista img { max-width: min(920px, 100%); max-height: 70vh; border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
body.foto-activa #hud { display: none; }

@media (max-width: 640px) {
  .hud-celular, .hud-saltar { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .foto-hora input { width: 100px; }
  /* el celular arriba: abajo está el aviso de cookies del sitio */
  .celular { place-items: start center; padding-top: calc(16px + env(safe-area-inset-top)); }
  .cel-equipo { height: min(540px, calc(100vh - 220px)); }
  .foto-pie { bottom: calc(190px + env(safe-area-inset-bottom)); }
  .foto-ayuda { bottom: calc(270px + env(safe-area-inset-bottom)); }
}

/* ---------- v4: charla con el profe (IA) y su pista ---------- */
.cel-ico.morado { background: #7a4cff; }
.btn-guia.pista { border-color: #7a4cff; background: #efe9ff; color: #3b1f8f; }
.pregunta-pista { margin: 0 0 10px; padding: 8px 10px; border-left: 4px solid #7a4cff; background: #efe9ff; border-radius: 4px; font-size: 14px; color: #2a1766; }
.pregunta-pista b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #5a3cc4; }
.charla { position: fixed; z-index: 23; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: rgba(11, 7, 20, 0.92); border: 1px solid var(--borde); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); animation: sube 0.25s ease; }
.charla-tope { display: flex; align-items: center; gap: 8px; }
.charla-tope p { flex: 1; margin: 0; display: grid; }
.charla-tope b { color: var(--amarillo); letter-spacing: 0.06em; }
.charla-tope span { font-size: 12px; color: var(--suave); }
.charla-tope .cel-boton { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.charla-lista { flex: 1; overflow-y: auto; touch-action: pan-y; display: flex; flex-direction: column; gap: 8px; min-height: 120px; user-select: text; }
.charla-lista p { margin: 0; max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: 15px; line-height: 1.4; }
.charla-profe { align-self: flex-start; background: rgba(255, 255, 255, 0.09); }
.charla-profe b { display: block; font-size: 11px; letter-spacing: 0.08em; color: var(--amarillo); }
.charla-alumno { align-self: flex-end; background: var(--magenta); }
.charla-profe.escribiendo span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--suave); animation: punto 1s infinite ease-in-out; }
.charla-profe.escribiendo span:nth-child(3) { animation-delay: 0.15s; }
.charla-profe.escribiendo span:nth-child(4) { animation-delay: 0.3s; }
@keyframes punto { 0%, 100% { opacity: 0.3; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }
.charla-sugeridas { display: flex; flex-wrap: wrap; gap: 6px; }
.charla-sugeridas:empty { display: none; }
.charla-sugeridas button { appearance: none; border: 1px solid var(--borde); background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 16px; cursor: pointer; }
.charla-form { display: flex; gap: 8px; }
.charla-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--borde); background: rgba(255, 255, 255, 0.08); color: #fff; font: 500 16px Inter, sans-serif; user-select: text; }
.charla-form input:focus-visible { outline: 2px solid var(--magenta); outline-offset: 1px; }
.charla-form .btn-juego { font-size: 14px; padding: 8px 16px; box-shadow: 0 3px 0 #000; }
.charla-nota { margin: 0; font-size: 11px; color: var(--suave); text-align: center; }
@media (max-width: 640px) {
  .charla { bottom: auto; top: calc(12px + env(safe-area-inset-top)); max-height: calc(100vh - 230px); }
}
/* ---------- v5: gráficas de videojuego, cinemáticas y el recuadro del profe ---------- */
/* títulos en Anton (Google Fonts, libre); el resto sigue en Inter */
:root { --titulo: 'Anton', 'Inter', Impact, sans-serif; --contorno: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 5px 0 #000, 0 0 18px rgba(0, 0, 0, 0.6); }

/* presentación de personaje: cuadro congelado, sin color y con tinte magenta */
body.gx-congelado #escena { filter: saturate(0.12) contrast(1.18) brightness(0.92); transition: filter 0.18s ease; }
body.gx-congelado #hud { opacity: 0; }
.gx-presenta { position: fixed; inset: 0; z-index: 24; pointer-events: none; display: none; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 0 max(16px, 6vw) calc(20vh + env(safe-area-inset-bottom)); }
.gx-presenta::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(160, 30, 190, 0.35), rgba(255, 45, 155, 0.42)); mix-blend-mode: color; }
.gx-presenta::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 70%, transparent 35%, rgba(20, 0, 30, 0.55)); }
.gx-presenta.visible { display: flex; }
/* la alumna se presenta con el juego andando: sin el velo de color ni la viñeta (R12) */
.gx-presenta.en-juego::before, .gx-presenta.en-juego::after { display: none; }
/* R13: con el juego andando, el nombre más chico y a un tercio de la pantalla (a la izquierda: la
   cámara la deja a ella a la derecha) y el minimapa se esconde mientras pasa (le tapaba 51-57 % del cuerpo
   en 1366-1536 px y pisaba el minimapa) */
.gx-presenta.en-juego { justify-content: flex-start; padding: 30vh max(16px, 6vw) 0; }
.gx-presenta.en-juego .gx-presenta-nombre { font-size: clamp(40px, 4.4vw, 72px); }
.gx-presenta.en-juego .gx-presenta-rotulo { font-size: clamp(13px, 1.4vw, 17px); }
/* el minimapa se va de una vez y vuelve con un fundido */
.hud-mapa, #minimapa { transition: opacity 0.25s ease; }
body.presentando .hud-mapa, body.presentando #minimapa { opacity: 0; transition: none; }
.gx-presenta p { position: relative; z-index: 1; margin: 0; }
.gx-presenta-nombre { font-family: var(--titulo); font-size: clamp(46px, 10vw, 120px); line-height: 0.95; text-transform: uppercase; letter-spacing: 0.01em; color: #fff; text-shadow: var(--contorno); animation: gx-entra-nombre 0.42s cubic-bezier(0.2, 0.9, 0.2, 1.15) both; }
.gx-presenta .gx-presenta-rotulo { margin-top: 10px; padding: 5px 12px; background: var(--magenta); color: #fff; font-weight: 700; font-size: clamp(14px, 2.2vw, 20px); box-shadow: 0 4px 0 #000; animation: gx-entra-rotulo 0.35s 0.18s ease-out both; }
.gx-presenta.sale p { animation: gx-sale 0.3s ease-in forwards; }
@keyframes gx-entra-nombre { from { opacity: 0; transform: translateX(-60px) skewX(-12deg); } to { opacity: 1; transform: none; } }
@keyframes gx-entra-rotulo { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes gx-sale { to { opacity: 0; transform: translateX(30px); } }

/* rótulo de lugar y hora */
.gx-lugar { position: fixed; z-index: 12; top: calc(14px + env(safe-area-inset-top)); left: 16px; padding: 7px 14px 7px 12px; border-left: 5px solid var(--magenta); background: rgba(8, 6, 16, 0.7); font-weight: 700; font-size: clamp(12px, 1.8vw, 15px); letter-spacing: 0.2em; text-transform: uppercase; text-shadow: 0 1px 0 #000; pointer-events: none; opacity: 0; clip-path: inset(0 100% 0 0); transition: opacity 0.4s ease; }
.gx-lugar.visible { opacity: 1; animation: gx-barrido 0.55s ease-out forwards; }
@keyframes gx-barrido { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
body.cine .gx-lugar { top: calc(11vh + 12px); }
/* mientras está el rótulo, los avisos bajan un poco: no se tapan */
body.gx-con-lugar .hud-aviso { top: calc(62px + env(safe-area-inset-top)); }

/* banda de misión */
.gx-banda { position: fixed; z-index: 19; left: 0; right: 0; top: 36%; display: grid; justify-items: center; gap: 2px; padding: 14px 16px 16px; pointer-events: none; text-align: center; background: linear-gradient(90deg, transparent, rgba(8, 6, 16, 0.82) 18%, rgba(8, 6, 16, 0.82) 82%, transparent); border-top: 2px solid rgba(255, 45, 155, 0.7); border-bottom: 2px solid rgba(255, 45, 155, 0.7); opacity: 0; transform: scaleY(0.2); transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1.1); }
.gx-banda.visible { opacity: 1; transform: none; }
/* una pregunta abierta manda: la banda no tapa las alternativas */
body:has(#pregunta:not(.oculto)) .gx-banda { opacity: 0; }
.gx-banda-tipo { font-weight: 700; font-size: clamp(11px, 1.6vw, 14px); letter-spacing: 0.42em; text-transform: uppercase; color: var(--magenta); text-shadow: 0 1px 0 #000; }
.gx-banda.cumplida { border-color: rgba(111, 211, 107, 0.75); }
.gx-banda.cumplida .gx-banda-tipo { color: var(--verde); }
.gx-banda-titulo { font-family: var(--titulo); font-weight: 400; font-size: clamp(30px, 5.5vw, 58px); line-height: 1.05; text-transform: uppercase; color: #fff; text-shadow: var(--contorno); }

/* +150 PTS que salta y el contador que late */
.gx-salto { position: fixed; z-index: 21; top: calc(156px + env(safe-area-inset-top)); right: 18px; margin: 0; font-family: var(--titulo); font-size: clamp(30px, 5vw, 46px); text-transform: uppercase; color: #5ff26a; text-shadow: var(--contorno); pointer-events: none; animation: gx-salta 1.6s ease-out forwards; }
.gx-salto.mal { color: #ff4646; }
@media (max-width: 640px) { .gx-salto { top: calc(226px + env(safe-area-inset-top)); } }
@keyframes gx-salta { 0% { opacity: 0; transform: translateY(14px) scale(0.6); } 14% { opacity: 1; transform: translateY(0) scale(1.15); } 26% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
.hud-puntos { display: inline-block; transform-origin: right center; }
.hud-puntaje.gx-sube .hud-puntos { animation: gx-late 0.7s ease-out; }
.hud-puntaje.gx-sube .hud-estrellas i.on { animation: gx-late-estrella 0.7s ease-out; }
@keyframes gx-late { 0% { transform: scale(1); color: #fff; } 30% { transform: scale(1.22); color: #5ff26a; } 100% { transform: scale(1); color: #fff; } }
@keyframes gx-late-estrella { 30% { transform: scale(1.45); } 100% { transform: scale(1.15); } }

/* destello de transición */
.gx-destello { position: fixed; inset: 0; z-index: 45; background: #fff; opacity: 0; pointer-events: none; }
.gx-destello.on { animation: gx-destello 0.55s ease-out; }
@keyframes gx-destello { 0% { opacity: 0; } 35% { opacity: 0.95; } 100% { opacity: 0; } }

/* reproductor de cinemáticas */
.cin { position: fixed; inset: 0; z-index: 40; background: #000; }
.cin-video, .cin-video video { position: absolute; inset: 0; width: 100%; height: 100%; }
.cin-video video { object-fit: contain; background: #000; }
.cin-sub { position: absolute; left: 50%; bottom: calc(7vh + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: min(900px, calc(100vw - 32px)); margin: 0; padding: 6px 14px; border-radius: 4px; background: rgba(0, 0, 0, 0.62); font-weight: 700; font-size: clamp(16px, 2.5vw, 24px); line-height: 1.35; text-align: center; white-space: pre-line; text-shadow: 0 2px 0 #000; opacity: 0; transition: opacity 0.2s ease; }
.cin-sub.visible { opacity: 1; }
.cin-saltar { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; overflow: hidden; border: 1px solid var(--borde); border-radius: 22px; background: rgba(8, 6, 16, 0.7); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; animation: aparece 0.4s 0.8s ease both; }
.cin-saltar:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
.cin-saltar kbd { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 5px; background: #fff; color: #000; font: 700 11px Inter, sans-serif; text-transform: none; }
.cin-saltar-carga { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--magenta); }
.cin-saltar-carga.llena { width: 100%; transition: width 0.8s linear; }
@media (pointer: coarse) { .cin-saltar kbd { display: none; } }

/* el recuadro del profe en la charla: como una videollamada */
.charla-cara { position: relative; flex: none; width: 76px; height: 76px; overflow: hidden; border-radius: 12px; border: 2px solid var(--borde); background: #1a1424; transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.charla-cara img, .charla-cara video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.charla-cara img { object-position: 50% 0; transform: scale(2.6); transform-origin: 50% 46%; }
.charla-cara video { opacity: 0; transition: opacity 0.25s ease; }
.charla-cara video.visible { opacity: 1; }
.charla-cara.hablando { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(255, 45, 155, 0.25); }
@media (max-width: 640px) { .charla-cara { width: 56px; height: 56px; } }

@media (prefers-reduced-motion: reduce) {
  .franja { transition: none; }
  .gx-presenta-nombre, .gx-presenta .gx-presenta-rotulo, .gx-presenta.sale p, .gx-lugar.visible, .cin-saltar,
  .hud-puntaje.gx-sube .hud-puntos, .hud-puntaje.gx-sube .hud-estrellas i.on { animation: none; }
  .gx-lugar { clip-path: none; transition: none; }
  .gx-banda { transform: none; transition: none; }
  .gx-salto { animation: gx-salta-quieto 1.6s linear forwards; }
  .gx-destello { background: #000; }
  .gx-destello.on { animation: gx-destello 0.25s linear; }
  .cin-saltar-carga.llena { transition: none; }
}
@keyframes gx-salta-quieto { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* ---------- v6: planos de diálogo (el profe habla en cámara) ---------- */
/* el video llena lo que queda entre las franjas; la caja de diálogo va encima como subtítulo */
.dlg-plano { position: fixed; inset: 0; z-index: 14; background: #000; pointer-events: none; }
.dlg-cuadro { position: absolute; left: 0; right: 0; top: 11vh; bottom: 11vh; overflow: hidden; }
.dlg-cuadro video { width: 100%; height: 100%; object-fit: cover; display: block; }
body.dlg-activo #hud { opacity: 0; }
body.dlg-activo .dialogo { bottom: calc(11vh + 14px); }
body.dlg-activo .dialogo-texto { display: inline; padding: 2px 8px; background: rgba(0, 0, 0, 0.55); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.dlg-suelto { z-index: 16; cursor: default; pointer-events: none; }
.dlg-suelto .dialogo-texto { display: inline; padding: 2px 8px; background: rgba(0, 0, 0, 0.55); box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* recuadro grande de videollamada junto a «Mission passed» */
.dlg-recuadro { position: fixed; z-index: 26; right: max(16px, 4vw); bottom: calc(6vh + env(safe-area-inset-bottom)); width: min(40vw, 440px); padding: 8px; border-radius: 14px; background: rgba(8, 6, 16, 0.86); border: 2px solid var(--magenta); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(255, 45, 155, 0.2); pointer-events: none; animation: sube 0.35s ease; }
.dlg-recuadro-video { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #000; }
.dlg-recuadro-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlg-recuadro-quien { margin: 8px 4px 0; font-weight: 700; font-size: 12px; letter-spacing: 0.08em; color: var(--amarillo); }
.dlg-recuadro-texto { margin: 2px 4px 2px; font-weight: 700; font-size: clamp(14px, 1.8vw, 17px); line-height: 1.35; }
@media (max-width: 640px) { .dlg-recuadro { left: 16px; right: 16px; width: auto; bottom: calc(16px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .dlg-recuadro { animation: none; } }
body.dlg-activo .gx-banda, body.dlg-activo .gx-lugar { opacity: 0; } /* el plano del profe manda: ni banda ni rótulo encima */
/* ---------- v7: minimapa redondo, objetivo con distancia, velocidad, logros y estadísticas ---------- */
.hud-mapa { width: 164px; }
#minimapa { width: 164px; height: 164px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.88); background: #1b2a22; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.45); }
.hud-barras { margin-top: 8px; }
@media (max-width: 640px) {
  .hud-mapa { width: 112px; }
  #minimapa { width: 112px; height: 112px; }
  .gx-salto { top: calc(262px + env(safe-area-inset-top)); }
}

/* marcador del objetivo: un rombo magenta con la distancia */
.gx-meta { position: fixed; left: 0; top: 0; z-index: 9; display: grid; justify-items: center; gap: 2px; margin: -18px 0 0 -30px; width: 60px; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; will-change: transform; }
.gx-meta.visible { opacity: 1; }
.gx-meta-punta { width: 18px; height: 18px; background: var(--magenta); border: 2px solid #fff; transform: rotate(45deg); box-shadow: 0 2px 0 #000; }
.gx-meta-dist { padding: 1px 7px; border-radius: 10px; background: rgba(8, 6, 16, 0.72); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 #000; }
.gx-meta:not(.fuera) .gx-meta-punta { display: none; } /* en pantalla ya está el cono del objetivo: queda la distancia */
.gx-meta.fuera .gx-meta-punta { width: 14px; height: 14px; opacity: 0.85; }
.gx-meta.cerca { opacity: 0 !important; }
body.cine .gx-meta, body.foto-activa .gx-meta { opacity: 0 !important; }

/* líneas de velocidad: rayas desde los bordes, con el centro limpio */
.gx-velocidad { position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: 0; background: repeating-conic-gradient(from 0deg at 50% 52%, rgba(255, 255, 255, 0.0) 0deg 3.2deg, rgba(255, 255, 255, 0.55) 3.4deg 3.6deg, rgba(255, 255, 255, 0.0) 3.8deg 7deg); -webkit-mask-image: radial-gradient(ellipse at 50% 52%, transparent 42%, #000 78%); mask-image: radial-gradient(ellipse at 50% 52%, transparent 42%, #000 78%); }
.gx-velocidad::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 52%, transparent 55%, rgba(10, 6, 20, 0.45)); }

/* avisos de logro, en la esquina de abajo a la derecha */
.gx-logro { position: fixed; z-index: 13; right: 16px; bottom: calc(136px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; max-width: min(320px, calc(100vw - 32px)); padding: 10px 14px 10px 10px; border-radius: 12px; background: rgba(8, 6, 16, 0.88); border: 1px solid rgba(242, 183, 5, 0.6); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); pointer-events: none; opacity: 0; transform: translateX(30px); transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1.1); }
.gx-logro.visible { opacity: 1; transform: none; }
.gx-logro-ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--amarillo); color: #1a1200; }
.gx-logro-ico svg { width: 22px; height: 22px; }
.gx-logro p { margin: 0; display: grid; line-height: 1.25; }
.gx-logro small { font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amarillo); }
.gx-logro b { font-size: 15px; }
.gx-logro span { font-size: 12px; color: var(--suave); }
.gx-logro span:empty { display: none; }
body.cine .gx-logro { bottom: calc(11vh + 16px); }

/* tarjeta de misión cumplida con estadísticas */
.gx-tarjeta { position: fixed; z-index: 26; left: 50%; top: 50%; width: min(420px, calc(100vw - 32px)); padding: 18px 22px 20px; border-radius: 14px; background: rgba(8, 6, 16, 0.92); border: 2px solid var(--verde); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); pointer-events: none; text-align: center; opacity: 0; transform: translate(-50%, -46%) scale(0.96); transition: opacity 0.3s ease, transform 0.35s ease; }
.gx-tarjeta.visible { opacity: 1; transform: translate(-50%, -50%); }
.gx-tarjeta-tipo { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.4em; text-transform: uppercase; color: var(--verde); }
.gx-tarjeta-titulo { margin: 2px 0 12px; font-family: var(--titulo); font-size: clamp(30px, 6vw, 44px); text-transform: uppercase; text-shadow: var(--contorno); }
.gx-tarjeta dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; text-align: left; }
.gx-tarjeta dt { color: var(--suave); font-size: 15px; }
.gx-tarjeta dd { margin: 0; font-family: var(--titulo); font-size: 24px; font-variant-numeric: tabular-nums; text-align: right; }

/* destello suave del acierto */
.gx-acierto { position: fixed; inset: 0; z-index: 21; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.55), rgba(95, 242, 106, 0.25) 60%, transparent); }
.gx-acierto.on { animation: gx-acierto 0.6s ease-out; }
@keyframes gx-acierto { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .gx-logro, .gx-tarjeta { transition: none; transform: none; }
  .gx-tarjeta.visible { transform: translate(-50%, -50%); }
  .gx-tarjeta { transform: translate(-50%, -50%); }
  .gx-acierto.on { animation: none; }
}
@media (max-width: 640px) { .gx-lugar { max-width: calc(100vw - 150px); letter-spacing: 0.1em; font-size: 11px; line-height: 1.35; } } /* el rótulo no choca con el puntaje */
/* en pantallas táctiles no se habla de teclas */
body.tactil .solo-teclado, body:not(.tactil) .solo-tactil { display: none; }
body.tactil .hud-accion kbd, body.tactil .hud-celular kbd { display: none; }
/* ---------- v8: barras con nombre, panel del ensayo de videojuego, HUD del celular sin pisarse ---------- */
/* barras de energía, concentración y guía: ícono, nombre y riel */
.hud-mapa { width: 200px; }
.hud-barras { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; padding: 8px 10px 9px; border-left: 4px solid var(--magenta); border-radius: 4px; background: rgba(8, 6, 16, 0.66); }
.barra { --c: #fff; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto 8px; column-gap: 8px; row-gap: 3px; align-items: center; height: auto; overflow: visible; background: none; border-radius: 0; }
.barra.verde { --c: var(--verde); }
.barra.azul { --c: var(--azul); }
.barra.amarilla { --c: var(--amarillo); }
.barra-ico { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--c); filter: drop-shadow(0 1px 0 #000); }
.barra-nombre { font-size: 11px; font-weight: 700; line-height: 1.35; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-riel { display: block; height: 8px; overflow: hidden; border-radius: 2px; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(0, 0, 0, 0.55); }
.barra .barra-riel b { display: block; height: 100%; width: 100%; background: var(--c); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); transition: width 0.4s ease; }
.barra.baja .barra-ico { color: #ff4646; }
.barra.baja .barra-riel b { background: #ff4646; animation: barra-baja 0.9s ease-in-out infinite; }
@keyframes barra-baja { 50% { opacity: 0.45; } }

/* el +PTS: una calcomanía oscura, legible encima de cualquier cosa */
.gx-salto { padding: 0 12px; border-radius: 4px; background: rgba(8, 6, 16, 0.82); border-left: 4px solid #5ff26a; line-height: 1.15; }
.gx-salto.mal { border-left-color: #ff4646; }
.gx-salto.en-panel { z-index: 22; translate: 0 -55%; } /* en la esquina del panel de la pregunta */

/* acción y diálogo: en táctil, un dedo en vez de la tecla */
.ico-toque { width: 20px; height: 20px; flex: none; }
.dialogo-seguir .ico-toque { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.hud-accion { border: 2px solid var(--amarillo); min-height: 48px; box-shadow: 0 4px 0 #000; }

/* ---------- panel del ensayo ---------- */
.pregunta { width: min(640px, calc(100vw - 32px)); padding: 16px 18px 18px; color: #fff; border: 2px solid rgba(255, 45, 155, 0.8); border-radius: 10px; background: linear-gradient(180deg, rgba(24, 14, 40, 0.95), rgba(8, 6, 16, 0.95)); box-shadow: 0 0 0 4px rgba(255, 45, 155, 0.16), 0 24px 60px rgba(0, 0, 0, 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); touch-action: pan-y; transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.pregunta::before { content: ''; position: absolute; left: 0; top: 0; width: 56px; height: 5px; background: var(--amarillo); }
.pregunta.resuelta.bien { border-color: var(--verde); box-shadow: 0 0 0 4px rgba(111, 211, 107, 0.2), 0 24px 60px rgba(0, 0, 0, 0.7); }
.pregunta.resuelta.mal { border-color: #ff4646; box-shadow: 0 0 0 4px rgba(255, 70, 70, 0.2), 0 24px 60px rgba(0, 0, 0, 0.7); }
.pregunta-tope { gap: 10px; color: var(--suave); }
.pregunta-num { white-space: nowrap; font-family: var(--titulo); font-weight: 400; font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 #000; }
.pregunta-reloj { width: 18px; height: 18px; margin-left: auto; flex: none; color: var(--suave); }
.pregunta-tiempo { flex: 0 1 220px; min-width: 70px; height: 10px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 2px; transform: skewX(-20deg); }
.pregunta-tiempo b { background: var(--verde); }
.pregunta-eje { display: inline-block; margin: 12px 0 10px; padding: 3px 10px; background: var(--magenta); color: #fff; font-size: 11px; letter-spacing: 0.16em; box-shadow: 0 3px 0 #000; }
.pregunta-enunciado { margin: 0 0 14px; color: #fff; font-size: clamp(18px, 3vw, 23px); font-weight: 700; line-height: 1.3; text-shadow: 0 2px 0 #000; }
.pregunta-apunte { color: #fff4cc; background: rgba(242, 183, 5, 0.13); }
.pregunta-apunte b { color: var(--amarillo); }
.pregunta-pista { color: #ece5ff; background: rgba(122, 76, 255, 0.18); border-left-color: #9b7bff; }
.pregunta-pista b { color: #c4b2ff; }
.pregunta-opciones button { position: relative; gap: 12px; min-height: 52px; padding: 10px 14px 10px 12px; border: 2px solid rgba(255, 255, 255, 0.16); border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 17px; transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease; }
.pregunta-opciones button .op-letra { display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin: 0 6px; border: 2px solid var(--amarillo); border-radius: 4px; background: #15101f; transform: rotate(45deg); font-size: inherit; box-shadow: 0 2px 0 #000; transition: background 0.15s ease, border-color 0.15s ease; }
.pregunta-opciones button .op-letra i { transform: rotate(-45deg); font-family: var(--titulo); font-style: normal; font-size: 16px; color: var(--amarillo); }
.pregunta-opciones button .op-texto { display: block; flex: 1; width: auto; height: auto; border: 0; border-radius: 0; font-weight: 500; font-size: inherit; line-height: 1.3; }
.pregunta-opciones button:focus-visible { outline: none; border-color: var(--amarillo); background: rgba(242, 183, 5, 0.12); box-shadow: inset 4px 0 0 var(--amarillo); transform: translateX(4px); }
.pregunta-opciones button:focus-visible .op-letra { background: var(--amarillo); }
.pregunta-opciones button:focus-visible .op-letra i { color: #1a1200; }
/* el hover solo con mouse: en táctil se quedaría pegado después del toque */
@media (hover: hover) {
  .pregunta-opciones button:hover:not(:disabled) { border-color: var(--amarillo); background: rgba(242, 183, 5, 0.12); box-shadow: inset 4px 0 0 var(--amarillo); transform: translateX(4px); }
  .pregunta-opciones button:hover:not(:disabled) .op-letra { background: var(--amarillo); }
  .pregunta-opciones button:hover:not(:disabled) .op-letra i { color: #1a1200; }
  .btn-guia:not(:disabled):hover { filter: brightness(1.2); }
}
.pregunta-opciones button:disabled { cursor: default; }
.pregunta-opciones button.bien { border-color: var(--verde); background: rgba(111, 211, 107, 0.2); color: #fff; }
.pregunta-opciones button.bien .op-letra { border-color: var(--verde); background: var(--verde); }
.pregunta-opciones button.bien .op-letra i { color: #0b2a0d; }
.pregunta-opciones button.mal { border-color: #ff4646; background: rgba(255, 70, 70, 0.18); color: #fff; }
.pregunta-opciones button.mal .op-letra { border-color: #ff4646; background: #ff4646; }
.pregunta-opciones button.mal .op-letra i { color: #2a0606; }
.pregunta-opciones button.bien::after, .pregunta-opciones button.mal::after { flex: none; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.pregunta-opciones button.bien::after { content: 'Correcta'; background: var(--verde); color: #0b2a0d; }
.pregunta-opciones button.mal::after { content: 'Tu respuesta'; background: #ff4646; color: #2a0606; }
.pregunta-opciones button.descartada { opacity: 0.28; text-decoration: none; }
.pregunta-opciones button.descartada .op-texto { text-decoration: line-through; }
.pregunta-pie { gap: 10px; }
.btn-guia { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 2px solid var(--amarillo); border-radius: 6px; background: rgba(242, 183, 5, 0.14); color: #ffd85a; font-size: 14px; box-shadow: 0 3px 0 #000; }
.btn-guia svg { width: 18px; height: 18px; flex: none; }
.btn-guia small { margin-left: 4px; font-size: 12px; font-weight: 500; opacity: 0.8; }
.btn-guia.pista { border-color: #9b7bff; background: rgba(122, 76, 255, 0.2); color: #dcd0ff; }
.btn-guia:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.pregunta-explica { color: #fff; font-size: 15px; line-height: 1.4; }
.pregunta-explica:empty { display: none; }
.pregunta.resuelta .pregunta-explica { flex-basis: 100%; padding: 8px 12px; border-radius: 4px; border-left: 4px solid; }
.pregunta.resuelta.bien .pregunta-explica { border-left-color: var(--verde); background: rgba(111, 211, 107, 0.14); }
.pregunta.resuelta.mal .pregunta-explica { border-left-color: #ff4646; background: rgba(255, 70, 70, 0.14); }
/* entrada: el panel crece y las alternativas entran una tras otra */
.pregunta.entra { animation: preg-entra 0.36s cubic-bezier(0.2, 0.9, 0.2, 1.12) both; }
.pregunta.entra .pregunta-opciones button { animation: op-entra 0.3s calc(0.1s + var(--i, 0) * 0.06s) ease-out both; }
.pregunta.entra .pregunta-opciones button.mal { animation: op-tiembla 0.4s ease-in-out; }
@keyframes preg-entra { from { opacity: 0; scale: 0.92; } to { opacity: 1; scale: 1; } }
@keyframes op-entra { from { opacity: 0; translate: -18px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes op-tiembla { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }

/* ---------- cinemáticas en el celular vertical: llenan la pantalla ---------- */
.cin-video::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); pointer-events: none; }
.cin.vertical .cin-video video { object-fit: cover; }
@media (orientation: portrait) { .cin-video video { object-fit: cover; } }
.cin.vertical .cin-sub { bottom: calc(10vh + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); padding: 8px 14px; background: rgba(0, 0, 0, 0.72); font-size: clamp(18px, 5vw, 22px); }
.cin-saltar { min-height: 48px; padding: 8px 16px; border: 2px solid rgba(255, 255, 255, 0.8); background: rgba(8, 6, 16, 0.78); box-shadow: 0 3px 0 #000; }

/* ---------- celular vertical ---------- */
@media (max-width: 640px) {
  .hud-mapa { width: 150px; top: calc(124px + env(safe-area-inset-top)); right: 16px; }
  #minimapa { width: 112px; height: 112px; margin-left: auto; }
  .hud-barras { gap: 4px; margin-top: 8px; padding: 6px 8px 7px; border-left-width: 3px; }
  .barra { grid-template-columns: 18px 1fr; grid-template-rows: auto 6px; column-gap: 6px; row-gap: 2px; }
  .barra-ico { width: 18px; height: 18px; }
  .barra-nombre { font-size: 10px; letter-spacing: 0.06em; }
  .barra-riel { height: 6px; }
  .gx-banda { top: 43%; }
  .gx-salto { top: calc(128px + env(safe-area-inset-top)); right: 142px; font-size: 30px; }
  .gx-logro { bottom: calc(212px + env(safe-area-inset-bottom)); max-width: min(260px, calc(100vw - 32px)); }
  .hud-objetivo { bottom: calc(94px + env(safe-area-inset-bottom)); }
  /* con el ensayo abierto: el panel manda; abajo quedan las barras en fila */
  body:has(#pregunta:not(.oculto)) #minimapa,
  body:has(#pregunta:not(.oculto)) .hud-objetivo,
  body:has(#pregunta:not(.oculto)) .hud-celular,
  body:has(#pregunta:not(.oculto)) .hud-saltar,
  body:has(#pregunta:not(.oculto)) .hud-accion,
  body:has(#pregunta:not(.oculto)) .gx-logro { display: none; }
  body:has(#pregunta:not(.oculto)) .hud-mapa { top: auto; left: 10px; right: 10px; width: auto; bottom: calc(10px + env(safe-area-inset-bottom)); }
  body:has(#pregunta:not(.oculto)) .hud-barras { grid-template-columns: 0.9fr 1.25fr 0.8fr; gap: 8px; margin: 0; }
  body:has(#pregunta:not(.oculto)) .barra { column-gap: 5px; }
  body:has(#pregunta:not(.oculto)) .barra-nombre { letter-spacing: 0; }
  .pregunta { top: calc(114px + env(safe-area-inset-top)); bottom: calc(76px + env(safe-area-inset-bottom)); left: 10px; right: 10px; width: auto; max-height: none; height: fit-content; margin: auto 0; transform: none; padding: 14px 14px 16px; }
  .pregunta-num { font-size: 18px; }
  .pregunta-tiempo { flex-basis: 120px; }
  .pregunta-enunciado { font-size: 18px; margin-bottom: 12px; }
  .pregunta-opciones button { font-size: 16px; min-height: 50px; }
  .btn-guia { font-size: 13px; padding: 8px 12px; }
}

/* ---------- celular horizontal (poco alto): el HUD en una columna a la derecha ---------- */
@media (max-height: 500px) and (min-width: 641px) {
  .hud-puntos { font-size: 28px; }
  .hud-estrellas i { width: 14px; height: 14px; }
  .hud-reloj { font-size: 13px; margin-top: 2px; }
  .hud-apuntes { font-size: 11px; }
  .hud-mapa { left: auto; right: 16px; bottom: auto; top: calc(104px + env(safe-area-inset-top)); width: 136px; }
  #minimapa { width: 78px; height: 78px; margin-left: auto; border-width: 2px; }
  .hud-barras { gap: 3px; margin-top: 6px; padding: 5px 7px 6px; border-left-width: 3px; }
  .barra { grid-template-columns: 16px 1fr; grid-template-rows: auto 5px; column-gap: 6px; row-gap: 2px; }
  .barra-ico { width: 16px; height: 16px; }
  .barra-nombre { font-size: 9px; letter-spacing: 0.06em; }
  .barra-riel { height: 5px; }
  .hud-celular { right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .hud-saltar { right: 70px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .hud-accion { right: 126px; bottom: calc(12px + env(safe-area-inset-bottom)); min-height: 46px; padding: 8px 14px; font-size: 15px; }
  .hud-objetivo { width: calc(100vw - 480px); bottom: calc(66px + env(safe-area-inset-bottom)); font-size: 15px; }
  .gx-banda { top: 27%; left: 150px; right: 150px; padding: 8px 12px 10px; }
  .gx-banda-titulo { font-size: 34px; }
  .gx-salto { top: calc(10px + env(safe-area-inset-top)); right: 150px; font-size: 28px; }
  .gx-logro { right: 168px; bottom: calc(112px + env(safe-area-inset-bottom)); max-width: 280px; }
  .gx-lugar { max-width: calc(100vw - 340px); }
  body.cine .franja { height: 8vh; }
  /* el ensayo a la izquierda de la columna, con las alternativas en dos columnas */
  .pregunta { top: 8px; bottom: 8px; left: 12px; right: 164px; width: auto; max-width: 720px; max-height: none; height: fit-content; margin: auto; transform: none; padding: 10px 14px 12px; }
  .pregunta-eje { margin: 6px 0 6px; }
  .pregunta-enunciado { font-size: 17px; margin-bottom: 8px; }
  .pregunta-opciones { grid-template-columns: 1fr 1fr; gap: 6px; }
  .pregunta-opciones button { min-height: 44px; padding: 6px 10px; font-size: 15px; }
  .pregunta-pie { margin-top: 8px; }
  .btn-guia { min-height: 40px; padding: 6px 12px; font-size: 13px; }
  body:has(#pregunta:not(.oculto)) .hud-objetivo, body:has(#pregunta:not(.oculto)) .hud-accion { display: none; }
  body:has(#pregunta:not(.oculto)) .gx-lugar { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pregunta.entra, .pregunta.entra .pregunta-opciones button, .pregunta.entra .pregunta-opciones button.mal, .barra.baja .barra-riel b { animation: none; }
  .pregunta-opciones button, .pregunta-opciones button:hover:not(:disabled), .pregunta-opciones button:focus-visible { transform: none; transition: none; }
}
@media (max-height: 500px) and (min-width: 641px) { .menu-caja, .final-caja { padding-bottom: calc(150px + env(safe-area-inset-bottom)); } } /* el aviso de cookies no tapa JUGAR en el celular horizontal */
/* ---------- v9: celular vertical, cada cosa en su zona (revisión del 23-nov) ---------- */
@media (max-width: 640px) and (orientation: portrait) {
  /* las barras van en una franja propia abajo, siempre (igual que con el ensayo abierto) */
  body:not(:has(#pregunta:not(.oculto))) .hud-barras { position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); grid-template-columns: 0.9fr 1.25fr 0.8fr; gap: 8px; margin: 0; }
  body:not(:has(#pregunta:not(.oculto))) .barra { column-gap: 5px; }
  body:not(:has(#pregunta:not(.oculto))) .barra-nombre { letter-spacing: 0; }
  /* encima de la franja: el objetivo a la izquierda y los botones en columna a la derecha */
  .hud-objetivo { left: 16px; right: auto; transform: none; text-align: left; width: calc(100vw - 150px); bottom: calc(64px + env(safe-area-inset-bottom)); }
  .hud-accion { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .hud-celular { bottom: calc(118px + env(safe-area-inset-bottom)); }
  .hud-saltar { bottom: calc(118px + env(safe-area-inset-bottom)); }
  .gx-logro { bottom: calc(176px + env(safe-area-inset-bottom)); }
  /* el puntaje y las estrellas con su fondo: no se pierden sobre la pizarra ni sobre un letrero */
  .hud-puntaje { padding: 6px 10px 6px 12px; border-radius: 10px; background: rgba(8, 6, 16, 0.55); }
  /* el consejo, más chico y a la izquierda del minimapa */
  .hud-aviso { max-width: calc(100vw - 170px); font-size: 13px; padding: 8px 11px; }
}

/* ---------- v10: rutas, esquivas y entradas con movimiento (revisión ronda 3) ---------- */
/* con desvío, el marcador va al próximo punto de la ruta: ahí sí se ve el rombo */
.gx-meta.paso .gx-meta-punta { display: block; }
/* el consejo baja bajo el letrero de la sede si en pantalla le queda encima (juego.js, esquivarLetrero) */
.hud-aviso { translate: 0 var(--esquiva, 0px); transform: translateX(-28px); transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.25), translate 0.3s ease; }
.hud-aviso.visible { transform: none; }
/* paneles y carteles que entran con movimiento */
.dialogo:not(.oculto) { animation: v10-sube 0.34s cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
.hud-accion:not(.oculto) { animation: v10-asoma 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.3) both; }
.hud-objetivo.entra { animation: v10-desliza 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
.dlg-recuadro { animation: v10-desde-lado 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.12) both; }
.gx-logro { transform: translateX(70px) scale(0.92); }
.gx-logro.visible { transform: none; }
.gx-tarjeta { transform: translate(-50%, -30%) scale(0.86); transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.2); }
.gx-tarjeta.visible { transform: translate(-50%, -50%); }
.gran-titulo { animation: v10-golpe 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.1) both; }
@keyframes v10-sube { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes v10-asoma { from { opacity: 0; scale: 0.7; } to { opacity: 1; scale: 1; } }
@keyframes v10-desliza { from { opacity: 0; translate: -30px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes v10-desde-lado { from { opacity: 0; translate: 60px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes v10-golpe { 0% { opacity: 0; transform: scale(1.35); } 60% { opacity: 1; transform: scale(0.97); } 100% { opacity: 1; transform: none; } }
@media (max-width: 640px) and (orientation: portrait) {
  /* la videollamada va encima de la franja de barras, sin taparla */
  .dlg-recuadro { bottom: calc(66px + env(safe-area-inset-bottom)); }
  /* la banda de misión, justo bajo el minimapa: no tapa la cabeza de la alumna */
  .gx-banda { top: calc(246px + env(safe-area-inset-top)); }
  @keyframes v10-desde-lado { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .hud-aviso { transform: none; transition: opacity 0.2s linear; }
  .dialogo:not(.oculto), .hud-accion:not(.oculto), .hud-objetivo.entra, .dlg-recuadro, .gran-titulo { animation: none; }
  .gx-logro, .gx-logro.visible, .gx-tarjeta.visible { transition: opacity 0.2s linear; }
  .gx-logro { transform: none; }
  .gx-tarjeta { transform: translate(-50%, -50%); transition: opacity 0.2s linear; }
}

/* ---------- v11: revisión ronda 4 ---------- */
/* el cartel de misión, arriba: no tapa la cabeza de la alumna (la cámara de juego la deja al medio) */
@media (min-width: 641px) and (min-height: 501px) { .gx-banda { top: 21%; } } /* entre el letrero de la sede (hasta ~16 %) y su cabeza (~36 %) */
/* WASTED arriba: el desplome se ve entero debajo del logo */
#gran-wasted { place-content: start center; padding-top: calc(5vh + env(safe-area-inset-top)); }
#gran-wasted img { width: min(620px, 82vw); }
@media (max-width: 640px) and (orientation: portrait) {
  #gran-wasted { padding-top: calc(130px + env(safe-area-inset-top)); }
  body:has(#gran-wasted:not(.oculto)) #minimapa { visibility: hidden; } /* el logo pasa por donde va el minimapa */
  /* el logro, arriba a la izquierda (bajo el consejo, si hay uno; juego: hudExtra.js, logro):
     sobre la pizarra o el cielo, lejos de la alumna, de su mochila y de los botones */
  .gx-logro, body.cine .gx-logro { top: var(--logro-arriba, calc(96px + env(safe-area-inset-top))); bottom: auto; left: 16px; right: auto; max-width: calc(100vw - 172px); transform: translateX(-40px) scale(0.92); }
  .gx-logro.visible { transform: none; }
}
@media (max-width: 640px) and (orientation: portrait) and (prefers-reduced-motion: reduce) {
  .gx-logro, body.cine .gx-logro { transform: none; }
}
/* pantalla final: los cuatro botones caben en el celular (si no caben en una línea, pasan a dos, sin cortarse) */
@media (max-width: 640px) { .final-botones { display: grid; grid-template-columns: 1fr 1fr; width: min(480px, 100%); } .final-botones .btn-juego { white-space: normal; line-height: 1.2; padding: 10px 12px; font-size: 13px; text-align: center; display: grid; place-items: center; min-height: 48px; } }
.final-botones a.btn-juego { text-decoration: none; }
/* durante el ensayo no se salta: el botón se esconde (vuelve al terminar) */
body.en-ensayo .hud-saltar { display: none !important; }

/* ---------- póster «Yo llegué a 1000» en la pantalla final (posterFinal.js) ---------- */
.final-poster { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; width: min(520px, 100%); padding: 12px; border-radius: 14px; background: rgba(8, 6, 16, 0.78); border: 1px solid var(--borde); text-align: left; }
.poster-vista { display: block; width: 150px; height: auto; aspect-ratio: 9 / 16; border-radius: 8px; background: #150722; box-shadow: 0 0 0 2px #000, 0 10px 26px rgba(0, 0, 0, 0.55); }
.poster-lado { min-width: 0; }
.poster-titulo { margin: 0 0 8px; font-family: var(--titulo); font-size: 28px; line-height: 1; text-transform: uppercase; color: var(--amarillo); text-shadow: 0 2px 0 #000; }
.poster-etiqueta { display: block; margin-bottom: 5px; font-size: 13px; color: var(--suave); }
.poster-campo { width: 100%; padding: 10px 12px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.08); color: #fff; font: 700 17px Inter, system-ui, sans-serif; user-select: text; -webkit-user-select: text; }
.poster-campo::placeholder { color: rgba(255, 255, 255, 0.45); font-weight: 500; }
.poster-campo:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; border-color: #fff; }
.poster-botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.poster-botones .btn-juego { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; font-size: 14px; box-shadow: 0 4px 0 #000; }
.poster-botones .btn-juego svg { width: 18px; height: 18px; flex: none; }
#poster-descargar { background: transparent; }
.poster-nota { margin: 8px 0 0; font-size: 12px; line-height: 1.35; color: var(--suave); }
@media (max-width: 640px) {
  .final-poster { grid-template-columns: 108px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .poster-vista { width: 108px; }
  .poster-titulo { font-size: 22px; margin-bottom: 6px; }
  /* uno sobre otro: en 390 px de ancho, lado a lado no caben sin cortarse */
  .poster-botones { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .poster-botones .btn-juego { min-height: 44px; padding: 8px 10px; font-size: 14px; }
}

/* un solo campo de nombre: con el formulario del CRM a la vista, el póster usa el nombre de ese (R9) */
.final-poster { margin-top: 4px; }
.poster-desde-form { display: none; margin: 0 0 4px; font-size: 13px; line-height: 1.35; color: var(--suave); }
#final:has([data-tesla-formulario] input[name="firstname"]) .poster-nombre-fila { display: none; }
#final:has([data-tesla-formulario] input[name="firstname"]) .poster-desde-form { display: block; }
/* celular vertical: con una acción a la vista («Mirar el cuadro», «Hablar»…), el objetivo sube sobre la píldora (R9: la pisaba) */
@media (max-width: 640px) and (orientation: portrait) {
  body:has(#hud-accion:not(.oculto)) .hud-objetivo { bottom: calc(118px + env(safe-area-inset-bottom)); width: calc(100vw - 140px); }
}

/* ---------- tarjeta de un cuadro del Muro de los 1000 (publicidad.js): la gráfica y una línea ---------- */
.placa { position: fixed; inset: 0; z-index: 24; display: grid; place-items: center; padding: 16px; background: rgba(4, 2, 10, 0.62); cursor: pointer; }
.placa-caja { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(420px, 100%); max-height: 100%; padding: 12px 12px 14px; border-radius: 14px; background: #120d18; border: 3px solid var(--amarillo); box-shadow: 0 0 0 3px #000, 0 20px 60px rgba(0, 0, 0, 0.6); text-align: center; animation: placa-entra 0.25s ease-out; }
.placa-grafica { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 150px); aspect-ratio: 4 / 5; border-radius: 8px; background: #2a2233; object-fit: contain; }
.placa-linea { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; color: #fff; text-wrap: balance; }
.placa-linea span { display: block; }
.placa-cerrar:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
@keyframes placa-entra { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .placa-caja { animation: none; } }
/* celular vertical: la banda de misión, más delgada y en la columna izquierda (la derecha es del
   puntaje y del minimapa): así puede subir sobre la cabeza de ella en la sala sin pisar el HUD (R11:
   tapaba el 20-23 % de su cuerpo) */
@media (max-width: 640px) and (orientation: portrait) {
  .gx-banda { left: 0; right: 156px; padding: 7px 10px 8px; }
  .gx-banda-titulo { font-size: 24px; }
  .gx-banda-tipo { font-size: 10px; letter-spacing: 0.3em; }
}
