/* --- RELOAD ANIMATION OVERLAY --- */
#reload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.reload-gun {
    position: fixed;
    bottom: -220px;
    right: -380px;
    width: 650px;
    height: 650px;
    background-image: url('../assets/images/weapons/gun_reload/gun_reload_default.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: bottom right;
    opacity: 0;
    z-index: 202;
}

.reload-gun.animate-approach {
    animation: gun-approach 0.3s ease-out forwards;
}

.reload-gun.animate-retreat {
    animation: gun-retreat 0.4s ease-in forwards;
}

@keyframes gun-approach {
    from {
        transform: scale(1) rotate(0deg);
        opacity: 0;
    }

    to {
        transform: scale(1.5) rotate(5deg);
        opacity: 1;
    }
}

@keyframes gun-retreat {
    from {
        transform: scale(1.5) rotate(5deg);
        opacity: 1;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 0;
    }
}

.reload-holster {
    position: fixed;
    bottom: -100px;
    right: -120px;
    width: 580px;
    height: 580px;
    background-image: url('../assets/images/weapons/holsters/holster_default.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: right center;
    opacity: 0;
    z-index: 201;
}

.reload-holster.animate-roll-out {
    animation: holster-roll-out 0.4s ease-out forwards;
}

.reload-holster.animate-roll-in {
    animation: holster-roll-in 0.3s ease-in forwards;
}

@keyframes holster-roll-out {
    0% {
        transform: translateX(100px) translateY(0) rotate(0deg) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    50% {
        transform: translateX(50px) translateY(-20px) rotate(180deg) scale(0.8);
    }

    100% {
        transform: translateX(0) translateY(-40px) rotate(360deg) scale(1);
        opacity: 1;
    }
}

@keyframes holster-roll-in {
    0% {
        transform: translateX(0) translateY(-40px) rotate(360deg) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateX(50px) translateY(-20px) rotate(180deg) scale(0.8);
    }

    100% {
        transform: translateX(100px) translateY(0) rotate(0deg) scale(0.5);
        opacity: 0;
    }
}

#reload-bullets-container {
    position: fixed;
    bottom: 167px;
    right: 220px;
    width: 100px;
    height: 180px;
    pointer-events: none;
    z-index: 203;
    transform: translateY(-40px);
    transition: opacity 0.4s ease-in;
}

#reload-bullets-container.fade-out {
    opacity: 0;
}

.reload-bullet {
    position: absolute;
    width: 150px;
    height: 150px;
    background-image: url('../assets/images/bullet.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: scale(0.5);
    animation: bullet-appear 0.3s ease-out forwards;
}

/* Pre-loaded bullets (already in magazine) appear instantly without animation */
.reload-bullet.pre-loaded {
    opacity: 1;
    transform: scale(1);
    animation: none;
}

@keyframes bullet-appear {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Bullet positions over holster (6 positions in circular pattern) */
.reload-bullet:nth-child(1) {
    left: 75px;
    top: 20px;
}

.reload-bullet:nth-child(2) {
    left: 130px;
    top: 50px;
}

.reload-bullet:nth-child(3) {
    left: 130px;
    top: 110px;
}

.reload-bullet:nth-child(4) {
    left: 75px;
    top: 142px;
}

.reload-bullet:nth-child(5) {
    left: 23px;
    top: 113px;
}

.reload-bullet:nth-child(6) {
    left: 23px;
    top: 50px;
}

/* ═══════════════════════════════════════════════
   SHOTGUN BREAK-ACTION RELOAD
   Isolated from revolver — dispatched by renderer
   ═══════════════════════════════════════════════ */

/* Shotgun reload gun: centered, larger, no rotation */
.reload-gun.animate-shotgun-open {
    animation: shotgun-open 0.4s ease-out forwards;
}

.reload-gun.animate-shotgun-close {
    animation: shotgun-close 0.35s ease-in forwards;
}

@keyframes shotgun-open {
    from {
        transform: scale(0.6) translateY(80px);
        opacity: 0;
    }

    to {
        transform: scale(1.2) translateY(0);
        opacity: 1;
    }
}

@keyframes shotgun-close {
    from {
        transform: scale(1.2) translateY(0);
        opacity: 1;
    }

    to {
        transform: scale(0.6) translateY(80px);
        opacity: 0;
    }
}

/* Override reload-gun positioning for shotgun (bottom-center, smaller) */
.reload-gun.shotgun-reload-gun {
    bottom: 1%;
    right: 28%;
    margin-right: -150px;
    transform-origin: center center;
    width: 500px;
    height: 500px;
}

/* Shell images positioned inside the barrel chambers */
.shotgun-shell-img {
    position: absolute;
    width: 250%;
    height: 250%;
    left: -160px;
    top: 80px;
    object-fit: contain;
    pointer-events: none;
    opacity: 0;
    transform: translateY(30px) scale(0.6);
    animation: shell-insert 0.3s ease-out forwards;
}

@keyframes shell-insert {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.6);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}