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 {
  max-width: 100%;
    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 {
    transform: rotateY(-180deg);
    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: rotateY,0.2s;
}

/*added transition*/
.deck .card.open {
    transform: rotateY(0);
    background: #02b3e4;
    cursor: default;
    transition: rotateY,0.4s;
}

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

#timer{
  display:inline-block;
  margin: 0;
}

/***********************MODAL******************************************
  modal code source: https://codepen.io/bradtraversy/pen/zEOrPp
  used with some modifications!*/
.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{
  background-color:#f4f4f4;
  margin: 20% auto;
  width:70%;
  box-shadow: 0 5px 8px 0 rgba(0,0,0,0.2),0 7px 20px 0 rgba(0,0,0,0.17);
  animation-name:modalopen;
  animation-duration:1s;
}

.modal-header h2, .modal-footer h3{
  margin:0;
}

.modal-header{
  letter-spacing: 5px;
  background:#e9e9e9;
  padding:15px;
  color:auto;
}

.modal-body{
  padding:10px 20px;
}


.newGameBtn{
  border: 2px solid #373737;
  border-radius: 5px;
  text-align: center;
  background-color: #ff8672 ;
  float: right;
  width:15%;
  font-size: 20px;
}

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

@keyframes modalopen{
  from{ opacity: 0}
  to {opacity: 1}
}



/*makes more visible the score panel on smaller screenwidth*/
@media screen and (max-width: 650px) {

   .container{
     max-width: 100%;
     margin right: 10%;
     margin-left: 10%;
   }
     .score-panel{
         width: 60%;
         font-size: large;
    }
     .deck {
         min-height: 300px;
         max-width: 80%;
         margin-top: 0;
         margin-bottom: 0;
         }
     .deck .card {
         width:20%;
         height:60px;
         margin:3px;
    }
}
