#screen-battle { z-index: 20; background: #000; }
#battle-root, #battle-root canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#battle-root { cursor: crosshair; }

.hud-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; font-family: var(--font); }
.hud-layer .clickable { pointer-events: auto; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair span { position: absolute; background: #d9ffe8; box-shadow: 0 0 3px rgba(0, 0, 0, .9); }
#crosshair .ch-t, #crosshair .ch-b { width: 2px; height: 9px; left: -1px; }
#crosshair .ch-l, #crosshair .ch-r { height: 2px; width: 9px; top: -1px; }
#crosshair .ch-dot { width: 2px; height: 2px; left: -1px; top: -1px; }

#hitmarker { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; opacity: 0; transform: rotate(45deg); }
#hitmarker span { position: absolute; background: #fff; box-shadow: 0 0 4px #000; }
#hitmarker .hm1 { width: 2px; height: 10px; left: 0; top: 0; }
#hitmarker .hm2 { width: 10px; height: 2px; right: 0; top: 0; }
#hitmarker .hm3 { width: 2px; height: 10px; right: 0; bottom: 0; }
#hitmarker .hm4 { width: 10px; height: 2px; left: 0; bottom: 0; }
#hitmarker.show { animation: hmPop .22s ease-out; }
#hitmarker.head span { background: var(--danger); }
@keyframes hmPop { 0% { opacity: 1; transform: rotate(45deg) scale(1.25); } 100% { opacity: 0; transform: rotate(45deg) scale(.85); } }

#vignette-dmg { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 42%, rgba(190, 12, 12, .55) 100%); transition: opacity .35s; }
#vignette-lowhp { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(160, 0, 0, .5) 100%); animation: lowPulse 1.1s infinite; }
@keyframes lowPulse { 0%, 100% { filter: brightness(.75); } 50% { filter: brightness(1.15); } }

#hud-topbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.tb-score {
  position: relative;
  min-width: 74px;
  text-align: center;
  padding: 6px 14px 8px;
  background: rgba(8, 13, 18, .82);
  border: 1px solid var(--line);
  font-size: 26px;
  font-weight: 900;
  font-family: Consolas, monospace;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.tb-alive {
  position: absolute;
  bottom: -17px;
  left: 0;
  right: 0;
  font-style: normal;
  font-size: 10px;
  font-weight: normal;
  letter-spacing: 3px;
  color: var(--txt-dim);
}
.tb-score.blue { color: var(--blue-team); border-bottom: 2px solid var(--blue-team); }
.tb-score.red { color: var(--red-team); border-bottom: 2px solid var(--red-team); }
#tb-center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 110px; padding: 4px 16px 6px; background: rgba(8, 13, 18, .82); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#tb-time { font-size: 19px; font-weight: bold; color: var(--txt-bright); font-family: Consolas, monospace; }
#tb-round { font-size: 10px; letter-spacing: 2px; color: var(--txt-dim); white-space: nowrap; }
#tb-objective { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: 2px; color: rgba(255, 220, 150, .85); text-shadow: 0 1px 4px #000; white-space: nowrap; }

#minimap-wrap { position: absolute; top: 14px; left: 14px; width: 172px; }
#minimap { width: 172px; height: 172px; background: rgba(5, 9, 13, .78); border: 1px solid var(--line-hi); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
#mm-mapname { margin-top: 5px; font-size: 11px; letter-spacing: 2px; color: var(--txt-dim); text-shadow: 0 1px 3px #000; }
#mm-mode { font-size: 11px; color: var(--gold); letter-spacing: 2px; text-shadow: 0 1px 3px #000; }

#killfeed { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; max-width: 420px; }
.kf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(8, 13, 18, .82);
  border-right: 2px solid var(--line-hi);
  font-size: 12px;
  letter-spacing: 1px;
  animation: kfIn .2s ease;
}
.kf-row.out { opacity: 0; transition: opacity .5s; }
@keyframes kfIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.kf-name.blue { color: var(--blue-team); font-weight: bold; }
.kf-name.red { color: var(--red-team); font-weight: bold; }
.kf-wpn { color: #93a7b8; font-size: 11px; border: 1px solid #33475a; padding: 0 6px; }
.kf-hs { color: var(--danger); font-weight: 900; }

#hud-bottom-left { position: absolute; left: 18px; bottom: 18px; width: 250px; }
.hp-plate { background: rgba(8, 13, 18, .78); border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); padding: 10px 14px 12px; }
.hp-row { display: flex; align-items: baseline; gap: 10px; }
#hp-num { font-size: 30px; font-weight: 900; color: var(--txt-bright); font-family: Consolas, monospace; line-height: 1; min-width: 56px; }
#hp-num.low { color: var(--danger); animation: lowNum .8s infinite; }
@keyframes lowNum { 50% { opacity: .45; } }
.bar-track { flex: 1; height: 7px; background: #1a2833; clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #37c66e, #7fe08c); transition: width .18s; }
#hp-fill.hurt { background: linear-gradient(90deg, #c93737, #ff7a52); }
.ar-row { margin-top: 7px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: #6fa8cc; letter-spacing: 2px; }
#ar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #2a6f9e, #57b6e8); transition: width .18s; }
#perk-tags { margin-top: 8px; display: flex; gap: 6px; }

#hud-bottom-right { position: absolute; right: 18px; bottom: 18px; text-align: right; }
.ammo-plate { background: rgba(8, 13, 18, .78); border: 1px solid var(--line); clip-path: polygon(0 0, 100% 0, 100% 10px, calc(100% - 10px) 100%, 0 100%); padding: 10px 16px 12px; display: inline-flex; align-items: baseline; gap: 8px; }
#ammo-mag { font-size: 38px; font-weight: 900; font-family: Consolas, monospace; color: var(--txt-bright); line-height: 1; }
#ammo-mag.empty { color: var(--danger); }
#ammo-reserve { font-size: 16px; color: var(--txt-dim); font-family: Consolas, monospace; }
#wpn-name { margin-top: 6px; font-size: 13px; letter-spacing: 2px; color: var(--gold); text-shadow: 0 1px 3px #000; }
#reload-tip { margin-top: 4px; font-size: 12px; letter-spacing: 3px; color: var(--cyan); animation: blinkTip .8s infinite; }
@keyframes blinkTip { 50% { opacity: .3; } }
#slot-bar { margin-top: 10px; display: flex; gap: 6px; justify-content: flex-end; }
.slot-chip { min-width: 46px; padding: 4px 9px; text-align: center; font-size: 11px; letter-spacing: 1px; color: var(--txt-dim); background: rgba(8, 13, 18, .78); border: 1px solid var(--line); clip-path: polygon(5px 0, 100% 0, 100% 100%, 0 100%, 0 5px); }
.slot-chip.active { color: var(--gold); border-color: var(--gold-deep); background: rgba(255, 179, 0, .1); }
.slot-key { color: #54707f; margin-right: 5px; font-family: Consolas, monospace; }

#center-prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); text-align: center; display: none; }
#cp-text { font-size: 14px; letter-spacing: 2px; color: var(--txt-bright); text-shadow: 0 1px 4px #000; margin-bottom: 8px; }
#cp-text b { color: var(--gold); }
#cp-progress { width: 220px; height: 8px; margin: 0 auto; background: rgba(20, 32, 44, .9); border: 1px solid var(--line-hi); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); overflow: hidden; }
#cp-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }

#banner { position: absolute; left: 0; right: 0; top: 26%; text-align: center; pointer-events: none; }
#banner-title { font-size: 44px; font-weight: 900; letter-spacing: 12px; text-indent: 12px; color: var(--txt-bright); text-shadow: 0 0 30px rgba(255, 179, 0, .4), 0 3px 10px #000; opacity: 0; }
#banner-sub { margin-top: 8px; font-size: 15px; letter-spacing: 4px; color: var(--txt-dim); text-shadow: 0 1px 4px #000; opacity: 0; }
#banner.show #banner-title { animation: bannerIn 2.4s ease forwards; }
#banner.show #banner-sub { animation: bannerIn 2.4s ease forwards; }
#banner-title.win { color: var(--green); text-shadow: 0 0 40px rgba(70, 214, 140, .5), 0 3px 10px #000; }
#banner-title.lose { color: var(--danger); text-shadow: 0 0 40px rgba(255, 77, 77, .45), 0 3px 10px #000; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(1.3); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

#respawn-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; background: radial-gradient(ellipse at center, rgba(60, 0, 0, .35), rgba(0, 0, 0, .78)); backdrop-filter: grayscale(.7); }
#respawn-killedby { font-size: 15px; letter-spacing: 2px; color: var(--txt-dim); }
#respawn-killedby b { color: var(--danger); }
#respawn-count { font-size: 64px; font-weight: 900; color: var(--txt-bright); font-family: Consolas, monospace; margin: 14px 0 6px; }
#respawn-note { font-size: 13px; letter-spacing: 3px; color: var(--txt-dim); }

#scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 720px; max-width: 94vw; display: none; background: rgba(6, 11, 16, .93); border: 1px solid var(--line-hi); clip-path: var(--chamfer); padding: 22px 26px; }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.sb-head b { font-size: 17px; letter-spacing: 3px; color: var(--txt-bright); }
.sb-head span { font-size: 11px; color: var(--txt-dim); letter-spacing: 1px; font-family: Consolas, monospace; }
.sb-team-title { font-size: 12px; letter-spacing: 3px; margin: 10px 0 6px; }
.sb-team-title.blue { color: var(--blue-team); }
.sb-team-title.red { color: var(--red-team); }
table.sb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sb-table th { text-align: left; font-weight: normal; font-size: 11px; color: #54707f; letter-spacing: 2px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.sb-table td { padding: 6px 8px; border-bottom: 1px dashed rgba(30, 49, 64, .55); color: var(--txt); font-family: Consolas, monospace; }
.sb-table td:first-child { font-family: var(--font); }
.sb-table tr.me td { background: rgba(255, 179, 0, .07); }
.sb-table tr.dead td { opacity: .45; }
.sb-table th.num, .sb-table td.num { text-align: right; }

#pause-menu { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(3, 6, 10, .72); backdrop-filter: blur(4px); }
.pm-box { width: 330px; padding: 30px 32px; background: linear-gradient(180deg, #121d27, #0a1118); border: 1px solid var(--line-hi); clip-path: var(--chamfer); text-align: center; }
.pm-box h3 { font-size: 20px; letter-spacing: 8px; text-indent: 8px; color: var(--txt-bright); margin-bottom: 6px; }
.pm-box .pm-sub { font-size: 12px; color: var(--txt-dim); letter-spacing: 2px; margin-bottom: 24px; }
.pm-actions { display: flex; flex-direction: column; gap: 10px; }
.pm-actions .btn { width: 100%; }
.pm-vol { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 12px; color: var(--txt-dim); letter-spacing: 1px; }
.pm-vol input { flex: 1; accent-color: var(--gold); }

#end-screen { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(10, 16, 22, .82), rgba(2, 4, 7, .96)); }
.end-box { width: 520px; text-align: center; padding: 40px 44px; background: linear-gradient(180deg, #121d27, #0a1118); border: 1px solid var(--line-hi); clip-path: var(--chamfer); }
#end-result { font-size: 52px; font-weight: 900; letter-spacing: 16px; text-indent: 16px; }
#end-result.win { color: var(--green); text-shadow: 0 0 44px rgba(70, 214, 140, .5); }
#end-result.lose { color: var(--danger); text-shadow: 0 0 44px rgba(255, 77, 77, .4); }
#end-sub { margin-top: 6px; font-size: 13px; letter-spacing: 3px; color: var(--txt-dim); }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 28px 0 20px; }
.es-cell { padding: 13px 6px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); clip-path: var(--chamfer); }
.es-num { font-size: 24px; font-weight: 900; color: var(--gold); font-family: Consolas, monospace; }
.es-label { margin-top: 4px; font-size: 11px; letter-spacing: 2px; color: var(--txt-dim); }
.end-rewards { display: flex; justify-content: center; gap: 12px; margin-bottom: 26px; }
.end-btns { display: flex; gap: 12px; justify-content: center; }

#scope-overlay { position: absolute; inset: 0; display: none; }
.scope-mask { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 31vmin, rgba(0, 0, 0, .97) 32.5vmin); }
.scope-cross-v { position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; margin-left: -0.75px; background: rgba(0, 0, 0, .9); }
.scope-cross-h { position: absolute; top: 50%; left: 0; right: 0; height: 1.5px; margin-top: -0.75px; background: rgba(0, 0, 0, .9); }
.scope-ring { position: absolute; left: 50%; top: 50%; width: 63vmin; height: 63vmin; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(0, 0, 0, .85); box-shadow: inset 0 0 60px rgba(0, 0, 0, .8); }

#fps-counter { position: absolute; right: 14px; top: 90px; font-family: Consolas, monospace; font-size: 12px; color: #7dff9e; text-shadow: 0 1px 3px #000; display: none; }
#bomb-status { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); display: none; text-align: center; }
#bomb-timer { font-size: 30px; font-weight: 900; color: var(--danger); font-family: Consolas, monospace; text-shadow: 0 0 16px rgba(255, 60, 60, .6); animation: blinkTip 1s infinite; }
#bomb-label { font-size: 11px; letter-spacing: 4px; color: var(--txt-dim); }

#lock-hint {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  background: rgba(8, 13, 18, .88);
  border: 1px solid var(--gold-deep);
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 3px;
  clip-path: var(--chamfer);
  pointer-events: none;
}
#lock-hint::before { content: ""; width: 9px; height: 9px; background: var(--gold); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }

.damage-flash-dir { position: absolute; left: 50%; top: 50%; width: 130px; height: 130px; margin: -65px; pointer-events: none; opacity: 0; background: conic-gradient(from 0deg, transparent 0 40%, rgba(255, 40, 40, .5) 50%, transparent 60% 100%); mask: radial-gradient(circle, transparent 54%, #000 62%); -webkit-mask: radial-gradient(circle, transparent 54%, #000 62%); }
