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 {
    width: 100%;
    height: 100%;
    max-width: 670px; 
    margin: auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

h1 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
}

/*
 * Styles for the deck of cards  
 */

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

.card {
    height: 125px;
    width: 125px;
    margin: 5px;
    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;
}

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

.deck .card.match {
    cursor: default;
    background: #02ccba;
    font-size: 33px;
}

/*
 * Styles for the Score Panel
 */

 .score-panel {
    text-align: left;
    width: 100%;
    padding: 0 35px;
    margin-bottom: 10px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

.score {
    display: inherit;
    text-align: center;
}

.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;
    color: #FFE701;
}

.score-panel .restart {
    text-align: center;
    cursor: pointer;
}

.moves {
    display: inline-block;
}

.timer {
    text-align: center;
}


/*
 * Styles for the modal
 */

 .modal {
    display: none;
    position: fixed;
    z-index:1;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    width: 60%;
    margin: 20% auto;
    border-radius: 8px;
    background-color:#f4f4f4;
    -webkit-box-shadow: 0 5px 8px 0 rgba(0,0,0,0.2),0 7px 20px 0 rgba(0,0,0,0.17);
    box-shadow: 0 5px 8px 0 rgba(0,0,0,0.2),0 7px 20px 0 rgba(0,0,0,0.17);
    -webkit-animation-name: ModalOpen;
    -moz-animation-name: ModalOpen;
    -o-animation-name: ModalOpen;
    animation-name: ModalOpen;
    -webkit-animation-duration: 1s;
    -moz-animation-duration: 1s;
    -o-animation-duration: 1s;
    animation-duration: 1s;
}

.modal-header {
    background: -webkit-linear-gradient(290deg, #02ccba 0%, #1E90FF 100%);
    background: -o-linear-gradient(290deg, #02ccba 0%, #1E90FF 100%);
    background: linear-gradient(160deg, #02ccba 0%, #1E90FF 100%);
    padding:15px;
    color:#fff;
}

.modal-header h2 {
    text-align: center;
    margin:0;
}

.modal-close-btn {
    float: right;
    font-size: 1.5em;
    color:#fff;
}

.modal-close-btn:hover, .modal-close-btn:focus {
    color:#000;
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    color: black;
    padding: 10px 20px;
    text-align: center;
}

.replay {
    padding: 1em;
}

.modal-replay-btn {
    display: block;
    background-color: #1E90FF;
    color: white;
    font-size: 16px;
    font-weight: normal;
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    margin: auto;
    -webkit-box-shadow: 7px 7px 30px #999999;
    box-shadow: 7px 7px 30px #999999;
    -webkit-transition: -webkit-box-shadow 0.5s;
    -moz-transition: -webkit-box-shadow 0.5s;
    -o-transition: -webkit-box-shadow 0.5s;
    transition: -webkit-box-shadow 0.5s;
    -o-transition: box-shadow 0.5s;
    transition: box-shadow 0.5s, -webkit-box-shadow 0.5s;
}

.modal-replay-btn:hover, .modal-replay-btn:focus {
    -webkit-box-shadow: 3px 3px 8px #6F6F6F;
    box-shadow: 3px 3px 8px #6F6F6F;
    background-color: #1E90FF;
    cursor: pointer;
}

@media screen and (max-width: 1230px) {
    .score-panel {
        width: 100%;
    }
}

@media screen and (max-width: 1024px) {
    .container {
        width: 90%;
        height: initial;
    }

    .card {
        width: 140px;
        height: 140px;
    }
}

@media screen and (max-width: 840px) {
    .card {
        width: 120px;
        height: 120px;
    }
}

@media screen and (max-width: 735px) {
    .container {
        width: 100%;
    }

    .deck {
        width: 90%;
    }

    .card {
        width: 110px;
        height: 110px;
    }
}

@media screen and (max-width: 650px) {
    .deck {
        width: 95%;
    }
}

@media screen and (max-width: 550px) {
    .game-heading {
        margin-bottom: 0;
    }

    .card {
        width: 90px;
        height: 90px;
    }

    .score-panel {
        display: block;
    }

    .score {
        margin: 10px auto;
    }

    .timer {
        margin: 10px auto;
    }

    .restart {
        margin: 10px auto;
    }

    .card.show {
        font-size: 2em;
    }
}

@media screen and (max-width: 465px) {
    .card {
        width: 70px;
        height: 70px;
    }
}

@media screen and (max-width: 380px) {
    .card {
        width: 65px;
        height: 65px;
    }
}

@media screen and (max-width: 330px) {
    .card {
        width: 55px;
        height: 55px;
    }
}