* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.intro {
    width: 780px;
    margin: auto;
    padding: 10px;
    border: 1px solid black;
    display: flex;
    justify-content: space-between;
}


/* start the game */

.start {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgb(41, 38, 231, .4);
    z-index: 2;
}

.start button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    font-size: 20px;
    cursor: pointer;
    background-color: rgb(212, 51, 51);
    border: 1px solid black;
    color: #fff;
}

.container {
    display: flex;
    flex-wrap: wrap;
    width: 800px;
    margin: 20px auto;
}

.block {
    height: 140px;
    transition: transform .5s;
    transform-style: preserve-3d;
    cursor: pointer;
    position: relative;
    flex: 1 0 140px;
    margin: 10px;
}

.face {
    position: absolute;
    backface-visibility: hidden;
}

.front {
    height: 140px;
    width: 140px;
    background-color: rgb(66, 21, 102);
}

.front::before {
    position: absolute;
    content: '!';
    text-align: center;
    font-size: 100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: yellow;
}

.back {
    transform: rotateY(180deg);
}

.back img {
    width: 140px;
    height: 140px;
}

.is-flipped,
.keep {
    transform: rotateY(180deg);
    pointer-events: none;
}

.noClick {
    pointer-events: none;
}

#fail,
#success {
    display: none;
}


/* play again */

.win {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgb(41, 38, 231, .4);
    z-index: 3;
    top: 0;
    display: none;
}

.win div {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.win div span {
    font-size: 72px;
    font-weight: 400;
    padding: 10px;
}

.win div button {
    width: 100%;
    padding: 20px;
    font-size: 30px;
    border-radius: 10px;
    cursor: pointer;
    background-color: rgb(212, 51, 51);
    color: white;
}

.win div button:hover,
#start:hover {
    background-color: rgb(196, 39, 39);
}