@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
html, body {
    margin: 0;
    padding: 0;
    background: #424242;
    height: 100%;
    font-family: 'Open Sans', sans-serif;
}
body {
    padding-top: 80px;
}

.game-intro {
    background-image: url('../icons/intro-bg.png');
}
.game-intro p {
    color: #fff;
    margin: 24px 0;
    font-size: 18px;
    letter-spacing: .5px;
    font-weight: 600;
}
.game-intro h1 {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    color: #fff;
    font-size: 64px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-over,
.game-intro {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #000030;
    z-index: 99;

    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}
.game-over h1 {
    font-family: 'VT323', monospace;
    font-size: 188px;
    margin: 0;
    padding: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: #E53935;
    text-shadow: 3px 3px 0px #fff;
}
.game-over p {
    color: #fff;
    margin: 24px 0;
    font-size: 32px;
    display: flex;
    align-items: center;
    font-weight: 600;
}
.game-over p span {
    font-size: 40px;
    font-weight: 700;
    padding-left: 8px;
}

.btn-style {
    font-family: 'Open Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 13px 50px 13px;
    outline: 0;
    border: 4px solid #fff;
    cursor: pointer;
    position: relative;
    background-color: rgba(0, 0, 0, 0);
    margin-top: 24px;
}
.btn-style::after {
    content: "";
    background-color: #ffe54c;
    width: 100%;
    z-index: -1;
    position: absolute;
    height: 100%;
    top: 7px;
    left: 7px;
    transition: 0.2s;
}
.btn-style:hover::after {
    top: 0px;
    left: 0px;
}



.game-container {
    display: flex;
    flex-wrap: wrap;
    height: 100%;
    align-content: flex-start;
    justify-content: flex-start;
    padding: 8px;
}

.game-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    padding: 24px 16px;
}
.game-header p {
    flex: 2;
    margin: 0;
    font-size: 18px;
    color: #fff;
    display: flex;
    align-items: center;
}
.game-header p span.score-print {
    font-weight: 800;
    font-size: 24px;
    margin-left: 8px;
}
.game-header p span.emoji-cant,
.game-header p span.emoji-can {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 160px;
    font-size: 34px;
    line-height: 79px;
    transform: scale(0);
}
.game-header p span.emoji-cant.animate,
.game-header p span.emoji-can.animate {
    animation: emojianimate .8s linear forwards;
}

.card {
    width: 16.66666%;
    height: 25%;
    text-align: center;
    position: relative;
    cursor: pointer;
}
.card.active .insire-card,
.card.matched  .insire-card {
    transform: rotateY(180deg);
}
.insire-card {
    transform-style: preserve-3d;
    transition: 0.4s ease-in-out; 
    position: relative;
    height:calc(100% - 16px);
    padding: 8px;
    margin: 8px 8px 8px 8px;
}
.card .insire-card img {
    max-width: 100px;
    max-height: 100px;
}
.card .insire-card .back img {
    opacity: .2;
}
.card .insire-card .back:after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    left: 4px;
    /* border: solid 1px #757575; */

    border: 15px solid transparent;
    outline: 2px solid #cdcdcd;
    outline-offset: -10px;
    background: linear-gradient(#cdcdcd 0 0) top,
          linear-gradient(#cdcdcd 0 0) left, linear-gradient(#cdcdcd 0 0) bottom,
          linear-gradient(#cdcdcd 0 0) right;
    background-size: 200% 2px, 2px 200%;
    background-origin: padding-box;
    background-repeat: no-repeat;
}
.card .insire-card .front:after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    left: 4px;

    border: 15px solid transparent;
    outline: 2px solid #cdcdcd;
    outline-offset: -10px;
    background: linear-gradient(#cdcdcd 0 0) top,
          linear-gradient(#cdcdcd 0 0) left, linear-gradient(#cdcdcd 0 0) bottom,
          linear-gradient(#cdcdcd 0 0) right;
    background-size: 200% 2px, 2px 200%;
    background-origin: padding-box;
    background-repeat: no-repeat;
}
.card .insire-card .front,
.card .insire-card .back {
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #fff;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card .insire-card .front {
    transform: rotateY(-180deg);
}




.timer {
    background: #fff;
    height: 24px;
    flex: 2;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}
.timer:after {
    content: 'time left';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 17px;
    line-height: 25px;
    text-transform: uppercase;
}
.timer span {
    display: block;
    background: #c00;
    height: 100%;
    width: 0px;
}
.timer.start-time span {
    animation: timer 60s linear forwards;
}

@keyframes timer {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@keyframes emojianimate {
    0% {
        transform: scale(0);
    }
    25% {
        transform: scale(1.5);
    }
    50% {
        transform: scale(2);
    }
    75% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(0);
    }
}

@media (max-width: 800px) {
    .card {
      width: 25%;
      height: 16.666%;
    }
  }