body {
  margin: 0;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  background-color: #111;
  color: white;
}

#start-screen, #game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/background.png') no-repeat center center/cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#game-over {
  display: none;
}

/* Overlay to make text readable */
#start-screen::before, #game-over::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7); /* Dark overlay */
  z-index: -1;
}

#game-logo {
  width: 300px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(30, 144, 255, 0.8));
}

h1 {
  font-size: 3rem;
  color: #1e90ff;
  text-shadow: 0 0 10px #1e90ff;
  margin-bottom: 10px;
  z-index: 1; /* Ensure text is above overlay */
}

p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #ccc;
}

button {
  padding: 15px 40px;
  font-size: 1.5rem;
  background: #1e90ff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  margin-top: 20px;
}

button:hover {
  background: #0077ea;
  transform: scale(1.05);
}

#ui {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  font-family: monospace;
  font-size: 1.2rem;
  pointer-events: none;
  text-shadow: 1px 1px 2px black;
}

#minimap {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 200px;
  border: 2px solid #555;
  background: rgba(0, 0, 0, 0.5);
}

/* Tank Selector Styles */
.tank-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.tank-card {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 20px;
  width: 150px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.tank-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.tank-card.selected {
  border-color: #1e90ff;
  background: rgba(30, 144, 255, 0.2);
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.5);
}

.tank-card h3 {
  margin: 0 0 15px 0;
  color: #fff;
}

.stat-bar {
  background: #333;
  height: 6px;
  border-radius: 3px;
  margin: 5px 0 2px 0;
  overflow: hidden;
}

.stat-bar .fill {
  height: 100%;
  background: #1e90ff;
}

.tank-card small {
  display: block;
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 8px;
}

#reload-container {
  width: 200px;
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #555;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
}

#reload-bar {
  width: 100%;
  height: 100%;
  background: #00ff00;
  width: 0%;
  /* transition removed for instant feedback */
}

#top-hud {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

#health-container {
  display: block;
  width: 300px; /* Wider for top bar */
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#health-bar {
  width: 100%;
  height: 100%;
  background: #ff4500;
  transition: width 0.2s ease-out;
}

#damage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.1s;
}

#damage-overlay.flash {
  background: rgba(255, 0, 0, 0.3);
  opacity: 1;
}

#damage-overlay.low-health {
  background: radial-gradient(circle, transparent 50%, rgba(255, 0, 0, 0.5) 100%);
  opacity: 1;
  animation: pulse 1s infinite alternate;
}

#countdown-timer {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4rem;
  font-weight: bold;
  color: #ffff00;
  text-shadow:
    0 0 10px #ffff00,
    0 0 20px #ffff00,
    0 0 30px #ff8800,
    2px 2px 4px rgba(0,0,0,0.8);
  z-index: 100;
  display: none;
  animation: pulse-countdown 1s infinite;
}

#countdown-timer.active {
  display: block;
}

@keyframes pulse-countdown {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}

@keyframes pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Debug Panel Styles */
#debug-panel {
  position: absolute;
  top: 20px;
  right: 240px; /* Next to minimap */
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #00ff00;
  border-radius: 10px;
  padding: 15px;
  min-width: 220px;
  font-family: 'Courier New', monospace;
  z-index: 100;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  transition: opacity 0.3s ease;
}

#debug-panel h3 {
  margin: 0 0 15px 0;
  color: #00ff00;
  font-size: 1.2rem;
  text-align: center;
  text-shadow: 0 0 10px #00ff00;
}

.debug-option {
  margin: 10px 0;
}

.debug-option label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #fff;
  transition: color 0.2s;
}

.debug-option label:hover {
  color: #00ff00;
}

.debug-option input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #00ff00;
}

.debug-option span {
  font-size: 0.95rem;
}

.debug-hint {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #333;
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
}

/* Active Debug Modes Indicator */
#debug-active-modes {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 255, 0, 0.2);
  border: 2px solid #00ff00;
  border-radius: 8px;
  padding: 10px 15px;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  font-weight: bold;
  text-shadow: 0 0 5px #00ff00;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
  z-index: 99;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.6);
  }
}
