.battle-modal {
    top: 68px;
    bottom: calc(max(110px, 19vh) + 10px);
    left: 0;
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    transform: none;
}

.arena-modal__body--combat {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    text-align: left;
}

.combat-page {
    position: relative;
    display: grid;
    min-height: 100%;
    background:
        radial-gradient(circle at 8% 0%, rgba(154, 106, 47, .14), transparent 28%),
        linear-gradient(135deg, rgba(30, 36, 26, .96), rgba(15, 21, 16, .98));
}

.combat-status {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 1;
    max-width: min(360px, calc(100vw - 32px));
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 800;
}

.combat-status.is-error {
    border-color: rgba(215, 107, 107, .6);
    color: #ffb0a4;
}

.combat-status.is-success {
    border-color: rgba(159, 211, 143, .48);
    color: #c6efb8;
}

.combat-battle-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100%;
    padding: 14px;
}

.combat-battle-top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.combat-battle-top div,
.combat-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(30, 36, 26, .86);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .38);
}

.combat-battle-top div {
    padding: 10px;
}

.combat-battle-top span,
.combat-fighter span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.combat-battle-top strong,
.combat-fighter strong {
    display: block;
    overflow: hidden;
    color: var(--button-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combat-shell {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(140px, .42fr);
    gap: 10px;
    min-height: 0;
}

.combat-fighters-panel {
    grid-row: 1 / 3;
    min-height: 0;
    padding: 12px;
}

.combat-actions-panel,
.combat-log-panel {
    min-height: 0;
    padding: 12px;
}

.combat-fighters {
    display: grid;
    align-content: start;
    gap: 10px;
    height: 100%;
    overflow: auto;
}

.combat-fighter {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--surface-soft);
}

.combat-fighter small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 800;
}

.combat-hp-bar {
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #0a0d09;
}

.combat-hp-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6f2222, #b5452f);
}

.combat-turn-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    height: 100%;
}

.combat-turn-form[hidden],
.combat-result[hidden] {
    display: none;
}

.combat-turn-form fieldset {
    display: grid;
    align-content: start;
    gap: 10px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-soft);
}

.combat-turn-form legend {
    padding: 0 6px;
    color: var(--button-text);
    font-weight: 800;
}

.combat-zone-list {
    display: grid;
    gap: 7px;
}

.combat-zone-choice {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background:
        linear-gradient(90deg, rgba(198, 141, 52, .08), transparent 42%),
        var(--bg-panel);
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}

.combat-zone-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.combat-zone-choice::before {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid rgba(198, 141, 52, .72);
    border-radius: 7px;
    background: rgba(10, 13, 9, .56);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4);
    color: transparent;
    content: "";
    transition: inherit;
}

.combat-zone-choice::after {
    position: absolute;
    left: 20px;
    width: 10px;
    height: 6px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    content: "";
    transform: rotate(-45deg) scale(.72);
    transform-origin: center;
    opacity: 0;
    transition: opacity .16s ease, transform .16s ease;
}

.combat-zone-choice:hover,
.combat-zone-choice:focus-within {
    border-color: rgba(198, 141, 52, .62);
    background:
        linear-gradient(90deg, rgba(198, 141, 52, .14), transparent 48%),
        rgba(28, 36, 25, .96);
}

.combat-zone-choice:has(input:checked) {
    color: var(--button-text);
    box-shadow: inset 0 0 0 1px rgba(255, 236, 178, .08);
}

.combat-zone-choice:has(input:checked)::after {
    opacity: 1;
    transform: rotate(-45deg) scale(1);
}

[data-combat-attack-zones] .combat-zone-choice:has(input:checked) {
    border-color: rgba(213, 91, 64, .84);
    background:
        linear-gradient(90deg, rgba(181, 69, 47, .32), transparent 58%),
        rgba(54, 22, 18, .88);
    color: #ffd7c7;
}

[data-combat-attack-zones] .combat-zone-choice:has(input:checked)::before {
    border-color: #d55b40;
    background: rgba(181, 69, 47, .62);
}

[data-combat-block-zones] .combat-zone-choice:has(input:checked) {
    border-color: rgba(126, 179, 103, .82);
    background:
        linear-gradient(90deg, rgba(95, 140, 80, .34), transparent 58%),
        rgba(31, 58, 27, .84);
    color: #d9ffd2;
}

[data-combat-block-zones] .combat-zone-choice:has(input:checked)::before {
    border-color: #7eb367;
    background: rgba(95, 140, 80, .68);
}

.combat-submit-button {
    grid-column: 1 / -1;
    justify-self: center;
    min-width: min(260px, 100%);
}

.combat-result {
    display: grid;
    grid-template-columns: minmax(150px, .72fr) minmax(260px, 1.4fr) minmax(150px, .72fr);
    align-items: stretch;
    gap: 12px;
    height: 100%;
}

.combat-equipment-card,
.combat-result-summary {
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 18%, rgba(198, 141, 52, .14), transparent 42%),
        var(--surface-soft);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35);
}

.combat-equipment-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    padding: 12px;
}

.combat-equipment-card span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.combat-equipment-card strong {
    overflow: hidden;
    color: var(--button-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combat-equipment-card img {
    align-self: center;
    justify-self: center;
    width: min(100%, 220px);
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .34));
}

.combat-equipment-card--opponent img {
    transform: scaleX(-1);
}

.combat-result-summary {
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 18px;
    text-align: center;
}

.combat-result-summary h3 {
    margin: 0;
    color: var(--button-text);
    font-size: clamp(1.15rem, 2.4vw, 1.8rem);
    line-height: 1.15;
}

.combat-result-summary p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.combat-result-summary dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 4px 0 0;
}

.combat-result-summary dl div {
    border: 1px solid rgba(198, 141, 52, .34);
    border-radius: 8px;
    padding: 10px;
    background: rgba(12, 16, 10, .54);
}

.combat-result-summary dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.combat-result-summary dd {
    margin: 4px 0 0;
    color: var(--button-text);
    font-size: 1.08rem;
    font-weight: 900;
}

.combat-log-panel {
    overflow: hidden;
}

.combat-log {
    display: grid;
    align-content: start;
    gap: 8px;
    height: 100%;
    margin: 0;
    overflow: auto;
    padding-left: 20px;
}

.combat-log li {
    border-bottom: 1px solid rgba(216, 207, 168, .12);
    padding-bottom: 8px;
    color: var(--ink);
}

@media (max-width: 760px) {
    .battle-modal {
        top: 12px;
        bottom: 12px;
        left: 10px;
        width: calc(100vw - 20px);
        transform: none;
    }

    .combat-battle-panel {
        padding: 10px;
    }

    .combat-battle-top,
    .combat-shell,
    .combat-turn-form,
    .combat-zone-list,
    .combat-result,
    .combat-result-summary dl {
        grid-template-columns: 1fr;
    }

    .combat-shell {
        grid-template-rows: auto auto minmax(180px, 1fr);
        overflow: auto;
    }

    .combat-fighters-panel,
    .combat-log-panel {
        grid-row: auto;
    }
}
