* {
    font-family: 'Lexend', sans-serif;
}

.container {
    width: 900px;
    margin: auto;
    background-color: rgba(22, 104, 228, 0.925);
}

.text-center {
    text-align: center;
}

.icon-grid {
    /* flex! */ 
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.show {
/* visibilità e opacità */
    font-size: 80px;
    text-align: center;
    visibility: visible ;
    opacity: 100%!important;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#griglia>div {
    /*XXXXXX dimensioni e margini */
    background-color: #b80adbdc;
    border: 1px solid #3889c4;
    border-radius: 10px;
    margin: 20px 10px;
    width: 120px;
    height: 120px; 
}

.timer {
    padding: 10px 0;
}

.icon {
    font-size: 80px;
    text-align: center;
    visibility: visible !important;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.disabled {
    pointer-events: none;
    cursor: wait;
}

.show {
    /*XXXXXX agganciare animation-name rotazione carta */
    animation-name: rotazione-carta;
    animation-duration: .5s;
    background-color: white;
    border: 1px solid #3889c4;
    border-radius: 10px;
}

.find {
    /*XXXXX agganciare animation-name indovinato */
    animation-name: indovinato;
    animation-duration: .5s;
    background-color: rgba(247, 212, 16, 0.56);
    border: 1px solid #3889c4;
    border-radius: 10px;
}

.button {
    color: white;
    font-size: 22px;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background-color: #b80adbdc;
    border: 1px solid #3889c4;
    border-radius: 5px;
}

.button:hover {
    background-color: #16486c;
    border: none;
}

#modal {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.9);
    position: fixed;
    top: 0;
    left: 0;
    text-align: center;
    align-items: center;
}

#modal.active {
    display: flex;
}

#modal h2 {
    margin-top: 20px;
}

@media (max-width: 600px) {
    .container {
        width: 400px;
    }
    #griglia>div {
        margin: 5px 5px;
        width: 70px;
        height: 70px;
    }
    .icon {
        font-size: 60px;
    }
}

@media (max-width: 420px) {
    .container {
        width: 230px;
    }
    #griglia>div {
        margin: 5px 5px;
        width: 40px;
        height: 40px;
    }
    .icon {
        font-size: 20px;
    }
}

@keyframes indovinato { /* animazione quando si indovina */
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }

}

@keyframes rotazione-carta { /* animazione quando ruota la carta */
    from {
        transform: perspective(300px) rotate3d(0, 1, 0, 80deg);
        animation-timing-function: ease-in;
    }
    50% {
        transform: perspective(300px) rotate3d(0, 1, 0, -10deg);
        animation-timing-function: ease-in;
    }
    to {
        transform: perspective(300px);
        animation-timing-function: ease-in;
    }

}