/* Menu */
body {
  overflow: hidden;
  margin: 0;
}

video {
  left: -1px;
  top: 0;
  width: 101vw;
  height: 100vh;
  position: absolute;
  object-fit: cover;
  z-index: -1;
}

* {
  font-family: "Luckiest Guy", cursive;
  font-weight: 400;
  font-style: normal;
}

/* menu */
#menu {
  display: flex;
  justify-content: space-evenly;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

#menu img {
  width: 400px;
  margin-top: -40px;
}

#menu .menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#menu .menu-buttons .play {
  background-image: url("assets/button/play.png");
  background-size: cover;
  background-position: center;
  transform: scaleX(1.2);
}

#menu .menu-buttons .play:hover {
  transform: scalex(1.3);
}

#menu .menu-buttons .about {
  background-image: url("assets/button/about.png");
  background-size: cover;
  background-position: center;
}
#menu .menu-buttons .score {
  background-image: url("assets/button/score.png");
  background-size: cover;
  background-position: center;
}

#menu .menu-btn {
  width: 200px;
  height: 20px;
  padding: 15px;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #fff;
}

#menu .menu-btn:hover {
  transform: scale(1.05);
}

/* game */
#game {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: none;
}

#player {
  position: absolute;
  width: 90px;
  height: 130px;
  background-position: left center;
  background-image: url("assets/hero/Attacking/Wraith_01_Attack_000.png");
  background-size: cover;
  background-repeat: no-repeat;
  bottom: 50%;
  left: 20px;
  transform: translateY(50%);
  animation: idle 0.7s infinite;
}

#enemy {
  position: absolute;
  width: 100px;
  height: 130px;
  background-position: left center;
  background-image: url("assets/enemy/Idle/Wraith_03_Idle_000.png");
  background-size: cover;
  background-repeat: no-repeat;
  bottom: 50%;
  right: 20px;
  transform: translateY(50%);
  transform: scalex(-1);
  animation: idleenemy 0.7s infinite;
}

#health-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  border: black 2px solid;
  border-radius: 5px;
  height: 30px;
  background-color: #000;
  overflow: hidden;
}


#health-bar .health {
  width: 100%;
  height: 100%;
  background-color: green;
}

.bullet {
  position: absolute;
  width: 40px;
  height: 40px;
  background-image: url("assets/meteor1.png");
  transform: rotate(90deg);
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 50%;
}

/* button */
.control {
  display: none;
}
.control-btn {
  position: absolute;
  width: 70px;
  height: 70px;
  bottom: 40px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  cursor: pointer;
  color: white;
}

.control-btn p{
  margin-top: 80px;
}

#up-btn {
  background-image: url("assets/etas.png");
  background-size: cover;
  right: 120px;
}

#down-btn {
  background-image: url("assets/down.png");
  background-size: cover;
  right: 20px;
}

#attack-btn {
  background-image: url("assets/skill.png");
  background-size: cover;
  left: 20px;
}

/* game over */
.popup {
  visibility: hidden;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 15, 15, 0.9);
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.popimg {
  position: relative;
  margin-top: 30px;
  background-size: cover;
  height: 500px;
  width: 530px;
  z-index: 99;
  animation: popu 2s alternate;
}

.popimg a {
  text-align: center;
  width: 80px;
  background-color: rgb(255, 200, 98);
  border: solid 4px darkgoldenrod;
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-51%);
  text-decoration: solid;
  color: darkorange;
  padding: 20px 5px;
  border-radius: 20px;
}

@keyframes attack {
  0% {
    background-image: url("assets/hero/Attacking/Wraith_01_Attack_000.png");
  }
  20% {
    background-image: url("assets/hero/Attacking/Wraith_01_Attack_002.png");
  }
  40% {
    background-image: url("assets/hero/Attacking/Wraith_01_Attack_004.png");
  }
  60% {
    background-image: url("assets/hero/Attacking/Wraith_01_Attack_006.png");
  }
  80% {
    background-image: url("assets/hero/Attacking/Wraith_01_Attack_008.png");
  }
  100% {
    background-image: url("assets/hero/Attacking/Wraith_01_Attack_010.png");
  }
}

@keyframes idle {
  0% {
    background-image: url("assets/hero/Idle/Wraith_01_Idle_000.png");
  }
  20% {
    background-image: url("assets/hero/Idle/Wraith_01_Idle_002.png");
  }
  40% {
    background-image: url("assets/hero/Idle/Wraith_01_Idle_004.png");
  }
  60% {
    background-image: url("assets/hero/Idle/Wraith_01_Idle_006.png");
  }
  80% {
    background-image: url("assets/hero/Idle/Wraith_01_Idle_008.png");
  }
  100% {
    background-image: url("assets/hero/Idle/Wraith_01_Idle_010.png");
  }
}

@keyframes died {
  0% {
    background-image: url("assets/hero/Idle/Wraith_01_Idle_000.png");
  }
  100% {
    background-image: url("assets/hero/Dying/Wraith_01_Dying_000.png");
  }
}

@keyframes attackenemy {
  0% {
    background-image: url("assets/enemy/Attacking/Wraith_03_Attack_000.png");
  }
  20% {
    background-image: url("assets/enemy/Attacking/Wraith_03_Attack_002.png");
  }
  40% {
    background-image: url("assets/enemy/Attacking/Wraith_03_Attack_004.png");
  }
  60% {
    background-image: url("assets/enemy/Attacking/Wraith_03_Attack_006.png");
  }
  80% {
    background-image: url("assets/enemy/Attacking/Wraith_03_Attack_008.png");
  }
  100% {
    background-image: url("assets/enemy/Attacking/Wraith_03_Attack_010.png");
  }
}

@keyframes idleenemy {
  0% {
    background-image: url("assets/enemy/Idle/Wraith_03_Idle_000.png");
  }
  20% {
    background-image: url("assets/enemy/Idle/Wraith_03_Idle_002.png");
  }
  40% {
    background-image: url("assets/enemy/Idle/Wraith_03_Idle_004.png");
  }
  60% {
    background-image: url("assets/enemy/Idle/Wraith_03_Idle_006.png");
  }
  80% {
    background-image: url("assets/enemy/Idle/Wraith_03_Idle_008.png");
  }
  100% {
    background-image: url("assets/enemy/Idle/Wraith_03_Idle_010.png");
  }
}

@keyframes diedenemy {
  0% {
    background-image: url("assets/enemy/Idle/Wraith_03_Idle_000.png");
  }
  100% {
    background-image: url("assets/enemy/Dying/Wraith_01_Dying_000.png");
  }
}

@keyframes muncul {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@media screen and (max-width: 768px) {
  #player, #enemy {
      width: 50px;
      height: 70px;
  }

  .bullet {
      width: 15px;
      height: 15px;
  }
  #menu img {
    width: 300px;
    margin-top: -40px;
  }
  
 
  
  #menu .menu-btn {
    width: 150px;
    height: 10px;
    padding: 15px;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #fff;
  }
  .popimg {
    width: 100%;
    background-size: cover;
    background-repeat: norepeat;
  }
  .control-btn p{
    visibility: hidden;
    display: none;
  }
}
