:root {
  --bg: #0b1220;
  --text: #e5ebf7;
  --accent: #4ea8ff;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 800px;
  height: 600px;
  border: 2px solid #314766;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  background: #1a2436;
  overflow: hidden;
}

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

#hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  font-weight: bold;
  font-size: 16px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

#speedDisplay {
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
}

.health-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.health-row span {
  margin-bottom: 3px;
  font-size: 12px;
  text-transform: uppercase;
  color: #aaa;
}

.health-bar-bg {
  width: 150px;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #000;
}

.health-bar-fill {
  width: 100%;
  height: 100%;
  background: #4ade80; /* Player is green */
  transition: width 0.2s, background-color 0.2s;
}

#targetHealthRow {
  display: none; /* Hidden until level starts */
}

#targetHealth {
  background: #f87171; /* Target is red */
}

/* Modals */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal h1 {
  font-size: 36px;
  margin-bottom: 20px;
  color: #f9fbff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.modal p {
  font-size: 18px;
  color: #9eadc3;
  margin-bottom: 30px;
  max-width: 600px;
  line-height: 1.5;
}

button {
  background: #18253c;
  color: var(--text);
  border: 1px solid #355075;
  border-radius: 7px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  border-color: var(--accent);
  background: #25344e;
}

button.primary {
  background: var(--accent);
  color: #051523;
  border-color: #7bc0ff;
  font-weight: 600;
}

button.primary:hover {
  background: #7bc0ff;
  border-color: #a3d4ff;
}
