html {
    box-sizing: border-box;
}

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

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

body {
    background: #ffffff url('../imgs/geometry2.png'); /* Background pattern from Subtle Patterns */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    font-family: 'Coda', cursive;
}

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

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

/*
 * 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;
}

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

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

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

/*
 * Styles for the Score Panel
 */

.score-panel {
    text-align: left;
    width: 345px;
    margin-bottom: 10px;
}

.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;
}

.score-panel .moves {
    display: inline-block;
    margin-left: 50px;
}

.score-panel .timer {
    display: inline-block;
    margin-left: 50px;
}

.score-panel .restart {
    float: right;
    cursor: pointer;
}

/*
* Styles for the modal
*/

.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
}
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgb(13, 80, 168);
    padding: 1rem 1.5rem;
    width: 20rem;
    border-radius: 0.5rem;
    align-items: center;
    margin: auto;
}

.close-btn {
    float: right;
    width: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    cursor: pointer;
    border-radius: 0.25rem;
    background-color: lightgray;
}

.close-btn:hover {
    background-color: darkgray;
    transform: scale(1.1);
}

.modal-title {
    text-align: center;
    color: silver;
}

.modal-stats {
    align-items: center;
    padding-bottom: 10px;
}

.modal-stats span {
    display: block;
    padding: 5px;
    color: silver;
    margin-top: -10px;
    margin-left: 5rem;
    word-spacing: 0.5rem;
}

.modal-restart {
    margin-left: 6rem;
    background-color: rgb(250, 170, 23);
    color: white;
    font-weight: bolder;
    border-radius: 0.25rem;
}

.modal-restart:hover {
    transform: scale(1.2);
    border-radius: 0.25rem;
    cursor: pointer;
}

.show-modal {
    opacity: 1;
    visibility: visible;
    transform: scale(1.0);
    transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
}

/*
* Small screen
*/

@media screen and (max-width: 350px) {
    .score-panel {
        display: flex;
        margin-left: auto;
        margin-right: auto;
    }

    .modal-content {
        width: 17rem;
    }
}

/*
* Medium screens
*/

@media screen and (max-width: 649px) {
    .score-panel {
        display: flex;
    }

    .score-panel .restart {
        display: inline-flex;
        margin-left: 50px;
        width: 40px;
    }

    .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;
    }
    
    .score-panel .moves {
        display: inline-block;
        margin-left: 50px;
    }
    
    .score-panel .timer {
        display: inline-block;
        margin-left: 50px;
    }

    .deck {
        width: 250px;
        min-height: 250px;
        padding: 10px;
    }

    .deck .card {
        width: 50px;
        height: 50px;
    }

    .deck .card.show {
        font-size: 1em;
    }
    
    .deck .card.match {
        font-size: 1em;
    }
}

/*
* Large screens
*/

@media screen and (min-width: 650px ) and (max-width: 900px) {
    .score-panel {
        display: flex;
    }

    .score-panel .restart {
        display: inline-flex;
        margin-left: 50px;
    }

    .deck {
        width: 500px;
        min-height: 500px;
        padding: 20px;
    }

    .deck .card {
        width: 100px;
        height: 100px;
    }
}