/* Voxel Combat Arena FPS — HUD + screens */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --accent: #ffb13e;
  --accent2: #6fd3ff;
  --danger: #e5483b;
  --good: #5fdc6a;
  --ink: #eef4f8;
  --panel: rgba(12, 18, 24, 0.9);
  --line: rgba(120, 180, 220, 0.25);
}
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0f14; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}
#game-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* ============ DEVICE NOTICE ============ */
#device-notice {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(8, 12, 16, 0.96); padding: 24px;
}
#device-notice.show { display: flex; }
.notice-card {
  max-width: 480px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 32px; text-align: center;
}
.notice-card .ic { font-size: 44px; margin-bottom: 12px; }
.notice-card h2 { color: var(--accent); letter-spacing: 1px; margin-bottom: 12px; }
.notice-card p { color: #b9c7d2; line-height: 1.5; margin-bottom: 20px; font-size: 15px; }

/* ============ SCREENS ============ */
#screens .screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,16,22,0.35) 0%, rgba(8,12,16,0.88) 100%);
  transition: opacity .25s;
}
#screens .screen.hidden { display: none; }
.menu-inner { text-align: center; }
.title-eyebrow { color: var(--accent2); letter-spacing: 6px; font-size: 13px; margin-bottom: 8px; }
.game-title {
  font-size: clamp(56px, 10vw, 110px); font-weight: 900; letter-spacing: 2px;
  color: var(--ink); line-height: .95; text-shadow: 0 6px 30px rgba(0,0,0,.6);
}
.game-title span { color: var(--accent); }
.title-sub { color: #9fb2c0; letter-spacing: 4px; font-size: 14px; margin: 12px 0 36px; }
.menu-buttons { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.btn {
  min-width: 280px; padding: 15px 30px; font-size: 17px; font-weight: 700;
  letter-spacing: 2px; color: var(--ink); background: rgba(40, 55, 68, 0.7);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  transition: all .15s; text-transform: uppercase;
}
.btn:hover { background: rgba(70, 95, 115, 0.85); transform: translateY(-1px); border-color: var(--accent2); }
.btn.primary { background: linear-gradient(135deg, #c77e1f, #ffb13e); color: #1a1206; border: none; }
.btn.primary:hover { filter: brightness(1.1); }
.best-score { margin-top: 28px; color: var(--accent); letter-spacing: 2px; font-size: 14px; font-weight: 600; }
.menu-foot { margin-top: 30px; color: #7288a0; font-size: 12px; letter-spacing: 1px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 40px 48px; text-align: center; max-width: 640px; width: calc(100% - 48px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.panel h2 { color: var(--accent); letter-spacing: 3px; margin-bottom: 26px; font-size: 30px; }
.panel .btn { margin: 8px 6px 0; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; text-align: left; margin-bottom: 18px; }
.help-grid div { color: #c2d0db; font-size: 14px; }
.help-grid b { color: var(--accent2); display: inline-block; min-width: 90px; }
.help-note { color: #9fb2c0; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.diff-row { display: flex; gap: 14px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.diff-btn { min-width: 150px; padding: 18px 12px; }
.diff-name { font-size: 18px; }
.diff-desc { font-size: 12px; opacity: .75; margin-top: 6px; font-weight: 400; }
.pause-stats { color: #b9c7d2; letter-spacing: 2px; margin-bottom: 20px; }

/* Death */
#scr-death { background: radial-gradient(ellipse at center, rgba(80,10,10,0.4), rgba(20,4,4,0.9)); }
.death-inner { text-align: center; }
.death-title { font-size: clamp(70px, 14vw, 150px); font-weight: 900; color: var(--danger); letter-spacing: 10px; text-shadow: 0 0 40px rgba(229,72,59,.5); }
.death-sub { color: #d8b0ab; letter-spacing: 3px; margin: 8px 0 26px; }
.respawn-count { color: var(--ink); font-size: 22px; letter-spacing: 3px; font-weight: 700; }

/* End */
#end-title.win { color: var(--good); }
#end-title.lose { color: var(--danger); }
.end-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 30px; margin-bottom: 22px; }
.end-stats .stat { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 8px 2px; }
.end-stats .stat span { color: #9fb2c0; letter-spacing: 1px; font-size: 13px; }
.end-stats .stat b { color: var(--ink); font-size: 17px; }
#end-best { margin-bottom: 18px; }

/* ============ HUD ============ */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; font-variant-numeric: tabular-nums; transition: opacity .25s; }
#hud.hud-hidden { opacity: 0; }

/* sniper scope overlay */
#scope { position: absolute; inset: 0; opacity: 0; transition: opacity .08s; pointer-events: none; }
#scope .scope-ring { position: absolute; left: 50%; top: 50%; width: 78vmin; height: 78vmin; transform: translate(-50%,-50%); border-radius: 50%; box-shadow: 0 0 0 200vmax rgba(0,0,0,0.96); border: 2px solid rgba(20,24,28,0.9); }
#scope .scope-h { position: absolute; left: 50%; top: 50%; width: 78vmin; height: 1.5px; background: rgba(0,0,0,0.85); transform: translate(-50%,-50%); }
#scope .scope-v { position: absolute; left: 50%; top: 50%; width: 1.5px; height: 78vmin; background: rgba(0,0,0,0.85); transform: translate(-50%,-50%); }

#vignette {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(180, 10, 10, 0.7) 100%);
  transition: opacity .2s;
}
#dmg-flash { position: absolute; inset: 0; background: rgba(229,72,59,0.28); opacity: 0; }
#dmg-flash.show { animation: dmgflash .35s ease-out; }
@keyframes dmgflash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* crosshair */
#crosshair { position: absolute; left: 50%; top: 50%; --gap: 8px; opacity: .95; }
#crosshair .ch { position: absolute; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.8); }
#crosshair .t { width: 2px; height: 9px; left: -1px; top: calc(-9px - var(--gap)); }
#crosshair .b { width: 2px; height: 9px; left: -1px; top: var(--gap); }
#crosshair .l { width: 9px; height: 2px; top: -1px; left: calc(-9px - var(--gap)); }
#crosshair .r { width: 9px; height: 2px; top: -1px; left: var(--gap); }
#crosshair .dot { width: 2px; height: 2px; left: -1px; top: -1px; border-radius: 50%; }

/* hitmarker */
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hitmarker span { position: absolute; width: 12px; height: 2px; background: #fff; box-shadow: 0 0 4px #000; }
#hitmarker span:nth-child(1) { transform: rotate(45deg) translate(9px, -7px); }
#hitmarker span:nth-child(2) { transform: rotate(-45deg) translate(-9px, -7px); }
#hitmarker span:nth-child(3) { transform: rotate(-45deg) translate(9px, 7px); }
#hitmarker span:nth-child(4) { transform: rotate(45deg) translate(-9px, 7px); }
#hitmarker.show { animation: hitm .25s ease-out; }
#hitmarker.head span { background: var(--danger); }
@keyframes hitm { 0% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(0.9); } }

/* top bar */
#hud-top { position: absolute; top: 16px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#compass { position: relative; width: 300px; height: 26px; overflow: hidden; background: rgba(10,16,22,.55); border: 1px solid var(--line); border-radius: 13px; }
#compass-strip { position: absolute; top: 0; height: 100%; white-space: nowrap; transition: transform .05s linear; }
.cmark { position: absolute; top: 3px; color: #8fa6b8; font-size: 11px; transform: translateX(-50%); }
.cmark.clab { color: var(--ink); font-weight: 700; font-size: 13px; top: 2px; }
.compass-needle { position: absolute; left: 50%; top: 0; width: 2px; height: 100%; background: var(--accent); transform: translateX(-50%); }
#objective { color: var(--ink); letter-spacing: 2px; font-size: 14px; font-weight: 600; text-shadow: 0 1px 3px #000; }
#timer { color: var(--accent2); font-size: 20px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 1px 3px #000; }

/* killfeed */
#killfeed { position: absolute; top: 90px; right: 20px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.kf-row { background: rgba(10,16,22,.6); border: 1px solid var(--line); border-radius: 4px; padding: 5px 12px; font-size: 13px; transition: opacity .6s; }
.kf-row.fade { opacity: 0; }
.kf-row .you { color: var(--accent2); }
.kf-row .foe { color: var(--danger); }
.kf-row .wpn { color: #9fb2c0; }
.kf-row .hs { color: var(--accent); }
.kf-row .streakcall { color: var(--accent); font-weight: 700; }
.kf-row .wavelabel { color: var(--accent); letter-spacing: 1px; }

/* bottom-left: health + streak */
#hud-bl { position: absolute; left: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 14px; }
#health-wrap { display: flex; align-items: center; gap: 10px; }
#health-label { color: #9fb2c0; font-size: 12px; letter-spacing: 1px; }
#health-bar { width: 220px; height: 16px; background: rgba(10,16,22,.6); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
#health-fill { height: 100%; width: 100%; background: var(--good); transition: width .15s, background .3s; }
#health-num { color: var(--ink); font-weight: 700; font-size: 18px; min-width: 40px; }
#streak-label { color: #9fb2c0; font-size: 11px; letter-spacing: 2px; margin-bottom: 5px; }
#streak-pips { display: flex; gap: 5px; }
.pip { width: 18px; height: 8px; background: rgba(255,255,255,.12); border-radius: 2px; }
.pip.on { background: var(--accent2); box-shadow: 0 0 6px var(--accent2); }
.pip.mile { height: 12px; }
.pip.mile.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
#streak-ready { margin-top: 6px; }
.sready { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 1px; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* bottom-right: ammo + weapons */
#hud-br { position: absolute; right: 22px; bottom: 22px; text-align: right; }
#weapon-name { color: #b9c7d2; letter-spacing: 2px; font-size: 14px; margin-bottom: 2px; }
#ammo { font-weight: 800; }
#ammo-mag { font-size: 42px; color: var(--ink); }
#ammo-sep { color: #7288a0; font-size: 26px; margin: 0 4px; }
#ammo-res { font-size: 24px; color: #9fb2c0; }
#nades { color: var(--accent); font-size: 20px; letter-spacing: 3px; margin-top: 4px; }
#weapon-slots { margin-top: 10px; display: flex; gap: 6px; justify-content: flex-end; }
.wslot { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: rgba(10,16,22,.6); border: 1px solid var(--line); border-radius: 4px; color: #7288a0; font-size: 13px; }
.wslot.active { background: var(--accent); color: #1a1206; font-weight: 700; border-color: var(--accent); }

/* minimap */
#minimap-wrap { position: absolute; top: 90px; left: 20px; }
#minimap { border-radius: 50%; box-shadow: 0 0 0 2px rgba(120,180,220,.3), 0 8px 24px rgba(0,0,0,.5); }

/* popups */
#popups { position: absolute; left: 0; right: 0; top: 42%; pointer-events: none; }
.popup { position: absolute; transform: translateX(-50%); font-weight: 800; font-size: 24px; color: #fff; text-shadow: 0 2px 6px #000; animation: popup 1.1s ease-out forwards; }
.popup.head { color: var(--accent); font-size: 20px; }
.popup.wave { color: var(--accent2); font-size: 26px; }
.popup.kill { color: #fff; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 30% { transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -40px); } }

/* streak banner */
#streak-banner {
  position: absolute; top: 22%; left: 50%; transform: translateX(-50%);
  font-size: 30px; font-weight: 900; letter-spacing: 4px; color: var(--accent);
  text-shadow: 0 0 20px rgba(255,177,62,.6), 0 2px 6px #000; opacity: 0; white-space: nowrap;
}
#streak-banner.show { animation: banner 2.4s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) scale(.8); } 12% { opacity: 1; transform: translateX(-50%) scale(1.05); } 20% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

#reload-ind { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); color: var(--accent2); letter-spacing: 3px; font-size: 14px; font-weight: 700; text-shadow: 0 1px 3px #000; }
#interact-hint { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); color: var(--ink); background: rgba(10,16,22,.7); padding: 8px 16px; border-radius: 4px; border: 1px solid var(--line); display: none; }

@media (max-width: 760px) {
  #minimap-wrap { transform: scale(.7); transform-origin: top left; }
  #health-bar { width: 140px; }
  .panel { padding: 24px; }
}
