*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a14; font-family: 'Segoe UI', Arial, sans-serif; }

#gameCanvas {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
}

/* HUD overlay */
#hudOverlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 10;
}

#crosshair {
  position: absolute; top: 50%; left: 50%;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
}
#crosshair::before, #crosshair::after {
  content: ''; position: absolute; background: rgba(180, 220, 255, 0.7);
}
#crosshair::before { width: 2px; height: 20px; left: 9px; }
#crosshair::after  { height: 2px; width: 20px; top: 9px; }

#statusPanel {
  position: absolute; top: 12px; left: 12px;
  color: #c0e8ff; font-size: 13px; line-height: 1.6;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
  pointer-events: none;
}

#moveState {
  position: absolute; top: 36px; left: 12px;
  color: #ffe08a; font-size: 12px; letter-spacing: 0.5px;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
}

#healthBar {
  position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%);
  width: 240px; height: 18px; background: rgba(10,18,30,0.6);
  border: 1px solid rgba(120,180,230,0.4); border-radius: 9px; overflow: hidden;
}
#hpFill {
  position: absolute; left: 0; top: 0; height: 100%; width: 100%;
  background: #5ad15a; transition: width 0.12s ease-out, background 0.2s;
}
#hpText {
  position: absolute; width: 100%; text-align: center; top: 1px;
  color: #fff; font-size: 12px; font-weight: bold; text-shadow: 0 0 3px rgba(0,0,0,0.9);
}

#hurtFlash {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0) 40%, rgba(200,0,0,0.85) 100%);
  opacity: 0; transition: opacity 0.1s ease-out; pointer-events: none; z-index: 20;
}

#weaponPanel {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  color: #eafaff; font-size: 16px; font-weight: bold; letter-spacing: 1px;
  padding: 6px 16px; background: rgba(10,18,30,0.55); border-radius: 18px;
  border: 1px solid rgba(120,180,230,0.35); text-shadow: 0 0 8px rgba(0,0,0,0.8);
}

#hitMarker {
  position: absolute; top: 50%; left: 50%;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  opacity: 0; transition: opacity 0.08s ease-out;
  pointer-events: none;
}
#hitMarker::before, #hitMarker::after {
  content: ''; position: absolute; left: 12px; top: 0;
  width: 2px; height: 26px; background: #ff5a5a; box-shadow: 0 0 6px rgba(255,0,0,0.8);
}
#hitMarker::before { transform: rotate(45deg); }
#hitMarker::after  { transform: rotate(-45deg); }

#controlsHint {
  position: absolute; bottom: 10px; right: 14px;
  max-width: 460px; text-align: right;
  color: #d6ecff; font-size: 12px; line-height: 1.5;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
  opacity: 0.8;
}

#chatLog {
  position: absolute; bottom: 50px; left: 12px;
  max-height: 180px; width: 340px; overflow-y: auto;
  color: #d0eaff; font-size: 13px; line-height: 1.4;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
}
#chatLog .chat-line { margin-bottom: 2px; }

#chatForm {
  position: absolute; bottom: 8px; left: 12px;
  pointer-events: auto;
}
#chatInput {
  width: 300px; padding: 6px 10px;
  background: rgba(0,0,0,0.55); color: #c0e8ff;
  border: 1px solid rgba(100,160,220,0.3); border-radius: 4px;
  font-size: 13px; outline: none;
}
#chatInput::placeholder { color: rgba(192,232,255,0.4); }

#loadingScreen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a14; color: #8af; font-size: 20px; z-index: 999;
}
