/* Принудительный полный экран */
.hack-code-game {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 40px 20px !important;
    background: #000000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-align: center;
    font-family: 'Courier New', monospace;
    z-index: 999999 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    box-sizing: border-box !important;
}

/* Блокируем прокрутку body */
body.hack-code-active {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
}

/* Фон страницы */
.hack-code-game::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(184, 134, 11, 0.03),
            rgba(184, 134, 11, 0.03) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(ellipse at center, rgba(184, 134, 11, 0.05) 0%, transparent 70%);
    pointer-events: none !important;
    z-index: 0 !important;
}

/* Виньетка */
.hack-code-game::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none !important;
    z-index: 0 !important;
}

.lock-container {
    position: relative !important;
    z-index: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 800px !important;
}

/* Кнопка "Показать код" */
.show-code-btn {
    background: transparent !important;
    color: #8b6914 !important;
    border: 1px solid #654321 !important;
    padding: 10px 25px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 1px !important;
    margin-bottom: 15px !important;
    opacity: 0.7 !important;
}

.show-code-btn:hover {
    opacity: 1 !important;
    background: rgba(184, 134, 11, 0.1) !important;
    border-color: #b8860b !important;
    color: #daa520 !important;
    box-shadow: 0 0 15px rgba(184, 134, 11, 0.3) !important;
}

.current-code {
    color: #daa520 !important;
    font-size: 36px !important;
    font-weight: bold !important;
    letter-spacing: 15px !important;
    margin-bottom: 25px !important;
    min-height: 45px !important;
    text-shadow: 0 0 15px rgba(218, 165, 32, 0.8), 0 0 25px rgba(218, 165, 32, 0.4) !important;
    font-family: 'Courier New', monospace !important;
    display: none !important;
    animation: fadeIn 0.4s ease !important;
}

.current-code.visible {
    display: block !important;
}

/* Замок */
.lock {
    margin: 0 auto 50px !important;
    width: 180px !important;
    height: 230px !important;
    position: relative !important;
    transition: all 0.6s ease !important;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.9)) !important;
}

.lock-body {
    width: 180px !important;
    height: 150px !important;
    background: 
        radial-gradient(circle at 30% 20%, #daa520 0%, transparent 40%),
        radial-gradient(circle at 70% 80%, #8b6914 0%, transparent 50%),
        linear-gradient(135deg, #b8860b 0%, #8b6914 30%, #654321 60%, #a0522d 100%) !important;
    border-radius: 20px !important;
    position: absolute !important;
    bottom: 0 !important;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        inset 0 2px 10px rgba(255, 215, 0, 0.2),
        inset 0 -5px 15px rgba(101, 67, 33, 0.6),
        inset 3px 0 10px rgba(139, 105, 20, 0.3) !important;
    border: 2px solid #654321 !important;
    overflow: hidden !important;
}

.rust-spot {
    position: absolute !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.6) 0%, rgba(101, 67, 33, 0.3) 50%, transparent 80%) !important;
    pointer-events: none !important;
}

.rust-spot.rust-1 {
    width: 40px !important;
    height: 35px !important;
    top: 20px !important;
    left: 15px !important;
}

.rust-spot.rust-2 {
    width: 30px !important;
    height: 30px !important;
    bottom: 25px !important;
    right: 20px !important;
}

.rust-spot.rust-3 {
    width: 35px !important;
    height: 25px !important;
    top: 50% !important;
    right: 10px !important;
    background: radial-gradient(circle, rgba(160, 82, 45, 0.5) 0%, transparent 70%) !important;
}

.lock-face {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    text-align: center !important;
    z-index: 2 !important;
}

.keyhole {
    position: relative !important;
    margin: 0 auto 20px !important;
    width: 40px !important;
    height: 50px !important;
}

.keyhole-circle {
    width: 26px !important;
    height: 26px !important;
    background: radial-gradient(circle, #000 0%, #1a1a1a 60%, #3a2a10 100%) !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(218, 165, 32, 0.3) !important;
}

.keyhole-slot {
    width: 10px !important;
    height: 25px !important;
    background: linear-gradient(to bottom, #000 0%, #1a1a1a 100%) !important;
    margin: -6px auto 0 !important;
    border-radius: 0 0 5px 5px !important;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9) !important;
}

.lock-digits {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-top: 15px !important;
}

.lock-digit {
    color: #daa520 !important;
    font-size: 22px !important;
    font-weight: bold !important;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.6) !important;
}

.lock-rivets {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 3 !important;
}

.rivet {
    position: absolute !important;
    width: 14px !important;
    height: 14px !important;
    background: radial-gradient(circle at 30% 30%, #daa520 0%, #8b6914 50%, #654321 100%) !important;
    border-radius: 50% !important;
    box-shadow: 
        inset 0 1px 2px rgba(255, 215, 0, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

.rivet.top-left { top: 15px !important; left: 15px !important; }
.rivet.top-right { top: 15px !important; right: 15px !important; }
.rivet.bottom-left { bottom: 15px !important; left: 15px !important; }
.rivet.bottom-right { bottom: 15px !important; right: 15px !important; }

.lock-shackle {
    width: 100px !important;
    height: 110px !important;
    border: 18px solid transparent !important;
    border-bottom: none !important;
    border-radius: 50px 50px 0 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    transition: all 0.6s ease !important;
    background: linear-gradient(to right, #654321 0%, #b8860b 20%, #daa520 50%, #b8860b 80%, #654321 100%) !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
    box-shadow: 
        inset 0 3px 8px rgba(255, 215, 0, 0.3),
        inset 0 -3px 8px rgba(101, 67, 33, 0.6),
        0 5px 15px rgba(0, 0, 0, 0.6) !important;
    border-top: 18px solid #b8860b !important;
    border-left: 18px solid #8b6914 !important;
    border-right: 18px solid #8b6914 !important;
}

.shackle-inner {
    width: 64px !important;
    height: 74px !important;
    border: 8px solid transparent !important;
    border-bottom: none !important;
    border-radius: 32px 32px 0 0 !important;
    position: absolute !important;
    top: 18px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #000 !important;
}

.lock.unlocked .lock-shackle {
    transform: translateX(-50%) rotate(-45deg) translateY(-30px) !important;
}

.lock.unlocked .lock-body {
    background: 
        radial-gradient(circle at 30% 20%, #ffd700 0%, transparent 40%),
        radial-gradient(circle at 70% 80%, #daa520 0%, transparent 50%),
        linear-gradient(135deg, #daa520 0%, #b8860b 30%, #8b6914 60%, #cd853f 100%) !important;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        inset 0 2px 10px rgba(255, 215, 0, 0.4),
        0 0 60px rgba(218, 165, 32, 0.6) !important;
}

.lock.unlocked .keyhole-circle {
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.8),
        0 0 25px rgba(255, 215, 0, 0.9) !important;
}

.lock.unlocked .lock-digit {
    color: #ffd700 !important;
    text-shadow: 0 0 20px rgba(255, 215, 0, 1) !important;
}

.game-title {
    color: #daa520 !important;
    font-size: 48px !important;
    margin: 0 0 20px 0 !important;
    text-shadow: 
        0 0 15px rgba(218, 165, 32, 0.5),
        0 0 30px rgba(218, 165, 32, 0.3),
        2px 2px 6px rgba(0, 0, 0, 0.9) !important;
    letter-spacing: 5px !important;
    font-weight: bold !important;
}

.game-description {
    color: #8b6914 !important;
    font-size: 18px !important;
    margin: 0 0 40px 0 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9) !important;
    letter-spacing: 1px !important;
}

.code-inputs {
    display: flex !important;
    justify-content: center !important;
    gap: 20px !important;
    margin-bottom: 40px !important;
}

.code-digit {
    width: 80px !important;
    height: 95px !important;
    font-size: 44px !important;
    text-align: center !important;
    border: 3px solid #8b6914 !important;
    border-radius: 12px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: #daa520 !important;
    font-weight: bold !important;
    font-family: 'Courier New', monospace !important;
    transition: all 0.3s ease !important;
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(139, 105, 20, 0.3) !important;
}

.code-digit:focus {
    outline: none !important;
    border-color: #daa520 !important;
    transform: scale(1.1) !important;
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(218, 165, 32, 0.6) !important;
}

.submit-code, .try-again {
    background: linear-gradient(135deg, #b8860b 0%, #8b6914 50%, #654321 100%) !important;
    color: #fff !important;
    border: 2px solid #daa520 !important;
    padding: 20px 60px !important;
    font-size: 22px !important;
    font-weight: bold !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 
        0 5px 25px rgba(184, 134, 11, 0.4),
        inset 0 2px 5px rgba(255, 215, 0, 0.3) !important;
    letter-spacing: 3px !important;
    font-family: 'Courier New', monospace !important;
    text-transform: uppercase !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

.submit-code:hover, .try-again:hover {
    transform: translateY(-3px) !important;
    background: linear-gradient(135deg, #daa520 0%, #b8860b 50%, #8b6914 100%) !important;
    box-shadow: 
        0 10px 35px rgba(218, 165, 32, 0.6),
        inset 0 2px 5px rgba(255, 215, 0, 0.4) !important;
}

.submit-code:active, .try-again:active {
    transform: translateY(0) !important;
}

.try-again {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%) !important;
    border-color: #4ecdc4 !important;
    box-shadow: 
        0 5px 25px rgba(78, 205, 196, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.2) !important;
}

.try-again:hover {
    box-shadow: 
        0 10px 35px rgba(78, 205, 196, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.3) !important;
}

.message {
    margin-top: 35px !important;
    padding: 25px 40px !important;
    border-radius: 12px !important;
    font-size: 24px !important;
    font-weight: bold !important;
    display: none !important;
    animation: fadeIn 0.5s ease !important;
    letter-spacing: 2px !important;
}

.message.error {
    background: rgba(139, 0, 0, 0.2) !important;
    color: #ff6b6b !important;
    border: 2px solid #8b0000 !important;
    display: block !important;
    box-shadow: 0 0 25px rgba(139, 0, 0, 0.4) !important;
}

.message.success {
    background: rgba(218, 165, 32, 0.2) !important;
    color: #ffd700 !important;
    border: 2px solid #daa520 !important;
    display: block !important;
    box-shadow: 0 0 30px rgba(218, 165, 32, 0.5) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-15px); }
    75% { transform: translateX(15px); }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes glitch {
    0%, 100% { text-shadow: 0 0 15px rgba(218, 165, 32, 0.5), 2px 2px 6px rgba(0, 0, 0, 0.9); }
    25% { text-shadow: -3px 0 15px rgba(218, 165, 32, 0.5), 2px 2px 6px rgba(0, 0, 0, 0.9); }
    50% { text-shadow: 3px 0 15px rgba(218, 165, 32, 0.5), 2px 2px 6px rgba(0, 0, 0, 0.9); }
    75% { text-shadow: 0 3px 15px rgba(218, 165, 32, 0.5), 2px 2px 6px rgba(0, 0, 0, 0.9); }
}

.game-title {
    animation: glitch 3s infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .hack-code-game {
        padding: 30px 15px !important;
    }
    
    .lock {
        width: 150px !important;
        height: 195px !important;
        margin-bottom: 35px !important;
    }
    
    .lock-body {
        width: 150px !important;
        height: 125px !important;
    }
    
    .lock-shackle {
        width: 85px !important;
        height: 95px !important;
    }
    
    .game-title {
        font-size: 36px !important;
    }
    
    .code-digit {
        width: 65px !important;
        height: 80px !important;
        font-size: 36px !important;
    }
    
    .submit-code, .try-again {
        padding: 18px 45px !important;
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {
    .hack-code-game {
        padding: 20px 10px !important;
    }
    
    .lock {
        width: 120px !important;
        height: 160px !important;
        margin-bottom: 25px !important;
    }
    
    .lock-body {
        width: 120px !important;
        height: 100px !important;
    }
    
    .lock-shackle {
        width: 70px !important;
        height: 80px !important;
    }
    
    .game-title {
        font-size: 28px !important;
        letter-spacing: 3px !important;
    }
    
    .game-description {
        font-size: 15px !important;
        margin-bottom: 25px !important;
    }
    
    .code-inputs {
        gap: 12px !important;
        margin-bottom: 30px !important;
    }
    
    .code-digit {
        width: 55px !important;
        height: 70px !important;
        font-size: 30px !important;
    }
    
    .submit-code, .try-again {
        padding: 15px 35px !important;
        font-size: 18px !important;
        letter-spacing: 2px !important;
    }
    
    .message {
        font-size: 18px !important;
        padding: 18px 25px !important;
    }
    
    .current-code {
        font-size: 28px !important;
        letter-spacing: 10px !important;
    }
}

@media (max-height: 600px) {
    .hack-code-game {
        padding: 15px 10px !important;
    }
    
    .lock {
        width: 100px !important;
        height: 130px !important;
        margin-bottom: 15px !important;
    }
    
    .lock-body {
        width: 100px !important;
        height: 85px !important;
    }
    
    .game-title {
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }
    
    .game-description {
        margin-bottom: 15px !important;
    }
    
    .code-inputs {
        margin-bottom: 20px !important;
    }
    
    .code-digit {
        width: 45px !important;
        height: 55px !important;
        font-size: 24px !important;
    }
}