@import url(https://fonts.googleapis.com/css?family=Amatic+SC|BioRhyme);

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/brickwall.png);
  /* Background pattern from Subtle Patterns */
  font-family: "BioRhyme", cursive;
}

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

h1 {
  font-family: "Amatic SC", cursive;
  font-size: 40px;
  font-weight: 700;
}

h4 {
  color: red;
}

/*
 * Styles for the deck of cards
 */

.deck {
  width: 300px;
  min-height: 300px;
  background: linear-gradient(160deg, #f46b45 0%, #eea849 100%);
  padding: 15px;
  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: 60px;
  width: 60px;
  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 {
  background: #027fe4;
  cursor: default;
  font-size: 20px;
  transition: font-size 0.5s;
}

@keyframes jump {
  0% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-30px);
  }
  50% {
    transform: translateY(0);
  }
  60% {
    transform: translateY(-15px);
  }
  80% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}

.deck .card.close {
  background: #ff0000;
  cursor: default;
  font-size: 20px;
  animation: jump 1s ease 0s 1 normal;
}

.deck .card.match {
  background: #27995b;
  cursor: default;
  font-size: 20px;
  transform: rotateZ(360deg);
  transition: transform 0.5s;
}

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

.score-panel .timer {
  padding-left: 40px;
}

.score-panel .restart {
  float: right;
  cursor: pointer;
}

/*
 * Styles for the Results Panel
 */

@keyframes appear {
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  60% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

.results {
  width: 360px;
  min-height: 360px;
  background: white;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 12px 15px 20px 0 rgba(46, 61, 73, 0.5);
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 0 0 3em;
  animation: appear 2s ease 0s 1 normal;
}

.stats,
.leaderboard {
  width: 100%;
  text-align: center;
}

.score,
.leaderboard-table {
  margin: auto;
  padding: 15px 0;
}

.score td {
  padding: 0 5px;
  text-align: left;
}

.score td:first-of-type {
  font-weight: bold;
}

.leaderboard {
  display: none;
}

.leaderboard-table td {
  padding: 0 10px;
  text-align: left;
}

.leaderboard-table tr:nth-of-type(1) {
  font-weight: bold;
}

@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.0);
  }
  70% {
    opacity: 1;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.success {
  font-size: 40px;
  color: green;
  opacity: 0;
  animation: bounce-in 1.5s ease 1.5s 1 normal forwards;
}

.play-again {
  padding-top: 10px; 
}

.btn-restart {
  color: white;
  font-size: 16px;
  font-weight: bold;
  font-family: "BioRhyme", cursive;
  padding: 10px;
  background-color: #ffb801;
  box-shadow: 1px 8px 0 0 rgba(46, 61, 73, 0.5);
  border: solid #ffb801 1px;
  border-radius: 20px;
  text-decoration: none;
  outline: none;
  cursor: pointer;
}

.btn-restart:hover {
  background-color: #ffa800;
}

.btn-restart:active {
  background-color: #ffa800;
  box-shadow: 0 5px rgba(46, 61, 73, 0.5);
  transform: translateY(4px);
}

.btn-save {
  color: white;
  background-color: blue;
  border: solid blue 1px;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  font-weight: bold;
  font-family: "BioRhyme", cursive;
  padding: 2px;
}

.name {
  font-size: 16px;
  font-weight: bold;
  font-family: "BioRhyme", cursive;
  padding: 0 5px;
  border: solid blue 1px;
  border-radius: 10px;
  outline: none;
}

/* Media queries breakpoints */

@media screen and (min-width: 960px) {
  .deck,
  .results {
    width: 660px;
    height: 660px;
    padding: 32px;
  }
  .deck .card {
    width: 125px;
    height: 125px;
  }
  .deck .card.open,
  .deck .card.close,
  .deck .card.match {
    font-size: 32px;
  }
}

@media screen and (min-width: 700px) and (max-width: 959px) {
  .deck,
  .results {
    width: 560px;
    height: 560px;
    padding: 28px;
  }
  .deck .card {
    width: 112px;
    height: 112px;
  }
  .deck .card.open,
  .deck .card.close,
  .deck .card.match {
    font-size: 28px;
  }
}
