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: 440px;
    min-height: 440px;
    padding: 20px;
    background: linear-gradient(160deg, #99e4f5 0%, #069dc3 100%);
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 3em;
}

.deck .card {
    transform: rotateY(180deg);
    width: 90px;
    height: 90px;
    background: rgba(46, 61, 73, 0.8);
    font-size: 0px;
    color: #ffffff;
    border-radius: 15px;
    border: 1px groove rgba(46, 61, 73, 0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 5px 2px 20px 0 rgba(46, 61, 73, 0.5);
    transition: all 0.4s;
}

.deck .card.open {
    background: #0293e4;
    transform-style: preserve-3d;
    transition: all 0.4s;
}

.deck .card.show {
    font-size: 40px;
    transform: rotateY(0deg);
    cursor: default;
}

.deck .card.match {
    background: rgb(54, 201, 140, 0.8);
    animation: shake 0.5s;
    transition: all 0.5s ease-in-out;
}

.deck .card.no-match {
    background: rgb(239, 76, 3, 0.8);
}

@keyframes shake {
    0% { transform: translate(-15px, 0px) rotate(-5deg);}
    20% { transform: translate(15px, 0px) rotate(5deg); }
    40% { transform: translate(-15px, 0px) rotate(-5deg); }
    60% { transform: translate(15px, 0px) rotate(5deg); }
    80% { transform: translate(-15px, 0px) rotate(-5deg); }
    100% { transform: translate(15px, 0px) rotate(5deg); }
}

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

/*
 * Styles for the Success Message
 */

.memory-solved {
  display: none;
  width: 400px;
  min-height: 400px;
  text-align: center;
  padding: 32px;
  background: white;
  border-radius: 10px;
  box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
  margin-top: 10%;
}

.memory-solved > * {
  margin: 20px auto;
}

.memory-solved .fa-check-circle {
  font-size: 7em;
  color: #4BB543;
}

#successMessage {
  font-size: 1.4em;
}

@media screen and (min-width: 760px) {
  .deck {
    width: 740px;
    height: 740px;
    padding: 20px;
  }

  .deck .card  {
    width: 145px;
    height: 145px;
    margin: 15px;
  }
}

@media screen and (min-width: 1024px) {
  .deck {
    width: 904px;
    height: 904px;
    padding: 32px;
  }

  .deck .card  {
    width: 170px;
    height: 170px;
    margin: 20px;
  }

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

  h1 {
    font-size: 2.3em;
  }

  .score-panel {
      font-size: 1.3em;
  }
}
