*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: monospace;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: rgb(69, 65, 100);
}
/* Memory game container */
.container{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 30px;
    background-color:rgb(177, 117, 201);
    padding: 40px 60px;
}
h2{
    font-size: 3em;
    color: aliceblue;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.reset{
    padding: 15px 20px;
    color: rgb(61, 125, 104);
    background-color: aliceblue;
    border: none;
    font-size: 1.5em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: 600;
}
.reset:focus{
    color:aliceblue;
    background-color:black;
}
.game{
    width: 430px;
    height: 430px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    transform-style: preserve-3d;
    perspective: 500px;
}
.item{
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    background-color: aliceblue;
    transform: rotateY(180deg);
    transition: 0.25s;
}
.item.boxOpen{
    transform: rotateY(0deg);
}
.item::after{
    content: '';
    position: absolute;
    inset: 0;
    background-color: blanchedalmond;
    transition: 0.25s;
    transform: rotateY(0deg);
    backface-visibility: hidden;
}
.boxOpen:after, .boxMatch:after{
    transform: rotateY(180deg);
}


.closeimg{
    width:40px;
    position:absolute;
    top:10%;
    left:90%;
    filter: invert(100%);
}

@media screen and (max-width: 500px){
    .container{
        width:370px;
        height:1200px;
    }
    .game{
        width:300px;
        margin-left:80px;
        margin-bottom:500px;
    }
    .closeimg{
        width:30px;
        left:85%;
    }
    h2{
        margin-left:50px;
    }
}
