/* ═══════════════════ COALITION WARS ═══════════════════ */
:root {
  --amber: #e8b04a;
  --amber-hi: #ffd27a;
  --red: #d9534f;
  --ink: #0b0b0d;
  --panel: rgba(12, 12, 14, 0.84);
  --line: rgba(232, 176, 74, 0.35);
  --text: #efe6d2;
  --muted: #9c937f;
  --display: 'Black Ops One', Impact, 'Arial Black', sans-serif;
  --ui: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --cut: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); font-family: var(--ui); font-weight: 500; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#screens { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#screens > * { pointer-events: auto; }
#crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.13) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
#crt::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%); }

/* ─────────── Pantallas ─────────── */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fadeIn 0.25s ease-out;
}
.screen.dim { background: radial-gradient(ellipse at 50% 40%, rgba(8,8,10,0.35), rgba(8,8,10,0.85)); }
.screen.solid { background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--fbg, #08080a) 85%, transparent), transparent 70%), linear-gradient(180deg, rgba(8,8,10,0.86), rgba(8,8,10,0.96)); transition: background 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.screen-title {
  font-family: var(--display); font-size: clamp(26px, 4vw, 44px); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 24px; text-shadow: 0 3px 0 #000;
}
.hint { font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 22px; text-align: center; }

/* Logo */
.logo { text-align: center; margin-bottom: 42px; transform: skewX(-6deg); }
.logo h1 {
  font-family: var(--display); font-weight: 400; margin: 0; line-height: 0.9;
  font-size: clamp(48px, 9vw, 120px); letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff1c9 0%, var(--amber) 45%, #a3451d 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 #000) drop-shadow(0 0 30px rgba(255, 120, 40, 0.35));
}
.logo h1 span { display: block; font-size: 0.62em; letter-spacing: 0.28em; }
.logo .sub { margin-top: 14px; font-size: clamp(13px, 1.5vw, 18px); letter-spacing: 0.32em; text-transform: uppercase; color: var(--text); opacity: 0.8; }

/* Menú principal */
.menu-list { display: flex; flex-direction: column; gap: 6px; min-width: min(420px, 86vw); }
.menu-item {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 12px 22px 12px 52px; border: 0; background: transparent; cursor: pointer; text-align: left;
  font-family: var(--display); font-size: clamp(20px, 2.6vw, 30px); letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(239, 230, 210, 0.55); transition: color 0.12s, background 0.12s, padding 0.12s;
}
.menu-item .key { font-family: var(--ui); font-weight: 700; font-size: 0.55em; color: var(--muted); width: 22px; }
.menu-item::before { content: '▶'; position: absolute; left: 18px; font-size: 0.7em; color: var(--amber); opacity: 0; transition: opacity 0.12s, left 0.12s; }
.menu-item.sel { color: #fff; background: linear-gradient(90deg, rgba(232,176,74,0.28), transparent 85%); padding-left: 60px; }
.menu-item.sel::before { opacity: 1; left: 24px; }
.menu-item.sel .key { color: var(--amber); }
.menu-item .tag { margin-left: auto; font-family: var(--ui); font-size: 0.45em; letter-spacing: 0.18em; color: var(--muted); border: 1px solid currentColor; padding: 2px 8px; }
.version { position: absolute; bottom: 14px; right: 18px; font-size: 13px; letter-spacing: 0.2em; color: var(--muted); }

/* Paneles */
.panel {
  background: var(--panel); border: 1px solid var(--line); clip-path: var(--cut);
  padding: 28px 32px; backdrop-filter: blur(4px); min-width: min(560px, 92vw); max-width: 92vw;
}

/* Opciones */
.opt-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px;
  padding: 10px 14px; font-size: 20px; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer;
  border-left: 3px solid transparent;
}
.opt-row.sel { background: rgba(232,176,74,0.12); border-left-color: var(--amber); }
.opt-val { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--amber-hi); }
.opt-val button { width: 30px; height: 30px; border: 1px solid var(--line); background: rgba(0,0,0,0.4); cursor: pointer; color: var(--amber); }
.opt-val button:hover { background: rgba(232,176,74,0.25); }
.opt-val span { min-width: 120px; text-align: center; }
.btn-row { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.btn {
  padding: 10px 26px; border: 1px solid var(--amber); background: rgba(232,176,74,0.08); cursor: pointer;
  font-family: var(--display); font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.btn:hover, .btn.sel { background: var(--amber); color: #111; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; color: var(--muted); border-color: var(--muted); }

/* Idioma */
.lang-item { display: flex; justify-content: space-between; align-items: center; font-size: 26px; padding: 12px 18px; cursor: pointer; letter-spacing: 0.06em; border-left: 3px solid transparent; }
.lang-item.sel { background: rgba(232,176,74,0.12); border-left-color: var(--amber); }
.lang-item .check { color: var(--amber); font-size: 20px; }

/* Online */
.online-badge { display: inline-block; font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase; padding: 4px 10px; border: 1px solid var(--red); color: var(--red); margin-bottom: 14px; }
.online-desc { color: var(--muted); font-size: 18px; max-width: 520px; line-height: 1.35; }
.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.online-grid input { width: 100%; padding: 10px 12px; font: inherit; font-size: 18px; letter-spacing: 0.2em; background: rgba(0,0,0,0.5); border: 1px solid var(--line); color: var(--text); text-transform: uppercase; }
.online-grid input:disabled { opacity: 0.4; }

/* ─────────── Selección de comandante ─────────── */
.select-screen { padding: 24px; justify-content: flex-start; }
.select-screen .screen-title { margin-top: 1vh; }
.vs-layout { display: grid; grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr); gap: 3vw; align-items: center; width: min(1400px, 100%); flex: 1; min-height: 0; }
.fighter { position: relative; height: min(62vh, 560px); display: flex; flex-direction: column; justify-content: flex-end; }
.fighter .portrait-wrap {
  position: absolute; inset: 0 0 90px 0; overflow: hidden; clip-path: var(--cut);
  border: 2px solid var(--pc, var(--amber)); background: #111;
}
.fighter img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fighter .portrait-wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.85)); }
.fighter .tagline { position: absolute; left: 0; right: 0; bottom: 96px; padding: 0 18px; z-index: 2; }
.fighter .rank { font-size: 15px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--pc, var(--amber)); }
.fighter .name { font-family: var(--display); font-size: clamp(30px, 3.6vw, 52px); line-height: 1; text-transform: uppercase; text-shadow: 0 3px 0 #000; }
.fighter .perk { height: 80px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); }
.fighter .perk b { display: block; color: var(--amber-hi); text-transform: uppercase; letter-spacing: 0.1em; font-size: 16px; }
.fighter .perk small { color: var(--muted); font-size: 15px; }
.fighter .side-tag { position: absolute; top: -14px; left: 14px; z-index: 3; font-family: var(--display); font-size: 22px; padding: 2px 14px; background: var(--pc, var(--amber)); color: #111; }
.fighter.right .side-tag { left: auto; right: 14px; }
.fighter.unknown .portrait-wrap { display: grid; place-items: center; }
.fighter.unknown .portrait-wrap::before { content: '?'; font-family: var(--display); font-size: 160px; color: rgba(255,255,255,0.12); }
.cpu-extra { position: absolute; top: 14px; right: 14px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.cpu-extra img { width: 54px; height: 72px; object-fit: cover; object-position: 50% 15%; border: 2px solid var(--pc); }

.cmd-grid { display: grid; grid-template-columns: repeat(4, clamp(58px, min(6.4vw, 9.5vh), 104px)); gap: 7px; }
.cmd-tile {
  position: relative; aspect-ratio: 3 / 4; padding: 0; border: 2px solid rgba(255,255,255,0.12); background: #111; cursor: pointer; overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform 0.1s, border-color 0.1s, filter 0.1s;
  filter: grayscale(0.55) brightness(0.75);
}
.cmd-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmd-tile .tn { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; background: rgba(0,0,0,0.7); }
.cmd-tile.sel { border-color: var(--amber); filter: none; transform: scale(1.07); z-index: 2; }
.cmd-tile.sel::after { content: 'P1'; position: absolute; top: 3px; left: 6px; font-family: var(--display); font-size: 14px; color: #111; background: var(--amber); padding: 0 5px; }
.cmd-tile.cpu-pick { border-color: var(--red); filter: none; }
.cmd-tile.cpu-pick::before { content: 'CPU'; position: absolute; top: 3px; right: 4px; z-index: 2; font-family: var(--display); font-size: 12px; color: #111; background: var(--red); padding: 0 4px; }
.cmd-tile.locked { border-color: #fff; filter: none; }

/* Retratos reales: encuadre centrado en la cara */
.fighter img, .cmd-tile img, .cmd-mini img, .hud-who img, .vs-portrait { object-position: 50% 12%; }
.cmd-grid.cpu-phase .cmd-tile:not(.locked) { border-color: color-mix(in srgb, var(--ec) 55%, transparent); filter: brightness(0.8); }
.cmd-grid.cpu-phase .cmd-tile.cpu-pick { border-color: var(--ec); filter: none; transform: scale(1.07); z-index: 2; box-shadow: 0 0 22px color-mix(in srgb, var(--ec) 60%, transparent); }
.cmd-grid.cpu-phase .cmd-tile.cpu-pick::before { background: var(--ec); color: #fff; }
.cmd-grid.cpu-phase .cmd-tile.locked { border-color: var(--pc); }
.title-logo { height: 1.3em; width: 1.3em; object-fit: cover; vertical-align: -0.32em; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }
.fighter.unknown .enemy-logo { position: absolute; inset: 0; margin: auto; width: 62%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; opacity: 0.22; filter: grayscale(0.3); }
.fighter.unknown .portrait-wrap::before { position: relative; z-index: 1; }

/* ─────────── Selección de facción ─────────── */
.faction-screen { justify-content: center; }
.faction-cards { display: flex; gap: clamp(14px, 3vw, 40px); justify-content: center; align-items: stretch; width: min(1100px, 100%); }
.faction-card {
  flex: 1; max-width: 480px; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer;
  padding: 26px 26px 22px; border: 2px solid color-mix(in srgb, var(--fc) 35%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--fbg) 90%, black), rgba(0,0,0,0.75));
  clip-path: var(--cut); filter: grayscale(0.6) brightness(0.65); transition: filter 0.2s, transform 0.2s, border-color 0.2s;
}
.faction-card.sel { filter: none; transform: translateY(-6px) scale(1.02); border-color: var(--fc); box-shadow: 0 0 60px color-mix(in srgb, var(--fc) 40%, transparent); }
.fc-logo { width: min(280px, 60%); aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 3px color-mix(in srgb, var(--fa) 60%, transparent), 0 12px 40px rgba(0,0,0,0.6); }
.fc-logo img { width: 100%; height: 100%; object-fit: cover; }
.faction-card.sel .fc-logo { animation: fcPulse 2.2s ease-in-out infinite; }
@keyframes fcPulse { 50% { box-shadow: 0 0 0 3px var(--fa), 0 0 50px color-mix(in srgb, var(--fc) 60%, transparent); } }
.fc-short { font-family: var(--display); font-size: clamp(40px, 5vw, 68px); line-height: 1; margin-top: 18px; color: var(--fa); text-shadow: 0 4px 0 #000; }
.fc-name { font-family: var(--display); font-size: clamp(16px, 1.7vw, 22px); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; }
.fc-motto { font-size: 15px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--fc); margin-top: 8px; filter: brightness(1.3); }
.fc-desc { font-size: 17px; color: var(--muted); line-height: 1.3; margin: 12px 0 0; max-width: 380px; }

/* Formato de partida */
.format-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: min(1100px, 100%); }
.format-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 14px; cursor: pointer; text-align: center;
  border: 2px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.45); clip-path: var(--cut); filter: brightness(0.7);
  transition: transform 0.15s;
}
.format-card.sel { filter: none; border-color: var(--amber); transform: translateY(-4px); background: rgba(232,176,74,0.1); }
.fm-title { font-family: var(--display); font-size: clamp(30px, 3.4vw, 46px); color: var(--amber-hi); text-shadow: 0 3px 0 #000; }
.fm-teams { display: flex; align-items: center; gap: 10px; }
.fm-team { display: flex; gap: 6px; }
.fm-vs { font-family: var(--display); color: var(--muted); font-weight: 400; }
.fm-unit { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fm-unit i { width: 26px; height: 34px; display: block; border-radius: 13px 13px 4px 4px; background: #4f7fe0; box-shadow: inset 0 -10px 0 rgba(0,0,0,0.25); }
.fm-unit.you i { background: var(--amber); }
.fm-unit.enemy i { background: #d0402e; }
.fm-unit small { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.fm-desc { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.3; }
.fmt-tag { font-family: var(--ui); font-weight: 700; font-size: 0.5em; letter-spacing: 0.15em; vertical-align: middle; padding: 2px 8px; border: 1px solid var(--amber); margin-left: 6px; }
.online-formats { display: flex; gap: 8px; margin-top: 10px; }
.online-formats span { font-family: var(--display); padding: 4px 10px; border: 1px solid var(--line); color: var(--muted); }
.ally-extra { left: 14px; right: auto; top: 40px; }
.ally-extra img { border-color: var(--pc); }
.cmd-tile.ally-roll, .cmd-tile.ally-pick { border-color: #7bd389; filter: none; }
.cmd-tile.ally-pick::before { content: 'ALLY'; position: absolute; top: 3px; right: 4px; z-index: 2; font-family: var(--display); font-size: 12px; color: #111; background: #7bd389; padding: 0 4px; }
.vs-side.team .vs-info .name { font-size: clamp(28px, 3.6vw, 58px); }
.vs-mates { position: absolute; z-index: 3; bottom: calc(8vh + clamp(90px, 10vw, 150px)); display: flex; gap: 8px; }
.vs-side.left .vs-mates { left: 6vw; }
.vs-side.right .vs-mates { right: 6vw; }
.vs-mates img { width: clamp(60px, 7vw, 100px); aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 12%; border: 2px solid var(--pc); box-shadow: 0 8px 20px rgba(0,0,0,0.6); }

/* VS: logos */
.vs-side .vs-logo { position: absolute; z-index: 3; top: 4vh; width: clamp(70px, 9vw, 130px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 3px var(--pc), 0 10px 30px rgba(0,0,0,0.7); }
.vs-side.left .vs-logo { left: 4vw; }
.vs-side.right .vs-logo { right: 4vw; }

/* ─────────── Selección de tanque ─────────── */
.tank-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; width: min(1200px, 100%); flex: 1; min-height: 0; align-items: center; }
.tank-stage { position: relative; height: min(56vh, 520px); background: radial-gradient(ellipse at 50% 70%, rgba(232,176,74,0.16), transparent 65%); border: 1px solid var(--line); clip-path: var(--cut); }
.tank-stage canvas { width: 100%; height: 100%; display: block; }
.tank-stage .tank-name { position: absolute; left: 22px; top: 16px; font-family: var(--display); font-size: clamp(34px, 4vw, 58px); text-transform: uppercase; text-shadow: 0 3px 0 #000; }
.tank-stage .tank-cls { position: absolute; left: 24px; top: calc(16px + clamp(38px, 4.4vw, 62px)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--amber); }
.tank-info .desc { font-size: 19px; color: var(--muted); margin: 0 0 18px; line-height: 1.3; }
.stat { margin-bottom: 14px; }
.stat label { display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: 0.14em; font-size: 15px; margin-bottom: 5px; }
.stat .bar { height: 12px; background: rgba(255,255,255,0.08); display: flex; gap: 3px; }
.stat .bar i { flex: 1; background: rgba(255,255,255,0.08); }
.stat .bar i.on { background: var(--amber); box-shadow: 0 0 8px rgba(232,176,74,0.5); }
.arsenal { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.arsenal span { font-size: 14px; letter-spacing: 0.08em; padding: 3px 8px; border: 1px solid var(--line); text-transform: uppercase; }
.arsenal span b { color: var(--amber-hi); margin-left: 4px; }
.tank-cards { display: flex; gap: 10px; margin-top: 18px; justify-content: center; }
.tank-card { padding: 10px 22px; border: 1px solid rgba(255,255,255,0.15); background: rgba(0,0,0,0.45); cursor: pointer; text-align: center; min-width: 120px; }
.tank-card b { display: block; font-family: var(--display); font-size: 20px; text-transform: uppercase; }
.tank-card small { color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.tank-card.sel { border-color: var(--amber); background: rgba(232,176,74,0.16); }
.tank-card.sel b { color: var(--amber-hi); }
.cmd-mini { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cmd-mini img { width: 48px; height: 64px; object-fit: cover; border: 2px solid var(--amber); }
.cmd-mini b { display: block; font-family: var(--display); font-size: 20px; text-transform: uppercase; }
.cmd-mini small { color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }

/* ─────────── VS ─────────── */
.vs-screen { flex-direction: row; overflow: hidden; background: #000; }
.vs-side { position: relative; flex: 1; height: 100%; overflow: hidden; }
.vs-side .vs-portrait { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.vs-side.left { clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%); animation: slideL 0.45s cubic-bezier(.2,.9,.3,1); }
.vs-side.right { clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%); margin-left: -6%; animation: slideR 0.45s cubic-bezier(.2,.9,.3,1); }
.vs-side::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,0.9), transparent 55%); }
.vs-side .vs-info { position: absolute; bottom: 8vh; z-index: 2; left: 6vw; }
.vs-side.right .vs-info { left: auto; right: 6vw; text-align: right; }
.vs-info .who { font-size: 18px; letter-spacing: 0.4em; color: var(--pc); }
.vs-info .name { font-family: var(--display); font-size: clamp(40px, 6vw, 90px); line-height: 1; text-transform: uppercase; }
.vs-info .tank { font-size: 20px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.vs-word { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; font-family: var(--display); font-size: clamp(90px, 16vw, 220px); color: var(--amber); text-shadow: 0 0 40px rgba(255,120,40,0.7), 0 8px 0 #000; animation: vsPop 0.6s 0.35s both cubic-bezier(.2,1.6,.4,1); }
.vs-ready { position: absolute; bottom: 3vh; left: 0; right: 0; text-align: center; z-index: 5; letter-spacing: 0.6em; text-transform: uppercase; font-size: 16px; animation: blink 0.8s infinite; }
@keyframes slideL { from { transform: translateX(-100%); } }
@keyframes slideR { from { transform: translateX(100%); } }
@keyframes vsPop { from { transform: translate(-50%, -50%) scale(3); opacity: 0; } }
@keyframes blink { 50% { opacity: 0.3; } }

/* ─────────── HUD ─────────── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-chip { background: var(--panel); border: 1px solid var(--line); padding: 6px 14px; font-size: 16px; letter-spacing: 0.16em; text-transform: uppercase; }
.hud-chip b { color: var(--amber-hi); }
.wind { display: flex; align-items: center; gap: 10px; }
.wind .arrow { display: inline-block; font-size: 20px; color: var(--amber-hi); transition: transform 0.3s; }
.hud-btn { width: 40px; height: 36px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 16px; color: var(--amber); }
.hud-bottom {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; align-items: stretch; gap: 10px; padding: 10px; background: var(--panel); border: 1px solid var(--line); clip-path: var(--cut);
  max-width: calc(100vw - 16px);
}
.hud-who { display: flex; gap: 10px; align-items: center; min-width: 170px; flex-shrink: 0; }
.hud-who img { width: 46px; height: 60px; object-fit: cover; border: 2px solid var(--pc); }
.hud-who b { display: block; font-family: var(--display); font-size: 20px; text-transform: uppercase; color: var(--pc); }
.hud-who small { color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-size: 13px; }
.hud-ctl { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 8px; border-left: 1px solid rgba(255,255,255,0.08); }
.hud-ctl label { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.hud-ctl .row { display: flex; align-items: center; gap: 6px; }
.hud-ctl .val { font-family: var(--display); font-size: 24px; min-width: 64px; text-align: center; color: var(--amber-hi); }
.hud-ctl .wname { font-size: 17px; font-weight: 700; min-width: 130px; text-align: center; text-transform: uppercase; letter-spacing: 0.05em; }
.hud-ctl .wname small { color: var(--muted); margin-left: 4px; }
.hud-ctl button { width: 32px; height: 32px; border: 1px solid var(--line); background: rgba(0,0,0,0.4); color: var(--amber); cursor: pointer; font-size: 15px; touch-action: none; }
.hud-ctl button:active { background: var(--amber); color: #111; }
.fuel-bar { width: 80px; height: 8px; background: rgba(255,255,255,0.1); }
.fuel-bar i { display: block; height: 100%; background: #7bd389; }
.fire-btn {
  padding: 0 26px; border: 0; cursor: pointer; background: linear-gradient(180deg, #ff7a3a, #b8321a); color: #fff;
  font-family: var(--display); font-size: 26px; letter-spacing: 0.08em; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.fire-btn:active { filter: brightness(1.3); }
.hud-bottom.cpu .hud-ctl, .hud-bottom.cpu .fire-btn { opacity: 0.35; pointer-events: none; }
.hud-keys { position: absolute; bottom: 104px; left: 0; right: 0; text-align: center; font-size: 13px; letter-spacing: 0.14em; color: rgba(239,230,210,0.5); text-transform: uppercase; pointer-events: none; }
.turn-banner { position: absolute; top: 26%; left: 0; right: 0; text-align: center; font-family: var(--display); font-size: clamp(30px, 5vw, 64px); text-transform: uppercase; color: var(--pc); text-shadow: 0 4px 0 #000; pointer-events: none; animation: banner 1.8s forwards; }
.turn-banner .tb-sub { display: block; font-family: var(--ui); font-weight: 700; font-size: 18px; letter-spacing: 0.15em; color: var(--text); margin-top: 6px; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.4); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }

.tank-label { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.tank-label.active .tl-name::before { content: '▼ '; }
.tank-label.active { animation: bob 0.9s ease-in-out infinite; }
@keyframes bob { 50% { margin-top: -4px; } }
.tl-bar { position: relative; width: 52px; height: 6px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.3); }
.tl-hp { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #d9534f, #7bd389); background-size: 52px 100%; }
.tl-sh { position: absolute; left: 0; top: -4px; height: 2px; background: #6fc3ff; }
.dmg-pop { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-size: 24px; color: #ff6a4a; text-shadow: 0 2px 0 #000; animation: pop 1.2s forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -20px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }

/* Retratos de comandantes en partida */
.hud-team { position: absolute; top: 56px; display: flex; gap: 8px; pointer-events: none; }
.hud-team.left { left: 14px; }
.hud-team.right { right: 14px; flex-direction: row-reverse; }
.hud-cmd { width: clamp(110px, 10vw, 150px); transition: transform 0.25s; transform-origin: top center; }
.hud-team.duo .hud-cmd { width: clamp(90px, 7.5vw, 120px); }
.hud-cmd.me .hc-name::after { content: ' ★'; color: var(--amber); }
.hc-frame {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #111;
  border: 2px solid color-mix(in srgb, var(--pc) 45%, #333); clip-path: var(--cut);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6);
}
.hc-frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.75)); }
.hc-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; filter: grayscale(1) brightness(0.6) contrast(1.05); transition: filter 0.35s; }
.hc-fac { position: absolute; top: 4px; left: 10px; z-index: 2; font-family: var(--display); font-size: 13px; padding: 0 6px; background: var(--panel); color: #9a9a9a; border: 1px solid rgba(255,255,255,0.15); }
.hc-turn { position: absolute; bottom: 6px; left: 0; right: 0; z-index: 2; text-align: center; font-family: var(--display); font-size: 14px; letter-spacing: 0.15em; color: #fff; opacity: 0; text-shadow: 0 2px 0 #000; }
.hc-info { margin-top: 4px; background: var(--panel); border: 1px solid var(--line); padding: 4px 8px 6px; }
.hc-name { display: block; font-family: var(--display); font-size: 16px; letter-spacing: 0.04em; color: #8d8d8d; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-bar { display: block; height: 5px; margin-top: 4px; background: rgba(255,255,255,0.1); }
.hc-bar i { display: block; height: 100%; transition: width 0.4s; }
/* El que tiene el turno: a color y resaltado */
.hud-cmd.active { transform: scale(1.04); }
.hud-cmd.active .hc-frame { border-color: var(--pc); box-shadow: 0 0 24px color-mix(in srgb, var(--pc) 55%, transparent); }
.hud-cmd.active .hc-frame img { filter: none; }
.hud-cmd.active .hc-fac { background: var(--pc); color: #fff; border-color: var(--pc); }
.hud-cmd.active .hc-name { color: var(--pc); filter: brightness(1.35); }
.hud-cmd.active .hc-turn { opacity: 1; animation: blink 1s infinite; }
.hud-cmd.dead .hc-frame img { filter: grayscale(1) brightness(0.3); }
.hud-cmd.dead .hc-frame::before { content: '✕'; position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 64px; color: rgba(217,83,79,0.8); }

/* Overlays de partida */
.overlay-panel { text-align: center; }
.score-table { width: 100%; border-collapse: collapse; margin: 10px 0 6px; font-size: 18px; }
.score-table th { font-size: 13px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; font-weight: 500; padding: 6px 10px; text-align: right; }
.score-table th:first-child, .score-table td:first-child { text-align: left; }
.score-table td { padding: 8px 10px; text-align: right; border-top: 1px solid rgba(255,255,255,0.07); }
.score-table td .dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; background: var(--pc); }
.big-result { font-family: var(--display); font-size: clamp(44px, 7vw, 96px); text-transform: uppercase; color: var(--amber); text-shadow: 0 5px 0 #000; margin: 0; }
.big-result.lose { color: var(--red); }

/* ─────────── HUD: cámara, minimapa, turnos, despliegue ─────────── */
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hud-right { display: flex; gap: 6px; }
.minimap { width: 300px; height: 54px; border: 1px solid var(--line); cursor: pointer; background: rgba(0,0,0,0.5); touch-action: none; }
.hud-bottom.hidden { display: none; }
.who-txt { display: flex; flex-direction: column; gap: 3px; }
.tank-sel { display: flex; align-items: center; gap: 4px; }
.tank-sel button { width: 24px; height: 24px; border: 1px solid var(--line); background: rgba(0,0,0,0.4); color: var(--amber); cursor: pointer; font-size: 11px; }
.tank-sel.single button { visibility: hidden; }
.tank-sel .tname { min-width: 104px; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.fire-btn.done { background: #3a3a3a; color: #888; }
.end-btn {
  padding: 0 18px; border: 1px solid var(--amber); cursor: pointer; background: rgba(232,176,74,0.1); color: var(--amber);
  font-family: var(--display); font-size: 17px; letter-spacing: 0.06em; white-space: nowrap; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.end-btn:hover { background: rgba(232,176,74,0.3); }
.end-btn.ready { background: var(--amber); color: #111; animation: endPulse 1s ease-in-out infinite; }
@keyframes endPulse { 50% { box-shadow: 0 0 24px rgba(232,176,74,0.8); filter: brightness(1.2); } }
.hud-bottom.cpu .end-btn, .hud-bottom.cpu .tank-sel button { opacity: 0.35; pointer-events: none; }
.tank-label.spent { opacity: 0.45; }
.hc-tanks { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hud-deploy {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: none; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--pc, var(--line)); clip-path: var(--cut); max-width: calc(100vw - 16px);
}
.hud-deploy.show { display: flex; }
.hd-text b { display: block; font-family: var(--display); font-size: 22px; text-transform: uppercase; color: var(--amber-hi); }
.hd-text span { font-size: 16px; letter-spacing: 0.06em; color: var(--text); }
.hud-toast { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font-size: 18px; letter-spacing: 0.12em; text-transform: uppercase; background: var(--panel); border: 1px solid var(--red); color: #ff8a7a; padding: 8px 18px; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.hud-toast.show { opacity: 1; }
#gl { touch-action: none; }
body.overlay #hud, body.overlay #labels { visibility: hidden; }

/* Suministros en batalla */
.sup-btn {
  padding: 0 14px; border: 1px solid #7bd389; cursor: pointer; background: rgba(123,211,137,0.1); color: #7bd389;
  font-family: var(--display); font-size: 15px; letter-spacing: 0.05em; white-space: nowrap; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.sup-btn:hover:not(:disabled) { background: rgba(123,211,137,0.3); }
.sup-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.hud-bottom.cpu .sup-btn { opacity: 0.2; pointer-events: none; }
.hud-supply {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; flex-direction: column; gap: 8px;
  width: min(720px, calc(100vw - 20px)); max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 18px 20px; background: rgba(10,10,12,0.95); border: 1px solid #7bd389; clip-path: var(--cut); z-index: 5;
}
.hud-supply.show { display: flex; }
.sp-head { display: flex; justify-content: space-between; align-items: baseline; }
.sp-head > b { font-family: var(--display); font-size: 24px; text-transform: uppercase; color: #7bd389; }
.sp-credits b { font-family: var(--display); color: var(--amber-hi); font-size: 20px; }
.sp-warn { margin: 0; color: #ffb37a; letter-spacing: 0.06em; font-size: 15px; }
.sp-row { padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.08); }
.sp-tank { display: flex; align-items: center; gap: 6px; text-transform: uppercase; font-size: 16px; margin-bottom: 6px; }
.sp-tank i { width: 10px; height: 10px; display: inline-block; }
.sp-tank small { color: var(--muted); }
.sp-ammo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sp-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.sp-name { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; }
.sp-have { font-size: 13px; color: var(--muted); }
.sp-have b { color: #7bd389; }
.sp-ctl { display: flex; align-items: center; gap: 4px; }
.sp-ctl button { width: 24px; height: 24px; border: 1px solid var(--line); background: rgba(0,0,0,0.4); color: var(--amber); cursor: pointer; }
.sp-ctl button:disabled { opacity: 0.3; cursor: not-allowed; }
.sp-price { font-size: 13px; color: var(--amber-hi); min-width: 30px; text-align: center; }
.sp-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.sp-total { margin-right: auto; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.sp-total b { font-family: var(--display); color: var(--amber-hi); }
.hc-credits { display: block; font-family: var(--display); font-size: 13px; color: var(--amber-hi); }
.cr-pop { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-size: 18px; color: var(--amber-hi); text-shadow: 0 2px 0 #000; animation: crpop 1.5s forwards; pointer-events: none; }
@keyframes crpop { 0% { opacity: 0; transform: translate(-50%, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60px); } }
.hud-toast.info { border-color: #7bd389; color: #7bd389; }

/* Menú contextual del terreno */
.ctx-menu {
  position: fixed; z-index: 30; display: none; min-width: 250px; max-width: 320px; padding: 12px 14px;
  background: rgba(10,10,12,0.95); border: 1px solid var(--amber); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  pointer-events: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.ctx-menu.show { display: block; animation: fadeIn 0.12s ease-out; }
.ctx-title { font-family: var(--display); font-size: 17px; text-transform: uppercase; color: var(--amber-hi); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: baseline; }
.ctx-title small { font-family: var(--ui); font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.ctx-menu table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ctx-menu th { text-align: left; font-weight: 500; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; padding: 3px 10px 3px 0; white-space: nowrap; }
.ctx-menu td { padding: 3px 0; }
.ctx-menu td small { color: var(--muted); }
.ctx-menu .warn { color: #ff9a6a; }
.ctx-hint { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
.ctx-hint.muted { color: var(--muted); font-size: 14px; }
.ctx-hint-title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #7bd389; margin-bottom: 4px; }
.ctx-shot { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.ctx-shot .lbl { width: 76px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ctx-shot .val { flex: 1; font-size: 15px; }
.ctx-shot .val b { font-family: var(--display); color: var(--amber-hi); font-weight: 400; }
.ctx-hint small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

/* ─────────── Tienda de ejército ─────────── */
.army-screen { overflow-y: auto; }
.army-result { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: center; margin: -10px 0 14px; padding: 8px 16px; background: var(--panel); border: 1px solid var(--line); }
.ar-title { font-family: var(--display); font-size: 20px; text-transform: uppercase; }
.ar-income { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 16px; color: var(--muted); }
.ar-income b { color: #7bd389; }
.ar-total b { font-size: 18px; }
.army-layout { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.2fr); gap: 18px; width: min(1200px, 100%); align-items: start; }
.army-layout .panel { min-width: 0; padding: 18px 20px; }
.shop-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.shop-head .cmd-mini { margin: 0; }
.credits { text-align: right; }
.credits small { display: block; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.credits b { font-family: var(--display); font-size: 40px; color: var(--amber-hi); line-height: 1; }
.credits b::after { content: ' ¢'; font-size: 0.5em; color: var(--amber); }
.shop-preview { height: 170px; margin: 10px 0; background: radial-gradient(ellipse at 50% 70%, rgba(232,176,74,0.14), transparent 65%); border: 1px solid rgba(255,255,255,0.06); }
.shop-preview canvas { width: 100%; height: 100%; display: block; }
.shop-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shop-card { padding: 10px; border: 1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.35); display: flex; flex-direction: column; gap: 4px; }
.shop-card:hover { border-color: var(--amber); }
.sc-top { display: flex; justify-content: space-between; align-items: baseline; }
.sc-top b { font-family: var(--display); font-size: 18px; text-transform: uppercase; }
.price { font-family: var(--display); color: var(--amber-hi); font-size: 18px; }
.price::after { content: '¢'; font-size: 0.7em; margin-left: 1px; color: var(--amber); }
.sc-cls { color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-size: 12px; }
.sc-stats { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.sc-stats b { color: var(--text); }
.shop-card .btn { margin-top: 4px; padding: 6px 10px; font-size: 15px; }
.al-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.al-head b { font-family: var(--display); font-size: 20px; text-transform: uppercase; }
.al-count { color: var(--muted); letter-spacing: 0.15em; }
.al-empty { color: var(--muted); font-size: 17px; text-align: center; padding: 30px 10px; }
.al-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.07); }
.al-name { display: flex; align-items: center; gap: 6px; font-size: 17px; text-transform: uppercase; }
.al-name .sw { width: 10px; height: 10px; display: inline-block; }
.al-name small { color: var(--muted); }
.tag.new { font-size: 11px; letter-spacing: 0.1em; padding: 1px 5px; background: #7bd389; color: #111; }
.al-hp { display: flex; align-items: center; gap: 8px; }
.al-hp .bar { flex: 1; height: 8px; background: rgba(255,255,255,0.1); }
.al-hp .bar i { display: block; height: 100%; }
.al-hp small { color: var(--muted); min-width: 64px; text-align: right; }
.al-lv { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.al-lv .ars { color: #b9ae95; }
.al-btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.btn.mini { padding: 5px 10px; font-size: 13px; font-family: var(--ui); font-weight: 700; letter-spacing: 0.06em; }
.btn.mini b { color: inherit; margin-left: 4px; }
.btn.mini.ref { border-color: var(--red); color: var(--red); }
.btn.mini.ref:hover { background: var(--red); color: #fff; }
.totals { font-family: var(--display); font-size: 26px; margin: 0 0 8px; }

#toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 50; pointer-events: none; font-size: 20px; letter-spacing: 0.15em; text-transform: uppercase; background: var(--panel); border: 1px solid var(--red); color: var(--red); padding: 8px 18px; opacity: 0; transition: opacity 0.2s; }
#toast.show { opacity: 1; }

/* ─────────── Responsive ─────────── */
@media (max-width: 900px) {
  .format-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .format-card { padding: 10px 8px; gap: 6px; }
  .fm-desc { font-size: 12px; }
  .fm-unit i { width: 18px; height: 24px; }
}
@media (max-width: 900px) and (orientation: portrait) {
  .faction-cards { flex-direction: column; align-items: center; overflow-y: auto; }
  .faction-card { width: 100%; padding: 14px; }
  .fc-logo { width: 120px; }
  .fc-desc { display: none; }
  .vs-layout { grid-template-columns: 1fr; gap: 14px; overflow-y: auto; }
  .fighter { height: 34vh; }
  .fighter.right { display: none; }
  .cmd-grid { justify-self: center; }
  .tank-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .tank-stage { height: 34vh; }
}
@media (max-width: 900px) and (orientation: portrait) {
  .army-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sup-btn { font-size: 12px; padding: 0 8px; }
  .sp-ammo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hud-bottom { gap: 4px; padding: 6px; }
  .hud-who .pn { display: none; }
  .hud-ctl { padding: 0 3px; }
  .hud-ctl label { font-size: 10px; letter-spacing: 0.1em; }
  .hud-ctl button, .tank-sel button { width: 26px; height: 26px; font-size: 12px; }
  .fuel-bar { width: 48px; }
  .shop-cards { gap: 6px; }
  .shop-card { padding: 7px; }
  .sc-top b { font-size: 15px; }
  .minimap { width: 200px; height: 40px; }
  .tank-sel .tname { min-width: 80px; font-size: 12px; }
  .end-btn { font-size: 13px; padding: 0 10px; }
  .hud-who { min-width: 0; flex-shrink: 0; }
  .hud-ctl { flex-shrink: 1; min-width: 0; }
  .shop-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sc-top { flex-direction: column; align-items: flex-start; }
  .hud-who img { display: none; }
  .hud-keys { display: none; }
  .hud-ctl .wname { min-width: 90px; font-size: 14px; }
  .hud-ctl .val { min-width: 44px; font-size: 18px; }
  .fire-btn { font-size: 18px; padding: 0 14px; }
}
/* Móvil en horizontal / pantallas bajas */
@media (max-height: 560px) {
  .hud-team { top: 46px; gap: 4px; }
  .hud-cmd, .hud-team.duo .hud-cmd { width: 70px; }
  .hc-name { font-size: 11px; }
  .hc-fac, .hc-turn { font-size: 10px; }
  .faction-card { padding: 12px 14px; }
  .fc-logo { width: 120px; }
  .fc-short { font-size: 32px; margin-top: 8px; }
  .fc-desc { font-size: 13px; margin-top: 6px; }
  .fc-motto { font-size: 11px; }
  .logo { margin-bottom: 12px; }
  .logo h1 { font-size: 46px; }
  .logo .sub { margin-top: 6px; font-size: 12px; }
  .menu-item { padding-top: 5px; padding-bottom: 5px; font-size: 20px; }
  .hint { margin-top: 8px; font-size: 12px; }
  .screen-title { margin: 0 0 8px; font-size: 24px; }
  .select-screen { padding: 8px 12px; }
  .vs-layout { grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr); gap: 14px; }
  .fighter { height: 72vh; }
  .fighter .portrait-wrap { bottom: 64px; }
  .fighter .tagline { bottom: 70px; padding: 0 10px; }
  .fighter .name { font-size: 28px; }
  .fighter .perk { height: 58px; padding: 6px 10px; }
  .fighter .perk b { font-size: 13px; } .fighter .perk small { font-size: 12px; }
  .cmd-grid { grid-template-columns: repeat(8, 46px); gap: 4px; }
  .vs-layout { grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr); }
  .cmd-tile .tn { font-size: 8px; letter-spacing: 0.02em; }
  .tank-layout { gap: 14px; }
  .tank-stage { height: 56vh; }
  .tank-info.panel { padding: 12px 16px; }
  .tank-info .desc { font-size: 15px; margin-bottom: 8px; }
  .stat { margin-bottom: 6px; }
  .cmd-mini { margin-bottom: 6px; }
  .tank-cards { margin-top: 8px; }
  .tank-card { padding: 6px 14px; }
  .panel { padding: 16px 20px; }
  .opt-row { padding: 4px 12px; font-size: 16px; }
  .hud-bottom { padding: 6px; bottom: 6px; }
  .hud-who img { width: 34px; height: 44px; }
  .minimap { width: 180px; height: 34px; }
  .shop-preview { height: 110px; }
  .hd-text b { font-size: 15px; } .hd-text span { font-size: 12px; }
  .hud-deploy { padding: 6px 10px; gap: 8px; bottom: 6px; }
  .hud-deploy .btn { font-size: 13px; padding: 6px 12px; }
  .shop-preview { display: none; }
  .army-layout .panel { padding: 10px 12px; }
  .credits b { font-size: 28px; }
  .army-result { margin: 0 0 8px; padding: 4px 10px; }
  .ar-title { font-size: 15px; } .ar-income { font-size: 13px; }
  .al-row { padding: 6px 0; }
  .hud-keys { display: none; }
}

/* ═══════════════════ MODO DE JUEGO / CONQUISTA ═══════════════════ */
.mode-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 36px); width: min(900px, 100%); }
.mode-card { position: relative; padding: 30px 26px 26px; gap: 14px; }
.mode-card .fm-desc { max-width: 340px; font-size: 16px; }
.mode-ico { width: 120px; height: 90px; color: var(--amber); filter: drop-shadow(0 4px 0 #000); }
.mode-tag { position: absolute; top: 14px; right: 18px; font-size: 12px; letter-spacing: 0.25em; padding: 2px 8px; background: var(--amber); color: #111; font-weight: 700; }

/* Configurar conquista */
.conquest-setup { padding: 20px 24px; justify-content: flex-start; }
.conquest-setup .screen-title { margin: 0 0 14px; }
.cq-layout { display: grid; grid-template-columns: minmax(330px, 420px) minmax(0, 1fr); gap: 20px; width: min(1500px, 100%); flex: 1; min-height: 0; }
.cq-config { min-width: 0; max-width: none; padding: 14px 10px; overflow-y: auto; }
.cq-config .opt-row { padding: 5px 10px; font-size: 15px; gap: 10px; }
.cq-config .opt-val { gap: 6px; }
.cq-config .opt-val button { width: 24px; height: 24px; font-size: 11px; }
.cq-config .opt-val span { min-width: 150px; font-size: 15px; }
.seed-val { display: flex; align-items: center; gap: 6px; }
.seed-input { width: 150px; padding: 3px 8px; font: inherit; font-weight: 700; font-size: 17px; letter-spacing: 0.22em; text-align: center; text-transform: uppercase;
  background: rgba(0,0,0,0.5); border: 1px solid var(--line); color: var(--amber-hi); user-select: text; -webkit-user-select: text; }
.seed-input:focus { outline: none; border-color: var(--amber); }
.seed-dice { width: 30px; height: 30px; border: 1px solid var(--line); background: rgba(0,0,0,0.4); color: var(--amber); cursor: pointer; font-size: 17px; }
.seed-dice:hover { background: rgba(232,176,74,0.25); }
.cq-preview { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.cq-map { position: relative; flex: 1; min-height: 200px; border: 1px solid var(--line); background: #07101a; clip-path: var(--cut); }
.cq-map canvas, .cp-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cq-busy { position: absolute; top: 10px; right: 14px; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); opacity: 0; transition: opacity 0.15s; }
.cq-busy.on { opacity: 1; }
.cq-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cq-fstat { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: rgba(0,0,0,0.45); border-left: 3px solid var(--fc); }
.cq-fstat img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; }
.cq-fstat b { font-family: var(--display); color: var(--fc); font-size: 18px; font-weight: 400; margin-right: 8px; }
.cq-fstat span { display: block; font-size: 14px; color: var(--text); }
.cq-fstat span + span { color: var(--muted); }
.cq-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.lg-item { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 6px; }
.lg-item b { text-transform: uppercase; letter-spacing: 0.08em; color: var(--amber-hi); }
.lg-item small { grid-column: 2; color: var(--muted); max-width: 230px; line-height: 1.15; }
.lg-ico { grid-row: span 2; display: flex; }
.lg-front { grid-row: span 2; width: 20px; height: 4px; background: #f5dea0; box-shadow: 0 0 0 1px #000; }
.conquest-setup .btn-row { margin-top: 12px; }
.conquest-setup .hint { margin-top: 8px; }

/* Mapa de campaña */
.campaign-screen { background: #06080b; justify-content: flex-start; padding: 10px 14px; gap: 10px; }
.cp-top { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 22px; width: 100%; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); }
.cp-title { display: flex; align-items: center; gap: 10px; }
.cp-title img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.cp-title b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 0.06em; color: var(--amber); text-transform: uppercase; line-height: 1; }
.cp-title small { font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.cp-terr { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; max-width: 520px; width: 100%; justify-self: center; }
.cp-terr > span { font-family: var(--display); font-size: 18px; }
.cp-bar { display: flex; height: 10px; background: #222; border: 1px solid rgba(0,0,0,0.6); }
.cp-bar i { display: block; height: 100%; transition: width 0.4s; }
.cp-goal { grid-column: 1 / -1; text-align: center; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cp-money { text-align: right; }
.cp-money small { display: block; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.cp-money b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--amber-hi); margin-right: 6px; }
.cp-money span { color: #7bd389; font-weight: 700; }
.cp-menu { padding: 6px 16px; font-size: 15px; }
.cp-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; width: 100%; flex: 1; min-height: 0; }
.cp-map { position: relative; min-height: 0; border: 1px solid var(--line); background: #07101a; }
.cp-side { min-width: 0; max-width: none; padding: 14px 14px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; clip-path: none; }
.ri-empty { color: var(--muted); font-size: 15px; line-height: 1.35; margin: 0; }
.ri-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--fc); padding-bottom: 4px; margin-bottom: 8px; }
.ri-head b { font-family: var(--display); font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; }
.ri-head span { font-family: var(--display); color: var(--fc); }
.ri-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 15px; }
.ri-grid span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; align-self: center; }
.ri-grid b { color: var(--amber-hi); }
.ri-sp { margin: 8px 0 0; font-size: 14px; color: var(--text); opacity: 0.85; line-height: 1.3; }
.ri-armies { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.ri-armies small { color: var(--muted); }
.ri-army { font-weight: 700; font-size: 14px; letter-spacing: 0.08em; padding: 2px 8px; border-left: 3px solid var(--fc); background: rgba(255,255,255,0.05); }
.ri-sel { margin-top: 12px; padding: 10px; background: rgba(232,176,74,0.08); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.ri-sel b { font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--amber); }
.ri-sel .ok { color: #7bd389; } .ri-sel .bad { color: #ff7a63; }
.ri-sel small { color: var(--muted); margin-top: 4px; }
.cp-h { font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cp-alist { display: flex; flex-direction: column; gap: 4px; }
.cp-army { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 1px solid transparent; background: rgba(255,255,255,0.03); cursor: pointer; text-align: left; }
.cp-army img { width: 38px; height: 38px; object-fit: cover; object-position: top; border-radius: 50%; border: 2px solid var(--line); }
.cp-army b { display: block; letter-spacing: 0.08em; }
.cp-army small { color: var(--muted); font-size: 13px; }
.cp-army:hover, .cp-army.sel { border-color: var(--amber); background: rgba(232,176,74,0.1); }
.cp-bottom { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.cp-bottom .hint { margin: 0; }
.cp-confirm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); z-index: 5; }
.cp-confirm p { font-size: 20px; text-align: center; margin: 0; }

@media (max-width: 1000px) and (orientation: landscape) {
  .cq-layout { grid-template-columns: 290px minmax(0, 1fr); gap: 10px; }
  .cq-config .opt-row { font-size: 13px; padding: 3px 6px; }
  .cq-config .opt-val span { min-width: 104px; font-size: 13px; }
  .seed-input { width: 104px; font-size: 14px; }
  .cp-body { grid-template-columns: minmax(0, 1fr) 220px; }
  .cp-side { padding: 10px; }
  .cp-money { display: none; }
  .cp-top { grid-template-columns: auto 1fr auto; gap: 10px; }
}
@media (max-height: 640px) {
  .cq-legend { display: none; }
  .conquest-setup { padding: 8px 12px; }
  .conquest-setup .screen-title { margin-bottom: 6px; }
  .conquest-setup .btn-row { margin-top: 6px; }
  .conquest-setup .btn { padding: 6px 16px; font-size: 15px; }
  .cq-fstat { padding: 3px 8px; } .cq-fstat img { width: 28px; height: 28px; }
  .cp-title img { display: none; }
  .ri-sp { display: none; }
}
@media (max-width: 1000px) and (orientation: portrait) {
  .cq-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .cq-map { min-height: 46vw; }
  .cp-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .cp-side { max-height: 34vh; }
  .cp-top { grid-template-columns: auto 1fr auto; gap: 10px; }
  .cp-money { display: none; }
}
@media (max-width: 700px) {
  .mode-cards { grid-template-columns: 1fr; }
  .cq-stats { grid-template-columns: 1fr; }
  .cp-goal { display: none; }
}

/* ─────────── Conquista: elegir comandantes ─────────── */
.cqc-screen { justify-content: flex-start; }
.cqc-layout { display: grid; grid-template-columns: minmax(200px, 270px) auto minmax(200px, 270px); gap: clamp(12px, 2.5vw, 34px); align-items: start; flex: 1; min-height: 0; }
.cqc-col { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; }
.cqc-h { font-family: var(--display); font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }
.cqc-slots { display: flex; flex-direction: column; gap: 6px; }
.cqc-slot { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.08); border-left: 3px solid rgba(255,255,255,0.15); }
.cqc-slot.mine.filled { border-left-color: var(--pc, var(--amber)); }
.cqc-screen .cqc-slot.mine.filled { border-left-color: var(--amber); }
.cqc-slot.enemy.filled { border-left-color: var(--red); }
.cqc-slot.next { border-color: var(--amber); box-shadow: 0 0 14px rgba(232,176,74,0.3); }
.cqc-slot.pop { animation: cqcPop 0.35s ease-out; }
@keyframes cqcPop { 0% { transform: scale(1.08); background: rgba(208,64,46,0.35); } 100% { transform: none; } }
.cqc-por { width: 46px; height: 46px; flex: none; overflow: hidden; background: #111; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.cqc-por img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.cqc-por span { font-family: var(--display); color: var(--muted); font-size: 20px; }
.cqc-si { min-width: 0; display: flex; flex-direction: column; }
.cqc-si b { font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: 0.04em; }
.cqc-si small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cqc-tag { align-self: flex-start; margin-top: 2px; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; padding: 0 6px; background: #7bd389; color: #111; font-weight: 700; }
.cqc-center { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cqc-detail { min-width: 0; width: 100%; max-width: 460px; padding: 10px 16px; clip-path: none; }
.cqc-detail b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--amber); text-transform: uppercase; }
.cqc-detail small { color: var(--amber-hi); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.cqc-detail p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.cqc-screen .cmd-tile.locked { border-color: var(--amber); filter: none; }
.cqc-screen .cmd-tile.locked::after { content: attr(data-n); position: absolute; top: 3px; left: 5px; font-family: var(--display); font-size: 15px; color: #111; background: var(--amber); padding: 0 6px; }
.cqc-screen .cmd-tile.sel:not(.locked)::after { content: '+'; }
.cmd-tile.cpu-roll { border-color: var(--ec, var(--red)); filter: none; transform: scale(1.05); }

/* ─────────── Conquista: campaña ─────────── */
.cp-phase { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 4px 16px; font-family: var(--display); font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(0,0,0,0.75); border: 1px solid var(--fc); color: var(--fc); pointer-events: none; }
.cp-banner { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); min-width: min(440px, 90%); max-width: 92%; padding: 10px 18px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  background: rgba(8,8,10,0.9); border: 1px solid var(--line); cursor: pointer; animation: fadeIn 0.25s; }
.cp-banner b { font-family: var(--display); font-weight: 400; font-size: 22px; text-transform: uppercase; color: var(--amber); }
.cp-banner b.ok { color: #7bd389; } .cp-banner b.bad { color: #ff7a63; }
.cp-banner span { font-size: 17px; }
.cp-banner small { color: var(--muted); font-size: 13px; }
.cp-banner small.bad { color: #ff7a63; }
.cp-banner i { color: var(--amber); font-style: normal; }
.ri-sel { margin: 0 0 12px; }
.ri-selh { display: flex; justify-content: space-between; align-items: baseline; }
.ri-selh span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.ri-units { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.ri-unit { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; font-size: 14px; }
.ri-unit small { color: var(--amber); }
.ri-unit .bar { height: 6px; background: #222; display: block; }
.ri-unit .bar i { display: block; height: 100%; }
.ri-help { color: var(--text) !important; opacity: 0.8; }
.cp-shop { margin-top: 6px; align-self: flex-start; }
.btn.mini { padding: 4px 12px; font-size: 13px; }
.cp-army.acted { opacity: 0.55; }
.cp-army.ally { cursor: default; }
.cp-army > div { flex: 1; }
.cp-done { color: #7bd389; font-style: normal; font-weight: 700; }
.cp-logw { margin-top: auto; }
.cp-log { display: flex; flex-direction: column; gap: 3px; font-size: 13px; max-height: 170px; overflow-y: auto; }
.lg-line small { color: var(--muted); margin-right: 4px; }
.cp-end.sel { animation: endPulse 1.4s ease-in-out infinite; }
@keyframes endPulse { 50% { box-shadow: 0 0 18px rgba(232,176,74,0.7); } }
.cp-dialog { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.62); z-index: 6; padding: 12px; }
.bd { max-width: min(860px, 96vw); width: 100%; padding: 20px 24px; max-height: 96%; overflow-y: auto; }
.bd h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 32px); color: var(--amber); text-transform: uppercase; text-align: center; letter-spacing: 0.04em; }
.bd-sub { text-align: center; color: var(--muted); margin: 4px 0 14px; font-size: 15px; }
.bd-sub b { color: var(--amber-hi); }
.bd-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; }
.bd-vs { font-family: var(--display); font-size: 34px; color: var(--amber); align-self: center; text-shadow: 0 3px 0 #000; }
.bd-side { display: flex; flex-direction: column; gap: 6px; }
.bd-fh { font-family: var(--display); color: var(--fc); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 2px solid var(--fc); padding-bottom: 3px; }
.bd-army { display: flex; align-items: center; gap: 10px; padding: 5px; background: rgba(255,255,255,0.04); border-left: 3px solid var(--fc); }
.bd-army.sup { background: rgba(123,211,137,0.1); }
.bd-army img { width: 44px; height: 44px; object-fit: cover; object-position: 50% 12%; flex: none; }
.bd-army b { display: block; letter-spacing: 0.08em; }
.bd-army small { color: var(--muted); font-size: 13px; }
.bd-ch { margin-top: 6px; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.bd-cand { text-align: left; padding: 5px 10px; border: 1px dashed var(--line); background: transparent; cursor: pointer; color: var(--text); font-weight: 700; letter-spacing: 0.06em; }
.bd-cand small { color: var(--muted); font-weight: 500; }
.bd-cand.on { border-style: solid; border-color: #7bd389; color: #7bd389; }
.bd-cand:disabled { opacity: 0.35; cursor: not-allowed; }
.bd-odds { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 16px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.bd-odds b { font-size: 18px; color: var(--amber-hi); }
.bd-bar { display: flex; height: 10px; background: #222; }
.bd-bar i { display: block; height: 100%; }
.cp-over { text-align: center; max-width: 520px; }
.cp-reason { color: var(--text); font-size: 18px; margin: 0 0 12px; }
.cp-stats { max-width: 300px; margin: 0 auto; text-align: left; }

@media (max-width: 1000px) and (orientation: portrait) {
  .cqc-layout { grid-template-columns: 1fr; width: 100%; }
  .cqc-col { order: 2; }
  .cqc-center { order: 1; }
}
@media (max-width: 1000px) {
  .bd-sides { grid-template-columns: 1fr; }
  .bd-vs { justify-self: center; font-size: 24px; }
}
@media (max-height: 640px) {
  .cqc-detail { display: none; }
  .cqc-por { width: 34px; height: 34px; }
  .cp-log { max-height: 90px; }
  .bd { padding: 12px 16px; }
}

/* ─────────── Conquista: reclutamiento ─────────── */
.ri-rec { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 4px; }
.ri-rec .btn { align-self: flex-start; }
.ri-rec small { color: var(--muted); font-size: 13px; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; }
.rc-card { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto 1fr; column-gap: 8px; text-align: left; padding: 6px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--text); }
.rc-card img { grid-row: span 3; width: 52px; height: 52px; object-fit: cover; object-position: 50% 12%; }
.rc-card b { font-family: var(--display); font-weight: 400; font-size: 15px; letter-spacing: 0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-card > * { min-width: 0; }
.rc-card small { color: var(--amber-hi); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.rc-card span { color: var(--muted); font-size: 12px; line-height: 1.2; }
.rc-card:hover { border-color: var(--amber); background: rgba(232,176,74,0.12); }

/* ─────────── Conquista: guardado y cooperativo ─────────── */
.cq-load { min-width: min(720px, 92vw); }
.load-item { padding-top: 8px; padding-bottom: 8px; }
.ld-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-name { line-height: 1; }
.sl-txt { font-family: var(--ui); font-size: 15px; letter-spacing: 0.04em; text-transform: none; color: var(--text); opacity: 0.85; }
.sl-txt b { font-weight: 700; color: var(--amber-hi); }
.sl-txt small { color: var(--muted); margin-left: 6px; }
.sl-empty { color: var(--muted); font-style: normal; }
.load-item.empty { opacity: 0.5; }
.ld-del { margin-left: auto; font-family: var(--ui); font-size: 14px; padding: 2px 10px; border: 1px solid var(--line); color: var(--muted); }
.ld-del:hover, .ld-confirm .ld-del { color: #fff; background: var(--red); border-color: var(--red); }
.cp-menu-panel { min-width: min(520px, 92vw); text-align: center; }
.cp-menu-panel h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--amber); text-transform: uppercase; }
.cp-msub { color: var(--muted); margin: 4px 0 14px; }
.cp-menu-panel .menu-list { min-width: 0; }
.cp-menu-panel .menu-item { font-size: clamp(17px, 2vw, 22px); }
.slot-item .sl-txt { font-size: 14px; }
.cqc-ptag { margin-top: 3px; align-self: flex-start; font-family: var(--display); font-size: 12px; padding: 0 8px; border: 0; background: var(--amber); color: #111; }
.cqc-ptag.p2 { background: #7bd389; }
.cqc-ptag.manual { cursor: pointer; box-shadow: 0 0 0 1px #fff inset; }
.cqc-ptag.manual::after { content: ' ⇄'; }
.cp-army.other { opacity: 0.6; cursor: default; }
.cp-army.p2 img { border-color: #7bd389; }

/* ═══════════ v0.8 · Diálogo de batalla con retratos grandes ═══════════ */
.bd2 { max-width: min(1180px, 97vw); padding: 18px 22px; }
.bd-arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: start; }
.bd-team { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bd-team.theirs .bd-fh { flex-direction: row-reverse; text-align: right; }
.bd-fh { display: flex; align-items: center; gap: 8px; }
.bd-fh img { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; }
.bd-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.bd-team.theirs .bd-cards { justify-content: flex-end; }
.bd-card { position: relative; width: clamp(130px, 14vw, 180px); display: flex; flex-direction: column; background: rgba(0,0,0,0.55); border: 2px solid var(--fc); clip-path: var(--cut); }
.bd-card.sup { border-color: #7bd389; cursor: pointer; }
.bd-por { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #111; }
.bd-por img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.bd-card.garrison .bd-por img { object-fit: contain; padding: 14%; object-position: center; }
.bd-por::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.92)); }
.bd-cn { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 1; padding: 0 8px; }
.bd-cn b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(16px, 1.6vw, 21px); line-height: 1; text-shadow: 0 2px 0 #000; }
.bd-cn small { color: var(--amber-hi); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.bd-units { padding: 5px 8px 3px; font-size: 12px; color: var(--muted); min-height: 34px; line-height: 1.25; }
.bd-hp { height: 5px; background: #222; margin: 0 8px 8px; }
.bd-hp i { display: block; height: 100%; }
.bd-tag { position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; padding: 1px 6px; background: #7bd389; color: #111; font-weight: 700; }
.bd-cands { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-cand { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px dashed var(--line); background: transparent; cursor: pointer; color: var(--text); text-align: left; }
.bd-cand img { width: 40px; height: 40px; object-fit: cover; object-position: 50% 12%; }
.bd-cand b { display: block; letter-spacing: 0.06em; color: #7bd389; }
.bd-cand small { color: var(--muted); }
.bd-cand:hover:not(:disabled) { border-style: solid; border-color: #7bd389; background: rgba(123,211,137,0.08); }
.bd-mid { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 40px; min-width: 120px; }
.bd-mid .bd-vs { font-size: 46px; }
.bd-pct { display: flex; flex-direction: column; align-items: center; width: 110px; height: 110px; justify-content: center; border-radius: 50%;
  background: radial-gradient(closest-side, #0b0b0d 78%, transparent 80% 100%), conic-gradient(var(--amber) calc(var(--p) * 1%), rgba(255,255,255,0.1) 0); }
.bd-pct b { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--amber-hi); line-height: 1; }
.bd-pct small { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: center; max-width: 80px; }
.bd-mid .bd-bar { width: 120px; }

/* ═══════════ Informe de fin de batalla ═══════════ */
.rs { position: relative; width: min(1180px, 97vw); max-height: 96%; overflow-y: auto; padding: 18px 24px 22px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,176,74,0.18), transparent 60%), rgba(8,8,10,0.94); border: 1px solid var(--line); clip-path: var(--cut); animation: rsIn 0.4s ease-out; }
.rs-lose { background: radial-gradient(ellipse at 50% 0%, rgba(217,83,79,0.22), transparent 60%), rgba(8,8,10,0.94); }
@keyframes rsIn { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.rs-head small { font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.rs-head h2 { margin: 2px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(42px, 6vw, 76px); line-height: 1; letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff1c9, var(--amber) 55%, #a3451d); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #000); }
.rs-lose .rs-head h2 { background: linear-gradient(180deg, #ffd0c8, #d9534f 55%, #6b1512); -webkit-background-clip: text; background-clip: text; }
.rs-head p { margin: 4px 0 14px; font-size: 19px; }
.rs-arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
.rs-mid { font-family: var(--display); font-size: 40px; color: var(--muted); align-self: center; }
.rs-label { font-family: var(--display); font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fc); border-bottom: 2px solid var(--fc); padding-bottom: 4px; margin-bottom: 10px; }
.rs-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.rs-card { width: clamp(140px, 15vw, 200px); background: rgba(0,0,0,0.5); border: 2px solid var(--fc); clip-path: var(--cut); text-align: left; }
.rs-card.won { box-shadow: 0 0 40px rgba(232,176,74,0.35); border-color: var(--amber); animation: rsGlow 2s ease-in-out infinite; }
@keyframes rsGlow { 50% { box-shadow: 0 0 60px rgba(232,176,74,0.6); } }
.rs-por { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #111; }
.rs-por img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.rs-card.lost .rs-por img { filter: grayscale(1) brightness(0.55) contrast(1.1); }
.rs-por::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.92)); }
.rs-name { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 1; padding: 0 10px; }
.rs-name b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(18px, 1.8vw, 24px); line-height: 1; text-shadow: 0 2px 0 #000; }
.rs-name small { color: var(--fc); font-weight: 700; letter-spacing: 0.1em; }
.rs-crown { position: absolute; top: 6px; right: 8px; z-index: 2; font-size: 30px; color: #ffd27a; text-shadow: 0 0 12px rgba(255,200,90,0.9), 0 2px 0 #000; }
.rs-stamp { position: absolute; top: 38%; left: 50%; z-index: 2; transform: translate(-50%, -50%) rotate(-14deg); padding: 4px 12px; white-space: nowrap;
  font-family: var(--display); font-size: clamp(15px, 1.6vw, 21px); letter-spacing: 0.08em; text-transform: uppercase; color: #ff6b5a; border: 3px solid #ff6b5a; background: rgba(0,0,0,0.45); }
.rs-card.dead .rs-stamp { color: #fff; background: rgba(217,83,79,0.85); border-color: #fff; }
.rs-stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 8px 10px 10px; font-size: 13px; }
.rs-stats span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; align-self: center; }
.rs-stats b { color: var(--text); text-align: right; }
.rs-stats em { color: #ff7a63; font-style: normal; }
.rs-cred { margin-top: 10px; font-family: var(--display); font-size: 20px; color: #7bd389; }
@media (max-width: 800px) { .rs-arena, .bd-arena { grid-template-columns: 1fr; } .rs-mid, .bd-mid { padding-top: 0; } .bd-team.theirs .bd-cards { justify-content: flex-start; } }

/* ═══════════ Punto 2: columna de parámetros más ancha y alineada ═══════════ */
.cq-layout { grid-template-columns: minmax(470px, 540px) minmax(0, 1fr); }
.cq-config .opt-row { grid-template-columns: minmax(0, 1fr) auto; }
.cq-config .opt-row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cq-config .opt-val span { width: 230px; min-width: 230px; white-space: nowrap; }
.seed-input { width: 230px; }
.seed-val { gap: 6px; }

/* ═══════════ Punto 5: ficha de la región con alto fijo (evita el bucle al pasar el ratón) ═══════════ */
.cp-side { overflow: hidden; }
.cp-info { flex: none; height: 300px; overflow-y: auto; }
.cp-armies { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cp-logw { flex: none; }
@media (max-width: 1150px) {
  .cq-layout { grid-template-columns: minmax(360px, 400px) minmax(0, 1fr); }
  .cq-config .opt-val span { width: 160px; min-width: 160px; font-size: 13px; }
  .seed-input { width: 160px; }
}
@media (max-width: 1000px) and (orientation: portrait) { .cq-layout { grid-template-columns: 1fr; } }

/* ═══════════ Clima y hora en el HUD ═══════════ */
.hud-chip-row { display: flex; gap: 6px; justify-content: center; }
.hud-chip.env { display: flex; align-items: center; gap: 8px; }
.hud-chip.env .wx-ico { font-size: 17px; letter-spacing: 0; }
.hud-chip.env .wx-name { font-size: 13px; color: var(--muted); }
.hud-chip.env .dn { color: var(--amber-hi); letter-spacing: 0; }
@media (max-width: 900px) { .hud-chip.env .wx-name { display: none; } }

/* ═══════════ Barras de desplazamiento con estilo propio ═══════════ */
* { scrollbar-width: thin; scrollbar-color: #a3762f rgba(0,0,0,0.35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.35); border-left: 1px solid rgba(232,176,74,0.12); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #e8b04a, #a3451d); border: 1px solid rgba(0,0,0,0.6); }
::-webkit-scrollbar-thumb:hover { background: var(--amber-hi); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* Selección de comandantes: sin scroll (las columnas caben enteras) */
.cqc-col { overflow: visible; }
.cqc-layout { overflow: visible; }
.cqc-slots { gap: 5px; }
.cqc-slot { padding: 4px 8px 4px 4px; }
.cqc-slot.pop { animation: cqcPopFlat 0.35s ease-out; }
@keyframes cqcPopFlat { 0% { background: rgba(208,64,46,0.4); box-shadow: 0 0 18px rgba(208,64,46,0.6); } 100% { background: rgba(0,0,0,0.45); box-shadow: none; } }

@media (max-width: 1100px) and (orientation: landscape) {
  .cqc-layout { grid-template-columns: minmax(170px, 230px) auto minmax(170px, 230px); gap: 12px; }
  .cqc-por { width: 38px; height: 38px; }
  .cqc-si b { font-size: 15px; }
  .cqc-si small { font-size: 12px; }
  .cqc-detail { padding: 6px 12px; }
  .cqc-detail b { font-size: 16px; }
}
@media (max-height: 720px) {
  .cqc-screen .btn-row { margin-top: 8px; }
  .cqc-screen .hint { margin-top: 6px; font-size: 12px; }
  .cqc-detail p { display: none; }
  .cqc-center { gap: 6px; }
}
@media (max-height: 600px) { .cqc-detail { display: none; } }

/* Diálogos: nunca scroll horizontal; fin de campaña con el título a medida */
.bd, .rs, .cp-dialog .panel, .cp-confirm .panel { overflow-x: hidden; }
.cp-over { max-width: min(720px, 94vw); width: auto; min-width: min(520px, 94vw); overflow: hidden; }
.cp-over .big-result { font-size: clamp(36px, 6vw, 76px); white-space: nowrap; line-height: 1.05; }

/* ═══════════ Tienda con pestañas por categoría ═══════════ */
.shop-preview { position: relative; }
.shop-desc { position: absolute; left: 10px; top: 8px; right: 40%; display: flex; flex-direction: column; gap: 1px; pointer-events: none; }
.shop-desc b { font-family: var(--display); font-weight: 400; font-size: 20px; text-transform: uppercase; color: var(--amber-hi); text-shadow: 0 2px 0 #000; }
.shop-desc small { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.shop-desc span { font-size: 13px; color: var(--text); opacity: 0.85; line-height: 1.25; }
.shop-tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.shop-tab { flex: 1; padding: 7px 6px; border: 1px solid transparent; border-bottom: 0; background: rgba(0,0,0,0.3); color: var(--muted); cursor: pointer;
  font: 700 13px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 100%, 0 100%); }
.shop-tab:hover { color: var(--text); }
.shop-tab.on { background: rgba(232,176,74,0.16); color: var(--amber-hi); border-color: var(--line); }
.shop-tab i { font-style: normal; font-size: 11px; padding: 0 5px; margin-left: 4px; background: var(--amber); color: #111; }
.shop-cards { max-height: 330px; overflow-y: auto; align-content: start; }
.sc-desc { margin: 2px 0 4px; font-size: 12px; color: var(--muted); line-height: 1.2; min-height: 2.4em; }
.dmg-pop.heal { color: #7bd389; }
@media (max-height: 760px) { .shop-cards { max-height: 230px; } .sc-desc { display: none; } }
.dmg-pop.dodge { color: #ffd27a; font-size: 20px; }

/* ═══════════ Parrilla de comandantes ampliada (más de 16) ═══════════ */
.cmd-grid.many { grid-template-columns: repeat(7, clamp(46px, min(5vw, 8.4vh), 88px)); gap: 6px; padding: 6px;
  max-height: calc(100vh - 220px); overflow-y: auto; overflow-x: hidden; align-content: start; }
.cmd-grid.many .cmd-tile .tn { font-size: 10px; letter-spacing: 0.04em; padding: 2px 0; }
.cmd-grid.many .cmd-tile { clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.cmd-grid.many .cmd-tile.sel, .cmd-grid.many .cmd-tile.cpu-pick { transform: scale(1.05); }
.cqc-screen .cmd-grid.many { max-height: calc(100vh - 300px); }
.cqc-screen .cmd-grid.many .cmd-tile.locked::after { font-size: 12px; padding: 0 4px; }
@media (max-width: 1100px) { .cmd-grid.many { grid-template-columns: repeat(7, clamp(40px, 5.4vw, 70px)); } }
@media (max-width: 900px) and (orientation: portrait) { .cmd-grid.many { grid-template-columns: repeat(6, 1fr); width: 100%; } }
.cmd-grid.many .cmd-tile .tn { letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: clip; }
@media (max-width: 1100px) { .cmd-grid.many .cmd-tile .tn { font-size: 9px; } }
.cqc-screen .cmd-grid.many { grid-template-columns: repeat(7, clamp(42px, min(4.6vw, 7.2vh), 82px)); gap: 5px; max-height: calc(100vh - 280px); }

/* v0.14 · selección de comandantes con muchos ejércitos (hasta 12 por facción) */
.cqc-slots.dense { gap: 3px; max-height: calc(100vh - 230px); overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.cqc-slots.dense .cqc-slot { padding: 2px 6px 2px 2px; gap: 7px; }
.cqc-slots.dense .cqc-por { width: 30px; height: 30px; }
.cqc-slots.dense .cqc-por span { font-size: 15px; }
.cqc-slots.dense .cqc-si b { font-size: 14px; line-height: 1.05; }
.cqc-slots.dense .cqc-si small { font-size: 11px; line-height: 1.1; }
.cqc-slots.dense .cqc-ptag, .cqc-slots.dense .cqc-tag { font-size: 10px; padding: 0 4px; }
/* v0.14 · más opciones de conquista: filas más compactas para que quepan sin scroll */
.cq-config { padding: 10px 10px; }
.cq-config .opt-row { padding: 3px 10px; min-height: 0; }
.cq-config .opt-val button { width: 22px; height: 22px; }
@media (max-height: 820px) {
  .cq-config .opt-row { padding: 2px 8px; font-size: 14px; }
  .cq-config .opt-val span { font-size: 14px; }
  .cq-config .opt-val button { width: 20px; height: 20px; }
}

/* ═══════════ v0.15 · Tienda más grande, sin scroll horizontal y con venta ═══════════ */
.army-layout { width: min(1500px, 100%); grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.shop-head .cmd-mini img { width: 84px; height: 112px; }
.shop-head .cmd-mini b { font-size: 26px; }
.shop-head .cmd-mini small { font-size: 13px; }
.shop-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-x: hidden; max-height: max(260px, calc(100vh - 500px)); padding-right: 4px; }
.shop-card { padding: 12px 14px; min-width: 0; gap: 5px; }
.sc-top { gap: 8px; flex-wrap: wrap; }
.sc-top b { font-size: 22px; }
.sc-top .price { font-size: 20px; }
.sc-cls { font-size: 13px; }
.sc-stats { font-size: 15px; flex-direction: row; flex-wrap: wrap; gap: 2px 14px; }
.sc-desc { font-size: 14px; min-height: 0; }
.shop-card .btn { font-size: 16px; padding: 7px 12px; align-self: flex-start; min-width: 50%; }
.shop-preview { height: 190px; }
.shop-desc b { font-size: 24px; }
.shop-desc span { font-size: 14px; }
.shop-tab { font-size: 14px; padding: 8px 6px; }
.btn.mini.sell { border-color: rgba(217,83,79,0.5); color: #e8a09d; }
.btn.mini.sell.arm { background: #a33a36; color: #fff; border-color: #d9534f; }
@media (max-height: 760px) { .shop-cards { max-height: max(220px, calc(100vh - 440px)); } .shop-preview { height: 140px; } .shop-head .cmd-mini img { width: 60px; height: 80px; } }
@media (max-width: 900px) { .shop-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sc-top { flex-direction: row; } }
/* la vista 3D pasa a la columna derecha: la tienda tiene más alto para las fichas */
.army-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.army-side .shop-preview.panel { margin: 0; padding: 0; height: 220px; }
.shop-head { margin-bottom: 12px; }
.shop-cards { max-height: max(240px, calc(100vh - 400px)); }
@media (max-height: 760px) { .shop-cards { max-height: max(200px, calc(100vh - 330px)); } .army-side .shop-preview.panel { height: 150px; } .sc-desc { display: block; } }
.dmg-pop.intercept { color: #9ff0a8; font-size: 20px; }
/* Solución de tiro por niveles de precisión */
.ctx-lvls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.ctx-lvls .ctx-calc { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; height: auto; line-height: 1.1; }
.ctx-lvls .ctx-calc span { font-size: 12px; letter-spacing: 0.06em; }
.ctx-lvls .ctx-calc small { margin: 0; font-size: 10px; color: inherit; opacity: 0.75; }
.ctx-lvls .ctx-calc b { font-size: 14px; }

/* ═══════════ Ficha de unidad en batalla (debajo de los retratos) ═══════════ */
.hud-unit { position: absolute; top: 260px; width: clamp(190px, 14vw, 240px); padding: 8px 10px 9px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--pc, var(--amber)); pointer-events: none; opacity: 0; transition: opacity 0.2s; font-size: 12px; color: var(--text); }
.hud-unit.show { opacity: 1; }
.hud-unit.left { left: 14px; }
.hud-unit.right { right: 14px; border-left: 1px solid var(--line); border-right: 3px solid var(--pc, var(--amber)); }
.hu-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hu-head b { font-family: var(--display); font-weight: 400; font-size: 18px; text-transform: uppercase; color: var(--pc); line-height: 1; }
.hu-head small { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.hu-tag { margin-left: auto; font-style: normal; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; padding: 1px 5px; background: var(--amber); color: #111; }
.hu-hp, .hu-sh { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.hu-sh { margin-top: 3px; }
.hu-hp .bar, .hu-sh .bar { flex: 1; height: 7px; background: rgba(255,255,255,0.1); }
.hu-sh .bar { height: 4px; }
.hu-hp .bar i, .hu-sh .bar i { display: block; height: 100%; }
.hu-sh .bar i { background: #6fc3ff; }
.hu-hp b { font-family: var(--display); font-weight: 400; font-size: 14px; min-width: 58px; text-align: right; }
.hu-sh small { color: #9fd6ff; font-size: 10px; min-width: 58px; text-align: right; }
.hu-stats { width: 100%; margin-top: 6px; border-collapse: collapse; }
.hu-stats th { text-align: left; font-weight: 400; color: var(--muted); padding: 1px 0; }
.hu-stats td { text-align: right; padding: 1px 0; }
.hu-wpn { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,0.08); color: var(--muted); font-size: 11px; }
.hu-wpn .on { color: var(--amber-hi); }
.hu-abil { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; font-size: 11px; color: #c8bfa8; }
.hu-abil .ok { color: #9ff0a8; }
.hu-abil .off { color: #e8a09d; }
@media (max-height: 640px) { .hud-unit { display: none; } }
/* Despliegue: selector de la unidad a colocar */
.hd-units { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
.hd-units:empty { display: none; }
.hd-u { padding: 4px 9px; font: 700 12px var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15); cursor: pointer; }
.hd-u:hover { color: var(--text); border-color: var(--amber); }
.hd-u.on { color: #111; background: var(--amber); border-color: var(--amber); }

/* ═══════════ v0.15 · Retratos más grandes (selección de comandantes y reclutamiento) ═══════════ */
.cmd-grid.many { grid-template-columns: repeat(6, clamp(70px, 7vw, 124px)); gap: 8px; max-height: calc(100vh - 230px); overflow-y: auto; overflow-x: hidden; }
.cmd-grid.many .cmd-tile .tn { font-size: 12px; padding: 3px 0; }
.cqc-screen .cmd-grid.many { grid-template-columns: repeat(6, clamp(64px, 6.4vw, 116px)); gap: 7px; max-height: calc(100vh - 290px); padding-right: 6px; }
@media (max-width: 1100px) { .cmd-grid.many, .cqc-screen .cmd-grid.many { grid-template-columns: repeat(5, clamp(56px, 8vw, 96px)); } .cmd-grid.many .cmd-tile .tn { font-size: 10px; } }
@media (max-width: 900px) and (orientation: portrait) { .cmd-grid.many, .cqc-screen .cmd-grid.many { grid-template-columns: repeat(5, 1fr); width: 100%; } }
.panel.bd.rc-dlg { width: min(1240px, 96vw); max-width: none; }
.rc-dlg .rc-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 64vh; padding-right: 6px; }
.rc-dlg .rc-card { grid-template-columns: 90px 1fr; column-gap: 12px; padding: 8px; }
.rc-dlg .rc-card img { width: 90px; height: 120px; }
.rc-dlg .rc-card b { font-size: 20px; }
.rc-dlg .rc-card small { font-size: 12px; margin: 2px 0 4px; }
.rc-dlg .rc-card span { font-size: 13px; line-height: 1.3; }
.cmd-grid.many { max-height: calc(100vh - 310px); }
.cqc-screen .cmd-grid.many { max-height: calc(100vh - 345px); }
.select-screen:not(.cqc-screen) .cmd-grid.many { max-height: calc(100vh - 210px); }
.hd-text b { white-space: nowrap; }
.army-note { margin: -6px 0 12px; padding: 6px 14px; border: 1px solid var(--red); background: rgba(160,40,30,0.25); color: #ffb3a8; letter-spacing: 0.06em; font-size: 15px; }
/* Refuerzo de emergencia en el diálogo de defensa */
.bd-card { position: relative; }
.bd-reinf { position: absolute; top: 6px; right: 6px; z-index: 3; padding: 3px 8px; font: 700 11px var(--ui); letter-spacing: 0.08em; text-transform: uppercase;
  color: #111; background: var(--amber); border: 0; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.bd-reinf:hover { background: var(--amber-hi); }
/* Lupa del diálogo de batalla */
.bd-look { vertical-align: middle; margin-left: 10px; width: 38px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer;
  background: rgba(0,0,0,0.4); border: 1px solid var(--amber); color: var(--amber-hi); }
.bd-look:hover { background: rgba(232,176,74,0.2); }
.cp-lookbar { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 10px 14px 10px 20px; background: var(--panel); border: 1px solid var(--red); box-shadow: 0 6px 24px rgba(0,0,0,0.6); }
.cp-lookbar span { font-family: var(--display); font-size: 20px; letter-spacing: 0.05em; text-transform: uppercase; color: #ff9a8a; }
/* Guarnición de origen como refuerzo del ataque */
.bd-garpick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.bd-gp { padding: 6px 12px; font: 700 13px var(--ui); letter-spacing: 0.06em; color: var(--muted); background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.18); cursor: pointer; }
.bd-gp small { opacity: 0.75; font-size: 11px; }
.bd-gp:hover { color: var(--text); border-color: var(--amber); }
.bd-gp.on { color: #111; background: var(--amber); border-color: var(--amber); }
.bd-garwarn { display: block; margin-top: 6px; color: #e8a09d; font-size: 12px; }
/* Suministros: reparación y suministro de fin de turno */
.sp-hp { margin-left: auto; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; text-transform: none; }
.sp-rep { padding: 3px 10px; font: 700 12px var(--ui); letter-spacing: 0.05em; text-transform: none; color: #9ff0a8; background: rgba(0,0,0,0.4); border: 1px solid rgba(123,211,137,0.5); cursor: pointer; }
.sp-rep:hover:not([disabled]) { border-color: #7bd389; }
.sp-rep.on { color: #111; background: #7bd389; border-color: #7bd389; }
.sp-rep[disabled] { opacity: 0.45; cursor: default; }
.hud-supply.late { border-color: var(--red); }
.hud-supply.late .sp-warn { color: #ff9a8a; }
.sup-btn.late { box-shadow: 0 0 0 1px var(--red) inset; }
/* Selección de comandantes terminada: los no elegidos, desactivados en blanco y negro */
.cmd-tile.unused, .cmd-tile.unused img { filter: grayscale(1) brightness(0.5); }
.cmd-tile.unused { opacity: 0.65; cursor: default; }
/* Indicador de reparaciones en la lista de ejércitos */
.cp-rep { display: flex; flex-direction: column; align-items: center; font-style: normal; font-size: 15px; line-height: 1; padding: 3px 5px; border: 1px solid currentColor; }
.cp-rep small { font-size: 10px; font-weight: 700; margin-top: 2px; color: inherit; }
.cp-rep.low { color: #e8d07a; }
.cp-rep.mid { color: #f0a050; }
.cp-rep.bad { color: #ff6a5a; animation: repBlink 1.2s ease-in-out infinite; }
@keyframes repBlink { 50% { opacity: 0.45; } }
.cp-army.acted .cp-rep { opacity: 1; }

/* v0.24 · Selección de comandante (Batallas): la ficha lateral nunca se desborda */
.cmd-screen .vs-layout { grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr); gap: 2.4vw; }
.cmd-screen .cmd-grid.many { grid-template-columns: repeat(6, clamp(50px, min(6vw, 8.6vh), 112px)); gap: 6px; }
.fighter { min-width: 0; }
.fighter .name { font-size: clamp(24px, 2.7vw, 46px); overflow-wrap: anywhere; word-break: break-word; }
.fighter .portrait-wrap { bottom: 108px; }
.fighter .tagline { bottom: 114px; }
.fighter .perk { height: 100px; overflow: hidden; padding: 9px 12px; }
.fighter .perk b { font-size: 14px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fighter .perk small { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-height: 760px) {
  .fighter .portrait-wrap { bottom: 86px; } .fighter .tagline { bottom: 92px; }
  .fighter .perk { height: 80px; padding: 6px 10px; }
  .fighter .perk small { -webkit-line-clamp: 2; font-size: 12px; }
}
/* Conquista: el detalle del comandante tampoco se sale */
.cqc-detail { overflow: hidden; min-width: 0; }
.cqc-detail p, .cqc-detail small, .cqc-detail b { overflow-wrap: anywhere; }

/* Valoración de fuerza (1-100) */
.pw { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 4px; flex: none;
  font-family: var(--display); font-weight: 400; font-size: 14px; line-height: 1; color: #111; background: #8d8676; clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
.pw.lo { background: #a39a86; }
.pw.md { background: #e8b04a; }
.pw.hi { background: #ffd27a; box-shadow: 0 0 10px rgba(255,210,122,0.6); }
.pw-list { min-width: 30px; height: 26px; font-size: 16px; }
.pw-sm { min-width: 24px; height: 18px; font-size: 12px; vertical-align: middle; }
.bd-por { position: relative; }
.pw-card { position: absolute; left: 8px; bottom: 58px; z-index: 3; min-width: 38px; height: 30px; font-size: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.bd-card.garrison .pw-card { bottom: 58px; }
.bd-cand { position: relative; }
.bd-cand .pw-sm { margin-left: 6px; }
.ri-gar { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); }

/* v1.26 · Campaña: panel central (región/ejército seleccionado + parte de guerra) y panel derecho solo para comandantes */
.cp-body { grid-template-columns: minmax(0, 1fr) clamp(240px, 19vw, 300px) clamp(220px, 17vw, 280px); }
.cp-mid .cp-info { flex: 1 1 auto; height: auto; min-height: 0; overflow-y: auto; }
.cp-mid .cp-logw { flex: none; }
.cp-mid .cp-log { max-height: 30vh; }
.cp-cmds .cp-armies { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width: 1000px) and (orientation: landscape) {
  .cp-body { grid-template-columns: minmax(0, 1fr) 200px 190px; }
}
@media (max-width: 1000px) and (orientation: portrait) {
  .cp-body { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .cp-map { grid-column: 1 / -1; }
  .cp-side { max-height: 34vh; }
}
.cp-body { grid-template-columns: minmax(0, 1fr) clamp(215px, 17vw, 290px) clamp(255px, 20.5vw, 330px); }
.cp-cmds { padding: 12px 10px; }
.cp-cmds .cp-army { gap: 7px; padding: 4px 6px 4px 4px; }
.cp-cmds .cp-army img { width: 34px; height: 34px; }
.cp-cmds .cp-army > div { min-width: 0; }
.cp-cmds .cp-army b, .cp-cmds .cp-army small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-cmds .pw-list { min-width: 28px; height: 24px; font-size: 15px; }
.cp-cmds .cp-rep { flex: none; }
/* Online: aviso de espera al otro jugador */
.hud-wait { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); padding: 6px 16px; background: var(--panel); border: 1px solid var(--amber);
  color: var(--amber-hi); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.hud-wait.show { opacity: 1; animation: waitPulse 1.4s ease-in-out infinite; }
@keyframes waitPulse { 50% { border-color: rgba(232,176,74,0.3); } }

/* ═══════════ Modo online ═══════════ */
.online-screen .on-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 420px); gap: 18px; width: min(1020px, 100%); align-items: start; }
.on-main, .on-list { max-width: none; padding: 18px 22px; }
.on-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.on-field span, .on-h { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.on-main input[type=text], .on-name, .on-code { padding: 9px 12px; font: inherit; font-size: 18px; background: rgba(0,0,0,0.5); border: 1px solid var(--line); color: var(--text); }
.on-code { text-transform: uppercase; letter-spacing: 0.25em; width: 100%; }
.on-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 14px; }
.on-mode { padding: 6px 10px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); }
.on-mode b { display: block; font-size: 14px; letter-spacing: 0.04em; }
.on-mode small { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.on-mode.ok { border-color: var(--amber); } .on-mode.ok small { color: #7bd389; }
.on-mode.soon { opacity: 0.55; } .on-mode.soon small { color: var(--muted); }
.on-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 8px 0; }
.on-row .btn { white-space: nowrap; }
.on-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.on-check input { width: 16px; height: 16px; accent-color: var(--amber); }
.on-localrow { margin-top: 10px; }
.on-status { min-height: 22px; margin: 10px 0 0; color: var(--amber-hi); font-size: 14px; line-height: 1.35; }
.on-status.bad { color: #ff8a7a; }
.online-screen.busy .btn { pointer-events: none; opacity: 0.6; }
.on-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.on-refresh { background: none; border: 1px solid var(--line); color: var(--amber); width: 28px; height: 28px; cursor: pointer; font-size: 16px; }
.on-refresh.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.on-rooms { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.on-room { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 0 10px; padding: 8px 12px; background: rgba(0,0,0,0.35); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.on-room b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.on-room small { grid-column: 1; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; }
.on-room span { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--amber); font-size: 13px; letter-spacing: 0.15em; text-transform: uppercase; }
.on-room:hover { border-color: var(--amber); background: rgba(232,176,74,0.1); }
.on-empty { color: var(--muted); font-size: 14px; line-height: 1.4; } .on-empty.bad { color: #ff8a7a; }
.lb-panel { width: min(760px, 100%); max-width: none; padding: 20px 26px; }
.lb-code { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lb-code small { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.lb-code b { font-family: var(--display); font-weight: 400; font-size: 40px; letter-spacing: 0.25em; color: var(--amber-hi); }
.lb-kind { margin-left: auto; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; }
.lb-mode { margin: 6px 0 12px; font-size: 15px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber); }
.lb-players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 14px; }
.lb-slot { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-left: 4px solid var(--fc); background: rgba(0,0,0,0.35); min-width: 0; }
.lb-slot img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.lb-slot b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-slot small { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.lb-slot.empty { opacity: 0.55; animation: waitPulse 1.4s ease-in-out infinite; }
.lb-vs { font-family: var(--display); font-size: 30px; color: var(--amber); }
.lb-opts .opt-row { padding: 5px 10px; }
.lb-turn { min-height: 20px; margin: 10px 0 0; font-size: 13px; color: #9ff0a8; } .lb-turn.warn { color: #f0a050; }
.net-wait .panel { text-align: center; padding: 26px 34px; max-width: 520px; }
.net-wait p { font-size: 18px; color: var(--text); line-height: 1.4; }
.nw-spin { width: 46px; height: 46px; margin: 0 auto 12px; border: 4px solid rgba(232,176,74,0.25); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.9s linear infinite; }
@media (max-width: 900px) { .online-screen .on-layout { grid-template-columns: 1fr; } }
/* Pantalla de carga inicial (capa al 90 %) */
#loader { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: #000; transition: opacity 0.4s; }
#loader.done { opacity: 0; pointer-events: none; }
.ld-box { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(520px, 86vw); }
.ld-logos img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 6px; display: inline-block; }
.ld-logos { display: flex; gap: 14px; }
.ld-box b { font-family: var(--display); font-size: 30px; letter-spacing: 0.08em; color: var(--amber-hi); }
.ld-txt { color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; }
.ld-bar { width: 100%; height: 10px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber-hi)); transition: width 0.15s; }
.ld-pct { font-family: var(--display); color: var(--amber); font-size: 18px; }

/* Barra de mando: en pantallas medianas se compacta para que quepa entera (FIN DE TURNO no se corta) */
@media (max-width: 1420px) {
  .hud-bottom { gap: 6px; padding: 8px; }
  .hud-who { min-width: 150px; }
  .hud-ctl { padding: 0 5px; }
  .hud-ctl .val { min-width: 52px; font-size: 22px; }
  .hud-ctl .wname { min-width: 100px; font-size: 15px; }
  .hud-ctl button { width: 28px; }
  .fuel-bar { width: 64px; }
  .fire-btn { padding: 0 18px; font-size: 23px; }
}

/* Logo (menú principal y pantalla de carga) */
.logo .logo-img { display: block; width: min(640px, 78vw); max-height: 30vh; object-fit: contain; margin: 0 auto; transform: skewX(6deg); filter: drop-shadow(0 8px 18px rgba(0,0,0,0.6)); }
.ld-title { display: block; width: min(520px, 86vw); height: auto; margin: 0 auto 8px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6)); }
@media (max-height: 560px) { .logo .logo-img { width: min(420px, 60vw); } }
