/* MEDIA QUERY: ALWAYS */
* {
  box-sizing: broder-box;
}
@media only screen and (orientation: portrait) {
  body {
    background-image: url("assets/images/page_bg_portrait.jpg");
  }
}
@media only screen and (orientation: landscape) {
  body {
    background-image: url("assets/images/page_bg_landscape.jpg");
  }
}
html {
  min-height: 100vh;
}

/* Media query 1 - default */
body {
  /* background-color: rgb(22, 168, 54); */
  margin: 0;
  background-repeat: no-repeat;
  background-size: cover;
}

#game-info-container {
  margin-top: 10px;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 0.25em 0;
}
.page-title {
  color: #012843;
  font-family: "Verdana", "Arial", "Times New Roman";
  font-weight: bold;
  text-align: center;
  font-size: 1.5em;
  margin: 0;
}
#instruction {
  margin: 0;
  padding: 0.25em;
  font-family: "Verdana", "Arial", "Times New Roman";
  font-style: italic;
  text-align: center;
  font-size: 0.75em;
  font-weight: normal;
  color: #474747;
}
.backtohome {
  margin: 0 auto;
  font-family: "Verdana", "Arial", "Times New Roman";
  font-size: 0.75em;
}
.backtohome a:link, .backtohome a:visited {
  /* font-weight: 600; */
  color: rgb(0, 52, 163);
  text-decoration: none;
}
#backtohome-top {
  visibility: normal;
  text-align: center;
  padding: 0.5em;
}
#backtohome-bottom {
  visibility: hidden;
}

#game-container {
  /* background-color:rgb(69, 114, 211); */
  /* width: 100%;
  display:flex;
  flex-wrap: wrap; */
}
#game {
  margin-top: 20px;
  /* width: 100%; */
}
.cards-spread {
  /* background-color: rgb(172, 189, 225); */
  /* padding: 5%; */
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-gap: 5%;
  justify-content: center;
  perspective: 500px;
}
.card {
  /* must have same size height and width as .back-of-card-img and .card-vlalue */
  /* position: relative; */
  /* padding: 50%; */
  height: 85px;
  width: 55px;
}
.card.visible .card-back {
  transform: rotateY(-180deg);
}
.card.visible .card-front {
  transform: rotateY(0);
}
.card-front {
  transform: rotateY(180deg);
}
.card-face {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  border-width: 2px;
  border-style: solid;
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 400ms ease-in-out;
  -webkit-box-shadow: 1px 1px 5px 0px rgba(0, 0, 0, 0.3);
  box-shadow: 1px 1px 5px 0px rgba(0, 0, 0, 0.3);
}
.card-back {
  border-color: rgb(36, 36, 36);
  border-width: 1px;
}
.card-back:hover {
  transform: scale(1.05);
}
.back-of-card-img,
.card-value {
  height: 85px;
  width: 55px;
}

#results-container {
  display: none;
  position: absolute;
  bottom: 0;
  background-color: white;
  font-family: "Verdana", "Arial", "Times New Roman";
  text-align: center;
  width: 100%;
}
#results-container.visible {
  display: flex;
  flex-direction: column;
  animation: victory-text-appear 500ms forwards;
}
@keyframes victory-text-appear {
  from {
    position: absolute;
    bottom: -10em;
    opacity: 0;
  }
  to {
    position: absolute;
    bottom: 0;
    opacity: 1;
  }
}
#msg-good-work {
  padding-top: 0.25em;
  color: rgb(0, 30, 162);
  font-family: "Carter One", cursive;
  font-size: 2em;
  margin: 0;
}
#msg-flip-count {
  margin: 0;
  font-style: italic;
  font-size: 1em;
  color: #474747;
}
#msg-play-again {
  font-family: "Verdana", "Arial", "Times New Roman";
  font-weight: bold;
  margin: 0;
  font-size: 1em;
  padding-top: 0.5em;
}
#btns-container {
  padding: 0.75em 0;
}
.end-of-game-btn {
  display: inline-block;
  margin: 0 2em;
  padding: 0.5em 1em;
  -webkit-border-radius: 0.4em;
  -moz-border-radius: 0.4em;
  border-radius: 0.4em;
  color: #ffffff;
  font-family: "Fredoka One", cursive;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  text-shadow: 2px 2px 0px #000000;
}
#victory-yes-btn {
  background: linear-gradient(to bottom, #77d42a 5%, #5cb811 100%);
  box-shadow: inset 0px 1px 0px 0px #c8efab;
  background-color: #77d42a;
  border: 1px solid #268a16;
}
#victory-yes-btn:hover {
  background: linear-gradient(to bottom, #5cb811 5%, #77d42a 100%);
  background-color: #5cb811;
  webkit-animation: nod 500ms infinite; /* Safari 4+ */
  -moz-animation: nod 500ms infinite; /* Fx 5+ */
  -o-animation: nod 500ms infinite; /* Opera 12+ */
  animation: nod 500ms infinite; /* IE 10+, Fx 29+ */
}
@-webkit-keyframes nod {
  0% {
    position: relative;
    bottom: 0;
  }
  33% {
    position: relative;
    bottom: 1em;
  }
  100% {
    position: relative;
    bottom: 0;
  }
}
@-moz-keyframes nod {
  0% {
    position: relative;
    bottom: 0;
  }
  33% {
    position: relative;
    bottom: 1em;
  }
  100% {
    position: relative;
    bottom: 0;
  }
}
@-o-keyframes nod {
  0% {
    position: relative;
    bottom: 0;
  }
  33% {
    position: relative;
    bottom: 1em;
  }
  100% {
    position: relative;
    bottom: 0;
  }
}
@keyframes nod {
  0% {
    position: relative;
    bottom: 0;
  }
  33% {
    position: relative;
    bottom: 1em;
  }
  100% {
    position: relative;
    bottom: 0;
  }
}
#victory-yes-btn:active {
  position: relative;
  top: 0.075em;
}

#victory-no-btn {
  background: linear-gradient(to bottom, #d42a2a 5%, #b81111 100%);
  box-shadow: inset 0px 1px 0px 0px #efabab;
  background-color: #d42a2a;
  border: 1px solid #8a1616;
}
#victory-no-btn:hover {
  background: linear-gradient(to bottom, #b81111 5%, #d42a2a 100%);
  background-color: #b81111;
  webkit-animation: shake 500ms infinite; /* Safari 4+ */
  -moz-animation: shake 500ms infinite; /* Fx 5+ */
  -o-animation: shake 500ms infinite; /* Opera 12+ */
  animation: shake 500ms infinite; /* IE 10+, Fx 29+ */
}
@-webkit-keyframes shake {
  0% {
    position: relative;
    right: 0;
  }
  33% {
    position: relative;
    right: 1em;
  }
  100% {
    position: relative;
    right: 0;
  }
}
@-moz-keyframes shake {
  0% {
    position: relative;
    right: 0;
  }
  33% {
    position: relative;
    right: 1em;
  }
  100% {
    position: relative;
    right: 0;
  }
}
@-o-keyframes shake {
  0% {
    position: relative;
    right: 0;
  }
  33% {
    position: relative;
    right: 1em;
  }
  100% {
    position: relative;
    right: 0;
  }
}
@keyframes shake {
  0% {
    position: relative;
    right: 0;
  }
  33% {
    position: relative;
    right: 1em;
  }
  100% {
    position: relative;
    right: 0;
  }
}
#victory-no-btn:active {
  position: relative;
  top: 0.075em;
}

/* Media query 2 */
@media only screen and (min-width: 480px) {
  body {
    /* background-color: red;
    background-image: none; */
  }
  #game-info-container {
    margin-top: 1em;
    padding: 0.25em 0;
  }
  .page-title {
    font-size: 2em;
  }
  #instruction {
    font-size: 1em;
  }
  .backtohome {
    font-size: 1em;
  }
  #backtohome-top {
    padding: 0.5em;
  }

  .cards-spread {
    grid-gap: 8%;
  }
  .card {
    /* must have same size height and width as .back-of-card-img and .card-vlalue */
    height: 100px;
    width: 70px;
  }
  .card-face {
    border-radius: 6px;
    border-width: 1px;
  }
  .back-of-card-img,
  .card-value {
    height: 100px;
    width: 70px;
  }

  #msg-good-work {
    font-size: 2.5em;
  }
  #msg-flip-count {
    font-size: 1.25em;
  }
  #msg-play-again {
    font-size: 1.25em;
  }
  #btns-container {
    padding: 1em 0;
  }
  .end-of-game-btn {
    padding: 0.5em 1em;
    -webkit-border-radius: 0.3em;
    -moz-border-radius: 0.3em;
    border-radius: 0.3em;
    font-size: 1.25em;
  }
}

/* Media query 3 */
@media only screen and (min-width: 768px) {
  body {
    /* background-color: rgb(255, 226, 9);
    background-image: none; */
  }
  #game-info-container {
    margin-top: 1em;
    /* padding: 0.25em 0; */
  }
  .page-title {
    font-size: 2.25em;
  }
  #instruction {
    font-size: 1.25em;
  }
  .backtohome {
    font-size: 1.25em;
  }
  #backtohome-top {
    padding: 0.5em;
  }

  .cards-spread {
    grid-gap: 8%;
  }
  .card {
    /* must have same size height and width as .back-of-card-img and .card-vlalue */
    height: 130px;
    width: 90px;
  }
  .back-of-card-img,
  .card-value {
    height: 130px;
    width: 90px;
  }

  #msg-good-work {
    font-size: 2.75em;
  }
  #msg-flip-count {
    font-size: 1.25em;
  }
  #msg-play-again {
    font-size: 1.25em;
  }
  .end-of-game-btn {
    font-size: 1.5em;
  }
}

/* Media query 4 */
@media only screen and (min-width: 968px) {
  body {
    /* background-color: rgb(20, 203, 175);
    background-image: none; */
  }
  #game-info-container {
    margin-top: 1em;
    /* padding: 0.25em 0; */
  }
  .page-title {
    font-size: 2.25em;
  }
  #instruction {
    font-size: 1.125em;
  }
  .backtohome {
    font-size: 1.125em;
  }
  #backtohome-top {
    padding: 0.5em;
  }
  #game-container {
    display: flex;
    /* justify-content: center;
      align-items: center; */
  }
  #game {
    position: relative;
    left: 4em;
    width: 60%;
  }

  .cards-spread {
    grid-gap: 8%;
    /* background-color: rgba(69, 203, 244, 0.1);
      border-style: solid;
      border-width: 2px;
      border-color: rgb(56, 132, 157);
      border-radius: 1em; */
  }
  .card {
    /* must have same size height and width as .back-of-card-img and .card-vlalue */
    height: 14vh;
    width: 10vh;
  }
  .back-of-card-img,
  .card-value {
    height: 14vh;
    width: 10vh;
  }

  #results-container {
    display: none;
    /* display: flex;
            justify-content: center;
            align-items: center; */

    width: 40%;
    height: 400px;
    position: relative;
    top: 5em;
    right: 0;
    background-color: white;
    border-radius: 50%;
  }

  #results {
    position: relative;
    top: 15%;
  }
  #results-container.visible {
    /* display: flex;
                flex-direction: column; */
    animation: victory-text-appear 500ms forwards;
  }
  @keyframes victory-text-appear {
    from {
      position: relative;
      right: -10em;
      opacity: 0;
    }
    to {
      position: relative;
      right: 0;
      opacity: 1;
    }
  }
  #msg-good-work {
    /* padding: 0.25em; */
    /* font-family: 'Carter One', cursive; */
    font-size: 3em;
  }
  #msg-flip-count {
    font-size: 1.5em;
    padding-bottom: 1em;
  }
  #msg-play-again {
    font-size: 1.5em;
    padding: 0.5em 0;
  }
  #btns-container {
    /* padding: 0.75em 0; */
  }
  .end-of-game-btn {
    /* display:inline-block; */
    /* margin: 0 2em; */
    /* padding:0.5em 1em; */
  }
}

/* @media (max-width: 600px) {
  .cards-spread {
    grid-template-columns: repeat(2, auto);
  }

  .game-info-container {
    flex-direction: column;
    align-items: center;
  }
} */
