/* Бой мира на сайте (22.10.2026) — fight.js. Одинаково на телефоне и компьютере: меняется только раскладка. */

/* ---------- паспорт пэта: кнопки боя ---------- */
.member-card-fight { display: flex; gap: 4px; margin: 3px 0 4px; }
.member-card-fight-btn {
    flex: 1; min-height: 24px; padding: 2px 4px; border: 1px solid #a48b60; border-radius: 3px;
    background: #e3d1ac; color: #57442c; font: inherit; font-size: 10px; cursor: pointer;
}
.member-card-fight-btn:hover { background: #d9c398; border-color: #8e7147; color: #362b1c; }
.member-card-fight-btn.danger { border-color: #a0654f; color: #7e3523; }
.member-card-fight-btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- кнопки боя ---------- */
.fight-btn {
    min-height: 34px; padding: 6px 12px; border: 1px solid rgba(214, 190, 255, 0.28); border-radius: 8px;
    background: rgba(40, 30, 56, 0.9); color: #f1ecf7; font: 500 14px "Manrope", "Segoe UI", Arial, sans-serif; cursor: pointer;
}
.fight-btn:hover { border-color: #e0772f; }
.fight-btn.primary { background: #e0772f; border-color: #e0772f; color: #1a1220; font-weight: 600; }
.fight-btn.danger { border-color: #b2513a; color: #ffb9a5; }
.fight-btn.potion { border-color: rgba(123, 224, 138, 0.45); text-align: left; }   /* 23.10: зелье с пояса */
.fight-btn:disabled { opacity: 0.45; cursor: default; }
.fight-btn:focus-visible { outline: 2px solid #e0772f; outline-offset: 2px; }

/* ---------- вызовы и короткие сообщения ---------- */
.fight-invites, .fight-toasts {
    position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.fight-invites { top: 16px; }
.fight-toasts { bottom: 24px; }
body.fight-open .fight-toasts { bottom: auto; top: 64px; }
.fight-invite, .fight-toast {
    pointer-events: auto; padding: 12px 14px; border: 1px solid rgba(224, 119, 47, 0.6); border-radius: 12px;
    background: rgba(22, 16, 32, 0.94); color: #f1ecf7; box-shadow: 0 8px 24px #0008;
    font: 14px/1.35 "Manrope", "Segoe UI", Arial, sans-serif;
}
.fight-invite.outgoing { border-color: rgba(214, 190, 255, 0.3); }
.fight-invite-title { font: 600 18px/1.2 "Cormorant Garamond", Georgia, serif; }
.fight-invite-left { margin-top: 4px; color: #a99fb8; font-size: 13px; }
.fight-invite-buttons { display: flex; gap: 8px; margin-top: 10px; }
.fight-invite-buttons .fight-btn { flex: 1; }
.fight-toast { border-color: rgba(214, 190, 255, 0.3); text-align: center; }

/* ---------- поле боя ---------- */
body.fight-open { overflow: hidden; }
.fight-arena {
    position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
    background: #0d0a14; color: #f1ecf7; font: 14px/1.35 "Manrope", "Segoe UI", Arial, sans-serif;
    padding: max(10px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}
.fight-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.fight-title { font: 600 22px/1.15 "Cormorant Garamond", Georgia, serif; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fight-clock { flex: none; color: #a99fb8; font-variant-numeric: tabular-nums; }

.fight-arena .fight-notice {
    position: relative; display: flex; align-items: center; gap: 6px; flex: 0 0 24px;
    box-sizing: border-box; width: 100%; height: 24px; min-height: 0; margin: 0 0 5px; padding: 0 8px 2px;
    border: 1px solid #514138; border-radius: 5px; color: #f1dfbc; background: linear-gradient(#211e23, #17151a);
    text-align: left; font: 500 13px/1.2 "Manrope", "Segoe UI", sans-serif; cursor: pointer;
}
.fight-notice-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fight-notice-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fight-notice-icon { flex: none; color: #d7a66b; }
.fight-notice-icon:empty { display: none; }
.fight-notice[data-kind="retreat-failed"] .fight-notice-icon, .fight-notice[data-kind="error"] .fight-notice-icon { color: #ed8881; }
.fight-notice[data-kind="too-close"] .fight-notice-icon { color: #cbd1dc; }
.fight-interval { position: absolute; inset: auto 3px 2px; height: 2px; overflow: hidden; background: #100e13; pointer-events: none; }
.fight-interval-fill { display: block; height: 100%; background: #d39b54; transform: scaleX(0); transform-origin: right center; }

.fight-arena :is(button, [role="button"]) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.fight-arena :is(button, [role="button"]):not(:disabled):active {
    translate: 0 1px; filter: brightness(1.15); box-shadow: inset 0 0 0 1px #d5a46d, inset 0 2px 5px #1c1416;
}
.fight-arena .fight-notice:focus-visible { outline: 2px solid #edbe82; outline-offset: 2px; }

.fight-stage {
    position: relative; flex: 1; min-height: 200px; overflow: hidden; border-radius: 14px;
    border: 1px solid rgba(214, 190, 255, 0.18); background: #17111f;
    isolation: isolate;     /* порядок фигур — внутри поля, меню и итог боя всегда поверх */
}
.fight-backdrop {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    filter: none; transform-origin: center; pointer-events: none;
}
.fight-field { position: absolute; inset: 0; }
.fight-stage.choosing-hold .fight-field,
.fight-stage.choosing-hold .fight-fighter { cursor: crosshair; }
.fight-hold-prompt {
    position: absolute; top: 62px; left: 50%; translate: -50% 0; z-index: 960;
    width: max-content; max-width: calc(100% - 24px); box-sizing: border-box;
    padding: 6px 10px; border: 1px solid #a1815c; border-radius: 8px;
    background: #211b17f2; color: #ffe1ad; font-size: 0.82rem; text-align: center;
    pointer-events: none;
}

.fight-fighter {
    position: absolute; width: 0; height: 0; cursor: pointer;   /* место — каждый кадр из записи боя (без CSS-задержки) */
}
.fight-figure, .fight-fighter canvas.fight-figure {
    position: absolute; left: 0; bottom: 0; transform-origin: 50% 100%;
    translate: -50% 0; object-fit: contain; object-position: 50% 100%;
    filter: drop-shadow(0 3px 4px #000a); pointer-events: auto;
}

.fight-label {
    position: absolute; left: 0; bottom: calc(var(--fight-unit, 60px) * 1.3); translate: -50% 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; white-space: nowrap;
}
.fight-name { font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px #000; }
.fight-fighter.mine .fight-name { color: #a6efb1; }
.fight-fighter.targeted .fight-name { color: #ffb070; }
/* 25.10: кружок здоровья с кольцом защиты (fight_fx.js Orb); холст шире кружка — осколки падают ниже */
.fight-orb { display: block; position: relative; width: 22px; height: 22px; flex: none; }
.fight-orb canvas { position: absolute; pointer-events: none; }
.fight-mark {
    position: absolute; left: 0; bottom: calc(var(--fight-unit, 60px) * 1.05); translate: 40% 0;
    font-size: 16px; pointer-events: none;
}

/* живой облик: клипы сборки (fight.js paint); силуэт — только пока облика нет */
.fight-sprite { position: absolute; display: none; pointer-events: auto; filter: drop-shadow(0 3px 4px #000a); }
.fight-fighter.look-pending .fight-figure, .fight-fighter.look-pending .fight-sprite { visibility: hidden; }   /* 01.11: без мелькания заглушки */
.fight-fighter:not(.no-look) .fight-sprite { display: block; }
.fight-fighter:not(.no-look) .fight-figure { display: none; }
.fight-fighter.act-out .fight-sprite { opacity: 0.45; }

/* силуэт (облика нет) — подсказки движением картинки */
.fight-fighter.act-windup.face-right .fight-figure { rotate: 7deg; }
.fight-fighter.act-windup.face-left .fight-figure { rotate: -7deg; }
.fight-fighter.act-stun .fight-figure { animation: fight-shake 0.3s linear infinite; }
@keyframes fight-shake { 25% { translate: -54% 0; } 75% { translate: -46% 0; } }
.fight-fighter.stone-ward .fight-sprite, .fight-fighter.stone-ward .fight-figure {
    filter: drop-shadow(0 0 3px #c5ac79);
}
.fight-fighter.spell-chilled .fight-figure {
    filter: sepia(.2) hue-rotate(160deg) saturate(1.18) brightness(1.07);
}
.fight-fighter.act-down .fight-figure { rotate: 90deg; translate: -20% 30%; filter: grayscale(0.8) brightness(0.7); }
.fight-fighter.face-left.act-down .fight-figure { rotate: -90deg; translate: -80% 30%; }
.fight-fighter.act-out { opacity: 0.4; }

/* эффекты «Испытания боя» (fight_fx.js): пол — под пэтами, остальное — поверх */
.fight-hold-marker {
    position: absolute; z-index: 5; pointer-events: none; translate: -50% -50%;
    box-sizing: border-box; border: 1px solid rgba(254, 221, 166, .45); border-radius: 50%;
    background: radial-gradient(ellipse, rgba(245, 197, 126, .10), rgba(245, 197, 126, .025));
    animation: fight-hold-glow 3.4s ease-in-out infinite;
}
@keyframes fight-hold-glow { 0%, 100% { opacity: .52; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
    .fight-hold-marker { animation: none; opacity: .72; }
}
.fight-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fight-fx-floor { z-index: 50; }
.fight-fx-over { z-index: 950; }
.fight-log-line.guard-break { color: #ffd466; }

.fight-journal {
    position: absolute; z-index: 5; right: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 58px);
    box-sizing: border-box; width: min(420px, calc(100% - 24px)); max-height: min(48dvh, 320px);
    overflow: auto; overscroll-behavior: contain; padding: 8px 10px;
    border: 1px solid #856548; border-radius: 9px; background: #1b151e; box-shadow: 0 8px 24px #000b;
}
.fight-journal[hidden] { display: none; }
.fight-journal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #f1dfbc; }
.fight-journal-head .fight-btn { width: auto; }
.fight-log { max-height: 170px; overflow: auto; padding: 6px 2px 0; display: flex; flex-direction: column; gap: 3px; }
.fight-log:empty { display: none; }
.fight-log-line { flex: none; }
.fight-log { scrollbar-width: thin; scrollbar-color: #8d7374 transparent; }
.fight-log-line { color: #d6cde3; font-size: 13px; overflow-wrap: anywhere; }
.fight-log-line.down, .fight-log-line.end { color: #ffb37d; }
.fight-log-line.mercy { color: #b9e3c2; }

.fight-request {
    margin-top: 8px; padding: 10px 12px; border: 1px solid #e0772f; border-radius: 12px; background: rgba(40, 24, 18, 0.9);
}
.fight-request[hidden] { display: none; }
.fight-request-text { font-weight: 600; }
.fight-request-left { color: #a99fb8; font-weight: 400; }

.fight-foot .fight-btn { white-space: nowrap; flex: none; }
.fight-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.fight-hint { color: #a99fb8; font-size: 13px; }
.fight-ranged { display: flex; flex: none; align-items: flex-start; gap: 5px; }
.fight-stage > .fight-ranged-top { position: absolute; inset: 8px auto auto 8px; z-index: 990; pointer-events: none; }
.fight-stage > .fight-combat-dock {
    position: absolute; left: 50%; bottom: clamp(26px, 8%, 64px); z-index: 990;
    translate: -50% 0;
}
.fight-combat-dock {
    position: relative; align-items: center; justify-content: center; gap: clamp(4px, 1vw, 9px);
    padding: 6px; width: max-content; max-width: calc(100% - 18px); box-sizing: border-box;
    border: 1px solid #a1815c; border-radius: 14px;
    background: repeating-linear-gradient(126deg, #a1876412 0, #a1876412 1px, transparent 1px, transparent 7px),
        linear-gradient(154deg, #403930, #211b17 56%, #191410);
    box-shadow: inset 0 0 0 2px #16120e, inset 0 1px 5px #b68e5535, 0 7px 17px #100a06b0;
}
.fight-arena .fight-combat-dock > .fight-btn.fight-ranged-button {
    width: clamp(44px, 11vw, 58px); height: clamp(44px, 11vw, 54px); min-height: 44px;
    border-color: #8a7053; background: linear-gradient(155deg, #4a4035, #26201a 71%);
    box-shadow: inset 0 0 0 2px #201913, inset 0 1px 4px #b7986e30, 0 2px 4px #120e0a;
    transition: border-color 150ms ease, filter 130ms ease, box-shadow 150ms ease;
}
.fight-arena .fight-combat-dock > .fight-btn.fight-ranged-button:disabled { border-color: #605345; }
.fight-arena .fight-combat-dock > .fight-btn:is([aria-pressed="true"], [aria-expanded="true"]):not(:disabled) {
    border-color: #f3bd77; box-shadow: inset 0 0 0 1px #ffc98270, inset 0 0 10px #f4a14650, 0 0 10px #f2a14445;
}
.fight-arena .fight-combat-dock > .fight-btn:hover:not(:disabled) { border-color: #e4b383; }
.fight-arena .fight-combat-dock > .fight-btn:not(:disabled):active { filter: brightness(1.2); }
.fight-belt-icon {
    position: relative; width: 30px; height: 12px; transform: rotate(-7deg); border-radius: 4px;
    background: radial-gradient(circle at 82% 50%, #301b13 0 1px, transparent 1.2px),
        radial-gradient(circle at 94% 50%, #301b13 0 1px, transparent 1.2px), linear-gradient(#754325, #a66336 36%, #54331f);
    box-shadow: 0 1px 2px #120b07, inset 0 1px 1px #b98561, inset 0 -1px 1px #391f14;
}
.fight-belt-icon::before, .fight-belt-icon::after { content: ""; position: absolute; }
.fight-belt-icon::before {
    width: 10px; height: 10px; top: -1px; left: 8px; border: 2px solid #c69b61; border-radius: 3px;
    box-shadow: 0 1px 2px #170e08, inset 0 0 1px #fff0c5;
}
.fight-belt-icon::after { width: 7px; height: 1.5px; top: 5px; left: 12px; background: #e5b982; }
.fight-belt-items {
    --slot-size: clamp(48px, 14vw, 64px); --slot-gap: 10px;
    position: absolute; right: 6px; bottom: calc(100% + 8px); display: flex; flex-direction: row-reverse;
    align-items: end; gap: var(--slot-gap); pointer-events: none; visibility: hidden;
    transition: visibility 0s linear 175ms;
}
.fight-belt-items[data-open] { pointer-events: auto; visibility: visible; transition-delay: 0s; }
.fight-arena .fight-belt-items .fight-belt-slot {
    position: relative; display: grid; place-items: center; box-sizing: border-box;
    width: var(--slot-size); height: var(--slot-size); padding: 0;
    border: 1px solid #b39768; border-radius: 50%;
    background: radial-gradient(circle at 38% 26%, #534638, #241e17 68%);
    box-shadow: 0 6px 10px #0d0805a0, inset 0 0 0 2px #26201a, inset 0 0 0 3px #92744955;
    opacity: 0; transform: translate(calc(var(--belt-step) * (var(--slot-size) + var(--slot-gap))), calc(var(--slot-size) * .85)) scale(.54);
    transition: opacity 145ms ease, transform 175ms ease, border-color 140ms ease;
}
.fight-arena .fight-belt-items[data-open] .fight-belt-slot {
    opacity: 1; transform: translateY(calc(var(--belt-step) * -6px)) scale(1);
    transition: opacity 180ms ease, transform 250ms cubic-bezier(.18, .82, .28, 1.12), border-color 140ms ease;
    transition-delay: calc(var(--belt-step) * 38ms), calc(var(--belt-step) * 38ms), 0s;
}
.fight-arena .fight-belt-slot:not(:disabled):hover { border-color: #ffd59c; }
.fight-arena .fight-belt-items[data-open] .fight-belt-slot:not(:disabled):active {
    scale: .94; filter: brightness(1.18); transition-delay: 0s;
}
.fight-belt-item { font: 24px/1 system-ui; color: #f2d9a7; }
.fight-belt-slot:disabled .fight-belt-item { opacity: .42; }
.fight-belt-picture { display: block; width: calc(var(--slot-size) * .69); height: calc(var(--slot-size) * .69); object-fit: contain; filter: drop-shadow(0 2px 2px #140d09); }
.fight-belt-count {
    position: absolute; right: -1px; bottom: -1px; display: grid; place-items: center;
    min-width: 17px; height: 17px; padding: 0 3px; border: 1px solid #ad8c5c; border-radius: 12px;
    background: #211913; color: #ffe2b5; font: 700 11px/1 system-ui; font-variant-numeric: tabular-nums;
}
.fight-belt-timer {
    position: absolute; inset: 0; display: grid; place-items: center; color: #fff1cf;
    font: 700 16px/1 system-ui; text-shadow: 0 1px 5px #21120b, 0 1px 4px #21120b;
}
.fight-belt-timer[hidden] { display: none; }
.fight-belt-empty {
    min-width: max-content; padding: 8px 12px; border: 1px solid #a1815c; border-radius: 9px;
    background: #272019; color: #f4dbb5; font-size: 13px; box-shadow: 0 4px 10px #140c08a0;
    opacity: 0; translate: 0 6px; transition: opacity 160ms ease, translate 160ms ease;
}
.fight-belt-items[data-open] .fight-belt-empty { opacity: 1; translate: none; }
@media (prefers-reduced-motion: reduce) {
    .fight-arena .fight-combat-dock > .fight-btn,
    .fight-arena .fight-belt-items, .fight-arena .fight-belt-items .fight-belt-slot,
    .fight-arena .fight-belt-items[data-open] .fight-belt-slot,
    .fight-arena .fight-belt-empty { transition: none; }
}
.fight-ranged[hidden] { display: none; }
.fight-vulnerable {
    flex: none; display: grid; place-items: center; width: 27px; height: 27px; margin: 3px 2px;
    border: 1px solid #e79275; border-radius: 50%; background: #3d231c; color: #ffe3b9;
    box-shadow: 0 0 9px #e2644c99, inset 0 0 0 2px #1f1512;
    font: 700 16px/1 Georgia, serif; animation: fight-vulnerable-pulse 1.05s ease-in-out infinite;
    pointer-events: auto;
}
.fight-vulnerable[hidden] { display: none; }
.fight-ranged-top .fight-vulnerable[hidden] { display: grid; visibility: hidden; }
@keyframes fight-vulnerable-pulse { 50% { opacity: .48; box-shadow: 0 0 2px #e2644c66, inset 0 0 0 2px #1f1512; } }
@media (prefers-reduced-motion: reduce) { .fight-vulnerable { animation: none; } }
.fight-log-line.ranged-notice { color: #ecd9aa; }
.fight-log-line.retreat-failed, .fight-log-line.error { color: #ffb9a5; }
.fight-ranged > .fight-btn.fight-ranged-button {
    position: relative; display: grid; place-items: center; padding: 0; width: 44px; height: 44px; pointer-events: auto;
    border-radius: 9px; border: 1px solid #ad8052; background: radial-gradient(at 35% 20%, #4e3640, #201721 74%);
    box-shadow: inset 0 0 0 2px #251822, 0 2px 7px #160d14aa; color: #ffe1a5;
}
.fight-ranged > .fight-btn.fight-ranged-button[hidden] { display: none; }
.fight-movement-icon {
    width: 19px; height: 21px; background: linear-gradient(150deg, #f3d6a6, #b47945);
    clip-path: polygon(44% 0, 56% 0, 56% 49%, 85% 25%, 95% 36%, 50% 69%, 5% 36%, 15% 25%, 44% 49%, 0 49%, 0 86%, 100% 86%, 100% 100%, 0 100%, 0 49%, 44% 49%);
    filter: drop-shadow(0 1px 2px #170d12);
}
.fight-combat-dock .fight-movement-icon {
    position: relative; width: 27px; height: 26px; background: none; clip-path: none;
}
.fight-combat-dock .fight-movement-icon::before {
    content: ""; position: absolute; inset: 1px 5px 4px;
    background: linear-gradient(125deg, #e2cda6, #978567 49%, #564b41 51%, #b5a186);
    clip-path: polygon(50% 0%, 95% 17%, 90% 59%, 75% 84%, 50% 100%, 25% 84%, 10% 59%, 5% 17%);
}
.fight-combat-dock .fight-movement-icon::after {
    content: ""; position: absolute; inset: auto 0 0; height: 7px;
    border: 1px solid #c5935b; border-top-color: #c5935b5c; border-radius: 50%;
}
.fight-movement-button[aria-pressed="true"]::before {
    content: ""; position: absolute; z-index: 1; width: 24px; height: 2px; transform: rotate(-45deg);
    background: #ffe1a5; box-shadow: 0 0 0 1px #201721; border-radius: 2px;
}
.fight-rush-icon {
    width: 21px; height: 19px; background: linear-gradient(150deg, #f3d6a6, #b47945);
    clip-path: polygon(0 10%, 52% 50%, 0 90%, 0 71%, 29% 50%, 0 29%, 0 10%, 47% 10%, 100% 50%, 47% 90%, 47% 71%, 76% 50%, 47% 29%, 47% 10%);
}
.fight-ranged > .fight-btn.fight-movement-button[aria-pressed="true"]:not(:disabled) { border-color: #d7a066; }
.fight-movement-button:disabled .fight-movement-icon,
.fight-rush-button:disabled .fight-rush-icon { opacity: .38; }
.fight-double-icon {
    position: relative; width: 27px; height: 25px;
}
.fight-double-icon::before, .fight-double-icon::after {
    content: ""; position: absolute; inset: 1px 4px 1px 5px;
    background: linear-gradient(130deg, #fff0c9 15%, #c98f61 56%, #744d34);
    clip-path: polygon(50% 0, 66% 20%, 58% 70%, 84% 70%, 84% 78%, 58% 78%, 58% 100%, 42% 100%, 42% 78%, 16% 78%, 16% 70%, 42% 70%, 34% 20%);
    transform: rotate(42deg);
}
.fight-double-icon::after { transform: rotate(-42deg); }
.fight-ranged > .fight-btn.fight-double-button[aria-pressed="true"]:not(:disabled) { border-color: #e5aa66; }
.fight-double-button:disabled .fight-double-icon { opacity: .38; }
.fight-kick-icon {
    width: 26px; height: 25px;
    background: linear-gradient(156deg, #ecc485 12%, #866143 56%, #dbad68 72%, #71472d 76%);
    clip-path: polygon(13% 5%, 52% 5%, 58% 46%, 73% 55%, 94% 59%, 100% 73%, 94% 90%, 13% 90%, 7% 78%, 11% 47%);
    transform: rotate(-24deg);
}
.fight-kick-button:disabled .fight-kick-icon { opacity: .38; }
.fight-ranged-button:hover:not(:disabled) { border-color: #ebba76; }
.fight-ranged > .fight-btn.fight-ranged-button:disabled { opacity: 1; border-color: #69545a; }
.fight-ranged-icon {
    width: 29px; height: 20px; transform: rotate(-43deg); background: linear-gradient(#ffdc93, #a17448 58%, #e7ba78);
    clip-path: polygon(0 27%, 22% 42%, 70% 42%, 70% 19%, 100% 50%, 70% 81%, 70% 58%, 22% 58%, 0 73%, 7% 50%);
}
.fight-ranged-button[data-weapon="blade"] .fight-ranged-icon {
    background: linear-gradient(90deg, #be8b55 34%, transparent 34%), linear-gradient(#f5edf2, #b7abd0 54%, #6a597c);
    clip-path: polygon(0 35%, 8% 35%, 8% 43%, 25% 43%, 25% 24%, 34% 24%, 34% 34%, 82% 34%, 100% 50%, 82% 66%, 34% 66%, 34% 76%, 25% 76%, 25% 57%, 8% 57%, 8% 65%, 0 65%);
}
.fight-ranged-button:disabled .fight-ranged-icon { opacity: .38; }
.fight-ranged-button[data-pending="true"]::after {
    content: ""; position: absolute; inset: auto 5px 5px auto;
    width: 5px; height: 5px; border-radius: 50%; background: #f0c080; box-shadow: 0 0 5px #f0c08080;
}
.fight-ranged-count {
    position: absolute; inset: 0; display: grid; place-items: center; color: #fff0cb;
    font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px #1b1017, 0 1px 7px #1b1017;
}
.fight-ranged-count[hidden] { display: none; }

.fight-menu {
    position: absolute; right: 16px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px); z-index: 5;
    display: flex; flex-direction: column; gap: 6px; min-width: 210px; padding: 10px;
    border: 1px solid rgba(214, 190, 255, 0.28); border-radius: 12px; background: rgba(22, 16, 32, 0.97); box-shadow: 0 8px 24px #000a;
}
.fight-menu-title { font: 600 17px "Cormorant Garamond", Georgia, serif; padding: 0 2px 2px; }

.fight-result {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 6;
    display: flex; flex-direction: column; gap: 6px; width: min(340px, calc(100vw - 32px)); padding: 18px;
    border: 1px solid #e0772f; border-radius: 14px; background: rgba(22, 16, 32, 0.97); box-shadow: 0 12px 32px #000c; text-align: center;
}
.fight-result-head { font: 700 28px "Cormorant Garamond", Georgia, serif; }
.fight-result-reason { color: #d6cde3; }
.fight-result-line { color: #ffb37d; font-size: 13px; }
.fight-result .fight-btn { margin-top: 8px; }

@media (max-width: 600px) {
    .fight-title { font-size: 19px; }
    .fight-hint { font-size: 12px; }
    .fight-orb { width: 20px; height: 20px; }
    .fight-menu { left: 16px; right: 16px; min-width: 0; }
}

/* 24.10: нападение — бой на карте, управление в полоске внизу (fight.js arena, вид «map»); кнопка — окно ↔ карта */
/* 26.10 (О2в): охота — без окна боя */
.fight-arena.fight-quiet { display: none !important; }
.fight-arena.fight-dock {
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px; margin: 0 auto; max-width: 560px; padding: 8px 12px 10px;
    background: rgba(13, 10, 20, 0.92); border: 1px solid rgba(214, 190, 255, 0.28); border-radius: 14px; box-shadow: 0 8px 24px #000a;
}
.fight-dock .fight-title { font-size: 18px; }
.fight-dock .fight-head { padding-bottom: 2px; align-items: center; }
.fight-dock .fight-journal { bottom: calc(100% + 6px); }
.fight-dock .fight-foot { padding-top: 4px; }
.fight-dock .fight-menu { right: 0; bottom: calc(100% + 8px); }
.fight-dock .fight-result { position: static; translate: none; width: auto; margin-top: 8px; padding: 12px; }
.fight-switch { flex: none; padding: 4px 10px; font-size: 13px; }
.fight-head .fight-switch { margin-left: auto; }
.fight-head .fight-clock { order: 0; }
body.fight-docked .fight-toasts { bottom: auto; top: 64px; }
.fight-request-row + .fight-request-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(224, 119, 47, 0.35); }
.fight-request { max-height: 40vh; overflow-y: auto; }
.fight-dock .fight-request { margin-top: 4px; padding: 6px 10px; max-height: 28vh; }
.fight-dock .fight-request-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.fight-dock .fight-request-row + .fight-request-row { margin-top: 6px; padding-top: 6px; }
.fight-dock .fight-request-text { flex: 1 1 150px; font-size: 13px; }
.fight-dock .fight-invite-buttons { margin-top: 0; gap: 6px; }
.fight-dock .fight-invite-buttons .fight-btn { flex: none; padding: 4px 10px; font-size: 13px; }
@media (max-width: 600px) {
    .fight-dock .fight-title { font-size: 16px; }
    .fight-dock .fight-hint { font-size: 11px; }
    .fight-dock .fight-foot { flex-wrap: wrap; }
}

/* бой на общей карте (fight.js mapWatch): тот же вид, что в окне, прямо на месте пэтов; только смотреть */
.map-fight { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.map-fight .fight-fighter { pointer-events: none; cursor: default; }
/* М2: на бойца на карте можно нажать — вступиться, напасть, смотреть его схватку */
.map-fight .fight-sprite, .map-fight .fight-figure, .map-fight .fight-label { pointer-events: auto; cursor: pointer; }
.fight-role { font-size: 11px; margin-right: 3px; text-shadow: 0 1px 2px #000; }
.fight-role:empty { display: none; }
.fight-fighter.unfocused { opacity: 0.28; transition: opacity 0.4s; }
.fight-fighter { transition: opacity 0.4s; }
.fight-fighter.st-out .fight-figure, .fight-fighter.st-out .fight-sprite { opacity: 0.75; }
.map-fight-menu { position: fixed; z-index: 1000; min-width: 190px; max-width: calc(100vw - 16px); padding: 8px; border-radius: 10px;
  background: #f4ead6; border: 1px solid #8e7147; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; gap: 6px; }
.map-fight-menu-title { font-weight: 700; color: #362b1c; font-size: 14px; }
.map-fight-menu-note { color: #6b5a40; font-size: 13px; }
.map-fight-menu-btn { font: inherit; font-size: 14px; padding: 8px 10px; min-height: 40px; border-radius: 8px; cursor: pointer; text-align: left;
  background: #e9dcc0; border: 1px solid #b59a6b; color: #362b1c; }
.map-fight-menu-btn:hover { background: #d9c398; border-color: #8e7147; }
.map-fight-menu-btn.danger { border-color: #a0654f; color: #7e3523; }
.map-fight-menu-btn:disabled { opacity: 0.5; cursor: default; }
.map-fight .fight-name { font-size: 10px; }
.map-fight .fight-orb { width: 16px; height: 16px; }

/* 24.10: павший в бою на многих ушёл чёрной дымкой к краю карты — без имени и полосок, не нажимается; тает и проявляется */
.fight-fighter.gone { pointer-events: none; transition: opacity 0.35s ease; }
.fight-fighter.gone .fight-label, .fight-fighter.gone .fight-mark { display: none; }
.fight-fighter.gone-hidden { opacity: 0; }

/* 25.10: отдаление в окне боя — кнопки (не спинбоксы), колесо и щипок; поле не листает страницу */
.fight-stage { touch-action: none; }
.fight-zoom { position: absolute; right: 8px; top: 8px; z-index: 990; display: flex; gap: 4px; }
.fight-zoom button { width: 36px; height: 36px; padding: 0; border-radius: 8px; font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
  background: #1d1a16cc; color: #f4ead6; border: 1px solid #ffffff40; }
.fight-zoom button:hover:not(:disabled) { background: #3a3128e6; }
.fight-zoom button:disabled { opacity: 0.35; cursor: default; }
.fight-zoom-value { min-width: 44px; align-self: center; text-align: center; padding: 4px 3px;
  border-radius: 4px; background: #1d1a16cc; color: #f4ead6; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Итог вверху карты, бумага и рамка из паспорта пэта. */
.fight-plate { position: absolute; z-index: 1001; top: 10px; left: 50%; translate: -50% 0;
  width: max-content; max-width: min(340px, calc(100% - 24px)); box-sizing: border-box; padding: 5px 10px;
  border: 1px solid #9a8460; border-radius: 2px 4px 3px 2px;
  background: repeating-linear-gradient(0deg, #806a4105 0 1px, transparent 1px 4px), linear-gradient(125deg, #eee4cb, #e5d6b5);
  box-shadow: 1px 4px 9px #0006, inset 2px 0 #fff5; color: #413827; text-align: center; pointer-events: none; }
.fight-plate-head { font: 700 15px/1.2 Georgia, serif; }
.fight-plate.win .fight-plate-head { color: #45603b; }
.fight-plate.loss .fight-plate-head { color: #8a4635; }
.fight-plate-line { margin-top: 2px; font: 10px/1.3 var(--body, sans-serif); overflow-wrap: anywhere; }
body.m-app:not(.mobile-chat-open) #map-frame > .fight-plate { top: calc(86px + var(--m-top)); }

/* 26.10: попали в зверька — сжимается (scale/translate — свойства отдельно от transform: поворот и «упал» не мешают) */
.creature img.squash { animation: creature-squash 0.28s ease-out; }
@keyframes creature-squash {
    0% { scale: 1 1; translate: 0 0; }
    30% { scale: 1.15 0.8; translate: 0 10%; }
    65% { scale: 0.96 1.05; translate: 0 -2.5%; }
    100% { scale: 1 1; translate: 0 0; }
}

/* 30.10 (слово Архитектора): бой с жителем — на карте, без окна. Вверху карты, внутри рамки — одна тонкая полоска
   здоровья выделенного врага, без рамки (fight.js drawBars, placeBars). Кружков над головами в таком бою нет. */
.map-fight.npc-fight .fight-orb { display: none !important; }
.fight-arena.fight-dock.fight-bars {
    inset: auto; top: 10px; left: 12px; width: 300px; max-width: none; margin: 0; padding: 0; height: auto; min-height: 0;
    display: block; background: none; border: 0; box-shadow: none; pointer-events: none;
    animation: fight-bars-in .35s cubic-bezier(.2, .8, .2, 1);
}
.fight-bars .fight-hint, .fight-bars .fight-foot .fight-btn { display: none; }
/* 01.11 (слово Архитектора): в бою с жителем осталась кнопка «Окно боя» — рядом с полосками, остальное в шапке скрыто */
.fight-bars .fight-head { display: block; position: absolute; top: 0; left: 100%; margin-left: 6px; padding: 0; pointer-events: auto; }
.fight-bars .fight-head .fight-title, .fight-bars .fight-head .fight-clock { display: none; }
.fight-bars .fight-head .fight-switch { margin: 0; white-space: nowrap; }
.fight-bars .fight-foot { padding: 0; height: 0; }
.fight-bars .fight-ranged { margin: 6px auto 0; pointer-events: auto; }
.fight-bars .fight-ranged .fight-btn { display: grid; }
.fight-bars .fight-menu, .fight-bars .fight-journal, .fight-bars .fight-notice { pointer-events: auto; }
.fight-bars .fight-journal { inset: calc(100% + 55px) 0 auto; width: 100%; }
.fight-bars .fight-menu { top: calc(100% + 8px); bottom: auto; left: 0; right: 0; }
.fight-bar-list { display: block; }
.fight-bar { transition: opacity .4s ease; }
.fight-bar.down { opacity: .35; }
.fight-bar-top { display: flex; justify-content: center; gap: 8px; font-size: 11px; line-height: 1.2; margin-bottom: 3px;
    color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px #000a; }
.fight-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fight-bar-num { opacity: .8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fight-bar-track { position: relative; height: 4px; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, 0.45); }
.fight-bar-trail, .fight-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.fight-bar-trail { background: rgba(255, 236, 200, 0.6); transition: width .7s ease .25s; }
.fight-bar-fill { transition: width .18s ease-out; background: linear-gradient(90deg, #d8433a, #ff8a6b); box-shadow: 0 0 6px #ff6b5588; }
.fight-bar-fill.low { animation: fight-bar-pulse 1s ease-in-out infinite; }
.fight-bar.hit .fight-bar-track { animation: fight-bar-shake .28s ease; }
@keyframes fight-bars-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fight-bar-pulse { 50% { opacity: .65; } }
@keyframes fight-bar-shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) {
    .fight-arena.fight-bars, .fight-bar-fill.low, .fight-bar.hit .fight-bar-track { animation: none; }
}

/* 30.10 (слово Архитектора): над бойцом — ни имени, ни значков, ни кружка: только полоска здоровья и полоска устойчивости.
   Глубина бойцов на карте — по линии ног вместе с точками карты (слой боя без своего z-index). */
.map-fight { z-index: auto; }
.fight-name, .fight-role, .fight-mark, .fight-orb { display: none !important; }
.fight-label { gap: 0; }
.fight-hpbars { display: none; flex-direction: column; gap: 2px; width: 54px; pointer-events: none; }
.fight-field .fight-hpbars { display: flex; }
.fight-hptrack, .fight-guardtrack { position: relative; display: block; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.fight-hptrack { height: 4px; }
.fight-guardtrack { height: 2px; }
.fight-guardtrack.off { opacity: 0; }
.fight-hpbar, .fight-guardbar { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .18s ease-out; }
.fight-hpbar { background: linear-gradient(90deg, #d8433a, #ff8a6b); }
.fight-fighter.mine .fight-hpbar { background: linear-gradient(90deg, #3fcf7a, #8ef0a8); }
.fight-fighter.side-0:not(.mine) .fight-hpbar { background: linear-gradient(90deg, #3fae9a, #8ee0cf); }
.fight-fighter.st-down .fight-hptrack, .fight-fighter.st-down .fight-guardtrack { opacity: .35; }
.fight-guardbar { background: linear-gradient(90deg, #6aa8ff, #b7d6ff); }
.fight-guardtrack.broken .fight-guardbar { background: #9a9aa8; }

.map-fight-bars { position: absolute; z-index: 1000; top: 10px; left: 50%; width: min(388px, calc(100% - 28px));
    transform: translate(-50%, -6px); box-sizing: border-box; padding: 5px 8px 6px; border-radius: 4px;
    background: #18151bcc; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px;
    pointer-events: none; opacity: 0; transition: opacity .3s ease, transform .3s ease; }
.map-fight-bars.shown { opacity: 1; transform: translate(-50%, 0); }
#map-frame:has(> .fight-plate) > .map-fight-bars { opacity: 0; }
body.m-app:not(.mobile-chat-open) #map-frame > .map-fight-bars { top: calc(128px + var(--m-top)); }
.mfb-side { display: flex; flex-direction: column; gap: 3px; transition: opacity .4s; }
.mfb-name { color: #f4ead6; font: 11px/1.2 var(--body, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfb-side.down { opacity: .4; }
.mfb-hp, .mfb-guard { position: relative; display: block; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 4px #0006; }
.mfb-hp { height: 5px; }
.mfb-guard { height: 3px; }
.mfb-guard.off { opacity: 0; }
.mfb-hp b, .mfb-guard b { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .2s ease-out; }
.mfb-a .mfb-hp b { background: linear-gradient(90deg, #3fae9a, #8ee0cf); }
.map-fight-bars.mine .mfb-a .mfb-hp b { background: linear-gradient(90deg, #3fcf7a, #8ef0a8); box-shadow: 0 0 6px #3fcf7a88; }
.mfb-b .mfb-hp b { background: linear-gradient(90deg, #d8433a, #ff8a6b); box-shadow: 0 0 6px #ff6b5588; }
.mfb-b { text-align: right; }
.mfb-b b { inset-inline: auto 0; } /* противник — полоска убывает к центру */
.mfb-guard b { background: linear-gradient(90deg, #6aa8ff, #b7d6ff); }
.mfb-guard.broken b { background: #9a9aa8; }
.mfb-side.low .mfb-hp b { animation: fight-bar-pulse 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mfb-side.low .mfb-hp b { animation: none; } }
