/* Google Fonts Import */

.uncial-antiqua-regular {
  font-family: "Uncial Antiqua", system-ui;
  font-weight: 400;
  font-style: normal;
}

.libre-baskerville-regular {
  font-family: "Libre Baskerville", serif;
  font-weight: 400;
  font-style: normal;
}

/* Main Style */

body {
  margin: 0;
  padding: 0;
  background-color: #fdf4ce;
  font-family: "Libre Baskerville", serif;
  color: #2b464f;
  min-height: 100vh;
  position: relative;
  padding: 40px 20px;
  overflow: hidden;
}

header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

/* Hero/ Background Image */

#background-image {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background-image: url("../images/transparentbg.webp");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center bottom;
  z-index: -1;
}

/* Headings */

h1 {
  font-family: "Uncial Antiqua", system-ui;
  font-size: 5rem;
  color: #a97e10;
  text-shadow: 1px 4px #fdeca6;
  margin: -1.8rem 0 -0.95rem 0;
}

h2 {
  font-family: "Uncial Antiqua", system-ui;
  font-size: 1.8rem;
  color: #a97e10;
  margin: -0.75rem 0 2.2rem;
}

h3 {
  text-align: center;
  font-family: "Uncial Antiqua", system-ui;
  color: #fff;
  background-color: goldenrod;
  border-radius: 5px;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  min-width: 290px;
  padding: 8px 6px;
  max-width: 625px;
  margin-top: -10px;
  background-image: linear-gradient(to right, goldenrod, #a97e10);
}

/* Custom Scroll Bar */
/* Tutorial Credit: W3 Schools - https://www.w3schools.com/howto/howto_css_custom_scrollbar.asp */

/* width */

::-webkit-scrollbar {
  width: 5px;
}

/* Track */

::-webkit-scrollbar-track {
  box-shadow: inset 0 0 3px goldenrod;
  border-radius: 2px;
}

/* Handle */

::-webkit-scrollbar-thumb {
  background: white;
  border-radius: 3px;
}

/* Buttons */

#buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#quiz-button {
  background-color: goldenrod;
  background-image: linear-gradient(to right, goldenrod, #a97e10);
  color: #fff;
  font-family: "Libre Baskerville", serif;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 45px;
  width: 160px;
  margin-top: 20px;
}

#quiz-button-instructions {
  background-color: #d96b62;
  background-image: linear-gradient(to right, #ee7a6c, #d6594f);
  color: #fff;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 #d96b62;
  font-family: "Libre Baskerville", serif;
  text-shadow: 1px 1px black;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 45px;
  width: 160px;
  margin: 0;
}

#tarot-reading-button {
  background-color: goldenrod;
  color: #fff;
  font-family: "Libre Baskerville", serif;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 45px;
  width: 160px;
  margin-top: 15px;
}

#reading-button {
  background-color: #d96b62;
  background-image: linear-gradient(to right, #ee7a6c, #d6594f);
  color: #fff;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 #d96b62;
  text-shadow: 1px 1px black;
  font-family: "Libre Baskerville", serif;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 45px;
  width: 160px;
  margin-top: 50px;
}

#quiz-button-back {
  background-color: goldenrod;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  color: #fff;
  text-shadow: 1px 1px black;
  font-family: "Libre Baskerville", serif;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 40px;
  width: 76px;
  margin: -5px 0 0 0;
}

#play-again-button {
  background-color: goldenrod;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  color: #fff;
  font-family: "Libre Baskerville", serif;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 40px;
  width: 76px;
  margin-right: 0.5px;
}

#next-question-button {
  background-color: goldenrod;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  font-family: "Libre Baskerville", serif;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 40px;
  width: 76px;
  margin: -3px 0 0 -2px;
}

#next-question-button:hover {
  background-color: #a97e10;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
}

.draw-button {
  height: 40px;
  width: 91px;
  margin-left: 3px;
  background-color: #7f75b2;
  background-image: linear-gradient(to right, #7c75af, #544287);
  text-shadow: 1px 1px black;
}

.draw-button:hover {
  background-color: #ff9ea9;
  text-shadow: 1px 1px black;
}

button {
  background-color: #7f75b2;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  color: #fff;
  font-family: "Libre Baskerville", serif;
  font-weight: bold;
  border-radius: 5px;
  border: 0px;
  height: 40px;
  width: 240px;
  margin: 10px 5px 0 5px;
}

button:hover {
  background-color: #ff9ea9;
  text-shadow: 1px 1px black;
}

#toggle-audio {
  height: 40px;
  width: 76px;
  background-color: goldenrod;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  color: #fff;
  margin: -3px 1px 0 1px;
}

.navigation {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
}

/* Tarot Reading Section */
/* Tarot Reading Instructions */

#tarot-reading {
  position: fixed;
  top: 148px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fdf4ce;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#reading-instructions-container {
  position: fixed;
  top: 136px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fdf4ce;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: auto;
}

#reading-instructions-container > h3 {
  margin-top: 0;
}

#reading-instructions-content {
  width: 90%;
  max-width: 310px;
  height: auto;
  background-color: rgb(246, 244, 244);
  border-radius: 5px;
  box-shadow: 0 0 0 2px goldenrod, 8px 8px 0 0 goldenrod;
  margin-top: -5px;
}

#reading-instructions-content > h4 {
  margin-left: 8%;
}

#reading-instructions-content > li {
  margin-left: 10px;
}

#reading-instructions-image {
  background-color: #fdeca6;
  padding-top: 15px;
  display: flex;
  justify-content: center;
  border-top-left-radius: 40%;
  border-top-right-radius: 40%;
}

#reading-instructions-image > img {
  height: 135px;
  width: auto;
}

#draw-span,
#redraw-span,
#exit-span {
  background-color: #7f75b2;
  color: white;
  border-radius: 5px;
  border: 1px solid goldenrod;
  padding: 4px;
}

/* Tarot Reading */

#tarot-draw {
  display: flex;
  position: fixed;
  top: 148px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fdf4ce;
  z-index: 90;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: auto;
}

#draw-container {
  position: fixed;
  top: 136px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fdf4ce;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: auto;
}

#draw-container > h3 {
  background-color: #7f75b2;
  background-image: linear-gradient(to right, #7c75af, #544287);
  margin-top: 0;
}

#tarot-deck {
  position: relative;
  text-align: center;
  margin: -2px 10px 15px 10px;
  height: 350px;
  width: auto;
  border-radius: 15px;
  box-shadow: 0 0 0 1px #7f75b2, 6px 6px 0 0 #ff9ea9;
  background-color: #7f75b2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

#tarot-deck img {
  height: 350px;
  width: auto;
}

/* Tutorial credit: W3 Schools - https://www.w3schools.com/howto/howto_css_shake_image.asp */

#tarot-deck:active {
  animation: shake 0.5s;
  animation-iteration-count: infinite;
}

@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

#tap-meaning {
  text-align: center;
  font-family: "Uncial Antiqua", system-ui;
  color: #fff;
  background-color: goldenrod !important;
  background-image: linear-gradient(to right, goldenrod, #a97e10) !important;
  border-radius: 45px;
  box-shadow: 0 0 0 1px #fff, 4px 4px 0 0 goldenrod;
  text-shadow: 1px 1px black;
  min-width: 250px;
  padding: 8px 6px;
  max-width: 625px;
  margin: -1px 0 2px 0;
}

/* Tarot Reading Flip Cards */
/* Tutorial credit: https://www.w3schools.com/howto/howto_css_flip_card.asp */

.card-container {
  perspective: 1000px;
}

.card {
  width: 203px;
  height: 350px;
  position: relative;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.cardFront,
.cardBack {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
}

.cardFront {
  z-index: 2;
  background-color: transparent;
}

.cardFront img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 15px;
}

.cardBack {
  background-color: rgb(246, 244, 244);
  transform: rotateY(180deg);
  box-shadow: 0 0 0 1px #7f75b2, 6px 6px 0 0 #ff9ea9;
  border-radius: 15px;
  border: 0.5px solid #8281fd;
}

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

.meaning-container {
  display: none;
  margin: 0 10px;
  font-weight: bold;
  padding-top: 15px;
}

.meaning-container.show {
  display: block;
}

#meaning-image {
  height: 55px;
  width: auto;
  background-color: #f8c6e3;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
}

#meaning-image > img {
  height: 55px;
  width: auto;
}
/* Tarot Quiz Section */
/* Tarot Quiz Layout */

#tarot-quiz {
  position: fixed;
  top: 148px;
  left: 0;
  right: 0;
  bottom: 0;
  padding-top: 18px;
  margin-top: -10px;
  background-color: #fdf4ce;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: auto;
}

/* Box shadow code: https://htmlcssfreebies.com/css-box-shadow-examples/ */

#quiz-container {
  position: relative;
  text-align: center;
  padding: 10px;
  margin: 0 10px 22px 10px;
  max-width: 290px;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 0 0 2px goldenrod, 6px 6px 0 0 goldenrod;
  background-color: rgb(246, 244, 244);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* Quiz Instructions */
#quiz-instructions {
  position: fixed;
  top: 148px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fdf4ce;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

#instructions-container {
  position: fixed;
  top: 136px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fdf4ce;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: auto;
}

#instructions-container > h3 {
  margin-top: 0;
}

#instructions-content {
  width: 90%;
  max-width: 310px;
  height: auto;
  background-color: rgb(246, 244, 244);
  border-radius: 5px;
  box-shadow: 0 0 0 2px goldenrod, 8px 8px 0 0 goldenrod;
}

h4 {
  text-align: left;
  font-weight: bolder;
  padding-left: 20px;
  margin-top: 8px;
}

ul {
  margin-top: -14px;
}

li {
  line-height: 24px;
  margin-left: -6px;
  padding-right: 2px;
}

.instructions-span {
  background-color: #7f75b2;
  color: white;
  border-radius: 5px;
  border: 1px solid goldenrod;
  padding: 4px;
}

/* Tutorial Credit: Stack Overflow: "Can I set an opacity only to the background image of a div?" */

#quiz-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("../images/quizbg.webp");
  background-color: #fff;
  background-size: contain;
  opacity: 0.2;
  z-index: 0;
}

#quiz-container div,
#quiz-container button {
  position: relative;
  z-index: 1;
}

.hidden {
  display: none;
}

/* Tarot Quiz Functionality */

#questions {
  margin-top: 5px;
  font-weight: bolder;
}

/* Code base for correct answer animation: https://www.sliderrevolution.com/resources/css-button-hover-effects/ */

#answers {
  margin: 5px 0;
  transition: transform 0.2s ease;
}

#points {
  background-image: none !important;
}

#quiz-results {
  position: relative;
  margin: 5px 0;
  min-height: 260px;
  max-width: 290px;
  overflow: hidden;
}

/* Tutorial: https://www.w3schools.com/Css/css3_2dtransforms.asp */

#results-image {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-height: 145px;
  z-index: -5;
  margin-top: -10px;
  margin-bottom: -10px;
}

#results-blurb {
  margin-top: 9px;
  width: 290px;
  height: 235px;
}

.correct {
  font-weight: bold;
  animation: pulse 0.9s ease;
}

/* Pulse effect for incorrect answers */

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.incorrect {
  text-decoration: line-through;
  animation: pulse 0.2s ease;
}

/* Misc. Text Effects */

/* Glow Effect for header */
@-webkit-keyframes glow {
  from {
    text-shadow: 0 0 5px #fdf4ce, 0 0 10px #fdf4ce, 0 0 15px #fde48096,
      0 0 20px #fff, 0 0 25px #fde380, 0 0 30px #fff, 0 0 35px #fff;
  }
  to {
    text-shadow: 0 0 10px #fdf4ce, 0 0 15px #fdf4ce, 0 0 20px #fde48089,
      0 0 25px #fde380, 0 0 30px #fff, 0 0 35px #fff, 0 0 40px #fde380;
  }
}

.h2glow {
  -webkit-animation: glow 2s ease-in-out infinite alternate;
  -moz-animation: glow 2s ease-in-out infinite alternate;
  animation: glow 2s ease-in-out infinite alternate;
}

/* Media Queries */
/* Media query: Mobile phones (375px and below) */

@media (max-width: 374px) {
  #next-question-button {
    margin-bottom: 20px;
  }

  #tarot-quiz {
    margin-top: 0px;
    padding-top: 10px;
  }
}

/* Media query: Mobile devices 424px and wider */
@media (min-width: 424px) {
  #reading-button {
    margin-top: 40px;
  }
}

@media (min-width: 700px) {
  .meaning-container {
    display: block;
    margin-top: 10px;
  }
}

/* Media query: Tablets and larger (768px and above) */
@media (min-width: 767px) {
  #reading-button {
    margin-top: 45px;
  }
}

@media (min-width: 1023px) {
  h1 {
    font-size: 5rem;
    margin-top: -35px;
  }

  h2 {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  h3 {
    margin-top: -10px;
  }

  #tarot-quiz {
    margin-top: 5px;
  }

  #instructions-container {
    margin-top: 20px;
  }

  #reading-instructions-container,
  #draw-container {
    margin-top: 5px;
  }
}

/* Media Query: Screens heights less than 580px */

@media (max-height: 580px) {
  #reading-button {
    margin-top: -15px;
  }
}

/* Media Query: Screens taller than 750px */

@media (min-height: 750px) {
  h1 {
    margin-top: -20px;
  }

  #reading-instructions-container > h3,
  #draw-container > h3 {
    margin-top: 20px;
  }
}

/* Media Query: Small laptops */

@media (min-width: 1439px) and (max-height: 991px) {
  h1 {
    margin-top: -20px;
    font-size: 6rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  #reading-button {
    margin-top: 20px;
    height: 60px;
    width: 180px;
  }

  #quiz-button-instructions {
    height: 60px;
    width: 180px;
  }

  #quiz-button {
    height: 45px;
    width: 180px;
  }

  #quiz-instructions,
  #reading-instructions-container,
  #tarot-reading,
  #tarot-draw,
  #draw-container {
    top: 170px;
  }

  #instructions-container {
    top: 190px;
  }

  #tarot-quiz {
    top: 195px;
  }

  #quiz-container {
    margin-top: 5px;
  }

  #points {
    margin-top: 10px;
  }
}

/* Media Query: Large Laptops */

@media (min-height: 991px) {
  h1 {
    font-size: 7rem;
    margin-top: 50px;
  }

  h2 {
    font-size: 2.75rem;
  }

  #reading-button {
    margin-top: 50px;
    height: 60px;
    width: 180px;
  }

  #quiz-button-instructions {
    height: 60px;
    width: 180px;
  }

  #quiz-button {
    height: 45px;
    width: 180px;
  }

  #quiz-instructions,
  #reading-instructions-container,
  #tarot-reading,
  #tarot-draw,
  #draw-container {
    top: 275px;
  }

  #instructions-container {
    top: 290px;
  }

  #tarot-quiz {
    top: 295px;
    margin-top: 40px;
    transform: scale(1.2);
  }

  #quiz-container {
    margin-top: 5px;
  }

  #points {
    margin-top: 10px;
  }
}

/* Media Queries: Landscape mode */
@media (max-width: 767px) and (orientation: landscape) {
  html,
  body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #card-name {
    margin-top: -40px;
  }

  h1,
  h2 {
    position: fixed;
  }

  h1 {
    top: 8px;
  }

  h2 {
    top: 70px;
  }

  #buttons {
    position: fixed;
    top: 110px;
    left: 38%;
  }

  #reading-instructions-container,
  #draw-container,
  #instructions-container {
    top: 92px;
  }

  #tarot-quiz {
    top: 103px;
  }

  #reading-instructions-container > h3,
  #draw-container > h3,
  #instructions-container > h3 {
    margin-top: 10px;
  }

  #tarot-deck {
    margin-top: -1px;
    margin-bottom: 4px;
  }
}
