/*
COLOR SCHEME

PRIMARY COLOR: #9e2021
SECONDARY COLOR: #155f60
THIRD COLOR: #6c943e
FOURTH COLOR: #1e7f3f
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100vh;
}
body {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 400;
}
.container {
  width: 98%;
  margin: 0 auto;
}

/* HEADER */

.top-header, .start-top-header {
  padding: 10px;
  border-bottom: solid 1px #000;
}
.logo {
  width: 55px;
  height: 55px;
}
.title {
  font-size: 1.5em;
  font-weight: 500;
  position: absolute;
  margin: -53px auto auto 65px;
}
.subtitle {
  position: absolute;
  margin: -26px auto auto 65px;
  font-size: 1.3em;
  font-weight: 400;
  font-style: italic;
}

/* SECTION GAME-CANVAS */

.game-canvas-heading {
  display: none;
}
.board-container {
  width: 300px;
  margin: 0 auto;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  padding: 10px 10px 20px 10px;
  box-shadow: 0 0 20px #000;
}
.board {
  -webkit-perspective: 800px;
  perspective: 800px;
  position: relative;
  width: 60px;
  height: 60px;
  margin-top: 10px;
  box-shadow: 0 0 15px #000;
}
.board:focus, .board:focus .card:focus {
  box-shadow: 0 0 15px #6c943e !important;
}
.board .card {
  width: 100%;
  height: 100%;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-transition: 0.6s;
  transition: 0.6s;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 5px;
  border: solid 1px #000;
  color: #fff;
  font-family: 'EB Garamond', serif;
  font-size: 2.5em;
  text-align: center;
}
.board .card.flip {
  -webkit-transform: rotatex(-180deg);
  transform: rotateX(-180deg);
  margin-top: 5px;
}
.board .card .side {
  width: 100%;
  height: 100%;
  position: absolute;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.board .card .front {
  position: absolute;
  z-index: 1;
  cursor: pointer;
  margin-top: 5px;
}
.board .card .back {
  -webkit-transform: rotatex(-180deg);
  transform: rotateX(-180deg);
  cursor: pointer;
  z-index: 2;
  background-color: #9e2021;
  border-radius: 5px;
  border: solid 1px #000;
  color: #fff;
  font-family: 'EB Garamond', serif;
  text-align: center;
}
.blue {
  background-color: #155f60;
  background: radial-gradient(#468b8b, #155f60);
}
.blue:hover {
  background-color: #468b8b;
  background: radial-gradient(#155f60, #468b8b);
}
.green {
  background-color: #6c943e;
  background: radial-gradient(#bcda99, #6c943e);
}
.green:hover {
  background-color: #bcda99;
  background: radial-gradient(#6c943e, #bcda99);
}
.dark-green {
  background-color: #1e7f3f;
  background: radial-gradient(#5cb279, #1e7f3f);
}
.dark-green:hover {
  background-color: #5cb279;
  background: radial-gradient(#1e7f3f, #5cb279);
}
.back {
  margin-top: 5px;
}
.match {
  background-color: #1e7f3f;
  visibility: hidden; 
  animation: bounceOutFrames linear 1s;
  animation-iteration-count: 1;
  transform-origin: 50% 50%;
  -webkit-animation: bounceOutFrames linear 1s;
  -webkit-animation-iteration-count: 1;
  -webkit-transform-origin: 50% 50%;
  -moz-animation: bounceOutFrames linear 1s;
  -moz-animation-iteration-count: 1;
  -moz-transform-origin: 50% 50%;
  -o-animation: bounceOutFrames linear 1s;
  -o-animation-iteration-count: 1;
  -o-transform-origin: 50% 50%;
  -ms-animation: bounceOutFrames linear 1s;
  -ms-animation-iteration-count: 1;
  -ms-transform-origin: 50% 50%;
}

/* GAME OPTIONS SECTION */

.game-options {
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  width: 300px;
  margin: 10px auto;
  box-shadow: 0 0 15px #000;
}
.row {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  padding: 10px;
  text-align: center;
}
.stars, .moves, .timer {
  width: 35%;
}
.row-title {
  font-weight: 500;
}
.fa-star {
  color: #6c943e;
}
.moves-counter, .time-counter {
  font-weight: 400;
}
.reload-button {
  width: 14%;
  color: #fff;
  background-color: rgba(0, 0, 0, 0);
  border: none;
}
.help-button {
  width: 14%;
  color: #fff;
  background-color: rgba(0, 0, 0, 0);
  border: none;
}
.reload-button:hover, .reload-button:focus {
  color: #6c943e;
}

/* FOOTER  */

.footer {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  margin-top: 10px;
}
.copyright {
  text-align: center;
  color: #fff;
  padding: 20px;
}
.link {
  color: #fff;
  text-decoration: none;
}
.link:hover, .link:focus {
  color: #6c943e;
}

/* MODALS STYLING  */

.modal-container {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
.modal-content, .start-modal-content {
  background-color: #fefefe;
  padding: 1em;
  border: 1px solid #888;
  min-width: 300px;
  max-width: 700px;
  left: 50%;
  top: 50%;
  position: relative;
  transform: translate(-50%, -50%);
}
.close {
  color: #757575;
  float: right;
  font-size: 28px;
  font-weight: bold;
}
.close:hover,
.close:focus {
  color: #6c943e;
  outline: 0;
  text-decoration: none;
  cursor: pointer;
}
.logo-modal, .start-logo-modal {
  width: 55px;
  height: 55px;
  margin-left: 50%;
  transform: translateX(-50%);
}
.modal-welcome, .start-modal-welcome {
  text-align: center;
  font-size: 2em;
  margin-top: 1.3em;
}
.modal-text, .start-modal-text {
  margin-top: 2em;
  text-align: center;
}
.start-button {
  margin-top: 2em;
  padding: 1em;
  margin-left: 50%;
  transform: translateX(-50%);
  background-color: #9e2021;
  color: #fff;
  font-family: inherit;
  font-size: 1em;
  min-width: 150px;
  border: none;
  box-shadow: 0 0 10px gray;
}
.start-button:hover, .start-button:focus {
  box-shadow: 0 0 2px gray;
  cursor: pointer;
}
.show {
  display: block !important;
  opacity: 1;
  transition: all 3s ease;
}

/* CARD MATCHED ANIMATION KEYFRAMES */

@keyframes bounceOutFrames{
  0% {
    opacity:1;
    transform:  scaleX(1.00) scaleY(1.00) ;
  }
  25% {
    opacity:1;
    transform:  scaleX(0.95) scaleY(0.95) ;
  }
  50% {
    opacity:1;
    transform:  scaleX(1.10) scaleY(1.10) ;
  }
  100% {
    opacity:0;
    transform:  scaleX(0.30) scaleY(0.30) ;
  }
}

@-moz-keyframes bounceOutFrames{
  0% {
    opacity:1;
    -moz-transform:  scaleX(1.00) scaleY(1.00) ;
  }
  25% {
    opacity:1;
    -moz-transform:  scaleX(0.95) scaleY(0.95) ;
  }
  50% {
    opacity:1;
    -moz-transform:  scaleX(1.10) scaleY(1.10) ;
  }
  100% {
    opacity:0;
    -moz-transform:  scaleX(0.30) scaleY(0.30) ;
  }
}

@-webkit-keyframes bounceOutFrames {
  0% {
    opacity:1;
    -webkit-transform:  scaleX(1.00) scaleY(1.00) ;
  }
  25% {
    opacity:1;
    -webkit-transform:  scaleX(0.95) scaleY(0.95) ;
  }
  50% {
    opacity:1;
    -webkit-transform:  scaleX(1.10) scaleY(1.10) ;
  }
  100% {
    opacity:0;
    -webkit-transform:  scaleX(0.30) scaleY(0.30) ;
  }
}

@-o-keyframes bounceOutFrames {
  0% {
    opacity:1;
    -o-transform:  scaleX(1.00) scaleY(1.00) ;
  }
  25% {
    opacity:1;
    -o-transform:  scaleX(0.95) scaleY(0.95) ;
  }
  50% {
    opacity:1;
    -o-transform:  scaleX(1.10) scaleY(1.10) ;
  }
  100% {
    opacity:0;
    -o-transform:  scaleX(0.30) scaleY(0.30) ;
  }
}

@-ms-keyframes bounceOutFrames {
  0% {
    opacity:1;
    -ms-transform:  scaleX(1.00) scaleY(1.00) ;
  }
  25% {
    opacity:1;
    -ms-transform:  scaleX(0.95) scaleY(0.95) ;
  }
  50% {
    opacity:1;
    -ms-transform:  scaleX(1.10) scaleY(1.10) ;
  }
  100% {
    opacity:0;
    -ms-transform:  scaleX(0.30) scaleY(0.30) ;
  }
}

/* BACKGROUND ANIMATION */

.animation {
  display: none;
}
.animation span {
  display: none;
}
