
* {

    box-sizing: border-box;
    user-select: none;

}

img {

    pointer-events: none;

}

body    {

    margin: 0;
    border: 0;
    background-color: rgb(18, 8, 8);
    color: white;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    align-content: center;

}

#practicas   {

    position: absolute;
    top: 10px;
    left: 10px;

    padding: 2px;

    background-color: rgb(255, 217, 0);
    color: black;

    border: 2px solid red;
    border-radius: 5px;

    text-decoration: none;
    font-style: normal;
    font-size: 150%;

}

#juego  {

    background-color: rgb(67, 0, 130);
    width: 98%;
    max-width: 600px;
    height: 95%;
    border-radius: 8px;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    align-content: center;

}

.botones    {

    background-color: rgb(35, 0, 68);
    width: 100%;
    height: 20%;
    border-radius: 8px;

    box-shadow: 8px 18px 28px black;

    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    align-content: center;

}

#comenzar, #size, #reiniciar   {

    width: 20%;
    height: 50%;

}

#comenzar, #reiniciar   {

    background-color: black;
    color: red;
    border: 2px solid blue;
    border-radius: 8px;
    font-size: 110%;

    text-align: center;

    cursor: pointer;

    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.2s ease-in-out

}

#comenzar:hover, #reiniciar:hover {

    background-color: rgb(58, 58, 58);
    color: rgb(255, 57, 57);
    transform: scale(1.1, 1.1);

}

#reiniciar  {

    display: none;

}


#size   {

    background-color: black;
    color: red;
    border: 2px solid blue;
    border-radius: 8px;

    text-align: center;

    cursor: pointer;
    outline: none;

}

#intentos, #tiempo   {

    width: 20%;
    text-align: right;

}

#zona-juego {

    width: 100%;
    height: 80%;

    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    align-content: center;

}

#tablero    {

    width: 100%;
    height: 100%;

    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    align-content: space-evenly;

    position: relative;

}

#victoria   {

    width: 100%;
    height: 80%;
    background-color: rgb(0, 0, 255);
    border-radius: 8px;
    position: absolute;

    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;

    font-size: 150%;
    text-align: left;
    padding: 15%;

    visibility: hidden;
    transform: scale(0);

    transition: transform 0.5s ease-in;

}

#victoria.victoria {

    visibility: visible;
    transform: scale(1);

}

.carta  {

    position: relative;

}

.frente {

    width: 100%;
    height: 100%;
    border-radius: 18px;    
    background-color: rgb(255, 179, 0);
    border: 4px solid rgb(204, 0, 0);

    cursor: pointer;

    transform: rotateX(360deg) rotateY(360deg);

}

.atras {

    width: 100%;
    height: 100%;
    border-radius: 18px;
    border: 4px solid black;
    background-color: rgb(211, 211, 193);

    transform: rotateX(180deg) rotateY(390deg);

}

.frente,
.atras {

    position: absolute;

    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    backface-visibility: hidden;

    display: flex;
    justify-content: center;
    align-items: center; 
    color: black;
    
}

.carta.girada .frente {

    transform: rotateX(180deg) rotateY(330deg);

}

.carta.girada .atras {

    transform: rotateX(0deg) rotateY(360deg);

}

.frente img {

    width: 80%;

}

.atras img {

    width: 90%;
    height: 90%;
    object-fit: contain;

}

#size  .deshabilitado  {

    background-color: gray;
    color: rgb(204, 0, 0);
    border-color: rgb(6, 0, 84);

}

@media screen and (max-width: 910px)    {

    #practicas   {

        position: inherit;
        margin-top: 8px;
    
    }

    #juego  {

        height: 85%;

    }

} 

@media screen and (max-width: 600px) {

    #juego  {

        width: 98%;
        min-width: 200px;

    }

    .botones    {

        font-size: 100%;
        flex-wrap: wrap;
        align-content: space-around;

    }

    #comenzar, #size, #intentos, #tiempo, #reiniciar   {

        min-width: 40%;
        text-align: center;
        font-size: 80%;

    }

}