/* ============================================
   3D ОГНЕТУШИТЕЛЬ
   ============================================
*/

#fireExtinguisher3D {
    position: fixed;
    bottom: 50px;
    right: 50px;
    width: 120px;
    height: 200px;
    z-index: 100;
    pointer-events: auto; /* Можно кликать! */
    cursor: pointer;
    filter: drop-shadow(0 10px 30px rgba(220, 38, 38, 0.4));
    animation: extinguisherFadeIn 1s ease-out;
}

.extinguisher-body {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out;
}

.extinguisher-body:active {
    transform: scale(0.95);
}

/* Цилиндр огнетушителя */
.extinguisher-cylinder {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 120px;
    background: linear-gradient(
        to right,
        #DC2626 0%,
        #EF4444 20%,
        #DC2626 40%,
        #991B1B 60%,
        #DC2626 80%,
        #EF4444 100%
    );
    border-radius: 10px;
    box-shadow: 
        inset -5px 0 10px rgba(0, 0, 0, 0.3),
        inset 5px 0 10px rgba(255, 255, 255, 0.2);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Этикетка */
.extinguisher-label {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #DC2626;
    font-size: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.fire-icon {
    font-size: 20px;
    animation: flicker 1.5s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
}

/* Верхняя часть (клапан) */
.extinguisher-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 25px;
    background: linear-gradient(180deg, #1F2937 0%, #374151 100%);
    border-radius: 8px 8px 5px 5px;
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.3),
        inset 0 -2px 3px rgba(255, 255, 255, 0.2);
}

/* Ручка */
.extinguisher-handle {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 8px;
    background: #374151;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.extinguisher-handle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #FBBF24;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Шланг */
.extinguisher-hose {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 4px;
    height: 40px;
    background: #1F2937;
    border-radius: 2px;
    transform: rotate(-15deg);
    transform-origin: top;
}

/* Насадка */
.extinguisher-nozzle {
    position: absolute;
    bottom: 50px;
    left: 15px;
    width: 15px;
    height: 8px;
    background: #374151;
    border-radius: 0 4px 4px 0;
    transform: rotate(-15deg);
}

/* Эффект свечения при движении */
.extinguisher-body::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(
        circle,
        rgba(220, 38, 38, 0.2) 0%,
        transparent 70%
    );
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.extinguisher-body:hover::after {
    opacity: 1;
}

/* ===== ЭФФЕКТ РАСПЫЛЕНИЯ ===== */

/* Контейнер для частиц пены */
.spray-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Частица пены */
.spray-particle {
    position: absolute;
    background: radial-gradient(circle, #ffffff 0%, #f0f0f0 50%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    animation: sprayFly 1.5s ease-out forwards;
}

@keyframes sprayFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0.3);
    }
}

/* Эффект пены на экране */
.foam-splash {
    position: absolute;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.6) 40%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    animation: foamExpand 1s ease-out forwards;
}

@keyframes foamExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Эффект облака пены */
.foam-cloud {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    border-radius: 50%;
    pointer-events: none;
    animation: cloudExpand 2s ease-out forwards;
    filter: blur(10px);
}

@keyframes cloudExpand {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(3) rotate(180deg);
        opacity: 0;
    }
}

/* Анимация насадки при выстреле */
.extinguisher-nozzle.shooting {
    animation: nozzleShake 0.3s ease-in-out;
}

@keyframes nozzleShake {
    0%, 100% {
        transform: rotate(-15deg);
    }
    25% {
        transform: rotate(-20deg) translateX(-2px);
    }
    75% {
        transform: rotate(-10deg) translateX(2px);
    }
}

/* Анимация огнетушителя при выстреле */
.extinguisher-body.shooting {
    animation: extinguisherRecoil 0.3s ease-out;
}

@keyframes extinguisherRecoil {
    0%, 100% {
        transform: translateZ(20px);
    }
    50% {
        transform: translateZ(10px) scale(0.98);
    }
}

/* Счётчик выстрелов */
.spray-counter {
    position: fixed;
    bottom: 260px;
    right: 50px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 101;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.spray-counter.show {
    opacity: 1;
    transform: translateY(0);
}

/* Звуковая волна (визуальный эффект звука) */
.sound-wave {
    position: absolute;
    bottom: 50px;
    left: 15px;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(251, 191, 36, 0.6);
    border-radius: 50%;
    animation: soundWaveExpand 0.6s ease-out;
}

@keyframes soundWaveExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Анимация появления */
@keyframes extinguisherFadeIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    #fireExtinguisher3D {
        display: none; /* Скрываем на мобильных */
    }
}
