/* La Oficina: planta pixel art punk-gamer con paneles tipo HUD. */
.ofi { --ofi-texto: #f2ece0; --ofi-gris: #b3afa5; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; color: var(--ofi-texto); font-family: var(--f-display); font-size: 1rem; line-height: 1.2; }

.ofi-cab { text-align: center; padding: 4px 0 0; }
.ofi-titulo {
  font: 400 clamp(1.5rem, 6vw, 2.4rem) 'Press Start 2P', ui-monospace, monospace; margin: 0;
  color: #e8323f; letter-spacing: .06em; transform: rotate(-2deg);
  text-shadow: 3px 3px 0 #ffd23f;
}

/* Mapa: escala entera para que el pixel art no se emborrone; en el móvil se desliza de lado */
.ofi-desplaza {
  max-width: 100%; margin: 0 auto; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  border: 3px solid #e8323f; border-radius: 4px; background: #060607;
  box-shadow: 0 0 0 3px #000;
}
.ofi-marco { position: relative; margin: 0 auto; --e: 2; }
.ofi-lienzo { display: block; width: 100%; height: 100%; }
.ofi-capa { position: absolute; inset: 0; }

.ofi-sala-nombre {
  position: absolute; transform: translate(-50%, -50%) rotate(-1.5deg); pointer-events: none; white-space: nowrap;
  font: 400 .78rem 'Press Start 2P', monospace; color: #000; background: var(--neon);
  padding: 6px 12px; border: 2px solid #000; box-shadow: 3px 3px 0 #000;
}
.sr-solo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Cada muñeco es un botón transparente encima del dibujo, con su cartel */
.ofi-agente {
  position: absolute; left: 0; top: 0; width: calc(30px * var(--e)); height: calc(70px * var(--e));
  padding: 0; border: 0; background: transparent; cursor: pointer; will-change: transform;
}
.ofi-agente:focus-visible { outline: 2px dashed var(--neon); outline-offset: 2px; }
.ofi-tag {
  position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 400 0.9375rem var(--f-display); line-height: 1; color: #fff; background: rgba(0, 0, 0, .82);
  border: 1px solid #555; padding: 2px 5px; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.ofi-agente.izq .ofi-tag { left: 0; transform: none; }
.ofi-agente.der .ofi-tag { left: auto; right: 0; transform: none; }
.ofi-agente:hover .ofi-tag, .ofi-agente:focus-visible .ofi-tag { opacity: 1; z-index: 3; }
.ofi-agente.trabaja .ofi-tag, .ofi-agente.espera .ofi-tag { opacity: 1; color: #000; background: var(--neon); border-color: #000; box-shadow: 2px 2px 0 #000; }
.ofi-agente.espera .ofi-tag { background: #ffd23f; animation: ofi-latido 1.2s steps(2) infinite; }
@keyframes ofi-latido { 50% { box-shadow: 0 0 0 3px #ffd23f, 2px 2px 0 #000; } }

/* Escena: el plano ocupa todo el ancho; en pantallas grandes el HUD va a su derecha */
body[data-ruta="oficina"] .vista { max-width: none; padding-left: 20px; padding-right: 20px; }
.ofi-escena { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1400px) { .ofi-escena { grid-template-columns: minmax(0, 1fr) 320px; } .ofi-huds { position: sticky; top: 84px; } }
.ofi-desplaza { width: 100%; }

/* Paneles HUD: marcadores grandes y una consola */
.ofi-huds { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ofi-hud {
  background: linear-gradient(180deg, rgba(18, 18, 20, .96), rgba(10, 10, 12, .96));
  border: 3px solid #3a3a40; border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 3px #000, 6px 6px 0 #000;
}
.ofi-hud-barra {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px;
  background: #1c1c20; border-bottom: 2px solid #3a3a40;
  font: 400 .62rem 'Press Start 2P', monospace; letter-spacing: .06em; color: #d6d1c4;
}
.ofi-estado { font: 400 0.9375rem var(--f-display); color: #b3afa5; letter-spacing: .04em; }
.ofi-estado.on { color: #46d36f; }
.ofi-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.ofi-dato {
  --c: #b3afa5; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; padding: 10px 12px; border-radius: 4px; background: rgba(255, 255, 255, .03);
  border: 2px solid color-mix(in srgb, var(--c) 60%, transparent);
}
.ofi-dato.verde { --c: #46d36f; } .ofi-dato.gris { --c: #b3afa5; } .ofi-dato.rosa { --c: #e8323f; } .ofi-dato.cian { --c: #ffd23f; }
.ofi-dato-icono { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font: 400 1.05rem var(--f-display); }
.ofi-dato strong { font: 400 1.8rem/1 var(--f-display); color: var(--c); }
.ofi-dato span:last-child { color: #b3afa5; font-size: 0.875rem; line-height: 1; }
.ofi-fuente { margin: 0; padding: 0 12px 12px; color: #7f7c76; font-size: 0.875rem; }

.ofi-terminal { border-color: #1f5c2a; }
.ofi-terminal .ofi-hud-barra { justify-content: flex-start; background: #0f1f13; border-color: #1f5c2a; color: #8ff08a; }
.ofi-luces { display: inline-flex; gap: 5px; }
.ofi-luces i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.ofi-luces i:nth-child(2) { background: #febc2e; } .ofi-luces i:nth-child(3) { background: #28c840; }
.ofi-log { list-style: none; margin: 0; padding: 10px 12px 0; display: grid; gap: 6px; position: relative;
  background: repeating-linear-gradient(0deg, rgba(70, 211, 111, .035) 0 2px, transparent 2px 4px); }
.ofi-log li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: baseline; color: #8fd88a; font-size: 0.875rem; line-height: 1.1; }
.ofi-log time { color: #4f8a4b; }
.ofi-log b { color: #e8ffe5; font-weight: 400; }
.ofi-log span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ofi-log li.vivo { color: #46d36f; }
.ofi-log li.vivo b::before { content: '▶ '; color: #46d36f; }
.ofi-log-vacio { margin: 0; padding: 10px 12px 0; color: #8fd88a; }
.ofi-cursor { margin: 0; padding: 4px 12px 12px; color: #46d36f; animation: ofi-cursor 1s steps(2) infinite; }
@keyframes ofi-cursor { 50% { opacity: 0; } }

/* Ficha del agente */
.ofi-ficha {
  --ofi-texto: #f2ece0; --ofi-gris: #b3afa5;
  background: #0a0a0c; color: var(--ofi-texto); border: 3px solid var(--neon); border-radius: 4px;
  box-shadow: 0 0 0 3px #000, 6px 6px 0 #000;
  font-family: var(--f-display); font-size: 1.0625rem; line-height: 1.45; max-width: 460px; /* ficha: todo en Pixelify Sans a 17 px */
}
/* Marco punk de la ficha (kit PixelLab, 10/10/2026): img/kit/ui_marco.png (508×336) para TODAS las salas, en 9 trozos.
   El borde mide ~56 px en la imagen y se pinta a la mitad (28 px) para que el pixel art salga limpio; las esquinas
   (cinta, imperdible, estrella) quedan enteras y los lados estiran. El color del cuarto va solo en la placa y en los acentos. */
dialog.ofi-ficha.con-marco {
  border: 30px solid transparent; border-radius: 0; box-shadow: none; padding: 6px 12px 10px; box-sizing: border-box;
  border-image: url(../img/kit/ui_marco.png) 56 fill / 30px stretch; image-rendering: pixelated;
  background: transparent; filter: drop-shadow(5px 5px 0 #000);
}
@media (max-width: 520px) { dialog.ofi-ficha.con-marco { border-width: 24px; border-image-width: 24px; padding: 2px 4px 6px; } }
/* ── Ficha del agente (10/10/2026): cabecera con retrato en pedestal, estado con icono pixel animado,
   pantallita LCD con lo de ahora, tres marcadores y línea de tiempo. Iconos: js/pixel-iconos.js. */
.ofi-ficha { position: relative; scrollbar-width: thin; scrollbar-color: var(--neon) transparent; }
.ofi-cerrar { position: sticky; top: 0; float: right; margin: 0 0 -48px; width: var(--tap); height: var(--tap); display: grid; place-items: center; padding: 0;
  background: #000; color: var(--neon); border: 2px solid var(--neon); border-radius: 0; box-shadow: 3px 3px 0 #000; cursor: pointer; z-index: 2; }
.ofi-cerrar:hover, .ofi-cerrar:focus-visible { background: var(--neon); color: #000; }
.ofi-ficha :focus-visible { outline: 2px solid var(--ofi-texto); outline-offset: 2px; }

.ofi-ficha-cab { display: flex; align-items: center; gap: 18px; padding-right: 56px; }
.ofi-pedestal { flex: none; position: relative; display: grid; place-items: end center; width: 120px; height: 128px;
  background: radial-gradient(ellipse 60% 14% at 50% 96%, rgb(0 0 0 / .7), transparent 70%); }
.ofi-pedestal .zeta-cara { --tam: 112px; border-color: var(--neon); box-shadow: 0 0 0 3px #000, 3px 3px 0 3px #000; }
.ofi-busto { width: 112px; height: 112px; image-rendering: pixelated; background: #151517; border: 2px solid var(--neon); border-radius: 12px;
  box-shadow: 0 0 0 3px #000, 3px 3px 0 3px #000; }
.ofi-retrato { height: 120px; width: auto; image-rendering: pixelated; filter: drop-shadow(3px 3px 0 #000); }
.ofi-pedestal.trabaja .ofi-retrato, .ofi-pedestal.trabaja .ofi-busto { animation: ofi-curra .6s steps(2) infinite; }
@keyframes ofi-curra { 50% { transform: translateY(-3px); } }
.ofi-ident { min-width: 0; display: grid; gap: 6px; justify-items: start; }
.ofi-cuarto { margin: 0; padding: 2px 8px; background: var(--neon); color: #000; font: 700 .8125rem/1.6 var(--f-display);
  text-transform: uppercase; letter-spacing: .06em; box-shadow: 2px 2px 0 #000; }
.ofi-nombre { margin: 0; font: 400 1.25rem/1.35 var(--f-pixel); color: var(--ofi-texto); overflow-wrap: anywhere; text-shadow: 3px 3px 0 #000; }
.ofi-estado { margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px;
  border: 2px solid currentColor; font: 700 .9375rem/1 var(--f-display); text-transform: uppercase; letter-spacing: .05em; }
.ofi-estado.trabaja { color: #3ddc84; }
.ofi-estado.espera { color: #ff9f1c; }
.ofi-estado.libre { color: #b3afa5; }
.ofi-estado.trabaja .pxi { animation: ofi-gira 1.2s steps(4) infinite; }
.ofi-estado.espera .pxi { animation: ofi-voltea 2.4s steps(1) infinite; }
.ofi-estado.libre .pxi { animation: ofi-flota 1.6s steps(3) infinite; }
@keyframes ofi-gira { to { transform: rotate(90deg); } }
@keyframes ofi-voltea { 50% { transform: rotate(180deg); } }
@keyframes ofi-flota { 50% { transform: translateY(-3px); } }

/* Pantallita LCD: lo que está haciendo ahora, que es lo primero que se busca. */
.ofi-lcd { margin-top: 16px; display: grid; gap: 4px; padding: 10px 14px; background: #0b1a0f; color: #86efac;
  border: 3px solid #000; box-shadow: inset 0 0 0 2px #1d3a24, 3px 3px 0 #000;
  background-image: repeating-linear-gradient(0deg, rgb(0 0 0 / .25) 0 1px, transparent 1px 3px); }
.ofi-lcd-etq { font: 700 .75rem/1 var(--f-display); letter-spacing: .12em; color: #3ddc84; }
.ofi-lcd-txt { font: 400 1.0625rem/1.4 var(--f-display); overflow-wrap: anywhere; }

/* Tres marcadores de hoy. */
.ofi-marcadores { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ofi-marcador { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; text-align: center;
  background: rgb(255 255 255 / .04); border: 2px solid #2a2a30; color: var(--neon); }
.ofi-marcador strong { font: 400 1rem/1.4 var(--f-pixel); color: var(--ofi-texto); }
.ofi-marcador small { font-size: .8125rem; color: var(--ofi-gris); }
.ofi-marcador.mal { color: #ff6b6b; border-color: #ff6b6b; }

.ofi-sub { margin: 18px 0 6px; color: var(--neon); text-transform: uppercase; letter-spacing: .06em; font: 700 .875rem/1.2 var(--f-display); }
.ofi-para { margin: 0; }

/* Línea de tiempo de lo de hoy: icono en una columna, unido por una raya del color del cuarto. */
.ofi-linea { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ofi-paso { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; padding: 6px 8px 6px 4px;
  background: rgb(255 255 255 / .04); border-left: 3px solid var(--neon); }
.ofi-paso-icono { grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; background: #000; color: var(--neon); }
.ofi-paso.hecho .ofi-paso-icono { color: #3ddc84; }
.ofi-paso.marcha .ofi-paso-icono { color: #86efac; animation: ofi-flota 1s steps(2) infinite; }
.ofi-paso.fallo { border-left-color: #ff6b6b; }
.ofi-paso.fallo .ofi-paso-icono { color: #ff6b6b; }
.ofi-paso-txt { overflow-wrap: anywhere; }
.ofi-paso-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ofi-gris); font-size: .875rem; }
.ofi-origen { display: inline-flex; align-items: center; gap: 4px; }

/* «Para qué sirve», plegado: se lee una vez y luego estorba. */
.ofi-para-que { margin-top: 16px; border: 2px dashed #2a2a30; padding: 0 10px; }
.ofi-para-que summary { display: flex; align-items: center; gap: 8px; min-height: var(--tap); cursor: pointer; list-style: none;
  color: var(--neon); text-transform: uppercase; letter-spacing: .06em; font: 700 .875rem/1 var(--f-display); }
.ofi-para-que summary::-webkit-details-marker { display: none; }
.ofi-para-que summary::after { content: '▸'; margin-left: auto; }
.ofi-para-que[open] summary::after { content: '▾'; }
.ofi-para-que .ofi-para { padding-bottom: 12px; }

.ofi-ficha .dialogo-botones { margin-top: 18px; }
.ofi-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--neon); color: #000;
  border: 3px solid #000; box-shadow: 4px 4px 0 #000; font: 700 1rem/1 var(--f-display); text-transform: uppercase; letter-spacing: .05em; min-height: var(--tap); }
.ofi-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #000; }
.ofi-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
@media (prefers-reduced-motion: reduce) { .ofi-ficha .pxi, .ofi-ficha .ofi-retrato, .ofi-ficha .ofi-busto { animation: none !important; } }
@media (max-width: 520px) {
  .ofi-ficha-cab { gap: 12px; padding-right: 48px; }
  .ofi-pedestal { width: 84px; height: 96px; }
  .ofi-pedestal .zeta-cara { --tam: 80px; }
  .ofi-busto { width: 80px; height: 80px; }
  .ofi-retrato { height: 88px; }
  .ofi-nombre { font-size: 1rem; }
  .ofi-marcador strong { font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ofi-agente.espera .ofi-tag { animation: none; }
}

/* Icono de estado encima de la cabeza: luz verde = trabajando, zzz = libre, ! = Zeta te espera */
.ofi-icono {
  position: absolute; right: -14px; top: -8px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  display: grid; place-items: center; font: 400 0.9375rem var(--f-display); line-height: 1; pointer-events: none;
}
.ofi-agente.libre .ofi-icono { background: rgba(20, 20, 22, .85); color: #d0cbbf; border: 1px solid #5a5a60; animation: ofi-zzz 2.6s ease-in-out infinite; }
.ofi-agente.trabaja .ofi-icono { min-width: 16px; width: 16px; height: 16px; padding: 0; background: #46d36f; border: 2px solid #000; box-shadow: 2px 2px 0 #000; animation: ofi-luz 1s steps(2) infinite; }
.ofi-agente.espera .ofi-icono { background: #ffd23f; color: #000; border: 2px solid #000; font-size: 0.975rem; box-shadow: 2px 2px 0 #000; }
@keyframes ofi-zzz { 50% { transform: translateY(-4px); opacity: .6; } }
@keyframes ofi-luz { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ofi-icono { animation: none !important; } }

/* Placa con el nombre bajo cada agente, siempre visible */
.ofi-placa {
  position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 400 0.9375rem/1 var(--f-display); color: #fff; background: rgba(8, 8, 10, .88);
  border: 2px solid var(--neon); border-radius: 2px; padding: 1px 6px; box-shadow: 2px 2px 0 #000;
}
.ofi-agente.trabaja .ofi-placa { background: var(--neon); color: #000; border-color: #000; }
.ofi-tag:empty { display: none; }

/* Panel de cuartos: cuántos trabajan en cada uno, en su color */
.ofi-cuartos { list-style: none; margin: 0; padding: 10px 12px 12px; display: grid; gap: 8px; }
.ofi-cuartos li { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: baseline; }
.ofi-cuarto-nombre { color: var(--c); font-size: 0.9rem; }
.ofi-cuarto-cuenta { color: #b3afa5; font-size: 0.875rem; }
.ofi-cuarto-cuenta b { color: #fff; font-weight: 400; font-size: 1.025rem; }
.ofi-cuarto-barra { grid-column: 1 / -1; height: 6px; background: rgba(255, 255, 255, .07); border-radius: 3px; overflow: hidden; }
.ofi-cuarto-barra i { display: block; height: 100%; background: var(--c); }

/* Centro de mando: paneles y chat dentro del vestíbulo (en el móvil, debajo del plano) */
.ofi-centro { position: absolute; z-index: 4; display: flex; flex-direction: column; gap: 10px; min-height: 0; font-size: 0.875rem; }
.ofi-centro.abajo { position: static; margin-top: 16px; }
.ofi-centro .ofi-hud { flex: none; }
.ofi-centro .ofi-datos { grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; }
.ofi-centro .ofi-dato { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: center; text-align: center; padding: 8px 4px; row-gap: 2px; }
.ofi-centro .ofi-dato-icono { grid-row: auto; width: 26px; height: 26px; font-size: 0.875rem; }
.ofi-centro .ofi-dato strong { font-size: 1.5rem; }
.ofi-centro .ofi-dato span:last-child { font-size: 0.875rem; }
.ofi-centro .ofi-fuente { display: none; }
.ofi-centro .ofi-cuartos { grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 8px 12px 10px; }
.ofi-centro .ofi-cuarto-nombre { font-size: 0.875rem; }

.ofi-centro .ofi-terminal .ofi-log li { font-size: 0.875rem; }

/* Oficina en el móvil: lista compacta primero; el plano, con «Ver el plano» */
.ofi-lista-movil, .ofi-ver-plano { display: none; }
@media (max-width: 899px) {
  .ofi-lista-movil { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ofi-ver-plano { display: inline-flex; justify-self: start; }
  .ofi:not(.con-plano) .ofi-desplaza { display: none; }
}
.ofi-mov-sala { min-width: 0; border: 3px solid var(--neon); border-radius: 4px; padding: 10px; background: color-mix(in srgb, var(--neon) 7%, #0a0a0c);
  box-shadow: 3px 3px 0 #000; }
.ofi-mov-sala h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; color: var(--neon); font: 400 1.025rem var(--f-display); }
.ofi-mov-sala h3 span { color: #b3afa5; font-size: 0.875rem; }
.ofi-mov-sala ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.ofi-mov-sala h3 { flex-wrap: wrap; gap: 0 8px; }
.ofi-mov-sala li { min-width: 0; }
.ofi-mov-agente { width: 100%; min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  text-align: left; padding: 6px 8px; border: 1px solid #2a2a30; border-radius: 4px; background: rgba(0, 0, 0, .35); color: #f2ece0; font: inherit; cursor: pointer; }
.ofi-mov-agente img { grid-row: span 2; width: 34px; height: 46px; object-fit: contain; image-rendering: pixelated; }
.ofi-mov-nombre { font: 400 0.95rem/1.2 var(--f-display); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ofi-mov-que { font-size: 0.875rem; color: #b3afa5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ofi-mov-agente.trabaja { border-color: #46d36f; }
.ofi-mov-agente.trabaja .ofi-mov-que { color: #46d36f; }
.ofi-mov-agente.espera .ofi-mov-que { color: #ffd23f; }

/* Ficha del agente más ancha en el ordenador (10/10/2026): se leía como un móvil en mitad de la pantalla.
   En pantalla ancha, lo que ha hecho hoy va en dos columnas y la ficha no pasa del 85 % del alto. */
dialog.ofi-ficha { width: min(820px, 94vw); max-width: 94vw; max-height: 85vh; overflow-y: auto; }
@media (min-width: 900px) {
  .ofi-ficha .ofi-linea { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Chat con Zeta dentro del vestíbulo (restaurado 10/10/2026 tras el rediseño punk) */
.ofi-chat { flex: 0 1 auto !important; height: 75vh; min-height: 280px; display: flex; flex-direction: column; border-color: #ff2e88;
  box-shadow: 0 0 0 3px #000, 0 0 22px rgba(255, 46, 136, .35); }
.ofi-chat .ofi-hud-barra { background: #2a0f20; border-color: #ff2e88; color: #ffd0e6; }
.ofi-chat-dentro { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ofi-chat-dentro > .hilo { min-height: 0; }
.ofi-chat .hilo { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px; font-family: system-ui, sans-serif; font-size: 1rem; }
.ofi-chat .composer { flex: none; position: static; padding: 8px 10px; border-top: 2px solid #3a2f55; background: rgba(10, 8, 18, .96); }
.ofi-chat .banner-desconexion, .ofi-chat .escribiendo { margin: 0; padding: 4px 12px; font-size: 1rem; }
.ofi-centro.abajo .ofi-chat { height: 70vh; }
/* En el PC el chat se estira hasta el remate (antes 75vh fijo y dejaba hueco muerto debajo) */
.ofi-centro:not(.abajo) .ofi-chat { flex: 1 1 auto !important; height: auto; }

/* Remate decorativo bajo el chat: cartel de neón y la pandilla saludando */
.ofi-remate { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 14px; pointer-events: none; }
.ofi-neon { font: 400 1.35rem var(--f-display); letter-spacing: .12em; color: #ffd0e6;
  text-shadow: 0 0 4px #ff2e88, 0 0 12px #ff2e88, 0 0 24px rgba(255, 46, 136, .6); animation: ofi-parpadeo 6s infinite; }
.ofi-neon b { font-weight: 400; color: #7df9ff; text-shadow: 0 0 4px #00e5ff, 0 0 12px #00e5ff; }
.ofi-neon span { font-size: 0.875rem; color: #b3afa5; text-shadow: none; letter-spacing: .05em; }
.ofi-pandilla { display: flex; align-items: flex-end; gap: 10px; padding: 0 16px 2px; }

/* Barra de vida de tokens: se vacía al gastar; pasada la media del día, K.O. en rojo */
.ofi-vida-caja { width: min(100%, 560px); pointer-events: auto; }
.ofi-vida { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 4px 8px;
  background: #0d0a16; border: 3px solid #000; border-radius: 6px; box-shadow: 3px 3px 0 #000, 0 0 12px rgba(255, 46, 136, .35); cursor: pointer; }
.ofi-vida:focus-visible { outline: 3px solid #7df9ff; outline-offset: 2px; }
.ofi-vida-mote { font: 400 1.05rem var(--f-display); letter-spacing: .08em; color: #ffd23f; text-shadow: 2px 2px 0 #000; min-width: 3.2em; }
/* Verde = la vida que queda · rojo = lo gastado (el fondo del tubo) */
.ofi-vida-tubo { position: relative; flex: 1; height: 26px; border: 2px solid #000; border-radius: 3px; overflow: hidden;
  background: linear-gradient(#ff6b6b, #c8202c 55%, #7a0f18); box-shadow: inset 0 3px 0 rgba(0, 0, 0, .35); }
.ofi-vida-relleno { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#5dff9a, #1fbf5a 55%, #138a3e);
  border-right: 3px solid #000; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45); transition: width .8s steps(12); }
.ofi-vida.critico .ofi-vida-relleno { animation: ofi-latido 1s infinite; }
.ofi-vida.ko .ofi-vida-tubo { background: repeating-linear-gradient(-45deg, #7a0f18 0 10px, #c8202c 10px 20px); animation: ofi-latido 1.4s infinite; }
.ofi-vida.ko .ofi-vida-relleno { display: none; }
.ofi-vida.ko .ofi-vida-mote { color: #ff5a64; }
.ofi-vida-cifra { position: relative; display: block; padding: 0 8px; font: 700 0.9375rem/22px var(--f-texto, system-ui); color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ofi-vida-detalle { margin-top: 6px; padding: 10px 12px; background: rgba(10, 8, 18, .96); border: 2px solid #3a2f55; border-radius: 6px; color: #e9e4f5; }
.ofi-vida-detalle .ofi-sub { margin: 6px 0 4px; }
.ofi-vida-cols { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 64px; border-bottom: 2px solid #3a2f55; }
.ofi-vida-cols span { flex: 1; min-width: 3px; background: #ff2e88; border-radius: 2px 2px 0 0; }
.ofi-vida-raya { position: absolute; left: 0; right: 0; border-top: 2px dashed #ffd23f; }
.ofi-vida-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ofi-vida-lista { list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.ofi-vida-lista li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.ofi-vida-lista b { color: #7df9ff; font-weight: 600; white-space: nowrap; }
@keyframes ofi-latido { 50% { filter: brightness(1.35); } }
@media (prefers-reduced-motion: reduce) { .ofi-vida-relleno { animation: none !important; transition: none; } }
.ofi-pandilla img { width: 40px; height: 56px; object-fit: contain; image-rendering: pixelated;
  animation: ofi-bote 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * .25s); }
.ofi-pandilla img.jefa { width: 52px; height: 72px; filter: drop-shadow(0 0 6px rgba(125, 249, 255, .7)); }
.ofi-centro.abajo .ofi-remate { padding-top: 12px; }
/* En el móvil la pandilla (384 px) empujaba la página 19 px: se encoge en vez de desbordar */
.ofi-centro { min-width: 0; }
.ofi-remate { max-width: 100%; }
.ofi-pandilla { max-width: 100%; gap: clamp(2px, 1.5vw, 10px); padding: 0 8px 2px; }
.ofi-pandilla img { flex: 0 1 auto; min-width: 0; }
@keyframes ofi-bote { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ofi-parpadeo { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ofi-pandilla img, .ofi-neon { animation: none; } }
