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 {
    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.notmatch {
  background: #b91616;
}


/*
 * Styles for the Score Panel
 */

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

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

.score-panel #timeRecord {
    float: left;
    margin-right: 20px;
}


/*
 * Styles for win model
 */

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}

.modal .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    text-align: center;
    border-radius: 10px;
    color: #636363;
}

.modal p {
  margin-top: 8px;
}

.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

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

.modal .model-text {
    font-size: 20px;
    font-weight: bold;
    color: #519a5b;
}

.modal .score-panel {
    width: 358px;
    text-align: center;
    margin: auto;
}

.modal .score-panel #timeRecord {
    margin: 10px 0;
    float: none;
    margin-right: 0;
}

.modal .replayBtn {
    padding: 15px 20px;
    border: none;
    background-color: #02ccba;
    color: #fff;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}


/*
 * add flipping styles
 */
.flip {
    transition: all .2s ease;
    transform-style: preserve-3d;
    -webkit-transform: rotateY( -180deg );
    -moz-transform: rotateY( -180deg );
    -o-transform: rotateY( -180deg );
    transform: rotateY( -180deg );
}


/*
 * media queries
 */
/* for medium screens */
@media screen and (max-width: 690px) {

   .deck {
     width: 473px;
     min-height: 486px;
     padding: 18px;
   }

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

   .score-panel {
       width: 365px;
   }

 }

 /* for small screens */
@media screen and (max-width: 500px) {

   .deck {
       width: 390px;
       min-height: 410px;
       padding: 12px;
   }

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

   .score-panel {
       width: 273px;
   }

 }

/* for small screens */
@media screen and (max-width: 420px) {

   .deck {
       width: 312px;
       min-height: 318px;
       padding: 12px;
   }

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

}

/* for width less than 319px*/
@media screen and (max-width: 319px) {

   .deck {
       width: 100%;
       height: 519px;
       padding: 5px;
   }

   .deck .card {
       height: 55px;
       width: 48%;
   }
   .score-panel {
       width: 68px;
   }

}
