:root {
  --h2-font-primary: "Jersey 10", sans-serif;
  --h2-font-size: 3rem;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  transition-behavior: smooth;
}
body {
  /* display: flex; */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  position: relative;
}
img {
  height: 100%;
}
h2 {
  font-family: var(--h2-font-primary);
  font-size: var(--h2-font-size);
}
p {
  line-height: 1.4;
  font-family: "Questrial", sans-serif;
}
#game-container {
  display: flex;
  flex-wrap: wrap;
  height: 100%;
  width: 100%;
  background-image: linear-gradient(
    #4bc7cf,
    #3cb7cb,
    #2da7c7,
    #1e97c4,
    #0f7ac0,
    #0771b8
  );
  position: relative;
  overflow: hidden;
}
#swimmer {
  /* top: 10%;
  left: 8%; */
  position: absolute;
  height: 100px;
  width: 100px;
  transition: all 0.1s ease;
  display: inline-block;
}
#shark {
  /* position: relative; */
  top: 50%;
  left: 30%;
  animation: left-right 10s infinite linear;
}
@keyframes left-right {
  0% {
    transform: translateX(0) scaleX(1);
  }
  49% {
    transform: translateX(400%) scaleX(1);
  }
  50% {
    transform: translateX(400%) scaleX(-1);
  }
  99% {
    transform: translateX(0) scaleX(-1);
  }
  100% {
    transform: translateX(0) scaleX(1);
  }
}
#ship {
  top: 20%;
  left: 60%;
  animation: left-right 35s infinite linear;
}
#floatie {
  top: 89%;
  left: 95%;
  transition: all 0.5s ease;
  animation: go-around 15s 1s infinite alternate-reverse;
  transform-origin: center center;
}
@keyframes go-around {
  /* bottom-right corner */
  0% {
    top: 89%;
    left: 94%;
    transform: rotate(0deg);
  }
  /* bottom-left corner */
  25% {
    top: 89%;
    left: 0%;
    transform: rotate(90deg);
  }
  /* top-left */
  50% {
    top: 89%;
    left: 94%;
    transform: rotate(180deg);
  }
  /* top-right corner */
  75% {
    top: 0%;
    left: 94%;
    transform: rotate(270deg);
  }
  /* back to bottom-right corner */
  100% {
    top: 89%;
    left: 94%;
    transform: rotate(360deg);
  }
}
/* @keyframes go-around {
  bottom-right corner
  0% {
    top: 89%;
    left: 95%;
    transform: rotate(0deg);
  }
  bottom-left corner
  25% {
    top: 89%;
    left: 75%;
    transform: rotate(90deg);
  }
  top-left
  50% {
    top: 55%;
    left: 75%;
    transform: rotate(180deg);
  }
  top-right corner
  75% {
    top: 55%;
    left: 95%;
    transform: rotate(270deg);
  }
  back to bottom-right corner
  100% {
    top: 89%;
    left: 95%;
    transform: rotate(360deg);
  }
} */
#left-waves {
  top: 20%;
  left: 15%;
  /* animation don't do anything here */
  animation: fade-in-out 9s ease-in-out infinite,
    teleport 10s infinite ease-in-out;
  transition: visibility 0s allow-discrete; /* syncs visibility with opacity */
}
/* display: none is non-animatable */
/* fade-in, stay visible, then hidden */
/* animate opacity + visibility -->> a discrete propert */
@keyframes fade-in-out {
  0% {
    opacity: 0;
    visibility: hidden; /* not clickable */
  }
  0% {
    opacity: 0;
    visibility: hidden; /* not clickable */
  }
  10% {
    opacity: 1;
    visibility: visible; /* not clickable */
  }
  30% {
    opacity: 1;
    visibility: visible; /* not clickable */
  }
  40% {
    opacity: 0;
    visibility: hidden; /* not clickable */
  }
  60% {
    opacity: 0;
    visibility: hidden; /* not clickable */
  }
  70% {
    opacity: 1;
    visibility: visible;
  }
  80% {
    opacity: 1;
    visibility: visible;
  }
  90% {
    opacity: 0;
    visibility: hidden;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}
@keyframes teleport {
  0% {
    transform: translateY(0);
  }
  10% {
    transform: translateY(100px);
  }
  30% {
    transform: translateY(200px);
  }
  40% {
    transform: translateY(300px);
  }
  60% {
    transform: translateY(400px);
  }
  70% {
    transform: translateY(300px);
  }
  80% {
    transform: translateY(200px);
  }
  90% {
    transform: translateY(100px);
  }
  100% {
    transform: translateY(0);
  }
}
#right-waves {
  top: 20%;
  left: 20.7%;
  animation: fade-in-out 9s ease-in-out infinite,
    teleport 10s infinite ease-in-out;
  transition: visibility 0s allow-discrete;
}
.colliding {
  border-radius: 50%;
  background-color: #e6e6e6ab;
}
.npc-box {
  height: 100px;
  width: 100px;
  display: inline-block;
  position: absolute;
}
#top-wall {
  top: -5%;
  height: 5%;
  width: 100%;
  /* background-color: #4ac5cf; */
  background-color: black;
  position: fixed;
  display: block;
}
#bottom-wall {
  height: 5%;
  width: 100%;
  /* background-color: #0973ba; */
  background-color: black;
  position: fixed;
  display: block;
  bottom: -5%;
}
#left-wall {
  height: 100%;
  width: 5%;
  /* background-color: #4ac5cf; */
  background-color: black;
  position: fixed;
  display: block;
  left: -5%;
}
#right-wall {
  height: 100%;
  width: 5%;
  /* background-color: #4ac5cf; */
  background-color: black;
  position: fixed;
  display: block;
  right: -5%;
}
#welcome-dialog {
  border: none;
  border-radius: 10px;
  outline: none;
  /* align-self: center; */
  justify-self: center;
  width: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
#welcome-dialog::backdrop {
  background-image: linear-gradient(
    #4bc7cf,
    #3cb7cb,
    #2da7c7,
    #1e97c4,
    #0f7ac0,
    #0771b8
  );
}
#welcome-container {
  display: flex;
  justify-content: space-evenly;
}
#start-btn {
  display: inline-block;
  padding: 0.6rem;
  font-family: "Jersey 10", sans-serif;
  font-size: 2rem;
  border-radius: 5px;
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  color: #666666;
}
#start-btn:hover {
  transform: scale(1.2);
  background-color: #d7d7d7;
  color: #000;
  box-shadow: 0 5px 5px #999999;
}
.welcome-left {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  flex-direction: column;
  width: 60%;
  justify-content: space-evenly;
}
.welcome-right {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  gap: 0.8rem;
}
#status-dialog {
  position: absolute;
  bottom: 0;
  height: 10%;
  overflow-y: auto;
  background-color: transparent;
  padding: 0.3rem;
  border: none;
  color: rgba(255, 255, 255, 0.568);
}
.start-span,
.arrow-span {
  font-family: var(--h2-font-primary);
  font-size: 1.2rem;
  color: #666666;
}
.start-span:focus {
  outline: #d7d7d7;
}
.keep-swimming {
  font-family: var(--h2-font-primary);
  color: #2099c5;
  font-size: 1.3rem;
}
