/* =========================================
   BATTLE FLOW UI
   Restored pre-battle transition + post-battle result screen.
   Does not change the battle arena layout.
   ========================================= */

body.battle-scroll-locked {
    overflow: hidden !important;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

body.battle-scroll-locked #game-log-shell,
body.battle-scroll-locked #main-bottom-nav {
    display: none !important;
}

#battle-transition-overlay,
#battle-result-overlay {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .88);
    color: #fff;
}

/* =========================================
   PRE-BATTLE TRANSITION
   ========================================= */

#battle-transition-overlay {
    z-index: 3000;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.battle-transition-icon {
    font-size: 48px;
    line-height: 1;
}

.battle-transition-text {
    font-size: 20px;
    font-weight: 700;
}

/* =========================================
   POST-BATTLE RESULT
   ========================================= */

#battle-result-overlay {
    z-index: 1900;
    overflow-y: auto;
    padding: 18px;
    box-sizing: border-box;
    background: rgba(8, 5, 3, .88) !important;
    backdrop-filter: blur(2px);
}

.battle-result-card {
    width: min(100%, 420px);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 18px;
    color: #f3dfac !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(131, 84, 35, .28), transparent 44%),
        linear-gradient(180deg, #332015 0%, #1b120d 55%, #120c09 100%) !important;
    border: 2px solid #9b6b2f !important;
    border-radius: 14px !important;
    box-shadow:
        0 0 0 2px rgba(39, 24, 13, .92),
        0 12px 36px rgba(0, 0, 0, .7),
        inset 0 0 24px rgba(205, 145, 59, .08) !important;
    font-family: Georgia, "Times New Roman", serif;
}

.battle-result-title {
    margin: 0 0 14px;
    text-align: center;
    color: #f4ce73 !important;
    text-shadow: 0 2px 3px #000;
    letter-spacing: .04em;
}

.battle-result-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.battle-result-stat {
    padding: 8px;
    text-align: center;
    color: #f5e5bd !important;
    background: rgba(14, 9, 6, .64) !important;
    border: 1px solid rgba(184, 126, 52, .55) !important;
    border-radius: 7px;
}

.battle-result-drops-title {
    margin: 10px 0 7px;
    font-weight: 700;
    color: #eac66e !important;
}

.battle-result-drops {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.battle-result-drop {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    color: #f0dfb4 !important;
    background: rgba(31, 20, 13, .9) !important;
    border: 1px solid rgba(166, 112, 44, .65) !important;
    border-radius: 7px;
}

.battle-result-empty {
    padding: 8px 0;
    color: #cbb98e !important;
}

.battle-result-return {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    color: #fff0bd !important;
    background: linear-gradient(180deg, #6d4722, #3b2716) !important;
    border: 1px solid #b17b35 !important;
    border-radius: 8px;
    box-shadow: inset 0 0 8px rgba(255, 212, 120, .08) !important;
}

.battle-result-return:active,
.battle-result-drop:active {
    filter: brightness(1.12);
}

@media (max-width: 390px) {
    #battle-result-overlay {
        padding: 12px;
    }

    .battle-result-card {
        padding: 14px;
    }

    .battle-result-title {
        font-size: 22px;
    }
}