/* UNDEAD PROTOCOL — HUD & menus */
* { margin:0; padding:0; box-sizing:border-box; }
[hidden] { display:none !important; }
html,body { width:100%; height:100%; overflow:hidden; background:#04060a; }
body { font-family:'Segoe UI', Arial, sans-serif; color:#d8dee6; user-select:none; }
#c { position:fixed; inset:0; width:100%; height:100%; display:block; cursor:crosshair; }

/* ---------- overlays ---------- */
#vignette { position:fixed; inset:0; pointer-events:none; z-index:5;
  background:radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }
#dmg { position:fixed; inset:0; pointer-events:none; z-index:6; opacity:0;
  background:radial-gradient(ellipse at center, transparent 40%, rgba(140,0,0,.75) 100%);
  transition:opacity .12s; }
#nuke-flash { position:fixed; inset:0; pointer-events:none; z-index:7; background:#fff;
  opacity:0; transition:opacity .9s; }
#scope { position:fixed; inset:0; pointer-events:none; z-index:4;
  background:radial-gradient(circle at center, transparent 21%, rgba(0,0,0,.985) 23%); }
#scope::before { content:''; position:absolute; left:50%; top:50%; width:82vmin; height:82vmin;
  transform:translate(-50%,-50%); border-radius:50%;
  border:2px solid rgba(10,10,10,.9); box-shadow:0 0 0 3px rgba(60,60,60,.45); }
#scope::after { content:''; position:absolute; inset:0;
  background:
    radial-gradient(circle at center, rgba(255,50,50,.95) 0 2.5px, transparent 3.5px),
    linear-gradient(rgba(0,0,0,.9), rgba(0,0,0,.9)) center / 100% 1.5px no-repeat,
    linear-gradient(rgba(0,0,0,.9), rgba(0,0,0,.9)) center / 1.5px 100% no-repeat; }

/* ---------- HUD ---------- */
#hud { position:fixed; inset:0; pointer-events:none; z-index:10; }
#hud [hidden] { display:none !important; }

#top-left { position:absolute; top:24px; left:28px; text-align:left; }
#round-box { display:flex; align-items:baseline; gap:10px; }
#round-label { font-size:15px; letter-spacing:5px; color:#9aa3ad; }
#round-num { font-family:'Impact','Arial Black',sans-serif; font-size:64px; line-height:.9;
  color:#e33; text-shadow:0 0 18px rgba(255,30,30,.65), 0 0 2px #000; }
.tl-row { font-size:12px; letter-spacing:3px; color:#aab3bd; margin-top:8px; text-shadow:0 1px 2px #000; }
.tl-row b { color:#e8eef5; font-size:14px; }

#announce { position:absolute; top:18%; width:100%; text-align:center;
  font-family:'Impact','Arial Black',sans-serif; font-size:52px; letter-spacing:6px;
  color:#e33; text-shadow:0 0 22px rgba(255,30,30,.8), 0 2px 4px #000;
  opacity:0; transition:opacity .4s; }
#subann { position:absolute; top:calc(18% + 66px); width:100%; text-align:center;
  font-size:16px; letter-spacing:4px; color:#cfd6de; text-shadow:0 1px 3px #000;
  opacity:0; transition:opacity .4s; }
#event-banner { position:absolute; top:76px; left:50%; transform:translateX(-50%);
  font-size:15px; letter-spacing:4px; padding:8px 22px; color:#ffd98a;
  background:rgba(10,12,16,.75); border:1px solid rgba(255,200,90,.4);
  opacity:0; transition:opacity .3s; text-shadow:0 0 10px rgba(255,190,60,.6); }

#boss-wrap { position:absolute; top:110px; left:50%; transform:translateX(-50%);
  width:min(560px,70vw); text-align:center; }
#boss-name { font-family:'Impact','Arial Black',sans-serif; font-size:22px; letter-spacing:6px;
  color:#ff5b5b; text-shadow:0 0 14px rgba(255,40,40,.7); margin-bottom:6px; }
#boss-wrap .bar { height:10px; background:rgba(0,0,0,.6); border:1px solid #66262c; }
#boss-fill { height:100%; width:100%; background:linear-gradient(#ff6a6a,#a01010); }

/* power-ups */
#pu-list { position:absolute; right:26px; top:38%; display:flex; flex-direction:column;
  gap:8px; align-items:flex-end; }
.pu-item { display:flex; align-items:center; gap:10px; background:rgba(8,10,14,.7);
  border:1px solid rgba(255,255,255,.14); padding:6px 12px; font-size:12px;
  letter-spacing:2px; text-shadow:0 1px 2px #000; }
.pu-item i { width:22px; height:22px; border-radius:3px; display:inline-block; }

/* unstuck cooldown — small, top right */
#unstuck-ind { position:absolute; top:26px; right:28px; font-size:11px;
  letter-spacing:2px; color:#79828c; text-shadow:0 1px 2px #000; }
#unstuck-ind.ready { color:#8fd18f; }

/* crosshair */
#crosshair { position:absolute; left:50%; top:50%; width:2px; height:2px; }
#crosshair .ch { position:absolute; background:#dff; box-shadow:0 0 3px rgba(0,255,255,.8); opacity:.85; }
#ch-t,#ch-b { width:2px; height:9px; left:-1px; }
#ch-l,#ch-r { width:9px; height:2px; top:-1px; }
#ch-dot { position:absolute; left:-1px; top:-1px; width:2px; height:2px; background:#fff; }
#hitmarker { position:absolute; left:50%; top:50%; width:0; height:0; opacity:0; }
#hitmarker span { position:absolute; width:2px; height:10px; background:#fff; left:-1px; top:-5px; }
#hitmarker span:nth-child(1){ transform:rotate(45deg) translateY(-11px); }
#hitmarker span:nth-child(2){ transform:rotate(135deg) translateY(-11px); }
#hitmarker span:nth-child(3){ transform:rotate(225deg) translateY(-11px); }
#hitmarker span:nth-child(4){ transform:rotate(315deg) translateY(-11px); }
#hitmarker.hs span { background:#ff5b5b; height:14px; }
#hs-pop { position:absolute; left:50%; top:calc(50% - 60px); transform:translateX(-50%);
  font-family:'Impact','Arial Black',sans-serif; font-size:20px; letter-spacing:4px;
  color:#ff7676; text-shadow:0 0 12px rgba(255,60,60,.8); opacity:0; }

#interact { position:absolute; left:50%; top:62%; transform:translateX(-50%);
  font-size:15px; letter-spacing:2px; color:#e8eef5; background:rgba(8,10,14,.72);
  padding:10px 20px; border:1px solid rgba(255,255,255,.18); opacity:0; transition:opacity .15s;
  text-shadow:0 1px 2px #000; white-space:nowrap; }
#interact b { color:#ffd76a; font-size:17px; }
#interact .deny { color:#ff8080; }

/* bottom-left: points & perks */
#bottom-left { position:absolute; left:28px; bottom:26px; }
#points { font-family:'Consolas',monospace; font-size:34px; color:#ffd76a;
  text-shadow:0 0 12px rgba(255,200,60,.35), 0 2px 3px #000; }
#pfloat { position:absolute; left:0; top:-26px; width:200%; }
.pf { position:absolute; font-family:'Consolas',monospace; font-size:18px;
  animation:pfup 1.1s ease-out forwards; text-shadow:0 1px 2px #000; }
.pf.gain { color:#ffe9a0; } .pf.loss { color:#ff9d8a; }
@keyframes pfup { from { opacity:1; transform:translateY(0);} to { opacity:0; transform:translateY(-34px);} }
#perk-list { display:flex; gap:6px; margin-top:10px; }
.perk-ico { width:34px; height:34px; border-radius:4px; display:flex; align-items:center;
  justify-content:center; font-family:'Impact',sans-serif; font-size:17px; color:#111;
  box-shadow:0 0 10px rgba(0,0,0,.6), inset 0 0 6px rgba(255,255,255,.35);
  border:1px solid rgba(0,0,0,.5); text-shadow:0 1px 0 rgba(255,255,255,.4); }
.perk-ico.used { filter:grayscale(1) brightness(.5); }

/* bottom-center: bars */
#bottom-center { position:absolute; left:50%; bottom:26px; transform:translateX(-50%);
  width:min(420px,40vw); }
#bottom-center .bar { height:7px; margin-top:5px; background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.12); }
#hp-fill { height:100%; width:100%; background:linear-gradient(#e8eef5,#8fa0b0); transition:width .15s; }
#hp-fill.low { background:linear-gradient(#ff5b5b,#8a0f0f); }
#ar-fill { height:100%; width:0%; background:linear-gradient(#7ecbff,#1b6fa8); }
#st-fill { height:100%; width:100%; background:rgba(255,255,255,.25); }
#stam-bar { height:3px; }

/* bottom-right: weapon */
#bottom-right { position:absolute; right:28px; bottom:26px; text-align:right; }
#wname { font-family:'Impact','Arial Black',sans-serif; font-size:24px; letter-spacing:3px;
  color:#e8eef5; text-shadow:0 2px 4px #000; }
#wtag { font-size:11px; letter-spacing:2px; color:#8fd18f; min-height:14px; }
#ammo { font-family:'Consolas',monospace; font-size:26px; color:#d8dee6; text-shadow:0 2px 3px #000; }
#ammo b { font-size:34px; color:#fff; } #ammo b.empty { color:#ff5b5b; }
#ammo-res { font-size:18px; color:#98a2ac; }

/* Fortnite-style loadout slots */
#loadout { position:absolute; right:0; bottom:96px; display:flex; flex-direction:column;
  gap:8px; align-items:flex-end; pointer-events:none; }
.lo-slot { position:relative; width:178px; height:58px; border-radius:4px;
  border:1px solid rgba(255,255,255,.30); display:flex; align-items:center; justify-content:center;
  opacity:.5; transform:scale(.9); transform-origin:right center; transition:all .13s ease;
  box-shadow:0 3px 10px rgba(0,0,0,.55); overflow:hidden; }
.lo-slot.selected { opacity:1; transform:scale(1); border-color:#fff;
  box-shadow:0 0 14px rgba(255,255,255,.22), 0 3px 10px rgba(0,0,0,.55); }
.lo-slot.empty { width:120px; background:rgba(8,10,14,.45) !important;
  border:1px dashed rgba(255,255,255,.18); box-shadow:none; }
.lo-icon { height:42px; max-width:158px; object-fit:contain;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.75)); }
.lo-key { position:absolute; top:3px; left:7px; font-size:11px; font-weight:700;
  color:rgba(255,255,255,.85); text-shadow:0 1px 2px #000; }
.lo-count { position:absolute; top:2px; right:8px; font-family:Consolas,monospace;
  font-size:15px; color:#fff; text-shadow:0 1px 2px #000; }
.lo-count.low { color:#ff5b5b; }
.lo-name { position:absolute; bottom:2px; left:0; right:0; text-align:center; font-size:9px;
  letter-spacing:1.5px; color:rgba(240,245,250,.95); text-shadow:0 1px 2px #000;
  white-space:nowrap; overflow:hidden; padding:0 4px; }

/* body state tints */
body.insta #vignette { background:radial-gradient(ellipse at center, transparent 50%, rgba(120,0,0,.5) 100%); }
body.insta #crosshair .ch { background:#ff8888; }

/* ---------- Menus ---------- */
#menu-root { position:fixed; inset:0; z-index:20; }
#menu-root[hidden] { display:none; }
.menu-panel { position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:14px;
  background:radial-gradient(ellipse at 50% 30%, rgba(20,28,40,.92), rgba(2,4,8,.97));
  animation:fadein .4s; }
.menu-panel[hidden] { display:none; }
@keyframes fadein { from { opacity:0; } to { opacity:1; } }

.menu-panel h1 { font-family:'Impact','Arial Black',sans-serif; font-size:74px; letter-spacing:8px;
  color:#e8eef5; text-shadow:0 0 30px rgba(255,40,40,.5); }
.menu-panel h1 span { color:#e33; }
.go-title { color:#e33 !important; text-shadow:0 0 40px rgba(255,30,30,.8) !important; }
.subtitle { font-size:14px; letter-spacing:6px; color:#8a94a0; }
#beststats { font-size:12px; letter-spacing:3px; color:#ffd76a; min-height:16px; }

.menu-btns { display:flex; flex-direction:column; gap:10px; margin-top:14px; width:280px; }
.mbtn { padding:13px 0; font-family:'Impact','Arial Black',sans-serif; font-size:20px;
  letter-spacing:4px; color:#cfd6de; background:rgba(16,20,26,.85);
  border:1px solid rgba(255,255,255,.16); cursor:pointer; transition:all .15s; }
.mbtn:hover { background:rgba(60,16,16,.9); border-color:#e33; color:#fff;
  text-shadow:0 0 10px rgba(255,50,50,.8); }
.mbtn.primary { border-color:#a22; }

#credits { max-width:520px; text-align:center; font-size:13px; line-height:1.7; color:#aab3bd; }

/* settings */
.set-grid { display:grid; grid-template-columns:280px 280px; gap:12px 20px;
  align-items:center; max-height:60vh; }
.set-grid label { font-size:13px; letter-spacing:2px; color:#cfd6de; display:flex;
  justify-content:space-between; }
.set-grid .val { color:#ffd76a; font-family:Consolas,monospace; }
.set-grid input[type=range] { width:100%; accent-color:#c22; }
.set-grid select { padding:8px; background:#14181f; color:#d8dee6; border:1px solid rgba(255,255,255,.2);
  font-size:14px; letter-spacing:1px; }

/* game over */
.go-grid { display:flex; gap:34px; margin:18px 0; }
.go-grid div { display:flex; flex-direction:column; align-items:center; gap:4px; }
.go-grid b { font-family:'Impact',sans-serif; font-size:38px; color:#ffd76a; }
.go-grid span { font-size:11px; letter-spacing:3px; color:#8a94a0; }
#go-best { font-size:12px; letter-spacing:3px; color:#8fd18f; }

#loading { position:fixed; inset:0; z-index:50; display:flex; align-items:center;
  justify-content:center; background:#04060a; color:#e33; font-size:30px;
  letter-spacing:10px; font-family:'Impact',sans-serif; }
#loading[hidden] { display:none; }

#err-overlay { position:fixed; inset:0; z-index:60; background:rgba(10,0,0,.92);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; }
#err-overlay h2 { color:#e33; font-family:'Impact',sans-serif; letter-spacing:6px; }
#err-text { max-width:80vw; max-height:60vh; overflow:auto; font-size:12px;
  color:#ffb0b0; white-space:pre-wrap; }

/* small screens */
@media (max-width:900px) { .set-grid { grid-template-columns:220px 220px; } }
