* {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-weight: 300;
    font-size: 14px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #4a4a4a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    overflow: hidden;
}

.locker {
    width: 100%;
    max-width: 400px;
    position: relative;
    transform-style: preserve-3d;
}

.safe-container {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 2s ease;
}

#keypad rect {
    cursor: pointer;
    transition: fill 0.2s ease;
}

#keypad rect:not([fill="#cc0000"]):not([fill="#006400"]):hover {
    fill: #555555;
}

#keypad rect:not([fill="#cc0000"]):not([fill="#006400"]):active {
    fill: #1a1a1a;
}

#keypad rect[fill="#cc0000"]:hover { fill: #ff0000; }
#keypad rect[fill="#cc0000"]:active { fill: #990000; }
#keypad rect[fill="#006400"]:hover { fill: #008000; }
#keypad rect[fill="#006400"]:active { fill: #004d00; }

@keyframes blinkLed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.blink-led {
    animation: blinkLed 0.2s 3;
}

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

.shake {
    animation: shake 0.1s 3;
}

@keyframes openDoor {
    from { transform: perspective(1000px) rotateY(0deg); }
    to { transform: perspective(1000px) rotateY(-70deg); }
}

.door {
    transform-origin: 51px center;
    transition: transform 1s ease;
}

.door.open {
    animation: openDoor 1s forwards;
}

@keyframes zoomIntoSafe {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate3d(0, 0, 500px) scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: translate3d(0, 0, 1000px) scale(0);
        opacity: 0;
    }
}

.safe-zoom {
    animation: zoomIntoSafe 1.5s forwards;
    animation-delay: 1s; 
}

.safe-interior {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: -1;
}

.safe-interior.show {
    opacity: 1;
    z-index: 100;
}

.hidden-message {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    color: #fff;
    font-size: 24px;
    max-width: 80%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateY(50px);
    opacity: 0;
    transition: all 1s ease;
}

.hidden-message.show {
    transform: translateY(0);
    opacity: 1;
}

.prize-content {
    margin-top: 30px;
    width: 100%;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Aggiungi questo CSS al tuo file esistente */

.prize-content {
    margin-top: 30px;
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.victory-message {
    text-align: center;
    color: white;
    font-size: 1.8em;
    font-weight: 400;
    line-height: 1.4;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.victory-image {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.victory-image img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.victory-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 45px rgba(0,0,0,0.5);
}

/* Aggiorna la classe hidden-message per essere più grande */
.hidden-message {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: #fff;
    font-size: 28px;
    max-width: 90%;
    width: auto;
    min-width: 600px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    transform: translateY(50px);
    opacity: 0;
    transition: all 1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Overlay per l'immagine ingrandita */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay.show {
    opacity: 1;
}

.image-overlay.fade-out {
    opacity: 0;
}

.enlarged-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.enlarged-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-overlay.show .enlarged-image {
    transform: scale(1);
}

.close-button {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #ff6666;
    transform: scale(1.1);
}

.close-button:active {
    transform: scale(0.95);
}

/* Media query per dispositivi più piccoli */
@media (max-width: 800px) {
    .hidden-message {
        min-width: 400px;
        max-width: 95%;
        padding: 30px;
        font-size: 24px;
    }
    
    .victory-message {
        font-size: 1.5em;
        padding: 20px 25px;
    }
    
    .victory-image {
        max-width: 400px;
    }
    
    .victory-image img {
        max-height: 300px;
    }
}

@media (max-width: 500px) {
    .hidden-message {
        min-width: 300px;
        padding: 25px;
        font-size: 20px;
    }
    
    .victory-message {
        font-size: 1.3em;
        padding: 18px 20px;
    }
    
    .victory-image {
        max-width: 320px;
    }
    
    .victory-image img {
        max-height: 250px;
    }
}
