* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Courier New', Courier, monospace;
}

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

.container {
  position: relative;
  display: inline-block;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  border: 4px solid #333;
}

canvas {
  display: block;
  background-color: #87CEEB;
}

.ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 20px;
  pointer-events: none;
  align-items: flex-start;
}

.player-health-container {
  position: relative;
  width: 40%;
  display: flex;
  flex-direction: column;
}

.health-bar-bg {
  background-color: #333;
  width: 100%;
  height: 30px;
  position: absolute;
  top: 0;
  left: 0;
  border: 2px solid #fff;
  z-index: 1;
}

.health-bar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 30px;
  background: linear-gradient(90deg, #ff416c, #ff4b2b);
  width: 100%;
  transition: width 0.3s ease;
  z-index: 2;
  border: 2px solid #fff; /* Ensure bar stays within bg visual style */
}

#player2Health {
  background: linear-gradient(90deg, #2b5876, #4e4376);
}

.player-name {
    margin-top: 35px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.2rem;
    text-shadow: 2px 2px 2px #000;
}

.timer {
  background-color: rgba(0, 0, 0, 0.8);
  color: #f1f1f1;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3px solid white;
  font-size: 28px;
  font-weight: bold;
  border-radius: 5px;
}

.display-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7); /* Dim background */
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  text-align: center;
}

.display-text p {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 4px 4px 0 #000;
    margin-bottom: 20px;
}
