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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
  font-family: system-ui, -apple-system, sans-serif;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#vision-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

#minimap {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 200px;
  height: 118px;
  border: 2px solid #444;
  border-radius: 6px;
  background: #1a1a1a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 10;
}

#hud-center {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 220px;
  max-width: 100%;
  box-sizing: border-box;
}

#timer {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.05em;
  line-height: 1;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 18px 8px;
  border-radius: 10px;
}

.paint-scores {
  display: flex;
  gap: 20px;
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
}

.blue-score strong {
  color: #64b5f6;
}

.red-score strong {
  color: #ef5350;
}

.health-bar-wrap,
#health-panel {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 200px;
  height: 22px;
  background: #c62828;
  border: 2px solid #fff;
  border-radius: 4px;
  overflow: visible;
  z-index: 11;
}

.health-tag {
  position: absolute;
  left: 6px;
  top: -16px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.health-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #2e7d32 0%, #43a047 100%);
  transition: width 0.15s ease;
}

#health-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#tube-hud {
  position: absolute;
  top: 140px;
  left: 12px;
  background: rgba(0, 0, 0, 0.55);
  padding: 10px 12px;
  border-radius: 8px;
  color: #eee;
  font-size: 11px;
  min-width: 160px;
  z-index: 11;
}

#tube-hud span {
  display: block;
  margin-bottom: 4px;
}

.tube-bar-wrap {
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.tube-bar {
  height: 100%;
  width: 100%;
  transition: width 0.1s ease;
}

.tube-bar.player-tube {
  background: #1565c0;
}

.tube-bar.enemy-tube {
  background: #c62828;
}

#menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 100;
  color: #fff;
  gap: 16px;
}

#menu.hidden {
  display: none;
}

#menu h1 {
  font-size: 2.5rem;
}

#menu p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 480px;
  text-align: center;
}

#win-count {
  font-size: 1.4rem;
  font-weight: 700;
}

#win-count.hidden {
  display: none;
}

#play-again {
  margin-top: 8px;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#play-again:hover {
  background: #1976d2;
  transform: scale(1.03);
}

#controls-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  z-index: 10;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
