* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #111;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100vh; font-family: 'Courier New', monospace;
  overflow: hidden;
}
#gameContainer { position: relative; }
canvas { display: block; }
#minimap {
  position: absolute; top: 10px; left: 50%;
  transform: translateX(-50%);
  opacity: 0.75; border: 1px solid #444; border-radius: 3px;
  pointer-events: none;
}

/* ---- Start Screen ---- */
#startScreen {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 100;
}
#startScreen h1 {
  color: #e8d5a3; font-size: 46px; letter-spacing: 8px;
  text-shadow: 0 0 24px #c8a84b; margin-bottom: 8px;
}
#startScreen > p { color: #888; font-size: 13px; margin-bottom: 32px; letter-spacing: 3px; }
.controls-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 36px; max-width: 580px; width: 90%;
}
.ctrl-box {
  background: rgba(255,255,255,0.04); border: 1px solid #333;
  border-radius: 6px; padding: 14px;
}
.ctrl-box h3 { color: #c8a84b; font-size: 11px; margin-bottom: 8px; letter-spacing: 2px; }
.ctrl-box div { color: #bbb; font-size: 11px; line-height: 1.9; }
.ctrl-box kbd {
  background: #2a2a2a; border: 1px solid #555; border-radius: 3px;
  padding: 1px 5px; font-size: 10px; color: #eee;
}
#startBtn {
  background: linear-gradient(135deg, #c8a84b, #7a5a10);
  border: none; color: #fff; font-size: 18px;
  font-family: 'Courier New', monospace; letter-spacing: 5px;
  padding: 14px 56px; border-radius: 4px; cursor: pointer;
  text-transform: uppercase; transition: all 0.2s;
  box-shadow: 0 0 30px rgba(200,168,75,0.25);
}
#startBtn:hover { transform: scale(1.04); box-shadow: 0 0 40px rgba(200,168,75,0.45); }

/* ---- Mode Toggles ---- */
.mode-toggles {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 28px; width: 90%; max-width: 580px;
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.03); border: 1px solid #333;
  border-radius: 6px; padding: 10px 16px;
}
.toggle-label {
  color: #c8a84b; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
}
.toggle-group { display: flex; gap: 6px; }
.toggle-btn {
  background: rgba(255,255,255,0.05); border: 1px solid #444;
  color: #888; font-family: 'Courier New', monospace;
  font-size: 11px; letter-spacing: 2px; padding: 6px 16px;
  border-radius: 3px; cursor: pointer; transition: all 0.15s;
  text-transform: uppercase;
}
.toggle-btn:hover { border-color: #666; color: #bbb; }
.toggle-btn.active {
  background: linear-gradient(135deg, #c8a84b44, #7a5a1044);
  border-color: #c8a84b; color: #e8d5a3;
}
.god-status {
  font-size: 10px; color: #888; letter-spacing: 1px;
  text-align: center; min-height: 14px;
}
.god-status.ok  { color: #81c784; }
.god-status.err { color: #ef9a9a; }
.pvp-status {
  font-size: 10px; color: #888; letter-spacing: 1px;
  text-align: center; min-height: 14px;
}
.pvp-status.ok  { color: #81c784; }
.pvp-status.err { color: #ef9a9a; }

/* ---- PvP Match Dialog ---- */
#pvpDialog {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); z-index: 110;
}
#pvpDialogBox {
  background: #1a1a14; border: 1px solid #c8a84b;
  border-radius: 8px; padding: 32px 48px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: 0 0 40px rgba(200,168,75,0.3);
  min-width: 280px;
}
#pvpDialogBox h3 {
  color: #e8d5a3; font-size: 18px; letter-spacing: 4px; margin: 0;
}
#pvpDialogBox p { color: #888; font-size: 12px; letter-spacing: 2px; margin: 0; }
#pvpDialogTimer {
  font-size: 48px; color: #c8a84b; font-weight: bold;
  text-shadow: 0 0 20px #c8a84b; line-height: 1;
}
.pvp-dialog-btns { display: flex; gap: 12px; margin-top: 4px; }
#pvpAcceptBtn {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  border: 1px solid #4caf50; color: #fff;
  font-family: 'Courier New', monospace; font-size: 13px;
  letter-spacing: 3px; padding: 10px 28px;
  border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
#pvpAcceptBtn:hover { box-shadow: 0 0 16px rgba(76,175,80,0.5); }
#pvpDeclineBtn {
  background: rgba(255,255,255,0.04); border: 1px solid #555;
  color: #888; font-family: 'Courier New', monospace; font-size: 13px;
  letter-spacing: 3px; padding: 10px 28px;
  border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
#pvpDeclineBtn:hover { border-color: #ef9a9a; color: #ef9a9a; }

/* ---- Countdown ---- */
#countdown {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); z-index: 90; pointer-events: none;
}
#countdownNum {
  color: #e8d5a3; font-size: 130px;
  text-shadow: 0 0 50px #c8a84b; font-weight: bold;
  animation: pulse 1s ease-in-out;
}
@keyframes pulse {
  0% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- HUD ---- */
#hud {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; display: none;
}
.player-hud { position: absolute; display: flex; flex-direction: column; gap: 4px; }
#hud-p1 { bottom: 14px; left: 14px; }
#hud-p2 { bottom: 14px; right: 14px; align-items: flex-end; }
.hud-name { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 2px; }
.hud-p1-color { color: #4fc3f7; }
.hud-p2-color { color: #ef9a9a; }
.hud-bar-bg {
  width: 130px; height: 9px; background: #222;
  border-radius: 5px; overflow: hidden; border: 1px solid #444;
}
.hud-bar { height: 100%; border-radius: 5px; transition: width 0.25s; }
.hp-bar { background: linear-gradient(90deg, #4caf50, #8bc34a); width: 100%; }
.hp-bar-low { background: linear-gradient(90deg, #f44336, #ff5722); }
.ammo-display { font-size: 12px; color: #e8d5a3; letter-spacing: 1px; }
.status-display { font-size: 10px; color: #aaa; letter-spacing: 1px; min-height: 13px; }

/* ---- Game Over ---- */
#gameOver {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.88);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  z-index: 100;
}
#gameOver h2 { font-size: 50px; letter-spacing: 6px; text-shadow: 0 0 30px currentColor; margin-bottom: 8px; }
#gameOver p { color: #999; font-size: 15px; margin-bottom: 36px; }
#restartBtn {
  background: linear-gradient(135deg, #c8a84b, #7a5a10);
  border: none; color: #fff; font-size: 15px;
  font-family: 'Courier New', monospace; letter-spacing: 4px;
  padding: 12px 44px; border-radius: 4px; cursor: pointer;
  text-transform: uppercase;
}
#restartBtn:hover { opacity: 0.85; }
