* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f8f8;
  overflow: hidden;

}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

#spawn-options-menu {
    pointer-events: auto;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(240, 240, 245, 0.98); 
    padding: 15px 20px;
    border-radius: 12px; 

    flex-direction: column; 
    z-index: 1002;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15); 
    border: 1px solid rgba(0,0,0,0.05);
    font-family: Arial, sans-serif;
    user-select: none;
    min-width: 300px;
    max-width: 90vw;

}
.spawn-menu-section {
  display: flex;
  flex-direction: column; 
  gap: 8px; 
}
.spawn-menu-section p {
  font-size: 14px;
  color: #555;
  margin-bottom: 0; 
  font-weight: 600;
}
.spawn-menu-button-group { 
    display: flex;
    gap: 8px;
}
.spawn-menu-button {
  padding: 10px 15px;
  border: 1px solid #ddd;
  background-color: #f0f0f0;
  color: #333;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  flex-grow: 1; 
  margin-right: 0; 
}
.spawn-menu-button:hover {
  background-color: #e0e0e0;
  border-color: #ccc;
}
.spawn-menu-button.selected {
  background-color: #007bff;
  color: white;
  border-color: #0056b3;
}
.spawn-menu-button.exit-button {
  background-color: #f8d7da; 
  color: #721c24;
  border-color: #f5c6cb;
}
.spawn-menu-button.exit-button:hover {
  background-color: #f1b0b7;
  border-color: #eba4ad;
}
.spawn-menu-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
  padding: 5px;
}
.spawn-menu-close-button:hover {
  color: #333;
}
.spawn-menu-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  background-color: #f0f0f0;
  color: #333;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%225%22%3E%3Cpath%20d%3D%22M0%200h10L5%205z%22%20fill%3D%22%23333%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 5px;
  padding-right: 35px; 
}
.spawn-menu-select:hover {
  background-color: #e0e0e0;
  border-color: #ccc;
}
.spawn-menu-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
.exit-button-section {
  margin-top: 10px; 
  display: flex; 
  justify-content: center; 
}
.exit-button-section .exit-button {
  flex-grow: 0; 
  min-width: 150px; 
  text-align: center;
}
.spawn-object-button {

}
.spawn-object-button[data-object="block"] {
  background-color: #add8e6; 
  border-color: #9accdc;
}
.spawn-object-button[data-object="block"]:hover {
  background-color: #9accdc;
  border-color: #89c0d0;
}
.spawn-object-button[data-object="block"].selected {
  background-color: #007bff; 
  border-color: #0056b3;
  color: white;
}

#spawn-objects-container.hidden { 
  display: none;
}
.gltf-model-button {

  background-color: #e9ecef; 
}
.gltf-model-button.selected {
  background-color: #28a745; 
  color: white;
  border-color: #1e7e34;
}
#gltf-model-selection-container {

}

.crosshair {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  pointer-events: none;
  z-index: 10;
}
.crosshair::before, .crosshair::after {
  content: '';
  position: absolute;
  background-color: rgba(255,255,255,0.8);
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.crosshair::before {
  left: 50%; top: 0;
  width: 2px; height: 100%;
  transform: translateX(-50%);
}
.crosshair::after {
  top: 50%; left: 0;
  width: 100%; height: 2px;
  transform: translateY(-50%);
}
.crosshair.crosshair-delete::before,
.crosshair.crosshair-delete::after {
    width: 100%;
    height: 4px;
    top: 50%;
    left: 0;
    transform-origin: center;
    background-color: #ff4d4d;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.7);
}
.crosshair.crosshair-delete::before {
    transform: translateY(-50%) rotate(45deg);
}
.crosshair.crosshair-delete::after {
    transform: translateY(-50%) rotate(-45deg);
}
.crosshair-blip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}
.blip-arm {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
  display: flex;
  gap: 2px;
}
.blip-pixel {
  background-color: #00d9e9;
  box-shadow: 0 0 8px #00d9e9, 0 0 12px #00d9e9;
  border-radius: 1px;
}
.blip-pixel:nth-child(1) { width: 5px; height: 5px; opacity: 1; }
.blip-pixel:nth-child(2) { width: 4px; height: 4px; opacity: 0.8; }
.blip-pixel:nth-child(3) { width: 3px; height: 3px; opacity: 0.6; }
.blip-arm:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg) translateX(15px);
}
.blip-arm:nth-child(2) {
  transform: translate(-50%, -50%) rotate(135deg) translateX(15px);
}
.blip-arm:nth-child(3) {
  transform: translate(-50%, -50%) rotate(225deg) translateX(15px);
}
.blip-arm:nth-child(4) {
  transform: translate(-50%, -50%) rotate(315deg) translateX(15px);
}
.crosshair-blip.active {
  animation: crosshairBlip 0.25s linear forwards;
}
@keyframes crosshairBlip {
  0% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
}
#quick-restart-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  pointer-events: none;
  display: none;
}
.progress-ring {
  transform: rotate(-90deg);
}
.progress-ring__circle {
  transition: stroke-dashoffset 0.05s linear;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-linecap: round;
}
#enemy-counter {
  position: fixed;
  top: 25px;
  right: 25px; /* Moved to the right */
  left: auto; /* Reset left property */
  display: none;
  flex-direction: column;
  align-items: center;
  color: white;
  font-family: 'Arial Black', Gadget, sans-serif;
  text-align: center;
  z-index: 100;
  min-width: 100px;
  background-image: radial-gradient(ellipse 90% 100% at 50% 150%, rgba(255, 0, 0, 0.25) 0%, transparent 60%);
  padding: 10px 15px 40px 15px; /* Increased bottom padding for the gradient */
  border-radius: 0;
  border: none;
  box-shadow: none;
  transition: opacity 0.3s ease;
}
#enemy-counter .enemy-counter-value {
  font-size: 3.2em; /* Slightly smaller */
  font-weight: 900;
  line-height: 1;
  color: #ff4d4d; /* Bright red color */
  text-shadow: 0 0 10px #ff0000, 0 0 5px #ff0000;
}
#enemy-counter .enemy-counter-underline {
    display: none; /* Hide the underline */
}
#enemy-counter .enemy-counter-label {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 8px; /* Added margin for spacing */
  opacity: 0.9;
  color: #ffc2c2; /* Lighter red for the label */
}
#game-over-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; 
  background-color: rgba(0, 0, 0, 0.75); 
  color: white;
  pointer-events: auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1001; 
  text-align: center;
  font-family: 'Press Start 2P', cursive; 
  font-size: 2.5em; 
  line-height: 1.5;
  text-shadow: 2px 2px 0px #000000; 
}
#game-over-screen .restart-prompt {
  font-size: 0.6em; 
  margin-top: 20px;
}
#fade-screen {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: black;
  opacity: 0;
  pointer-events: none; 
  z-index: 2000; 
  transition: opacity 1s ease-in-out;
}
.slow-mo-energy-bar-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 39%; 
  max-width: 338px; 
  min-width: 208px; 
  height: 28px; 
  background-color: #000000; 
  border-radius: 14px; 
  padding: 3px; 
  box-sizing: border-box;
  z-index: 100;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.5), 0 0 5px rgba(0,0,0,0.3); 
  opacity: 0; 
  visibility: hidden; 
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; 
}
.slow-mo-energy-bar-container.visible {
  opacity: 1;
  visibility: visible;
}
.slow-mo-energy-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 60%, #dddddd 100%); 
  border-radius: 11px; 
  transition: width 0.25s cubic-bezier(0.25, 0.1, 0.25, 1); 
  position: relative; 
  box-shadow: 0 0 10px rgba(210, 210, 255, 0.6), 0 0 5px rgba(255,255,255,0.8); 
}
.slow-mo-energy-bar-fill::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 5%;
  width: 90%;
  height: 40%; 
  background: linear-gradient(to bottom, rgba(255,255,255,0.7), rgba(255,255,255,0)); 
  border-radius: 6px; 
  opacity: 0.9;
}
#level-timer-container {
  position: fixed;
  top: 65px; 
  left: 50%;
  transform: translateX(-50%);
  display: none; 
  flex-direction: column;
  align-items: center;
  color: white;
  font-family: 'Arial Black', Gadget, sans-serif;
  z-index: 100;
  text-shadow: 0 0 5px rgba(0,0,0,0.7);
}
#level-timer-value {
  font-size: 1.8em;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.timer-underline {
  width: 80%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  border-radius: 1px;
}
#ammo-counter {
  position: fixed;
  bottom: 25px; 
  left: 160px; 
  transform: none; 
  display: none; 
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  border-radius: 8px;
  color: white;
  font-family: 'Arial Black', Gadget, sans-serif;
  text-align: center;
  z-index: 100;
  min-width: 100px;
}
#ammo-counter .ammo-count {
  font-size: 3.5em; 
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease-in-out; 
}
#ammo-counter .ammo-count.ammo-warning {
  color: #FFA500; 
  text-shadow: 0 0 8px rgba(255, 165, 0, 0.6);
}
#ammo-counter .ammo-count.ammo-critical {
  color: #FF3030; 
  text-shadow: 0 0 8px rgba(255, 48, 48, 0.7);
}
#ammo-counter .ammo-label {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 5px;
  opacity: 0.8;
}
#ammo-counter .ammo-underline {
    width: 60%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    margin: 8px 0;
}
.highlight-settings {
  color: #4CAF50; 
  font-weight: bold;
}
#settings-tip-element {
  position: fixed;
  bottom: 25px;
  right: 25px;
  padding: 8px 15px;
  background-color: rgba(20, 20, 20, 0.7);
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Arial', sans-serif;
  font-size: 1.1em;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 5px;
  z-index: 100;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
  white-space: nowrap;
}
#health-bar-container {
  position: fixed;
  bottom: 25px;
  left: 25px;
  width: 120px; 
  height: 120px; 
  z-index: 101; 
  display: flex;
  align-items: center;
  justify-content: center;
}
#health-bar-progress {
  width: 100%;
  height: 100%;
  border-radius: 50%; 

  --health-percent: 100%;
  --health-color: hsl(120, 100%, 45%); 
  --track-color: rgba(60, 60, 60, 0.75); 

  background-image: conic-gradient(
    var(--health-color) 0% var(--health-percent),
    var(--track-color) var(--health-percent) 100%
  );

  -webkit-mask-image: radial-gradient(transparent 60%, black 61%); 
  mask-image: radial-gradient(transparent 60%, black 61%); 

  box-shadow: 0 0 8px rgba(0,0,0,0.3); 
}
#health-bar-value {
  position: absolute; 
  color: white;
  font-size: 28px; 
  font-weight: bold;
  font-family: 'Arial Black', Gadget, sans-serif; 
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8); 
  pointer-events: none; 
}

#tutorial-prompt-panel {
  position: fixed;
  right: 30px;
  top: 100px;
  width: 400px; 
  background-color: rgba(15, 25, 35, 0.9); 
  border: 1px solid rgba(100, 180, 255, 0.5); 
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 0 20px rgba(80, 150, 220, 0.25); 
  display: none; 
  flex-direction: column;
  gap: 12px; 
  z-index: 1000; 
  font-family: 'Arial', sans-serif; 
  color: #E0E0E0; 
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  opacity: 0;
  transform: translateX(20px); 
}
#tutorial-prompt-panel.visible {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}
#tutorial-prompt-image {
  width: 100%;
  height: 220px; 
  object-fit: cover; 
  border-radius: 6px; 
  background-color: #000; 
  border: 1px solid rgba(100, 180, 255, 0.3); 
}
#tutorial-prompt-text {
  font-size: 1.15em; 
  font-weight: bold; 
  line-height: 1.5;
  text-align: left; 
  margin: 0; 
  white-space: pre-line; 
}