body {
    background: #CFD0CF;
    color: #434344;
}
h1 {
    text-align: center;
    font: bold 42px/47px Arial, sans-serif;
    margin: 40px 0px;
}
#playground {
    width: 595px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(4, 130px);
    grid-template-rows: repeat(3, 130px);
    grid-column-gap: 25px;
    grid-row-gap: 25px;
}
#timer {
    margin: 30px 0;
    text-align: center;
    font: 32px/36px Arial, sans-serif;
}
.card {
    cursor: pointer;

    width: 130px;
    height: 130px;

    -webkit-perspective: 600px; 
    -moz-perspective: 600px; 
    perspective: 600px;

    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    transform-style: preserve-3d;
}
.side {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    border-radius: 9px;
    box-shadow: 1px 1px 5px rgba(0,0,0,0.5);

    -moz-backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;

    -webkit-transition: transform .3s linear;
    -moz-transition: transform .3s linear;
    transition: transform .3s linear;
}
.front {
    font-size: 75px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;

    -webkit-transform: rotateY(-180deg);
    -moz-transform: rotateY(-180deg);
    transform: rotateY(-180deg);
}
.back {
    background: linear-gradient(45deg, #22AB93, #19668D);
    border: 5px solid #fff;
}
.rotate > .front {
    -webkit-transform: none;
    -moz-transform: none;
    transform: none;
}
.rotate > .back {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    transform: rotateY(180deg);
}
.match > .front {
    background: #5AD66F;
}
.mismatch > .front {
    background: #F44336;
}
#message {
    background: rgba(0,0,0,0.5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.messageBox {
    background: #fff;
    padding: 48px 0 30px 0;
    text-align: center;
    width: 30%;
    min-width: 350px;
}
.messageText {
    font: bold 48px Arial, sans-serif;
    text-align: center;
    margin: 0 0 40px 0;
}
.messageText span {
    display: inline-block;
    position: relative;

    transform-origin: center bottom;
    animation: dance .4s ease-in-out infinite alternate;
}
.messageText span:nth-child(2) { animation-delay: .1s; }
.messageText span:nth-child(3) { animation-delay: .2s; }
.messageText span:nth-child(4) { animation-delay: .3s; }
@keyframes dance {
    0% {
        transform: scaleY(0.9);
    }
    100% {
        transform: scaleY(1.3) translateY(-7px);
    }
}
.messageButton {
    background: linear-gradient(-90deg, #22AB93, #19668D);
    color: #fff;
    height: 40px;
    font-size: 20px;
    padding-left: 30px;
    padding-right: 30px;
    border-radius: 9px;
    box-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    border: 0;
    outline: none;
    cursor: pointer;
}
.messageButton:active {
    box-shadow: 2px 1px 8px rgba(0,0,0,0.5) inset;
    outline: none;
    cursor: pointer;
}