/* ============================================================
   VOXEL STRIKE — HUD & menu styling
   Palette: desert bone, gunmetal, olive, amber accent.
   ============================================================ */
:root {
  --amber: #f0b545;
  --amber-dim: #b98a2e;
  --bone: #e8e4d4;
  --olive: #9aa26b;
  --red: #ff4d3d;
  --panel: rgba(14, 16, 13, 0.86);
  --edge: rgba(240, 181, 69, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0c0e0b; }
body {
  font-family: "Lucida Console", Monaco, "Courier New", monospace;
  color: var(--bone);
  -webkit-user-select: none; user-select: none;
}
#game-canvas-holder, #game-canvas-holder canvas { position: fixed; inset: 0; }

/* ==================== HUD ==================== */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

/* crosshair */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transition: opacity 0.08s; }
.ch-line { position: absolute; background: rgba(235, 240, 220, 0.92); box-shadow: 0 0 2px rgba(0,0,0,0.8); }
#ch-t, #ch-b { width: 2px; height: 9px; left: -1px; }
#ch-l, #ch-r { height: 2px; width: 9px; top: -1px; }
#ch-t { bottom: var(--gap); } #ch-b { top: var(--gap); }
#ch-l { right: var(--gap); } #ch-r { left: var(--gap); }
#ch-dot { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: rgba(235,240,220,0.95); }

/* hitmarker */
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hitmarker i { position: absolute; width: 2.5px; height: 10px; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,0.9); }
#hitmarker i:nth-child(1) { transform: translate(-8px, -13px) rotate(45deg); }
#hitmarker i:nth-child(2) { transform: translate(6px, -13px) rotate(-45deg); }
#hitmarker i:nth-child(3) { transform: translate(-8px, 4px) rotate(-45deg); }
#hitmarker i:nth-child(4) { transform: translate(6px, 4px) rotate(45deg); }
#hitmarker.show { opacity: 1; }
#hitmarker.show.head i { background: var(--amber); }
#hitmarker.show.kill i { background: var(--red); height: 12px; }

/* damage feedback */
#damage-vignette { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(140, 8, 4, 0.55) 78%, rgba(120, 4, 2, 0.85) 100%); }
#lowhp-pulse { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(150, 10, 5, 0.5) 100%); }
#damage-dirs { position: absolute; left: 50%; top: 50%; }
.dmg-dir { position: absolute; width: 0; height: 0; animation: dmgfade 0.9s forwards; }
.dmg-dir::before { content: ''; position: absolute; left: -34px; top: -110px; border-left: 34px solid transparent;
  border-right: 34px solid transparent; border-bottom: 18px solid rgba(255, 60, 40, 0.85); filter: blur(1px); }
@keyframes dmgfade { from { opacity: 1; } to { opacity: 0; } }

/* scope overlay */
#scope-overlay { display: none; position: absolute; inset: 0; background:
  radial-gradient(circle at center, transparent 31%, rgba(0,0,0,0.985) 33.5%); }
.scope-ring { position: absolute; left: 50%; top: 50%; width: 62vmin; height: 62vmin; transform: translate(-50%,-50%);
  border: 3px solid #0a0a0a; border-radius: 50%; box-shadow: inset 0 0 40px rgba(0,0,0,0.9); }
.scope-cross { position: absolute; background: rgba(10, 12, 10, 0.9); }
.scope-cross.h { left: 15%; right: 15%; top: 50%; height: 1.5px; }
.scope-cross.v { top: 15%; bottom: 15%; left: 50%; width: 1.5px; }
.scope-mil { position: absolute; left: 50%; width: 9px; height: 1.5px; background: #0a0c0a; transform: translateX(-50%); }
.scope-mil.m1 { top: 56%; } .scope-mil.m2 { top: 60%; } .scope-mil.m3 { top: 64%; width: 14px; }

/* airstrike aim */
#airstrike-aim { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.as-frame { width: 34vmin; height: 34vmin; border: 2px dashed var(--amber); position: relative; animation: aspulse 1s infinite; }
@keyframes aspulse { 50% { border-color: var(--red); } }
.as-text { margin-top: 14px; color: var(--amber); font-size: 13px; letter-spacing: 2px; text-shadow: 0 0 6px #000; }

/* top center */
#top-center { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; }
#compass { position: relative; width: 320px; height: 22px; margin: 0 auto; overflow: hidden;
  background: rgba(10, 12, 9, 0.55); border: 1px solid rgba(232,228,212,0.18); border-radius: 3px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
#compass-strip { position: absolute; top: 0; left: calc(50% - 500px); height: 100%; }
.ctick { position: absolute; top: 3px; font-size: 8px; color: rgba(232,228,212,0.5); transform: translateX(-50%); }
.ctick.major { font-size: 12px; font-weight: bold; color: var(--bone); top: 3px; }
#compass-needle { position: absolute; left: 50%; top: 0; width: 2px; height: 100%; background: var(--amber); transform: translateX(-50%); }
#match-timer { margin-top: 4px; font-size: 19px; font-weight: bold; letter-spacing: 2px; text-shadow: 0 1px 3px #000; }
#match-timer.urgent { color: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.45; } }
#objective-row { margin-top: 2px; font-size: 10.5px; letter-spacing: 1.5px; color: rgba(232,228,212,0.85); text-shadow: 0 1px 2px #000; }
#wave-num { color: var(--amber); margin-right: 10px; font-weight: bold; }

/* minimap */
#minimap-holder { position: absolute; top: 12px; left: 12px; }
#minimap { display: block; border-radius: 50%; box-shadow: 0 2px 12px rgba(0,0,0,0.55); }
#score-row { margin-top: 6px; font-size: 12px; letter-spacing: 1px; color: rgba(232,228,212,0.8);
  background: rgba(10,12,9,0.55); padding: 3px 8px; border-radius: 3px; display: inline-block; }
#score-val { color: var(--amber); font-weight: bold; font-size: 14px; }
#xp-row { margin-top: 4px; display: flex; align-items: center; gap: 6px; }
#rank-label { font-size: 10px; color: var(--olive); font-weight: bold; letter-spacing: 1px; }
#xp-bar { width: 110px; height: 5px; background: rgba(10,12,9,0.7); border: 1px solid rgba(232,228,212,0.15); }
#xp-fill { height: 100%; width: 0%; background: var(--olive); transition: width 0.3s; }

/* killfeed */
#killfeed { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.feed-item { background: rgba(10, 12, 9, 0.72); padding: 4px 10px; font-size: 11.5px; letter-spacing: 0.5px;
  border-right: 3px solid var(--amber); border-radius: 2px; transition: opacity 0.5s; animation: feedin 0.18s; }
@keyframes feedin { from { transform: translateX(24px); opacity: 0; } }
.feed-item .k { color: var(--amber); font-weight: bold; }
.feed-item .v { color: #ff8a7a; }
.feed-item .icon { margin: 0 7px; color: var(--bone); }
.feed-item.head .icon { color: var(--amber); }
.feed-item.sys { color: var(--olive); border-right-color: var(--olive); font-weight: bold; }
.feed-item.fade { opacity: 0; }

/* bottom-left: health + streak */
#bottom-left { position: absolute; left: 16px; bottom: 16px; }
#health-cross { font-size: 26px; color: #7fc46a; text-shadow: 0 0 8px rgba(0,0,0,0.8); transition: color 0.3s; }
#health-cross.crit { color: var(--red); animation: blink 0.8s infinite; }
#streak-block { margin-top: 8px; }
#streak-pips { display: flex; gap: 4px; margin-bottom: 6px; }
.pip { width: 13px; height: 13px; background: rgba(232,228,212,0.13); border: 1px solid rgba(232,228,212,0.25); transform: rotate(45deg); }
.pip.on { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 6px rgba(240,181,69,0.6); }
.pip.ms { border-color: var(--amber-dim); border-width: 2px; }
#streak-list { display: flex; flex-direction: column; gap: 3px; }
.ks-item { display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: 1px;
  background: rgba(10,12,9,0.55); padding: 3px 8px; border-radius: 2px; color: rgba(232,228,212,0.45); }
.ks-item.ready { color: var(--amber); box-shadow: 0 0 8px rgba(240,181,69,0.25); animation: blink 1.6s infinite; }
.ks-key { display: inline-block; width: 14px; height: 14px; line-height: 14px; text-align: center;
  border: 1px solid currentColor; border-radius: 2px; font-size: 9px; }
.ks-at { margin-left: auto; font-size: 9px; }

/* bottom-right: weapon */
#bottom-right { position: absolute; right: 18px; bottom: 16px; text-align: right; }
#weapon-slots { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 5px; }
.wslot { font-size: 9px; letter-spacing: 1px; padding: 2px 7px; background: rgba(10,12,9,0.5);
  color: rgba(232,228,212,0.4); border-radius: 2px; }
.wslot.active { color: var(--bone); background: rgba(10,12,9,0.8); border-bottom: 2px solid var(--amber); }
.wslot .wn { color: var(--amber-dim); }
#weapon-name { font-size: 12px; letter-spacing: 2px; color: rgba(232,228,212,0.85); text-shadow: 0 1px 2px #000; }
#ammo-row { margin-top: 2px; text-shadow: 0 1px 3px #000; }
#ammo-mag { font-size: 34px; font-weight: bold; color: var(--bone); }
#ammo-mag.low { color: var(--red); }
#ammo-sep { margin: 0 6px; color: rgba(232,228,212,0.4); font-size: 22px; }
#ammo-reserve { font-size: 18px; color: rgba(232,228,212,0.65); }
#fire-mode { display: inline-block; margin-left: 10px; font-size: 9px; letter-spacing: 1px; color: var(--olive);
  border: 1px solid rgba(154,162,107,0.5); padding: 2px 5px; border-radius: 2px; vertical-align: 6px; }
#grenade-row { margin-top: 3px; font-size: 13px; color: rgba(232,228,212,0.8); }
.nade-icon { color: var(--olive); margin-right: 5px; }
.nade-key { margin-left: 6px; font-size: 9px; color: rgba(232,228,212,0.4); }

/* reload hint */
#reload-hint { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); opacity: 0;
  color: var(--amber); font-size: 13px; letter-spacing: 2px; text-shadow: 0 1px 4px #000; }

/* score popups */
#score-popups { position: absolute; inset: 0; }
.popup { position: absolute; font-size: 17px; font-weight: bold; color: var(--bone); text-shadow: 0 1px 4px #000;
  animation: popup 1.1s forwards; letter-spacing: 1px; }
.popup.head { color: var(--amber); }
.popup.sub { font-size: 12px; }
.popup.wave { color: var(--olive); font-size: 20px; }
@keyframes popup { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(-46px); opacity: 0; } }

/* banner */
#wave-banner { position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%) scale(0.9); opacity: 0;
  text-align: center; transition: all 0.22s; pointer-events: none; }
#wave-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.bn-title { font-size: 40px; font-weight: bold; letter-spacing: 10px; color: var(--bone);
  text-shadow: 0 2px 10px #000, 0 0 30px rgba(240,181,69,0.35); }
.bn-sub { font-size: 13px; letter-spacing: 4px; color: var(--amber); margin-top: 5px; text-shadow: 0 1px 4px #000; }

/* streak toast */
#streak-toast { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); opacity: 0; text-align: center;
  transition: opacity 0.25s; pointer-events: none; }
#streak-toast.show { opacity: 1; }
.st-name { font-size: 21px; font-weight: bold; color: var(--amber); letter-spacing: 4px; text-shadow: 0 0 14px rgba(240,181,69,0.5), 0 2px 6px #000; }
.st-key { font-size: 11px; letter-spacing: 2px; color: var(--bone); margin-top: 3px; text-shadow: 0 1px 3px #000; }

/* respawn overlay */
#respawn-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(60,0,0,0.35), rgba(20,0,0,0.75)); }
.rs-title { font-size: 54px; font-weight: bold; letter-spacing: 16px; color: var(--red); text-shadow: 0 0 24px rgba(255,60,40,0.5); }
.rs-sub { margin-top: 10px; font-size: 15px; letter-spacing: 3px; }
#respawn-timer { color: var(--amber); font-weight: bold; font-size: 19px; }
.rs-note { margin-top: 6px; font-size: 10px; letter-spacing: 2px; color: rgba(232,228,212,0.55); }

/* ==================== MENUS ==================== */
#menu-root { position: fixed; inset: 0; z-index: 20; display: flex; pointer-events: none; }
.screen { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: auto;
  background: linear-gradient(180deg, rgba(8,10,7,0.55), rgba(8,10,7,0.78)); overflow-y: auto; padding: 20px; }
.menu-panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; padding: 34px 44px;
  max-width: 520px; width: 100%; text-align: center; box-shadow: 0 12px 60px rgba(0,0,0,0.7); margin: auto; }
.menu-panel.wide { max-width: 860px; }

.game-logo { font-size: 52px; font-weight: bold; letter-spacing: 6px; line-height: 1; }
.lg-a { color: var(--bone); } .lg-b { color: var(--amber); margin-left: 12px; }
.game-tag { margin-top: 6px; font-size: 11px; letter-spacing: 6px; color: var(--olive); }
#best-score { margin: 22px 0 6px; font-size: 12px; letter-spacing: 1.5px; color: rgba(232,228,212,0.75);
  border: 1px dashed rgba(232,228,212,0.2); padding: 9px; border-radius: 3px; }
#best-score .accent { color: var(--amber); font-weight: bold; font-size: 14px; }

.menu-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.menu-buttons.row { flex-direction: row; justify-content: center; }
.btn { font-family: inherit; font-size: 14px; letter-spacing: 3px; padding: 13px 26px; cursor: pointer;
  background: rgba(232,228,212,0.06); color: var(--bone); border: 1px solid rgba(232,228,212,0.25);
  border-radius: 3px; transition: all 0.12s; }
.btn:hover { background: rgba(240,181,69,0.14); border-color: var(--amber); color: var(--amber); }
.btn.primary { background: rgba(240,181,69,0.16); border-color: var(--amber); color: var(--amber); font-weight: bold; }
.btn.primary:hover { background: rgba(240,181,69,0.3); }

.menu-settings { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 10px; letter-spacing: 2px;
  color: rgba(232,228,212,0.6); }
.menu-settings label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-settings input[type=range] { flex: 1; accent-color: var(--amber); }
.menu-foot { margin-top: 20px; font-size: 9px; letter-spacing: 1.5px; color: rgba(232,228,212,0.35); }

.panel-title { font-size: 26px; font-weight: bold; letter-spacing: 8px; color: var(--bone); margin-bottom: 20px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.card { background: rgba(232,228,212,0.045); border: 1px solid rgba(232,228,212,0.16); border-radius: 4px;
  padding: 16px 14px; cursor: pointer; text-align: left; transition: all 0.13s; }
.card:hover { border-color: var(--amber); background: rgba(240,181,69,0.08); transform: translateY(-2px); }
.card.selected { border-color: var(--amber); background: rgba(240,181,69,0.14); box-shadow: 0 0 18px rgba(240,181,69,0.25); }
.card-title { font-size: 16px; font-weight: bold; letter-spacing: 3px; color: var(--amber); }
.card-weapons { margin-top: 9px; font-size: 11px; line-height: 1.5; }
.cw-main, .cw-sec { color: var(--bone); }
.card-weapons span { color: rgba(232,228,212,0.45); font-size: 9px; margin-left: 7px; letter-spacing: 1px; }
.card-desc { margin-top: 8px; font-size: 10px; line-height: 1.55; color: rgba(232,228,212,0.6); }
.card-stats { margin-top: 10px; }
.stat-row { display: flex; align-items: center; gap: 7px; font-size: 8px; color: rgba(232,228,212,0.5);
  letter-spacing: 1px; margin-top: 3px; }
.stat-row span { width: 32px; }
.stat-bar { flex: 1; height: 4px; background: rgba(232,228,212,0.1); }
.stat-bar div { height: 100%; background: var(--olive); }
.diff-meta { margin-top: 10px; font-size: 10px; color: var(--amber-dim); letter-spacing: 1px; }

.howto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 22px; text-align: left; font-size: 11px;
  letter-spacing: 1px; color: rgba(232,228,212,0.75); margin-bottom: 18px; }
.howto-grid b { color: var(--amber); display: inline-block; min-width: 130px; }
.howto-notes { font-size: 10.5px; line-height: 1.7; color: rgba(232,228,212,0.55); text-align: left; margin-bottom: 18px; }

#pause-stats { display: flex; justify-content: center; gap: 18px; font-size: 11px; letter-spacing: 1px;
  color: rgba(232,228,212,0.65); margin-bottom: 4px; }
#pause-stats b { color: var(--amber); margin-left: 4px; }

#end-title { font-size: 58px; font-weight: bold; letter-spacing: 14px; }
#end-title.win { color: var(--amber); text-shadow: 0 0 34px rgba(240,181,69,0.5); }
#end-title.lose { color: var(--red); text-shadow: 0 0 34px rgba(255,77,61,0.4); }
#end-sub { margin-top: 6px; font-size: 12px; letter-spacing: 3px; color: rgba(232,228,212,0.7); }
#end-stats { margin: 22px auto; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 30px; max-width: 560px; }
.es-row { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 1px;
  color: rgba(232,228,212,0.65); border-bottom: 1px solid rgba(232,228,212,0.1); padding-bottom: 5px; }
.es-row b { color: var(--bone); }
#end-best { min-height: 22px; font-size: 12px; letter-spacing: 2px; color: rgba(232,228,212,0.6); margin-bottom: 10px; }
.newbest { color: var(--amber); font-weight: bold; animation: blink 1.2s infinite; }

/* mobile notice */
#mobile-notice { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center;
  background: rgba(8, 10, 7, 0.9); padding: 24px; }
.mn-panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; padding: 30px 26px;
  max-width: 420px; text-align: center; }
.mn-title { font-size: 20px; font-weight: bold; letter-spacing: 4px; color: var(--amber); }
.mn-body { margin: 16px 0 20px; font-size: 12px; line-height: 1.7; color: rgba(232,228,212,0.75); }

/* ==================== responsive ==================== */
@media (max-width: 720px) {
  .menu-panel { padding: 24px 18px; }
  .game-logo { font-size: 34px; }
  .panel-title { font-size: 19px; letter-spacing: 4px; }
  .howto-grid { grid-template-columns: 1fr; }
  .howto-grid b { min-width: 110px; }
  #end-title { font-size: 36px; letter-spacing: 8px; }
  #end-stats { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  #compass { width: 210px; }
  #minimap { width: 120px; height: 120px; }
  #minimap-holder { top: 8px; left: 8px; }
  #ammo-mag { font-size: 26px; }
  .bn-title { font-size: 26px; letter-spacing: 5px; }
  .rs-title { font-size: 36px; letter-spacing: 8px; }
  .menu-buttons.row { flex-direction: column; }
}
