.fight-site-return { position: fixed; z-index: 100; top: 5px; left: 50%; transform: translateX(-50%); padding: 3px 12px; color: #fff; background: #080b16d9; border: 1px solid #536078; font: 12px/1.3 system-ui, sans-serif; text-decoration: none; }
.fight-site-return:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* Серверный бой: зрители смотрят, управляет только оператор сайта */
body.battle-page.fight-integrated #add-red, body.battle-page.fight-integrated #add-blue, body.battle-page.fight-integrated #start-battle,
body.battle-page.fight-integrated #pause-battle, body.battle-page.fight-integrated #restart-battle, body.battle-page.fight-integrated #load-demo,
body.battle-page.fight-integrated .simulation-speed__buttons { display: none !important; }
/* OBS: только арена и табло */
body.fight-obs .battle-controls, body.fight-obs .fighter-inspector, body.fight-obs .fight-site-return { display: none !important; }
/* Панель Марика: рамка на картинке ниже и тоньше, чем у Бигмурза, — растягиваем её до той же высоты, чтобы «Сила команды» встала внутрь */
body.battle-page .team-summary--red { background-size: 100% 200%; background-position: center 52%; }
/* Скорость меняет стример на пульте; зрителям показываем только текущее значение */
body.battle-page.fight-integrated:not(.fight-operator) .simulation-speed { width: auto; }
/* Оператор (админ/стример) на арене: свои кнопки управления и скорость ×1–×4 для всех */
body.battle-page.fight-integrated.fight-operator .simulation-speed__buttons { display: grid !important; }
/* Зрители на сайте и OBS: кнопки скорости 1×–4× тоже видны (текущая подсвечена), но это только показ — скорость меняет стример */
body.battle-page.fight-integrated:not(.fight-operator):not(.fight-replay) .simulation-speed { width: 160px; }
body.battle-page.fight-integrated:not(.fight-operator):not(.fight-replay) .simulation-speed__buttons { display: grid !important; pointer-events: none; }
body.battle-page.fight-integrated:not(.fight-operator):not(.fight-replay) .simulation-speed__buttons button { cursor: default; }
/* «Игру создал po_dusham_» — в нижней правой рамке панели правил */
.rules-panel { position: relative; }
.rules-panel .fight-credit { position: absolute; z-index: 3; left: 52.5%; right: 2.6%; top: 78%; bottom: 5.5%; margin: 0; display: flex; align-items: center; justify-content: center; gap: .45em;
  font-family: var(--font-display, "Oswald", sans-serif); font-size: clamp(10px, .8vw, 16px); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #a4b5cb; white-space: nowrap; }
.rules-panel .fight-credit a { color: #ffd43b; text-decoration: none; text-transform: none; letter-spacing: .04em; font-size: 1.15em; text-shadow: 0 0 10px rgba(255, 212, 59, .45); pointer-events: auto; }
.rules-panel .fight-credit a:hover, .rules-panel .fight-credit a:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
/* кнопки управления — в левой половине панели, чтобы не налезали на рамку с подписью (если кнопок много — в два ряда) */
@media (min-width: 761px) {
  body.battle-page .rules-panel .battle-controls { margin-right: 49.5%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px clamp(3px, 0.35vw, 7px); margin-top: 2px; }
  body.battle-page .rules-panel .battle-controls .control { min-height: clamp(24px, 2.6vh, 36px); padding-block: 2px; }
}
@media (max-width: 760px) {
  .rules-panel .fight-credit { position: static; margin-top: 8px; justify-content: flex-start; }
}
/* подпись всегда поверх, характеристики бойца — строкой над ней, как в оригинале */
.rules-panel .fighter-inspector { position: relative; z-index: 2; }
/* характеристики бойца целиком: до двух строк, место под них занято всегда (панель не прыгает) */
@media (min-width: 761px) {
  body.battle-page .rules-panel .fighter-inspector { white-space: normal; text-overflow: clip; line-height: 1.25; height: 2.5em; margin-right: 2.5%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
/* «Где я?»: подсветка своего бойца жёлтым */
.fight-me-ring { position: absolute; left: 0; top: 0; z-index: 6; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border: 2px solid #ffd43b; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 59, .35), rgba(255, 212, 59, 0) 70%); box-shadow: 0 0 12px 3px rgba(255, 212, 59, .75); cursor: pointer; animation: fight-me-pulse 1.2s ease-in-out infinite; will-change: transform; }
.fight-me-ring span { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -3px); padding: 1px 6px; border-radius: 4px; background: #ffd43b; color: #1a1300;
  font: 700 11px/1.3 var(--font-display, "Oswald", sans-serif); letter-spacing: .08em; white-space: nowrap; pointer-events: none; }
@keyframes fight-me-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.25; } }
.fight-me-chip { position: absolute; z-index: 6; left: 50%; top: 10px; transform: translateX(-50%); max-width: 70%; padding: 5px 14px; border: 1px solid #ffd43b; border-radius: 999px;
  background: rgba(20, 16, 0, .85); color: #ffe58a; font: 600 13px/1.3 system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 0 14px rgba(255, 212, 59, .35); }
.fight-me-chip b { color: #ffd43b; }
@media (prefers-reduced-motion: reduce) { .fight-me-ring { animation: none; } }
/* характеристики бойца — белым жирным, чтобы читались на стриме */
body.battle-page .rules-panel .fighter-inspector { color: #fff; font-weight: 700; }
/* «кто кого выбил» в ленте */
.feed-event .fight-by { color: #ffd43b; font-weight: 600; }
/* топ по выбиваниям под надписью о победе */
.fight-board { position: absolute; z-index: 9; left: 50%; top: calc(50% + clamp(48px, 5vw, 80px)); transform: translateX(-50%); width: min(560px, 80%); max-height: 45%; overflow: auto;
  padding: 10px 16px; background: rgba(3, 7, 15, .92); border: 1px solid rgba(255, 212, 59, .55); box-shadow: 0 0 22px rgba(255, 212, 59, .18); color: #e7edf7; font: 600 14px/1.35 system-ui, sans-serif; }
.fight-board h3 { margin: 0 0 6px; color: #ffd43b; font: 700 15px/1.2 var(--font-display, "Oswald", sans-serif); letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.fight-board ol { list-style: none; margin: 0; padding: 0; }
.fight-board__row { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); align-items: baseline; }
.fight-board__row b { color: #8697ae; } .fight-board__row strong { text-align: right; color: #ffd43b; font-size: 16px; }
.fight-board__row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fight-board__row em { font-style: normal; color: #8697ae; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fight-board__row--red span { color: #ff6b78; } .fight-board__row--blue span { color: #4cc3ff; }
.fight-board details summary { cursor: pointer; margin-top: 6px; color: #ffd43b; text-align: center; list-style: none; }
.fight-board details summary::-webkit-details-marker { display: none; }
/* боковые панели на широких экранах */
.fight-side { position: fixed; z-index: 20; max-height: 70vh; overflow: hidden; padding: 14px 16px; background: rgba(3, 7, 15, .86); border: 1px solid rgba(120, 150, 200, .35); border-radius: 6px; color: #e7edf7; font: 600 15px/1.4 system-ui, sans-serif; }
.fight-side h3 { margin: 0 0 10px; font: 700 18px/1.2 var(--font-display, "Oswald", sans-serif); letter-spacing: .08em; text-transform: uppercase; color: #ffd43b; }
.fight-side--right { border-color: rgba(76, 195, 255, .45); } .fight-side--left { border-color: rgba(255, 70, 90, .45); }
.fight-killfeed { list-style: none; margin: 0; padding: 0; } .fight-killfeed li { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fight-killfeed i { font-style: normal; color: #ffd43b; } .fight-killfeed .v { opacity: .65; text-decoration: line-through; }
.fight-side .t-red { color: #ff6b78; } .fight-side .t-blue { color: #4cc3ff; } .fight-side .muted { color: #8697ae; }
.fight-howto { margin: 0; padding-left: 20px; } .fight-howto li { margin-bottom: 8px; } .fight-howto b { color: #ffd43b; }
/* счёт W/L под названием команды */
.fight-wl { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 4px; background: rgba(0, 0, 0, .45); font: 700 clamp(11px, .85vw, 16px)/1.2 var(--font-display, "Oswald", sans-serif); letter-spacing: .06em; color: #e7edf7; white-space: nowrap; }
.fight-wl b { color: #ffd43b; font-weight: 700; } .fight-wl i { font-style: normal; opacity: .5; }
.fight-wl--red { border: 1px solid rgba(255, 70, 90, .55); } .fight-wl--blue { border: 1px solid rgba(76, 195, 255, .55); }
/* «Правила арены» — кнопка */
.fight-rules-btn { cursor: pointer; border-radius: 4px; transition: background .15s; }
.fight-rules-btn:hover, .fight-rules-btn:focus-visible { background: rgba(255, 212, 59, .08); outline: none; }
.fight-rules-btn h2::after { content: " ⓘ"; font-size: .7em; color: #ffd43b; }
.fight-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); }
.fight-modal[hidden] { display: none; }
.fight-modal__box { position: relative; width: min(760px, 100%); max-height: 88vh; overflow: auto; padding: 24px 28px; background: #070d1a; border: 1px solid rgba(255, 212, 59, .5); border-radius: 8px; color: #e7edf7; font: 400 16px/1.55 system-ui, sans-serif; box-shadow: 0 0 40px rgba(0, 0, 0, .6); }
.fight-modal__box h2 { margin: 0 0 12px; color: #ffd43b; font: 700 24px/1.2 var(--font-display, "Oswald", sans-serif); letter-spacing: .06em; text-transform: uppercase; }
.fight-modal__box h3 { margin: 18px 0 6px; color: #4cc3ff; font: 700 17px/1.2 var(--font-display, "Oswald", sans-serif); letter-spacing: .06em; text-transform: uppercase; }
.fight-modal__box p { margin: 0 0 8px; } .fight-modal__box b { color: #ffd43b; }
.fight-modal__close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 1px solid #36425e; border-radius: 6px; background: #121a2e; color: #fff; font-size: 16px; cursor: pointer; }
.fight-modal__box b { white-space: nowrap; }
/* кнопки «Команда Марика / Бигмурза» в полосе комментария и списки команд */
.fight-strip { --commentary-side: clamp(150px, 15vw, 300px); }
.fight-strip .battle-status { position: static; width: auto; max-width: 100%; text-align: center; }
body.fight-in-battle .fight-strip .battle-status { display: none; }
body:not(.fight-in-battle) .fight-strip #commentary-recent { display: none; }
.fight-team-btn { position: absolute; z-index: 4; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 4px; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff; font: 700 clamp(10px, .8vw, 15px)/1.1 var(--font-display, "Oswald", sans-serif); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.fight-team-btn b { color: #ffd43b; } .fight-team-btn i { font-style: normal; font-size: .8em; opacity: .8; }
.fight-team-btn[aria-expanded="true"] i { display: inline-block; transform: rotate(180deg); }
.fight-team-btn--red { left: calc(clamp(20px, 3vw, 58px) + clamp(26px, 2.6vw, 48px) + 10px); border: 1px solid rgba(255, 70, 90, .7); box-shadow: 0 0 10px rgba(255, 43, 56, .25); }
.fight-team-btn--blue { right: clamp(20px, 3vw, 58px); border: 1px solid rgba(76, 195, 255, .7); box-shadow: 0 0 10px rgba(0, 217, 255, .25); }
.fight-team-btn:hover, .fight-team-btn:focus-visible { background: rgba(255, 212, 59, .14); outline: none; }
.fight-team-panel { position: absolute; z-index: 30; top: calc(100% + 4px); width: min(48%, 900px); max-height: 62vh; display: flex; flex-direction: column; background: rgba(4, 8, 18, .96); border-radius: 6px; color: #e7edf7; font: 500 13px/1.3 system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.fight-team-panel[hidden] { display: none; }
.fight-team-panel--red { left: clamp(10px, 2vw, 40px); border: 1px solid rgba(255, 70, 90, .6); } .fight-team-panel--blue { right: clamp(10px, 2vw, 40px); border: 1px solid rgba(76, 195, 255, .6); }
.fight-team-panel header { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.fight-team-panel h3 { margin: 0; flex: 1; font: 700 15px/1.2 var(--font-display, "Oswald", sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.fight-team-panel--red h3 { color: #ff6b78; } .fight-team-panel--blue h3 { color: #4cc3ff; }
.fight-team-panel input { width: 180px; padding: 4px 8px; border: 1px solid #2c3755; border-radius: 4px; background: #0b1222; color: #fff; font: inherit; }
.fight-team-panel .x { width: 28px; height: 28px; border: 1px solid #2c3755; border-radius: 4px; background: #111a2e; color: #fff; cursor: pointer; }
.fight-team-panel .sum { padding: 4px 10px; color: #8697ae; font-size: 12px; }
.fight-team-panel .tbl { overflow: auto; padding: 0 6px 8px; }
.fight-team-panel table { width: 100%; border-collapse: collapse; }
.fight-team-panel th { position: sticky; top: 0; background: #0a1020; color: #8697ae; font-weight: 600; font-size: 11px; text-align: right; padding: 4px 6px; }
.fight-team-panel th:nth-child(-n+2), .fight-team-panel td.nick, .fight-team-panel td.hero { text-align: left; }
.fight-team-panel td { padding: 3px 6px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, .05); white-space: nowrap; cursor: pointer; }
.fight-team-panel td.nick { color: #fff; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; } .fight-team-panel td.hero { color: #aab6c8; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.fight-team-panel sup { color: #6fe39a; font-size: 10px; margin-left: 2px; }
.fight-team-panel tr.dead td { opacity: .45; } .fight-team-panel tr.me td { background: rgba(255, 212, 59, .14); } .fight-team-panel tr.me td.nick { color: #ffd43b; }
.fight-team-panel tr:hover td { background: rgba(255, 255, 255, .05); }
.fight-team-panel .empty { padding: 12px; color: #8697ae; }
body.fight-obs .fight-team-btn, body.fight-obs .fight-team-panel { display: none !important; }
@media (max-width: 760px) { .fight-team-btn { font-size: 9px; padding: 3px 6px; } .fight-team-btn span { display: none; } .fight-team-btn--red::before { content: "Марик"; } .fight-team-btn--blue::before { content: "Бигмурз"; } .fight-team-panel { width: calc(100% - 20px); left: 10px; right: 10px; } }

/* «ТЫ» теперь рисуется на холсте вместе с бойцом; кнопка осталась невидимой областью для клика */
.fight-me-ring { border: 0 !important; background: none !important; box-shadow: none !important; animation: none !important; width: 34px; height: 34px; margin: -17px 0 0 -17px; }
.fight-me-ring span { display: none; }

/* повтор боя */
.fight-replay-btn { position: absolute; z-index: 10; left: 50%; top: 46px; transform: translateX(-50%); padding: 7px 22px; border: 1px solid #ffd43b; border-radius: 4px;
  background: rgba(20, 16, 0, .9); color: #ffd43b; font: 700 15px/1.2 var(--font-display, "Oswald", sans-serif); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; box-shadow: 0 0 14px rgba(255, 212, 59, .35); }
.fight-replay-btn:hover, .fight-replay-btn:focus-visible { background: #ffd43b; color: #1a1300; }
.fight-replay-tag { position: absolute; z-index: 7; right: 14px; top: 10px; padding: 3px 12px; border-radius: 4px; background: rgba(255, 212, 59, .9); color: #1a1300; font: 700 13px/1.3 var(--font-display, "Oswald", sans-serif); letter-spacing: .12em; text-transform: uppercase; pointer-events: none; }
body.battle-page.fight-integrated.fight-replay .simulation-speed__buttons { display: grid !important; }
/* «Сила команды» у Марика: рамка красной панели внизу выше, чем у синей — поднимаем подпись, чтобы стояла как у Бигмурза */
body.battle-page .team-summary--red .team-power { transform: translateY(-0.45vw); }
/* OBS: арена по центру, по бокам — панели «Как играть» и «Кто кого выбил» (как на сайте на широком экране); выключить: &sides=0 */
body.fight-obs-sides .battle-app { width: calc(100% - 26vw); max-width: 1920px; }
body.fight-obs-sides .team-summary__name { font-size: clamp(20px, 1.55vw, 32px); }
