/* ==================== SLOT LEVER ==================== */
.lever-container {
    position: relative;
    width: 80px;
    height: 280px;
    cursor: pointer;
    user-select: none;
}

.lever-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 50px;
    background: linear-gradient(145deg, #2a2215, #1a1508);
    border-radius: 10px 10px 20px 20px;
    box-shadow: 
        0 5px 20px rgba(0,0,0,0.5),
        inset 0 2px 5px rgba(212, 168, 83, 0.2),
        0 0 30px rgba(212, 168, 83, 0.2);
    border: 3px solid #8b6914;
}

.lever-base::before {
    content: 'SPIN';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 900;
    color: #d4a853;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 168, 83, 0.5);
}

.lever-stick {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    transform-origin: bottom center;
    width: 16px;
    height: 180px;
    background: linear-gradient(90deg, #5a4a2a, #8b7635, #d4a853, #8b7635, #5a4a2a);
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(212, 168, 83, 0.3),
        inset 2px 0 4px rgba(255,255,255,0.2),
        inset -2px 0 4px rgba(0,0,0,0.3);
    transition: transform 0.3s cubic-bezier(0.4, 2, 0.5, 1);
}

.lever-stick::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(255,255,255,0.3) 0%, 
        transparent 20%,
        transparent 80%,
        rgba(0,0,0,0.2) 100%
    );
    border-radius: 6px;
}

/* Ручка шара */
.lever-ball {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: 55px;
    background: radial-gradient(circle at 30% 30%, 
        #ff6b6b 0%, 
        #c21631 40%, 
        #8b1025 70%,
        #5a0a18 100%
    );
    border-radius: 50%;
    box-shadow: 
        0 0 30px rgba(194, 22, 49, 0.6),
        0 0 60px rgba(194, 22, 49, 0.3),
        inset 0 -8px 15px rgba(0,0,0,0.4),
        inset 0 8px 15px rgba(255,255,255,0.2),
        0 5px 15px rgba(0,0,0,0.5);
    border: 3px solid #d4a853;
    animation: ballGlow 2s ease-in-out infinite;
}

.lever-ball::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 12px;
    width: 18px;
    height: 12px;
    background: radial-gradient(ellipse, rgba(255,255,255,0.6) 0%, transparent 70%);
    border-radius: 50%;
}

@keyframes ballGlow {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(194, 22, 49, 0.6),
            0 0 60px rgba(194, 22, 49, 0.3),
            inset 0 -8px 15px rgba(0,0,0,0.4),
            inset 0 8px 15px rgba(255,255,255,0.2),
            0 5px 15px rgba(0,0,0,0.5);
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(194, 22, 49, 0.8),
            0 0 100px rgba(194, 22, 49, 0.4),
            0 0 150px rgba(212, 168, 83, 0.2),
            inset 0 -8px 15px rgba(0,0,0,0.4),
            inset 0 8px 15px rgba(255,255,255,0.2),
            0 5px 15px rgba(0,0,0,0.5);
    }
}

/* Hover */
.lever-container:hover .lever-ball {
    animation: ballGlowHover 0.5s ease-in-out infinite;
}

.lever-container:hover .lever-stick {
    transform: translateX(-50%) rotate(-5deg);
}

@keyframes ballGlowHover {
    0%, 100% { 
        box-shadow: 
            0 0 50px rgba(194, 22, 49, 0.8),
            0 0 100px rgba(194, 22, 49, 0.5),
            inset 0 -8px 15px rgba(0,0,0,0.4),
            inset 0 8px 15px rgba(255,255,255,0.2);
    }
    50% { 
        box-shadow: 
            0 0 70px rgba(212, 168, 83, 0.9),
            0 0 140px rgba(194, 22, 49, 0.5),
            inset 0 -8px 15px rgba(0,0,0,0.4),
            inset 0 8px 15px rgba(255,255,255,0.2);
    }
}

/* Pulled animation */
.lever-container.pulled .lever-stick {
    transform: translateX(-50%) rotate(35deg);
    transition: transform 0.15s ease-in;
}

.lever-container.released .lever-stick {
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.5);
}

.lever-container.pulled .lever-ball {
    animation: none;
    box-shadow: 
        0 0 80px rgba(212, 168, 83, 1),
        0 0 150px rgba(194, 22, 49, 0.8),
        0 0 200px rgba(255, 215, 0, 0.4),
        inset 0 -8px 15px rgba(0,0,0,0.4),
        inset 0 8px 15px rgba(255,255,255,0.3);
}

/* Декоративные элементы */
.lever-socket {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 25px;
    background: linear-gradient(180deg, #1a1508, #2a2215);
    border-radius: 5px 5px 15px 15px;
    border: 2px solid #8b6914;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.5);
}

.lever-socket::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 12px;
    background: radial-gradient(ellipse, #0a0a0a 0%, #1a1508 100%);
    border-radius: 50%;
}

/* Искры */
.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.lever-container.pulled .spark {
    animation: sparkFly 0.5s ease-out forwards;
}

@keyframes sparkFly {
    0% { 
        opacity: 1; 
        transform: translate(0, 0) scale(1);
    }
    100% { 
        opacity: 0; 
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Disabled */
.lever-container.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.lever-container.disabled .lever-ball {
    animation: none;
    box-shadow: 
        0 0 15px rgba(100, 100, 100, 0.3),
        inset 0 -8px 15px rgba(0,0,0,0.4);
}
