/* Global Styles */
*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
}

html {
  font-family: Arial, sans-serif;
  font-size: 16px;
}

/* Variables */
:root {
  --speedFactor: 1s; /* Default animation duration */
}

/* Import Animations */
@keyframes run {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@keyframes move {
  0% {
    right: -20%;
  }
  100% {
    right: 100%;
  }
}
@keyframes jump {
  0% {
    bottom: 0;
    height: 4rem;
  }
  25% {
    bottom: 6rem;
    height: 3rem;
  }
  50% {
    bottom: 8rem;
    height: 2rem;
  }
  75% {
    bottom: 6rem;
    height: 3rem;
  }
  100% {
    bottom: 0;
    height: 4rem;
  }
}
/* Body Styles */
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #faf9f6;
  user-select: none;
}

/* Header Styles */
h1 {
  padding: 10px;
  font-size: 32px;
}
h1 img {
  width: 30px;
}

.description {
  font-size: 16px;
  font-weight: bold;
}

/* Game Info Styles */
.game-info {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 50rem;
  padding: 10px;
  font-size: 16px;
}
.game-info .life {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90px;
  height: 30px;
  background-image: url(../assets/images/heart.png);
}

/*Game Board Styles*/
.game-board {
  position: relative;
  width: 50rem;
  height: 20rem;
  border: 2px solid #333;
  border-radius: 5px;
  overflow: hidden;
  background-color: #fff;
}
.game-board .product-name {
  font-size: 16px;
  color: red;
  position: absolute;
  top: 10%;
  width: 100%;
  text-align: center;
  font-weight: bold;
}
.game-board .runner {
  position: absolute;
  bottom: 0;
  left: 5rem;
  width: 2rem;
  height: 4rem;
  transition: width 0.3s, height 0.3s;
  animation: run 0.2s infinite linear;
}
.game-board .runner.jump {
  animation: jump 0.5s linear;
}
.game-board .runner.duck {
  width: 3rem;
  height: 2rem;
}
.game-board .product {
  object-fit: contain;
  box-shadow: 0px 0px 20px 5px red;
  border: 2px solid red;
  border-radius: 5px;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 3rem;
  height: 3rem;
  animation: move 2s linear;
}
.game-board .power-up {
  position: absolute;
  bottom: 6rem;
  right: 0;
  width: 2rem;
  height: 2rem;
  animation: move 6s infinite linear;
}

/*Buttons Style*/
.buttons {
  display: flex;
  width: 50rem;
  margin-top: 5px;
}
.buttons button {
  flex: 1;
  padding: 10px;
  margin: 5px;
  font-weight: bold;
  background-color: #fff;
  border: 2px solid #333;
  border-radius: 5px;
  font-weight: bold;
}

/*Game Over Dialog Style*/
.game-over {
  font-size: 16px;
  font-weight: bold;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  background-color: #faf9f6;
  text-align: center;
  line-height: 30px;
  border: 2px solid black;
  border-radius: 10px;
}
.game-over button {
  font-weight: bold;
  padding: 10px 20px;
  margin: 5px;
  border-radius: 10px;
  background-color: #fff;
}

/* Import Responsive */
@media (max-width: 900px) {
  html {
    font-size: 14px;
  }
}
@media (max-width: 700px) {
  html {
    font-size: 12px;
  }
}
@media (max-width: 650px) {
  .game-info,
  .buttons {
    width: 100vw;
  }
  .game-board {
    width: 100vw;
    height: 40vw;
  }
  .buttons {
    flex-direction: column;
  }
}
@media (max-width: 500px) {
  html {
    font-size: 10px;
  }
}
@media (max-width: 400px) {
  html {
    font-size: 8px;
  }
}