/* Stile generale per il body */

body {

    margin: 0;

    padding: 0;

    background-color: #000000;

    display: flex;

    justify-content: center;

    flex-direction: column;

    align-items: center;

    height: 100vh;

    font-family: 'MedievalSharp', sans-serif;

    overflow: hidden;

}

.popup {
    display: none; /* Nascondi di default */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: rgb(255, 255, 255);
    padding: 15px;
    font-size: 22px;
    text-align: center;
    border-radius: 8px;
    z-index: 10;
}



/* Stile per la schermata iniziale */

#startScreen {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    background: linear-gradient(135deg, #f4e4bc 0%, #e8d7b0 25%, #dcc8a4 50%, #d0ba98 75%, #c4ac8c 100%);

    background-size: cover;

    color: white;

    text-align: center;

    overflow: hidden;

    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);

    border-radius: 15px;

    padding: 20px;

}



#personaggio {

    position: absolute;

    top: 60%;

    left: 50%;

    transform: translate(-50%, -50%);

    width: 350px;

    height: auto;

    z-index: 10;

}



#backgroundImage {

    position: absolute;

    width: 100%;

    height: 100%;

    object-fit: cover;

    z-index: -1;

}



#gameDescription {

    background-color: rgba(0, 0, 0, 0.8);

    color: white;

    padding: 30px;

    border-radius: 20px;

    text-align: center;

    width: 70%;

    margin: 0 auto;

    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);

    animation: fadeIn 2s ease-in-out;

}



@keyframes fadeIn {

    from { opacity: 0; }

    to { opacity: 1; }

}



.yellow-text {

    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 0, 0, 0.6);

}



.white-text {

    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.5);

}



.arial-font {

    font-family: Arial, sans-serif;

}



.red-text {

    color: red;

}



.blue-text {

    color: lightblue;

}



.beige-text {

    color: #f4ecd8;

}



.gray-text {

    color: gray;

}



.brown-text {

    color: rgb(104, 39, 6);

}



.comic-font {

    font-family: 'Comic Sans MS', cursive, sans-serif;

}



.created-by {

    font-size: 18px;

    color: #FFD700;

    font-family: 'MedievalSharp', sans-serif;

    padding: 5px 10px;

    border: 2px solid black; /* Cornice nera attorno al testo */

    border-radius: 5px; /* Angoli leggermente arrotondati */

    background-color: rgba(0, 0, 0, 0.7); /* Sfondo nero semi-trasparente */

    margin-top: 20px;

    z-index: 10;

    display: inline-block;

}



/* Stile per il pulsante di inizio - Design Premium */

#startButton {

    font-size: 1.1rem;

    padding: 12px 24px;

    border: none;

    border-radius: 40px;

    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);

    color: #8B0000;

    cursor: pointer;

    transition: all 0.4s ease;

    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.7),
        0 0 40px rgba(255, 165, 0, 0.4),
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);

    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 255, 255, 0.5);

    font-family: 'MedievalSharp', sans-serif;

    font-weight: bold;

    position: relative;

    overflow: hidden;

    border: 3px solid rgba(255, 255, 255, 0.8);

    display: flex;

    align-items: center;

    gap: 8px;

    animation: gentlePulse 3s infinite;

}

#startButton .button-icon,
#startButton span {
    position: relative;
    z-index: 2;
}



@keyframes gentlePulse {

    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.7),
            0 0 40px rgba(255, 165, 0, 0.4),
            0 8px 25px rgba(0, 0, 0, 0.3),
            inset 0 2px 10px rgba(255, 255, 255, 0.3);
    }

    50% { 
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.9),
            0 0 60px rgba(255, 165, 0, 0.6),
            0 12px 35px rgba(0, 0, 0, 0.4),
            inset 0 2px 10px rgba(255, 255, 255, 0.5);
    }

}



#startButton::before {

    content: '';

    position: absolute;

    top: -50%;

    left: -50%;

    width: 200%;

    height: 200%;

    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );

    transform: translateX(-100%) rotate(45deg);

    transition: transform 0.6s ease;

    z-index: 1;

}



#startButton::after {

    content: '';

    position: absolute;

    top: 50%;

    left: 50%;

    width: 0;

    height: 0;

    background: radial-gradient(circle, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 70%);

    transform: translate(-50%, -50%);

    transition: all 0.3s ease;

    border-radius: 50%;

    z-index: 1;

}



#startButton:hover::before {

    transform: translateX(100%) rotate(45deg);

}



#startButton:hover::after {

    width: 100%;

    height: 100%;

}



#startButton:hover {

    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FF6B9D 100%);

    box-shadow: 
        0 0 40px rgba(255, 107, 107, 0.8),
        0 0 70px rgba(255, 142, 83, 0.5),
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 2px 15px rgba(255, 255, 255, 0.4);

    transform: translateY(-8px) scale(1.08);

    border-color: rgba(255, 255, 255, 1);

    animation: none;

}



#startButton:active {

    transform: translateY(-5px) scale(1.02);

    box-shadow: 
        0 0 30px rgba(255, 107, 107, 0.6),
        0 0 50px rgba(255, 142, 83, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.4);

}



#discordButton {

    font-size: 24px;

    padding: 12px 25px;

    border: none;

    border-radius: 50px; /* Forma ovale */

    background: linear-gradient(135deg, #7289da 0%, #99aab5 100%); /* Colori Discord */

    color: white;

    cursor: pointer;

    transition: all 0.3s ease;

    box-shadow: 0 0 15px rgba(114, 137, 218, 0.8), 0 0 25px rgba(153, 170, 181, 0.5); /* Effetto di luce intorno */

    text-shadow: 0 0 5px rgba(0, 0, 0, 0.2); /* Leggera ombra al testo */

    font-family: 'MedievalSharp', sans-serif; /* Font magico */

    position: relative;

    overflow: hidden;

}



#discordButton::before {

    content: '';

    position: absolute;

    top: 50%;

    left: 50%;

    width: 300%;

    height: 300%;

    background: radial-gradient(circle, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%);

    transform: translate(-50%, -50%) scale(0.1);

    transition: transform 0.3s ease;

    border-radius: 50%;

    z-index: 0;

}



#discordButton:hover::before {

    transform: translate(-50%, -50%) scale(1);

}



#discordButton:hover {

    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%); /* Cambia sfumatura al passaggio del mouse */

    box-shadow: 0 0 30px rgba(114, 137, 218, 0.8), 0 0 40px rgba(153, 170, 181, 0.5); /* Luce aumentata */

}



#discordButton:active {

    transform: scale(0.95); /* Piccolo effetto di clic */

}





#logo {

    margin-top: 30px;

    width: 150px;

    height: auto;

}



#gameCanvas {
    width: 90vw;
    height: 90vh;
    border: 5px solid gold;
    display: none;
    background-size: cover;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    border-radius: 15px;
    /* Evita che il filtro blur crei stacking context problematici */
    isolation: isolate;
}



#typingBar {
    position: absolute;
    bottom: 8%; /* Posizionata sopra il fondo */
    left: 50%;
    transform: translateX(-50%);
    width: 30vw; /* Dimensione iniziale */
    padding: 0;
    border: 50px;
    background: none;
    box-shadow: none;
    text-align: center;
    transition: width 0.3s ease;
}

#inputField {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; /* Mantieni la larghezza del contenitore */
    font-size: 30px;
    border: none;
    outline: none;
    background: transparent;
    color: rgb(255, 255, 255);
    text-align: center;
    caret-color: white;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px; /* Spaziatura tra lettere */
  
    padding: 15px;
    border-radius: 50px;
}

/* Stile per il placeholder */
#inputField::placeholder {
    color: rgb(255, 255, 255);
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Italic', sans-serif;
    letter-spacing: 1px;
    text-shadow: none;
    animation: lampeggio 0.8s infinite;
}

/* Animazione di lampeggio per il placeholder */
@keyframes lampeggio {
    0% {
        opacity: 1; /* Testo completamente visibile */
    }
    50% {
        opacity: 0; /* Testo completamente trasparente */
    }
    100% {
        opacity: 1; /* Testo completamente visibile */
    }
}




/* Mostra il campo di input quando il gioco è avviato */
#inputField.active {
    display: block; /* Mostra l'input */
}




#progressBars {
    display: none; /* Nasconde le barre prima dell'inizio del gioco */
    position: absolute;
    bottom: 6%; /* Posiziona sotto la typing bar */
    left: 50%;
    transform: translateX(-50%);
    display: flex; /* Allinea le barre orizzontalmente */
    gap: 30vw; /* Spaziatura proporzionale tra le barre */
    justify-content: center; /* Centra le barre */
    width: auto; /* Adatta larghezza dinamicamente */
    overflow: visible;
    padding-top: 45px; /* Spazio per la percentuale sopra */
}

#correctBarContainer, #errorBarContainer {
    position: relative;
    width: 15vw; /* Larghezza proporzionale */
    height: 4vh; /* Altezza proporzionale */
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.3) 100%);
    border: 3px solid rgba(200, 220, 255, 0.6);
    border-radius: 20px;
    overflow: visible;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.5),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
}

/* Tappo sinistro della provetta */
#correctBarContainer::before, #errorBarContainer::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: calc(100% + 8px);
    background: linear-gradient(135deg, #c0c0c0, #808080);
    border: 2px solid #666;
    border-radius: 8px 4px 4px 8px;
    box-shadow: 
        0 0 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 3px rgba(255, 255, 255, 0.6);
    z-index: 15;
}

/* Tappo destro della provetta */
#correctBarContainer::after, #errorBarContainer::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: calc(100% + 8px);
    background: linear-gradient(135deg, #c0c0c0, #808080);
    border: 2px solid #666;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 
        0 0 10px rgba(0, 0, 0, 0.5),
        inset 0 1px 3px rgba(255, 255, 255, 0.6);
    z-index: 15;
}

#correctBar, #errorBar {
    position: relative;
    height: 100%;
    width: 0%; /* Inizia vuoto */
    transition: width 0.3s ease; /* Animazione fluida */
    border-radius: 10px;
    overflow: hidden;
}

#correctBar {
    background: linear-gradient(90deg, #0a5c0a, #00ff00, #0a5c0a);
    background-size: 200% 100%;
    animation: liquidFlow 3s ease-in-out infinite;
}

#errorBar {
    background: linear-gradient(90deg, #8b0000, #ff4444, #8b0000);
    background-size: 200% 100%;
    animation: liquidFlow 3s ease-in-out infinite;
}

.liquid-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.3) 75%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: wave 2s linear infinite;
    pointer-events: none;
}

@keyframes liquidFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes wave {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

.progress-percent {
    position: absolute;
    top: -35px;
    left: 0%;
    transform: translateX(-50%);
    font-family: 'MedievalSharp', sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 10px rgba(0, 0, 0, 0.9);
    transition: left 0.3s ease;
    pointer-events: none;
    z-index: 50;
    min-width: 45px;
    text-align: center;
}

.magic-wand {
    position: absolute;
    top: -25px;
    left: 0%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% + 25px);
    background: rgba(255, 255, 255, 0.9);
    transition: left 0.3s ease;
    pointer-events: none;
    z-index: 15;
}

.canvas-errore {

    animation: vibrazione 0.1s linear;

    border: 3px solid red;

}



@keyframes vibrazione {

    0% { transform: translateX(-2px); }

    50% { transform: translateX(2px); }

    100% { transform: translateX(-2px); }

}



#gameContainer {
    /* Container per il canvas del gioco */
}

#gameOverScreen {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90vw, 500px);
    max-height: min(85vh, 700px);
    background: linear-gradient(135deg, 
        rgba(139, 69, 19, 0.98), 
        rgba(160, 82, 45, 0.98),
        rgba(101, 67, 33, 0.98),
        rgba(139, 69, 19, 0.98)
    );
    backdrop-filter: blur(3px);
    border: 2px solid #FFD700;
    border-radius: 15px;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 15px rgba(255, 215, 0, 0.1);
    color: white;
    padding: 20px;
    text-align: center;
    font-family: 'Cinzel', 'serif', sans-serif;
    z-index: 10000;
    overflow-y: auto;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Forza l'isolamento dal resto del layout */
    isolation: isolate;
    /* Animazione personalizzata che non interferisce con transform */
    animation: gameOverFadeIn 0.5s ease-in-out forwards;
}

@keyframes gameOverFadeIn {
    0% {
        opacity: 0;
        scale: 0.9;
    }
    100% {
        opacity: 1;
        scale: 1;
    }
}



#gameOverScreen h1 {
    margin-bottom: 15px;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: #FFD700;
    text-shadow: 
        0 0 15px #FFD700,
        0 0 30px rgba(255, 215, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.7);
    font-family: 'Cinzel', 'serif', sans-serif;
    letter-spacing: 1px;
}



#gameOverScreen p {
    font-size: clamp(1rem, 3vw, 1.3em);
    color: #98FB98;
    margin: 10px 0;
    text-shadow: 0 0 8px rgba(152, 251, 152, 0.8);
    font-weight: bold;
}

#gameOverScreen input {
    padding: 12px;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    border: 2px solid #8B4513;
    border-radius: 8px;
    margin: 10px 5px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    width: min(250px, 70vw);
    max-width: 100%;
    box-sizing: border-box;
}

#gameOverScreen input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: scale(1.02);
}

#gameOverScreen button {
    padding: 12px 20px;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: 2px solid #8B4513;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    color: #333;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    margin: 8px 5px;
    width: min(180px, 60vw);
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}



#gameOverScreen button:hover {
    background: linear-gradient(45deg, #FFA500, #FF8C00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.5);
}



.fade-in {

    animation: fadeIn 0.5s ease-in-out forwards;

}



@keyframes fadeIn {

    0% {

        opacity: 0;

    }

    100% {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#restartButton {

    margin-top: 20px;

    padding: 10px 20px;

    font-size: 24px;

    background-color: #45a049;

    color: white;

    border: none;

    border-radius: 5px;

    cursor: pointer;

    transition: background-color 0.3s;

    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);

}


.sfondo-libreria {
    background-image: none;
    background-size: cover;
    background-position: center;
}

.sfondo-pozioni {
    background-image: url('assets/images/pozioni.jpg');
    background-size: cover;
    background-position: center;
}





#restartButton:hover {

    background-color: #45a049;

}


.tremolio-continuo {
    animation: tremolioContinuo 0.1s infinite;
}

@keyframes tremolioContinuo {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, -1px); }
    50% { transform: translate(1px, 1px); }
    75% { transform: translate(-1px, 1px); }
    100% { transform: translate(1px, -1px); }
}



@keyframes tremolio {

    0% { transform: translate(0px, 0px); }

    25% { transform: translate(2px, -2px); }

    50% { transform: translate(-2px, 2px); }

    75% { transform: translate(2px, 2px); }

    100% { transform: translate(-2px, -2px); }

}



.tremolio-sfondo {

    animation: tremolio 0.1s infinite;

}



.parola-pergamena {

    background-color: #f4ecd8;

    border: 2px solid #8B4513;

    border-radius: 15px;

    padding: 5px 10px;

    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);

    display: inline-block;

    font-family: 'MedievalSharp', sans-serif;

    color: inherit;

    text-align: center;

}



@keyframes allarme {

    0% { background-color: black; }

    50% { background-color: red; }

    100% { background-color: black; }

}



.effetto-allarme {
    animation: allarme 0.5s infinite;
}

#saveScoreButton, #restartButton {

    margin: 15px auto;  /* Spazio sopra e sotto il pulsante e centratura automatica */

    padding: 10px 30px;  /* Dimensione del pulsante */

    font-size: 16px;

    cursor: pointer;

    background-color: #f0f0f0;

    border: 1px solid #ccc;

    border-radius: 5px;

    width: 200px;  /* Larghezza uniforme del pulsante */

    display: block;  /* Assicura che il pulsante occupi una riga completa per la centratura */

}



#congratulazioni {

    color: green;

    font-size: 18px;

    font-weight: bold;

    margin-top: 10px;

}





#nomeGiocatore {

    margin: 15px auto;  /* Spazio sopra e sotto l'input e centratura automatica */

    padding: 8px;

    font-size: 16px;

    text-align: center;  /* Testo centrato all'interno del campo */

    width: 80%;  /* Larghezza del campo di input */

    max-width: 300px;  /* Larghezza massima per non occupare troppo spazio */

    border: 1px solid #ccc;

    border-radius: 5px;

    display: block;  /* Imposta il campo come elemento a blocco per la centratura */

}





/* Classifica integrata nel game over (non più overlay) */
#classifica {
    display: block;
    margin: 15px 0;
    padding: 15px;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #FFD700;
    border-radius: 10px;
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.4),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
    font-family: 'Cinzel', 'serif', sans-serif;
    box-sizing: border-box;
}

#classifica h2 {
    font-size: clamp(1.2rem, 4vw, 1.8em);
    color: #FFD700;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #FFD700;
}

.classifica-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.classifica-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: clamp(0.8rem, 2vw, 1em);
    transition: all 0.3s;
}

.classifica-item:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.01);
}

/* Classifica nel menu principale */
.classifica-preview-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 15px;
}

.classifica-menu-preview {
    background: rgba(139, 69, 19, 0.8);
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.4),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(5px);
}

.loading-classifica {
    text-align: center;
    padding: 20px;
    font-size: 1.1em;
    color: #FFD700;
}

/* Adatta gli stili della classifica per il menu */
.classifica-menu-preview h2 {
    color: #FFD700;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.6em;
    text-shadow: 0 0 15px #FFD700;
}

.classifica-menu-preview .classifica-lista {
    max-height: 300px;
    overflow-y: auto;
}

.classifica-menu-preview .classifica-item {
    background: rgba(25, 25, 112, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.3);
    margin: 6px 0;
    padding: 10px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}







#nomeGiocatore, #saveScoreButton {

    display: none;

}





#victory {

    position: absolute;

    top: 60%;

    left: 50%;

    transform: translate(-50%, -50%);

    width: 350px;

    height: auto;

    z-index: 10;

}



#saveScoreButton, #restartButton {

    font-family: Arial, sans-serif; /* Usa lo stesso font dell'input */

    font-size: 16px; /* Dimensione del testo normale */

    padding: 10px 20px; /* Stesso padding */

    border: 1px solid #ccc; /* Bordo semplice */

    background-color: white; /* Sfondo bianco */

    color: black; /* Testo nero */

    cursor: pointer;

}



#saveScoreButton:hover, #restartButton:hover {

    background-color: #f0f0f0; /* Colore di sfondo leggermente diverso al passaggio del mouse */

}





/* Aggiungi una classe generale per le scritte magiche */

.magical-text {

    display: inline-block;

    transition: transform 0.3s ease, color 0.3s ease; /* Transizione per il movimento e il colore */

    cursor: pointer; /* Aggiunge il puntatore per il passaggio del mouse */

}



/* Effetto di spostamento magico al passaggio del mouse */

.magical-text:hover {

    transform: translateY(-5px) rotate(2deg); /* Leggera rotazione e movimento verso l'alto */

    color: #FFD700; /* Cambia il colore durante il passaggio (giallo dorato) */

    text-shadow: 0 0 10px rgba(255, 223, 0, 0.7); /* Effetto di bagliore magico */

}



/* Variante per farlo oscillare leggermente */

.magical-text:hover {

    animation: swing 0.5s ease-in-out;

}



@keyframes swing {

    0% { transform: rotate(0deg); }

    25% { transform: rotate(5deg); }

    50% { transform: rotate(-5deg); }

    100% { transform: rotate(0deg); }

}

/* Aggiungi questa classe al tuo CSS */
.fade-out {
    transition: opacity 0.3s ease; /* Velocità di dissolvenza */
    opacity: 0.3; /* Nasconde l'elemento gradualmente */
}

.effetto-magico {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* Mettendolo sotto il gioco */
}

@keyframes apparizione-bagliore {
    0% {
        opacity: 0;
        transform: scale(0.5);
        filter: blur(8px);
    }
    50% {
        opacity: 1;
        transform: scale(1);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
        filter: blur(10px);
    }
}

.bagliore {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 80%);
    border-radius: 50%;
    animation: apparizione-bagliore 3s infinite ease-in-out;
}





.parola-normale {

    background-color: #a67c52; /* Colore dello sfondo */

    border: 2px solid #ffffff; /* Cornice marrone scuro */

    border-radius: 15px; /* Angoli arrotondati */

    padding: 5px 10px; /* Spaziatura interna */

    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Ombra intorno alla parola */

    display: inline-block;

    font-family: 'MedievalSharp', sans-serif; /* Stile del font */

    color: inherit; /* Mantiene il colore corrente */

    text-align: center; /* Allineamento del testo */

}



.parola-fuoco {
    background-color: #ff0000; /* Colore rosso per le parole fuoco */
    border: 3px solid #ff7b00; /* Bordo arancione */
    border-radius: 15px; /* Angoli arrotondati */
    padding: 5px 10px; /* Spaziatura interna */
    box-shadow: 0 0 15px rgba(255, 123, 0, 0.8); /* Ombra arancione brillante */
    display: inline-block;
    font-family: 'MedievalSharp', sans-serif; /* Stile del font */
    color: white; /* Testo bianco per contrasto sul rosso */
    animation: fire-glow 1.5s ease-in-out infinite alternate; /* Animazione pulsante */
}

/* Animazione di pulsazione per le parole fuoco */
@keyframes fire-glow {
    0% {
        box-shadow: 0 0 15px rgba(255, 123, 0, 0.8), inset 0 0 10px rgba(255, 0, 0, 0.3);
        border-color: #ff7b00;
    }
    100% {
        box-shadow: 0 0 25px rgba(255, 123, 0, 1), inset 0 0 15px rgba(255, 0, 0, 0.5);
        border-color: #ffaa00;
    }

    text-align: center; /* Allineamento del testo */

}



.parola-ghiaccio {

    background-color: #00eeff; /* Colore dello sfondo */

    border: 2px solid #ffffff; /* Cornice marrone scuro */

    border-radius: 15px; /* Angoli arrotondati */

    padding: 5px 10px; /* Spaziatura interna */

    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Ombra intorno alla parola */

    display: inline-block;

    font-family: 'MedievalSharp', sans-serif; /* Stile del font */

    color: inherit; /* Mantiene il colore corrente */

    text-align: center; /* Allineamento del testo */

}

.parola-aria {

    background-color: #ff7b00; /* Colore dello sfondo */

    border: 2px solid #ffffff; /* Cornice marrone scuro */

    border-radius: 15px; /* Angoli arrotondati */

    padding: 5px 10px; /* Spaziatura interna */

    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Ombra intorno alla parola */

    display: inline-block;

    font-family: 'MedievalSharp', sans-serif; /* Stile del font */

    color: inherit; /* Mantiene il colore corrente */

    text-align: center; /* Allineamento del testo */

}



.parola-lento {

    background-color: #a52a2a; /* Colore dello sfondo */

    border: 2px solid #ffffff; /* Cornice marrone scuro */

    border-radius: 15px; /* Angoli arrotondati */

    padding: 5px 10px; /* Spaziatura interna */

    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Ombra intorno alla parola */

    display: inline-block;

    font-family: 'MedievalSharp', sans-serif; /* Stile del font */

    color: inherit; /* Mantiene il colore corrente */

    text-align: center; /* Allineamento del testo */

}



.parola-trappola {

    background-color: #777777; /* Colore dello sfondo */

    border: 2px solid #ffffff; /* Cornice marrone scuro */

    border-radius: 15px; /* Angoli arrotondati */

    padding: 5px 10px; /* Spaziatura interna */

    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Ombra intorno alla parola */

    display: inline-block;

    font-family: 'MedievalSharp', sans-serif; /* Stile del font */

    color: inherit; /* Mantiene il colore corrente */

    text-align: center; /* Allineamento del testo */

}

/* Effetto magico per il personaggio */
.char-magico {
    position: relative;
    display: inline-block;
    animation: glow 1.5s infinite alternate; /* Bagliore pulsante */
}

/* Bagliore */
@keyframes glow {
    0% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
                    0 0 20px rgba(0, 255, 255, 0.6),
                    0 0 30px rgba(0, 128, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 1),
                    0 0 30px rgba(0, 255, 255, 0.8),
                    0 0 40px rgba(0, 128, 255, 0.6);
    }
}

/* Particelle intorno al personaggio */
.char-magico::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 80%);
    border-radius: 50%;
    animation: sparkle 3s infinite;
    pointer-events: none;
}

/* Animazione delle particelle */
@keyframes sparkle {
    0%, 100% {
        transform: scale(1) translate(-5px, -5px);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) translate(5px, 5px);
        opacity: 0.6;
    }
}

/* ========================================
   MENU PROFESSIONALE - Navigazione e Stile
   ======================================== */

/* Menu di navigazione */
.main-nav {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
}

.nav-btn {
    padding: 12px 25px;
    font-size: 1rem;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.8), rgba(75, 0, 0, 0.8));
    color: #FFD700;
    border: 2px solid #FFD700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.nav-btn:hover::before {
    width: 300px;
    height: 300px;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    border-color: #FFF;
}

.nav-btn.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B0000;
    border-color: #FFF;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}

.nav-btn span {
    position: relative;
    z-index: 1;
}

/* Sezioni del menu */
.menu-section {
    display: none;
    width: 90%;
    max-width: 1000px;
    margin: 60px auto 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 15px;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 100;
    position: relative;
}

/* Ottimizzazione speciale per la sezione Home */
#homeSection {
    margin: 40px auto 15px;
    padding: 20px;
    max-height: 80vh;
}

.menu-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Logo principale */
.main-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: block;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Descrizione text */
.description-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 15px auto;
    max-width: 700px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Effetto hover per le singole parole */
.word-hover {
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    position: relative;
    padding: 2px 1px;
}

.word-hover:hover {
    transform: scale(1.15) translateY(-3px);
    color: #FFD700;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.8),
        0 0 25px rgba(255, 215, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    filter: brightness(1.3);
}

.word-hover:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    animation: underlineExpand 0.3s ease-out forwards;
    transform: translateX(-50%);
}

@keyframes underlineExpand {
    from { width: 0; }
    to { width: 100%; }
}

/* Titoli principali nelle sezioni menu */
.menu-section h1 {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
    margin-bottom: 10px;
    margin-top: 5px;
}

/* Container pulsanti */
.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

/* Sezione principale con pulsante start e tutorial */
.main-game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Sezione separata per Discord */
.discord-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
}

.discord-section::before {
    content: "💬 Community";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #FFD700;
    font-size: 0.8rem;
    padding: 0 10px;
    border-radius: 10px;
}

.main-button, .secondary-button {
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.main-button {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B0000;
    border: 3px solid #FFF;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    font-weight: bold;
}

.main-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.6);
}

.secondary-button {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.9), rgba(75, 0, 0, 0.9));
    color: #FFD700;
    border: 2px solid #FFD700;
}

.secondary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
    border-color: #FFF;
}

.button-icon {
    font-size: 1.5rem;
}

/* Skip Tutorial Checkbox */
.skip-tutorial-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.skip-tutorial-container:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.skip-tutorial-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #FFD700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.skip-tutorial-label:hover {
    color: #FFF;
    text-shadow: 0 0 10px #FFD700;
}

.skip-tutorial-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    height: 20px;
    width: 20px;
    background: rgba(139, 0, 0, 0.8);
    border: 2px solid #FFD700;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.skip-tutorial-label:hover .checkmark {
    border-color: #FFF;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.skip-tutorial-checkbox:checked ~ .checkmark {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-color: #FFF;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.skip-tutorial-checkbox:checked ~ .checkmark:after {
    display: block;
}

.skip-tutorial-label .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #8B0000;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Grid Info */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 20px 0;
}

.info-card {
    background: rgba(139, 0, 0, 0.3);
    padding: 18px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.info-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.info-card p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Grid Parole Speciali */
.special-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.word-card {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.word-card:hover {
    transform: scale(1.05);
    border-color: #FFD700;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.2);
}

.word-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px currentColor);
}

.word-card h4 {
    font-size: 1.2rem;
    margin: 10px 0;
}

.word-card p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Credits */
.credits-content {
    max-width: 900px;
    margin: 0 auto;
}

.credit-card {
    background: rgba(139, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    margin-bottom: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.credit-card:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.credit-card.special-thanks {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.4), rgba(75, 0, 130, 0.4));
    border-color: #FF69B4;
}

.credit-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 15px currentColor);
}

.developer-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    filter: brightness(1.1) contrast(1.1);
    transition: all 0.3s ease;
}

.developer-image:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    filter: brightness(1.2) contrast(1.2);
}

.credit-card h3 {
    font-size: 1.3rem;
    margin: 8px 0;
}

.credit-card p {
    font-size: 1rem;
    margin: 5px 0;
}

.large-text {
    font-size: 1.5rem !important;
    font-weight: bold;
    color: #FFD700 !important;
}

.version-info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

.version-info p {
    font-size: 1.1rem;
    margin: 8px 0;
    color: #FFD700;
}

/* Scrollbar personalizzata */
.menu-section::-webkit-scrollbar {
    width: 12px;
}

.menu-section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

.menu-section::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFD700, #FFA500);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.5);
}

.menu-section::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FFF, #FFD700);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        gap: 10px;
    }

    .button-container {
        flex-direction: column;
        gap: 15px;
    }

    .skip-tutorial-container {
        margin: 8px 0;
    }

    .skip-tutorial-label {
        font-size: 1rem;
    }

    .main-button, .secondary-button {
        font-size: 1rem;
        padding: 10px 20px;
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* ======= PAROLE CHE CADONO COME NEL GIOCO ======= */

.falling-words-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.falling-word {
    position: absolute;
    font-family: 'MedievalSharp', serif;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid;
    display: inline-block;
    animation: fallAndRotate 15s infinite linear;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    top: -100px;
    transform: translateY(-50px);
}

/* Parole normali */
.normal-word {
    background: linear-gradient(135deg, #8B6F47, #A0805A);
    color: #FFFFFF;
    border-color: #D4AF37;
    box-shadow: 
        0 0 10px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.3);
}

/* Parola Bomba */
.bomb-word {
    background: linear-gradient(135deg, #8B0000, #FF0000);
    color: #FFFFFF;
    border-color: #FF4444;
    animation: fallAndRotate 12s infinite linear, bombPulse 1s infinite ease-in-out;
    box-shadow: 
        0 0 15px rgba(255, 0, 0, 0.6),
        0 0 25px rgba(139, 0, 0, 0.4);
}

/* Parola Fuoco */
.fire-word {
    background: linear-gradient(135deg, #FF4500, #FF8C00);
    color: #FFFFFF;
    border-color: #FFD700;
    animation: fallAndRotate 13s infinite linear, fireFlicker 0.5s infinite ease-in-out;
    box-shadow: 
        0 0 15px rgba(255, 69, 0, 0.7),
        0 0 25px rgba(255, 140, 0, 0.5);
}

/* Parola Aria */
.air-word {
    background: linear-gradient(135deg, #FF7B00, #FFA500);
    color: #FFFFFF;
    border-color: #FFFFFF;
    animation: fallAndRotate 11s infinite linear, airSwirl 1s infinite ease-in-out;
    box-shadow: 
        0 0 15px rgba(255, 123, 0, 0.7),
        0 0 25px rgba(255, 165, 0, 0.5);
}

/* Parola Ghiaccio */
.ice-word {
    background: linear-gradient(135deg, #00CED1, #87CEEB);
    color: #000080;
    border-color: #FFFFFF;
    animation: fallAndRotate 16s infinite linear, iceShimmer 2s infinite ease-in-out;
    box-shadow: 
        0 0 15px rgba(0, 206, 209, 0.6),
        0 0 25px rgba(135, 206, 235, 0.4);
}

/* Parola Lento */
.slow-word {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: #FFFFFF;
    border-color: #D2B48C;
    animation: fallAndRotate 20s infinite linear, slowPulse 3s infinite ease-in-out;
    box-shadow: 
        0 0 15px rgba(139, 69, 19, 0.6),
        0 0 25px rgba(160, 82, 45, 0.4);
}

/* Parola Trappola */
.trap-word {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    color: #FFFFFF;
    border-color: #FFFFFF;
    animation: fallAndRotate 14s infinite linear, trapFlash 2s infinite ease-in-out;
    box-shadow: 
        0 0 15px rgba(220, 20, 60, 0.7),
        0 0 25px rgba(139, 0, 0, 0.5);
}

/* Animazioni di caduta */
@keyframes fallAndRotate {
    0% {
        transform: translateY(-150px) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 150px)) rotate(360deg);
        opacity: 0;
    }
}

/* Animazioni specifiche per ogni tipo */
@keyframes bombPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes fireFlicker {
    0%, 100% { 
        box-shadow: 
            0 0 15px rgba(255, 69, 0, 0.7),
            0 0 25px rgba(255, 140, 0, 0.5);
    }
    50% { 
        box-shadow: 
            0 0 25px rgba(255, 69, 0, 1),
            0 0 35px rgba(255, 140, 0, 0.8);
    }
}

@keyframes lightningFlash {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.3; }
}

@keyframes iceShimmer {
    0%, 100% { 
        border-color: #FFFFFF;
        box-shadow: 
            0 0 15px rgba(0, 206, 209, 0.6),
            0 0 25px rgba(135, 206, 235, 0.4);
    }
    50% { 
        border-color: #87CEEB;
        box-shadow: 
            0 0 25px rgba(0, 206, 209, 0.9),
            0 0 35px rgba(135, 206, 235, 0.7);
    }
}

@keyframes airSwirl {
    0%, 100% { 
        transform: rotate(0deg);
        filter: blur(0px);
    }
    25% { 
        transform: rotate(90deg);
        filter: blur(1px);
    }
    50% { 
        transform: rotate(180deg);
        filter: blur(0px);
    }
    75% { 
        transform: rotate(270deg);
        filter: blur(1px);
    }
}

@keyframes slowPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(0.95);
        opacity: 1;
    }
}

@keyframes trapFlash {
    0%, 80%, 100% { 
        border-color: #FFFFFF;
        box-shadow: 
            0 0 15px rgba(220, 20, 60, 0.7),
            0 0 25px rgba(139, 0, 0, 0.5);
    }
    90% { 
        border-color: #FF0000;
        box-shadow: 
            0 0 25px rgba(255, 0, 0, 1),
            0 0 35px rgba(220, 20, 60, 0.8);
    }
}
        padding: 10px 15px;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .menu-section {
        margin: 100px auto 30px;
        padding: 20px;
        width: 95%;
    }
    
    .info-grid, .special-words-grid {
        grid-template-columns: 1fr;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .main-button, .secondary-button {
        width: 100%;
        justify-content: center;
    }
    
    .skip-tutorial-container {
        order: -1; /* Mette la checkbox sopra i pulsanti su mobile */
    }
    
    .skip-tutorial-label {
        font-size: 1rem;
    }
}

/* Stili per il selettore di lingua */
.language-selector {
    margin-left: auto;
}

.language-select {
    background: rgba(0, 0, 0, 0.9);
    color: #FFD700;
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 10px 15px;
    font-family: 'MedievalSharp', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 130px;
    position: relative;
    z-index: 9999;
}

.language-select:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    border-color: #FFF;
}

.language-select:focus {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    border-color: #FFF;
}

.language-select:focus:hover {
    background: rgba(0, 0, 0, 0.95);
}

.language-select option {
    background: #1a1a1a;
    color: #FFD700;
    border: none;
    padding: 8px;
    font-size: 14px;
}
