/* Voxel Strike — HUD + menu styling. Dark military aesthetic, stencil accents. */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b0e0c; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #e8ece4;
  -webkit-user-select: none; user-select: none;
}
#app { position: fixed; inset: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- shared type ---------- */
.stencil {
  font-family: "Arial Black", "Impact", "Segoe UI", sans-serif;
  letter-spacing: .18em;
  font-weight: 900;
}

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  overflow-y: auto; padding: 12px 0;
}
@media (max-height: 700px) {
  .game-logo { font-size: 34px; }
  .menu-panel { margin-top: 12px; gap: 10px; }
  .panel { padding: 10px 14px; }
  .deploy-btn { margin-top: 12px; padding: 11px 48px; font-size: 16px; }
  .controls-hint { margin-top: 8px; }
  .menu-tagline { margin-top: 6px; }
  .screen { justify-content: flex-start; }
}
#menu-screen { background: linear-gradient(180deg, rgba(8,10,8,.42) 0%, rgba(8,10,8,.78) 100%); }
#pause-screen, #death-screen, #end-screen { background: rgba(5,7,5,.72); backdrop-filter: blur(2px); }

.menu-wrap { text-align: center; width: min(680px, 92vw); }
.game-logo {
  font-size: clamp(40px, 7vw, 76px);
  color: #f2f5ec;
  text-shadow: 0 0 24px rgba(255,190,80,.25), 0 3px 0 #1c241c, 0 6px 18px rgba(0,0,0,.8);
}
.game-logo .accent { color: #ffb03a; }
.game-sub {
  margin-top: 2px; font-size: 13px; letter-spacing: .5em; color: #9aa78f; text-transform: uppercase;
}
.menu-tagline { margin-top: 14px; color: #b9c4ae; font-size: 14px; letter-spacing: .04em; }

.menu-panel {
  margin-top: 26px; display: flex; gap: 18px; justify-content: center; align-items: stretch; flex-wrap: wrap;
}
.panel {
  background: rgba(14,18,13,.82);
  border: 1px solid rgba(255,176,58,.22);
  box-shadow: 0 8px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  padding: 16px 18px; text-align: left; width: 300px;
}
.panel h3 { font-size: 12px; letter-spacing: .3em; color: #ffb03a; margin-bottom: 12px; text-transform: uppercase; }

.loadout-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.02);
  transition: background .12s, border-color .12s;
}
.loadout-opt:hover { background: rgba(255,176,58,.10); }
.loadout-opt.selected { border-color: #ffb03a; background: rgba(255,176,58,.14); }
.loadout-opt .lo-key {
  width: 22px; height: 22px; line-height: 22px; text-align: center; font-size: 11px;
  background: #242b20; color: #ffb03a; border: 1px solid rgba(255,176,58,.4); flex: none;
}
.loadout-opt .lo-name { font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.loadout-opt .lo-role { font-size: 10px; color: #93a187; letter-spacing: .12em; text-transform: uppercase; margin-top: 1px; }

.diff-row { display: flex; gap: 6px; }
.diff-btn {
  flex: 1; padding: 9px 4px; text-align: center; cursor: pointer; font-size: 11px; letter-spacing: .14em;
  border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.02); color: #c3cdb6;
}
.diff-btn:hover { background: rgba(255,176,58,.10); }
.diff-btn.selected { border-color: #ffb03a; color: #ffb03a; background: rgba(255,176,58,.14); font-weight: 700; }
.diff-desc { margin-top: 10px; font-size: 11px; color: #93a187; min-height: 26px; line-height: 1.4; }

.deploy-btn {
  margin-top: 26px; padding: 15px 64px; cursor: pointer;
  font-family: "Arial Black", sans-serif; font-size: 20px; letter-spacing: .3em; color: #10130d;
  background: linear-gradient(180deg, #ffc153, #e08f1c);
  border: none; box-shadow: 0 4px 0 #7a4d0c, 0 10px 30px rgba(255,160,40,.25);
  transition: transform .08s, box-shadow .08s;
}
.deploy-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #7a4d0c, 0 14px 34px rgba(255,160,40,.4); }
.deploy-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a4d0c; }
.best-line { margin-top: 14px; font-size: 12px; letter-spacing: .2em; color: #8d9a80; }
.best-line b { color: #ffb03a; }
.controls-hint {
  margin-top: 18px; font-size: 11px; color: #77836c; letter-spacing: .06em; line-height: 1.8;
}
.controls-hint b { color: #aab89b; font-weight: 600; }

/* pause / death / end */
.pause-title, .death-title, .end-title {
  font-size: clamp(30px, 5vw, 54px); color: #f2f5ec; text-shadow: 0 4px 18px rgba(0,0,0,.8);
}
.death-title { color: #ff5340; }
.end-title.victory { color: #ffd25e; }
.end-title.defeat { color: #ff5340; }
.sub-line { margin-top: 8px; font-size: 13px; letter-spacing: .3em; color: #9aa78f; text-transform: uppercase; }
.menu-buttons { margin-top: 30px; display: flex; flex-direction: column; gap: 10px; width: 300px; }
.mbtn {
  padding: 13px; text-align: center; cursor: pointer; font-size: 14px; letter-spacing: .22em; font-weight: 700;
  border: 1px solid rgba(255,176,58,.35); background: rgba(14,18,13,.85); color: #e8ece4;
  transition: background .12s;
}
.mbtn:hover { background: rgba(255,176,58,.18); }
.mbtn.primary { background: linear-gradient(180deg, #ffc153, #e08f1c); color: #10130d; border: none; }
.respawn-count { font-size: clamp(48px, 9vw, 90px); color: #ffb03a; margin-top: 18px; font-family: "Arial Black", sans-serif; }

.stats-grid {
  margin-top: 22px; display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 10px;
  width: min(640px, 90vw);
}
.stat-cell { background: rgba(14,18,13,.85); border: 1px solid rgba(255,255,255,.08); padding: 12px; text-align: center; }
.stat-cell .sv { font-size: 26px; font-weight: 800; color: #ffd25e; font-family: "Arial Black", sans-serif; }
.stat-cell .sl { font-size: 10px; letter-spacing: .18em; color: #93a187; margin-top: 4px; text-transform: uppercase; }
.newbest { margin-top: 12px; color: #ffd25e; font-size: 13px; letter-spacing: .3em; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }

/* crosshair */
#xhair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.xh-line { position: absolute; background: #f4ffe8; box-shadow: 0 0 3px rgba(0,0,0,.9); }
.xh-dot { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: #f4ffe8; }
#xhair.hitflash .xh-line, #xhair.hitflash .xh-dot { background: #ffd25e; }

/* hitmarker */
#hitmarker {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0;
}
.hm-line { position: absolute; width: 10px; height: 2px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.8); }
.hm-line:nth-child(1) { transform: translate(-12px,-9px) rotate(45deg); }
.hm-line:nth-child(2) { transform: translate(2px,-9px) rotate(-45deg); }
.hm-line:nth-child(3) { transform: translate(-12px,7px) rotate(-45deg); }
.hm-line:nth-child(4) { transform: translate(2px,7px) rotate(45deg); }
#hitmarker.headshot .hm-line { background: #ff5340; }
#hitmarker.show { animation: hm-pop .22s ease-out; }
@keyframes hm-pop { 0% { opacity: 1; transform: scale(1.35); } 100% { opacity: 0; transform: scale(.9); } }

/* damage vignette */
#dmg-vignette {
  position: absolute; inset: 0; opacity: 0; transition: opacity .18s;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(200,10,0,.55) 100%);
}
#heal-flash {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(80,200,90,.28) 100%);
}
#dmg-flash {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,30,10,.12) 0%, rgba(255,20,0,.38) 100%);
}
#dmg-direction {
  position: absolute; left: 50%; top: 50%; width: 130px; height: 130px; margin: -65px 0 0 -65px;
  opacity: 0;
}
.dir-arc {
  position: absolute; left: 50%; top: -34px; width: 46px; height: 22px; margin-left: -23px;
  border-radius: 50% 50% 0 0; border-top: 4px solid rgba(255,60,30,.95);
  transform-origin: 50% 99px;
}

/* bottom-left: health */
#health-wrap { position: absolute; left: 26px; bottom: 24px; width: 230px; }
#health-label { font-size: 10px; letter-spacing: .3em; color: #93a187; margin-bottom: 5px; }
#health-bar-bg { height: 9px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15); }
#health-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #7dc05a, #a8dd72); transition: width .15s; }
#health-bar.hurt { background: linear-gradient(90deg, #d8a03a, #e8c05a); }
#health-bar.critical { background: linear-gradient(90deg, #c93a26, #e8573c); }
#health-num { font-size: 12px; color: #c3cdb6; margin-top: 4px; letter-spacing: .1em; }
#streak-lives { margin-top: 6px; font-size: 10px; letter-spacing: .2em; color: #77836c; }

/* bottom-right: ammo */
#ammo-wrap { position: absolute; right: 26px; bottom: 24px; text-align: right; }
#weapon-name { font-size: 12px; letter-spacing: .24em; color: #ffb03a; font-weight: 700; }
#ammo-line { margin-top: 2px; }
#ammo-mag { font-family: "Arial Black", sans-serif; font-size: 40px; color: #f2f5ec; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
#ammo-mag.low { color: #ff8340; }
#ammo-mag.empty { color: #ff5340; }
#ammo-reserve { font-size: 16px; color: #93a187; margin-left: 6px; }
#nade-line { margin-top: 4px; font-size: 12px; color: #c3cdb6; letter-spacing: .12em; }
#nade-line .nade-pip { display: inline-block; width: 9px; height: 9px; margin-left: 4px; background: #ffb03a; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
#nade-line .nade-pip.spent { background: #3a4234; }
#resupply-hint { margin-top: 5px; font-size: 10px; color: #7dc05a; letter-spacing: .16em; opacity: 0; }
#resupply-hint.on { opacity: 1; animation: pulse 1s infinite; }

/* reload indicator */
#reload-ind {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .34em; color: #ffd25e; opacity: 0;
}
#reload-ind.on { opacity: 1; animation: pulse .7s infinite; }

/* top-left: minimap + objective */
#minimap-wrap { position: absolute; left: 20px; top: 20px; }
#minimap { width: 164px; height: 164px; border: 1px solid rgba(255,255,255,.18); background: rgba(8,10,8,.62); }
#objective { margin-top: 8px; font-size: 11px; letter-spacing: .18em; color: #c3cdb6; text-shadow: 0 1px 3px #000; }
#objective b { color: #ffb03a; }
#wave-line { margin-top: 3px; font-size: 10px; letter-spacing: .2em; color: #77836c; }

/* top-center: compass + timer */
#compass-wrap { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 380px; text-align: center; }
#compass { width: 380px; height: 30px; background: rgba(8,10,8,.45); border: 1px solid rgba(255,255,255,.12); }
#match-timer { margin-top: 5px; font-family: "Arial Black", sans-serif; font-size: 15px; color: #e8ece4; letter-spacing: .12em; text-shadow: 0 1px 4px #000; }

/* top-right: score + killfeed */
#score-wrap { position: absolute; right: 20px; top: 20px; text-align: right; }
#score-num { font-family: "Arial Black", sans-serif; font-size: 24px; color: #ffd25e; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
#score-label { font-size: 9px; letter-spacing: .3em; color: #93a187; }
#streakmeter { margin-top: 7px; display: flex; gap: 4px; justify-content: flex-end; }
.streak-pip { width: 26px; height: 5px; background: #2a3226; border: 1px solid rgba(255,255,255,.1); }
.streak-pip.lit { background: #ffb03a; box-shadow: 0 0 6px rgba(255,176,58,.7); }
#killfeed { position: absolute; right: 20px; top: 92px; text-align: right; font-size: 12px; }
.kf-row {
  margin-bottom: 4px; padding: 4px 9px; background: rgba(8,10,8,.6); border-right: 3px solid #ffb03a;
  color: #dbe4cf; letter-spacing: .04em; animation: kf-in .18s ease-out;
}
.kf-row .kf-victim { color: #ff8d6e; }
.kf-row .kf-method { color: #ffb03a; font-weight: 700; }
.kf-row.death { border-right-color: #ff5340; }
.kf-row.streakfeed { border-right-color: #7db8ff; color: #cfe4ff; }
@keyframes kf-in { from { transform: translateX(24px); opacity: 0; } }

/* score popups */
#popups { position: absolute; left: 50%; top: 56%; width: 0; height: 0; }
.popup {
  position: absolute; transform: translateX(-50%); white-space: nowrap;
  font-family: "Arial Black", sans-serif; font-size: 16px; color: #ffd25e;
  text-shadow: 0 2px 5px rgba(0,0,0,.85); animation: pop-rise 1s ease-out forwards;
}
.popup.bonus { color: #ff8340; font-size: 12px; }
@keyframes pop-rise { 0% { opacity: 0; margin-top: 8px; } 12% { opacity: 1; } 100% { opacity: 0; margin-top: -44px; } }

/* streaks ready bar */
#streak-bar { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); display: flex; gap: 10px; }
.streak-slot {
  padding: 7px 12px; font-size: 11px; letter-spacing: .14em; color: #67755c;
  background: rgba(8,10,8,.55); border: 1px solid rgba(255,255,255,.09);
}
.streak-slot .sk {
  display: inline-block; min-width: 18px; padding: 1px 4px; margin-right: 7px; text-align: center;
  background: #242b20; border: 1px solid rgba(255,255,255,.14); color: #93a187; font-size: 10px;
}
.streak-slot.ready { color: #ffd25e; border-color: #ffb03a; animation: pulse 1.1s infinite; }
.streak-slot.ready .sk { color: #ffb03a; border-color: #ffb03a; }

/* killstreak banners + wave banners */
#banner {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%); text-align: center; opacity: 0;
  pointer-events: none;
}
#banner.show { animation: banner-in 2.6s ease-out forwards; }
#banner-title { font-family: "Arial Black", sans-serif; font-size: 38px; color: #ffd25e; text-shadow: 0 3px 14px rgba(0,0,0,.9); letter-spacing: .18em; }
#banner-sub { font-size: 13px; letter-spacing: .34em; color: #e8ece4; margin-top: 4px; }
#banner.hostile #banner-title { color: #ff5340; }
@keyframes banner-in {
  0% { opacity: 0; transform: translateX(-50%) scale(1.25); }
  10% { opacity: 1; transform: translateX(-50%) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; }
}

/* wave intermission counter */
#wave-countdown {
  position: absolute; left: 50%; top: 40%; transform: translateX(-50%); text-align: center;
  font-family: "Arial Black", sans-serif; font-size: 52px; color: #f2f5ec; text-shadow: 0 3px 12px rgba(0,0,0,.85);
}
#wave-countdown .wc-label { font-size: 13px; letter-spacing: .4em; color: #ffb03a; font-family: "Segoe UI", sans-serif; }

/* damage flash on low hp heartbeat */
#lowhp-pulse { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(190,20,0,.4) 100%); }

/* touch notice */
#touch-notice { position: absolute; inset: 0; z-index: 80; background: rgba(5,7,5,.92); display: flex; align-items: center; justify-content: center; padding: 20px; }
.touch-card { max-width: 420px; background: #11150f; border: 1px solid rgba(255,176,58,.35); padding: 26px; text-align: center; }
.touch-title { font-family: "Arial Black", sans-serif; letter-spacing: .2em; color: #ffb03a; font-size: 18px; }
.touch-body { margin: 14px 0 20px; font-size: 13px; line-height: 1.6; color: #b9c4ae; }
#touch-anyway { padding: 11px 18px; background: none; border: 1px solid rgba(255,255,255,.25); color: #c3cdb6; cursor: pointer; letter-spacing: .1em; }
#touch-anyway:hover { background: rgba(255,255,255,.07); }

#fatal { position: absolute; inset: 0; z-index: 90; background: #0b0e0c; color: #ff8d6e; padding: 40px; font-size: 14px; font-family: monospace; white-space: pre-wrap; }

/* sniper scope overlay */
#scope-overlay { position: absolute; inset: 0; opacity: 0; transition: opacity .12s; pointer-events: none; }
#scope-overlay.on { opacity: 1; }
#scope-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, transparent 26vmin, rgba(2,3,2,.985) 27vmin);
}
#scope-reticle-h, #scope-reticle-v { position: absolute; left: 50%; top: 50%; background: rgba(10,14,10,.85); }
#scope-reticle-h { width: 52vmin; height: 1.5px; transform: translate(-50%, -50%); }
#scope-reticle-v { width: 1.5px; height: 52vmin; transform: translate(-50%, -50%); }
#scope-ring { position: absolute; left: 50%; top: 50%; width: 53vmin; height: 53vmin; transform: translate(-50%,-50%); border-radius: 50%; border: 3px solid rgba(20,24,20,.9); }
