/* css/style.css */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  font-family: Arial, sans-serif;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none; /* Hide the default cursor */
}

/* Crosshair styling */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  pointer-events: none; /* Makes the crosshair non-interactive so clicks pass through to the canvas */
  z-index: 1000;
  display: none; /* Hide initially until game starts */
}

#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background-color: white;
  border: 1px solid black;
}

#crosshair::before {
  width: 2px;
  height: 20px;
  left: 9px;
  top: 0;
}

#crosshair::after {
  width: 20px;
  height: 2px;
  left: 0;
  top: 9px;
}

/* Center dot of the crosshair */
#crosshair-center {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: red;
  border-radius: 50%;
  top: 8px;
  left: 8px;
}

@keyframes gradientBackground {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Menu Overlay */
#menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: -webkit-linear-gradient(225deg, rgb(131,58,180), rgb(253,29,29),             
  rgb(252,176,69, 251)) 0% 0% / 300% 300%;
  background-size: 300% 300%;
  animation: gradientBackground 10s ease infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#menu-container {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 80%;
}

#menu-container h1 {
  margin-top: 0;
  color: white;
  font-size: 36px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#menu-form {
  margin-bottom: 30px;
}

#menu-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

#player-name {
  padding: 10px;
  font-size: 16px;
  width: 80%;
  margin-bottom: 20px;
  border: none;
  border-radius: 5px;
  text-align: center;
}

#play-button {
  background-color: royalblue;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 20px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

#play-button:hover {
  background-color: #0039e3;
  transform: scale(1.05);
}

#game-controls {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  padding: 15px;
  margin-top: 20px;
}

#game-controls h2 {
  margin-top: 0;
  font-size: 20px;
  color: #DF1F2D;
}

#game-controls ul {
  list-style: none;
  padding: 0;
  text-align: left;
  margin: 0;
  display: inline-block;
}

#game-controls li {
  margin: 10px 0;
  font-size: 16px;
}

/* Player name tag */
.player-name-tag {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
}

/* Game UI Panel */
#game-ui {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 250px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 8px;
  padding: 15px;
  font-family: Arial, sans-serif;
  pointer-events: none; /* Allows clicks to pass through */
  z-index: 1500;
}

#game-ui h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #DF1F2D;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#player-info {
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 10px;
}

#player-info p {
  margin: 5px 0;
  font-size: 14px;
}

/* Health bar */
#health-container {
  margin-bottom: 15px;
}

#health-bar {
  height: 15px;
  background-color: #2B3784;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) inset;
  position: relative;
}

#health-fill {
  height: 100%;
  background-color: #4CAF50; /* Green color instead of red */
  width: 100%; /* 100% health by default */
  transition: width 0.3s ease-in-out;
}

#health-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Add these styles to your css/style.css file */

/* Health bar flash effect */
.health-flash {
  animation: flash 0.5s;
}

@keyframes flash {
  0% { box-shadow: 0 0 0 rgba(255, 0, 0, 0); }
  50% { box-shadow: 0 0 10px rgba(255, 0, 0, 1); }
  100% { box-shadow: 0 0 0 rgba(255, 0, 0, 0); }
}

/* Damage overlay */
#damage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 1s ease-out;
  opacity: 0;
}

/* Death overlay */
#death-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  color: red;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  font-size: 2em;
  transition: opacity 1s;
}

#death-overlay button {
  padding: 10px 20px;
  font-size: 0.8em;
  background-color: #DF1F2D;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#death-overlay button:hover {
  background-color: #FF3347;
}

/* Controls section */
#controls-section h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #DF1F2D;
}

#controls-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

#controls-list li {
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.key {
  display: inline-block;
  padding: 2px 6px;
  background-color: #444;
  border-radius: 3px;
  min-width: 15px;
  text-align: center;
  margin-right: 5px;
  font-weight: bold;
  font-family: monospace;
  font-size: 10px;
}

#score-display {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 8px;
  color: #fff;
  font-size: 24px;
  font-family: Arial, sans-serif;
  z-index: 3000;
  pointer-events: none;
}



