/*
 * General
 */
* {
  box-sizing: border-box;
}

body {
  background-color: #f2f2f2;
  margin: 0;
  padding: 0;
  font-family: "Nunito", sans-serif;
}

.back-link {
  color: #333;
  text-decoration: none;
  line-height: 30px;
  border-bottom: 1px solid;
  margin: 10px;
}

.hide {
  display: none;
}


/*
 * Header
 */
.header-container {
  max-width: 600px;
  margin: 10px auto;
  text-align: center;
  font-size: 1em;
  display: flex;
  flex-wrap: wrap;
}

.main-header {
  font-family: "Bree Serif", serif;
  letter-spacing: 0.1em;
  line-height: 30px;
  color: #fa9eb0;
  text-shadow: 2px 2px #a8503c;
  margin: 10px auto;
  width: 100%;
}

.game-type-header {
  font-size: 0.8em;
  margin: 5px auto;
  font-family: "Anonymous Pro", monospace;
}

.btn-restart{
  font-size: 0.8em;
  padding: 5px;
  width: 30%;
  color: #62cdfd;
  text-decoration: underline;
  cursor: pointer;
}


/*
 * Game
 */
 .game-container {
   max-width: 600px;
   margin: auto;
 }


/*
 * Game controls
 */
 .game-controls {
    display: flex;
    flex-wrap: nowrap;
    padding: 3px;
    background-color: #fff;
    width: 98%;
    border-radius: 8px;
    box-shadow: 0 -2px 10px 0 rgba(0,0,0,0.1);
    margin: auto;
 }

 .game-control-item {
   width: 100%;
   margin: 5px;
   text-align: center;
   font-family: "Anonymous Pro", monospace;
 }

 .current-value {
   font-size: 1.4em;
   font-weight: 700;
 }

 .game-board {
   height: 100%;
 }

 .stars {
   display: inline-block;
   margin: 1px;
 }

 .result-label {
   line-height: 1.4em;
   margin-top: 0;
   margin-bottom: 5px;
   text-align: center;
   font-size: 0.8em;
 }


/*
 * Cards
 */
.card-container {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: auto;
  background-color: #f2f2f2;
  padding: 2px;
}

.card-pos {
  width: 23.5%;
  height: 77px;
  margin: 2px;
  padding: 0;
  list-style-type: none;
  perspective: 1000px;
  background-color: transparent;
}

.card {
  order: 1000;
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.3s;
  transform-style: preserve-3d;
}

.card-flip {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  border-radius: 8px;
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden; /*to make the cards flip correctly in safari*/
  border: 1px solid #d7d7d7;
}

.card-back {
  background-image: url(../img/card-back.svg);
  background-color: #6ad2ff;
  object-fit: none;
  object-position: 50% 50%;
  box-shadow: 0px 0px 5px 0px rgba(194,194,194,0.4);
  cursor: pointer;
}

.card-front {
  background-color: #fff;
  transform: rotateY(180deg);
  padding: 10px;
}

.card-symbol {
  height: 100%;
  width: inherit;
}


/*
 * Footer
 */
 .footer-container {
   width: 100%;
   background-color: #fff;
   color: #000;
   text-align: center;
   padding: 6px;
   margin: 30px 0 0 0;
   font-size: 0.7em;
 }


/*
 * Modal
 */
.modal {
  display: flex;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
   position: relative;
   padding: 10px;
   margin: auto;
   width: 100%;
   height: 100%;
   text-align: center;
   background-color: #fff;
   box-shadow: 0 0 64px 20px rgba(0,0,0,0.11);
}

.modal-header {
  margin: 10px 0 20px 0;
  font-size: 2.5em;
  line-height: 43px;
}

.modal-img {
   width: 100%;
   height: 30%;
 }

.close-btn {
   float: right;
   color: #000;
   font-size: 24px;
   font-weight: bold;
}

.results-container {
  font-family: "Bree Serif", serif;
  letter-spacing: 0.1em;
  width: 100%;
  display: flex;
  text-align: left;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.result-item {
  width: 33%;
  border: 4px dotted #ffeb99;
  background-color: #fffdf6;
  border-radius: 48px;
  margin: 2px;
  padding-top: 20px;
  height: auto;
  text-align: center;
  min-height: 90px;
}

.result-value {
   width: 100%;
   font-size: 1em;
   font-family: "Anonymous Pro", monospace;
}

.star {
  width: 1em;
}

.btn-play-again {
  width: 100%;
  font-family: "Bree Serif", serif;
  font-size: 1.2em;
  background-color: #6ad2ff;
  color: #fff;
  padding: 15px 25px;
  margin-top: 50px;
  border-radius: 8px;
  box-shadow: 0px 2px 8px 0px rgba(194,194,194,0.8);
}


/*
 * Responsive
 */
@media screen and (min-width: 600px) {
  .game-container {
    height: 750px;
  }

  .game-controls {
    margin-left: 60px;
    position: absolute;
    padding-bottom: 20px;
  }

  .game-board {
    position: relative;
    top: 85px;
  }
 }

@media screen and (min-width: 500px) {
  .header-container {
    font-size: 1.6em;
    margin: 5px auto 30px auto;
  }

  .card-container {
    max-width: 600px;
    height: 50%;
  }

  .card-pos {
    width: 24.0%;
    height: 150px;
  }

  .card-back {
    box-shadow: 0px 0px 15px 0px rgba(194,194,194,1);
  }

  .modal-content {
    max-width: 600px;
    height: auto;
    border-radius: 16px;
    padding: 20px;
  }

  .modal-img {
    height: 30%;
  }

  .game-controls {
    padding: 10px 20px;
    max-width: 480px;
    height: 100px;
    box-shadow: 0 -4px 21px 0 rgba(0,0,0,0.14);
  }

  .current-value {
    font-size: 2em;
  }

  .result-value {
    font-size: 2em;
  }

  .star {
    width: 1.7em;
  }
}

@media screen and (min-width: 330px) and (max-width: 500px) {
  .card-pos {
    width: 23.7%;
    height: 110px;
  }
}
 /* Reference: Making a 2-sided card flip. https://www.w3schools.com/howto/howto_css_flip_card.asp */
