/* ============================================================
   Pixel Art Battle Royale — HUD & UI Styles
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a12; font-family: 'Courier New', monospace; color: #fff; }

#game-container { position: relative; width: 100vw; height: 100vh; }
#game-canvas { display: block; width: 100%; height: 100%; background: #111118; image-rendering: pixelated; }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.hud-top {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.hud-health, .hud-armor { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; }
.bar-label { font-size: 9px; opacity: 0.7; min-width: 18px; }
.bar-bg { width: 100px; height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width 0.2s ease; }
.health-bar { background: linear-gradient(90deg, #EF4444, #22C55E); width: 100%; }
.armor-bar { background: linear-gradient(90deg, #3B82F6, #60A5FA); width: 0%; }
.hud-info { display: flex; gap: 12px; font-size: 12px; font-weight: 600; margin-left: auto; }
.hud-info span { background: rgba(0,0,0,0.5); padding: 3px 8px; border-radius: 6px; }

/* Kill Feed */
.kill-feed {
  position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column;
  gap: 3px; max-width: 250px;
}
.kill-entry {
  font-size: 10px; padding: 3px 8px; background: rgba(0,0,0,0.65);
  border-radius: 4px; animation: killFadeIn 0.3s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes killFadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Minimap */
.minimap {
  position: absolute; bottom: 10px; right: 10px;
  width: 124px; height: 124px; border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px; overflow: hidden; background: rgba(0,0,0,0.4);
}
#minimap-canvas { width: 120px; height: 120px; image-rendering: pixelated; }

/* Overlays */
.overlay-screen {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 18, 0.92); backdrop-filter: blur(8px);
}
.menu-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.game-title { font-size: 2rem; letter-spacing: 0.15em; text-transform: uppercase; text-shadow: 0 0 20px rgba(249,115,22,0.5); }
.game-subtitle { font-size: 0.8rem; opacity: 0.5; letter-spacing: 0.1em; }
.death-title { font-size: 1.8rem; color: #EF4444; text-shadow: 0 0 20px rgba(239,68,68,0.5); }
.victory-title { font-size: 1.8rem; color: #F59E0B; text-shadow: 0 0 20px rgba(245,158,11,0.5); animation: victoryPulse 1s ease infinite alternate; }
@keyframes victoryPulse { to { text-shadow: 0 0 40px rgba(245,158,11,0.8); } }

.btn-play {
  padding: 0.75rem 2rem; font-size: 1rem; font-weight: 700; font-family: inherit;
  background: linear-gradient(135deg, #F59E0B, #EF4444); color: #fff;
  border: none; border-radius: 8px; cursor: pointer; letter-spacing: 0.08em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}
.btn-play:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(245,158,11,0.5); }

.menu-info { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.65rem; opacity: 0.4; margin-top: 0.5rem; }

.death-stats, .victory-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1.5rem;
  font-size: 0.75rem; text-align: left;
}
.stat-label { opacity: 0.5; }
.stat-value { font-weight: 700; }

/* Scores Panel */
.scores-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 15; background: rgba(16,16,28,0.95); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 1.25rem; min-width: 280px;
  pointer-events: all;
}
.scores-panel h3 { text-align: center; margin-bottom: 0.75rem; font-size: 1rem; }
.scores-panel ol { list-style: none; font-size: 0.75rem; }
.scores-panel li { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.7rem; font-family: inherit; background: rgba(255,255,255,0.1); color: #fff; border: none; border-radius: 6px; cursor: pointer; margin-top: 0.5rem; pointer-events: all; }
.btn-sm:hover { background: rgba(255,255,255,0.2); }
.btn-scores { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: all; }

/* Touch Controls */
.touch-controls {
  position: absolute; bottom: 20px; left: 0; right: 0; z-index: 8;
  display: flex; justify-content: space-between; padding: 0 20px;
  pointer-events: none;
}
.dpad { position: relative; width: 130px; height: 130px; pointer-events: all; }
.dpad-btn {
  position: absolute; width: 42px; height: 42px; border-radius: 8px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.15);
  color: white; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.dpad-btn:active { background: rgba(249,115,22,0.3); }
.dpad-btn.up { top: 0; left: 50%; transform: translateX(-50%); }
.dpad-btn.down { bottom: 0; left: 50%; transform: translateX(-50%); }
.dpad-btn.left { top: 50%; left: 0; transform: translateY(-50%); }
.dpad-btn.right { top: 50%; right: 0; transform: translateY(-50%); }

.action-btns { display: flex; flex-direction: column; gap: 10px; pointer-events: all; align-self: flex-end; }
.action-btn {
  width: 56px; height: 56px; border-radius: 50%; font-size: 20px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.15);
  color: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.action-btn:active { background: rgba(239,68,68,0.3); }
