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

body {
  background: #0a0a0a;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  color: #e0e0e0;
}

#lobby {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0a1628 0%, #1a2a4a 50%, #0a1628 100%);
}

#lobby-box {
  text-align: center;
  padding: 40px;
}

#lobby-box h1 {
  font-size: 64px;
  color: #ff4444;
  text-shadow: 0 0 20px #ff0000, 0 0 40px #ff000066;
  letter-spacing: 8px;
}

#lobby-box h2 {
  font-size: 36px;
  color: #ffaa00;
  text-shadow: 0 0 15px #ff8800;
  letter-spacing: 12px;
  margin-bottom: 30px;
}

#name-input {
  display: block;
  margin: 0 auto 20px;
  padding: 12px 24px;
  font-size: 18px;
  font-family: 'Courier New', monospace;
  background: #1a1a2a;
  border: 2px solid #444;
  color: #fff;
  text-align: center;
  width: 280px;
  outline: none;
  transition: border-color 0.2s;
}

#name-input:focus {
  border-color: #ff4444;
}

#join-btn {
  padding: 14px 48px;
  font-size: 20px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  background: #ff4444;
  color: #fff;
  border: none;
  cursor: pointer;
  letter-spacing: 4px;
  transition: all 0.2s;
}

#join-btn:hover {
  background: #ff6666;
  transform: scale(1.05);
}

#instructions {
  margin-top: 40px;
  padding: 20px;
  background: #11112288;
  border: 1px solid #333;
}

#instructions h3 {
  color: #ffaa00;
  margin-bottom: 10px;
  letter-spacing: 4px;
}

#instructions p {
  margin: 6px 0;
  color: #aaa;
  font-size: 14px;
}

#game {
  position: fixed;
  inset: 0;
}

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

#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

#hp-bar-container {
  position: relative;
  width: 200px;
  height: 24px;
  background: #333;
  border: 2px solid #555;
}

#hp-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff4444, #44ff44);
  transition: width 0.15s;
}

#hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
}

#speed-display {
  margin-top: 8px;
  font-size: 16px;
  color: #88ccff;
}

#scoreboard {
  text-align: right;
  font-size: 14px;
}

#scoreboard .player-score {
  margin: 4px 0;
  padding: 4px 8px;
  background: #00000088;
}

#scoreboard .player-score.me {
  color: #44ff44;
}

#scoreboard .player-score.other {
  color: #ff8888;
}

#death-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000000cc;
  z-index: 10;
}

#death-screen h1 {
  font-size: 72px;
  color: #ff0000;
  text-shadow: 0 0 30px #ff0000;
  animation: pulse 0.5s infinite alternate;
}

#death-screen p {
  font-size: 24px;
  color: #aaa;
  margin-top: 20px;
}

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

#kill-feed {
  position: fixed;
  top: 60px;
  right: 20px;
  pointer-events: none;
}

.kill-msg {
  padding: 6px 12px;
  margin: 4px 0;
  background: #000000aa;
  font-size: 13px;
  animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
