@import url('../vendor/fonts.css?v=2026-10-12w');

:root {
  --ui: 1;                           /* escala de la interfaz (Opciones); la fija UIScale en js/ui_hud.js */
  --dock-b: calc(28px + 50px * var(--ui));   /* hueco inferior del dossier: la barra de vistas va debajo */
  --bg: #070b12;
  --panel: rgba(12, 18, 29, 0.86);
  --panel-solid: #0d1420;
  --panel-2: rgba(22, 31, 47, 0.78);
  --line: rgba(226, 184, 74, 0.26);
  --line-strong: rgba(226, 184, 74, 0.7);
  --gold: #e2b84a;
  --gold-2: #f4d98a;
  --bronze: #9b7424;
  --crimson: #b3282d;
  --crimson-2: #e5484d;
  --ivory: #efe6cf;
  --muted: #8d97a8;
  --green: #4fc08d;
  --blue: #5aa9e6;
  --violet: #9a7ad6;
  --amber: #e8a33d;
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.8);
  --r: 10px;
  --font-title: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ivory); font-family: var(--font-body); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 700; margin: 0; letter-spacing: 0.06em; }
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.ic.lg { width: 1.6em; height: 1.6em; }
.muted { color: var(--muted); }
.gold { color: var(--gold-2); }
.red { color: var(--crimson-2); }
.green { color: var(--green); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; z-index: 1; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
#vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(3, 6, 12, 0.72) 100%); }

/* ---------- Paneles ---------- */
/* sin backdrop-filter: casi opaco en lugar de desenfocar el mapa 3D que tienen debajo, cada fotograma */
.panel { position: relative; background: rgba(12, 18, 29, 0.93);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel::before, .panel::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--gold); opacity: 0.55; pointer-events: none; }
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--r); }
.panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--r); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 8px; border-bottom: 1px solid var(--line); }
.panel-h h3 { font-size: 12px; color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.panel-b { padding: 10px 12px 12px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--ivory); transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s; user-select: none; }
.btn:hover:not(:disabled) { background: rgba(226, 184, 74, 0.14); border-color: var(--line-strong); color: var(--gold-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: 0.42; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, #f1cf6c 0%, #c79b2f 55%, #a07a1f 100%); color: #1a1205; border-color: #ffe9a3; font-family: var(--font-title); letter-spacing: 0.1em; font-weight: 700; text-transform: uppercase;
  box-shadow: 0 6px 20px -6px rgba(226, 184, 74, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe08a 0%, #dcae3d 55%, #b78a25 100%); color: #1a1205; transform: translateY(-1px); }
.btn.danger { border-color: rgba(229, 72, 77, 0.55); color: #ffb4b6; }
.btn.danger:hover:not(:disabled) { background: rgba(229, 72, 77, 0.2); border-color: var(--crimson-2); color: #fff; }
.btn.blue { border-color: rgba(90, 169, 230, 0.5); color: #b7dcf7; }
.btn.blue:hover:not(:disabled) { background: rgba(90, 169, 230, 0.18); border-color: var(--blue); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn .sub { font-weight: 400; font-size: 11px; opacity: 0.8; }
.btn-ic { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.btn-ic .ic { width: 21px; height: 21px; }          /* iconos de la barra: casi todo el botón, poco relleno */
.hud-right .btn:not(.btn-ic) .ic { width: 19px; height: 19px; }

/* ---------- HUD superior ---------- */
#hud { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 8px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding-right: 14px; border-right: 1px solid var(--line); }
.brand .logo { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.65)); }
.brand .logo img { width: 46px; height: 46px; display: block; }
.brand h1 { font-size: 17px; color: var(--gold-2); letter-spacing: 0.22em; line-height: 1; }
.brand small { display: block; font-size: 9.5px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.stats { display: flex; align-items: stretch; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.stats::-webkit-scrollbar { display: none; }
.stat { display: flex; flex-direction: column; justify-content: center; padding: 3px 12px; border-radius: 8px; min-width: 78px; flex: none; position: relative; cursor: default; }          /* sin encoger: si no caben, la fila se desplaza (antes se montaban unas sobre otras) */
.stat:hover { background: rgba(255, 255, 255, 0.05); }
.stat .k { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat .v { white-space: nowrap; font-size: 16px; font-weight: 700; color: var(--ivory); display: flex; align-items: baseline; gap: 5px; }
.stat .v small { font-size: 11px; font-weight: 500; color: var(--muted); }
.stat.year .v { font-family: var(--font-title); color: var(--gold-2); font-size: 17px; }
.stat.rank .v { font-family: var(--font-title); color: #8ee4b6; font-size: 15px; }
.mini-bar { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 3px; }
.mini-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--gold); transition: width .4s ease; }
.hud-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hud-right .btn.primary { padding: 10px 18px; font-size: 12.5px; }
.hud-right .btn.games { padding: 10px 16px; font-size: 12.5px; font-family: var(--font-title); letter-spacing: 0.1em; font-weight: 700; text-transform: uppercase; color: #fff4e0; border-color: #f0b4b6;
  background: linear-gradient(180deg, #d4474c 0%, #a82a2f 55%, #7a1519 100%); box-shadow: 0 6px 18px -6px rgba(229, 72, 77, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.hud-right .btn.games:hover:not(:disabled) { background: linear-gradient(180deg, #e65a5f 0%, #b8353a 55%, #8a1c20 100%); color: #fff; border-color: #fff; transform: translateY(-1px); }
/* botones de icono: en escritorio van en fila (el contenedor no cuenta) y sin texto; en tablet y móvil pasan a un menú desplegable */
.hud-menu { display: contents; }
.hud-menu-btn { display: none; }
.hud-tools { display: contents; }
.hud-tools .lbl { display: none; }
.hud-tools .ico { display: inline-flex; }

/* ---------- Columnas ---------- */
#left { position: fixed; top: calc(var(--hud-h, 70px) + 22px); left: 12px; bottom: 14px; width: 292px; z-index: 9; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
#left > * { pointer-events: auto; }
#left .scroll { overflow-y: auto; max-height: 100%; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; }
/* Caja única de unidades: legiones y flotas en pestañas; ocupa el hueco que queda y su contenido se desplaza dentro */
#left .units-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#left .units-panel > .panel-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; padding: 8px; }
#left .unit-tabs { padding: 8px 10px; gap: 6px; }
.unit-tab { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 6px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; cursor: pointer; white-space: nowrap; }
.unit-tab .ic { width: 20px; height: 20px; flex: none; }
.unit-tab.on { background: rgba(226, 184, 74, 0.2); border-color: var(--gold); color: var(--gold-2); }
.unit-tab:hover:not(.on) { border-color: var(--line-strong); color: var(--ivory); }
.card.fleet .leg-emblem { display: grid; place-items: center; font-size: 19px; background: linear-gradient(#1c3550, #10223a); border: 1px solid rgba(120, 180, 255, .45); border-radius: 8px; }
.card.fleet .mv { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); margin-top: 6px; overflow: hidden; }
.card.fleet .mv i { display: block; height: 100%; background: linear-gradient(90deg, #4aa8ff, #9ad4ff); }
.card.fleet.sel { border-color: #6cb8ff; box-shadow: 0 0 0 1px rgba(108, 184, 255, .35) inset; }
.fl-troops { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.fl-troops:last-child { border-bottom: 0; }
.fl-troops .btn { padding: 3px 9px; font-size: 11.5px; }
.card { background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 9px; padding: 9px 10px; margin-bottom: 7px; cursor: pointer; transition: border-color .15s, background .15s, transform .12s; }
.card:hover { border-color: var(--line-strong); background: rgba(34, 46, 68, 0.85); }
.card.sel { border-color: var(--gold); background: rgba(226, 184, 74, 0.12); box-shadow: 0 0 0 1px rgba(226, 184, 74, 0.25), 0 8px 24px -10px rgba(226, 184, 74, 0.4); }
.card.done { opacity: 0.62; }
.leg-row { display: flex; align-items: center; gap: 9px; }
.leg-emblem.portrait { width: 44px; height: 44px; background-size: cover; background-position: center top; image-rendering: pixelated; position: relative; border-color: var(--gold); place-items: end center; }
.leg-emblem.portrait .num { font-size: 9px; background: rgba(122, 21, 25, 0.9); padding: 0 5px; border-radius: 6px 6px 0 0; line-height: 1.5; }
.leg-emblem { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #c93b3f, #7a1519 70%); border: 1px solid #f0b4b6; color: #ffe9c9; font-family: var(--font-title); font-size: 11px; font-weight: 700; flex: none; box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4); }
.leg-name { font-weight: 600; font-size: 13px; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.leg-meta .ic { width: 1em; height: 1em; }
.pips { display: inline-flex; gap: 2px; }
.pips i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.pips i.on { background: var(--gold); box-shadow: 0 0 5px var(--gold); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; border: 1px solid; white-space: nowrap; }
.tag.rome { color: #ffb4b6; background: rgba(179, 40, 45, 0.3); border-color: rgba(229, 72, 77, 0.6); }
.tag.ally { color: #f4d98a; background: rgba(226, 184, 74, 0.16); border-color: rgba(226, 184, 74, 0.6); }
.tag.tributary { color: #cdbaf2; background: rgba(154, 122, 214, 0.18); border-color: rgba(154, 122, 214, 0.6); }
.tag.foreign { color: #b7dcf7; background: rgba(90, 169, 230, 0.14); border-color: rgba(90, 169, 230, 0.5); }
.tag.rebel { color: #e1e1e1; background: rgba(60, 60, 60, 0.6); border-color: rgba(200, 200, 200, 0.5); }
/* orden del Senado: tarjeta compacta (título, plazo y recompensa; el texto completo está en el dossier de la provincia objetivo) */
#order-panel .panel-b { padding: 7px 8px 7px 10px; }
.order-card { font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.order-card .oc { flex: 1; min-width: 0; }
.order-card .t { color: var(--gold-2); font-weight: 600; display: flex; gap: 7px; align-items: center; min-width: 0; }
.order-card .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card .reward { margin-top: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-card .btn-ic { width: 30px; height: 30px; flex: none; } .order-card .btn-ic .ic { width: 19px; height: 19px; }
.log { font-size: 12px; max-height: 150px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; }
.log div { padding: 3px 0; border-bottom: 1px dotted rgba(255, 255, 255, 0.07); color: #c5ccd8; }
.log div.good { color: #8ee4b6; } .log div.bad { color: #ff9ea1; } .log div.military { color: #f4d98a; }
.log .y { color: var(--muted); font-size: 10.5px; margin-right: 6px; }

/* ---------- Dossier ---------- */
#dossier { position: fixed; top: calc(var(--hud-h, 70px) + 22px); right: 12px; bottom: var(--dock-b); width: 366px; z-index: 9; transform: translateX(120%); opacity: 0; transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .25s; display: flex; flex-direction: column; }
#dossier.open { transform: none; opacity: 1; }
#dossier .body { overflow-y: auto; padding: 0 14px 14px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; }
.dos-art { height: 124px; position: relative; overflow: hidden; border-radius: 12px 12px 0 0; flex: none; }
.dos-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dos-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 12, 22, 0) 35%, rgba(8, 12, 22, 0.92) 100%); pointer-events: none; }
.dos-head.over { margin-top: -38px; position: relative; z-index: 1; border-bottom: 1px solid var(--line); }
.dos-head { display: flex; gap: 12px; padding: 14px 14px 10px; align-items: center; border-bottom: 1px solid var(--line); }
.dos-head h2 { font-size: 17px; color: var(--gold-2); line-height: 1.2; }
.dos-head .cities { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.portrait { width: 64px; height: 64px; border-radius: 8px; flex: none; border: 1px solid var(--gold); background: #1b1308 center/cover no-repeat; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.5); image-rendering: auto; position: relative; overflow: hidden; }
.portrait.pixel { image-rendering: pixelated; background-color: #3b3128; }
.portrait .crest { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); }
.portrait .crest .ic { width: 70%; height: 70%; opacity: 0.8; }
.portrait .crest.emb { padding: 3px; }
.portrait .crest.emb img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.sect { margin-top: 12px; }
.sect > h4 { font-size: 10.5px; letter-spacing: 0.18em; color: var(--gold); text-transform: uppercase; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv { background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 7px 10px; }
.kv .k { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 700; margin-top: 1px; }
.meter { height: 7px; background: rgba(255, 255, 255, 0.09); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; border-radius: 4px; transition: width .4s; }
.seg { display: flex; gap: 5px; }
.seg button { flex: 1; padding: 6px 4px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button.on { background: rgba(226, 184, 74, 0.2); border-color: var(--gold); color: var(--gold-2); }
.fs-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; padding: 0; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(8, 12, 20, 0.7); backdrop-filter: blur(6px); color: #c9c2ad; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.fs-btn:hover { color: var(--gold-2); border-color: var(--gold); background: rgba(226, 184, 74, 0.14); }
.fs-btn svg { width: 17px; height: 17px; pointer-events: none; }
.seg button:hover:not(.on) { border-color: var(--line-strong); color: var(--ivory); }
.actions { display: flex; flex-direction: column; gap: 7px; }
.hint-box { font-size: 12px; color: #c5ccd8; background: rgba(226, 184, 74, 0.07); border: 1px solid rgba(226, 184, 74, 0.2); border-radius: 8px; padding: 8px 10px; }
.warn-box { font-size: 12px; color: #ffc2c4; background: rgba(229, 72, 77, 0.1); border: 1px solid rgba(229, 72, 77, 0.35); border-radius: 8px; padding: 8px 10px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 0; }
.chk input { accent-color: var(--gold); }

/* ---------- Barra inferior ---------- */
/* barra de vistas del mapa: debajo del dossier, a la derecha */
#dock { position: fixed; right: 12px; bottom: 14px; z-index: 9; display: flex; justify-content: flex-end; gap: 8px; padding: 7px 10px; align-items: center; max-width: calc(100vw - 24px); }
#dock .btn { padding: 5px 9px; }
#dock .btn .ic { width: 21px; height: 21px; }
#dock .btn.on { background: rgba(226, 184, 74, 0.22); border-color: var(--gold); color: var(--gold-2); }
#hint { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 9; padding: 7px 16px; border-radius: 20px; font-size: 12.5px; background: rgba(8, 12, 20, 0.88); border: 1px solid var(--line); color: var(--gold-2); pointer-events: none; opacity: 0; transition: opacity .25s; white-space: nowrap; }
#hint.show { opacity: 1; }

/* ---------- Etiquetas del mapa ---------- */
.maplabel { position: absolute; transform: translate(-50%, -50%); font-family: var(--font-title); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 6px #000, 0 0 12px rgba(0, 0, 0, 0.9); color: #f1ead6; transition: opacity .2s; display: flex; flex-direction: column; align-items: center; gap: 2px; will-change: transform; }
.maplabel .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.7); box-shadow: 0 0 6px currentColor; }
.maplabel.rome { color: #ffd3d4; }
.maplabel.ally { color: var(--gold-2); }
.maplabel.tributary { color: #d9c8f7; }
.maplabel.rebel { color: #bbb; }
.maplabel.foreign { color: #a9bdd6; font-weight: 600; opacity: .88; }
.maplabel.foreign .dot { border-radius: 2px; transform: rotate(45deg); }
.maplabel.sel { color: #fff; text-shadow: 0 0 10px var(--gold), 0 1px 3px #000; }
.maplabel .sub { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.04em; font-size: 10px; color: #ffe0a3; opacity: 0.95; text-transform: none; }
.maplabel.sieged .sub { color: #ffb066; font-weight: 700; text-shadow: 0 0 8px rgba(255, 110, 30, 0.9), 0 1px 3px #000; animation: sg-pulse 1.4s ease-in-out infinite; }
@keyframes sg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.maplabel.geo { font-weight: 500; font-style: italic; letter-spacing: 0.36em; font-size: 11px; opacity: .6; text-shadow: 0 1px 4px #000, 0 0 10px rgba(0,0,0,.8); }
.maplabel.geo.sea { color: #9cc8e8; }
.maplabel.geo.land { color: #e9d9b0; }
/* nombres de provincia: capitales espaciadas, sobrias; nombres de ciudad: cursiva con placa, junto a la maqueta */
.maplabel .nm { letter-spacing: 0.2em; font-size: 0.96em; }
.maplabel.city { flex-direction: row; gap: 0; z-index: 1; pointer-events: none; font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 700; letter-spacing: 0.02em; text-transform: none; font-size: 12.5px; color: #fff4d4; text-shadow: 0 1px 2px #000, 0 0 5px #000, 0 0 9px rgba(0, 0, 0, 0.9); }
.maplabel.city.rome { color: #ffe3b0; }
.maplabel.city.ally { color: #f4d98a; }
.maplabel.city.tributary { color: #e6dcfa; }
.maplabel.city.foreign { color: #d7e3f2; }
.maplabel.city.rebel { color: #e0c8c8; }
.maplabel.city.sel { color: #fff; }
/* flotas en el mapa: galeras y tropas a bordo */
.fleet-tag { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 5px; padding: 1px 7px 1px 6px; font: 700 11px var(--font-body); color: #fff4d4; background: rgba(34, 12, 14, .78); border: 1px solid rgba(255, 213, 140, .55); border-radius: 11px; white-space: nowrap; text-shadow: 0 1px 2px #000; box-shadow: 0 1px 6px rgba(0, 0, 0, .55); will-change: transform; pointer-events: none; transition: opacity .2s; }
.fleet-tag .ic { font-size: 11px; opacity: .95; }
.fleet-tag .tr { color: #ffd877; font-weight: 600; margin-left: 2px; }
.fleet-tag.foe { background: rgba(14, 18, 30, .8); border-color: rgba(150, 190, 255, .5); color: #dfe9ff; }
.fleet-tag.sel { border-color: #ffe08a; box-shadow: 0 0 10px rgba(255, 224, 138, .7), 0 1px 6px rgba(0, 0, 0, .55); color: #fff; }
.tooltip { position: fixed; z-index: 30; pointer-events: none; padding: 8px 12px; border-radius: 9px; font-size: 12px; background: rgba(8, 12, 20, 0.94); border: 1px solid var(--line-strong); box-shadow: var(--shadow); min-width: 150px; display: none; transform: translate(14px, 14px); }
.tooltip b { font-family: var(--font-title); color: var(--gold-2); font-size: 13px; letter-spacing: 0.08em; display: block; margin-bottom: 3px; }
.tooltip .r { display: flex; justify-content: space-between; gap: 14px; color: #c5ccd8; }

/* ---------- Modales ---------- */
#modal-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.modal { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(5px); pointer-events: auto; animation: fadeIn .22s ease; }
.modal.clear { background: rgba(3, 6, 12, 0.38); backdrop-filter: none; }
.sheet { position: relative; background: linear-gradient(180deg, rgba(20, 29, 45, 0.97), rgba(11, 17, 28, 0.98)); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 30px 90px -20px #000, 0 0 0 1px rgba(0, 0, 0, 0.6); max-height: calc(100vh - 36px); overflow: hidden; display: flex; flex-direction: column; animation: rise .3s cubic-bezier(.16, 1, .3, 1); }
.sheet.w560 { width: min(560px, 100%); } .sheet.w680 { width: min(680px, 100%); } .sheet.w820 { width: min(820px, 100%); } .sheet.w1000 { width: min(1000px, 100%); } .sheet.w1100 { width: min(1100px, 100%); }
.sheet-h { padding: 16px 22px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.sheet-h h2 { font-size: 20px; color: var(--gold-2); letter-spacing: 0.14em; text-transform: uppercase; }
.sheet-h .sub { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; text-transform: none; font-family: var(--font-body); font-weight: 400; display: block; margin-top: 3px; letter-spacing: 0.02em; }
.sheet-b { padding: 16px 22px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; }
.sheet-f { padding: 12px 22px 16px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.sheet-f .grow { flex: 1; }
.x { margin-left: auto; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985) } to { opacity: 1; transform: none } }
@keyframes pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }

/* Informe de año (pergamino) */
.parchment { background: linear-gradient(180deg, rgba(239, 230, 207, 0.97), rgba(222, 207, 170, 0.97)); color: #2a1f0f; border-color: #b08a3a; }
.parchment .sheet-h { border-color: rgba(120, 85, 20, 0.35); }
.parchment .sheet-h h2 { color: #6b1d1f; }
.parchment .sheet-h .sub { color: #6a5a3a; }
.parchment .sheet-f { border-color: rgba(120, 85, 20, 0.35); }
.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger td, .ledger th { padding: 4px 8px; border-bottom: 1px dotted rgba(90, 60, 10, 0.35); text-align: left; }
.ledger td.r, .ledger th.r { text-align: right; font-variant-numeric: tabular-nums; }
.ledger tr.total td { font-weight: 800; border-top: 2px solid #5a3c0a; border-bottom: 0; font-size: 14px; }
.ledger .neg { color: #8b1a1d; } .ledger .pos { color: #1f6b3b; }
.rep-lines div { padding: 5px 0 5px 20px; position: relative; font-size: 13px; }
.rep-lines div::before { content: '❖'; position: absolute; left: 2px; top: 5px; color: #8a6a1c; font-size: 11px; }
.rep-lines .bad { color: #8b1a1d; font-weight: 600; } .rep-lines .good { color: #1f6b3b; font-weight: 600; }

/* Eventos */
.ev-img { height: 220px; background: #0a0f1a center/cover no-repeat; position: relative; }
.ev-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(11, 17, 28, 0.98)); }
.ev-img .ic-bg { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(226, 184, 74, 0.5); }
.ev-img .ic-bg .ic { width: 90px; height: 90px; }
.choice { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 11px 14px; border-radius: 9px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.09); cursor: pointer; margin-bottom: 8px; transition: all .15s; font-size: 13.5px; }
.choice:hover:not(:disabled) { border-color: var(--gold); background: rgba(226, 184, 74, 0.12); transform: translateX(3px); color: var(--gold-2); }
.choice:disabled { opacity: 0.4; cursor: not-allowed; }
.choice .grow { flex: 1; }
.choice small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; font-weight: 400; }
.choice .cost { font-weight: 700; color: var(--gold-2); white-space: nowrap; display: flex; gap: 4px; align-items: center; }

/* Diplomacia */
.parley { display: grid; grid-template-columns: 250px 1fr; min-height: 420px; }
.parley .side { position: relative; background: #17110a center/cover; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: flex-end; padding: 0; overflow: hidden; }
.parley .side .scene { position: absolute; inset: 0; background-size: cover; background-position: center bottom; opacity: 0.9; }
.parley .side .face { position: relative; width: 100%; aspect-ratio: 1; background-size: contain; background-repeat: no-repeat; background-position: center bottom; image-rendering: pixelated; z-index: 2; margin-bottom: 0; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.parley .side .nameplate { position: relative; z-index: 3; padding: 10px 14px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85)); }
.parley .side .nameplate h3 { font-size: 15px; color: var(--gold-2); }
.parley .side .nameplate div { font-size: 11.5px; color: #cfc6b0; }
.parley .main { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.speech { position: relative; background: rgba(0, 0, 0, 0.35); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; padding: 14px 18px; font-size: 15px; line-height: 1.55; font-style: italic; color: #f1ead6; min-height: 72px; }
.speech.mine { border-left-color: var(--crimson-2); font-style: normal; color: #ffd8d9; }
.speech .who { display: block; font-style: normal; font-family: var(--font-title); font-size: 11px; letter-spacing: .16em; color: var(--gold); margin-bottom: 4px; text-transform: uppercase; }
.attitude { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.attitude .meter { flex: 1; margin: 0; height: 9px; }
.att-grad { background: linear-gradient(90deg, #e5484d, #e8a33d 45%, #4fc08d); }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.09); cursor: pointer; transition: all .15s; }
.opt:hover:not(:disabled) { border-color: var(--gold); background: rgba(226, 184, 74, 0.12); }
.opt:disabled { opacity: .4; cursor: not-allowed; }
.opt .ic { width: 22px; height: 22px; color: var(--gold); margin-top: 2px; }
.opt b { display: block; font-size: 13px; }
.opt small { color: var(--muted); font-size: 11px; line-height: 1.3; display: block; }
.opt-grid.single { grid-template-columns: 1fr; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 11.5px; padding: 3px 9px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: #c5ccd8; display: inline-flex; gap: 5px; align-items: center; }

/* Batalla */
.battle { display: flex; flex-direction: column; }
.battle canvas { width: 100%; display: block; background: #0a0f1a; aspect-ratio: 16 / 7.4; }
.b-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; padding: 10px 18px; background: rgba(5, 8, 14, 0.9); border-bottom: 1px solid var(--line); }
.b-side .nm { font-family: var(--font-title); font-size: 13px; letter-spacing: .1em; color: var(--ivory); text-transform: uppercase; }
.b-side.e { text-align: right; } .b-side.e .nm { color: #b7dcf7; } .b-side.p .nm { color: #ffb4b6; }
.b-side .nums { font-size: 12px; color: var(--muted); }
.b-side .nums b { color: var(--ivory); font-variant-numeric: tabular-nums; }
.b-side .meter { margin-top: 4px; height: 6px; }
.b-mid { text-align: center; font-family: var(--font-title); }
.b-mid .rd { font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.b-mid .ter { font-size: 13px; color: var(--gold-2); }
.tactic-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px 18px 4px; }
.tac { padding: 9px 8px; border-radius: 9px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.09); cursor: pointer; text-align: center; transition: all .15s; position: relative; }
.tac:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.tac.on { border-color: var(--gold-2); background: rgba(226, 184, 74, 0.2); box-shadow: 0 0 18px -4px rgba(226, 184, 74, .6); }
.tac:disabled { opacity: .35; cursor: not-allowed; }
.tac .ic { width: 26px; height: 26px; color: var(--gold); display: block; margin: 0 auto 3px; }
.tac b { display: block; font-family: var(--font-title); font-size: 11.5px; letter-spacing: .06em; }
.tac .tend { position: absolute; top: 4px; right: 5px; font-size: 9.5px; color: #8cc8f2; font-weight: 700; }
.tac.rec::after { content: var(--i18n-consejo, 'consejo'); position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 9px; background: var(--green); color: #052; padding: 1px 6px; border-radius: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tac-desc { padding: 6px 18px 0; font-size: 12px; color: #c5ccd8; min-height: 38px; }
.b-log { padding: 8px 18px; font-size: 12.5px; max-height: 96px; overflow-y: auto; color: #c5ccd8; }
.b-log div { padding: 2px 0; }
.b-log .win { color: #8ee4b6; } .b-log .lose { color: #ff9ea1; }

/* Título */
#title { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #05080f center/cover no-repeat; transition: opacity .8s ease; }
#title::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 60%, rgba(5, 8, 15, 0.1), rgba(5, 8, 15, 0.82) 80%), linear-gradient(180deg, rgba(5, 8, 15, 0.55), transparent 35%, rgba(5, 8, 15, 0.7)); }
#title .inner { position: relative; text-align: center; padding: 20px; width: min(520px, 100%); margin: auto; flex: none; }
#title .logo-img { width: min(460px, 86vw); image-rendering: auto; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.9)); margin: 0 auto 4px; display: block; }
#title .title-emblem { width: min(160px, 32vw); height: auto; display: block; margin: 0 auto 2px; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.85)); }
#title h1.word { font-size: clamp(38px, 7vw, 68px); color: var(--gold-2); letter-spacing: .3em; text-shadow: 0 4px 30px rgba(0, 0, 0, .9), 0 0 40px rgba(226, 184, 74, .35); margin-right: -.3em; }
#title .tag-line { color: #d8cfb8; letter-spacing: .34em; font-size: 12px; text-transform: uppercase; margin: 6px 0 30px; text-shadow: 0 2px 8px #000; }
#title .menu { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
#title .menu .btn { padding: 12px 18px; font-size: 13px; font-family: var(--font-title); letter-spacing: .14em; text-transform: uppercase; background: rgba(8, 12, 20, 0.7); backdrop-filter: blur(6px); }
#title .menu .btn.primary { background: linear-gradient(180deg, #f1cf6c, #a07a1f); }
#title .menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#title .menu-grid .btn { padding: 11px 8px; font-size: 11.5px; letter-spacing: .1em; }
#title .menu-grid > :last-child:nth-child(odd) { grid-column: span 2; }          /* número impar de botones: el último a lo ancho */
/* selectores deslizantes del título (sonido y calidad gráfica): una caja dorada se desliza hasta la opción elegida y la ilumina */
#title .tsw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#title .tsw { display: flex; flex-direction: column; gap: 5px; text-align: left; min-width: 0; }
#title .tsw-lab { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #b9ad8a; padding-left: 4px; text-shadow: 0 1px 6px #000; }
#title .tsw-box { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(8, 12, 20, .7); backdrop-filter: blur(6px); }
#title .tsw-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 6px; border: 1px solid var(--gold); background: linear-gradient(180deg, rgba(241, 207, 108, .34), rgba(160, 122, 31, .34)); box-shadow: 0 0 14px rgba(226, 184, 74, .35), inset 0 0 8px rgba(255, 236, 170, .25); transition: transform .28s cubic-bezier(.3, .7, .2, 1); }
#title .tsw-box[data-i="1"] .tsw-thumb { transform: translateX(100%); }
#title .tsw-box button { position: relative; z-index: 1; background: none; border: 0; padding: 9px 4px; font-family: var(--font-title); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #8d97a8; cursor: pointer; white-space: nowrap; transition: color .2s, text-shadow .2s; }
#title .tsw-box button:hover:not(.on) { color: var(--ivory); }
#title .tsw-box button.on { color: var(--gold-2); text-shadow: 0 0 10px rgba(226, 184, 74, .6); }
@media (max-width: 520px) { #title .tsw-row { grid-template-columns: 1fr; } }          /* en pantallas estrechas, un selector por fila (si no, «Rendimiento» no cabe) */
#title .tsw-row { transition: opacity .7s ease .95s, transform .7s cubic-bezier(.2, .7, .2, 1) .95s; }
#title.pre .tsw-row { opacity: 0; transform: translateY(12px); }
@media (prefers-reduced-motion: reduce) { #title .tsw-thumb, #title .tsw-row { transition: none !important; transform: none; } #title .tsw-box[data-i="1"] .tsw-thumb { transform: translateX(100%) !important; } }
.file-row { display: flex; gap: 8px; flex-wrap: wrap; } .file-row .btn { flex: 1; justify-content: center; }
#title .credit { position: relative; flex: none; padding: 4px 16px 12px; text-align: center; font-size: 11px; color: #8d97a8; letter-spacing: .08em; z-index: 2; transition: opacity .8s ease 1s; }
/* entrada del título: fundido del fondo y aparición escalonada del emblema, el rótulo y el menú (Title.show quita .pre) */
#title.pre:not(.under) { opacity: 0; }
#title.under { transition: none; }          /* al arrancar: el fondo ya está bajo la pantalla de carga, que se funde encima */
#title .inner > *, #title .menu .btn, #title .menu-grid { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
#title.pre .inner > *, #title.pre .menu .btn { opacity: 0; transform: translateY(12px); }
#title.pre .credit { opacity: 0; }
#title .credit a { color: #e2b84a; text-decoration: underline; text-underline-offset: 2px; }
#title .inner > :nth-child(1) { transition-delay: .15s; } #title .inner > :nth-child(2) { transition-delay: .3s; } #title .inner > :nth-child(3) { transition-delay: .45s; }
#title .inner > .menu { transition: none; opacity: 1; transform: none; }
#title .menu .btn:nth-child(1) { transition-delay: .55s; } #title .menu .btn:nth-child(2) { transition-delay: .62s; } #title .menu .btn:nth-child(3) { transition-delay: .69s; }
#title .menu .btn:nth-child(4) { transition-delay: .76s; } #title .menu .btn:nth-child(5) { transition-delay: .83s; } #title .menu .btn:nth-child(6) { transition-delay: .9s; }
@media (prefers-reduced-motion: reduce) { #title .inner > *, #title .menu .btn { transform: none !important; transition-delay: 0s !important; } }
.field { display: flex; flex-direction: column; gap: 5px; text-align: left; margin-bottom: 14px; }
.field label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.field input[type=text] { padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); color: var(--ivory); font-size: 15px; font-family: var(--font-title); letter-spacing: .08em; }
.field input[type=text]:focus { outline: 2px solid var(--gold); border-color: transparent; }

/* Toasts */
#toasts { position: fixed; top: calc(var(--hud-h, 70px) + 22px); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 9px 18px; border-radius: 22px; background: rgba(8, 12, 20, 0.95); border: 1px solid var(--line-strong); font-size: 13px; box-shadow: var(--shadow); animation: toastIn .3s cubic-bezier(.16, 1, .3, 1); display: flex; gap: 8px; align-items: center; max-width: 80vw; }
.toast.good { border-color: rgba(79, 192, 141, 0.7); color: #b5efd3; } .toast.bad { border-color: rgba(229, 72, 77, 0.7); color: #ffc2c4; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96) } to { opacity: 1; transform: none } }

/* Ayuda */
.help h3 { font-size: 13px; color: var(--gold); margin: 14px 0 6px; letter-spacing: .14em; text-transform: uppercase; }
.help p, .help li { font-size: 13.5px; color: #d6d9e0; margin: 0 0 6px; }
.help ul { padding-left: 18px; margin: 0; }
.help kbd { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-bottom-width: 2px; padding: 0 6px; border-radius: 4px; font-size: 12px; }
.matrix { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.matrix th, .matrix td { padding: 4px 6px; text-align: center; border: 1px solid rgba(255, 255, 255, .08); }
.matrix .w { background: rgba(79, 192, 141, .22); } .matrix .l { background: rgba(229, 72, 77, .2); }

#loading { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; color: var(--gold); font-family: var(--font-title); letter-spacing: .3em; transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .load-emblem { width: 117px; height: 110px; display: block; margin: 0 auto 14px; animation: pulse 1.6s infinite; }
/* pantalla de carga: lema, barra de cohortes (10 manípulos) y mensaje de la fase (js/loading.js) */
#loading .ld-box { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
#loading .ld-name { font-size: 22px; }
#loading .ld-tag { font: 500 11px/1.2 Inter, system-ui, sans-serif; letter-spacing: .24em; text-transform: uppercase; color: #9aa3b2; }
#loading .ld-bar { display: flex; gap: 6px; margin-top: 22px; }
#loading .ld-bar i { width: 26px; height: 8px; border-radius: 2px; border: 1px solid rgba(226, 184, 74, .35); background: rgba(226, 184, 74, .08); animation: ldWave 1.4s ease-in-out infinite; }
#loading .ld-bar i.on { background: linear-gradient(180deg, #f1cf6c, #c79b2f); border-color: #f1cf6c; box-shadow: 0 0 8px rgba(226, 184, 74, .55); animation: none; }
#loading .ld-msg { min-height: 1.4em; margin-top: 8px; font: 400 13px/1.4 Inter, system-ui, sans-serif; letter-spacing: .04em; color: #c9b27a; }
@keyframes ldWave { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #loading .ld-bar i { animation: none; } }

/* Puntos de corte del HUD:
   · escritorio: más de 1100 px de ancho
   · tablet:     hasta 1100 px (o hasta 500 px de alto, móvil en horizontal): sin minimapa y con los botones de icono en un menú
   · móvil:      hasta 700 px (o hasta 500 px de alto): barra superior en una sola línea, Juegos y Fin del año solo con icono */
@media (max-width: 1500px) { .stat .v small, .stat .k span.t { display: none; } .stat { min-width: 0; padding: 3px 9px; } }          /* turno, siguiente rango, ingreso anual: solo si sobra sitio */
@media (max-width: 1360px) {
  .stat .k span.t { display: none; }
  .stat { min-width: 0; padding: 3px 8px; }
  .brand h1, .brand small { display: none; }          /* el título y el subtítulo se van juntos: queda solo el escudo */
}
@media (max-width: 1280px) {
  #left { width: 250px; } #dossier { width: 330px; }
  .stat { min-width: 0; padding: 3px 8px; }
}
@media (max-width: 1100px) {
  .stat .k { font-size: 8.5px; }
  .parley { grid-template-columns: 180px 1fr; } .opt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px), (max-height: 500px) {
  #minimap-panel { display: none; }
  #left { width: 224px; } #dossier { width: 296px; }
  .hud-menu { display: block; position: relative; }
  .hud-menu-btn { display: inline-flex; }
  .hud-menu.open .hud-menu-btn { background: rgba(226, 184, 74, 0.22); border-color: var(--gold); color: var(--gold-2); }
  .hud-tools { display: none; position: absolute; right: 0; top: calc(100% + 10px); z-index: 12; flex-direction: column; gap: 3px; padding: 6px; min-width: 200px;
    background: rgba(12, 18, 29, 0.98); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); }
  .hud-menu.open .hud-tools { display: flex; }
  .hud-tools .btn-ic { width: auto; height: auto; padding: 9px 12px; justify-content: flex-start; gap: 10px; } .hud-tools .btn-ic .ic { width: 18px; height: 18px; }
  .hud-tools .lbl { display: inline; }
}
@media (max-width: 700px), (max-height: 500px) {
  #hud { gap: 8px; padding: 5px 8px; flex-wrap: nowrap; }
  .brand { padding-right: 0; border-right: 0; }
  .brand .logo, .brand .logo img { width: 32px; height: 32px; }
  .stats { gap: 0; }
  .stat { flex: none; padding: 2px 6px; }
  .stat .k { font-size: 8px; }
  .stat .v { font-size: 13.5px; gap: 3px; }
  .stat.year .v, .stat.rank .v { font-size: 13px; }
  .stat .v small { display: none; }
  .hud-right { gap: 6px; flex: none; }
  .hud-right .btn.games { width: 34px; height: 34px; padding: 0; }
  .hud-right .btn.games .txt { display: none; } .hud-right .btn.games .ic { width: 22px; height: 22px; }
  .hud-right .btn.primary { padding: 8px 12px; font-size: 11.5px; }
  #left { width: 190px; } #dossier { width: min(280px, calc(100vw - 24px)); }
  #dock { gap: 5px; padding: 5px 7px; } #dock .btn { padding: 4px 7px; } #dock .btn .ic { width: 19px; height: 19px; }
  .dos-art { height: 64px; } .dos-head.over { margin-top: -24px; } .dos-head { padding: 8px 10px 8px; gap: 8px; }          /* pantallas bajas: la lámina no se come el dossier */
  .dos-head h2 { font-size: 15px; } .dos-head .cities { font-size: 10.5px; }
}
@media (max-width: 560px) {
  .brand { display: none; }
  .hud-right .btn.primary { width: 34px; height: 34px; padding: 0; }
  .hud-right .btn.primary .txt { display: none; }
}
@media (max-height: 760px) { .ev-img { height: 150px; } .sheet-b { padding: 12px 18px; } }

/* ---- minimapa ---- */
#minimap-panel { flex: none; padding: 5px; }
#minimap { width: 100%; height: auto; display: block; border-radius: 6px; cursor: crosshair; background: #04070d; }
@media (max-height: 760px) { #minimap-panel { display: none; } }

/* ==== batalla3d ==== */
.modal:has(> .b3sheet) { backdrop-filter: none; background: rgba(3, 6, 12, 0.86); padding: 10px; }
/* batalla naval y juegos del Circo/Coliseo (clases navalsheet y minisheet, js/ui_fleets.js y js/ui_flow.js): sin blur de fondo */
.modal:has(> .navalsheet), .modal:has(> .minisheet) { backdrop-filter: none; }
.sheet.b3sheet { width: min(1360px, 100%); height: min(900px, calc(100vh - 20px)); max-height: calc(100vh - 20px); }
.b3sheet .sheet-h { padding: 8px 18px 7px; }
.b3sheet .sheet-h h2 { font-size: 16px; }
.b3sheet .sheet-h .sub { margin-top: 1px; }
.b3sheet .sheet-b { padding: 0; flex: 1; min-height: 0; overflow: hidden; display: flex; }
.b3 { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.b3-stage { position: relative; flex: 1; min-height: 240px; overflow: hidden; background: #0a0f1a; user-select: none; }
.b3-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.b3-cv:active { cursor: grabbing; }
.b3-ovl { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.b3-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px 10px rgba(0, 0, 0, 0.55); }

/* cabecera sobre la escena */
.b3-hud { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; padding: 10px 14px 26px; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 8, 14, 0.9), rgba(5, 8, 14, 0.55) 70%, rgba(5, 8, 14, 0)); }
.b3-gen { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.b3-gen.e { flex-direction: row-reverse; text-align: right; }
.b3-por { width: 62px; height: 62px; flex: none; border-radius: 50%; border: 2px solid var(--gold); overflow: hidden; display: grid; place-items: center; color: #ffe7a8;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.6); background: radial-gradient(circle at 35% 30%, #c93b3f, #5a1013 75%); }
.b3-por.e { background: radial-gradient(circle at 35% 30%, #3a5070, #121a28 75%); border-color: #9fc4e6; color: #c9e3f8; }
.b3-por .ic { width: 34px; height: 34px; }
.b3-por img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.b3-info { min-width: 0; flex: 1; max-width: 330px; }
.b3-name { font-family: var(--font-title); font-size: 14px; letter-spacing: .08em; color: #ffd0d1; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; }
.b3-gen.e .b3-name { color: #c9e3f8; }
.b3-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.b3-row { display: grid; grid-template-columns: 40px 1fr 46px; align-items: center; gap: 6px; font-size: 11px; height: 14px; pointer-events: auto; }
.b3-gen.e .b3-row { direction: rtl; }
.b3-row .k { color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.b3-row b { font-variant-numeric: tabular-nums; color: var(--ivory); font-size: 11.5px; text-align: right; }
.b3-gen.e .b3-row b { text-align: left; }
.b3-seg { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 8px; }
.b3-seg.cav { grid-template-columns: repeat(12, 1fr); }
.b3-seg i { background: rgba(255, 255, 255, 0.1); border-radius: 1.5px; transition: background .5s; }
.b3-gen.p .b3-seg i.on { background: linear-gradient(180deg, #ff7478, #b3282d); }
.b3-gen.e .b3-seg i.on { background: linear-gradient(180deg, #8fc6f2, #2f6aa8); }
.b3-seg.cav i.on { filter: saturate(.75) brightness(1.15); }
.b3-seg i.lost { animation: b3lost 1.8s ease forwards; }
@keyframes b3lost { 0%, 30% { background: #ffe7a0; box-shadow: 0 0 6px #ffcf5a; } 100% { background: rgba(120, 20, 20, 0.55); box-shadow: none; } }
.b3-bar { position: relative; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); }
.b3-bar > i { display: block; height: 100%; border-radius: 4px; transition: width .6s ease; }
.b3-bar.mor > i { background: linear-gradient(90deg, #4fc08d, #9be3b8); }
.b3-bar.mor.low > i { background: linear-gradient(90deg, #e8a33d, #ffcf6a); }
.b3-bar.fat > i { background: linear-gradient(90deg, #8a7a5a, #c9b27a); }
.b3-bar .thr { position: absolute; left: 25%; top: -3px; bottom: -3px; width: 2px; background: #ff6a6e; box-shadow: 0 0 4px #ff3a3e; }
.b3-gen.e .b3-bar .thr { left: auto; right: 25%; }
.b3-gen.hit .b3-por { animation: b3hit .7s ease; }
@keyframes b3hit { 30% { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(255, 80, 80, 0.6), 0 0 22px rgba(255, 60, 60, 0.7); } }
.b3-center { text-align: center; font-family: var(--font-title); padding-top: 2px; min-width: 190px; }
.b3-phase { font-size: 15px; letter-spacing: .2em; color: var(--gold-2); text-transform: uppercase; text-shadow: 0 2px 6px #000; }
.b3-pips { display: flex; gap: 5px; justify-content: center; margin: 5px 0 6px; }
.b3-pips i { width: 16px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); }
.b3-pips i.done { background: var(--gold); }
.b3-pips i.cur { background: #fff3c4; box-shadow: 0 0 8px var(--gold); animation: b3pulse 1.2s ease-in-out infinite; }
.b3-meta { display: flex; gap: 6px; justify-content: center; font-family: var(--font-body); font-size: 11px; }
.b3-terr, .b3-kind { padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.45); color: var(--ivory); }
.b3-kind { color: #ffb4b6; border-color: rgba(229, 72, 77, 0.5); }
.b3-kind.def { color: #b7dcf7; border-color: rgba(90, 169, 230, 0.5); }
.b3-last { font-family: var(--font-body); font-size: 11px; color: #aab3c2; margin-top: 5px; text-shadow: 0 1px 2px #000; }
.b3-last b { color: #c9e3f8; }

/* controles de cámara */
.b3-ctrls { position: absolute; right: 12px; bottom: 10px; z-index: 2; display: flex; gap: 6px; align-items: center; }
.b3-cbtn { pointer-events: auto; background: rgba(8, 12, 20, 0.74); border: 1px solid var(--line); color: var(--ivory); border-radius: 7px; padding: 5px 9px; font-size: 11.5px; cursor: pointer; }
.b3-cbtn:hover { border-color: var(--gold); color: var(--gold-2); }
.b3-stage kbd, .b3-cbtn kbd { font-family: var(--font-body); font-size: 9.5px; padding: 0 4px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 3px; margin-left: 3px; color: var(--muted); }
.b3-help { font-size: 10.5px; color: rgba(239, 230, 207, 0.65); text-shadow: 0 1px 2px #000; margin-left: 4px; }

/* rótulos que siguen a los ejércitos */
.b3-tag { position: absolute; left: 0; top: 0; display: flex; gap: 5px; align-items: center; padding: 3px 10px 3px 7px; border-radius: 12px; font-family: var(--font-title); font-size: 11.5px; letter-spacing: .08em;
  opacity: 0; transition: opacity .35s; white-space: nowrap; background: rgba(8, 12, 20, 0.8); border: 1px solid; }
.b3-tag.on { opacity: 1; }
.b3-tag .ic { width: 15px; height: 15px; }
.b3-tag.p { color: #ffc2c4; border-color: rgba(229, 72, 77, 0.75); }
.b3-tag.e { color: #c9e3f8; border-color: rgba(90, 169, 230, 0.75); }
.b3-float { position: absolute; left: 0; top: 0; font-family: var(--font-title); font-weight: 700; font-size: 28px; white-space: nowrap; text-shadow: 0 2px 4px #000, 0 0 14px rgba(0, 0, 0, 0.8); animation: b3float 2.4s ease forwards; }
.b3-float.p { color: #ff8a8e; }
.b3-float.e { color: #9fd0f7; }
.b3-float.big { font-size: 18px; }
@keyframes b3float { 0% { opacity: 0; } 12% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }

/* rótulo de fase y resultado */
.b3-banner { position: absolute; left: 50%; top: 34%; z-index: 3; transform: translate(-50%, -50%) scale(.92); text-align: center; pointer-events: none; opacity: 0; white-space: nowrap;
  transition: opacity .4s, transform .5s cubic-bezier(.16, 1, .3, 1); font-family: var(--font-title); padding: 24px 70px; background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(5, 8, 14, 0.62), rgba(5, 8, 14, 0) 100%); }
.b3-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.b3-banner small { display: block; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 4px; text-shadow: 0 1px 4px #000; }
.b3-banner span { font-size: 30px; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 3px 16px #000, 0 0 2px #000; }
.b3-banner span.p { color: #ffb0b3; }
.b3-banner span.e { color: #b7dcf7; }
.b3-banner em { font-style: normal; font-size: 13px; color: #c5ccd8; margin: 0 12px; letter-spacing: .2em; text-transform: uppercase; vertical-align: middle; text-shadow: 0 1px 4px #000; }
.b3-banner small.ord { color: #8ee4b6; margin: 6px 0 0; }
.b3-banner.intro span { font-size: 21px; }
.b3-result { position: absolute; left: 50%; top: 36%; z-index: 3; transform: translate(-50%, -50%); text-align: center; pointer-events: none; padding: 30px 90px 26px; white-space: nowrap;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(5, 8, 14, 0.85), rgba(5, 8, 14, 0.5) 55%, rgba(5, 8, 14, 0) 100%); animation: b3res .9s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes b3res { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); filter: blur(6px); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; } }
.b3-res-ic .ic { width: 48px; height: 48px; }
.b3-res-w { font-family: var(--font-title); font-size: 50px; letter-spacing: .3em; margin-right: -.3em; text-transform: uppercase; line-height: 1.1; }
.b3-result.win .b3-res-w { color: #f4d98a; text-shadow: 0 0 30px rgba(226, 184, 74, 0.65), 0 4px 18px #000; }
.b3-result.win .b3-res-ic { color: var(--gold); animation: b3spin 1.2s ease both; }
.b3-result.lose .b3-res-w { color: #ff8a8e; text-shadow: 0 0 26px rgba(229, 72, 77, 0.6), 0 4px 18px #000; }
.b3-result.lose .b3-res-ic { color: #ff8a8e; }
.b3-result.draw .b3-res-w { color: #e8e0c8; text-shadow: 0 4px 18px #000; }
.b3-result.draw .b3-res-ic { color: var(--muted); }
.b3-res-why { font-size: 14px; color: var(--ivory); margin-top: 4px; text-shadow: 0 1px 4px #000; }
.b3-res-n { font-size: 12px; color: #aab3c2; margin-top: 4px; text-shadow: 0 1px 3px #000; }

/* mando: tácticas, órdenes y crónica */
.b3-cmd { display: grid; grid-template-columns: minmax(0, 1fr) 380px; border-top: 1px solid var(--line); background: rgba(5, 8, 14, 0.94); flex: none; }
.b3-tacwrap { padding: 10px 14px 8px; min-width: 0; }
.b3-tacrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.b3-tac { position: relative; padding: 7px 6px 6px; border-radius: 9px; background: linear-gradient(180deg, rgba(34, 45, 66, 0.92), rgba(18, 25, 38, 0.94)); border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; color: var(--ivory); min-height: 66px; }
.b3-tac:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 16px -6px rgba(226, 184, 74, 0.5); }
.b3-tac.on { border-color: var(--gold-2); background: linear-gradient(180deg, rgba(226, 184, 74, 0.32), rgba(120, 90, 20, 0.25)); box-shadow: 0 0 18px -4px rgba(226, 184, 74, 0.7); }
.b3-tac:disabled { opacity: .38; cursor: not-allowed; }
.b3-tac.on:disabled { opacity: 1; }
.b3-tac .b3-ic .ic { width: 24px; height: 24px; color: var(--gold); display: block; margin: 0 auto 2px; }
.b3-tac b { display: block; font-family: var(--font-title); font-size: 11.5px; letter-spacing: .06em; }
.b3-key { position: absolute; top: 4px; left: 7px; font-size: 9.5px; color: var(--muted); }
.b3-tend { position: absolute; top: 4px; right: 6px; font-size: 10px; color: #8cc8f2; font-weight: 700; }
.b3-adv { display: inline-block; margin-top: 3px; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.b3-adv.up { color: #8ee4b6; background: rgba(79, 192, 141, 0.14); }
.b3-adv.down { color: #ff9ea1; background: rgba(229, 72, 77, 0.14); }
.b3-adv.eq { color: var(--muted); background: rgba(255, 255, 255, 0.06); }
.b3-tac.rec::after { content: var(--i18n-consejo, 'consejo'); position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 9px; background: var(--green); color: #052; padding: 1px 6px; border-radius: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.b3-orderrow { display: flex; gap: 10px; align-items: center; margin-top: 7px; min-height: 30px; }
.b3-orders { display: flex; gap: 6px; align-items: center; flex: none; }
.b3-order { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: 14px; font-size: 11.5px; font-weight: 600; cursor: pointer; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--ivory); }
.b3-order .ic { width: 15px; height: 15px; color: var(--gold); }
.b3-order:hover:not(:disabled) { border-color: var(--gold); }
.b3-order.on { background: rgba(79, 192, 141, 0.2); border-color: #4fc08d; color: #b8f0d2; box-shadow: 0 0 10px -2px rgba(79, 192, 141, 0.6); }
.b3-order:disabled { opacity: .4; cursor: not-allowed; }
.b3-armed { font-size: 10.5px; color: #8ee4b6; }
.b3-desc { font-size: 11.5px; color: #c5ccd8; line-height: 1.35; flex: 1; min-width: 0; }
.b3-log { border-left: 1px solid var(--line); padding: 7px 12px; overflow-y: auto; max-height: 132px; font-size: 11.5px; color: #c5ccd8; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; }
.b3-entry { border-left: 2px solid rgba(255, 255, 255, 0.2); padding: 2px 0 3px 8px; margin: 3px 0 6px; animation: b3in .4s ease both; }
.b3-entry.win { border-color: #4fc08d; }
.b3-entry.lose { border-color: var(--crimson-2); }
.b3-eh { display: flex; gap: 5px; align-items: baseline; flex-wrap: wrap; font-family: var(--font-title); font-size: 11px; }
.b3-eh .ph { color: var(--gold-2); letter-spacing: .1em; text-transform: uppercase; }
.b3-eh .t { color: var(--ivory); }
.b3-eh .vs { color: var(--muted); font-size: 10px; }
.b3-eh .adv { margin-left: auto; font-family: var(--font-body); font-size: 10px; font-weight: 700; }
.b3-entry.win .adv { color: #8ee4b6; }
.b3-entry.lose .adv { color: #ff9ea1; }
.b3-entry.even .adv { color: var(--muted); }
.b3-entry p { margin: 1px 0; font-size: 11px; color: #aeb7c6; }
.b3-loss { font-size: 11px; margin-top: 2px; }
.b3-loss .p { color: #ff9ea1; font-weight: 700; }
.b3-loss .e { color: #9fd0f7; font-weight: 700; }
.b3-loss .mor { color: var(--muted); }
.b3-line { padding: 2px 0; animation: b3in .4s ease both; }
.b3-line.win { color: #8ee4b6; font-weight: 600; }
.b3-line.lose { color: #ff9ea1; font-weight: 600; }
.b3-line.info { color: #d9cfb2; font-style: italic; }
.b3-foot { padding: 8px 16px 10px; }
.b3-foot .btn.on { background: rgba(226, 184, 74, 0.22); border-color: var(--gold); color: var(--gold-2); }
.b3-note { font-size: 11.5px; }
.b3-sum { font-size: 12.5px; color: var(--ivory); }
.b3-stage.nogl { background: radial-gradient(ellipse at 50% 70%, #3e5a30, #0a0f1a); }
@keyframes b3pulse { 50% { opacity: .55; } }
@keyframes b3spin { 0% { transform: rotate(-30deg) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes b3in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) {
  .b3-cmd { grid-template-columns: 1fr; }
  .b3-log { border-left: 0; border-top: 1px solid var(--line); max-height: 90px; }
  .b3-info { max-width: 220px; }
  .b3-help { display: none; }
  .b3-center { min-width: 140px; }
}
@media (max-height: 760px) {
  .b3-por { width: 48px; height: 48px; }
  .b3-log { max-height: 104px; }
  .b3-tac { min-height: 58px; padding: 5px 4px; }
  .b3-hud { padding-bottom: 14px; }
  .b3-res-w { font-size: 44px; }
}
/* ==== /batalla3d ==== */

/* ---- Enciclopedia (ventana de provincia / ficha de jefe) ---- */
.sheet.wiki .sheet-b { padding: 0; overflow: auto; }
.wk { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 0; }
.wk-left { padding: 16px 18px 18px 20px; display: flex; flex-direction: column; gap: 12px; background: rgba(0, 0, 0, 0.18); border-right: 1px solid var(--line); }
.wk-right { padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 10px; }
.wk-right p { margin: 0; font-size: 14px; line-height: 1.65; color: #d8dcea; text-align: left; }
.wk-right p.lead::first-letter { font-family: var(--font-title); font-size: 2.3em; float: left; line-height: 0.9; padding: 4px 6px 0 0; color: var(--gold-2); }
.wk-years { font-family: var(--font-title); letter-spacing: 0.08em; color: var(--gold); font-size: 12.5px; text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.wk-hero { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); cursor: zoom-in; aspect-ratio: 3 / 2; background: #0b111c; box-shadow: 0 10px 30px -10px #000; }
.wk-hero img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s; }
.wk-hero:hover img { transform: scale(1.035); }
.wk-hero .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 8px; font-size: 11.5px; line-height: 1.4; color: #e6e9f2; background: linear-gradient(180deg, transparent, rgba(5, 8, 14, 0.92)); display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; }
.wk-hero .cap i { opacity: 0.6; white-space: nowrap; font-size: 10.5px; }
.wk-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wk-fact { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.wk-fact small, .wk-cities small, .wk-traits small, .wk-lead small, .wk-prov small { display: block; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 9.5px; margin-bottom: 2px; }
.wk-fact b { font-size: 13.5px; color: #eef0f7; }
.wk-cities { font-size: 12.5px; color: #cfd5e4; line-height: 1.5; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.wk-fact-box { border-left: 3px solid var(--gold); background: rgba(226, 184, 74, 0.08); padding: 9px 12px; border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.55; color: #e6e1cf; }
.wk-fact-box b { display: block; color: var(--gold-2); font-family: var(--font-title); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; margin-bottom: 2px; }
.wk-fact-box.tac { border-color: #c8323a; background: rgba(200, 50, 58, 0.08); }
.wk-src { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.wk-lead, .wk-prov { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; background: rgba(255, 255, 255, 0.04); transition: background 0.15s, border-color 0.15s; }
.wk-lead:hover, .wk-prov:hover { background: rgba(226, 184, 74, 0.12); border-color: var(--gold); }
.wk-lead .por { width: 58px; height: 58px; border-radius: 8px; background-size: cover; background-position: center top; border: 1px solid var(--gold); flex: none; image-rendering: pixelated; }
.wk-lead b, .wk-prov b { display: block; font-size: 15px; color: var(--gold-2); }
.wk-lead span { font-size: 11.5px; color: var(--muted); }
.wk-lead em, .wk-prov em { margin-left: auto; font-style: normal; color: var(--gold); font-size: 12px; white-space: nowrap; }
.wk-portrait { border-radius: 10px; overflow: hidden; border: 2px solid var(--gold); cursor: zoom-in; box-shadow: 0 10px 30px -10px #000; aspect-ratio: 4 / 3; background: #1b1308; }
.wk-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; }
.wk-badge { align-self: flex-start; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(47, 138, 82, 0.2); color: #8fe3b2; border: 1px solid rgba(47, 138, 82, 0.6); }
.wk-badge.inv { background: rgba(179, 116, 31, 0.2); color: #f0c27a; border-color: rgba(179, 116, 31, 0.6); }
.wk-traits { display: flex; flex-direction: column; gap: 5px; }
.wk-bar { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; font-size: 12px; color: #cfd5e4; }
.wk-bar div { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.wk-bar i { display: block; height: 100%; background: linear-gradient(90deg, #b3282d, #e2b84a); }
.wk-tac { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-tac span { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; background: rgba(255, 255, 255, 0.05); }
.wk-zoom { position: fixed; inset: 0; z-index: 99999; background: rgba(3, 5, 10, 0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: zoom-out; padding: 20px; }
.wk-zoom img { max-width: 96vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 30px 90px #000; }
.wk-zoom .cap { color: #cfd5e4; font-size: 13px; text-align: center; max-width: 900px; }
@media (max-width: 820px) { .wk { grid-template-columns: 1fr; } .wk-left { border-right: 0; border-bottom: 1px solid var(--line); } }
.dos-art { cursor: pointer; }
.dos-art .more { position: absolute; right: 10px; top: 8px; z-index: 2; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(8, 12, 22, 0.78); border: 1px solid var(--gold); color: var(--gold-2); }
.dos-art:hover .more { background: rgba(226, 184, 74, 0.9); color: #1a1205; }
.portrait.link { cursor: pointer; }
.portrait.link:hover { box-shadow: 0 0 0 2px var(--gold); }
.b3sheet .sheet-h.art { background-size: cover; background-position: center 40%; min-height: 58px; position: relative; }
.b3sheet .sheet-h.art > * { position: relative; z-index: 1; }
.b3sheet .sheet-h.art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 12, 22, 0.92) 0%, rgba(8, 12, 22, 0.55) 55%, rgba(8, 12, 22, 0.8) 100%); }

/* ---- Crónica de campaña: camino a César, estadísticas y gráficas ---- */
.sheet.chronicle .sheet-b { padding: 0; }
.ch-tabs { display: flex; gap: 2px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid); z-index: 2; }
.ch-tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 9px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ch-tabs button:hover { color: var(--gold-2); }
.ch-tabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
.ch-body { padding: 16px 18px 18px; }
.ch-hero { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, rgba(226,184,74,.08), rgba(255,255,255,.02)); margin-bottom: 14px; }
.ch-ring { display: grid; place-items: center; padding-top: 6px; }
.ch-goal h3 { margin: 0 0 4px; font-size: 18px; color: var(--gold); letter-spacing: .06em; }
.ch-goal p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; }
.ch-req { margin-bottom: 9px; }
.ch-reqh { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.ch-reqh span { color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: 10.5px; flex: 1; }
.ch-reqh b { color: var(--ivory); font-variant-numeric: tabular-nums; }
.ch-reqh i { font-style: normal; font-size: 12px; }
.ch-reqh i.ok { color: var(--green); } .ch-reqh i.no { color: var(--crimson-2); }
.ch-bar { height: 8px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; }
.ch-bar i { display: block; height: 100%; border-radius: 5px; transition: width .6s ease; }
.ch-pips { display: flex; gap: 4px; margin: 4px 0 4px; }
.ch-pip { flex: 1; text-align: center; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 5px 0; border-radius: 6px; background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid transparent; }
.ch-pip.done { background: rgba(226,184,74,.18); color: var(--gold-2); }
.ch-pip.cur { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(226,184,74,.35); }
.ch-proj { margin-top: 10px; padding: 9px 12px; border-radius: 9px; background: rgba(92,176,255,.1); border: 1px solid rgba(92,176,255,.3); font-size: 12.5px; line-height: 1.45; }
.ch-proj b { display: block; color: #8fd0ff; font-size: 15px; margin-bottom: 2px; }
.ch-proj.dim { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); } .ch-proj.dim b { color: var(--muted); }
.ch-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ch-tile { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-tile small { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ch-tile b { font-size: 17px; color: var(--ivory); font-variant-numeric: tabular-nums; }
.ch-tile span { font-size: 11px; color: var(--muted); }
.ch-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ch-card { padding: 10px 12px 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid rgba(255,255,255,.07); min-width: 0; }
.ch-card h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); display: flex; justify-content: space-between; }
.ch-card h4 span { color: var(--muted); letter-spacing: .06em; text-transform: none; font-weight: 400; }
.ch-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ch-leg span { display: inline-flex; align-items: center; gap: 5px; } .ch-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ch-leg.col { flex-direction: column; font-size: 12.5px; gap: 6px; } .ch-leg.col b { color: var(--ivory); }
.ch-donut { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 6px 0; }
.ch-hbars { display: flex; flex-direction: column; gap: 7px; padding: 6px 0; }
.ch-hb { display: grid; grid-template-columns: 110px 1fr 42px; gap: 8px; align-items: center; font-size: 12px; }
.ch-hb > div { height: 9px; background: rgba(255,255,255,.07); border-radius: 5px; overflow: hidden; } .ch-hb > div i { display: block; height: 100%; background: linear-gradient(90deg, #c98b2f, #f4d98a); border-radius: 5px; }
.ch-hb b { text-align: right; font-variant-numeric: tabular-nums; }
.ch-filter { display: flex; gap: 6px; margin-bottom: 10px; } .ch-filter .btn.sel { background: rgba(226,184,74,.18); border-color: var(--gold); color: var(--gold-2); }
@media (max-width: 860px) { .ch-hero { grid-template-columns: 1fr; } .ch-tiles { grid-template-columns: repeat(2, 1fr); } .ch-charts { grid-template-columns: 1fr; } }

/* ---- Batalla en tiempo real ---- */
.rt-stage canvas { cursor: default; touch-action: none; }
.rt-tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 1px 5px 2px; border-radius: 8px; background: rgba(8, 12, 20, 0.78); border: 1px solid; font-size: 10.5px; line-height: 1.1; white-space: nowrap; pointer-events: none; min-width: 24px; text-align: center; will-change: transform; }
.rt-tag .n { font-family: var(--font-title); font-size: 12px; letter-spacing: .06em; }
.rt-tag .m { font-variant-numeric: tabular-nums; opacity: .92; font-size: 10px; }
.rt-tag .m:empty { display: none; }
.rt-tag .bar { display: block; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.rt-tag .bar u { display: block; height: 100%; text-decoration: none; transition: width .25s; }
.rt-tag.p { color: #ffe9b0; border-color: rgba(226, 184, 74, 0.7); }
.rt-tag.e { color: #ffc4c0; border-color: rgba(229, 96, 90, 0.7); }
.rt-tag.cmd { border-radius: 50%; min-width: 22px; padding: 2px 5px; background: rgba(60, 44, 8, 0.9); }
.rt-tag.cmd .m, .rt-tag.cmd .bar { display: none; }
.rt-tag.sel { box-shadow: 0 0 0 2px var(--gold-2), 0 0 14px rgba(255, 224, 140, 0.7); background: rgba(70, 52, 12, 0.92); }
.rt-tag.eng { border-style: dashed; }
.rt-tag.rout { opacity: .55; filter: grayscale(.8); }
.rt-tag.free { opacity: .6; }
.rt-help { position: absolute; left: 12px; bottom: 10px; z-index: 2; max-width: 62%; font-size: 10.5px; color: rgba(239, 230, 207, 0.72); text-shadow: 0 1px 2px #000; pointer-events: none; line-height: 1.35; }
.rt-help b { color: var(--gold-2); font-weight: 600; }
.b3-cbtn.on { border-color: var(--gold); color: var(--gold-2); background: rgba(60, 44, 8, 0.8); }
.b3-phase.frozen { color: #8fd0ff; }
.rt-cmd { height: 176px; flex: none; }
.rt-cmd > * { overflow-y: auto; min-height: 0; }
.rt-cmd .b3-log { max-height: none; }
.rt-deploy { padding: 6px 14px 4px; min-width: 0; }
.rt-deploy .b3-tac { padding: 5px 4px 4px; }
.rt-deploy .b3-desc { margin-top: 5px; }
.rt-lab { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 4px 0 4px; }
.rt-frow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 4px; }
.rt-trow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.rt-enemy { margin-top: 6px; font-size: 12px; color: #c9e3f8; }
.rt-enemy .muted { color: var(--muted); font-weight: 400; }
.rt-sel { padding: 10px 14px; min-width: 0; font-size: 12.5px; }
.rt-sel-empty { color: var(--muted); font-size: 12px; line-height: 1.5; }
.rt-sel-h { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-title); letter-spacing: .06em; font-size: 14px; color: var(--gold-2); margin-bottom: 4px; }
.rt-sel-h span { font-family: var(--font-body); font-size: 12px; color: var(--ivory); letter-spacing: 0; }
.rt-sel-r { color: var(--muted); margin: 2px 0; } .rt-sel-r b { color: var(--ivory); }
.rt-sel-w { margin-top: 6px; color: #ffb07a; font-size: 11.5px; }
.rtsheet .b3-stage { min-height: 420px; }
@media (max-width: 760px) { .rt-frow { grid-template-columns: repeat(2, 1fr); } .rt-trow { grid-template-columns: repeat(3, 1fr); } .rt-help { display: none; } }
.rt-deploy .b3-tac { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 3px 6px; min-height: 32px; }
.rt-deploy .b3-tac .b3-ic { display: inline-flex; margin: 0; }
.rt-deploy .b3-tac .b3-ic .ic { width: 17px; height: 17px; margin: 0; }
.rt-deploy .b3-tac b { font-size: 11px; display: inline; }
.rt-deploy .b3-tac .b3-key { top: 1px; left: 4px; }
.rt-deploy .rt-lab { margin: 2px 0 3px; }
.rt-deploy .rt-enemy { margin-top: 4px; }
.rt-deploy .b3-desc { margin-top: 4px; line-height: 1.3; }

/* ficha de provincia: capital histórica + emblema */
.wk-citybox { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 10px 0; border: 1px solid rgba(233, 194, 90, 0.35); border-radius: 10px; background: linear-gradient(180deg, rgba(60, 42, 20, 0.45), rgba(24, 16, 8, 0.45)); }
.wk-citybox img { width: 58px; height: 58px; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.wk-citybox small { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2, #e9c25a); }
.wk-citybox b { display: block; font-family: Georgia, serif; font-style: italic; font-size: 17px; color: #fff4d4; }
.wk-citybox span { display: block; font-size: 12px; opacity: 0.85; line-height: 1.35; }
.wk-citybox em { display: block; font-size: 11px; opacity: 0.7; margin-top: 2px; }

/* tarjetas con cabecera ilustrada (ascensos, anales, invasiones, informes...) */
.sheet.withart .sheet-b { padding: 0 0 16px; }
.sheet-art-b { padding: 14px 22px 0; }
.sheet.withart .ev-img { height: 200px; }
@media (max-height: 760px) { .sheet.withart .ev-img { height: 140px; } }

/* ---- victoria: diploma de César (tarjeta 3D) ---- */
.vc-root { --cw: min(380px, 80vw, calc((100vh - 210px) * 0.636)); position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; opacity: 0; transition: opacity .5s linear;
  background: radial-gradient(ellipse at 50% 42%, rgba(52, 34, 12, 0.6), rgba(3, 4, 8, 0.94) 72%); }
.vc-root.in { opacity: 1; } .vc-root.out { opacity: 0; transition-duration: .35s; }
.vc-confetti { position: absolute; inset: 0; pointer-events: none; }
.vc-glow { position: absolute; width: 74vmin; height: 74vmin; left: 50%; top: 46%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(244, 217, 138, 0.26), transparent 62%); filter: blur(8px); pointer-events: none; animation: vc-pulse 5s ease-in-out infinite; }
.vc-stage { position: relative; width: var(--cw); height: calc(var(--cw) / 0.636); perspective: 1500px; animation: vc-drop .9s cubic-bezier(.2, .9, .25, 1.05) both, vc-float 6s ease-in-out .9s infinite; }
.vc-tilt { width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out; }
.vc-card { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.5s cubic-bezier(.45, .05, .2, 1); cursor: pointer; }
.vc-card.flipped { transform: rotateY(180deg); }
.vc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; overflow: hidden; padding: 7% 8% 6%; display: flex; flex-direction: column; align-items: center; text-align: center; color: #3a2a14;
  background: radial-gradient(ellipse at 28% 18%, #f8efd5 0%, #ecdcb0 46%, #cfb47c 100%);
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 238, 176, 0.45) inset, inset 0 0 70px rgba(122, 82, 22, 0.42); }
.vc-face::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.3; mix-blend-mode: multiply; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .32  0 0 0 0 .15  0 0 0 .7 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>"); }
.vc-back { transform: rotateY(180deg); }
.vc-frame { position: absolute; inset: 3.4%; border: 2px solid #b88a22; border-radius: 8px; box-shadow: inset 0 0 0 6px transparent, inset 0 0 0 7.5px rgba(184, 138, 34, 0.6); pointer-events: none; }
.vc-top { position: relative; width: 78%; margin-top: 1%; display: flex; justify-content: center; }
.vc-top .vc-laurel { width: 100%; height: auto; filter: drop-shadow(0 1px 1px rgba(80, 50, 8, 0.5)); }
.vc-top img { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); width: 26%; height: auto; filter: drop-shadow(0 2px 3px rgba(60, 35, 5, 0.55)); }
.vc-kicker { margin-top: 2.5%; font: 700 clamp(8px, 1.45vh, 11px) var(--font-title); letter-spacing: 0.3em; text-transform: uppercase; color: #7a5a1c; }
.vc-title { margin-top: 3%; font-family: var(--font-title); font-weight: 900; font-size: calc(var(--cw) * 0.118); letter-spacing: 0.14em; line-height: 1.05;
  background: linear-gradient(180deg, #a8262c 0%, #8f1d22 55%, #5e0f13 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 rgba(255, 244, 204, 0.85)); }
.vc-title.sm { font-size: calc(var(--cw) * 0.082); letter-spacing: 0.1em; }
.vc-sub { margin-top: 1%; font: italic 600 clamp(10px, 1.7vh, 13px) Georgia, serif; letter-spacing: 0.1em; color: #8a6417; }
.vc-rule { position: relative; width: 70%; height: 14px; margin: 3.5% 0 2.5%; }
.vc-rule::before, .vc-rule::after { content: ''; position: absolute; top: 50%; width: 41%; height: 1px; background: linear-gradient(90deg, transparent, #b88a22); }
.vc-rule::before { left: 0; } .vc-rule::after { right: 0; transform: scaleX(-1); }
.vc-rule i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 9px; height: 9px; background: #b88a22; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.vc-name { font: italic 700 calc(var(--cw) * 0.074) Georgia, serif; color: #2a1a08; line-height: 1.15; margin-top: 1%; }
.vc-text { margin: 3% 0 0; max-width: 88%; font: 500 clamp(10.5px, 1.75vh, 13.5px) Georgia, serif; line-height: 1.55; color: #4a3414; }
.vc-seal { margin-top: auto; filter: drop-shadow(0 4px 5px rgba(60, 20, 10, 0.5)); transform: rotate(-4deg); }
.vc-seal svg { height: calc(var(--cw) * 0.235); width: auto; display: block; }
.vc-year { margin-top: 2.5%; font: 700 clamp(9px, 1.5vh, 11.5px) var(--font-title); letter-spacing: 0.28em; color: #7a5a1c; }
.vc-stats { position: relative; z-index: 1; width: 86%; flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; margin: 1% 0 3%; }
.vc-kv { display: flex; align-items: baseline; gap: 6px; text-align: left; }
.vc-kv span { font: 700 clamp(8px, 1.35vh, 10.5px) var(--font-title); letter-spacing: 0.12em; text-transform: uppercase; color: #7a5a1c; white-space: nowrap; }
.vc-kv i { flex: 1; border-bottom: 1.5px dotted rgba(138, 100, 23, 0.55); transform: translateY(-3px); min-width: 8px; }
.vc-kv b { font: italic 700 clamp(13px, 2.3vh, 18px) Georgia, serif; color: #2a1a08; white-space: nowrap; }
.vc-mark { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 62%; opacity: 0.09; mix-blend-mode: multiply; pointer-events: none; }
.vc-mark img { width: 100%; height: auto; display: block; }
.vc-foot { margin-top: auto; font: italic 600 clamp(9px, 1.4vh, 11px) Georgia, serif; color: #8a6417; }
.vc-glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.62) 50%, transparent 62%); background-size: 320% 100%; background-position: 170% 0; opacity: 0.55; animation: vc-sheen 6.5s ease-in-out infinite; }
.vc-hint { font: 600 12px var(--font-body); letter-spacing: 0.08em; color: var(--gold-2); opacity: 0; animation: vc-hint 1s 1.4s forwards; }
.vc-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@keyframes vc-drop { from { transform: translateY(-80px) rotateX(26deg) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes vc-sheen { 0%, 52% { background-position: 170% 0; } 78%, 100% { background-position: -70% 0; } }
@keyframes vc-pulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes vc-hint { to { opacity: 0.85; } }


/* ---------- Prólogo (js/intro.js + js/intro_motion.js) ---------- */
#intro { position: fixed; inset: 0; z-index: 55; background: transparent; opacity: 0; transition: opacity .6s ease; cursor: pointer; overflow: hidden; }
#intro.on { opacity: 1; }
#intro.out { background: #000; pointer-events: none; }
#intro.out .i-skip, #intro.out .i-hint { display: none; }
#intro .i-continue { position: absolute; left: 50%; bottom: 12vh; z-index: 7; min-width: 230px; opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: opacity .6s ease .15s, transform .6s ease .15s; }
#intro.held .i-continue { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#intro.held .i-skip { display: none; }
#intro.leaving { transition: opacity .9s ease; pointer-events: none; }
#intro.leaving .i-continue, #intro.leaving .i-hint, #intro.leaving .i-skip { display: none; }
body.handoff #hud, body.handoff #left, body.handoff #dock, body.handoff #labels { animation: hudIn 1.2s ease both; }
@keyframes hudIn { from { opacity: 0; } to { opacity: 1; } }
#intro .im-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#intro .i-skip { position: absolute; right: 22px; bottom: 20px; z-index: 7; padding: 9px 16px; font-family: var(--font-title); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #e8e0cb; background: rgba(8, 12, 20, 0.62); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 8px; cursor: pointer; backdrop-filter: blur(4px); }
#intro .i-skip:hover { border-color: var(--gold); color: var(--gold-2); }
#intro .i-hint { position: absolute; left: 22px; bottom: 26px; z-index: 7; font-size: 11px; letter-spacing: .06em; color: rgba(232, 224, 203, 0.5); pointer-events: none; }

/* ---------- Escala de la interfaz (Opciones) ----------
   UIScale (js/ui_hud.js) pone --ui y la clase ui-scaled en <html> solo cuando la escala no es 100 %. Cada contenedor de la
   interfaz se escala con transform desde su esquina de anclaje y reparte su tamaño entre --ui para seguir ocupando el mismo
   hueco; así getBoundingClientRect/offsetWidth siguen dando medidas fiables y no se tocan #gl ni #labels (el mapa 3D, sus
   etiquetas y las coordenadas de clic quedan intactos). El tooltip se escala sin zoom para posicionarse con clientX/Y. */
html.ui-scaled #hud { right: auto; width: calc((100vw - 24px) / var(--ui)); transform: scale(var(--ui)); transform-origin: 0 0; }
html.ui-scaled #left { bottom: auto; height: calc((100vh - var(--hud-h, 70px) - 36px) / var(--ui)); transform: scale(var(--ui)); transform-origin: 0 0; }
html.ui-scaled #dossier { bottom: auto; height: calc((100vh - var(--hud-h, 70px) - 22px - var(--dock-b)) / var(--ui)); transform: scale(var(--ui)) translateX(120%); transform-origin: 100% 0; }
html.ui-scaled #dossier.open { transform: scale(var(--ui)); }
html.ui-scaled #dock { max-width: calc((100vw - 24px) / var(--ui)); transform: scale(var(--ui)); transform-origin: 100% 100%; }
html.ui-scaled #hint { transform: translateX(-50%) scale(var(--ui)); transform-origin: 50% 100%; }
html.ui-scaled #toasts { transform: translateX(-50%) scale(var(--ui)); transform-origin: 50% 0; }
html.ui-scaled #modal-root { inset: auto; top: 0; left: 0; width: calc(100vw / var(--ui)); height: calc(100vh / var(--ui)); height: calc(100dvh / var(--ui)); transform: scale(var(--ui)); transform-origin: 0 0; }
html.ui-scaled .sheet { max-height: calc((100vh - 36px) / var(--ui)); }
html.ui-scaled .sheet.b3sheet { height: min(900px, calc((100vh - 20px) / var(--ui))); max-height: calc((100vh - 20px) / var(--ui)); }
html.ui-scaled .tooltip { transform: translate(14px, 14px) scale(var(--ui)); transform-origin: 0 0; }

/* aviso discreto de MapPuzzle en la portada: una esquina, cerrable y recordado (no afecta a la partida) */
.cross-card { position: fixed; right: 16px; bottom: 64px; z-index: 45; display: flex; align-items: center; gap: 10px; max-width: 290px; padding: 8px; border-radius: 12px; background: rgba(10, 15, 26, .9); border: 1px solid rgba(226, 184, 74, .4); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); color: #e9e2cf; text-decoration: none; font: 12px/1.35 Inter, system-ui, sans-serif; transition: border-color .2s; }
.cross-card:hover { border-color: #e2b84a; }
.cross-card img { width: 38px; height: 38px; border-radius: 8px; flex: 0 0 auto; }
.cross-card span { display: flex; flex-direction: column; min-width: 0; }
.cross-card small { font-size: 10.5px; opacity: .75; letter-spacing: .02em; }
.cross-card b { font-family: var(--font-title); font-size: 14px; letter-spacing: .05em; color: #f4d98a; }
.cross-card .cross-x { flex: 0 0 auto; align-self: flex-start; margin: -4px -4px 0 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #c9d1dc; font-size: 16px; line-height: 1; cursor: pointer; }
.cross-card .cross-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (max-width: 600px) { .cross-card { right: 10px; bottom: 76px; max-width: none; padding: 4px; gap: 4px; } .cross-card span { display: none; } .cross-card img { width: 32px; height: 32px; } .cross-card .cross-x { margin: -6px -6px 0 0; } }
