/* Просмотр боя (js/screens/battle.js, план 5.6.4): две шеренги героев, выпады, потери, навыки. Приставка bt-. */
.bt { display: flex; flex-direction: column; gap: 10px; --bt-speed: 1; } /* скорость просмотра (battle.js setSpeed): ×2 — всё вдвое быстрее */
.bt-top { display: flex; align-items: baseline; gap: 14px; min-height: 26px; }
.bt-round { font-family: var(--serif, serif); font-size: 20px; color: var(--w-accent, #f0d79a); white-space: nowrap; } /* в окне — тёмное золото: окна светлые */
.bt-say { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-field { display: grid; grid-template-columns: 1fr 56px 1fr; gap: 8px; align-items: center; padding: 10px;
  border-radius: 12px; background: radial-gradient(ellipse at center, rgba(120, 84, 40, 0.35), rgba(16, 20, 28, 0.6));
  border: 1px solid var(--w-line, var(--bronze-d)); }
.bt-mid { display: flex; justify-content: center; opacity: 0.8; }
.bt-side { display: flex; flex-direction: column; gap: 8px; }
.bt-tag { font-size: 14px; font-weight: 700; color: #fff; text-shadow: var(--t-outline); text-transform: uppercase; letter-spacing: 0.05em; } /* на тёмном поле — белым с обводкой */
.bt-side.d .bt-tag { text-align: right; }
.bt-u { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: center; padding: 6px 8px;
  border-radius: 10px; background: var(--w-well, rgba(16, 20, 28, 0.7)); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform calc(0.18s / var(--bt-speed)) ease-out, opacity calc(0.3s / var(--bt-speed)), filter calc(0.3s / var(--bt-speed)); }
.bt-u.a { border-left: 3px solid #6fb3ff; }
.bt-u.d { border-right: 3px solid #ff7a6a; }
.bt-u img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.bt-u .t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bt-u .t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-u .bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
/* полоса здоровья — сжатием по ширине (transform: scaleX, battle.js paint), а не шириной: переход идёт на видеокарте, без
   раскладки в каждом кадре (замер 09.11: ширина в переходе — 131 раскладка за 10 с боя) */
.bt-u .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fd08e, #c8e07a); transform-origin: 0 50%;
  transition: transform calc(0.35s / var(--bt-speed)); }
[dir="rtl"] .bt-u .bar i { transform-origin: 100% 50%; }
.bt-u.d .bar i { background: linear-gradient(90deg, #ff9a7a, #ffcf7a); }
.bt-u .n { font-size: 13px; color: var(--muted); }
.bt-u.lunge-a { transform: translateX(26px) scale(1.04); z-index: 2; box-shadow: 0 0 12px rgba(111, 179, 255, 0.6); }
.bt-u.lunge-d { transform: translateX(-26px) scale(1.04); z-index: 2; box-shadow: 0 0 12px rgba(255, 122, 106, 0.6); }
.bt-u.hurt { animation: bt-shake calc(0.35s / var(--bt-speed)); filter: brightness(1.5) saturate(0.6); }
.bt-u.cast { box-shadow: 0 0 16px rgba(201, 180, 255, 0.85); }
.bt-u.dead { opacity: 0.38; filter: grayscale(0.9); }
.bt-float { position: absolute; right: 10px; top: -4px; font-weight: 700; font-size: 19px; pointer-events: none;
  animation: bt-rise calc(1.3s / var(--bt-speed)) ease-out forwards; text-shadow: 0 1px 3px #000; z-index: 3; }
.bt-float.loss { color: #ff7a6a; }
.bt-float.miss { color: var(--muted); font-size: 15px; }
.bt-float.skill { left: 64px; right: auto; color: #d8c6ff; font-size: 16px; }
/* итог боя — сплошная лента цвета исхода, белые надписи с обводкой: читается и на светлом окне, и поверх сцены */
.bt-end { text-align: center; padding: 10px 14px; border-radius: 10px; display: flex; flex-direction: column; gap: 4px; color: #fff;
  border-bottom: 4px solid rgba(0, 0, 0, 0.22); text-shadow: var(--t-outline); }
.bt-end b { font: 700 26px/1.15 var(--sans); }
.bt-end.win { background: linear-gradient(#5cb46c, #3a8a4a); }
.bt-end.lose { background: linear-gradient(#d65a4a, #a8392d); }
.bt-end.draw { background: linear-gradient(#d9ab45, #b0832a); }
.bt-end span { font-size: 16px; font-weight: 700; }
.bt-ctl { display: flex; gap: 8px; justify-content: flex-end; }
.bt-none { color: var(--muted); font-style: italic; }
/* дракон армии строкой у стороны и полоса стен у замка (план 5.6.4; на сцене их рисует холст) */
.bt-drg { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #e8a060; }
.bt-side.d .bt-drg { justify-content: flex-end; }
.bt-walls { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 0 4px; font-size: 14px; color: var(--muted); }
.bt-walls .bar { height: 9px; border-radius: 4px; background: var(--w-track, rgba(255, 255, 255, 0.1)); overflow: hidden; }
.bt-walls .bar i { display: block; height: 100%; background: linear-gradient(90deg, #b89058, #e2c27e); transform-origin: 0 50%;
  transition: transform calc(0.6s / var(--bt-speed)); }
[dir="rtl"] .bt-walls .bar i { transform-origin: 100% 50%; }
.bt-walls.hit .t { color: var(--w-bad, #ffb3a8); font-weight: 700; } /* стены побиты — красным по светлому окну */
.bt.staged .bt-drg, .bt.staged .bt-walls { display: none; }
.rep-watch { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
@keyframes bt-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes bt-rise { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px); } }

/* стоя: шеренги одна над другой */
body.vertical .bt-field { grid-template-columns: 1fr; }
body.vertical .bt-mid { transform: rotate(90deg); height: 30px; }
body.vertical .bt-u.lunge-a { transform: translateY(14px) scale(1.03); }
body.vertical .bt-u.lunge-d { transform: translateY(-14px) scale(1.03); }
body.vertical .bt-tag { font-size: 16px; }
body.vertical .bt-end b { font-size: 30px; }
body.vertical .bt-end span { font-size: 18px; }
/* стоя не мельче 16 (docs/UI_PLAN.md §2.1): ход раунда, имя героя, воины, стены, дракон — и в полосе под сценой */
body.vertical .bt-say, body.vertical .bt-u .n, body.vertical .bt-walls, body.vertical .bt-drg { font-size: 16px; }
body.vertical .bt-u .t b { font-size: 18px; }
body.vertical .bt.staged .bt-u .t b, body.vertical .bt.staged .bt-u .n, body.vertical .bt.staged .bt-none { font-size: 16px; }

/* сцена-диорама (js/screens/battlestage.js, docs/ANIM.md §2.11, P7; круг 8): поле боя холстом на всю высоту окна,
   над ним — раунд и кнопки, под ним — крупные портреты героев (воины на портрете, полоса здоровья, вспышка навыка),
   итог — лентой поверх поля. Фон до первого кадра — цвет своего места боя (data-place, battle.js): без зелёной
   заглушки */
.bt.staged { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top ctl" "stage stage" "field field"; gap: 8px 10px; }
.bt.staged .bt-top { grid-area: top; align-self: center; min-height: 0; }
.bt.staged .bt-say { display: none; } /* кто кого бьёт — видно на поле */
.bt.staged .bt-ctl { grid-area: ctl; align-self: center; flex-wrap: nowrap; }
.bt.staged .bt-ctl .btn { min-width: 0; padding-left: 16px; padding-right: 16px; }
body.vertical .bt.staged .bt-round { font-size: 26px; }
body.phone-land .bt.staged .bt-round { font-size: 22px; }
.bt.staged .bt-stage { grid-area: stage; }
.bt.staged .bt-field { grid-area: field; }
.bt-stage { position: relative; flex: 1 1 auto; min-height: 200px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--w-line, #a5b6cc); background: linear-gradient(#5f7a4a, #4c6a3c 50%, #3a5530); }
.bt-stage[data-place="walls"] { background: linear-gradient(#8a7a5c, #75664a 50%, #5c503a); }
.bt-stage[data-place="arena"] { background: linear-gradient(#a58c64, #8f7652 50%, #735e40); }
.bt-stage[data-place="ash"] { background: linear-gradient(#6a625a, #57504a 50%, #433d38); }
.bt-stage[data-place="throne"] { background: linear-gradient(#4e453c, #5a5047 50%, #433b34); }
.bt-stage[data-place="forest"] { background: linear-gradient(#55744a, #44623c 50%, #33502e); }
.bt-stage .bt-cv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.bt-stage.wait::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.35); border-top-color: rgba(255, 255, 255, 0.95);
  animation: bt-spin 0.9s linear infinite; } /* кадры сцены грузятся (первый раз — страницы атласа) */
@keyframes bt-spin { to { transform: rotate(360deg); } }
.bt-stage .bt-end { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 56%; z-index: 2;
  padding: 12px 22px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: bt-ribbon calc(0.35s / var(--bt-speed)) ease-out; }
/* портреты героев под полем (образец 098): крупный портрет в рамке цвета стороны, воины — на портрете снизу, полоса
   здоровья под ним; навык — портрет вспыхивает и подскакивает, удар — красная вспышка и дрожь, павший — серый.
   Лёжа — обе стороны в одну строку (нападение слева, оборона справа), стоя — строкой на сторону */
.bt.staged .bt-field { --bt-pw: 92px; flex: 0 0 auto; grid-template-columns: 1fr 30px 1fr; gap: 6px; padding: 8px 10px;
  background: var(--w-well, #d4e0ef); }
.bt.staged .bt-side { flex-direction: row; flex-wrap: wrap; gap: 8px 10px; align-content: flex-start; padding: 4px 6px; border-radius: 12px; }
.bt.staged .bt-side.a { background: linear-gradient(90deg, rgba(63, 127, 214, 0.22), rgba(63, 127, 214, 0)); }
.bt.staged .bt-side.d { justify-content: flex-end; background: linear-gradient(270deg, rgba(201, 71, 61, 0.22), rgba(201, 71, 61, 0)); }
.bt.staged .bt-tag { display: none; }
.bt.staged .bt-mid svg { width: 26px; height: 26px; }
.bt.staged .bt-u { flex: 0 0 var(--bt-pw); width: var(--bt-pw); box-sizing: border-box; min-width: 0; display: grid;
  grid-template: "pic" var(--bt-pw) "bar" auto / var(--bt-pw); gap: 6px; padding: 0; background: none; border: 0; }
.bt.staged .bt-u .t { display: contents; }
.bt.staged .bt-u .t b { display: none; } /* имя — в подсказке портрета; на поле видно, кто есть кто */
.bt.staged .bt-u img { grid-area: pic; width: var(--bt-pw); height: var(--bt-pw); border-radius: 14px; object-position: 50% 18%;
  box-shadow: 0 0 0 3px #4f8fe0, 0 3px 8px rgba(0, 0, 0, 0.35); transition: filter 0.3s; }
.bt.staged .bt-u.d img { box-shadow: 0 0 0 3px #d9574a, 0 3px 8px rgba(0, 0, 0, 0.35); }
.bt.staged .bt-u .n { grid-area: pic; align-self: end; z-index: 1; padding: 14px 2px 3px; border-radius: 0 0 14px 14px;
  background: linear-gradient(rgba(10, 12, 18, 0), rgba(10, 12, 18, 0.82) 55%); color: #fff; text-align: center;
  font: 700 17px/1.1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt.staged .bt-u .bar { grid-area: bar; z-index: 1; height: 10px; border-radius: 5px; background: rgba(16, 20, 28, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); } /* z-index — над свечением портрета, как прежде */
/* свечение портрета: выпад (::before, цвет стороны) и навык (::after) — готовые рамки поверх портрета, проступают
   прозрачностью; у навыка рамка подскакивает вместе с портретом, у выпада — дрожит с ним от удара. Меняются только
   opacity и transform — на видеокарте (замер 09.11: box-shadow портрета в переходе шёл в главном потоке — пересчёт
   стилей и перерисовка в каждом кадре выпада и навыка) */
.bt.staged .bt-u::before, .bt.staged .bt-u::after { content: ''; position: absolute; grid-area: pic; inset: 0; border-radius: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.bt.staged .bt-u::before { box-shadow: 0 0 0 3px #9cc8ff, 0 0 18px 4px rgba(111, 179, 255, 0.85); }
.bt.staged .bt-u.d::before { box-shadow: 0 0 0 3px #ffb0a4, 0 0 18px 4px rgba(255, 122, 106, 0.85); }
.bt.staged .bt-u::after { box-shadow: 0 0 0 3px #e2d4ff, 0 0 26px 8px rgba(190, 160, 255, 0.9); }
.bt.staged .bt-u.lunge-a, .bt.staged .bt-u.lunge-d { transform: none; } /* выпад — на поле, в полосе только свечение */
.bt.staged .bt-u.lunge-a::before, .bt.staged .bt-u.lunge-d::before { opacity: 1; }
.bt.staged .bt-u.hurt { animation: none; }
.bt.staged .bt-u.hurt img { animation: bt-hurt calc(0.4s / var(--bt-speed)) ease-out; }
.bt.staged .bt-u.hurt:is(.lunge-a, .lunge-d)::before { animation: bt-jolt calc(0.4s / var(--bt-speed)) ease-out; }
.bt.staged .bt-u.cast img, .bt.staged .bt-u.cast::after { animation: bt-cast calc(0.6s / var(--bt-speed)) ease-out; }
.bt.staged .bt-u.cast::after { opacity: 1; }
.bt.staged .bt-u.dead img { filter: grayscale(1) brightness(0.55); }
.bt.staged .bt-u.dead .n { color: #ff9a8a; }
.bt.staged .bt-u.dead { opacity: 0.85; }
.bt.staged .bt-none { margin: 0; font-size: 15px; }
body.vertical .bt.staged .bt-field { --bt-pw: 104px; grid-template-columns: 1fr; padding: 8px; }
body.vertical .bt.staged .bt-mid { display: none; }
body.vertical .bt.staged .bt-side, body.vertical .bt.staged .bt-side.d { flex-wrap: nowrap; justify-content: center; }
body.vertical .bt.staged .bt-u .n { font-size: 20px; }
body.vertical .bt.staged .bt-u .bar { height: 12px; border-radius: 6px; }
@keyframes bt-ribbon { from { opacity: 0; transform: translate(-50%, -50%) scale(0.86); } }
@keyframes bt-hurt { 0% { filter: brightness(1.9) saturate(0.4); transform: translateX(0); } 30% { transform: translateX(-5px); }
  60% { transform: translateX(4px); } 100% { filter: none; transform: none; } }
@keyframes bt-cast { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes bt-jolt { 30% { transform: translateX(-5px); } 60% { transform: translateX(4px); } } /* дрожь bt-hurt без вспышки */

/* ——— лёжа на телефоне (body.phone-land, js/ui.js fitStage: сцена мельче 3/4, около 0,57): здесь размеры прибиты в px —
   ход раунда, имена и воины героев, дракон и стены 12–15 (7–9 css px). Растут до размеров круга 1 (css/kod.css
   body.phone-land): текст не мельче 16, ход раунда 17, имя героя 18 (в полосе под сценой — 16), портрет 56 (40). На
   планшете и ПК лёжа и стоя — как было ——— */
body.phone-land .bt-say { font-size: var(--fs-sub); }
body.phone-land .bt-tag { font-size: 16px; }
body.phone-land .bt-u { grid-template-columns: 56px 1fr; }
body.phone-land .bt-u img { width: 56px; height: 56px; }
body.phone-land .bt-u .t b { font-size: 18px; }
body.phone-land .bt-u .bar { height: 10px; border-radius: 5px; }
body.phone-land .bt-u .n { font-size: 16px; }
body.phone-land .bt-drg, body.phone-land .bt-walls { font-size: 16px; }
body.phone-land .bt-float { font-size: 24px; }
body.phone-land .bt-float.miss, body.phone-land .bt-float.skill { font-size: 18px; }
body.phone-land .bt-end span { font-size: var(--fs-sub); }
/* лёжа: портреты под полем в одну строку — 84 px, воины на портрете 17 */
body.phone-land .bt.staged .bt-field { --bt-pw: 84px; padding: 6px 10px; }
body.phone-land .bt.staged .bt-u .n { font-size: 17px; }
body.phone-land .bt.staged .bt-none { font-size: 16px; }
body.phone-land .bt.staged .bt-u .bar { height: 9px; }
