/* Corpo e fundo */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #007bff; /* Blue background */
    user-select: none;
}

/* Container principal */
.container {
    border-radius: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: linear-gradient(
        325deg,
        #000080 0%, /* Dark blue */
        #0000ff 30%, /* Blue */
        #00ffff 70%, /* Light blue */
        #ffffff 100% /* White */
    );

    padding: 40px 60px;
}

/* Título */
h2 {
    font-size: 3em;
    color: #e7e5eb;
    text-shadow: 5px 3px 6px #007bff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Botão de reset */
.reset {
    border-radius: 3px;
    padding: 15px 20px;
    width: 100%;
    border: none;
    font-size: 1.5em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: 600;
    background-color: #6392f8;
    
    color: #0000ff;
}

.reset:hover{
    background: linear-gradient(
        325deg,
        #000080 0%, /* Dark blue */
        #0000ff 30%, /* Blue */
        #00ffff 70%, /* Light blue */
        #ffffff 100% /* White */
       
    );
    color: #ffffff;
    transform: rotate(2deg);
    transition: 0.3s ease;
    
}

/* Container do jogo */
.game {
    width: 350px;
    height: 330px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    transform-style: preserve-3d;
    perspective: 500px;
}

/* Itens do jogo */
.item {
    border-radius: 10px;
    cursor: grab;
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    font-size: 3.5em;
    transform: rotateY(180deg);
    transition: 0.25s;
}

.item:active {
    cursor: grabbing;
}

.item::after {
    border-radius: 10px;
    content: "";
    position: absolute;
    inset: 0;
    background-color: #000080; 
    transition: 0.25s;
    transform: rotateY(0deg);
    backface-visibility: hidden;
}

.item.boxOpen {
    transform: rotateY(0deg);
}

.boxOpen::after,
.boxMatch::after {
    transform: rotateY(180deg);
}





/* Ajustes para telas pequenas (até 312px) */

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


    .item {
        
        width: 50px;
        height: 57px;
        font-size: 40px;
    }

    .game {  
       
        width: 420px;
        height: 100px;
        gap: 2px;
    }

    .reset {
        width: 150px;
    }


}




@media screen and (max-width: 490px) {
   
    .container {
        height: 500px;
        width: 339px;
    }
    .game {  
      
        width: 312px;
        height: 312px;
        gap: 2px;
    }
    .item {
        width: 76px;
        height: 76px;
        font-size: 40px;
    }
    h2 {
        font-size: 1.5rem;
        letter-spacing: 0;
    }
}


