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: 'Acme', sans-serif;
}

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

h1 {
    font: 40px/1.5 'Acme', sans-serif;
    font-weight: 300;
    margin: 12px;
}

/*
 * Styles for the deck of cards
 */

.deck {
    width: 660px;
    min-height: 680px;
    background: linear-gradient(160deg, #56bcbf 0%, #047190 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);
    transition: all .3s ease-in-out;
}

.deck .card:hover {
    transform: scale3d(1, 1, 2) rotateZ(0deg);
    background: rgba(46, 61, 73, 0.815);
}

.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 {
    display: flex;
    justify-content: space-between;
    width: 345px;
    margin-bottom: 10px;
    font: 18px/1.5 'Acme', sans-serif;
}

.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 .restart {
    float: right;
    cursor: pointer;
}

/* to change the color of the stars*/

.grey {
    color: #d3d3d3;
}

/* to stop event listener after opening two cards */

.stop-event {
    pointer-events: none;
}

/* Modal */

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

.modal-box {
    position: fixed;
    background-color: #fff;
    top: 40%;
    left: 25%;
    width: 625px;
    padding: 40px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 1px 1px 40px #e3e1e1;
    list-style: none;
}

.modal-box h1 {
    margin: auto;
}

.btn-modal {
    color: #f3f7f7;
    background-color: #02b3e4;
    width: 120px;
    height: 30px;
    border: 1px solid #e9edef;
    border-radius: 5px;
    box-shadow: 1px 2px 4px rgba(235, 235, 235, 0.48);
    font-size: 1em;
}

.btn-modal:hover {
    background-color: #f3f7f7;
    color: #02b3e4;
    transition: all 0.5s ease;
}

.rating-modal li {
    display: inline-block;
}

hr {
    margin: 0 auto;
    width: 80%;
}

.footer {
    text-align: center;
    margin: 4%;
}

/* Media Queries  */

@media screen and (max-width: 650px) {
    .score-panel {
        width: 90%;
        margin: 0 auto;
        flex-basis: 40%;
    }
    .deck {
        width: 95%;
        padding: 3%;
        margin: 0 auto;
        min-height: 100%;
    }
    .deck .card {
        height: 92px;
        margin-top: 2%;
    }
    .modal-box {
        width: 90%;
        left: 5%;
        top: 25%;
        margin: auto 0;
    }
}

@media screen and (max-width: 368px) {
    .deck .card {
        width: 68px;
        height: 92px;
        margin-top: 2%;
    }
}

@media screen and (min-width: 369px) and (max-width: 460px) {
    .deck .card {
        width: 82px;
    }
}

@media screen and (min-width: 461px) and (max-width: 516px) {
    .deck .card {
        width: 92px;
    }
}

@media screen and (min-width: 517px) and (max-width: 580px) {
    .deck .card {
        width: 105px;
    }
}

@media screen and (min-width: 651px) and (max-width: 820px) {
    .modal-box {
        width: 80%;
        left: 10%;
        top: 35%;
        margin: auto 0;
    }
}

@media screen and (min-width: 821px) and (max-width: 1024px) {
    .modal-box {
        width: 60%;
        left: 20%;
        top: 32%;
    }
}