/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0,0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.0,0); /* Black w/ opacity */
}

/* Modal Content */
.modal-content {
    background-color: none;
    margin: auto;
    padding: 10px;
    border: none;
    width: 80%;
}

/* The Close Button */
.close {
    color: #000000;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000000;
    text-decoration: none;
    cursor: pointer;
}



.secgame{

    padding: 0;

    margin: 0;

    box-sizing: border-box;

}



.boxgame {

    height: 120vh;

    display: flex;

    background: #D69578;

    background-size: cover;

}



.memorygame {

    width: 500px;

    height: 500px;

    margin: auto;

    display: flex;

    justify-content: center;

    align-items: center;

    flex-wrap: wrap;

    perspective: 1000px;

}



.memorycard {

    width: calc(25% - 10px);

    height: calc(33.333% - 10px);

    margin: 5px;

    position: relative;

    box-shadow: 1px 1px 1px rgba(0,0,0,.3);

    transition: all .5s;

    transform-style: preserve-3d;

    transform: scale(1);

}



.memorycard.flip {

    transform: rotateY(180deg);

}



.memorycard:active {

    transform: scale(0.97);

    transition: transform .2s;

}



.frontface,

.backface {

    width: 100%;

    height: 100%;

    padding: 20px;

    position: absolute;

    backface-visibility: hidden;

    border-radius: 5px;

    background: white;

}



.frontface {

    transform: rotateY(180deg);

}





@media screen and (max-width: 750px) and (max-height: 500px) {

    .memorygame {

        width: 50%;

        height: 70%;

    }



    .memorycard {

        width: calc(25% - 8px);

        height: calc(33.333% - 8px);

        margin: 4px;

    }



    .frontface,

    .backface {

        padding: 10px;

    }
}