:root {
    --bg: #0f2e40;
    --accent: #235e6e;
    --clr-chiaro: #84c1c6;
    --clr-medio: #235e6e;
    --clr-scuro: #0f2e40;
    --clr-scurissimo: rgb(10, 28, 39);

    --c1: #58b7b0;
    --c2: #e08e45;
    --c3: #d9534f;
    --c4: #f0c987;
    --c5: #7b9acc;
    --c6: #7cc47f;
}

/* base */
* {
    box-sizing: border-box
}

html,
body {
    /* height: 100% */
    touch-action: none;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    background: var(--bg);
    color: #eeeeee;
    -webkit-font-smoothing: antialiased;
    padding: 8px;
    display: flex;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* header */
.app__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

.app__title {
    font-size: 1.3rem;
    margin: 0
}

.back-button {
    color: var(--clr-chiaro);
    text-decoration: none;
}

.status {
    color: var(--clr-chiaro);
    font-size: 0.95rem
}

/* Stili bottoni */
.controls {
    display: flex;
    gap: 50px;
    align-items: center;
    padding: 6px;
    justify-content: center;
}

.submit-button {
    width: 110px;
    height: 35px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer
}

.restart-button {
    width: 110px;
    height: 35px;
    background: transparent;
    color: var(--clr-chiaro);
    border: 1px solid var(--clr-chiaro);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer
}

/* finestra modale per Ricomincia e Fine partita */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal__content {
    background: var(--accent);
    color: #eeeeee;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.modal__content h2 {
    margin-top: 0;
}

.modal__content button {
    margin: 0.5rem;
}

#modal-buttons button {
    margin: 0.5rem;
    min-width: 50px;
    background: #0f2e40;
    color: var(--clr-chiaro);
    border: 1px solid var(--clr-chiaro);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer
}

/* Stili per il contenitore del regolamento */
.regolamento-container {
    max-height: 100%;
    /* Altezza massima visibile */
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    padding: 0 30px;
    /* margin-bottom: 10px; */
}

/* Nasconde il regolamento */
.regolamento-container.hidden {
    max-height: 0;
    padding: 0 30px;
    margin: 0;
}

.regolamento-toggle {
    text-align: center;
    font-size: 0.9em;
    color: var(--clr-chiaro);
    cursor: pointer;
    /* margin-bottom: 10px; */
    user-select: none;
    /* Impedisce la selezione del testo */
}

.regolamento {
    text-align: justify;
}

.regolamento p,
li {
    font-size: 14px;
    margin: 0;
}

/* Effetti di bagliore per il saldo */
.win-glow {
    animation: glow-win 0.5s ease-in-out forwards;
}

.lose-glow {
    animation: glow-lose 0.5s ease-in-out forwards;
}

/* Animazione del bagliore verde per la vittoria */
@keyframes glow-win {
    0% {
        text-shadow: 0 0 5px rgba(0, 255, 0, 0);
        color: white;
    }

    50% {
        text-shadow: 0 0 15px #0f0, 0 0 20px #0f0;
        color: #00ff00;
    }

    100% {
        text-shadow: 0 0 5px rgba(0, 255, 0, 0);
        color: white;
    }
}

/* Animazione del bagliore rosso per la sconfitta */
@keyframes glow-lose {
    0% {
        text-shadow: 0 0 5px rgba(255, 0, 0, 0);
        color: white;
    }

    50% {
        text-shadow: 0 0 15px #f00, 0 0 20px #f00;
        color: #ff0000;
    }

    100% {
        text-shadow: 0 0 5px rgba(255, 0, 0, 0);
        color: white;
    }
}


/* -------------------------------------------------- */
/* Trova la talpa - Nuovi stili */
/* -------------------------------------------------- */
.talpa-rules {
    text-align: center;
    font-size: 0.9em;
    color: #ccc;
    line-height: 1.4;
}

.whac-a-mole-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}

.whac-a-mole-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

.whac-a-mole-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
    /* Rende la griglia quadrata */
    background-color: #825d40;
    padding: 15px;
    margin: 15px 0;
    border-radius: 10px;
}

.whac-a-mole-hole {
    width: 100%;
    aspect-ratio: 1;
    background-color: transparent;
    /* Rimuovi il colore di base */
    background-image: url('Immagini/prato.jpg');
    /* Assicurati che il nome del file sia corretto */
    background-size: cover;
    /* Adatta l'immagine a coprire l'intero elemento */
    background-position: center;
    border-radius: 50%;
    /* Mantieni la forma circolare del buco */
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    /* Aggiungi una transizione per l'effetto hover */
}

.whac-a-mole-hole:hover {
    background-color: #666;
}

.whac-a-mole-mole {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    /* Occupa l'intera larghezza del buco */
    height: 100%;
    border-radius: 50%;
    /* Mantieni la forma per nascondersi */
    background-image: url('Immagini/mole.png');
    /* Usa la tua immagine qui */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: bottom 0.2s ease-in-out;
}

.whac-a-mole-mole.up {
    bottom: 0;
}





/* piccole regole per schermi stretti */
@media (max-width:420px) {

    /* header */
    .app__header {
        padding: 0 10px 0 10px;
    }

    .app {
        gap: 5px
    }

    .regolamento-container {
        padding: 0 10px;
    }

    /* Nasconde il regolamento */
    .regolamento-container.hidden {
        padding: 0 10px;
    }
}