@font-face { font-family: "Stencil CM"; src: url("/lib/stencil.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Barlow"; font-weight: 400; src: url("/lib/barlow-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Barlow"; font-weight: 600; src: url("/lib/barlow-600.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; src: url("/lib/barlowc-600.woff2") format("woff2"); font-display: swap; }
:root {
  --marino: #0e1f2d; --acero: #16303f; --acero2: #1e3f52; --linea: #2f5568;
  --oro: #e3b341; --oro2: #b98a1e; --hueso: #edf1e4; --tenue: #9db3ba;
  --oliva: #56672c; --propio: #62b6f0; --enemigo: #f0685e; --verde: #7ed957;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--marino); color: var(--hueso);
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif; font-size: 15px; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: "Barlow Condensed", sans-serif; letter-spacing: .07em; }
.app { height: 100dvh; display: grid; grid-template-columns: 312px 1fr; grid-template-rows: auto 1fr auto; }

/* Botones: respuesta al paso del cursor y a la pulsacion */
.boton, .seg button, .gran, .zoom button, .clave { transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.boton { position: relative; overflow: hidden; border: 1px solid var(--oro2); background: rgba(227,179,65,.12); color: var(--oro); border-radius: 4px; padding: 7px 12px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.boton:hover { background: rgba(227,179,65,.22); border-color: var(--oro); box-shadow: 0 0 0 1px rgba(227,179,65,.35), 0 4px 14px rgba(0,0,0,.35); }
.boton:active, .seg button:active, .gran:active, .zoom button:active, .clave:active { transform: translateY(1px) scale(.985); }
.boton.ancho { width: 100%; }
.boton[aria-pressed="true"] { background: var(--oro); color: #1b1503; }
.boton.fuerte { width: 100%; padding: 12px 14px; font-size: 16.5px; color: #1b1503; background: linear-gradient(180deg, #f1c95a, var(--oro) 55%, #c9982a); border-color: #f6dc8c; box-shadow: 0 3px 0 #7d5c12, 0 8px 18px rgba(0,0,0,.4); }
.boton.fuerte:hover { filter: brightness(1.06); box-shadow: 0 3px 0 #7d5c12, 0 0 0 2px rgba(246,220,140,.4), 0 10px 22px rgba(0,0,0,.45); }
.boton.fuerte:active { transform: translateY(3px); box-shadow: 0 0 0 #7d5c12, 0 3px 8px rgba(0,0,0,.4); }
.boton.fuerte::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-18deg); transition: left .5s ease; }
.boton.fuerte:hover::after { left: 115%; }
.boton[disabled] { opacity: .55; cursor: wait; }
.enlace { background: none; border: 0; color: var(--tenue); cursor: pointer; padding: 8px; text-decoration: underline; }
.enlace:hover { color: var(--hueso); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--propio); outline-offset: 2px; }

.barra { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 8px 18px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #1a3a4d 0%, var(--acero) 100%); border-bottom: 3px solid var(--oro); position: relative; z-index: 2; }
.barra::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 6px;
  background: repeating-linear-gradient(135deg, var(--oliva) 0 10px, transparent 10px 20px); opacity: .9; pointer-events: none; }
.emblema { height: 48px; width: auto; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.marca { line-height: 1; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.marca b { display: block; font-family: "Stencil CM", "Barlow Condensed", sans-serif; font-weight: 400; font-size: 26px; letter-spacing: .04em; color: var(--hueso); white-space: nowrap; }
.marca span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--oro); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hueco { flex: 1; }
.puesto { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--oro2); border-radius: 4px; background: rgba(227,179,65,.1); font-weight: 600; white-space: nowrap; }
.puesto i { width: 9px; height: 9px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 3px rgba(126,217,87,.22); }
.puesto.b-azul { border-color: var(--propio); background: rgba(98,182,240,.14); } .puesto.b-rojo { border-color: var(--enemigo); background: rgba(240,104,94,.14); }
.reloj { text-align: right; line-height: 1.1; flex: none; }
.reloj b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 22px; letter-spacing: .06em; white-space: nowrap; }
.reloj span { font-size: 11.5px; color: var(--tenue); }
.btn-panel { display: none; flex: none; }

.panel { grid-row: 2 / 4; background: var(--acero); border-right: 1px solid var(--linea); padding: 18px 16px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.tab { display: flex; flex-direction: column; gap: 12px; }
.grupo h2 { margin: 0 0 7px; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 17px; letter-spacing: .03em; color: var(--oro); display: flex; align-items: center; gap: 8px; }
.grupo h2::after { content: ""; flex: 1; height: 1px; background: var(--linea); }
.seg { display: grid; gap: 4px; background: var(--marino); padding: 4px; border-radius: 6px; border: 1px solid var(--linea); }
.seg.c4 { grid-template-columns: repeat(4, 1fr); } .seg.c3 { grid-template-columns: repeat(3, 1fr); } .seg.c2 { grid-template-columns: repeat(2, 1fr); }
.seg button { border: 0; background: transparent; padding: 7px 2px; border-radius: 4px; cursor: pointer; color: var(--tenue); font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 15.5px; }
.seg button:hover { color: var(--hueso); background: rgba(255,255,255,.06); }
.seg button[aria-pressed="true"] { background: var(--oro); color: #1b1503; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.nota { margin: 6px 2px 0; font-size: 13px; color: var(--tenue); }
.nota:empty { display: none; }
.interruptor { display: flex; align-items: center; justify-content: space-between; padding: 5px 2px; cursor: pointer; }
.interruptor input { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 3px; background: var(--marino); border: 1px solid var(--linea); position: relative; cursor: pointer; margin: 0; flex: none; }
.interruptor input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 2px; background: var(--tenue); transition: transform .15s; }
.interruptor input:checked { background: var(--oliva); border-color: #8ea24a; }
.interruptor input:checked::after { transform: translateX(18px); background: var(--hueso); }
.fila { display: flex; gap: 6px; }
.fila input, .campo input { flex: 1; min-width: 0; width: 100%; background: var(--marino); border: 1px solid var(--linea); border-radius: 4px; padding: 7px 10px; font-family: "Barlow Condensed", sans-serif; font-size: 17px; letter-spacing: .04em; }
.fila input::placeholder, .campo input::placeholder { color: #5f7f8c; }
.ficha { background: var(--marino); border: 1px solid var(--linea); border-left: 4px solid var(--propio); border-radius: 4px; padding: 8px 12px; }
.ficha .coord { font-family: "Barlow Condensed", sans-serif; font-size: 21px; letter-spacing: .06em; }
.ficha dl { margin: 5px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; font-size: 13.5px; }
.ficha dt { color: var(--tenue); } .ficha dd { margin: 0; text-align: right; font-weight: 600; }
.vacio { color: var(--tenue); font-size: 13.5px; margin: 0; }
.resultado { margin: 6px 2px 0; font-family: "Barlow Condensed", sans-serif; font-size: 18px; }
.resultado:empty { display: none; }
.red { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.red li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--marino); border: 1px solid var(--linea); border-left: 4px solid var(--linea); border-radius: 4px; font-size: 13.5px; }
.red li.b-azul { border-left-color: var(--propio); } .red li.b-rojo { border-left-color: var(--enemigo); }
.red li b { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.red li small { color: var(--tenue); white-space: nowrap; }
.luz { width: 9px; height: 9px; border-radius: 50%; background: #56707c; flex: none; }
.luz.on { background: var(--verde); box-shadow: 0 0 0 3px rgba(126,217,87,.2); }

.marco { position: relative; min-height: 0; min-width: 0; background: #0a1721; isolation: isolate; z-index: 0; }
#mapa { position: absolute; inset: 0; background: #0a1721; font-family: inherit; }
.esq { position: absolute; width: 26px; height: 26px; border: 3px solid var(--oro); z-index: 450; pointer-events: none; }
.esq.a { top: 16px; left: 10px; border-right: 0; border-bottom: 0; } .esq.b { top: 16px; right: 10px; border-left: 0; border-bottom: 0; }
.esq.c { bottom: 10px; left: 10px; border-right: 0; border-top: 0; } .esq.d { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.mira { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 450; pointer-events: none; display: none; }
.mira::before, .mira::after { content: ""; position: absolute; background: #c8102e; }
.mira::before { left: 16px; top: 0; width: 2px; height: 34px; } .mira::after { top: 16px; left: 0; height: 2px; width: 34px; }
.norte { position: absolute; top: 30px; right: 26px; z-index: 450; width: 40px; text-align: center; pointer-events: none;
  font-family: "Stencil CM", sans-serif; font-size: 17px; color: #10212e; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.norte svg { display: block; margin: 0 auto; }
.zoom { position: absolute; right: 22px; bottom: 30px; z-index: 450; display: grid; gap: 4px; }
.zoom button { width: 38px; height: 38px; border-radius: 4px; border: 1px solid var(--oro2); background: var(--acero); color: var(--oro); font-size: 22px; line-height: 1; cursor: pointer; }
.zoom button:hover { background: var(--acero2); border-color: var(--oro); }
.aviso { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); z-index: 460; max-width: min(80%, 460px); padding: 8px 14px; border-radius: 4px;
  background: var(--marino); border: 1px solid var(--oro2); border-left: 4px solid var(--oro); font-size: 13.5px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.aviso:empty { display: none; }
.eti { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 14px; color: #0b2d5c; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; white-space: nowrap; }
.leaflet-container .leaflet-control-attribution { background: rgba(14,31,45,.78); color: var(--tenue); font-size: 10px; }
.leaflet-container .leaflet-control-attribution a { color: var(--hueso); }

.lectura { display: flex; align-items: stretch; background: var(--acero); border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom); }
.dato { padding: 7px 16px; border-right: 1px solid var(--linea); min-width: 0; }
.dato span { display: block; font-size: 11.5px; color: var(--tenue); }
.dato b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 20px; letter-spacing: .05em; white-space: nowrap; }
.dato.principal b { color: var(--oro); font-size: 24px; }
.dato.principal { background: var(--marino); }

/* Portada */
.portada { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; overflow: hidden;
  background:
    linear-gradient(rgba(98,182,240,.07) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(98,182,240,.07) 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(ellipse at 50% 30%, #1f4459 0%, var(--marino) 62%, var(--marino) 100%); }
.portada::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(135deg, var(--oro) 0 14px, #10212e 14px 28px); }
.radar { position: absolute; left: 50%; top: 32%; width: 130vmax; height: 130vmax; margin: -65vmax 0 0 -65vmax; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(227,179,65,.16), transparent 14%, transparent 100%); animation: barrido 9s linear infinite; }
@keyframes barrido { to { transform: rotate(360deg); } }
@keyframes entra { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.port-caja { position: relative; width: min(560px, 100%); flex: 1; min-height: 0; overflow-y: auto; padding: 26px 20px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.port-escudo { height: min(26dvh, 210px); width: auto; filter: drop-shadow(0 10px 22px rgba(0,0,0,.6)); animation: entra .7s ease both; flex: none; }
.portada.compacta .port-escudo { height: min(13dvh, 96px); }
.portada h1 { margin: 12px 0 0; font-family: "Stencil CM", "Barlow Condensed", sans-serif; font-weight: 400; font-size: clamp(30px, 7vw, 50px); letter-spacing: .05em; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.45); }
.port-sub { margin: 8px 0 0; color: var(--oro); font-size: 15.5px; }
.pant { width: 100%; margin-top: 22px; display: grid; gap: 12px; text-align: left; animation: entra .3s ease both; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gran { cursor: pointer; text-align: left; padding: 18px 16px; border-radius: 6px; border: 1px solid var(--linea); border-top: 4px solid var(--oro); background: linear-gradient(180deg, var(--acero2), var(--acero)); box-shadow: 0 4px 0 #0a1721, 0 12px 24px rgba(0,0,0,.4); }
.gran:hover { border-color: var(--oro); box-shadow: 0 4px 0 #0a1721, 0 0 0 2px rgba(227,179,65,.35), 0 14px 28px rgba(0,0,0,.5); transform: translateY(-2px); }
.gran:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a1721, 0 4px 10px rgba(0,0,0,.4); }
.gran b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 25px; letter-spacing: .03em; }
.gran span { display: block; margin-top: 4px; color: var(--tenue); font-size: 13.5px; }
.campo { display: grid; gap: 5px; font-size: 13.5px; color: var(--tenue); }
.tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--tenue); font-size: 13px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--linea); }
.port-error { min-height: 20px; margin: 10px 0 0; color: #ffb3ac; font-weight: 600; }
.port-pie { position: relative; margin: 0; padding: 8px 16px max(10px, env(safe-area-inset-bottom)); font-size: 11.5px; color: #7f98a1; text-align: center; }
.orden-puesto { padding: 12px 14px; border-radius: 6px; background: var(--acero); border: 1px solid var(--linea); border-left: 6px solid var(--oro); }
.orden-puesto.b-azul { border-left-color: var(--propio); } .orden-puesto.b-rojo { border-left-color: var(--enemigo); }
.orden-puesto span { display: block; font-size: 12.5px; color: var(--tenue); }
.orden-puesto b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 25px; letter-spacing: .03em; }
.orden-puesto em { font-style: normal; color: var(--oro); font-size: 13.5px; }
.orden-txt { margin: 0; font-size: 14.5px; }
.claves { display: grid; gap: 8px; }
.clave { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; width: 100%; text-align: left; cursor: pointer; padding: 10px 12px; border-radius: 6px; background: var(--marino); border: 1px solid var(--linea); border-left: 6px solid var(--linea); }
.clave:hover { border-color: var(--oro); }
.clave.b-azul { border-left-color: var(--propio); } .clave.b-rojo { border-left-color: var(--enemigo); }
.clave span { font-size: 13px; color: var(--tenue); }
.clave b { grid-column: 1; font-size: 23px; color: var(--hueso); }
.clave i { grid-row: 1 / 3; grid-column: 2; font-style: normal; font-size: 12.5px; color: var(--tenue); display: flex; align-items: center; gap: 6px; }
.clave.sub { margin-left: 18px; width: calc(100% - 18px); padding: 6px 10px; } .clave.sub b { font-size: 18px; }
details summary { cursor: pointer; color: var(--oro); padding: 6px 0; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .barra { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .emblema { height: 40px; } .marca { flex: 1 1 auto; } .marca b { font-size: 19px; } .marca span { font-size: 11px; }
  .puesto, .reloj span, .hueco { display: none; } .reloj b { font-size: 16px; }
  .btn-panel { display: block; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; max-height: 76dvh; border-right: 0; border-top: 3px solid var(--oro);
    transform: translateY(105%); transition: transform .22s ease; padding-bottom: max(14px, env(safe-area-inset-bottom)); box-shadow: 0 -12px 30px rgba(0,0,0,.5); }
  .panel.abierto { transform: none; }
  .dato { padding: 6px 12px; } .dato.sec { display: none; } .dato.principal b { font-size: 21px; } .dato b { font-size: 17px; }
  .norte { top: 26px; right: 18px; } .zoom { right: 14px; }
}
@media (max-width: 520px) { .reloj { display: none; } .marca b { font-size: 18px; } .dos { grid-template-columns: 1fr; } .tres { grid-template-columns: 1fr; } }
@media (hover: none) { .mira { display: block; } }
@media (prefers-reduced-motion: reduce) { *, *::after { transition: none !important; animation: none !important; } .radar { display: none; } }

/* ---- Pestaña de fichas ---- */
#tabFichas { flex: 1; min-height: 0; }
.grupo.llena { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fichas { list-style: none; margin: 8px 0 0; padding: 0 2px 0 0; display: grid; gap: 4px; overflow-y: auto; min-height: 0; align-content: start; }
.fila-ficha { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; padding: 3px 8px 3px 6px; border-radius: 4px; background: var(--marino); border: 1px solid var(--linea);
  transition: transform .08s ease, border-color .15s ease, background-color .15s ease; }
.fila-ficha:hover { border-color: var(--oro); background: #12283a; }
.fila-ficha:active { transform: translateY(1px) scale(.99); }
.fila-ficha.sel { border-color: var(--oro); background: rgba(227,179,65,.16); box-shadow: inset 4px 0 0 var(--oro); }
.fila-ficha.ajena { cursor: default; opacity: .72; }
.fila-ficha .sim { width: 38px; height: 40px; flex: none; }
.fila-ficha span { min-width: 0; }
.fila-ficha b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-ficha small { display: block; color: var(--tenue); font-family: "Barlow Condensed", sans-serif; font-size: 14px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sep-fichas { margin-top: 6px; font-size: 12.5px; color: var(--tenue); }

/* ---- Fichas sobre el plano ---- */
.ficha-mapa { text-align: center; }
.ficha-mapa .sim { width: 46px; height: 49px; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.55)); transition: transform .12s ease; }
.ficha-mapa span { display: block; margin: -3px -30px 0; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 12.5px; line-height: 1; color: #10212e; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; white-space: nowrap; pointer-events: none; }
.ficha-mapa:hover .sim { transform: scale(1.12); }
.ficha-mapa.sel .sim { transform: scale(1.18); filter: drop-shadow(0 0 5px var(--oro)) drop-shadow(0 0 2px var(--oro)); }
.ficha-mapa.ajena .sim { opacity: .82; }
.ficha-mapa.cae .sim { animation: cae .38s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes cae { from { transform: translateY(-26px) scale(1.5); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Elige tu brigada ---- */
.portada.ancha .port-caja { width: min(1060px, 100%); padding-top: 18px; }
.portada.ancha .port-escudo { height: min(9dvh, 64px); }
.portada.ancha h1 { font-size: clamp(22px, 3.4vw, 30px); margin-top: 6px; }
.portada.ancha .port-sub { display: none; }
.portada.ancha .pant { margin-top: 10px; gap: 10px; }
.bri-titulo { margin: 0; text-align: center; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 22px; letter-spacing: .04em; color: var(--oro); }
.bri-cartas { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.pant { min-width: 0; } .pant > * { min-width: 0; }
.bri-carta { cursor: pointer; padding: 10px 4px 9px; text-align: center; border-radius: 6px; border: 1px solid var(--linea); border-bottom: 4px solid #0a1721; background: linear-gradient(180deg, var(--acero2), var(--acero));
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease; min-width: 0; }
.bri-carta em { display: block; font-style: normal; font-family: "Stencil CM", sans-serif; font-size: 34px; line-height: 1; color: var(--tenue); }
.bri-carta b { display: block; margin-top: 5px; font-family: "Barlow Condensed", sans-serif; font-size: 15.5px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bri-carta span { display: block; font-size: 12px; color: var(--tenue); }
.bri-carta:hover { transform: translateY(-3px); border-color: var(--oro2); }
.bri-carta:active { transform: translateY(2px); }
.bri-carta[aria-selected="true"] { border-color: var(--oro); border-bottom-color: var(--oro2); background: linear-gradient(180deg, #2a5670, #1b3b4d); transform: translateY(-5px);
  box-shadow: 0 0 0 2px rgba(227,179,65,.4), 0 14px 26px rgba(0,0,0,.5); }
.bri-carta[aria-selected="true"] em { color: var(--oro); text-shadow: 0 0 14px rgba(227,179,65,.55); }
.bri-detalle { background: rgba(14,31,45,.82); border: 1px solid var(--linea); border-left: 6px solid var(--propio); border-radius: 6px; padding: 12px 14px; }
.bri-detalle.cambia { animation: entra .22s ease both; }
.bri-cab b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 24px; letter-spacing: .03em; }
.bri-cab span { color: var(--tenue); font-size: 13.5px; }
.bri-cuerpo { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 6px 22px; margin-top: 10px; align-items: start; }
.bri-stats { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; align-items: center; font-size: 13.5px; }
.bri-stats dt { color: var(--tenue); } .bri-stats dd { margin: 0; }
.niveles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.niveles i { height: 12px; background: #0a1721; border: 1px solid var(--linea); transform: skewX(-18deg); }
.niveles i.on { background: linear-gradient(180deg, #f1c95a, var(--oro2)); border-color: var(--oro); }
.bri-uds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; }
.bri-uds li { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bri-uds .sim { width: 36px; height: 38px; flex: none; }
.bri-uds span { min-width: 0; }
.bri-uds b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bri-uds small { display: block; font-size: 12px; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .bri-cartas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bri-cuerpo { grid-template-columns: minmax(0, 1fr); } .bri-uds { grid-template-columns: minmax(0, 1fr); }
  .bri-carta em { font-size: 26px; } .bri-carta b { font-size: 13.5px; }
}

/* ---- Ajustes de cabecera y red de mando ---- */
@media (min-width: 861px) { .marca { flex-shrink: 0; } }
.puesto { min-width: 0; }
.puesto span { overflow: hidden; text-overflow: ellipsis; }
#tabMando { flex: 1; min-height: 0; }
#tabMando .grupo.llena .red { overflow-y: auto; min-height: 0; align-content: start; }
.portada.ancha .port-pie { padding-top: 4px; }
.red, .fichas { grid-template-columns: minmax(0, 1fr); }

/* ---- Fase, cola de validación y órdenes ---- */
.fase { margin: 0 0 6px; font-size: 13.5px; color: var(--tenue); }
.fase b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 21px; letter-spacing: .04em; color: var(--hueso); }
.fila-ficha.e-pendiente { box-shadow: inset 4px 0 0 var(--oro); }
.fila-ficha.e-aprobada { box-shadow: inset 4px 0 0 #2e9e3f; }
.fila-ficha.e-devuelta { box-shadow: inset 4px 0 0 var(--enemigo); }
.cola-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cola-cab b { font-family: "Barlow Condensed", sans-serif; font-size: 17px; letter-spacing: .03em; }
.cola { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; max-height: 38dvh; overflow-y: auto; }
.cola li { padding: 7px 8px; background: var(--marino); border: 1px solid var(--linea); border-left: 4px solid var(--propio); border-radius: 4px; }
.cola li.b-rojo { border-left-color: var(--enemigo); }
.cola-txt b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cola-txt small { display: block; color: var(--tenue); font-size: 12.5px; }
.cola-bot { display: grid; grid-template-columns: 1fr 1fr auto; gap: 5px; margin-top: 6px; }
.cola .fila { margin-top: 6px; }
.boton.si { border-color: #2e9e3f; color: #8fe39b; background: rgba(46,158,63,.16); }
.boton.si:hover { background: rgba(46,158,63,.3); border-color: #8fe39b; }
.boton.no { border-color: var(--enemigo); color: #ffb3ac; background: rgba(240,104,94,.14); }
.boton.no:hover { background: rgba(240,104,94,.28); }
#mapa.resolviendo .leaflet-marker-icon.ficha-mapa { transition: transform 1.5s cubic-bezier(.45, .05, .25, 1); }

/* ---- Radio ---- */
#tabRadio { flex: 1; min-height: 0; }
#tabRadio .grupo.llena { gap: 7px; }
.globo { display: inline-block; min-width: 17px; margin-left: 5px; padding: 0 5px; border-radius: 9px; background: var(--enemigo); color: #fff; font: 600 11.5px/17px "Barlow", sans-serif; font-style: normal; vertical-align: 1px; }
.redes { display: flex; flex-wrap: wrap; gap: 4px; }
.redes button { border: 1px solid var(--linea); background: var(--marino); color: var(--tenue); border-radius: 4px; padding: 5px 8px; cursor: pointer; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 14.5px; transition: transform .08s ease, border-color .15s ease; }
.redes button:hover { border-color: var(--oro2); color: var(--hueso); }
.redes button:active { transform: translateY(1px); }
.redes button[aria-pressed="true"] { background: var(--oro); border-color: var(--oro); color: #1b1503; }
.mensajes { list-style: none; margin: 0; padding: 6px; flex: 1; min-height: 60px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; background: #0a1721; border: 1px solid var(--linea); border-radius: 4px; }
.mensajes li { padding: 6px 8px; border-radius: 4px; background: var(--acero2); border-left: 4px solid var(--linea); max-width: 94%; align-self: flex-start; animation: entra .25s ease both; }
.mensajes li.mio { align-self: flex-end; background: #244a5f; }
.mensajes li div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.mensajes li div b { color: var(--oro); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mensajes li div small { color: var(--tenue); white-space: nowrap; }
.mensajes li p { margin: 2px 0 0; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mensajes li.m-orden { border-left-color: var(--oro); }
.mensajes li.m-parte { border-left-color: var(--propio); }
.mensajes li.m-fuegos { border-left-color: var(--enemigo); }
.mensajes li.m-aprobada { border-left-color: #2e9e3f; background: rgba(46,158,63,.18); }
.mensajes li.m-devuelta { border-left-color: var(--enemigo); background: rgba(240,104,94,.16); }
.mensajes li.m-sistema { align-self: center; background: none; border: 0; color: var(--tenue); text-align: center; }
.mensajes li.m-sistema div { display: none; }
.mensajes li.m-vacio { align-self: center; background: none; border: 0; color: var(--tenue); font-size: 13px; text-align: center; margin: auto 0; animation: none; }
.coord-msj { border: 0; background: rgba(98,182,240,.2); color: #bfe3fb; border-radius: 3px; padding: 0 4px; cursor: pointer; font: 600 14.5px "Barlow Condensed", sans-serif; letter-spacing: .05em; }
.coord-msj:hover { background: rgba(98,182,240,.4); }
.plantillas { display: flex; flex-wrap: wrap; gap: 4px; }
.plantillas button { border: 1px dashed var(--linea); background: none; color: var(--tenue); border-radius: 4px; padding: 3px 7px; cursor: pointer; font-size: 12.5px; transition: border-color .15s ease, color .15s ease; }
.plantillas button:hover { border-color: var(--oro); color: var(--oro); }
#rTexto { width: 100%; resize: none; background: var(--marino); color: var(--hueso); border: 1px solid var(--linea); border-radius: 4px; padding: 7px 9px; font: inherit; font-size: 14px; }
#rTexto:focus-visible { outline: 2px solid var(--propio); outline-offset: 2px; }
#pestanas button { position: relative; }

/* ---- Acciones del turno, contactos, blancos y efectos ---- */
.acciones, .rep { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 470; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; max-width: calc(100% - 130px);
  padding: 7px 9px; border-radius: 6px; background: rgba(14,31,45,.95); border: 1px solid var(--oro2); box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.rep { top: 22px; bottom: auto; z-index: 480; }
.acciones b, .rep b { font-family: "Barlow Condensed", sans-serif; font-size: 16px; letter-spacing: .03em; color: var(--oro); padding: 0 4px; }
.rep span { font-size: 12.5px; color: var(--tenue); }
.acciones button, .rep button { border: 1px solid var(--linea); background: var(--acero2); color: var(--hueso); border-radius: 4px; padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 13.5px;
  transition: transform .08s ease, background-color .15s ease, border-color .15s ease; }
.acciones button:hover, .rep button:hover { border-color: var(--oro); background: #2a5670; }
.acciones button:active, .rep button:active { transform: translateY(1px) scale(.97); }
.acciones button[aria-pressed="true"] { background: var(--oro); border-color: var(--oro); color: #1b1503; }
.acciones button.quita { border-color: var(--enemigo); color: #ffb3ac; }
.acciones button.cierra, .rep button.cierra { background: none; color: var(--tenue); }
.rep button[disabled] { opacity: .35; cursor: default; }
.fila-ficha.neutral, .ficha-mapa.neutral .sim { filter: grayscale(1); opacity: .62; }
.ficha-mapa.neutral span { color: #7a1010; }
.ficha-mapa.o-pendiente .sim { filter: drop-shadow(0 0 4px var(--oro)); } .ficha-mapa.o-aprobada .sim { filter: drop-shadow(0 0 4px #2e9e3f); } .ficha-mapa.o-devuelta .sim { filter: drop-shadow(0 0 4px var(--enemigo)); }
.ficha-mapa.contacto span { color: #7a1010; }
.ficha-mapa.contacto.parte .sim { opacity: .55; }
div.fila-ficha.contacto { cursor: default; border-left: 4px solid var(--enemigo); }
div.fila-ficha.contacto span { flex: 1; }
div.fila-ficha.contacto .boton { padding: 4px 8px; font-size: 12.5px; }
.blanco i { display: block; width: 30px; height: 30px; border: 3px solid var(--oro); border-radius: 50%; background:
  linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat, linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; color: var(--oro); box-shadow: 0 0 0 2px #10212e; }
.blanco.atacar i { border-radius: 0; transform: rotate(45deg); }
.blanco.e-aprobada i { border-color: #2e9e3f; color: #2e9e3f; } .blanco.e-devuelta i { border-color: #c8102e; color: #c8102e; }
.rotulo b { display: inline-block; padding: 1px 6px; border-radius: 3px; font: 600 13px "Barlow Condensed", sans-serif; letter-spacing: .04em; white-space: nowrap; color: #fff; background: #7a1fa2; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.rotulo { text-align: center; }
.rotulo.puente b { background: #1565c0; } .rotulo.obst b { background: #5d4037; }
.fx { pointer-events: none; }
.fx i { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 4px solid #ffb300; opacity: 0; animation: onda 1.5s ease-out forwards; }
.fx i:nth-child(2) { animation-delay: .22s; border-color: #ff6d00; } .fx i:nth-child(3) { animation-delay: .44s; border-color: #c8102e; }
.fx.fuego i:first-child { background: radial-gradient(circle, #fff3c4, #ff9800 55%, transparent 70%); border: 0; animation-name: destello; }
.fx.vacio i { border-color: #9db3ba; }
@keyframes onda { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(5.2); opacity: 0; } }
@keyframes destello { 0% { transform: scale(.2); opacity: 1; } 35% { transform: scale(3.4); opacity: .95; } 100% { transform: scale(4.4); opacity: 0; } }
#mapa.tiembla { animation: tiembla .42s linear; }
@keyframes tiembla { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 3px); } 40% { transform: translate(4px, -4px); } 60% { transform: translate(-3px, -2px); } 80% { transform: translate(3px, 3px); } }
.mensajes li.m-combate { border-left-color: #ff6d00; background: rgba(255,109,0,.14); align-self: stretch; max-width: none; }
.mensajes li.m-combate div { display: none; }

/* ---- Marcador ---- */
.marcador { width: 100%; border-collapse: collapse; font-size: 13px; }
.marcador th { font-weight: 400; color: var(--tenue); font-size: 11.5px; text-align: right; padding: 0 3px 2px; }
.marcador td { text-align: right; padding: 4px 3px; border-top: 1px solid var(--linea); white-space: nowrap; }
.marcador td:first-child { text-align: left; font-weight: 600; border-left: 4px solid var(--propio); padding-left: 6px; }
.marcador tr.b-rojo td:first-child { border-left-color: var(--enemigo); }
.marcador td b { font-family: "Barlow Condensed", sans-serif; font-size: 18px; color: var(--oro); }
.marcador button { width: 20px; height: 20px; padding: 0; margin: 0 2px; border-radius: 3px; border: 1px solid var(--linea); background: var(--marino); color: var(--hueso); cursor: pointer; }
a.boton { text-decoration: none; display: inline-block; text-align: center; }

/* ---- Organización para el combate y editor de brigada ---- */
.org { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.org-gt { display: grid; gap: 5px; align-content: start; padding: 10px; border-radius: 6px; background: rgba(14,31,45,.82); border: 1px solid var(--linea); border-top: 4px solid var(--propio); min-height: 120px; }
.org-gt > b { font-family: "Barlow Condensed", sans-serif; font-size: 18px; } .org-gt > small { color: var(--tenue); font-size: 12px; margin-bottom: 4px; }
.org-cia { cursor: grab; text-align: left; padding: 7px 9px; border-radius: 4px; border: 1px solid var(--linea); background: var(--acero2); font-size: 13.5px; transition: transform .08s ease, border-color .15s ease; }
.org-cia:hover { border-color: var(--oro); } .org-cia:active { transform: scale(.97); }
.org-cia.sel { border-color: var(--oro); background: rgba(227,179,65,.2); box-shadow: inset 4px 0 0 var(--oro); }
.bri-cartas { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.ed { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; margin-top: 10px; }
.ed-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
.ed-pieza { display: flex; align-items: center; gap: 6px; cursor: grab; padding: 4px 6px; border-radius: 4px; border: 1px solid var(--linea); background: var(--acero2); font-size: 12.5px; text-align: left; min-width: 0; transition: transform .08s ease, border-color .15s ease; }
.ed-pieza:hover { border-color: var(--oro); } .ed-pieza:active { transform: scale(.96); }
.ed-pieza .sim { width: 30px; height: 32px; flex: none; }
.ed-pieza span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-org { display: grid; gap: 8px; align-content: start; padding: 10px; border: 1px dashed var(--linea); border-radius: 6px; }
.ed-raiz { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tenue); } .ed-raiz .sim { width: 34px; height: 36px; flex: none; }
.ed-hijos { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 18px; border-left: 2px solid var(--oro2); min-height: 44px; }
.ed-pieza.puesta { border-color: var(--oro2); cursor: pointer; }
.ed-hueco { display: flex; align-items: center; padding: 0 14px; border: 1px dashed var(--oro2); border-radius: 4px; color: var(--tenue); font-size: 12.5px; }
@media (max-width: 860px) {
  .bri-cartas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ed { grid-template-columns: minmax(0, 1fr); }
  .acciones, .rep { max-width: calc(100% - 20px); bottom: 12px; } .rep { bottom: auto; }
  .acciones button { padding: 6px 8px; font-size: 13px; }
  .zoom { bottom: 96px; }
}
#tabPlano { gap: 9px; }
.aviso { pointer-events: none; }

/* ---- Sin zoom de página al tocar; botones de zoom del plano más grandes ---- */
html, body, button, a, label, .panel, .portada { touch-action: manipulation; }
.zoom { gap: 6px; }
.zoom button { width: 46px; height: 46px; font-size: 28px; font-weight: 600; box-shadow: 0 3px 0 #0a1721, 0 6px 14px rgba(0,0,0,.45); }
.zoom button:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a1721; }
* { touch-action: manipulation; } #mapa, #mapa * { touch-action: none; }

/* ---- Pilas de fichas, abanico y modo demostración ---- */
.ficha-mapa .pila { position: absolute; right: -9px; top: 6px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; background: #10212e; color: var(--oro); border: 2px solid var(--oro); font: 600 12px/15px "Barlow", sans-serif; font-style: normal; text-align: center; }
.ficha-mapa.cima .sim { filter: drop-shadow(4px -4px 0 rgba(16,33,46,.75)) drop-shadow(0 2px 2px rgba(0,0,0,.55)); }
.ficha-mapa.flota .sim { filter: drop-shadow(0 8px 6px rgba(0,0,0,.6)); animation: sube .22s ease-out both; }
.ficha-mapa.flota span { background: rgba(14,31,45,.92); color: var(--hueso); text-shadow: none; padding: 2px 5px; border-radius: 3px; margin-top: 0; display: inline-block; }
@keyframes sube { from { transform: translateY(40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.acciones .pista { font-size: 13px; color: var(--tenue); padding: 0 4px; }
.boton.demo { margin-top: 2px; border-style: dashed; white-space: normal; padding: 10px 12px; }
#selDemo { width: 100%; background: var(--marino); color: var(--hueso); border: 1px solid var(--oro2); border-radius: 4px; padding: 8px; font: inherit; font-size: 14px; }

/* ---- Guía paso a paso ---- */
.guia { position: absolute; left: 46px; right: 84px; top: 20px; z-index: 465; display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 4px;
  background: rgba(14,31,45,.94); border: 1px solid var(--linea); border-left: 5px solid var(--oro); box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.guia div { flex: 1; min-width: 0; }
.guia b { font-family: "Barlow Condensed", sans-serif; font-size: 16.5px; letter-spacing: .03em; color: var(--oro); }
.guia p { margin: 1px 0 0; font-size: 13.5px; line-height: 1.3; }
.guia button { flex: none; border: 1px solid var(--linea); background: var(--acero2); color: var(--hueso); border-radius: 4px; padding: 3px 9px; cursor: pointer; font-weight: 600; }
.guia.plegada { right: auto; padding: 0; border: 0; background: none; box-shadow: none; }
.guia.plegada button { padding: 7px 12px; border-color: var(--oro2); color: var(--oro); background: rgba(14,31,45,.94); }
.aviso { top: auto; bottom: 86px; }
.norte { top: 26px; }
@media (max-width: 860px) { .guia { left: 12px; right: 66px; top: 18px; } .guia p { font-size: 13px; } .aviso { bottom: 76px; max-width: 92%; } }

/* ---- Aviso del DIREX: ventana de chat que abre y cierra el DIREX ---- */
.chat-direx { position: fixed; z-index: 700; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(430px, calc(100vw - 20px)); max-height: min(520px, calc(100dvh - 40px));
  display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; border-radius: 6px; background: #10212e; border: 1px solid var(--oro2); border-top: 5px solid var(--oro);
  box-shadow: 0 0 0 100vmax rgba(5,12,18,.45), 0 18px 50px rgba(0,0,0,.7); animation: avisoEntra .25s ease-out both; }
@keyframes avisoEntra { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%); } }
.chat-direx header { display: flex; align-items: center; gap: 8px; padding-top: 9px; }
.chat-direx header b { flex: 1; min-width: 0; font-family: "Saira Stencil One", "Barlow Condensed", sans-serif; font-weight: 400; font-size: 19px; letter-spacing: .04em; color: var(--oro); }
.chat-direx header button { border: 1px solid var(--linea); background: var(--acero2); color: var(--hueso); border-radius: 4px; width: 34px; height: 30px; cursor: pointer; font-size: 18px; line-height: 1; }
.cd-fichas { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.cd-fichas button { flex: none; border: 1px solid var(--linea); background: var(--acero); color: var(--hueso); border-radius: 14px; padding: 4px 11px; cursor: pointer; font-size: 13.5px; }
.cd-fichas button[aria-pressed="true"] { background: var(--oro); border-color: var(--oro); color: #1b1503; font-weight: 600; }
.cd-para { display: flex; align-items: center; gap: 8px; color: var(--tenue); font-size: 14px; }
.cd-para select { flex: 1; min-width: 0; background: var(--marino); color: var(--hueso); border: 1px solid var(--oro2); border-radius: 4px; padding: 8px; font: inherit; font-size: 16px; }
#cdLista { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 70px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
#cdLista li { align-self: flex-start; max-width: 88%; padding: 6px 10px; border-radius: 4px; background: var(--acero); border-left: 3px solid var(--linea); }
#cdLista li.del-direx { border-left-color: var(--oro); background: rgba(227,179,65,.12); }
#cdLista li.mio { align-self: flex-end; border-left: 0; border-right: 3px solid var(--propio); }
#cdLista li div { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--tenue); }
#cdLista li b { color: var(--hueso); font-weight: 600; }
#cdLista li p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.3; }
.cd-pie { display: flex; gap: 6px; align-items: stretch; }
.cd-pie textarea { flex: 1; min-width: 0; resize: none; background: var(--marino); color: var(--hueso); border: 1px solid var(--linea); border-radius: 4px; padding: 7px 9px; font: inherit; font-size: 16px; }
.cd-pie textarea:focus, .cd-para select:focus { outline: 2px solid var(--oro); outline-offset: 1px; }
.cd-cerrar { border: 1px solid var(--enemigo); background: rgba(240,104,94,.12); color: var(--enemigo); border-radius: 4px; padding: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.cd-cerrar:hover { background: rgba(240,104,94,.24); }
.chip-direx { position: fixed; z-index: 700; right: 12px; top: 74px; border: 1px solid var(--oro); background: var(--oro); color: #1b1503; border-radius: 18px; padding: 7px 14px; cursor: pointer; font: inherit; font-weight: 600; box-shadow: 0 6px 16px rgba(0,0,0,.5); animation: late 1.6s ease-in-out infinite; }
.chip-direx i { font-style: normal; margin-left: 7px; background: #1b1503; color: var(--oro); border-radius: 10px; padding: 1px 7px; font-size: 13px; }
@keyframes late { 50% { box-shadow: 0 0 0 7px rgba(227,179,65,.25), 0 6px 16px rgba(0,0,0,.5); } }
@media (prefers-reduced-motion: reduce) { .chat-direx, .chip-direx { animation: none; } }

/* ---- Modo de la unidad y funciones tácticas ---- */
.ficha-mapa .modo { position: absolute; left: -8px; top: 8px; font: 600 9.5px/13px "Barlow", sans-serif; font-style: normal; letter-spacing: .04em; padding: 0 3px; border-radius: 3px; border: 1px solid #10212e; }
.ficha-mapa .modo.m-of { background: var(--oro); color: #1b1503; }
.ficha-mapa .modo.m-def { background: var(--oliva); color: #fff; }
.ficha-mapa.ajena .modo { opacity: .85; }
.acciones.func { flex-direction: column; align-items: stretch; gap: 6px; width: min(640px, calc(100% - 130px)); }
.acciones .fila-b { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; }
.acciones .fila-b:first-child { justify-content: flex-start; }
.acciones .fila-b:first-child .cierra { margin-left: auto; }
.acciones .funs { padding: 5px 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.acciones .funs button { background: none; border-radius: 14px; padding: 4px 10px; font-size: 13px; }
.acciones .funs button[aria-pressed="true"] { background: var(--hueso); border-color: var(--hueso); color: #10212e; }
.acciones button:disabled { opacity: .32; cursor: not-allowed; border-style: dashed; }
.conmuta { display: inline-flex; border: 1px solid var(--oro2); border-radius: 4px; overflow: hidden; }
.acciones .conmuta button { border: 0; border-radius: 0; background: none; padding: 6px 9px; }
.acciones .conmuta button[aria-pressed="true"] { background: var(--oro); color: #1b1503; }
@media (max-width: 860px) { .acciones.func { width: calc(100% - 16px); max-width: none; bottom: 8px; } .acciones .funs button { padding: 5px 8px; font-size: 12.5px; } }
.marco:has(.acciones.func:not([hidden])) .aviso { bottom: 172px; }
@media (max-width: 860px) { .marco:has(.acciones.func:not([hidden])) .zoom { bottom: 190px; } .marco:has(.acciones.func:not([hidden])) .aviso { bottom: 200px; } }
@media (max-width: 860px) { .acciones.func { bottom: 36px; } .marco:has(.acciones.func:not([hidden])) .zoom { bottom: 218px; } .marco:has(.acciones.func:not([hidden])) .aviso { bottom: 226px; } }

/* ---- Informe final: ganador y lecciones aprendidas ---- */
.informe { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(5,12,18,.82); }
.informe[hidden] { display: none; }
.inf-caja { width: min(1080px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #10212e; border: 1px solid var(--oro2); border-radius: 6px; box-shadow: 0 24px 70px rgba(0,0,0,.75); overflow: hidden; }
.inf-cab { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 4px solid var(--oro); background: linear-gradient(90deg, rgba(227,179,65,.16), transparent 70%); }
.inf-cab.g-azul { border-bottom-color: var(--propio); background: linear-gradient(90deg, rgba(98,182,240,.2), transparent 70%); }
.inf-cab.g-rojo { border-bottom-color: var(--enemigo); background: linear-gradient(90deg, rgba(240,104,94,.2), transparent 70%); }
.inf-cab img { height: 74px; flex: none; }
.inf-cab div { flex: 1; min-width: 0; }
.inf-cab small { color: var(--tenue); font-size: 13px; }
.inf-cab h2 { margin: 0; font-family: "Saira Stencil One", "Barlow Condensed", sans-serif; font-weight: 400; font-size: clamp(22px, 3.4vw, 36px); line-height: 1.05; letter-spacing: .03em; color: var(--oro); }
.inf-cab p { margin: 3px 0 0; font-size: 15px; }
.inf-cab button { flex: none; align-self: flex-start; width: 36px; height: 34px; border: 1px solid var(--linea); background: var(--acero2); color: var(--hueso); border-radius: 4px; cursor: pointer; font-size: 18px; }
.inf-cuerpo { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 16px; }
.inf-bando { padding: 10px 12px; border-radius: 4px; background: var(--acero); border-top: 4px solid var(--propio); }
.inf-bando.b-rojo { border-top-color: var(--enemigo); }
.inf-bando.gana { box-shadow: 0 0 0 2px var(--oro); }
.inf-bando h3 { margin: 0; display: flex; align-items: baseline; gap: 10px; font-family: "Barlow Condensed", sans-serif; font-size: 22px; letter-spacing: .02em; }
.inf-bando h3 b { margin-left: auto; font-family: "Saira Stencil One", sans-serif; font-weight: 400; font-size: 30px; color: var(--oro); }
.inf-pts { margin: 2px 0 8px; font-size: 13px; color: var(--tenue); }
.inf-fun { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; align-items: end; margin-bottom: 4px; }
.inf-fun span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-size: 10.5px; line-height: 1.15; text-align: center; color: var(--tenue); overflow-wrap: anywhere; }
.inf-fun i { width: 70%; background: var(--oro); border-radius: 2px 2px 0 0; }
.inf-fun b { color: var(--hueso); font-size: 13px; }
.inf-fun .cero i { background: var(--linea); }
.inf-bando h4 { margin: 10px 0 3px; font-family: "Barlow Condensed", sans-serif; font-size: 16px; letter-spacing: .04em; color: var(--oro); }
.inf-bando ul, .inf-bando ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.35; }
.inf-bando li { margin-bottom: 3px; }
.inf-bando ul.bien li::marker { color: #58c26a; content: "+ "; }
.inf-bando ul.mal li::marker { color: var(--enemigo); content: "− "; }
.inf-caja footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--linea); }
.inf-caja footer .boton { text-decoration: none; }
@media (max-width: 760px) { .informe { padding: 6px; } .inf-cuerpo { grid-template-columns: minmax(0, 1fr); padding: 10px; } .inf-cab img { height: 52px; } .inf-cab { padding: 10px; gap: 10px; } .inf-caja footer .boton { flex: 1; text-align: center; } }
.informe em { font-style: normal; }
.informe .corto { display: none; }
@media (max-width: 760px) { .informe .largo { display: none; } .informe .corto { display: inline; } .inf-caja footer .boton { padding-left: 6px; padding-right: 6px; } }

/* ---- Reserva, orden de operaciones ---- */
.ficha-mapa .modo.m-res { background: #6d7f8c; color: #fff; }
.op-caja { width: min(620px, 100%); }
.op-cuerpo { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.op-cuerpo fieldset { border: 1px solid var(--linea); border-radius: 4px; margin: 0; padding: 6px 10px 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.op-cuerpo legend { padding: 0 6px; font-family: "Barlow Condensed", sans-serif; font-size: 16px; letter-spacing: .04em; color: var(--oro); }
.op-cuerpo label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--tenue); min-width: 0; }
.op-cuerpo label:has(input) { grid-column: 1 / -1; }
.op-cuerpo select, .op-cuerpo input { width: 100%; background: var(--marino); color: var(--hueso); border: 1px solid var(--linea); border-radius: 4px; padding: 7px; font: inherit; font-size: 16px; }
.op-cuerpo select:focus, .op-cuerpo input:focus { outline: 2px solid var(--oro); outline-offset: 1px; }
.op-cuerpo pre, .inf-opord pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.4; }
.inf-opord { margin: 6px 0; font-size: 13.5px; }
.inf-opord summary { cursor: pointer; color: var(--oro); }
@media (max-width: 760px) { .op-cuerpo fieldset { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .marco:has(.acciones.func:not([hidden])) .zoom { bottom: 268px; } .marco:has(.acciones.func:not([hidden])) .aviso { bottom: 276px; } .acciones .conmuta button { padding: 6px 7px; } }

/* ---- Barra de acciones estilo juego de móvil: tira de tarjetas ---- */
.acciones .tira { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.acciones .carta { flex: none; min-width: 96px; max-width: 150px; min-height: 54px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--linea); border-top: 4px solid var(--tenue);
  background: var(--acero2); color: var(--hueso); font-size: 14.5px; font-weight: 600; line-height: 1.15; text-align: left; white-space: normal; scroll-snap-align: start; box-shadow: 0 3px 0 rgba(0,0,0,.35); transition: transform .08s; }
.acciones .carta:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.acciones .carta small { font-size: 10.5px; font-weight: 500; letter-spacing: .03em; color: var(--tenue); }
.acciones .carta[aria-pressed="true"] { background: var(--oro); border-color: var(--oro); color: #1b1503; }
.acciones .carta[aria-pressed="true"] small { color: #4a3a08; }
.carta.f-mando { border-top-color: #c9a227; } .carta.f-inteligencia { border-top-color: #62b6f0; } .carta.f-maniobra { border-top-color: #58c26a; } .carta.f-fuegos { border-top-color: #f0685e; }
.carta.f-logistico { border-top-color: #b98b5a; } .carta.f-proteccion { border-top-color: #9aa7b1; } .carta.f-informacion { border-top-color: #b085f5; }
.acciones .res-b { border-radius: 4px; padding: 6px 9px; }
.acciones .res-b[aria-pressed="true"] { background: #6d7f8c; border-color: #6d7f8c; color: #fff; }
.ficha-mapa .res { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); font: 700 11px/14px "Barlow", sans-serif; font-style: normal; padding: 0 4px; border-radius: 3px; background: #fff; color: #111; border: 1.5px solid #111; }
.tac-puente span, .tac-minas span { display: block; text-align: center; font: 600 10px/12px "Barlow", sans-serif; color: #111; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.tac-puente svg { background: rgba(255,255,255,.7); border-radius: 2px; }
@media (max-width: 860px) { .marco:has(.acciones.func:not([hidden])) .zoom { bottom: 190px; } .marco:has(.acciones.func:not([hidden])) .aviso { bottom: 198px; } }

/* ---- Visita guiada de la demostración ---- */
.tuto { position: fixed; z-index: 1600; right: 14px; bottom: 14px; width: min(380px, calc(100vw - 20px)); padding: 12px 14px; border-radius: 10px; background: #10212e; border: 1px solid var(--oro2); border-left: 6px solid var(--oro); box-shadow: 0 16px 44px rgba(0,0,0,.7); }
.tuto[hidden] { display: none; }
.tuto small { color: var(--tenue); font-size: 12.5px; }
.tuto h3 { margin: 2px 0 4px; font-family: "Barlow Condensed", sans-serif; font-size: 20px; letter-spacing: .02em; color: var(--oro); }
.tuto p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.35; }
.tuto .fila { display: flex; gap: 6px; }
.tuto .fila .boton { flex: 1; }
.tuto .barra-t { height: 4px; border-radius: 2px; background: var(--linea); margin-bottom: 8px; overflow: hidden; }
.tuto .barra-t i { display: block; height: 100%; background: var(--oro); }
@media (max-width: 860px) { .tuto { right: 10px; left: 10px; width: auto; bottom: auto; top: 64px; } }
.acciones.func { overflow: hidden; }
.acciones.func > * { min-width: 0; max-width: 100%; }
.tuto { bottom: auto; top: 76px; }
body:has(.tuto:not([hidden])) .guia { display: none; }

/* ---- Efectos: humo, rayos de guerra electrónica, ataque aéreo ---- */
.fx.humo i { width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 0; background: radial-gradient(circle, rgba(236,239,241,.95), rgba(176,190,197,.7) 55%, transparent 72%); animation: humo 3.8s ease-out forwards; }
.fx.humo i:nth-child(2) { margin-left: -44px; animation-delay: .25s; } .fx.humo i:nth-child(3) { margin-left: -2px; animation-delay: .5s; } .fx.humo i:nth-child(4) { margin-top: -44px; animation-delay: .75s; } .fx.humo i:nth-child(5) { margin-top: -6px; margin-left: -30px; animation-delay: 1s; }
@keyframes humo { 0% { transform: scale(.2); opacity: 0; } 20% { opacity: .95; } 100% { transform: scale(2.6) translateY(-14px); opacity: 0; } }
.fx.ew svg { width: 110px; height: 110px; overflow: visible; }
.fx.ew path { fill: none; stroke: #7df9ff; stroke-width: 4; stroke-linejoin: bevel; filter: drop-shadow(0 0 5px #00e5ff) drop-shadow(0 0 2px #fff); opacity: 0; animation: rayo 1.8s steps(1) forwards; }
.fx.ew path:nth-child(2) { animation-delay: .18s; stroke: #e1f5fe; } .fx.ew path:nth-child(3) { animation-delay: .34s; }
@keyframes rayo { 0%, 12%, 30%, 46%, 70% { opacity: 1; } 6%, 22%, 38%, 58% { opacity: 0; } 100% { opacity: 0; } }
.eje-ew { animation: ejeEw 1.8s linear forwards; filter: drop-shadow(0 0 4px #00e5ff); }
@keyframes ejeEw { 0% { stroke-dashoffset: 120; opacity: 1; } 80% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.fx.aire i:first-child { width: 140px; height: 6px; margin: -3px 0 0 -70px; border: 0; border-radius: 3px; background: linear-gradient(90deg, transparent, #fff, transparent); animation: pasada .9s ease-in forwards; }
.fx.aire i:nth-child(2) { background: radial-gradient(circle, #fff3c4, #ff9800 55%, transparent 70%); border: 0; animation: destello 1.5s ease-out .9s forwards; }
.fx.aire i:nth-child(3) { animation-delay: 1.1s; }
@keyframes pasada { 0% { transform: translateX(-160px) rotate(-12deg); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(160px) rotate(-12deg); opacity: 0; } }
#rMensajes .m-estatica { text-align: center; padding: 22px 12px; border: 1px dashed var(--enemigo); border-radius: 4px; color: var(--hueso); line-height: 1.4;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 2px, transparent 2px 5px); animation: estatica .25s steps(2) infinite; }
#rMensajes .m-estatica b { display: block; font-family: "Saira Stencil One", sans-serif; font-weight: 400; font-size: 20px; color: var(--enemigo); margin-bottom: 4px; }
@keyframes estatica { 50% { background-position: 0 3px; } }
.acciones .pot button[aria-pressed="true"] { background: #7df9ff; border-color: #7df9ff; color: #06222b; }
@media (prefers-reduced-motion: reduce) { .fx i, .fx path, .eje-ew, #rMensajes .m-estatica { animation-duration: .01s; } }

/* ---- Propiedades de la unidad ---- */
.acciones .props { margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(14,31,45,.7); border: 1px solid var(--linea); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; font-size: 13.5px; }
.acciones .props > dt { grid-column: 1 / -1; font-family: "Barlow Condensed", sans-serif; font-size: 16px; color: var(--oro); }
.acciones .props div { min-width: 0; }
.acciones .props div dt { font-size: 11.5px; color: var(--tenue); }
.acciones .props dd { margin: 0; line-height: 1.25; }
.acciones .props-b { border-radius: 4px; padding: 6px 9px; }
.acciones .props-b[aria-pressed="true"] { background: var(--hueso); border-color: var(--hueso); color: #10212e; }
@media (max-width: 860px) { .acciones .props { grid-template-columns: minmax(0, 1fr); max-height: 40vh; overflow-y: auto; } }
.acciones .props .conmuta { display: flex; margin-top: 4px; width: max-content; }

/* ---- Situación táctica: botón para resolver el turno con DIREX automático ---- */
.chip-turno { position: absolute; z-index: 468; left: 12px; bottom: 34px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--oro); background: var(--oro); color: #1b1503;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 4px 0 #8a6a12, 0 10px 22px rgba(0,0,0,.5); }
.chip-turno:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a6a12; }
.chip-turno small { font-weight: 500; font-size: 12px; }
.chip-turno[hidden], .marco:has(.acciones:not([hidden])) .chip-turno { display: none; }

/* Unidades propias que no están a tus órdenes: oscurecidas. Solo se ven claras las que puedes mover. */
.ficha-mapa.ajena .sim { opacity: 1; filter: brightness(.42) saturate(.55); }
.ficha-mapa.ajena span { opacity: .6; }
.ficha-mapa.ajena .pila, .ficha-mapa.ajena .res { filter: brightness(.6); }
.tac-puente.real svg { background: #fff; border: 1px solid #111; border-radius: 3px; }
.campo select { width: 100%; background: var(--marino); color: var(--hueso); border: 1px solid var(--linea); border-radius: 4px; padding: 8px; font: inherit; font-size: 16px; }
.campo select:focus { outline: 2px solid var(--oro); outline-offset: 1px; }
@media (max-width: 860px) { .marco:has(.acciones .pot) .aviso { bottom: 400px; } .marco:has(.acciones .pot) .zoom { bottom: 400px; } }
.acciones .pot [data-bar="ok"]:not(:disabled) { background: var(--oro); border-color: var(--oro); color: #1b1503; font-weight: 700; }
@media (max-width: 860px) { .marco:has(.acciones.func:not([hidden]) .pot) .aviso { bottom: 410px; } .marco:has(.acciones.func:not([hidden]) .pot) .zoom { bottom: 410px; } }

/* ---- Vista de batalla en 3D (opcional) ---- */
#mapa3d { position: absolute; inset: 0; z-index: 420; background: #0a1721; }
#mapa3d[hidden] { display: none; }
#mapa3d.tiembla { animation: tiembla .42s linear; }
body.en-3d #mapa { visibility: hidden; }
body.en-3d .norte, body.en-3d .mira { display: none; }
.zoom .z3d { font-size: 16px; font-family: "Barlow Condensed", sans-serif; letter-spacing: .04em; }
.zoom .z3d[aria-pressed="true"] { background: var(--oro); color: #1b1503; border-color: var(--oro); }
.m3d-marca { position: absolute; }
.m3d-marca > div { position: relative; }
.m3d-marca.en-pie > div { filter: drop-shadow(0 6px 5px rgba(0,0,0,.45)); }
.m3d-marca .poste { position: absolute; width: 2px; background: linear-gradient(#2b2b2b, #111); border-radius: 1px; }
.m3d-marca .pie { position: absolute; width: 18px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.4); }
.maplibregl-ctrl-attrib { font-size: 10px; }
#mapa3d .maplibregl-ctrl-top-right { top: 6px; right: 6px; }

/* Ficha ampliada de la unidad seleccionada (datos OR5-014) */
.ficha-mapa.sel .sim { transform: scale(1.5); }
.acciones .ficha-amp { margin: 0; padding: 10px 12px 8px; border-radius: 8px; background: rgba(10,24,35,.94); border: 1px solid var(--oro2); box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 13.5px; text-align: left; max-height: 46vh; overflow-y: auto; animation: amplia .18s ease-out both; }
@keyframes amplia { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .acciones .ficha-amp { animation: none; } }
.ficha-amp header { display: flex; align-items: center; gap: 12px; }
.ficha-amp .sim-g svg, .ficha-amp .sim-g img { width: 74px; height: 79px; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.ficha-amp .titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ficha-amp .titulo b { font-family: "Barlow Condensed", sans-serif; font-size: 20px; line-height: 1.1; color: var(--oro); padding: 0; }
.ficha-amp .titulo small { color: var(--tenue); font-size: 12.5px; }
.ficha-amp .vrpc { text-align: right; }
.ficha-amp .vrpc b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 34px; line-height: 1; color: var(--hueso); padding: 0; }
.ficha-amp .vrpc small { color: var(--tenue); font-size: 11px; }
.ficha-amp .ef { position: relative; height: 9px; margin-top: 10px; border-radius: 5px; background: #23404f; overflow: hidden; }
.ficha-amp .ef i { position: absolute; inset: 0 auto 0 0; background: var(--verde); }
.ficha-amp .ef i.medio { background: var(--oro); }
.ficha-amp .ef i.mal { background: var(--enemigo); }
.ficha-amp .ef u { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--marino); }
.ficha-amp .ef-l { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; font-size: 12px; color: var(--tenue); }
.ficha-amp .ef-l b { color: var(--hueso); padding: 0; font-size: 13px; font-family: inherit; }
.ficha-amp .act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ficha-amp .act .conmuta { display: flex; }
.ficha-amp h4 { margin: 10px 0 4px; font: 600 14px/1.2 "Barlow Condensed", sans-serif; color: var(--oro); border-bottom: 1px solid var(--linea); padding-bottom: 2px; }
.ficha-amp dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.ficha-amp dl div dt { font-size: 11.5px; color: var(--tenue); }
.ficha-amp dd { margin: 0; line-height: 1.3; }
.ficha-amp .fuente { margin: 8px 0 0; font-size: 11px; color: var(--tenue); line-height: 1.3; }
@media (max-width: 860px) { .ficha-amp dl { grid-template-columns: minmax(0, 1fr); } .ficha-amp .sim-g svg, .ficha-amp .sim-g img { width: 58px; height: 62px; } .acciones .ficha-amp { max-height: 42vh; } }

/* Al tocar una unidad se resaltan sus acciones para que el jugador elija */
.acciones .tira.ofrece .carta { animation: ofrece .9s ease-out both; }
.acciones .tira.ofrece .carta:nth-child(2) { animation-delay: .05s; }
.acciones .tira.ofrece .carta:nth-child(3) { animation-delay: .1s; }
.acciones .tira.ofrece .carta:nth-child(4) { animation-delay: .15s; }
.acciones .tira.ofrece .carta:nth-child(n+5) { animation-delay: .2s; }
@keyframes ofrece { 0% { transform: translateY(10px); opacity: 0; } 45% { transform: none; opacity: 1; box-shadow: 0 0 0 2px var(--oro), 0 0 16px rgba(227,179,65,.6); } 100% { box-shadow: 0 3px 0 rgba(0,0,0,.35); } }
@media (prefers-reduced-motion: reduce) { .acciones .tira.ofrece .carta { animation: none; } }
.acciones button.props-b { font-weight: 700; }

/* Con una unidad seleccionada, los avisos van arriba y la guía se pliega: no tapan las fichas */
.marco:has(.acciones:not([hidden])) .aviso.aviso { top: 14px; bottom: auto; max-width: min(92%, 520px); font-size: 13.5px; padding: 6px 12px; }
.marco:has(.acciones:not([hidden])) .guia { display: none; }

/* Bordes del sistema (columna lateral del teléfono): la portada termina en el mismo color que el fondo de la página */
html:has(.portada:not([hidden])) { background: var(--marino); }

/* DIREX: crear unidades desde la casilla */
.crea-u { margin-top: 8px; border: 1px solid var(--linea); border-radius: 6px; padding: 6px 8px; }
.crea-u summary { cursor: pointer; font-weight: 600; color: var(--oro); }
.crea-u .fila { display: flex; gap: 6px; margin-top: 6px; }
.crea-u select, .crea-u input { flex: 1; min-width: 0; background: var(--acero2); border: 1px solid var(--linea); color: var(--hueso); border-radius: 4px; padding: 6px; }
.crea-u .nota { margin: 6px 0 0; font-size: 12px; color: var(--tenue); }

/* Panel de opciones */
.port-opc { position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 3; border: 1px solid var(--oro2); background: rgba(14,31,45,.85); color: var(--oro); border-radius: 4px; padding: 7px 12px; font-weight: 600; cursor: pointer; }
.port-opc:hover { background: rgba(227,179,65,.18); }
.opciones { position: fixed; inset: 0; z-index: 2600; display: grid; place-items: center; background: rgba(4,10,16,.62); padding: 16px; }
.opciones[hidden] { display: none; }
.opc-caja { width: min(420px, 100%); background: var(--acero); border: 1px solid var(--oro2); border-top: 4px solid var(--oro); border-radius: 8px; padding: 12px 16px 14px; box-shadow: 0 18px 40px rgba(0,0,0,.55); }
.opc-caja header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.opc-caja h2 { margin: 0; font: 600 22px/1 "Barlow Condensed", sans-serif; color: var(--oro); }
.opc-caja .cierra { border: 0; background: none; color: var(--tenue); font-size: 24px; cursor: pointer; padding: 2px 8px; }
.opc-caja .interruptor { margin-top: 10px; }
.opc-caja .nota { margin: 4px 0 0; font-size: 12.5px; color: var(--tenue); }
.port-escudo, .emblema { object-fit: contain; }

/* Pantallas plegables y giro: la aplicación ocupa siempre la ventana visible y respeta las zonas del sistema */
.app { position: fixed; inset: 0; height: auto; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); box-sizing: border-box;
  grid-template-columns: clamp(270px, 30vw, 360px) minmax(0, 1fr); }
@media (max-width: 860px) { .app { grid-template-columns: minmax(0, 1fr); } }
.barra { min-width: 0; }
.marca { min-width: 0; } .marca b, .marca span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.puesto { max-width: 34vw; overflow: hidden; }
.puesto span { white-space: nowrap; }
.panel .boton.ancho, .panel .boton { white-space: normal; line-height: 1.2; text-wrap: balance; }
.panel select { max-width: 100%; text-overflow: ellipsis; }
.panel .seg button { white-space: normal; line-height: 1.15; }
/* En Mando el panel se desplaza entero: la red de mando no se encoge hasta solaparse con los botones */
#tabMando .grupo, #tabMando .grupo.llena { flex-shrink: 0; }
#tabMando .grupo.llena { min-height: auto; }
#tabMando .grupo.llena .red { max-height: 46dvh; }

/* RPAS: radio de acción, orden de ida y vuelta y vuelo animado */
.rotulo-vuelo { text-align: center; pointer-events: none; }
.rotulo-vuelo b, .rotulo-vuelo small { display: block; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff; color: #0d47a1; }
.rotulo-vuelo b { font: 700 14px/1.1 "Barlow Condensed", sans-serif; }
.rotulo-vuelo small { font: 600 11.5px/1.2 "Barlow", sans-serif; }
.rotulo-vuelo.corto b { font-size: 13px; }
.dron svg { width: 46px; height: 46px; fill: #0d47a1; stroke: #fff; stroke-width: 1.6; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); transition: transform .1s linear; }

/* Barra de lecturas: las cifras nunca se montan; se quitan las secundarias si no caben */
.lectura { container-type: inline-size; min-width: 0; overflow: hidden; }
.dato { flex: 0 1 auto; overflow: hidden; }
.dato b { overflow: hidden; text-overflow: ellipsis; font-size: clamp(15px, 1.6vw, 20px); }
.dato.principal b { font-size: clamp(17px, 2vw, 24px); }
@container (max-width: 1150px) { .lectura .dato:nth-child(5) { display: none; } }
@container (max-width: 920px) { .lectura .dato:nth-child(4) { display: none; } }
@container (max-width: 640px) { .lectura .dato:nth-child(3) { display: none; } }
.panel .fila > .boton { min-width: 0; padding-left: 6px; padding-right: 6px; font-size: clamp(12.5px, 1.25vw, 15px); }

/* Escucha electrónica: contactos localizados solo por ESM y ondas */
.ficha-mapa.contacto.esm { filter: drop-shadow(0 0 6px rgba(125,249,255,.9)); }
.ficha-mapa.contacto.esm::after { content: ""; position: absolute; left: 50%; top: 22px; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 2px solid rgba(125,249,255,.85); pointer-events: none; animation: esm-lat 2.4s ease-out infinite; }
.ficha-mapa.contacto.esm span { color: #0d47a1; font-weight: 700; }
.ficha-mapa.contacto.esm.ping::after { animation: esm-lat .7s ease-out 3; }
@keyframes esm-lat { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ficha-mapa.contacto.esm::after { animation: none; } }
.onda-esm { filter: drop-shadow(0 0 4px rgba(125,249,255,.9)); }

/* Estado de la unidad a simple vista: barra de efectivos y umbrales del 70 % y del 50 % */
.ficha-mapa .efb { display: block; position: relative; width: 38px; height: 6px; margin: -2px auto 3px; border-radius: 3px; background: rgba(16,33,46,.75); box-shadow: 0 0 0 1px #fff; overflow: hidden; }
.ficha-mapa .efb i { position: absolute; inset: 0 auto 0 0; }
.ficha-mapa .efb.v i { background: #2e9d4a; }
.ficha-mapa .efb.a i { background: #f0a020; }
.ficha-mapa .efb.r i { background: #d32f2f; }
.ficha-mapa .umb { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 17px; padding: 0 3px; border-radius: 9px; background: #f0a020; color: #10212e; border: 1.5px solid #fff; font: 700 10.5px/14px "Barlow", sans-serif; font-style: normal; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.ficha-mapa.desg .sim { filter: drop-shadow(0 0 4px rgba(240,160,32,.95)) drop-shadow(0 2px 2px rgba(0,0,0,.55)); }
.ficha-mapa .tacha { position: absolute; left: 50%; top: 24px; width: 58px; height: 5px; margin: -2px 0 0 -29px; background: #d32f2f; border: 1px solid #fff; border-radius: 3px; transform: rotate(-35deg); box-shadow: 0 1px 3px rgba(0,0,0,.5); pointer-events: none; }
.ficha-mapa.neutral span { color: #b71c1c; }
.fila-ficha.desg .sim { filter: drop-shadow(0 0 3px rgba(240,160,32,.95)); }

/* Escena de confrontación de un ataque */
.duelo { position: fixed; inset: 0; z-index: 2800; display: grid; place-items: center; overflow: hidden; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.duelo[hidden] { display: none; }
.duelo .d-velo { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(10,24,35,.86), rgba(3,8,12,.95)); opacity: 0; transition: opacity .3s; }
.duelo.abre .d-velo { opacity: 1; }
.duelo .d-banda { position: absolute; top: 50%; height: 34vh; width: 120vw; margin-top: -17vh; opacity: .92; }
.duelo .d-banda.azul { background: linear-gradient(90deg, transparent, #1e5fa8 30%, #2f7fd6); }
.duelo .d-banda.rojo { background: linear-gradient(270deg, transparent, #b3261e 30%, #d9443a); }
.duelo .d-banda.az { left: -120vw; clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); }
.duelo .d-banda.ro { right: -120vw; clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%); }
.duelo.abre .d-banda.az { animation: banda-i 1.25s cubic-bezier(.2,.9,.25,1) forwards; }
.duelo.abre .d-banda.ro { animation: banda-d 1.25s cubic-bezier(.2,.9,.25,1) forwards; }
@keyframes banda-i { 0% { left: -120vw; } 35% { left: -66vw; } 55% { left: -64vw; } 100% { left: -64vw; opacity: 0; } }
@keyframes banda-d { 0% { right: -120vw; } 35% { right: -66vw; } 55% { right: -64vw; } 100% { right: -64vw; opacity: 0; } }
.duelo .d-sello { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(3); opacity: 0; font: 400 clamp(46px, 11vw, 120px)/1 "Stencil CM", "Barlow Condensed", sans-serif; color: #f4ecd8; letter-spacing: .04em; text-shadow: 0 4px 0 #000, 0 0 30px rgba(227,179,65,.6); pointer-events: none; }
.duelo.abre .d-sello { animation: sello 1.3s ease-out forwards; animation-delay: .3s; }
@keyframes sello { 0% { opacity: 0; transform: translate(-50%, -50%) scale(3) rotate(-6deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1.04) rotate(-4deg); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.9) rotate(-4deg); } }
.duelo .d-caja { position: relative; width: min(980px, 100%); max-height: 100%; overflow-y: auto; background: linear-gradient(180deg, #13293a, #0d1d29); border: 1px solid var(--oro2); border-top: 4px solid var(--oro); border-radius: 10px; padding: 12px 16px 14px; box-shadow: 0 30px 60px rgba(0,0,0,.6); opacity: 0; transform: translateY(18px) scale(.97); }
.duelo.tabla .d-caja { opacity: 1; transform: none; transition: opacity .35s, transform .35s cubic-bezier(.2,.9,.25,1); }
.duelo .d-caja header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.duelo .d-caja h2 { margin: 0; font: 600 20px/1.1 "Barlow Condensed", sans-serif; color: var(--oro); }
.duelo .d-caja header span { color: var(--tenue); font-size: 13px; }
.duelo .d-campo { display: grid; grid-template-columns: 1fr minmax(120px, 170px) 1fr; gap: 12px; margin-top: 10px; align-items: start; }
.duelo .d-lado { border-radius: 8px; padding: 8px; background: rgba(255,255,255,.03); border-top: 4px solid; }
.duelo .d-lado.azul { border-color: #2f7fd6; } .duelo .d-lado.rojo { border-color: #d9443a; }
.duelo .d-lado h3 { margin: 0 0 6px; font: 600 15px/1 "Barlow Condensed", sans-serif; color: var(--hueso); letter-spacing: .02em; }
.duelo .d-lado ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.duelo .ud { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: center; }
.duelo .ud .sm svg, .duelo .ud .sm .sim { width: 56px; height: 60px; display: block; }
.duelo .ud .dt { min-width: 0; display: flex; flex-direction: column; }
.duelo .ud .dt b { font: 600 15px/1.1 "Barlow Condensed", sans-serif; color: var(--hueso); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duelo .ud .dt small { color: var(--tenue); font-size: 12px; }
.duelo .ud .br { position: relative; height: 12px; margin-top: 4px; border-radius: 6px; background: #23404f; overflow: hidden; }
.duelo .ud .br i { position: absolute; inset: 0 auto 0 0; background: #2e9d4a; }
.duelo .ud.ama .br i { background: #f0a020; } .duelo .ud.roj .br i { background: #d32f2f; }
.duelo .ud .br u { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.7); }
.duelo .ud .pc { font: 700 18px/1.2 "Barlow Condensed", sans-serif; color: var(--hueso); }
.duelo .ud .ds { min-height: 1.2em; font-size: 12.5px; color: var(--oro); opacity: 0; transition: opacity .4s; }
.duelo.fin .ud .ds { opacity: 1; }
.duelo.golpe .ud { animation: sacude .35s; }
@keyframes sacude { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.duelo .pot { margin: 6px 0 0; font-size: 12.5px; color: var(--tenue); }
.duelo .d-centro { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 8px; }
.duelo .prop { font: 700 34px/1 "Barlow Condensed", sans-serif; color: var(--oro); }
.duelo .d-centro small { color: var(--tenue); font-size: 12px; }
.duelo .d-centro .desvio { color: var(--oro); margin-top: 4px; }
.duelo .dados { display: flex; gap: 8px; margin-top: 8px; }
.duelo .dados i { width: 38px; height: 38px; border-radius: 8px; background: #f4ecd8; color: #10212e; font: 700 22px/38px "Barlow", sans-serif; font-style: normal; box-shadow: 0 3px 0 #8a7d5c; }
.duelo.tabla:not(.dadoOk) .dados i { animation: dado .14s linear infinite; }
@keyframes dado { 50% { transform: rotate(12deg) translateY(-3px); } }
.duelo .d-mult { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.duelo .d-mult span { font-size: 12px; padding: 3px 8px; border-radius: 12px; border: 1px solid var(--linea); color: var(--hueso); }
.duelo .d-res { margin-top: 10px; text-align: center; opacity: 0; transform: scale(1.6); }
.duelo.fin .d-res { opacity: 1; transform: none; transition: opacity .3s, transform .45s cubic-bezier(.2,1.4,.4,1); }
.duelo .d-res b { display: inline-block; padding: 4px 18px; border: 3px solid var(--oro); border-radius: 6px; font: 700 clamp(22px, 4vw, 30px)/1.1 "Barlow Condensed", sans-serif; letter-spacing: .06em; color: var(--oro); transform: rotate(-2deg); }
.duelo .d-res.bien b { border-color: #3fbf62; color: #3fbf62; } .duelo .d-res.mal b { border-color: #ef5350; color: #ef5350; }
.duelo footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.duelo footer .primario { background: var(--oro); color: #10212e; border-color: var(--oro); }
.duelo.sale { opacity: 0; transition: opacity .3s; }
@media (max-width: 720px) {
  .duelo .d-campo { grid-template-columns: 1fr; }
  .duelo .d-centro { order: -1; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px 10px; padding: 0; }
  .duelo .prop { font-size: 28px; }
  .duelo .dados { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .duelo *, .duelo { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Confirmación sobre el hexágono: «¿Mover aquí?» */
.confirma .cf { background: #10212e; border: 2px solid var(--oro); border-radius: 8px; padding: 6px 8px 8px; text-align: center; box-shadow: 0 8px 20px rgba(0,0,0,.5); position: relative; animation: conf .16s ease-out; }
.confirma .cf::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: var(--oro); }
.confirma b { display: block; font: 600 17px/1.2 "Barlow Condensed", sans-serif; color: var(--hueso); white-space: nowrap; }
.confirma span { display: flex; gap: 6px; margin-top: 6px; justify-content: center; }
.confirma button { flex: 1; min-height: 34px; border-radius: 5px; font: 700 15px/1 "Barlow", sans-serif; cursor: pointer; border: 1px solid var(--oro2); }
.confirma .si { background: var(--oro); color: #10212e; }
.confirma .no { background: transparent; color: var(--hueso); }
@keyframes conf { from { transform: translateY(6px) scale(.92); opacity: 0; } }
.duelo .d-banda, .duelo .d-sello { pointer-events: none; }
body:has(.tuto:not([hidden])) .duelo { z-index: 1500; }

/* Confrontación animada: entrada, dados lentos, trazadoras, impactos y desenlace */
.duelo .d-caja { position: relative; }
.duelo .d-lado:first-child .ud { opacity: 0; transform: translateX(-70px); }
.duelo .d-lado:last-child .ud { opacity: 0; transform: translateX(70px); }
.duelo.entra .d-lado .ud { opacity: 1; transform: none; transition: transform .45s cubic-bezier(.2,1.3,.4,1), opacity .3s; }
.duelo.entra .d-lado .ud:nth-child(2) { transition-delay: .1s; } .duelo.entra .d-lado .ud:nth-child(3) { transition-delay: .2s; }
.duelo.entra .d-centro .prop { animation: destello .6s ease-out .35s both; }
@keyframes destello { 0% { text-shadow: 0 0 0 transparent; transform: scale(.6); } 50% { text-shadow: 0 0 24px #ffe08a; transform: scale(1.15); } 100% { transform: none; } }
.duelo.tabla:not(.dadoOk) .dados i.cae { animation: none; }
.duelo .dados i.cae { animation: cae .3s cubic-bezier(.2,1.6,.4,1) both !important; }
@keyframes cae { from { transform: translateY(-14px) scale(1.25); } }
.duelo.tension .dados i:last-child { box-shadow: 0 3px 0 #8a7d5c, 0 0 18px rgba(255,224,138,.9); }
.duelo .traz { position: absolute; height: 3px; transform-origin: 0 50%; border-radius: 2px; pointer-events: none; z-index: 3; background: linear-gradient(90deg, transparent, var(--c) 60%, #fff); opacity: 0; animation: traz .35s ease-out both; }
@keyframes traz { 0% { opacity: 1; clip-path: inset(0 100% 0 0); } 60% { opacity: 1; clip-path: inset(0 0 0 30%); } 100% { opacity: 0; clip-path: inset(0 0 0 95%); } }
.duelo .fogon { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none; z-index: 4; background: radial-gradient(circle, #fff 0, #ffd36b 30%, rgba(255,120,40,.7) 55%, transparent 70%); opacity: 0; animation: fogon .45s ease-out both; }
@keyframes fogon { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.6); } }
.duelo .ud { position: relative; }
.duelo.golpe .ud.impacto { animation: sacude .45s; }
.duelo .ud.impacto .sm { animation: rojo-golpe .6s; }
@keyframes rojo-golpe { 30% { filter: brightness(2.2) drop-shadow(0 0 10px #ff6a3d); } }
.duelo .perdida { position: absolute; right: 4px; top: 0; font: 700 22px/1 "Barlow Condensed", sans-serif; color: #ff6b5e; text-shadow: 0 2px 0 #000; pointer-events: none; animation: perdida 1.6s ease-out forwards; }
@keyframes perdida { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 20% { opacity: 1; transform: translateY(-4px) scale(1.15); } 100% { opacity: 0; transform: translateY(-34px); } }
.duelo.entra .d-lado .ud.repliega { transform: translateX(46px); opacity: .55; transition: transform .8s ease-in, opacity .8s; }
.duelo .ud.tachada .sm { position: relative; filter: grayscale(.8); }
.duelo .ud.tachada .sm::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 6px; margin-top: -3px; background: #d32f2f; border: 1px solid #fff; border-radius: 3px; transform: rotate(-30deg) scaleX(0); transform-origin: 0 50%; animation: tacha .35s ease-out forwards; }
@keyframes tacha { to { transform: rotate(-30deg) scaleX(1); } }
.campo .ayuda { display: block; margin-top: 4px; font-size: 12px; color: var(--tenue); line-height: 1.3; }

/* ===== PC con monitor y ratón ===== */
.ficha-mapa .tip { display: none; }
.atajos { display: none; }
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  .app { grid-template-columns: clamp(320px, 21vw, 400px) minmax(0, 1fr); --panel-w: clamp(320px, 21vw, 400px); }
  body { font-size: 16px; }
  /* Barra de acciones: ancha, sin desplazamiento, con el número de su atajo */
  .acciones.func, .acciones { left: 0; right: 0; margin-inline: auto; transform: none; }
  .acciones.func { width: min(1040px, calc(100% - 180px)); overflow: visible; bottom: 22px; padding: 10px 12px; }
  .acciones .tira { flex-wrap: wrap; overflow: visible; justify-content: center; gap: 8px; counter-reset: tecla; }
  .acciones .carta { position: relative; min-width: 124px; max-width: 190px; min-height: 64px; padding: 8px 12px 8px 14px; font-size: 15.5px; transition: transform .1s, border-color .1s, background .1s; }
  .acciones .carta small { font-size: 11.5px; }
  .acciones .carta:not(:disabled) { counter-increment: tecla; }
  .acciones .carta:not(:disabled)::after { content: counter(tecla); position: absolute; top: 4px; right: 5px; min-width: 17px; height: 17px; border-radius: 4px; border: 1px solid currentColor; opacity: .6; font: 600 11px/15px "Barlow", sans-serif; text-align: center; }
  .acciones .carta:not(:disabled):nth-of-type(10)::after { content: "0"; }
  .acciones .carta:not(:disabled):nth-of-type(n+11)::after { display: none; }
  .acciones .carta:not(:disabled):hover { transform: translateY(-3px); border-color: var(--oro); }
  .acciones b { font-size: 19px; }
  .acciones button { font-size: 14.5px; padding: 7px 12px; }
  /* La ficha de la unidad se acopla a la izquierda del plano y deja libre el centro */
  .acciones .ficha-amp { position: fixed; left: calc(var(--panel-w, 340px) + 16px); top: 132px; bottom: auto; width: 400px; max-height: calc(100vh - 170px); z-index: 480; font-size: 14px; }
  .acciones .ficha-amp dl { grid-template-columns: minmax(0, 1fr); }
  .acciones .ficha-amp .sim-g svg { width: 84px; height: 90px; }
  /* Ficha emergente al pasar el ratón */
  .ficha-mapa:hover { z-index: 9000 !important; }
  .ficha-mapa:hover .tip { display: block; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 260px; padding: 7px 10px; border-radius: 6px; background: #10212e; border: 1px solid var(--oro2); color: var(--hueso); font: 400 13px/1.35 "Barlow", sans-serif; font-style: normal; text-align: left; white-space: normal; box-shadow: 0 8px 20px rgba(0,0,0,.5); pointer-events: none; animation: conf .12s ease-out; }
  .ficha-mapa .tip b { display: block; font: 600 15px/1.2 "Barlow Condensed", sans-serif; color: var(--oro); }
  .ficha-mapa.sel:hover .tip { display: none; }
  /* Plano y controles */
  .zoom button { width: 44px; height: 44px; }
  .aviso { font-size: 15.5px; max-width: min(70%, 640px); }
  .confirma button { min-height: 32px; }
  .confirma .si::after { content: " ⏎"; opacity: .6; font-weight: 400; }
  .duelo .d-caja { width: min(1120px, 100%); padding: 18px 24px 20px; }
  .duelo .ud { grid-template-columns: 74px 1fr; } .duelo .ud .sm svg { width: 72px; height: 77px; }
  .duelo .ud .dt b { font-size: 18px; } .duelo .prop { font-size: 46px; } .duelo .dados i { width: 48px; height: 48px; font-size: 27px; line-height: 48px; }
  /* Atajos en Opciones */
  .atajos { display: block; }
  .opc-pes { grid-template-columns: repeat(3, 1fr) !important; } .opc-pes [data-opc="atajos"] { display: block !important; }
  .atajos h3 { margin: 0 0 6px; font: 600 16px/1 "Barlow Condensed", sans-serif; color: var(--oro); }
  .atajos dl { margin: 0; display: grid; gap: 5px; font-size: 13.5px; }
  .atajos dl div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: baseline; }
  .atajos dd { margin: 0; color: var(--hueso); } .atajos dt { color: var(--tenue); }
  kbd { display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--linea); border-bottom-width: 2px; border-radius: 4px; background: var(--acero2); color: var(--hueso); font: 600 12px/1.4 "Barlow", sans-serif; text-align: center; }
  .opc-caja { width: min(520px, 100%); }
}

/* ===== Acciones como fichas de plástico ===== */
.acciones .tira { align-items: flex-end; gap: 9px; padding: 22px 4px 10px; }
.acciones .carta { --c: #6f7d4a; --o: #2f3719; position: relative; flex: none; width: 92px; min-width: 0; max-width: none; min-height: 0; height: 84px; padding: 6px 5px 7px; border: 0; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; text-align: center;
  background: var(--c); color: var(--o);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.32), inset 0 -4px 0 rgba(0,0,0,.22), 0 6px 0 var(--o), 0 9px 12px rgba(0,0,0,.45);
  transition: transform .1s, box-shadow .1s; }
.acciones .carta .ico svg { width: 26px; height: 26px; fill: none; stroke: var(--o); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 0 rgba(255,255,255,.45)); }
.acciones .carta small { font-size: 9.5px; letter-spacing: .03em; color: var(--o); opacity: .85; text-transform: none; }
.acciones .carta .nom { font: 600 13px/1.1 "Barlow Condensed", sans-serif; color: var(--o); text-shadow: 0 1px 0 rgba(255,255,255,.3); }
.acciones .carta:hover { transform: translateY(-3px); }
.acciones .carta:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.32), inset 0 -2px 0 rgba(0,0,0,.22), 0 2px 0 var(--o), 0 3px 4px rgba(0,0,0,.45); }
.acciones .carta[aria-pressed="true"] { transform: translateY(4px); background: var(--c); color: var(--o); box-shadow: inset 0 3px 6px rgba(0,0,0,.35), 0 2px 0 var(--o), 0 0 0 3px #f4ecd8; }
.acciones .carta[aria-pressed="true"] small { color: var(--o); }
.acciones .carta.f-maniobra { --c: #6f7d4a; --o: #2f3719; }
.acciones .carta.f-fuegos { --c: #a8574a; --o: #4a1f17; }
.acciones .carta.f-inteligencia { --c: #557690; --o: #1b3042; }
.acciones .carta.f-proteccion { --c: #7f7c73; --o: #34332e; }
.acciones .carta.f-mando { --c: #8c7a52; --o: #3a2f16; }
.acciones .carta.f-logistico { --c: #8a6a4a; --o: #38281a; }
.acciones .carta.f-informacion { --c: #6f5d86; --o: #2c2238; }
.acciones .carta.rec { --c: #c9a961; --o: #4a3510; width: 108px; height: 98px; border-radius: 18px; outline: 3px solid #e3b341; outline-offset: 3px; }
.acciones .carta.rec .ico svg { width: 32px; height: 32px; }
.acciones .carta.rec .nom { font-size: 15px; }
.acciones .rec-l { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: #e3b341; color: #412402; font: 700 10.5px/1 "Barlow", sans-serif; padding: 3px 8px; border-radius: 9px; white-space: nowrap; }
.acciones .tira.ofrece .carta { animation: sube .32s cubic-bezier(.2,1.4,.4,1) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes sube { from { transform: translateY(26px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .acciones .tira.ofrece .carta { animation: none; } }
.acciones .carta:not(:disabled)::after { top: 4px; right: 6px; border: 0; background: rgba(0,0,0,.2); color: #f4ecd8; border-radius: 50%; opacity: 1; }
/* Tabla de estimación bajo las fichas */
.acciones .estima { margin: 2px 0 0; padding: 8px 12px; border-radius: 6px; background: rgba(10,24,35,.85); border: 1px solid var(--linea); border-left: 4px solid #e3b341; text-align: left; font-size: 13.5px; }
.acciones .estima.ok { border-left-color: #3fbf62; } .acciones .estima.mal { border-left-color: #ef5350; }
.acciones .estima .porque { margin: 0; color: var(--hueso); line-height: 1.35; }
.acciones .estima .porque b { color: var(--oro); padding: 0; font: 600 14.5px/1 "Barlow Condensed", sans-serif; }
.acciones .estima dl { margin: 6px 0 0; display: grid; grid-template-columns: auto auto 1fr; gap: 4px 18px; }
.acciones .estima dt { font-size: 11.5px; color: var(--tenue); }
.acciones .estima dd { margin: 0; color: var(--hueso); }
.acciones .estima dd.gr { font: 700 22px/1.1 "Barlow Condensed", sans-serif; color: var(--oro); }
.acciones .estima.ok dl div:first-child dd { color: #3fbf62; } .acciones .estima.mal dl div:first-child dd { color: #ef5350; }
.acciones .estima .nota { margin: 4px 0 0; font-size: 11.5px; color: var(--tenue); }
@media (max-width: 720px) {
  .acciones .carta { width: 76px; height: 74px; } .acciones .carta.rec { width: 90px; height: 86px; }
  .acciones .carta .ico svg { width: 22px; height: 22px; } .acciones .tira { padding-top: 24px; }
  .acciones .estima dl { grid-template-columns: 1fr 1fr; } .acciones .estima dl div:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  .acciones .carta { width: 108px; height: 92px; max-width: none; min-width: 0; padding: 7px 6px; }
  .acciones .carta.rec { width: 124px; height: 106px; }
  .acciones .carta .nom { font-size: 14.5px; } .acciones .carta.rec .nom { font-size: 16.5px; }
}

/* Partida sin DIREX: configuración, sala y «todo listo» */
.puestos { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.puestos select { width: 100%; }
.sala-bando { margin-top: 10px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--linea); border-left: 4px solid var(--propio); }
.sala-bando.b-rojo { border-left-color: var(--enemigo); }
.sala-bando h3 { margin: 0 0 2px; font: 600 16px/1.2 "Barlow Condensed", sans-serif; color: var(--oro); text-transform: capitalize; }
.sala-bando .claves { margin-top: 6px; }
.clave-tarjeta { padding: 8px 10px; border: 1px solid var(--linea); border-radius: 6px; background: rgba(255,255,255,.03); display: flex; flex-direction: column; gap: 4px; }
.clave-tarjeta.lista { border-color: #3fbf62; }
.clave-tarjeta b { color: var(--hueso); }
.clave-tarjeta code { font-size: 18px; color: var(--oro); letter-spacing: .06em; }
.clave-tarjeta small { color: var(--tenue); }
.clave-tarjeta .boton { margin-top: 4px; }
.chip-turno.listo[aria-pressed="true"] { background: #2e9d4a; border-color: #2e9d4a; color: #fff; }
/* La radio avisa hasta que se lee */
#pestanas button.alerta { animation: radio-alerta 1.1s ease-in-out infinite; }
@keyframes radio-alerta { 0%, 100% { box-shadow: 0 0 0 0 rgba(227,179,65,0); color: inherit; } 50% { box-shadow: 0 0 0 3px rgba(227,179,65,.55); color: var(--oro); } }
#pestanas button.alerta .globo { background: var(--enemigo); }
.campo .fila > select:first-child { width: auto; flex: none; min-width: 78px; }
.campo .fila > .puestos { flex: 1; min-width: 0; }
.campo .fila > .puestos select { width: 100%; min-width: 0; }
.campo .fila > .puestos:empty { display: none; }

/* Reglas en un minuto */
.reglas { margin-top: 8px; border: 1px solid var(--linea); border-radius: 6px; padding: 6px 10px; }
.reglas summary { cursor: pointer; font-weight: 600; color: var(--oro); }
.reglas ol { margin: 6px 0 2px; padding-left: 18px; font-size: 13px; line-height: 1.4; color: var(--hueso); }
.reglas li { margin-bottom: 5px; } .reglas li b { color: var(--oro); padding: 0; font-family: inherit; font-size: inherit; }

/* Demostración */
.demo-cartas { display: grid; gap: 8px; margin-top: 6px; }
.demo-carta { text-align: left; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--oro2); border-left: 5px solid var(--oro); background: rgba(255,255,255,.04); color: var(--hueso); cursor: pointer; }
.demo-carta:hover { background: rgba(227,179,65,.12); }
.demo-carta b { display: block; font: 600 19px/1.1 "Barlow Condensed", sans-serif; color: var(--oro); margin-bottom: 4px; }
.demo-carta span { font-size: 13.5px; color: var(--tenue); line-height: 1.35; }
.novedades { margin-top: 12px; border: 1px solid var(--linea); border-radius: 6px; padding: 6px 10px; text-align: left; }
.novedades summary { cursor: pointer; color: var(--oro); font-weight: 600; }
.novedades ul { margin: 6px 0 2px; padding-left: 18px; font-size: 13px; line-height: 1.4; color: var(--hueso); }
.novedades li { margin-bottom: 4px; }

/* Elección de brigada: ficha de «elige tu jugador» */
.bri-cab { display: flex; gap: 14px; align-items: center; }
.bri-escudo { position: relative; flex: none; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 50% 35%, #2a5670, #10212e 75%); border: 1px solid var(--oro2); box-shadow: inset 0 0 0 4px rgba(227,179,65,.15), 0 8px 20px rgba(0,0,0,.45); }
.bri-escudo svg { width: 70px; height: 74px; }
.bri-escudo em { position: absolute; right: -8px; bottom: -8px; font: 400 26px/1 "Stencil CM", "Barlow Condensed", sans-serif; color: var(--oro); background: #10212e; border: 1px solid var(--oro2); border-radius: 6px; padding: 3px 7px; }
.bri-cab > div { min-width: 0; }
.bri-cab b { display: block; font: 600 24px/1.1 "Barlow Condensed", sans-serif; color: var(--oro); }
.bri-cab > div > span { color: var(--tenue); font-size: 13px; }
.bri-cab p { margin: 4px 0 0; color: var(--hueso); font-size: 14px; }
.bri-cuerpo { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.bri-medidas { display: grid; gap: 7px; align-content: start; }
.bri-medidas .med dt { font-size: 12px; color: var(--tenue); }
.bri-medidas .med dd { margin: 2px 0 0; position: relative; height: 18px; border-radius: 4px; background: #0e1f2d; border: 1px solid var(--linea); overflow: hidden; }
.bri-medidas .med dd i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3d6d8a, #62b6f0); transition: width .5s cubic-bezier(.2,.9,.25,1); }
.bri-medidas .med dd i.alto { background: linear-gradient(90deg, #8a6a1a, var(--oro)); }
.bri-medidas .med dd i.bajo { background: linear-gradient(90deg, #6d3a35, #c8102e); }
.bri-medidas .med dd b { position: absolute; right: 6px; top: 0; line-height: 18px; font: 700 13px/18px "Barlow Condensed", sans-serif; color: var(--hueso); text-shadow: 0 1px 2px #000; }
.bri-juicio { display: grid; gap: 8px; align-content: start; }
.bri-juicio > div { padding: 7px 10px; border-radius: 6px; border-left: 4px solid; background: rgba(255,255,255,.03); }
.bri-juicio .fuerte { border-color: #3fbf62; } .bri-juicio .debil { border-color: #ef5350; } .bri-juicio .empleo { border-color: var(--oro); }
.bri-juicio h4 { margin: 0 0 2px; font: 600 13px/1 "Barlow Condensed", sans-serif; letter-spacing: .03em; color: var(--tenue); }
.bri-juicio p { margin: 0; font-size: 13.5px; line-height: 1.35; color: var(--hueso); }
.bri-detalle.cambia .bri-medidas .med dd i { animation: crece .6s cubic-bezier(.2,.9,.25,1) both; }
@keyframes crece { from { width: 0 !important; } }
.bri-uds { margin-top: 10px; }
@media (max-width: 860px) { .bri-cuerpo { grid-template-columns: minmax(0, 1fr); } .bri-escudo { width: 72px; height: 72px; } .bri-escudo svg { width: 52px; height: 56px; } }

/* Escudos reales, lema y reseña en la elección de brigada */
.bri-carta img { display: block; width: 46px; height: 58px; object-fit: contain; margin: 0 auto 2px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.bri-carta img + em { font-size: 15px; margin-top: 0; }
.bri-escudo.real { width: 118px; height: 132px; background: radial-gradient(circle at 50% 40%, #27506a, #10212e 78%); }
.bri-escudo.real img { width: 104px; height: 118px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.55)); }
.bri-cab .lema { display: block; margin: 4px 0 2px; font: italic 600 15px/1.2 "Barlow Condensed", sans-serif; color: var(--oro); letter-spacing: .02em; quotes: "«" "»"; }
.bri-resena { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--linea); font-size: 13px; line-height: 1.45; color: var(--hueso); }
.bri-fuente { margin-top: 8px; font-size: 11px; }
@media (max-width: 860px) { .bri-carta img { width: 34px; height: 42px; } .bri-escudo.real { width: 84px; height: 94px; } .bri-escudo.real img { width: 74px; height: 84px; } }
/* Brigada secreta (AGM): ficha dorada */
.bri-carta.secreta { border-color: var(--oro); box-shadow: 0 0 0 1px rgba(214,174,84,.35), 0 0 18px rgba(214,174,84,.25); background: linear-gradient(180deg, rgba(214,174,84,.14), rgba(214,174,84,.03)); }
.bri-carta.secreta em { color: var(--oro); font-size: 12px; letter-spacing: .08em; }
img[data-escudo] { cursor: pointer; }
/* Nombres completos en las fichas de brigada: dos líneas y columnas que se adaptan al ancho */
.bri-cartas { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); align-items: stretch; }
.bri-carta { display: flex; flex-direction: column; justify-content: flex-start; }
.bri-carta b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.1; min-height: 2.2em; font-size: 14.5px; hyphens: manual; overflow-wrap: anywhere; }
.bri-carta span { margin-top: auto; padding-top: 2px; }
@media (max-width: 860px) { .bri-cartas { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); } .bri-carta b { font-size: 13px; } }
@media (max-width: 400px) { .bri-cartas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .bri-carta { padding: 8px 3px 7px; } .bri-carta b { font-size: 12.5px; } }

.bri-der { display: grid; gap: 12px; min-width: 0; }
.bri-pie { display: grid; gap: 8px; }
.bri-pie .bri-fuente { order: 2; margin: 0; }

/* ---- Elige tu brigada en PC: lista a la izquierda, ficha completa a la derecha, todo a la vista sin desplazamiento ---- */
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  .portada.ancha .port-caja { width: min(1440px, 100% - 48px); padding-top: 14px; overflow: clip; }
  .portada.ancha .port-escudo { height: 44px; }
  .portada.ancha h1 { font-size: 22px; margin-top: 4px; }
  #pBrigada { grid-template-columns: 252px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px 18px; align-items: start; flex: 1; min-height: 0; margin-top: 8px; }
  #pBrigada .bri-titulo { grid-column: 1; grid-row: 1; text-align: left; font-size: 17px; margin: 0 0 2px 2px; }
  #pBrigada .bri-cartas { grid-column: 1; grid-row: 2; align-self: stretch; display: flex; flex-direction: column; gap: 5px; min-height: 0; overflow-y: auto; padding: 2px; }
  #pBrigada .bri-carta { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 6px 10px 6px 8px; border-bottom-width: 1px; box-shadow: none; flex: none; }
  #pBrigada .bri-carta:hover, #pBrigada .bri-carta[aria-selected="true"] { transform: none; }
  #pBrigada .bri-carta[aria-selected="true"] { border-color: var(--oro); box-shadow: inset 4px 0 0 var(--oro); }
  #pBrigada .bri-carta img { grid-row: 1 / span 2; width: 34px; height: 42px; margin: 0; }
  #pBrigada .bri-carta img + em { font-size: 12px; }
  #pBrigada .bri-carta em { grid-column: 3; grid-row: 1 / span 2; font-size: 17px; color: var(--oro2); letter-spacing: .04em; }
  #pBrigada .bri-carta b { grid-column: 2; grid-row: 1; margin: 0; min-height: 0; font-size: 15px; line-height: 1.15; }
  #pBrigada .bri-carta span { grid-column: 2; grid-row: 2; margin: 0; padding: 0; font-size: 11.5px; }
  #pBrigada .bri-carta[data-id="custom"] em { grid-column: 1; grid-row: 1 / span 2; justify-self: center; font-size: 22px; }
  #pBrigada .bri-der { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
  #pBrigada .bri-detalle { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px; }
  #pBrigada .bri-pie { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
  #pBrigada .bri-pie .bri-fuente { order: 0; max-width: 55%; margin-top: 12px; }
  #pBrigada #bConfirmaBri { width: auto; min-width: 320px; padding-inline: 36px; margin: 0; }
  .bri-escudo.real { width: 104px; height: 118px; }
  .bri-escudo.real img { width: 92px; height: 104px; }
  .bri-cab b { font-size: 26px; }
  .bri-cuerpo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px 26px; }
  .bri-medidas { gap: 6px; }
  .bri-resena { margin-top: 10px; font-size: 13.5px; }
  .bri-uds { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 16px; margin-top: 8px; }
  .portada.ancha .port-pie { display: none; }
}

/* ---- CIDI: necesidades de información y zonas de indicio ---- */
.cidi-caja { width: min(620px, 100%); }
.cidi-como { margin: 0 0 12px; font-size: 13.5px; line-height: 1.45; color: var(--tenue); }
.cidi-como b { color: var(--hueso); font-weight: 600; }
.cidi-nic { display: grid; gap: 7px; }
.cidi-nic button { cursor: pointer; text-align: left; padding: 10px 14px; border-radius: 6px; border: 1px solid var(--linea); border-left: 4px solid var(--oro2); background: var(--acero2); color: var(--hueso); transition: border-color .12s ease, background-color .12s ease; }
.cidi-nic button:hover, .cidi-nic button:focus-visible { border-color: var(--oro); background: #24475c; }
.cidi-nic button:disabled { opacity: .6; cursor: progress; }
.cidi-nic b { display: block; font: 600 17px/1.2 "Barlow Condensed", sans-serif; letter-spacing: .02em; }
.cidi-nic span { display: block; margin-top: 2px; font-size: 13px; color: var(--tenue); }
.indicio-eti span { position: absolute; left: 0; bottom: 4px; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px 3px; border-radius: 4px; background: rgba(16,33,46,.9); border: 1px solid var(--oro2); color: var(--oro); font: 600 13px/1.15 "Barlow Condensed", sans-serif; letter-spacing: .03em; text-align: center; pointer-events: none; }
.indicio-eti small { display: block; font: 400 11px/1.1 "Barlow", sans-serif; color: var(--hueso); letter-spacing: 0; }
#bCidi:disabled { opacity: .55; cursor: default; }

/* ---- Instrucción ---- */
.instr-b { display: block; text-align: left; padding: 12px 16px; border: 1px solid var(--oro); border-left: 6px solid var(--oro); background: linear-gradient(90deg, rgba(227,179,65,.2), rgba(227,179,65,.04)); color: var(--hueso); }
.instr-b b { display: block; font: 600 20px/1.1 "Barlow Condensed", sans-serif; color: var(--oro); letter-spacing: .02em; }
.instr-b span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--tenue); font-weight: 400; }
.instr-lista { display: grid; gap: 6px; }
.instr-carta { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--linea); background: var(--acero2); color: var(--hueso); cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.instr-carta:hover, .instr-carta:focus-visible { border-color: var(--oro); background: #24475c; }
.instr-carta em { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--linea); font: 400 18px/1 "Stencil CM", "Barlow Condensed", sans-serif; font-style: normal; color: var(--tenue); }
.instr-carta.siguiente { border-color: var(--oro2); box-shadow: inset 4px 0 0 var(--oro); }
.instr-carta.siguiente em { border-color: var(--oro); color: var(--oro); }
.instr-carta.hecha em { border-color: #3fbf62; background: #3fbf62; color: #0d1d28; }
.instr-carta b { display: block; font: 600 17px/1.15 "Barlow Condensed", sans-serif; letter-spacing: .02em; }
.instr-carta span { display: block; font-size: 12.5px; color: var(--tenue); line-height: 1.3; }
.instr-carta small { font-size: 12px; color: var(--tenue); white-space: nowrap; }
.instr-carta.hecha small { color: #7fd98f; }

.instr { position: absolute; left: 46px; right: 84px; top: 14px; z-index: 470; max-width: 760px; margin-inline: auto; padding: 8px 10px 8px 14px; border-radius: 6px; background: rgba(14,31,45,.95); border: 1px solid var(--oro2); border-left: 5px solid var(--oro); box-shadow: 0 10px 28px rgba(0,0,0,.5); }
.instr-cab { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.instr-cab small { font-size: 12px; color: var(--tenue); letter-spacing: .02em; }
.instr-pasos { display: flex; gap: 4px; flex: none; }
.instr-pasos i { width: 18px; height: 6px; border-radius: 3px; background: #0a1721; border: 1px solid var(--linea); }
.instr-pasos i.ok { background: #3fbf62; border-color: #3fbf62; }
.instr-pasos i.ya { background: var(--oro); border-color: var(--oro); }
.instr-tarea { margin: 3px 0 6px; font: 600 18px/1.25 "Barlow Condensed", sans-serif; letter-spacing: .01em; color: var(--hueso); }
.instr-tarea.nueva { animation: instrNueva .6s ease; }
@keyframes instrNueva { from { color: #7fd98f; transform: translateX(-6px); } to { color: var(--hueso); transform: none; } }
.instr-tareas { margin: 0 0 6px; padding-left: 20px; font-size: 13px; color: var(--tenue); }
.instr-tareas li.ok { color: #7fd98f; text-decoration: line-through; text-decoration-color: rgba(127,217,143,.5); }
.instr-tareas li.ya { color: var(--hueso); font-weight: 600; }
.instr-pista { margin: 0 0 7px; padding: 6px 10px; border-radius: 4px; background: rgba(227,179,65,.12); border-left: 3px solid var(--oro); font-size: 13.5px; line-height: 1.4; }
.instr-bot { display: flex; flex-wrap: wrap; gap: 6px; }
.instr-bot button { border: 1px solid var(--linea); background: var(--acero2); color: var(--hueso); border-radius: 4px; padding: 4px 11px; cursor: pointer; font-weight: 600; font-size: 13px; }
.instr-bot button:first-child { border-color: var(--oro2); color: var(--oro); }
.instr-bot button:hover { border-color: var(--oro); }
.instr-bot button:disabled { opacity: .5; cursor: default; }
.instr-marca { animation: instrLatido 1.4s ease-in-out infinite; }
@keyframes instrLatido { 50% { opacity: .45; } }
#bListo.instr-brilla { animation: instrBrilla .7s ease-in-out 5; }
@keyframes instrBrilla { 50% { box-shadow: 0 0 0 6px rgba(227,179,65,.55), 0 0 24px rgba(227,179,65,.6); } }

.instr-velo { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; background: rgba(5,12,18,.62); }
.instr-velo[hidden] { display: none; }
.instr-caja { width: min(600px, 100%); }
.instr-cuerpo { padding: 14px 18px; overflow-y: auto; }
.instr-cuerpo ol { margin: 8px 0 10px; padding-left: 22px; line-height: 1.45; }
.instr-aprende { margin: 0; font-size: 15px; color: var(--oro); }
.instr-doc { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.instr-sello { flex: none; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; border: 3px solid #3fbf62; color: #3fbf62; font: 400 30px/1 "Stencil CM", "Barlow Condensed", sans-serif; transform: rotate(-12deg); animation: instrSello .5s cubic-bezier(.2,.9,.3,1.4) both; }
@keyframes instrSello { from { transform: scale(2) rotate(-30deg); opacity: 0; } }
.instr-datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.instr-datos div { padding: 8px 10px; border-radius: 6px; background: rgba(255,255,255,.04); border: 1px solid var(--linea); }
.instr-datos dt { font-size: 12px; color: var(--tenue); }
.instr-datos dd { margin: 2px 0 0; font: 600 22px/1 "Barlow Condensed", sans-serif; }
.instr-nombre { display: grid; gap: 4px; margin-bottom: 10px; font-size: 13px; color: var(--tenue); }
.instr-nombre input { font: 600 18px/1.2 "Barlow Condensed", sans-serif; padding: 7px 10px; }
.instr-tabla { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 8px; }
.instr-tabla th, .instr-tabla td { padding: 5px 8px; border-bottom: 1px solid var(--linea); text-align: left; }
.instr-tabla th { font-size: 12px; color: var(--tenue); font-weight: 600; }
.instr-tabla tfoot td { font-weight: 700; border-bottom: 0; }
@media (max-width: 760px) { .instr { left: 8px; right: 8px; top: 8px; } .instr-tarea { font-size: 16px; } }
@media print {
  body * { visibility: hidden !important; }
  #instrCert, #instrCert * { visibility: visible !important; }
  #instrCert { position: absolute; inset: 0; width: 100%; max-height: none; background: #fff; color: #000; border: 0; box-shadow: none; }
  #instrCert footer, #instrCert .inf-cab button { display: none; }
  #instrCert h2, #instrCert small, #instrCert td, #instrCert th, #instrCert p, #instrCert input { color: #000 !important; }
  #instrCert input { border: 0; background: none; }
}
.instr-error { margin: 0 0 7px; padding: 6px 10px; border-radius: 4px; background: rgba(240,104,94,.14); border-left: 3px solid var(--enemigo); font-size: 13.5px; line-height: 1.4; }
.instr-caja footer { display: flex; justify-content: flex-end; gap: 8px; }
.instr-caja footer .boton { width: auto; margin: 0; padding-inline: 22px; }
.instr-nombre input { width: 100%; box-sizing: border-box; background: #0e1f2d; color: var(--hueso); border: 1px solid var(--linea); border-radius: 4px; }
.instr-nombre input:focus { outline: 2px solid var(--oro); outline-offset: 1px; }
/* Volver al menú principal */
.btn-menu { flex: none; padding: 6px 14px; }
.btn-menu .corto { display: none; }
.btn-menu[hidden] { display: none; }
@media (max-width: 1100px) { .btn-menu .largo { display: none; } .btn-menu .corto { display: inline; } .btn-menu { padding: 6px 10px; } }
.clave-menu { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 4px; border: 1px solid var(--oro2); font: 600 20px/1.2 "Barlow Condensed", sans-serif; letter-spacing: .06em; color: var(--oro); user-select: all; }
#bSalir { margin-top: 6px; }

/* ---- Portada: el menú entero cabe en una pantalla y ningún texto se corta ---- */
/* El escudo cede el espacio que haga falta antes de que aparezca el desplazamiento. */
.portada:not(.compacta) .port-escudo { flex: 0 1 auto; min-height: 64px; max-width: 100%; }
.inicio { gap: 10px; margin-top: 18px; }
.entradas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inicio .gran { padding: 13px 14px 12px; }
.inicio .gran b { font-size: clamp(21px, 5.8vw, 25px); line-height: 1.1; }
.inicio .gran span, .modo span { text-wrap: balance; line-height: 1.3; }
.modos { display: grid; gap: 8px; }
.modo { cursor: pointer; text-align: left; padding: 9px 14px 10px; border-radius: 6px; border: 1px solid var(--linea); border-left: 5px solid var(--oro); background: linear-gradient(90deg, rgba(227,179,65,.13), rgba(227,179,65,.02) 70%), var(--acero); color: var(--hueso); box-shadow: 0 3px 0 #0a1721;
  transition: transform .08s ease, border-color .15s ease, box-shadow .15s ease; }
.modo:hover, .modo:focus-visible { border-color: var(--oro); box-shadow: 0 3px 0 #0a1721, 0 0 0 2px rgba(227,179,65,.3); }
.modo:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a1721; }
.modo b { display: block; font: 600 20px/1.15 "Barlow Condensed", sans-serif; letter-spacing: .02em; color: var(--oro); }
.modo span { display: block; margin-top: 1px; color: var(--tenue); font-size: 13.5px; }
.modo[disabled] { opacity: .55; cursor: wait; }
@media (min-width: 540px) { .modos { grid-template-columns: repeat(3, minmax(0, 1fr)); } .modo { padding: 11px 12px 12px; } }
/* Móvil apaisado: poca altura, así que el subtítulo se guarda y todo va en dos filas. */
@media (max-height: 520px) { .portada:not(.compacta) .port-sub { display: none; } .portada:not(.compacta) .port-escudo { min-height: 44px; } .port-caja { padding-top: 16px; } .inicio { margin-top: 12px; } .portada:not(.compacta) h1 { font-size: clamp(24px, 5vw, 32px); margin-top: 6px; } }
/* En la portada los botones parten el texto en líneas en vez de cortarlo. */
.portada .boton { white-space: normal; text-wrap: balance; line-height: 1.2; }

/* Potestad (debo moverla) en azul claro y control (puedo moverla) en verde claro. */
:root { --potestad: #a9d8ff; --control: #b9f0b4; }
.fila-ficha.m-potestad { box-shadow: inset 5px 0 0 var(--potestad); }
.fila-ficha.m-control { box-shadow: inset 5px 0 0 var(--control); }
.fila-ficha.m-potestad.sel, .fila-ficha.m-control.sel { box-shadow: inset 5px 0 0 var(--oro); }
.ficha-mapa.m-potestad span, .ficha-mapa.m-control span { display: inline-block; margin: -3px 0 0; padding: 1px 4px 2px; border-radius: 3px; text-shadow: none; color: #0d1f2b; transform: translateX(-50%); position: relative; left: 50%; }
.ficha-mapa.m-potestad span { background: var(--potestad); }
.ficha-mapa.m-control span { background: var(--control); }
.ley-mando { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; padding: 0 0 4px; font-size: 12.5px; }
.ley-mando span { padding: 2px 7px; border-radius: 3px; color: #0d1f2b; font-weight: 600; }
.ley-mando .m-potestad { background: var(--potestad); } .ley-mando .m-control { background: var(--control); }
.red li.sub { margin-left: 14px; }
#bRelevo { margin-bottom: 8px; white-space: normal; }

/* Opciones en tres apartados: ajustes, atajos y créditos. */
.opc-pes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 2px 0 8px; }
.opc-pes button { border: 1px solid var(--oro2); background: transparent; color: var(--hueso); font: 600 15px/1 "Barlow Condensed", sans-serif; letter-spacing: .04em; padding: 8px 4px; border-radius: 4px; cursor: pointer; }
.opc-pes button[aria-selected="true"] { background: var(--oro); border-color: var(--oro); color: #13222f; }
.opc-pes button:focus-visible { outline: 2px solid var(--oro); outline-offset: 2px; }
.opc-sec { min-height: 230px; }
.opc-sec .atajos { margin-top: 0; }
.cred-autor { margin: 6px 0 14px; padding: 12px 0 14px; border-bottom: 1px solid rgba(227,179,65,.3); text-align: center; }
.cred-autor small { display: block; color: var(--tenue); font-size: 12.5px; margin-bottom: 4px; }
.cred-autor b { display: block; font: 400 26px/1.1 "Stencil CM", "Barlow Condensed", sans-serif; letter-spacing: .03em; color: var(--hueso); }
.cred-lista { margin: 0; display: grid; gap: 7px; }
.cred-lista div { display: grid; grid-template-columns: 112px 1fr; gap: 8px; font-size: 13.5px; line-height: 1.3; }
.cred-lista dt { color: var(--oro); font-weight: 600; }
.cred-lista dd { margin: 0; color: var(--hueso); }
.creditos .nota { margin-top: 12px; }
@media (max-width: 380px) { .cred-lista div { grid-template-columns: 1fr; gap: 0; } }
/* Sin teclado (móvil), no hay atajos que enseñar: solo Ajustes y Créditos. */
.opc-pes { grid-template-columns: 1fr 1fr; } .opc-pes [data-opc="atajos"] { display: none; }

.demo-salto { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; }
.demo-salto select { min-width: 0; }
.demo-salto .boton { padding: 6px 10px; }
#demoLeyenda { margin-top: 8px; }

.opc-hex { margin: 10px 0 4px; display: grid; gap: 6px; }
.opc-hex .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.mues { display: inline-block; width: 22px; height: 12px; border-radius: 2px; }
.mues.oro { background: #c99a06; box-shadow: 0 0 0 2px #10212e; }
.mues.negro { background: #111; box-shadow: 0 0 0 2px #fff; }
