html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: #ffffff url('../img/geometry2.png'); /* Background pattern from Subtle Patterns */
    font-family: 'Coda', cursive;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.title {
    font-family: 'Pacifico', cursive;
}


/*
 * Styles for the deck of cards
 */

.deck {
    width: 660px;
    min-height: 680px;
    background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
    padding: 32px;
    border-radius: 10px;
    box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 3em;
}

.deck .card {
    height: 125px;
    width: 125px;
    background: #2e3d49;
    font-size: 0;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
}

.deck .card.open {
    /* transform: rotateY(0); */
    background: #02b3e4;
    cursor: default;
    animation-name: cardsFlip;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    animation-duration: 0.75s;
}

.deck .card.show {
    font-size: 33px;
}


.deck .card.match {
    cursor: default;
    background: #965fca;
    font-size: 33px;
    animation-name: cardsMatch;
    animation-duration: 0.75s;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
}


.deck .card.unmatch{
    animation-name: cardsUnmatch;
    animation-duration: 0.75s;
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    background: #d35977;
}


.deck .card.disable{
    pointer-events: none;
    opacity: 0.9;
}



/*
 * Styles for the Score Panel
 */

.score-panel {
    text-align: left;
    width: 50%;
    margin-bottom: 10px;
    cursor: pointer;
}

.score-panel .stars {
    margin: 0;
    padding: 0;
    display: inline-block;
    margin: 0 5px 0 0;
}

.score-panel .stars li {
    list-style: none;
    display: inline-block;
}

.fa-star{
    color:#8f031a;
}

.restart{
    font-size: 20px;
    float: right;
    cursor: pointer;
}

.timer{
    display: inline-block;
    margin: 0 1rem;
}


/*
 * Styles for the Congratulations popup
 */

.overlay{
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left:0;
    background: rgba(0,0,0,0.7);
    transition: opacity 500ms;
    visibility: hidden;
    opacity: 0;
}

.overlay:target{
    visibility: visible;
    opacity: 1;
}

.popup{
    margin: 70px auto;
    padding: 20px;
    background: #ecf0c9;
    border-radius: 15px;
    width: 40%;
    position: relative;
    transition: all 5s ease-in-out;
    font-family: 'Courgette', cursive;
}

.popup .close {
    position: absolute;
    top: 20px;
    right: 30px;
    transition: all 200ms;
    font-size: 35px;
    font-weight: bolder;
    text-decoration: none;
    color: #333;
}

.popup .close:hover {
    color: rgb(12, 14, 1);
}

.popup .content-1,
.content-2 {
    max-height: 30%;
    overflow: auto;
    text-align: center;
    font-size: 50px;
    font-weight: bold;
}

.content-1{
    font-weight: bold;
}

#starRating li {
    display: inline-block;
}

.showModal {
    visibility: visible !important;
    opacity: 100 !important;
}

#play-again {
    background-color: #141214;
    padding: 0.7rem 1rem;
    font-size: 1.1rem;
    display: block;
    margin: 0 auto;
    width: 50%;
    font-family: 'Courgette', cursive;
    color: #cc3232;
    border-radius: 20px;
}

.button{
    border-radius: 9px;
    font-family: 'Courgette', cursive;
    background-color: #2bcbe0;
    cursor: pointer;
    font-size: 25px;
}

.button:hover{
    background-color: #1da3b4;
}


/*
* Animations for flip
*/
@keyframes cardsFlip {
    from{
        transform: perspective(400px) rotate3d(0, 1, 0, 145deg);
        animation-timing-function: ease-in;
        opacity: 0;
    }

    40% {
        transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
        animation-timing-function: ease-in;
    }

    60% {
        transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
        opacity: 1;
    }

    80% {
        transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
    }

    to{
        transform: perspective(400px);
    }
}


/*
* Animations for card match
*/
@keyframes cardsMatch{
    from {
        transform: scale3d(1, 1, 1);
    }

    30% {
        transform: scale3d(1.25, 0.75, 1);
    }

    40% {
        transform: scale3d(0.75, 1.25, 1);
    }

    50% {
        transform: scale3d(1.15, 0.85, 1);
    }

    65% {
        transform: scale3d(.95, 1.05, 1);
    }

    75% {
        transform: scale3d(1.05, .95, 1);
    }

    to {
        transform: scale3d(1, 1, 1);
    }
}



/*
* Animations for card unmatch
*/
@keyframes cardsUnmatch {
    from {
        transform: scale3d(1, 1, 1);
    }

    50% {
        transform: scale3d(1.2, 1.2, 1.2);
    }

    to {
        transform: scale3d(1, 1, 1);
    }
} 