:root {
  --blue: #5b87b5;
  --red: #b8594c;
  --paper: #d8d4c8;
  --ink: #11150f;
  --scope-d: min(92vmin, 100vw);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; background: #0a0d10; }

body {
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: var(--paper);
  user-select: none;
  -webkit-user-select: none;
}

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

/* ---------- menu ---------- */

#menu {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(70, 90, 70, 0.25), transparent 60%),
    linear-gradient(180deg, #0d1216 0%, #131a16 55%, #0b0f0c 100%);
}

#menu-box { text-align: center; max-width: 520px; padding: 32px; }

#menu h1 {
  font-size: 56px; letter-spacing: 14px; font-weight: 800; color: var(--paper);
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}
#menu h1 span { color: #8fa876; }

#menu .tag {
  margin: 8px 0 36px; letter-spacing: 3px; font-size: 13px;
  color: #93a08c; text-transform: uppercase;
}

#name {
  display: block; width: 280px; margin: 0 auto 14px; padding: 12px 16px;
  background: rgba(0,0,0,0.4); color: var(--paper);
  border: 1px solid #3c4a3a; border-radius: 3px;
  font-size: 17px; letter-spacing: 2px; text-align: center; outline: none;
}
#name:focus { border-color: #8fa876; }

#join {
  width: 280px; padding: 13px; font-size: 17px; letter-spacing: 6px; font-weight: 700;
  color: #131a13; background: #8fa876; border: none; border-radius: 3px; cursor: pointer;
}
#join:hover { background: #a4bd8a; }
#join:disabled { background: #4a5546; color: #20281f; cursor: wait; }

#menu-msg { min-height: 22px; margin-top: 14px; color: #c97a5e; letter-spacing: 1px; font-size: 14px; }

.controls {
  margin-top: 30px; font-size: 12.5px; line-height: 2; letter-spacing: 1.5px;
  color: #7d8a78;
}

#vol-wrap {
  display: inline-flex; gap: 10px; align-items: center; margin-top: 22px;
  font-size: 12px; letter-spacing: 2px; color: #7d8a78; text-transform: uppercase;
}
#vol { accent-color: #8fa876; width: 140px; }

/* ---------- HUD ---------- */

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

#crosshair {
  position: absolute; left: 50%; top: 50%; width: 3px; height: 3px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(225, 228, 215, 0.85);
  box-shadow: 0 0 4px rgba(0,0,0,0.9);
}

#vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(8, 10, 8, 0.42) 100%);
}

/* scope */
#scope { position: absolute; inset: 0; }
.scope-hole {
  position: absolute; left: 50%; top: 50%;
  width: var(--scope-d); height: var(--scope-d);
  transform: translate(-50%, -50%); border-radius: 50%;
  box-shadow:
    0 0 0 200vmax rgba(4, 6, 5, 0.99),
    inset 0 0 90px 35px rgba(0, 0, 0, 0.95),
    inset 0 0 220px 60px rgba(0, 0, 0, 0.45);
}
.reticle { position: absolute; left: 50%; top: 50%; background: rgba(10, 12, 10, 0.92); }
.reticle-h { width: var(--scope-d); height: 1.5px; transform: translate(-50%, -50%); }
.reticle-v { width: 1.5px; height: var(--scope-d); transform: translate(-50%, -50%); }
.scope-dot {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 5px;
  transform: translate(-50%, -50%); border-radius: 50%; background: rgba(10,12,10,0.95);
}

/* top bar */
#topbar {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 26px; align-items: baseline;
  font-weight: 800; text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
#score-blue { color: var(--blue); font-size: 30px; }
#score-red { color: var(--red); font-size: 30px; }
#score-title { color: rgba(216,212,200,0.5); font-size: 11px; letter-spacing: 6px; }

#compass {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  opacity: 0.85;
}

/* killfeed */
#killfeed {
  position: absolute; top: 18px; right: 22px; text-align: right;
  font-size: 14px; letter-spacing: 0.5px;
}
#killfeed .entry {
  margin-bottom: 6px; padding: 5px 10px; border-radius: 2px;
  background: rgba(8, 11, 9, 0.55); text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  transition: opacity 1s;
}
#killfeed .t0 { color: var(--blue); font-weight: 700; }
#killfeed .t1 { color: var(--red); font-weight: 700; }
#killfeed .skull { color: #d8d4c8; opacity: 0.8; margin: 0 7px; }
#killfeed .entry.headshot { background: rgba(60, 12, 8, 0.6); box-shadow: inset 2px 0 0 #d9483b; }
#killfeed .hs-mark { display: inline-flex; align-items: center; margin: 0 7px; vertical-align: middle; }
#killfeed .hs-head { color: #e85544; filter: drop-shadow(0 0 5px rgba(232, 85, 68, 0.85)); }

/* ammo */
#ammo {
  position: absolute; right: 30px; bottom: 26px; text-align: right;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
#ammo-count { font-size: 42px; font-weight: 800; }
#ammo-mag { font-size: 18px; color: rgba(216,212,200,0.55); }
#bolt-state { font-size: 11px; letter-spacing: 4px; color: #8fa876; margin-top: 2px; }
#bolt-state.busy { color: #c9a05e; }
#stance { font-size: 11px; letter-spacing: 4px; color: rgba(216,212,200,0.7); margin-top: 4px; }

/* killstreak perks */
#perks {
  position: absolute; left: 22px; bottom: 26px;
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
#perks .streak { font-size: 11px; letter-spacing: 3px; color: #8a9486; margin-bottom: 3px; }
#perks .perk {
  display: flex; align-items: center; gap: 9px; min-width: 168px;
  font-size: 13px; letter-spacing: 2px; padding: 4px 8px 4px 12px; border-radius: 3px;
  background: rgba(8,11,9,0.5); color: rgba(216,212,200,0.32);
  border-left: 3px solid rgba(216,212,200,0.15);
}
#perks .perk b { color: inherit; }            /* kills needed to earn the perk */
#perks .perk .perk-name { flex: 1; }          /* fills the row, pushing the key right */
#perks .perk kbd {                            /* key-shaped square: the deploy key */
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1; color: inherit;
  background: rgba(216,212,200,0.1); border: 1px solid rgba(216,212,200,0.35);
  border-bottom-width: 2px; border-radius: 4px;
}
#perks .perk.on { color: #d8d4c8; border-left-color: #8fa876; }
#perks .perk.on.active { color: #fff; border-left-color: #e8a23a; background: rgba(70,42,12,0.6); }

#pilot {
  position: absolute; left: 50%; bottom: 13vh; transform: translateX(-50%);
  padding: 7px 22px; background: rgba(70,20,8,0.6); border-radius: 3px;
  font-size: 14px; letter-spacing: 4px; color: #ffcaa6; text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

#mount-prompt {
  position: absolute; left: 50%; bottom: 18vh; transform: translateX(-50%);
  padding: 7px 20px; background: rgba(12,16,12,0.62); border-radius: 3px;
  font-size: 14px; letter-spacing: 3px; color: #d8e4cf; text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}

/* HMG heat gauge */
#heat {
  position: absolute; left: 50%; bottom: 14vh; transform: translateX(-50%);
  width: 220px; height: 8px; border-radius: 4px;
  background: rgba(10,12,10,0.6); border: 1px solid rgba(216,212,200,0.25);
  overflow: hidden;
}
#heat-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7fc24a 0%, #e8c24a 55%, #e8783a 100%);
  transition: width 0.08s linear;
}
#heat-fill.over {
  background: #e8463b;
  animation: heatpulse 0.5s ease-in-out infinite;
}
@keyframes heatpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* chat: a fading message log above the perks, with an input box when open */
#chat-log {
  position: absolute; left: 22px; bottom: 232px; width: 460px;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,0.9); pointer-events: none;
}
#chat-log .line {
  background: rgba(8,11,9,0.42); padding: 2px 9px; border-radius: 3px;
  color: #d8d4c8; max-width: 100%; transition: opacity 0.6s;
}
#chat-log .line.sys { color: #e8c45a; }
#chat-log .line .t0 { color: var(--blue); font-weight: 700; }
#chat-log .line .t1 { color: var(--red); font-weight: 700; }
#chat-input {
  position: absolute; left: 22px; bottom: 198px; width: 460px; pointer-events: auto;
  padding: 7px 11px; font-family: inherit; font-size: 14px; letter-spacing: 1px;
  color: #fff; background: rgba(8,11,9,0.82); border: 1px solid rgba(216,212,200,0.32);
  border-radius: 3px; outline: none;
}
#chat-input::placeholder { color: rgba(216,212,200,0.4); }

/* drone FPV feed overlay */
#drone-hud {
  position: absolute; inset: 0; pointer-events: none;
  color: #8fe6a8; font-size: 13px; letter-spacing: 3px;
  text-shadow: 0 0 6px rgba(40,200,110,0.6);
  box-shadow: inset 0 0 120px 20px rgba(20,60,30,0.45);
}
#drone-hud .dh-corner { position: absolute; width: 42px; height: 42px; border: 2px solid rgba(120,230,150,0.7); }
#drone-hud .tl { top: 70px; left: 40px; border-right: none; border-bottom: none; }
#drone-hud .tr { top: 70px; right: 40px; border-left: none; border-bottom: none; }
#drone-hud .bl { bottom: 70px; left: 40px; border-right: none; border-top: none; }
#drone-hud .br { bottom: 70px; right: 40px; border-left: none; border-top: none; }
#drone-hud .dh-reticle {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px;
  transform: translate(-50%, -50%); border: 1.5px solid rgba(140,240,170,0.8); border-radius: 50%;
}
#drone-hud .dh-reticle::before, #drone-hud .dh-reticle::after {
  content: ''; position: absolute; background: rgba(140,240,170,0.8);
}
#drone-hud .dh-reticle::before { left: 50%; top: -12px; width: 1.5px; height: 70px; transform: translateX(-50%); }
#drone-hud .dh-reticle::after { top: 50%; left: -12px; height: 1.5px; width: 70px; transform: translateY(-50%); }
#drone-hud .dh-top { position: absolute; top: 78px; left: 50%; transform: translateX(-50%); font-weight: 700; }
#drone-hud .dh-readout { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; }
#drone-hud .dh-readout span { font-size: 22px; font-weight: 800; color: #c6ffd6; }
#drone-hud .dh-left { left: 56px; text-align: left; }
#drone-hud .dh-right { right: 56px; text-align: right; }
#drone-hud .dh-bottom {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 2px; color: rgba(160,240,180,0.85);
}

/* AC-130 gun-camera overlay: monochrome IR look with a boxed cannon reticle */
#ac130-hud {
  position: absolute; inset: 0; pointer-events: none;
  color: #c9d2c0; font-size: 13px; letter-spacing: 3px;
  text-shadow: 0 0 5px rgba(180,200,170,0.5);
  box-shadow: inset 0 0 200px 40px rgba(0,0,0,0.55);
}
#ac130-hud::after {        /* faint scanlines */
  content: ''; position: absolute; inset: 0; opacity: 0.5;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.14) 2px 4px);
}
#ac130-hud .ac-scan {
  position: absolute; left: 50%; top: 50%; width: 240px; height: 240px;
  transform: translate(-50%, -50%); border: 1px solid rgba(200,210,190,0.25); border-radius: 50%;
}
#ac130-hud .ac-reticle {
  position: absolute; left: 50%; top: 50%; width: 120px; height: 120px;
  transform: translate(-50%, -50%); border: 1.5px solid rgba(220,230,210,0.7);
}
#ac130-hud .ac-reticle::before, #ac130-hud .ac-reticle::after {
  content: ''; position: absolute; background: rgba(220,230,210,0.7);
}
#ac130-hud .ac-reticle::before { left: 50%; top: -40px; width: 1.5px; height: 200px; transform: translateX(-50%); }
#ac130-hud .ac-reticle::after { top: 50%; left: -40px; height: 1.5px; width: 200px; transform: translateY(-50%); }
#ac130-hud .ac-tick { position: absolute; background: rgba(255,90,70,0.95); }
#ac130-hud .t-top, #ac130-hud .t-bottom { left: 50%; width: 2px; height: 10px; transform: translateX(-50%); }
#ac130-hud .t-left, #ac130-hud .t-right { top: 50%; height: 2px; width: 10px; transform: translateY(-50%); }
#ac130-hud .t-top { top: 6px; } #ac130-hud .t-bottom { bottom: 6px; }
#ac130-hud .t-left { left: 6px; } #ac130-hud .t-right { right: 6px; }
#ac130-hud .ac-top { position: absolute; top: 78px; left: 50%; transform: translateX(-50%); font-weight: 700; }
#ac130-hud .ac-left, #ac130-hud .ac-right { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; }
#ac130-hud .ac-left { left: 60px; text-align: left; }
#ac130-hud .ac-right { right: 60px; text-align: right; }
#ac130-hud .ac-right span { font-size: 22px; font-weight: 800; color: #fff; }
#ac130-hud .ac-bottom {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 2px; color: rgba(210,220,200,0.85);
}
#ping { font-size: 10px; letter-spacing: 2px; color: rgba(216,212,200,0.45); margin-top: 4px; }
#ping .udp { color: #8fa876; }
#ping .tcp { color: #c9a05e; }

/* breath meter */
#breath {
  position: absolute; left: 50%; bottom: 13vh; transform: translateX(-50%);
  width: 200px; height: 5px; background: rgba(0,0,0,0.55); border-radius: 3px;
  outline: 1px solid rgba(216,212,200,0.25);
}
#breath-fill {
  height: 100%; width: 100%; border-radius: 3px; background: #9fb7d1;
  transition: width 0.1s linear;
}
#breath-fill.winded { background: #c97a5e; }

/* hitmarker */
#hitmarker {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%);
  font-size: 34px; font-weight: 800; color: #e8e4d8;
  text-shadow: 0 0 12px rgba(255, 80, 60, 0.9);
}
#hitmarker.hs { color: #e85544; font-size: 42px; text-shadow: 0 0 16px rgba(232, 85, 68, 1); }

/* banner */
#banner {
  position: absolute; top: 24vh; left: 50%; transform: translateX(-50%);
  padding: 8px 26px; background: rgba(8, 11, 9, 0.6); border-radius: 2px;
  font-size: 16px; letter-spacing: 4px; text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* death overlay */
#death {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(ellipse at center, rgba(60, 8, 4, 0.45) 0%, rgba(12, 4, 2, 0.88) 100%);
}
#death-title { font-size: 30px; font-weight: 800; letter-spacing: 10px; color: #d8d4c8; }
#death-by { font-size: 15px; letter-spacing: 3px; color: #b08a80; }
#death-count { font-size: 88px; font-weight: 800; color: #e8e4d8; text-shadow: 0 0 30px rgba(180, 40, 20, 0.7); }
#death-hint { font-size: 12px; letter-spacing: 4px; color: #8a7d74; text-transform: uppercase; }

/* scoreboard */
#scoreboard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(8, 11, 9, 0.82); padding: 24px 34px; border-radius: 4px;
  border: 1px solid rgba(216,212,200,0.15);
}
#scoreboard table { border-collapse: collapse; min-width: 380px; }
#scoreboard th {
  font-size: 11px; letter-spacing: 3px; color: #7d8a78; text-align: left;
  padding: 4px 18px 10px 4px;
}
#scoreboard td { padding: 5px 18px 5px 4px; font-size: 15px; letter-spacing: 1px; }
#scoreboard .me td { background: rgba(143, 168, 118, 0.12); }
#scoreboard .dead td:first-child { opacity: 0.5; }

/* pause */
#pause {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: rgba(6, 9, 7, 0.72);
}
.pause-title { font-size: 26px; letter-spacing: 12px; font-weight: 800; }
.pause-hint { font-size: 13px; letter-spacing: 3px; color: #8fa876; text-transform: uppercase; }
#pause .controls { margin-top: 18px; text-align: center; }
