/* Public combat state, compact clickable effects and readable artwork in both themes. */
.battle-combatants {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}
.battle-status {
    --battle-portrait-height: 176px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-rows: minmax(var(--battle-portrait-height), 1fr) auto;
    align-items: center;
    justify-items: center;
    align-content: stretch;
    gap: 8px 0;
    padding: 8px 6px;
    min-width: 0;
    min-height: 196px;
    overflow: clip;
}
.battle-status-right {
    grid-template-columns: max-content minmax(0, 1fr);
}
.battle-status > .battle-portrait {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, calc(var(--battle-portrait-height) * 2 / 3));
    height: auto;
    aspect-ratio: 2 / 3;
    min-width: 0;
    justify-self: start;
    flex-basis: auto;
}
.battle-status-right > .battle-portrait {
    grid-column: 2;
    justify-self: end;
}
.battle-vitals {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}
.battle-modifiers {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: flex-start;
    align-self: start;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    min-width: 0;
}
.battle-status-right .battle-modifiers {
    grid-column: 1;
    flex-direction: row;
}
.battle-resource {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    height: 22px;
    overflow: hidden;
    border: 1px solid #45574e;
    border-radius: 3px;
    background: #24342e;
    isolation: isolate;
}
.battle-resource-fill {
    position: absolute;
    inset: 0;
    background: #983b3b;
    transform-origin: left;
    transition: transform 350ms linear;
    z-index: -1;
}
.battle-mana .battle-resource-fill {
    background: #385f9a;
}
.battle-resource b {
    color: white;
    font-size: var(--battle-resource-font);
    line-height: 1;
    white-space: nowrap;
}
.battle-status-tactics {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    min-width: 0;
}
.battle-status .combat-charges {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin: 0;
}
.battle-tactic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 11px;
    flex-shrink: 0;
}
.battle-tactic strong {
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.battle-tactic:focus-visible {
    outline: 1px solid var(--muted);
    outline-offset: -1px;
}
.battle-effects {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    align-content: flex-start;
    flex-wrap: nowrap;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    min-width: 0;
    max-height: 136px;
    overflow-y: auto;
}
.battle-effect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 10px;
    flex-shrink: 0;
}
#combatEffectDialog {
    width: min(440px, calc(100% - 24px));
    max-height: calc(100dvh - 32px);
    padding: 14px 18px 20px;
    color: var(--battle-text);
    overflow-y: auto;
}
.effect-panel-close {
    display: block;
    width: 44px;
    min-height: 44px;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 20px;
}
.effect-panel-close:focus-visible {
    outline: 1px solid var(--muted);
    outline-offset: 1px;
}
.effect-summary {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}
.effect-summary h2 {
    font-size: 23px;
    margin: 0;
    overflow-wrap: anywhere;
}
.effect-description {
    margin: 20px 0 10px;
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.effect-duration {
    margin: 0;
    line-height: 1.5;
}
:root:not([data-theme='dark']) .battle-effect,
:root:not([data-theme='dark']) .battle-tactic,
:root:not([data-theme='dark']) .effect-panel-close {
    background: transparent;
}

.battle-effect img {
    width: 19px;
    height: 19px;
}
.combat-state-icon {
    display: inline-block;
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    vertical-align: middle;
    object-fit: contain;
}
.battle-status-tactics .combat-state-icon {
    width: 26px;
    height: 26px;
}
.effect-art img {
    display: block;
    width: 76px;
    height: 76px;
}
:root[data-theme='dark'] .battle-effect img,
:root[data-theme='dark'] .effect-art img,
:root[data-theme='dark'] .combat-state-icon {
    filter: brightness(0) invert(1);
}
@media (prefers-reduced-motion: reduce) {
    .battle-resource-fill {
        transition: none;
    }
}
