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

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

/*
 * Styles for the deck of cards
 */

.deck {
    max-width: 680px;
    height: 680px;
    background: linear-gradient(160deg, #02ccba 0%, #aa7ecd 100%);
    padding: 2em;
    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;
    pointer-events: none;
}

.deck .card.show {
    font-size: 2.5rem;
}

.deck .card.match {
    cursor: default;
    background: #02ccba;
    font-size: 2.5rem;
    pointer-events: none;
}


/*
 * Styles for the Score Panel
 */

.score-panel {
    text-align: left;
    width: 320px;
    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;
    color: #aa7ecd;
    visibility: visible;
}

.score-panel .timer {
    margin-left: 1.5em;
}

.score-panel .restart {
    float: right;
    cursor: pointer;
}
/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    padding-top: 10em;
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto; /* 15% from the top and centered */
    padding: 1.5em;
    text-align: center;
    border: 1px solid #888;
    border-radius: 8px;
    width: 50%; /* Could be more or less, depending on screen size */
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    -webkit-animation-name: animatetop;
    -webkit-animation-duration: 0.5s;
    -moz-animation-name: animatetop;
    -moz-animation-duration: 0.5s;
    -o-animation-name: animatetop;
    -o-animation-duration: 0.5s;
    animation-name: animatetop;
    animation-duration: 0.5s
}

/* Add Animation */
@-webkit-keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

@-moz-keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

@-o-keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

@keyframes animatetop {
    from {top:-300px; opacity:0}
    to {top:0; opacity:1}
}

.modal-score {
    text-align: center;
    padding: 0;
    margin: 0;
}

.modal-score li {
    list-style: none;
}

.modal-moves,
.modal-stars,
.modal-time {
    color: #02ccba;
    font-weight: bold;
    padding: 10px;
}


/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Button in the modal */
#modalBtn {
    font-size: 18px;
    padding: 10px 20px;
    margin-top: 40px;
    background-color: #aa7ecd;
    border-radius: 8px;
}

/* Responsive */

@media screen and (min-width: 460px) and (max-width: 680px) {
    .deck {
        height: 85vh;
        margin: 0 0 1em;
    }

    .deck .card {
        height: 15vh;
        width: 19vw;
    }

    .modal-content {
        width: 70%;
    }
}

@media screen and (max-width: 459px) {
    .deck {
        padding: 1em;
        height: 65vh;
        align-content: space-between;
        margin: 0 0 1em;
    }

    .deck .card {
        height: 13vh;
        width: 20vw;
    }

    .score-panel .stars {
        margin-left: 0.5em;
    }

    .score-panel .restart {
        margin-right: 0.7em;
    }

    .modal-content {
        width: 70%;
    }
}
