* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html {
    background: url(../captainamerica/bg1.svg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

body {
    height: 100vh;
    display: flex;
}

.memory-game {
    width: 56.25rem;
    height: 600px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    perspective: 1000px;
}

.memory-card {
    width: calc(100%/6 - 10px);
    height: calc(33.333% - 10px);
    margin: 5px;
    position: relative;
    transform: scale(1);
    transform-style: preserve-3d;
    transition: transform .5s;
    box-shadow: 1px 1px 1px rgba(0, 0, 0, .3);
    border-radius: 5px;
    visibility: initial;
}

.memory-card:active {
    transform: scale(0.97);
    transition: transform .2s;
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.memory-card.flipDelay {
    transition-delay: 0.3s;
    transform: rotateY(180deg);
    visibility: hidden;
}

.front-face, .back-face {
    width: 100%;
    height: 100%;
    padding: 20px 10px;
    position: absolute;
    border-radius: 5px;
    background: #dbeeff;
    backface-visibility: hidden;
}

.front-face {
    transform: rotateY(180deg);
}

/*                Modal              */

.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 1rem 1.5rem;
    width: 24rem;
    border-radius: 0.5rem;
}

.close-button {
    float: right;
    width: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    cursor: pointer;
    border-radius: 0.25rem;
    background-color: lightgray;
}

.close-button:hover {
    background-color: darkgray;
}

.show-modal {
    opacity: 1;
    visibility: visible;
    transform: scale(1.0);
    transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
}

@media screen and (max-width: 600px) {
    .memory-game {
        width: 58rem;
        height: 58rem;
        margin: auto;
        display: flex;
        flex-wrap: wrap;
        perspective: 1000px;
    }
}

.logo {
    width: 15rem;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: -9999;
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 1px 5px 15px -2px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 18%;
}

/* for con */

h1 {
    position: absolute;
    margin-top: 30vh;
    width: 99%;
    text-align: center;
    font-size: 666%;
    z-index: -3;
    color: #2f696a;
    font-family: sans-serif;
    text-shadow: 0 0 3px #e29f9e, 0 0 5px #2f696a;
    opacity: 0.8;
    display: none;
}

canvas {
    overflow-y: hidden;
    overflow-x: hidden;
    width: 98.8%;
    margin: 0;
    z-index: -3;
    position: absolute;
}

.match {
    visibility: hidden;
}

.win {
    width: 100px;
    height: 100px;
    animation: crescendo 1.5s alternate infinite ease-in;
}

@keyframes crescendo {
    0% {
        transform: scale(.8);
    }
    100% {
        transform: scale(1.5);
    }
}