@font-face {
    font-family: Baloo2;
    src: url(../../assets/css/Fonts/Baloo2-Regular.ttf) format('truetype')
}


@font-face {
    font-family: iransans;
    src: url('../../assets/css/Fonts/IRANSansWeb(FaNum).eot'),
        url('../../assets/css/Fonts/IRANSansWeb(FaNum).woff'),
        url('../../assets/css/Fonts/IRANSansWeb(FaNum).woff2'),
        url('../../assets/css/Fonts/IRANSansWeb(FaNum).ttf')
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background: #007bff;
    padding: 20px;
    font-family: "Baloo2", 'iransans', Sans-Serif;
}

#app {
    display: grid;
    grid-template-columns: repeat(auto-fit, 100px);
    grid-auto-rows: 100px;
    grid-gap: 15px;
    justify-content: center;
    perspective: 800px;
    max-width: 720px;
    margin: 0 auto;
}

i.fas {
    font-size: 40px;
    color: #333;
}

.victoryState {
    grid-column-start: 1;
    grid-column-end: -1;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.card {
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    box-shadow: 5px 5px 0 0 #333;
    cursor: pointer;
    animation: flipUp 0.5s forwards;
}

.card i {
    opacity: 1;
    transition: opacity 0.5s;
}

.card.down {
    animation: flipDown 0.5s forwards;
}

.card.down i {
    opacity: 0;
}

.card.matched {
    animation: matching 0.3s forwards;
}

@keyframes flipDown {
    0% {
        background: #fff;
        transform: rotateY(0deg);
        box-shadow: 5px 5px 0 0 #333;
    }

    100% {
        background: #40e682;
        transform: rotateY(180deg);
        box-shadow: -5px 5px 0 0 #333;
    }
}

@keyframes flipUp {
    0% {
        background: #40e682;
        transform: rotateY(180deg);
        box-shadow: -5px 5px 0 0 #333;
    }

    100% {
        background: #fff;
        transform: rotateY(0deg);
        box-shadow: 5px 5px 0 0 #333;
    }
}

@keyframes matching {
    0% {
        background: #fff;
    }

    100% {
        background: #ffe000;
    }
}

@media screen and (max-width: 425px) {
    #app {
        grid-template-columns: repeat(auto-fit, 75px);
        grid-auto-rows: 75px;
    }
}

@media screen and (max-width: 375px) {
    #app {
        grid-template-columns: repeat(auto-fit, 60px);
        grid-auto-rows: 60px;
    }
}

@media screen and (max-width: 320px) {
    #app {
        grid-template-columns: repeat(auto-fit, 55px);
        grid-auto-rows: 55px;
    }
}