/* All coordinates are logical pixels inside the existing 1920×960 stage. */
.war-map-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.war-attack-arrow { position: absolute; z-index: 2; display: block; background-repeat: no-repeat; filter: drop-shadow(0 3px 4px #000); }
.war-battle-marker { position: absolute; z-index: 1; display: grid; place-items: center; padding: 0; border: 0; background: none; transform: translate(-50%, -50%); cursor: pointer; pointer-events: auto; }
.war-battle-marker__icon { display: block; background-repeat: no-repeat; filter: drop-shadow(0 4px 5px #000); transition: filter .18s ease, transform .18s ease; }
.war-battle-marker.is-hovered .war-battle-marker__icon { transform: scale(1.018); filter: saturate(1.06) brightness(1.11) drop-shadow(0 0 3px rgba(238, 201, 113, .38)); }
.endgame-region.is-battle-selected, .endgame-enemy-territory.is-battle-selected { z-index: 2; }
.map-view[data-map-mode="endgame"] .endgame-region.is-battle-selected,
.map-view[data-map-mode="endgame"] .endgame-enemy-territory.is-battle-selected,
.map-view[data-map-mode="endgame"] .war-battle-marker.is-selected .war-battle-marker__icon { animation: warBattleSelectionPulse 1.5s ease-in-out infinite; }
@keyframes warBattleSelectionPulse {
    0%, 100% { transform: scale(1); filter: saturate(.98) brightness(1.02) drop-shadow(0 0 1px rgba(238, 201, 113, .18)); }
    50% { transform: scale(1.018); filter: saturate(1.06) brightness(1.28) drop-shadow(0 0 3px rgba(238, 201, 113, .5)); }
}
.war-battle-marker:focus-visible { outline: 2px solid #e3c780; outline-offset: 3px; }
.war-panel { --details-button-text-shadow: 0 2px 0 #000; z-index: 14; box-sizing: border-box; overflow: hidden; color: #cdbb9b; font: 400 14px/1.45 var(--font-body); text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .8); }
.war-panel__content { position: absolute; top: 140px; right: 44px; bottom: 176px; left: 44px; overflow: hidden; }
.war-panel__title { margin: 0; color: #caba95; font: 700 30px/1 var(--font-title); text-align: center; text-transform: uppercase; }
.war-panel__feedback { margin: 8px 0 12px; color: #bca177; font: 400 12px/1.35 var(--font-body); text-align: center; }
.war-battle-list { display: grid; gap: 6px; }
.war-battle-choice { box-sizing: border-box; display: grid; align-content: center; gap: 4px; width: 312px; height: 88px; padding: 12px 20px; border: 0; color: #bca177; background: transparent url("../image/ui/text_field.png") center / 100% 100% no-repeat; text-align: left; font: inherit; text-shadow: inherit; cursor: pointer; transition: transform .18s ease; }
.war-battle-choice:hover, .war-battle-choice:focus-visible { transform: translateY(-4px); }
.war-battle-choice strong { min-width: 0; overflow: hidden; color: #caba95; font: 700 18px/1.2 var(--font-title); text-overflow: ellipsis; white-space: nowrap; }
.war-battle-choice span { font-size: 12px; line-height: 1.4; }
.war-battle-choice.is-selected { filter: brightness(1.25); }
.war-battle-choice:focus-visible { outline: 1px solid #e5c77e; outline-offset: -6px; }
.war-battle-choice[hidden], .war-battle-pages[hidden], .war-join-button[hidden] { display: none; }
.war-battle-pages { display: flex; height: 28px; margin-top: 6px; align-items: center; justify-content: center; gap: 14px; color: #bca177; font-size: 12px; }
.war-battle-pages button { width: 32px; height: 28px; padding: 0; border: 0; background: none; color: #cba86c; font: 700 26px/1 var(--font-title); }
.war-battle-pages button:disabled { opacity: .35; }
.war-battle-details { margin-top: 12px; }
.war-battle-details h3 { margin: 0; color: #caba95; font: 700 20px/1.2 var(--font-title); text-align: center; overflow-wrap: anywhere; }
.war-battle-details p { margin: 6px 0 0; overflow-wrap: anywhere; }
.war-battle-details p:empty { display: none; }
.war-battle-progress { width: 312px; height: 48px; overflow: hidden; background: transparent url("../image/ui/exp_frame.png") center / 312px 48px no-repeat; }
.war-battle-progress__fill { display: block; width: var(--war-battle-progress, 0%); height: 48px; background: transparent url("../image/ui/exp_bar.png") left top / 312px 48px no-repeat; }
.war-battle-count, .war-battle-clock { color: #ead29d; font-weight: 600; }
.war-battle-difficulty { color: #cba86c; }
.war-battle-reason { color: #bca177; font: 400 12px/1.35 var(--font-body); }
.map-view:not([data-map-mode="endgame"]) .war-panel { display: none; }
.map-view.war-awaiting-state[data-map-mode="endgame"] .endgame-region-layer { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .war-battle-marker__icon, .war-battle-choice { transition: none; } }
@media (prefers-reduced-motion: reduce) {
    .map-view[data-map-mode="endgame"] .endgame-region.is-battle-selected,
    .map-view[data-map-mode="endgame"] .endgame-enemy-territory.is-battle-selected,
    .map-view[data-map-mode="endgame"] .war-battle-marker.is-selected .war-battle-marker__icon { animation: none; transform: scale(1.018); filter: saturate(1.06) brightness(1.28) drop-shadow(0 0 3px rgba(238, 201, 113, .5)); }
}
