* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
}

body {
  background-color: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

.game-container {
  position: relative;
  width: 1024px;
  height: 576px;
  background-color: #fff;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  background-image: linear-gradient(to bottom, #87CEEB 0%, #E0F7FA 100%); /* Simple sky background */
  border: 4px solid #333;
}

canvas {
  display: block;
}

/* HUD Styling */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none; /* Let clicks pass through */
}

.player-status {
  width: 40%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.p1-status {
  align-items: flex-start;
}

.p2-status {
  align-items: flex-end;
}

.bar-container {
  position: relative;
  width: 100%;
  height: 30px;
  background-color: #333;
  border: 2px solid #000;
}

.health-bar-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #550000;
}

.health-bar {
  position: absolute;
  top: 0;
  height: 100%;
  background-color: #ff3333; /* Default P1 color */
  width: 100%;
  transition: width 0.2s ease-out;
}

.p2-status .health-bar {
  background-color: #3388ff; /* P2 color */
  right: 0; /* Deplete from left to right for P2? No, usually right to left. CSS positioning handles this. */
}

/* For P2, we want the bar to shrink from the center outwards or standard fighting game style */
/* Standard: P1 left-to-right, P2 right-to-left */
.p1-status .health-bar {
  left: 0;
}
.p2-status .health-bar {
  right: 0;
}

.energy-container {
  height: 10px;
  width: 80%; /* Smaller than HP bar */
  background-color: #222;
  border: 1px solid #000;
  margin-top: 2px;
}

.energy-bar {
  height: 100%;
  width: 0%;
  background-color: #ffff00;
  box-shadow: 0 0 5px #ffff00;
}

.p2-status .energy-bar {
  float: right; /* Align to right */
}

.timer-container {
  width: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer {
  background-color: #333;
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3px solid #fff;
  border-radius: 5px;
}

.round-display {
  margin-top: 5px;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  font-size: 14px;
}

.score-marker {
  margin-top: 5px;
  display: flex;
  gap: 5px;
}

.score-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc;
  border: 1px solid #000;
}

.score-dot.active {
  background-color: #ffff00; /* Gold for win */
}

/* Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  z-index: 10;
}

.overlay h1 {
  font-size: 64px;
  text-transform: uppercase;
  letter-spacing: 5px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
}

.controls-hint {
  font-size: 18px;
  text-align: center;
  line-height: 1.6;
  background: rgba(0,0,0,0.5);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #555;
}
