/* Estilo de la marca (03-12-2026): el del logo del bro. Espacio morado oscuro, morado «.COM» (#c838f8),
   blanco roto de las letras, contorno negro grueso y sombra dura, como una pegatina. Exo 2 Black Italic para títulos y botones. */
@font-face { font-family: "Exo 2"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/f/exo2.woff2") format("woff2"); }
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 700 900; font-display: swap; src: url("/f/exo2-italic.woff2") format("woff2"); }
:root {
  --fondo: #0c0820; --panel: rgba(24, 13, 50, 0.92); --panel-2: #1d1040; --borde: rgba(214, 160, 255, 0.28); --negro: #05030c;
  --texto: #f7f2ff; --suave: #b5a7d8; --acento: #c838f8; --acento-2: #e08bff; --oscuro: #681098;
  --aviso: #ffc23d; --mal: #ff5c7a; --bien: #6ff0b6;
  --boton: linear-gradient(#b23ee6, #a52fdc 50%, #7a16b0); /* blanco encima ≥ 4,5:1 (AA) */
  --anillo: rgba(214, 160, 255, 0.5); /* contorno de controles ≥ 3:1 sobre los paneles */
  --titulo: "Exo 2", system-ui, sans-serif; --sombra: 0 4px 0 var(--negro);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); font: 500 15px/1.4 "Exo 2", system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; overflow: hidden; }
canvas#lienzo { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--panel-2); border: 2px solid var(--negro); border-radius: 10px; padding: 6px 12px; cursor: pointer; min-height: 36px;
  box-shadow: inset 0 0 0 1px var(--anillo), inset 0 2px 0 rgba(255, 255, 255, 0.1), 0 2px 0 var(--negro); transition: transform 0.06s, background 0.12s; }
button:hover { background: #2c1860; }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 0 0 1px var(--anillo); }
button[aria-pressed="true"], button.activo { background: var(--boton); color: #fff; }
button:disabled { opacity: 0.45; cursor: default; }
button.primario { background: var(--boton); color: #fff; font-family: var(--titulo); font-style: italic; font-weight: 900; letter-spacing: 0.02em; text-transform: uppercase; text-shadow: 0 2px 0 var(--negro); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 3px 0 var(--negro); }
button.primario:hover, button[aria-pressed="true"]:hover { filter: brightness(1.1); }
button.peligro { border-color: #7a1030; color: #ffc4d0; }
input[type="range"], input[type="checkbox"] { accent-color: var(--acento); }
button:focus-visible { outline: 3px solid var(--aviso); outline-offset: 2px; }
select:focus, input:focus { outline: 2px solid var(--acento-2); outline-offset: 1px; }
select, input[type="number"], input[type="text"] { background: rgba(5, 3, 12, 0.6); border: 2px solid var(--anillo); border-radius: 10px; padding: 6px 8px; min-height: 36px; }
a { color: var(--acento-2); }
h1, h2, h3, #barra .marca { font-family: var(--titulo); font-style: italic; font-weight: 900; letter-spacing: 0.01em; }
.panel { position: fixed; background: var(--panel); border: 2px solid var(--borde); border-radius: 14px; padding: 10px 12px; backdrop-filter: blur(6px); box-shadow: 0 0 0 2px var(--negro), var(--sombra); }

#barra { position: fixed; top: 0; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 7px 12px; background: linear-gradient(rgba(12, 8, 32, 0.96), rgba(12, 8, 32, 0.75)); border-bottom: 2px solid var(--negro); box-shadow: 0 2px 0 rgba(200, 56, 248, 0.35); z-index: 5; }
#barra .marca { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; text-transform: uppercase; text-shadow: 0 2px 0 var(--negro); }
#barra .marca img { border-radius: 6px; }
#barra .marca small { color: var(--acento-2); font: 700 11px var(--titulo); font-style: italic; text-shadow: none; align-self: flex-end; margin-bottom: 3px; }
#barra .dato { color: var(--suave); font-variant-numeric: tabular-nums; }
#reloj { display: inline-flex; gap: 4px; align-items: center; }
#reloj button { min-height: 32px; min-width: 38px; padding: 2px 6px; font-size: 15px; }
#reloj #acel { min-width: 60px; text-align: center; font: italic 900 17px var(--titulo); color: var(--acento-2); font-variant-numeric: tabular-nums; }
#pestanas { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
#pestanas button { padding: 3px 8px; min-height: 32px; font-size: 13.5px; font-family: var(--titulo); font-style: italic; font-weight: 800; }

#datos { top: calc(var(--barra, 52px) + 8px); left: 12px; width: 272px; font-size: 14px; font-variant-numeric: tabular-nums; max-height: calc(100vh - 200px); overflow: auto; }
#datos dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0; }
#datos dt { color: var(--suave); font-style: italic; font-weight: 700; }
#datos dd { margin: 0; text-align: right; font-weight: 700; }
#datos h2 { font-size: 17px; margin: 0; text-shadow: 0 2px 0 var(--negro); }
#datos .estado { font-size: 13px; color: var(--aviso); font-style: italic; font-weight: 700; }
#datos .instr { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 4px 0; font-size: 13px; }
#datos .instr button { min-height: 28px; padding: 2px 8px; }
.barra-p { height: 8px; background: rgba(5, 3, 12, 0.7); border: 1px solid var(--negro); border-radius: 5px; overflow: hidden; }
.barra-p > i { display: block; height: 100%; background: linear-gradient(90deg, var(--oscuro), var(--acento), var(--acento-2)); }
#naves { top: calc(var(--barra, 52px) + 8px); right: 12px; width: 220px; font-size: 14px; max-height: 40vh; overflow: auto; }
#naves ul { list-style: none; margin: 6px 0 0; padding: 0; }
#naves li { display: flex; gap: 6px; align-items: center; justify-content: space-between; margin: 3px 0; }
#naves li button { min-height: 28px; padding: 2px 8px; font-size: 13px; }
#mandos { left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
#mandos .fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.redondo { width: 48px; height: 44px; font-size: 22px; padding: 0; }
.empuje { display: flex; align-items: center; gap: 6px; }
.empuje input { width: 140px; }
.tiempo, .zoom { display: inline-flex; gap: 4px; align-items: center; }
#acel { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
#maniobra { right: 12px; bottom: 140px; width: 320px; font-size: 14px; max-height: calc(100vh - var(--barra, 52px) - 170px); overflow: auto; }
#maniobra > strong { display: block; margin-top: 8px; font: italic 900 15px var(--titulo); }
#maniobra details { margin-top: 8px; border-top: 1px solid var(--borde); padding-top: 6px; }
#maniobra summary { cursor: pointer; }
.balance { margin: 4px 0; font-size: 13px; }
.balance .ok, .balance .mal { font-weight: 700; }
.plan-activo { border: 2px solid var(--acento); border-radius: 8px; padding: 6px 8px; margin-bottom: 4px; }
#maniobra .fila { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
#maniobra input[type="number"] { width: 80px; }

#pantalla { position: fixed; inset: var(--barra, 52px) 0 0 0; background: radial-gradient(ellipse at 50% -10%, rgba(120, 30, 190, 0.35), transparent 60%), rgba(12, 8, 32, 0.98); overflow: auto; z-index: 4; }
#contenido { max-width: 1100px; margin: 0 auto; padding: 16px; }
#contenido h1 { font-size: 30px; margin: 4px 0 14px; text-transform: uppercase; text-shadow: 0 3px 0 var(--negro), 0 0 18px rgba(200, 56, 248, 0.45); }
#contenido h2 { font-size: 19px; margin: 20px 0 8px; color: var(--acento-2); text-shadow: 0 2px 0 var(--negro); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tarjeta { background: var(--panel-2); border: 2px solid var(--negro); border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--borde), var(--sombra); }
.tarjeta h3 { font-size: 17px; margin: 0 0 4px; }
.tarjeta p { margin: 4px 0; color: var(--suave); font-size: 14px; }
label, summary, #barra .dato, .etq { font-weight: 600; }
#avisos div { font-weight: 600; }
.tarjeta.bloqueada { opacity: 0.6; }
.suave { color: var(--suave); }
.hangar { display: grid; grid-template-columns: 1fr 240px 300px; gap: 14px; align-items: start; }
.hangar canvas { width: 100%; height: 60vh; background: radial-gradient(circle at 50% 30%, #2a1458, #0a0618); border-radius: 16px; border: 2px solid var(--negro); box-shadow: inset 0 0 0 2px var(--borde), var(--sombra); }
.lista-partes { list-style: none; padding: 0; margin: 0; }
.lista-partes li { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.lista-partes li.sel { background: rgba(200, 56, 248, 0.25); box-shadow: inset 0 0 0 2px var(--acento); }
.lista-partes li span { flex: 1; }
.lista-partes li button { min-height: 28px; padding: 0 8px; }
.lista-partes li.separa { border-top: 1px dashed var(--aviso); margin-top: 6px; }
.catalogo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 70vh; overflow: auto; }
.catalogo button { text-align: left; font-size: 13px; padding: 6px 8px; }
.catalogo button small { display: block; color: var(--suave); }
dl.cifras { display: grid; grid-template-columns: auto auto; gap: 2px 10px; margin: 8px 0; font-variant-numeric: tabular-nums; }
dl.cifras dt { color: var(--suave); font-style: italic; font-weight: 700; } dl.cifras dd { margin: 0; text-align: right; font-weight: 700; }
.zonas { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0; }
.zonas i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--negro); background: rgba(255, 255, 255, 0.08); }
.ok { color: var(--bien); } .mal { color: var(--mal); } .alerta { color: var(--aviso); }
/* El color nunca es la única pista (accesibilidad, 03-12-2026): cada estado lleva además su símbolo.
   El « / "" » hace que los lectores de pantalla no lo lean (el texto ya lo dice). */
.ok::before { content: "✔ "; content: "✔ " / ""; }
.mal::before { content: "✖ "; content: "✖ " / ""; }
.alerta::before { content: "⚠ "; content: "⚠ " / ""; }
#avisos div.alerta::before { content: "⚠ "; content: "⚠ " / ""; font-weight: 800; }
#avisos div.evento::before { content: "⚡ "; content: "⚡ " / ""; font-weight: 800; }
#avisos div.hallazgo::before { content: "★ "; content: "★ " / ""; font-weight: 800; }
#avisos div.ciencia::before { content: "✦ "; content: "✦ " / ""; font-weight: 800; }
#avisos div.dinero::before { content: "€ "; content: "€ " / ""; font-weight: 800; }
#avisos div.encargo::before { content: "✉ "; content: "✉ " / ""; font-weight: 800; }
#avisos div.nave::before { content: "➤ "; content: "➤ " / ""; font-weight: 800; }
#avisos div.info::before { content: "ℹ "; content: "ℹ " / ""; font-weight: 800; }
#avisos { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--barra, 52px) + 8px); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 6; pointer-events: none; max-width: min(420px, calc(100vw - 24px)); }
#avisos div { background: var(--panel); border: 2px solid var(--negro); border-left: 5px solid var(--acento); border-radius: 10px; box-shadow: var(--sombra); padding: 6px 10px; font-size: 14px; transition: opacity 0.6s; }
#avisos div.alerta { border-left-color: var(--mal); }
#avisos div.alerta::before { color: var(--mal); }
#avisos div.evento, #avisos div.hallazgo { border-left-color: var(--aviso); }
dialog#ficha { position: fixed; top: 60px; margin: 0 auto; z-index: 7; box-shadow: 0 10px 40px rgba(0,0,0,0.6); background: var(--panel-2); color: var(--texto); border: 2px solid var(--negro); outline: 2px solid var(--borde); border-radius: 16px; max-width: 460px; padding: 18px; }
dialog#ficha::backdrop { background: rgba(0, 0, 0, 0.6); }
.inicio { max-width: 520px; margin: 8vh auto; }
.inicio h1 { margin: 0 0 8px; font-size: 20px; text-transform: none; }
.inicio h1 .suave { color: var(--acento-2); }
.inicio h1 .logo { display: block; width: 100%; height: auto; margin-bottom: 6px; }
.inicio label { display: block; margin: 10px 0; }

@media (max-width: 1400px) { #barra .marca small { display: none; } }
@media (max-width: 900px) {
  .hangar { grid-template-columns: 1fr; }
  .hangar canvas { height: 38vh; }
  #naves { display: none; }
  #maniobra { left: 12px; right: 12px; width: auto; bottom: 150px; }
  .empuje input { width: 100px; }
}
@media (max-width: 600px) {
  html, body { font-size: 13px; }
  #barra { gap: 4px 10px; padding: 6px 8px; }
  #barra .marca { display: none; }
  #reloj { display: inline-flex; gap: 4px; align-items: center; }
#reloj button { min-height: 34px; min-width: 40px; padding: 2px 8px; font-size: 16px; }
#reloj #acel { min-width: 72px; text-align: center; font: italic 900 17px var(--titulo); color: var(--acento-2); font-variant-numeric: tabular-nums; }
#pestanas { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  #pestanas button { min-height: 30px; padding: 2px 8px; flex: 0 0 auto; }
  button, select, input[type="number"], input[type="text"] { min-height: 32px; padding: 4px 8px; }
  .panel { padding: 6px 8px; border-radius: 10px; }
  #datos { width: auto; max-width: 62vw; font-size: 12px; max-height: 45vh; }
  #datos dd { white-space: nowrap; }
  #mandos button, #mandos output { white-space: nowrap; flex: 0 0 auto; }
  #datos dl { gap: 0 6px; }
  #datos .opcional { display: none; }
  #mandos { left: 6px; right: 6px; bottom: 6px; gap: 6px; }
  #mandos .fila { gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
  #mandos label > span.etq, .etq { display: none; }
  .redondo { width: 40px; height: 36px; font-size: 18px; flex: 0 0 auto; }
  .empuje input { width: 90px; }
  #avisos div { font-size: 12px; }
  #maniobra { bottom: 110px; }
  dialog#ficha { max-width: calc(100vw - 24px); }
}
