/* GRISHKA_WAR_V15 — карта кланов, походы и бои. Только CSS-переменные тем — выглядит своим в любой теме. */
.page-war .page-head { margin-bottom: 10px; }
.war-hbtn .pill { cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.war-wrap { position: relative; height: min(58vh, 460px); min-height: 300px; border-radius: 22px; overflow: hidden; border: 1px solid var(--stroke-2);
  box-shadow: var(--shadow-sm); background: var(--surface-2); touch-action: none; user-select: none; -webkit-user-select: none; }
#war-cv { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#war-cv:active { cursor: grabbing; }
.war-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.war-zoom button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--stroke-2); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm); }
.war-zoom button:active { transform: scale(.92); }
.war-legend { margin: 7px 4px 0; color: var(--muted); font-size: 11.5px; font-weight: 650; text-align: center; }
.war-banner { position: absolute; left: 10px; right: 58px; top: 10px; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 750; box-shadow: var(--shadow-sm); animation: rise .3s var(--smooth) both; }
.war-banner span { flex: 1; }
.war-banner button { border: 0; border-radius: 10px; padding: 7px 10px; background: rgba(0, 0, 0, .18); color: inherit; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }

#war-panel { margin-top: 14px; }
.war-place .row-btns { margin-top: 2px; }
.war-stats { display: grid; align-items: stretch; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.war-stats > div, .war-grid > div { padding: 9px 6px 8px; justify-content: space-between; border-radius: 14px; background: var(--surface); border: 1px solid var(--stroke); text-align: center;
  display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.war-stats small, .war-grid small { font-size: 10.5px; color: var(--muted); font-weight: 650; line-height: 1.2; }
.war-stats b, .war-grid b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.war-mine { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.war-mine .wm-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.war-mine .wm-t small { font-size: 12px; font-weight: 600; }
.war-mine .btn { flex: none; }
.war-m-btns .fx-tag { flex: 1; text-align: center; padding: 11px 9px; }
.war-mine .ok { color: var(--good); } .war-mine .bad { color: var(--bad); }
.war-inc { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-soft); }
.war-inc .ico { background: var(--bad-soft); border-color: transparent; }
.war-inc b { color: var(--bad); font-variant-numeric: tabular-nums; }

.war-march { flex-direction: column; align-items: stretch; gap: 10px; }
.war-march.st-gathering { border-color: var(--accent); }
.war-m-top { display: flex; align-items: center; gap: 12px; }
.war-m-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.war-m-who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.war-chip { padding: 4px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--stroke); font-size: 12px; font-weight: 650;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-cap { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 700; }
.war-m-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.war-m-btns .btn { flex: 1; justify-content: center; }
.war-m-btns .btn.danger, .war-m-btns .btn.danger:not([disabled]) { color: var(--bad); border-color: var(--bad); }

.war-rep { cursor: pointer; }
.war-rep .val.pos { color: var(--good); } .war-rep .val.neg { color: var(--bad); }
.war-rep.lose .ico { background: var(--bad-soft); border-color: transparent; }
.war-rep.win .ico { background: var(--good-soft); border-color: transparent; }
.war-rules { margin: 16px 2px 4px; font-size: 12px; line-height: 1.45; }
.war-entry { margin-bottom: 12px; cursor: pointer; border: 1px solid var(--stroke); }
.war-eico { background: var(--good-soft); font-size: 24px; }

/* лист базы */
.war-bs { text-align: center; }
.war-bs-top { position: relative; width: 84px; height: 84px; margin: 0 auto 6px; display: grid; place-items: center; }
.war-bs-top .clan-ico { position: absolute; left: -6px; top: -6px; }
.war-bs-hq { font-size: 54px; line-height: 1; position: relative; left: 10px; top: 6px; }
.war-bs-name { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.war-bs-meta { color: var(--muted); font-size: 13px; font-weight: 600; margin: 3px 0 10px; }
.war-tag { display: inline-block; margin: 0 4px 8px; padding: 5px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; }
.war-tag.bad { background: var(--bad-soft); color: var(--bad); }
.war-of { font-style: normal; font-size: 11px; font-weight: 650; color: var(--muted); }
.war-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 12px; }
.war-note { color: var(--muted); font-size: 12.5px; font-weight: 550; margin: 8px 0 4px; line-height: 1.4; }
.war-go { min-height: 52px; font-size: 16px; }
.war-row { margin-top: 10px; }
.war-bs .btn-wide + .btn-wide { margin-top: 8px; }

/* отчёт о бое */
.war-rp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; text-align: center; }
.war-rp-head > div { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.war-rp-head b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-rp-head small { font-size: 11px; color: var(--muted); font-weight: 650; }
.war-rp-head .vs { font-size: 26px; }
.war-rp-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 6px; }
.war-rp-bars .bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.war-rp-bars .bar i { display: block; height: 100%; border-radius: 99px; transition: width .5s var(--smooth); }
.war-rp-bars .bar.a i { background: var(--accent); } .war-rp-bars .bar.d i { background: var(--info, #4c8dff); margin-left: auto; }
.war-rp-round { text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.war-rp-units { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 34vh; overflow-y: auto; }
.war-rp-units .col { display: flex; flex-direction: column; gap: 5px; }
.war-u { position: relative; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto 5px; column-gap: 6px; align-items: center;
  padding: 6px 8px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--stroke); text-align: left; transition: opacity .3s; }
.war-u .ue { grid-row: 1 / 3; font-size: 18px; line-height: 1; }
.war-u .un { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-u .uh { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.war-u .uh i { display: block; height: 100%; background: var(--good); transition: width .45s var(--smooth); }
.war-u.dead { opacity: .4; } .war-u.dead .uh i { background: var(--bad); }
.war-u em { position: absolute; right: 6px; top: 3px; font-style: normal; font-size: 12px; font-weight: 800; color: var(--bad); opacity: 0; }
.war-u em.crit { color: var(--accent); font-size: 13.5px; }
.war-u em.pop { animation: warPop .8s var(--smooth) both; }
@keyframes warPop { 0% { opacity: 0; transform: translateY(4px) scale(.8); } 25% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
.war-rp-log { min-height: 44px; margin: 10px 0 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.5; text-align: center; }
.war-rp-log b { color: var(--bad); } .war-rp-log i { color: var(--accent); font-style: normal; font-weight: 800; }
.war-rp-res { margin: 6px 0 10px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--stroke); font-size: 13px; font-weight: 600;
  line-height: 1.5; text-align: center; animation: rise .35s var(--smooth) both; }
.war-rp-res .t { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.war-rp-res .t.good { color: var(--good); } .war-rp-res .t.bad { color: var(--bad); }
.war-rp-res .muted { color: var(--muted); }

/* статус бойца на экране «Мой боец» */
.fx-war { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--stroke); font-size: 13px; font-weight: 650; text-align: center; }
.fx-war.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.fx-war-btn { margin-top: 10px; }

/* контраст в светлых «бумажных» темах */
body[data-theme="comic"] .war-wrap, body[data-theme="notebook"] .war-wrap { border-width: 2px; border-color: var(--text); }
body[data-theme="comic"] .war-banner, body[data-theme="notebook"] .war-banner { color: var(--accent-ink); }
@media (max-width: 360px) { .war-stats { grid-template-columns: repeat(2, 1fr); } }

/* GRISHKA_WAR_ART_V15_1: image panel, same palette on every theme */
.war-bs-top {width:132px; height:118px;}
.war-bs-top .clan-ico {left:-5px; top:4px; width:42px; height:42px; filter:none!important; mix-blend-mode:normal!important;}
.war-bs-hq-img {width:106px; height:106px; object-fit:contain; display:block;}
body[data-theme] .war-bs-hq-img {filter:none!important; mix-blend-mode:normal!important;}
