*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:monospace;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0a3c2f;
}
.starts-container{
    height: 70px;
    width: 160px;
    padding: 15px 30px;
    font-size: 1.5em;
    color: #fff;
    text-transform: uppercase;
    background: #209d7b;
    border-radius: 5px;
    position: absolute;
    box-shadow: 10px 10px 10px #0a3c2f;
    top: 1vh;
    z-index: 10;
    display: block;
    position: absolute;
}
#active,#counter{
    display: none;
}
.container{
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 20px 15px 0 15px;
    background: #0d614b;
    padding: 40px 60px;
    border-radius: 4px;
}
#result{
    line-break: auto;
    line-height: 2em;
    margin-bottom: 15px;
}
p,h2{
    font-size: 3em;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
#reset,#start{
    padding: 15px 20px;
    color: #267c65;
    background: #fff;
    border: none;
    font-size: 1.5em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: 600;
    border-radius: 4px;
}
#reset:focus{
    color: #fff;
    background: #267c65;
}
.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: #fff;
    transform: rotateY(180deg);
    transition: 0.25s;
    border-radius: 4px;
}
.item.boxOpen{
    transform: rotateY(0deg);
}
.item::after{
    content: '';
    position: absolute;
    inset: 0;
    background: #209d7b;
    transition: 0.3s;
    transform: rotateY(0deg);
    backface-visibility: hidden;
    border-radius: 4px;
}
.boxOpen:after,
.boxMatch:after{
    transform: rotateY(180deg);
}

.shake{
    animation: shake 0.3s ease-in-out;
}
@keyframes shake{
    0%, 100%{
        transform: translateX(0);
    }
    20%{
        transform: translateX(-13px);
    }
    40%{
        transform: translateX(13px);
    }
    60%{
        transform: translateX(-8px);
    }
    80%{
        transform: translateX(8px);
    }
}

@media screen and (max-width: 555px) {
    .item{
        width: 80px;
        height: 80px;
    }
    .container{
        padding: 40px 60px;
    }
    .game{
        width: 350px;
        height: 383px;
    }
    .starts-container{
        top: 10vh;
    }
}
@media screen and (max-width: 445px) {
    .item{
        width: 68px;
        height: 68px;
    }
    .game{
        width: 320px;
        height: 303px;
    }
    .container{
        padding-left: 66px;
    }
    p,h2{
        font-size: 1.5em;
    }
}
@media screen and (max-width: 388px) {
    .item{
        width: 60px;
        height: 60px;
    }
    .game{
        width: 280px;
        height: 280px;
    }
    .container{
        padding-left: 73px;
    }
    .starts-container{
        height: 80px;
        width: 180px;
        padding: 15px 25px;
    }
}