@import url('../vendor/fonts.css');

:root {
  --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 ---------- */
.panel { position: relative; background: var(--panel); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  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; }

/* ---------- 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: 38px; height: 38px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(226, 184, 74, 0.45)); }
.brand .logo .ic { width: 38px; height: 38px; }
.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: visible; }
.stat { display: flex; flex-direction: column; justify-content: center; padding: 3px 12px; border-radius: 8px; min-width: 78px; position: relative; cursor: default; }
.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; }

/* ---------- Columnas ---------- */
#left { position: fixed; top: calc(var(--hud-h, 70px) + 22px); left: 12px; bottom: 76px; 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; }
#left .legion-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#left .legion-panel .panel-b { overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; padding: 8px; }
.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); }
.order-card { font-size: 12.5px; }
.order-card .t { color: var(--gold-2); font-weight: 600; margin-bottom: 4px; display: flex; gap: 7px; align-items: center; }
.order-card .reward { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.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: 76px; 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; }
.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); }
.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 ---------- */
#dock { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9; display: flex; gap: 8px; padding: 7px 10px; align-items: center; max-width: calc(100vw - 24px); }
#dock .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
#dock .btn { padding: 7px 12px; }
#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.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; }
.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; image-rendering: pixelated; 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: '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: grid; place-items: center; background: #05080f center/cover no-repeat; }
#title::before { content: ''; position: absolute; inset: 0; 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%); }
#title .logo-img { width: min(460px, 86vw); image-rendering: pixelated; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.9)); margin: 0 auto 4px; display: block; }
#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 .credit { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 11px; color: #8d97a8; letter-spacing: .08em; z-index: 2; }
.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: 84px; 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 .ic { width: 64px; height: 64px; display: block; margin: 0 auto 14px; animation: pulse 1.6s infinite; }

@media (max-width: 1360px) {
  .stat .k span.t { display: none; }
  .stat { min-width: 0; padding: 3px 8px; }
  .brand h1 { display: none; }
}
@media (max-width: 1280px) {
  #left { width: 250px; } #dossier { width: 330px; }
  .stat { min-width: 64px; padding: 3px 8px; } .brand small { display: none; }
}
@media (max-width: 1180px) {
  #hud { flex-wrap: wrap; row-gap: 4px; }
  .brand { order: 1; border-right: 0; padding-right: 0; }
  .hud-right { order: 2; margin-left: auto; }
  .stats { order: 3; flex-basis: 100%; overflow-x: auto; justify-content: space-between; scrollbar-width: none; }
  .stat { flex: none; padding: 3px 7px; }
}
@media (max-width: 1100px) {
  .brand h1 { display: none; } .stat .k { font-size: 8.5px; }
  .parley { grid-template-columns: 180px 1fr; } .opt-grid { grid-template-columns: 1fr; }
}
@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; }
.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 at center, rgba(5, 8, 14, 0.62), rgba(5, 8, 14, 0) 70%); }
.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 at center, rgba(5, 8, 14, 0.85), rgba(5, 8, 14, 0.5) 55%, rgba(5, 8, 14, 0) 75%); 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: '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; } }
