* {
  margin: 0;
  padding: 0;
  overflow-y: hidden;
}

html {
  display: flex;
  justify-content: center;
  background-color: black;
}

body {
  position: relative;
  min-width: 524px;
}

/* BUTTONS */
#start-button,
#restart-button {
  position: absolute;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #ffa12b;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 55px;
  border: 5px solid black;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
}

#start-button:active,
#restart-button:active {
  background-color: #f78900;
  -webkit-box-shadow: inset 0 1px 0 #ffe5c4, inset 0 -3px 0 #915100;
  -moz-box-shadow: inset 0 1px 0 #ffe5c4, inset 0 -3pxpx 0 #915100;
  box-shadow: inset 0 1px 0 #ffe5c4, inset 0 -3px 0 #915100;
  border: 5px solid black;
}

#start-button {
  background-image: url("../images/play.png");
  top: 35%;
  width: 145px;
}

#restart-button {
  background-image: url("../images/restart.png");
  top: 70%;
  width: 215px;
}

/* MENU */
#game-intro {
  display: inherit;
}

.title-ironhack {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.title-samurai {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.samurai {
  position: absolute;
  top: 67.5%;
  left: 25.3%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 188px;
}

/* GAME SCREEN */
#game-screen {
  display: none;
}

.samurai_attack_left {
  animation-name: attack_left;
  animation-duration: 0.08s;
}

.samurai_attack_right {
  animation-name: attack_right;
  animation-duration: 0.08s;
}

#timer-container {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 40px;
  background-color: black;
  border: 8px solid gold;
  box-shadow: 0 5px 50px black;
  z-index: 2;
}

.tilt-move {
  animation: tilt-n-move 0.15s infinite;
}

#timer-bar {
  height: 100%;
  background-color: red;
}

#bamboo-container {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  position: absolute;
  top: 37.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 700px;
  width: 450px;
}

#animation-container {
  display: flex;
  flex-direction: column-reverse;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%);
  height: 100%;
  width: 99%;
  overflow-x: clip;
  overflow-y: clip;
}

.spinAwayRight {
  position: absolute;
  top: 60%;
  left: 10%;
  animation: spinAwayRight 1s linear;
}

.spinAwayLeft {
  position: absolute;
  top: 60%;
  animation: spinAwayLeft 1s linear;
}

@keyframes spinAwayRight {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(25%) translateY(-50px) rotate(-180deg);
    opacity: 1;
  }
  50% {
    transform: translateX(50%) translateY(100px) rotate(-360deg);
  }
  75% {
    transform: translateX(75%) translateY(200px) rotate(-540deg);
  }
  100% {
    transform: translateX(100%) translateY(250px) rotate(-720deg);
    opacity: 0;
  }
}

@keyframes spinAwayLeft {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-25%) translateY(-50px) rotate(180deg);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(100px) rotate(360deg);
  }
  75% {
    transform: translateX(-75%) translateY(200px) rotate(540deg);
  }
  100% {
    transform: translateX(-100%) translateY(250px) rotate(720deg);
    opacity: 0;
  }
}

#score-container {
  display: flex;
  justify-content: center;
  position: absolute;
  width: 100%;
  height: 50px;
  top: 88%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#score {
  position: absolute;
  top: 85%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes tilt-n-move {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  25% {
    transform: translate(-55%, -55%) rotate(5deg);
  }
  50% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  75% {
    transform: translate(-55%, -55%) rotate(-5deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
}

@keyframes attack_left {
  0% {
    content: url("../images/character/left/attack_3_left.png");
  }
  20% {
    content: url("../images/character/left/attack_4_left.png");
  }
  40% {
    content: url("../images/character/left/attack_5_left.png");
  }
  60% {
    content: url("../images/character/left/attack_6_left.png");
  }
  80% {
    content: url("../images/character/left/attack_7_left.png");
  }
  100% {
    content: url("../images/character/left/attack_0_left.png");
  }
}

@keyframes attack_right {
  0% {
    content: url("../images/character/right/attack_3_right.png");
  }
  20% {
    content: url("../images/character/right/attack_4_right.png");
  }
  40% {
    content: url("../images/character/right/attack_5_right.png");
  }
  60% {
    content: url("../images/character/right/attack_6_right.png");
  }
  80% {
    content: url("../images/character/right/attack_7_right.png");
  }
  100% {
    content: url("../images/character/right/attack_0_right.png");
  }
}

/* END SCREEN */
#game-end {
  display: none;
}

#game-over {
  position: absolute;
  width: 450px;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#leaderboard {
  position: absolute;
  flex-direction: column;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  font-weight: 700;
  font-family: "Nanum Brush Script", cursive;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-image: url("../images/scroll.png");
  background-repeat: no-repeat;
  background-position: center;
  width: 452px;
  height: 312px;
}

@media (max-width: 524px) {
  body {
    width: 100%;
  }
}
