/* Note: All code in this project was arranged for a 'mobile-first' design */
/* Importing Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Oxygen:wght@300&family=Poppins:wght@500&display=swap");

/* wild card selector to override browser default styles */
* {
  margin: 0;
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
}

/* general styles */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #ffef0a;
  font-family: "Oxygen", sans-serif;
  background: url(../images/background_tree_yf.webp) no-repeat center
    center/cover;
}

h1 {
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #ffef0a;
  text-align: center;
  font-size: 170%;
  padding: 11% 6% 4% 6%;
}

/* main content */
main {
  /* push footer down */
  flex: 1 0 auto;
}

.move-time-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 280px;
  height: 55px;
  margin: 0 auto;
}

.moves-area {
  text-align: center;
  width: 40%;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 90%;
  font-weight: bold;
  background-color: #ffef0a;
  color: #2a2a2a;
}

.time-area {
  text-align: center;
  width: 40%;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 90%;
  font-weight: bold;
  background-color: #ffef0a;
  color: #2a2a2a;
}

/* credit for timer code that was adjusted for my own use, tutorial at the following address: https://github.com/adipurdila/countdown-timer/tree/main */
.timer-container {
  list-style: none;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
}

/* memory game */
.overall-game-area {
  display: flex;
  flex-wrap: wrap;
  padding: 2% 2% 1% 2%;
}

.grid-section-area {
  height: 300px;
  width: 300px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  width: calc(25% - 8px);
  height: calc(25% - 8px);
  margin: 4px;
  position: relative;
  transform-style: preserve-3d;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
  transform: scale(1);
  transition: transform 0.5s;
}

.cards:active {
  transform: scale(0.96);
  transition: transform 0.2s;
}

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

.front,
.back {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
  padding: 2px;
  position: absolute;
  border-radius: 5px;
  background: #ffef0a;
  backface-visibility: hidden;
}

.front {
  transform: rotateY(180deg);
}

.pose-name-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.pose-name-area {
  text-align: center;
  width: 240px;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 82%;
  font-weight: bold;
  background-color: #ffef0a;
  color: #2a2a2a;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  height: 45px;
}

.rules-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.rules-btn {
  margin: 4px;
  text-align: center;
  width: 240px;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 85%;
  font-weight: bold;
  background-color: #fffae6;
  color: #2a2a2a;
  box-shadow: 0.1rem 0.1rem #2a2a2a;
  cursor: pointer;
}

/* start of rules modal style */
/* modal credit 1: https://www.w3schools.com/howto/howto_css_modals.asp */
/* modal credit 2: https://github.com/moirahartigan/Portfolio-2---Alien-Memory-Game/tree/master */
.rules-modal-class {
  display: none;
  background-color: rgba(0, 0, 0, 0.8);
  position: absolute;
  z-index: 99;
  left: 0;
  top: 0;
  width: 100%;
  min-height: 100vh;
  flex-wrap: wrap;
  justify-content: center;
}

.rules-modal-card {
  font-family: "Poppins", sans-serif;
  border: 0.8em solid #d47cfa;
  background-color: #fffae6;
  border-radius: 18px;
  padding: 5%;
  margin: 30px 30px 100px 30px;
  width: 78%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.rules-card-body {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
}

.modal-heading {
  padding: 1% 3% 4% 3%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  color: #d47cfa;
}

.have-fun-div {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  color: #d47cfa;
  padding: 2% 0% 3% 0%;
  margin-bottom: 10px;
}

.rule-list {
  font-weight: 250;
  font-size: 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.rule-list li {
  font-family: Poppins, sans-serif;
  margin-bottom: 12px;
  color: black;
  text-align: center;
  list-style-type: none;
  line-height: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 96%;
  font-size: 98%;
}

.close-rules-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.close-rules-button {
  margin: 4px;
  text-align: center;
  width: 40%;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 92%;
  font-weight: bold;
  background-color: #ffef0a;
  color: #2a2a2a;
  box-shadow: 0.1rem 0.1rem #2a2a2a;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* end of rules modal */

/* start of reset modal style */
/* modal credit 1: https://www.w3schools.com/howto/howto_css_modals.asp */
/* modal credit 2: https://github.com/moirahartigan/Portfolio-2---Alien-Memory-Game/tree/master */
.sure-modal-class {
  display: none;
  background-color: rgba(0, 0, 0, 0.8);
  position: absolute;
  z-index: 99;
  left: 0;
  top: 0;
  width: 100%;
  min-height: 100vh;
  flex-wrap: wrap;
  justify-content: center;
}

.sure-modal-card {
  font-family: "Poppins", sans-serif;
  border: 0.8em solid #d47cfa;
  background-color: #fffae6;
  border-radius: 18px;
  padding: 5%;
  margin: 30px 30px 100px 30px;
  width: 78%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.sure-card-body {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
}

.modal-sure-heading {
  padding: 1% 3% 5% 3%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  color: #d47cfa;
}

.modal-sure-heading h2 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  color: #d47cfa;
  margin: 0 auto;
  text-align: center;
}

.continue-playing-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.continue-playing-button {
  margin: 4px;
  text-align: center;
  width: 40%;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 92%;
  font-weight: bold;
  background-color: #ffef0a;
  color: #2a2a2a;
  box-shadow: 0.1rem 0.1rem #2a2a2a;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.reset-modal-button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.reset-modal-button {
  margin: 4px;
  text-align: center;
  width: 40%;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 92%;
  font-weight: bold;
  background-color: #ffef0a;
  color: #2a2a2a;
  box-shadow: 0.1rem 0.1rem #2a2a2a;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* end of reset modal */

.reset-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.reset-btn {
  margin: 2px;
  text-align: center;
  width: 240px;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 85%;
  font-weight: bold;
  background-color: #fffae6;
  color: #2a2a2a;
  box-shadow: 0.1rem 0.1rem #2a2a2a;
  cursor: pointer;
}

/* start of scoreboard area */
/* credit for scoreboard: https://github.com/Kathrin-ddggxh/CI-PP2_memory-card-game/tree/main */
.scores-container-1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 8px 0px 0px 0px;
}

.scores-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 6% 0% 8% 0%;
  font-weight: bold;
  background-color: #4d3b71;
  color: #ffef0a;
  border-radius: 14px;
  width: 68%;
  box-shadow: 0.2rem 0.2rem #0fff50;
}

.scores {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.score-heading {
  font-family: "Oxygen", sans-serif;
  margin-top: 5px;
  padding: 10px 4px 10px 4px;
  color: #ffef0a;
  font-weight: bolder;
  font-size: 126%;
}

.score-display-item {
  font-size: 90%;
  padding: 5px 8px 8px 8px;
  line-height: 25px;
}

.counter {
  color: #0fff50;
  font-weight: bolder;
  font-size: 115%;
}

.improved {
  padding: 2px 0px 18px 0px;
  font-size: 110%;
}

/* end of scoreboard area */

/* styling for using screen real estate */
.screen-game-compare-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

/* footer */
footer {
  background-color: #d47cfa;
}

.container-footer-divs {
  color: #000000;
  display: flex;
  justify-content: space-evenly;
  text-align: center;
  flex-wrap: wrap;
  border-top: 1px solid #000000;
}

.footer-divs p {
  display: flex;
  justify-content: center;
  padding: 1em;
  font-weight: bold;
}

.footer-logo-div {
  width: 12%;
}

/* credit for socials code: whisper rs portfolio project 1*/
.socials {
  text-align: center;
  padding: 12px;
  display: flex;
  justify-content: space-evenly;
  letter-spacing: 18px;
  list-style-type: none;
  color: #000000;
}

.socials i {
  font-size: 170%;
  color: #000000;
}

.footer-logo {
  max-width: 3rem;
  display: flex;
  justify-content: center;
  padding: 10% 8% 8% 8%;
}

.git-hub-div {
  font-size: 170%;
}

#timer-running,
#timer-end {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #ffef0a;
  font-family: "Oxygen", sans-serif;
  background: url(../images/background_tree_yf.webp) no-repeat center
    center/cover;
  position: absolute;
  width: 100%;
}

.timer-end-game-title,
.win-page-game-title {
  padding: 14% 0% 2% 0%;
}

#timer-running.hidden {
  animation: fadeOut 0.8s forwards;
}

#timer-end {
  display: none;
  opacity: 0;
}

#win-page {
  display: none;
  opacity: 0;
}

#timer-end.visible {
  display: flex;
  height: 150vh;
  animation: fadeIn 0.8s forwards 0.8s;
}

#win-page.visible {
  display: flex;
  height: 150vh;
  animation: fadeIn 0.8s forwards 0.8s;
  flex-direction: column;
  color: #ffef0a;
  font-family: "Oxygen", sans-serif;
  background: url(../images/background_tree_yf.webp) no-repeat center
    center/cover;
  position: absolute;
  width: 100%;
}

.time-out-container {
  display: flex;
  justify-content: center;
  height: 300px;
  padding-top: 130px;
}

.win-container {
  display: flex;
  justify-content: center;
  height: 300px;
  padding-top: 130px;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.retry-container {
  display: flex;
  justify-content: center;
  padding: 0px 10px 80px 10px;
}

.retry-btn {
  margin: 2px;
  text-align: center;
  width: 240px;
  border-radius: 8px;
  padding: 5px;
  margin: 8px 4px 0px 4px;
  font-size: 85%;
  font-weight: bold;
  background-color: #fffae6;
  color: #2a2a2a;
  box-shadow: 0.1rem 0.1rem #2a2a2a;
  cursor: pointer;
}

/* style for 404 page */
.error-container {
  text-align: center;
}

.error-heading {
  padding: 4% 3% 0% 3%;
}

.error-paragraph {
  padding: 1%;
  font-weight: bold;
}

.return-link-paragraph {
  padding: 0% 0% 1% 0%;
}

.return-link {
  color: #0fff50;
  font-weight: bold;
}

.error-image {
  width: 50%;
}

/* media query: tablets and larger (768px and up) */
@media screen and (min-width: 768px) {
  /* header */
  h1 {
    font-size: 200%;
    padding: 10% 6% 6% 6%;
  }

  .scores-container-1 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 60px 0px 0px 0px;
  }

  .scores-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2% 0% 1% 0%;
    font-weight: bold;
    background-color: #4d3b71;
    color: #ffef0a;
    border-radius: 14px;
    width: 68%;
    box-shadow: 0.2rem 0.2rem #0fff50;
  }

  .score-display-item {
    font-size: 90%;
    padding: 10px 8px 12px 8px;
    line-height: 25px;
  }

  .score-heading {
    font-family: "Oxygen", sans-serif;
    margin-top: 5px;
    padding: 18px 5px 10px 5px;
    color: #ffef0a;
    font-weight: bolder;
    font-size: 126%;
  }

  .improved {
    padding: 6px 0px 26px 0px;
    font-size: 110%;
  }

  .rules-modal-card {
    font-family: "Poppins", sans-serif;
    border: 0.8em solid #d47cfa;
    background-color: #fffae6;
    border-radius: 18px;
    padding: 5%;
    margin: 100px 140px 100px 140px;
    width: 78%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .rule-list li {
    font-family: Poppins, sans-serif;
    margin-bottom: 20px;
    color: black;
    text-align: center;
    list-style-type: none;
    line-height: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 96%;
  }

  .sure-modal-card {
    font-family: "Poppins", sans-serif;
    border: 0.8em solid #d47cfa;
    background-color: #fffae6;
    border-radius: 18px;
    padding: 5%;
    margin: 100px 140px 100px 140px;
    width: 78%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .timer-end-game-title,
  .win-page-game-title {
    padding: 8% 0% 2% 0%;
  }
}

/* large devices (laptops and desktops, 992px and up) */
@media screen and (min-width: 992px) {
  /* header */
  h1 {
    font-size: 220%;
    padding: 8% 6% 4% 6%;
  }

  .scores-container-1 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 60px 0px 0px 0px;
  }

  .scores-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2% 0% 1% 0%;
    font-weight: bold;
    background-color: #4d3b71;
    color: #ffef0a;
    border-radius: 14px;
    width: 68%;
    box-shadow: 0.2rem 0.2rem #0fff50;
  }

  .score-display-item {
    font-size: 94%;
    padding: 10px 6px 12px 6px;
    line-height: 25px;
  }

  .score-heading {
    font-family: "Oxygen", sans-serif;
    margin-top: 5px;
    padding: 18px 5px 10px 5px;
    color: #ffef0a;
    font-weight: bolder;
    font-size: 128%;
  }

  .improved {
    padding: 6px 0px 26px 0px;
    font-size: 112%;
  }

  .rules-modal-card {
    font-family: "Poppins", sans-serif;
    border: 0.8em solid #d47cfa;
    background-color: #fffae6;
    border-radius: 18px;
    padding: 5%;
    margin: 100px 140px 100px 140px;
    width: 78%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .rule-list li {
    font-family: Poppins, sans-serif;
    margin-bottom: 20px;
    color: black;
    text-align: center;
    list-style-type: none;
    line-height: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 96%;
  }

  .sure-modal-card {
    font-family: "Poppins", sans-serif;
    border: 0.8em solid #d47cfa;
    background-color: #fffae6;
    border-radius: 18px;
    padding: 5%;
    margin: 100px 140px 100px 140px;
    width: 78%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .timer-end-game-title,
  .win-page-game-title {
    padding: 8% 0% 2% 0%;
  }

  .footer-logo {
    max-width: 3rem;
    display: flex;
    justify-content: center;
    padding: 8% 6% 6% 6%;
  }
}

/* very large devices (large laptop screens and monitors, 1440px and up) */
@media screen and (min-width: 1440px) {
  /* header */
  h1 {
    font-size: 240%;
    padding: 6% 6% 2% 6%;
  }

  .footer-divs p {
    display: flex;
    justify-content: center;
    padding: 1em;
    font-weight: bold;
    font-size: 106%;
  }

  .scores-container-1 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 60px 0px 0px 0px;
  }

  .scores-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2% 0% 1% 0%;
    font-weight: bold;
    background-color: #4d3b71;
    color: #ffef0a;
    border-radius: 14px;
    width: 68%;
    box-shadow: 0.2rem 0.2rem #0fff50;
  }

  .score-display-item {
    font-size: 94%;
    padding: 10px 6px 12px 6px;
    line-height: 25px;
  }

  .score-heading {
    font-family: "Oxygen", sans-serif;
    margin-top: 5px;
    padding: 18px 5px 10px 5px;
    color: #ffef0a;
    font-weight: bolder;
    font-size: 128%;
  }

  .improved {
    padding: 6px 0px 26px 0px;
    font-size: 112%;
  }

  .rules-modal-card {
    font-family: "Poppins", sans-serif;
    border: 0.8em solid #d47cfa;
    background-color: #fffae6;
    border-radius: 18px;
    padding: 5%;
    margin: 100px 140px 100px 140px;
    width: 78%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .rule-list li {
    font-family: Poppins, sans-serif;
    margin-bottom: 20px;
    color: black;
    text-align: center;
    list-style-type: none;
    line-height: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 96%;
    font-size: 118%;
  }

  .sure-modal-card {
    font-family: "Poppins", sans-serif;
    border: 0.8em solid #d47cfa;
    background-color: #fffae6;
    border-radius: 18px;
    padding: 5%;
    margin: 100px 140px 100px 140px;
    width: 78%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .timer-end-game-title,
  .win-page-game-title {
    padding: 6% 0% 2% 0%;
  }

  .footer-logo {
    max-width: 3rem;
    display: flex;
    justify-content: center;
    padding: 6% 6% 6% 6%;
  }
}
