header {
  position: absolute;
}

.oracle {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20; /* ensure object is on top */
}

.forwards-oracle {
  animation: fly 4.5s linear;
}

.reversed-oracle {
  animation: fly 4.5s linear reverse;
  animation-fill-mode: forwards;
}

.oracle .message {
  border: 4px solid #fffb;
  background-color: var(--purple-low-opacity);
  border-radius: 32px;
  width: 320px;
  padding: 0 32px;
  min-height: 120px;

  color: #fff;
  text-align: center;

  font-size: 16px;
  font-weight: bold;

  /* center text */
  display: grid;
  place-items: center;
}

.oracle img {
  width: 180px;
  animation: 1.5s ease-in-out 0s infinite alternate float;
}

@keyframes fly{
  0%{
    transform: scale(2) translate(100vw,15vh);
  }
  20% {
    transform: scale(2) translate(0,15vh);
  }
  70%{
    transform: scale(2) translate(0,15vh);
  }
  100%{
    transform: scale(1) translate(0,0);
  }
}

.grid {
  display: flex;
  flex-direction: column;
  height: 100vh;
  align-items: center;
  overflow: hidden;
}

/****** Board related CSS ******/
/* board is a flex container */
.grid > .board {
  flex: 1;

  display: flex;
  justify-content: center;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: center;
  gap: 0.5%;
  row-gap: 0.5%;

  width: 100%;
  max-width: 1536px;
}

/*animations for hovering on cards*/
@keyframes card-animation {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.2);
  }
}

/* each card has width 10% of the window width */
.card-container {
  width: 8%;
  aspect-ratio: 0.6;
  position: relative;
  perspective: 1000px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.active-container::before {
  content: "";
  position: absolute;
  inset: -180px;
  background-image: radial-gradient(circle, #ff0 30%, transparent 50%);
  transform-origin: center;
  pointer-events: none;

  opacity: 0;
  scale: 0.4;
  transition: all 400ms ease-in-out;
}

.card-container:not(.flipped):hover::before {
  opacity: 0.4;
  scale: 1;
}

.card-container:not(.flipped):hover {
  /* animation: 0.7s ease-in-out 0s infinite alternate card-animation; */
  z-index: 10;
}

.tarot-card {
  height: 100%;
  transition: transform 600ms 50ms;
  transform-style: preserve-3d;
}

.active-container:hover .tarot-card {
  transform: rotateX(40deg) rotateY(-40deg) translateZ(40px) scale(1.1);
}

.flipped.card-container .tarot-card {
  transform: rotateX(179deg);
}

.flipped:not(.reversed).card-container .tarot-card {
  transform: rotateY(-179deg);
}

.tarot-card {
  pointer-events: none;
}

.tarot-card .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background-size: cover;
  background-position: center;
  transform: translateZ(1px);
}

.tarot-card .front {
  background-image: linear-gradient(#888, #ccc);
  transform: rotateY(180deg);
}

.tarot-card .back {
  background-image: url("../assets/images/cardback.png");
}

/********** Player **************/
.player {
  width: 100%;
  max-width: 600px;
  height: 100px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.player .bars {
  flex: 1;
}

.luck-bar,
.oscillating-bar {
  height: 24px;
  position: relative;
  font-family: "Mystery Quest", cursive, serif;
}

.luck-bar {
  background-color: #0905;
}

.luck-bar .fill {
  background-color: #090;
  height: 100%;
  transition: width 0.3s;
}

/**** Oscillating bar ****/
.oscillating-bar {
  background-color: #d555;
  margin-top: 8px;
}

.oscillating-bar .fill {
  background-color: #d55;
  height: 100%;
  animation: 0.7s linear 0s infinite alternate oscillate;
}

.label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Mobile Display */
@media only screen and (max-width: 600px) {
  .board > .card-container {
    width: 15%;
    height: auto;
  }

  .oracle {
    transform: scale(0.75);
  }

  .oracle .message {
    width: 50%;
  }

  @keyframes fly{
    0%{
      transform: translate(100vw,35vh);
    }
    20% {
      transform: translate(0,35vh);
    }
    70%{
      transform: translate(0,35vh);
    }
    100%{
      transform: scale(0.75) translate(0,0);
    }
  }

  #how_to_button {
    display: none;
  }

  #back-btn {
    display: none;
  }

  header{
    display: none;
  }

  .player {
    width: 90%;
  }
}

@keyframes oscillate {
  0% {
    width: 15%;
  }

  100% {
    width: 85%;
  }
}

@keyframes float {
  0% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(8px);
  }
}

#profile_image {
  width: 5rem;
  padding: 0.5rem;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  color: transparent;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: all 0.3s ease;
  border: 2px solid var(--white);
}

/* instructions */
.buttons {
  position: fixed;
  bottom: 0%;
  right: 0%;
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 1rem;
}

#how_to_modal ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  list-style-type: none;
}

@media (max-width: 62em) {
  .buttons {
    display: none;
  }
  .content {
    display: none;
  }
}
