body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #000;
  font-family: "Courier New", monospace;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #ff0000;
  font-size: 24px;
  text-shadow: 2px 2px 4px #000;
  z-index: 100;
  user-select: none;
}

#ammo {
  margin-bottom: 10px;
}

#health {
  margin-bottom: 10px;
}

#score {
  margin-bottom: 10px;
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  color: #ff0000;
  font-size: 24px;
  z-index: 100;
  user-select: none;
  pointer-events: none;
}

#gameOver {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff0000;
  font-size: 48px;
  text-align: center;
  display: none;
  z-index: 200;
  user-select: none;
}

#restartButton {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #ff0000;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 24px;
}

#startScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  background-image: url('background.jpg');
  background-size: cover;
  background-position: center;
  color: #ff0000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 300;
}

#startScreen h1 {
  font-size: 48px;
  margin-bottom: 40px;
  text-shadow: 2px 2px 4px #600;
  /* Add a text shadow to make the title more readable against the background */
  text-shadow: 3px 3px 5px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

#startButton {
  padding: 15px 30px;
  background-color: #ff0000;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 24px;
  /* Add a subtle shadow to make the button stand out against the background */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 0, 0, 0.3);
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}

#gameInfo {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #ff0000;
  font-size: 16px;
  text-shadow: 2px 2px 4px #000;
  z-index: 100;
  user-select: none;
  text-align: right;
}

#fps {
  margin-bottom: 5px;
}

#enemiesKilled {
  margin-bottom: 5px;
}

#gameTime {
  margin-bottom: 5px;
}

#audioVisualization {
  position: absolute;
  top: 100px;
  right: 20px;
  z-index: 100;
  border: 1px solid #ff0000;
  background-color: rgba(0, 0, 0, 0.5);
}

/* Add these styles for the loading screen */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1s ease;
}

#loadingScreen.fade-out {
  opacity: 0;
}

.loading-container {
  text-align: center;
  color: #ff0000;
}

.loading-container h1 {
  font-size: 64px;
  margin-bottom: 40px;
  text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
  animation: pulse 2s infinite;
}

.loading-bar-container {
  width: 400px;
  height: 20px;
  background-color: #222;
  border: 2px solid #ff0000;
  margin: 0 auto 20px;
  overflow: hidden;
  box-shadow: 0 0 10px #ff0000;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff0000, #ff6600);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px #ff0000 inset;
}

.loading-text {
  font-size: 24px;
  margin-bottom: 30px;
  text-shadow: 0 0 5px #ff0000;
  letter-spacing: 2px;
}

.loading-animation {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.loading-circle {
  width: 20px;
  height: 20px;
  background-color: #ff0000;
  border-radius: 50%;
  animation: bounce 0.8s infinite alternate;
  box-shadow: 0 0 10px #ff0000;
}

.loading-circle:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-circle:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-20px);
  }
}

@keyframes pulse {
  0% {
    text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
  }
  50% {
    text-shadow: 0 0 15px #ff0000, 0 0 30px #ff0000, 0 0 40px #ff0000;
  }
  100% {
    text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
  }
}
