* {
  image-rendering: pixelated;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: url('./assets/desert.png') repeat-x;
  background-size: 800px 100%; /* Match the image width exactly */
  animation: scrollBackground 3s linear infinite; /* Faster background */
}

@keyframes scrollBackground {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -800px 0; /* Match the image width exactly */
  }
}

#dog {
  position: absolute;
  bottom: 120px; /* Keep the dog raised */
  left: 500px; /* Keep the dog closer to the center */
  width: 100px; /* Increased from 80px to 100px */
  height: 100px; /* Increased from 80px to 100px */
  background: url('./assets/dog.gif') no-repeat;
  background-size: contain;
}

.cactus {
  position: absolute;
  bottom: 120px; /* Keep the cactus raised */
  width: 70px;
  height: 100px;
  background: url('./assets/cactus.png') no-repeat;
  background-size: contain;
  animation: moveCactus linear forwards; /* Use dynamic duration */
}

@keyframes moveCactus {
  from {
    left: 100vw; /* Start off-screen to the right */
  }
  to {
    left: -50px; /* Move off-screen to the left */
  }
}

#score {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 24px;
  color: white;
}

#game-over {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  font-size: 32px;
}

#restart-button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 18px;
  cursor: pointer;
}