:root{
  --ink:#eaf6f7; --ink-dim:#a9c4cb; --panel:rgba(9,28,42,.78); --panel-2:rgba(16,44,62,.82);
  --line:rgba(140,220,230,.22); --gold:#ffcf5c; --teal:#4fd1c5; --danger:#ff6b6b; --good:#5fd8a0;
  --font:'Fredoka','Baloo 2','Nunito','Trebuchet MS',system-ui,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;width:100%;height:100%;height:100dvh;overflow:hidden;background:#0a1a24;color:var(--ink);font-family:var(--font)}
body.playing.touch-device{touch-action:none;-webkit-touch-callout:none}
canvas#game{position:fixed;inset:0;width:100%;height:100%;display:block;outline:none;touch-action:none}
#labels{position:fixed;inset:0;pointer-events:none;overflow:hidden}
#ui{position:fixed;inset:0;pointer-events:none}
#ui *{pointer-events:auto}
#boot{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 40%,#17506b,#071824 70%);z-index:100;transition:opacity .6s}
#boot.gone{opacity:0;pointer-events:none}
.boot-inner{text-align:center}
.boot-spinner{width:42px;height:42px;margin:0 auto 16px auto;border:3px solid rgba(255,255,255,.12);border-top-color:var(--teal);border-right-color:var(--teal);border-radius:50%;animation:boot-spin .85s linear infinite}
.boot-inner h1{margin:.2em 0 .5em;font-weight:600;letter-spacing:.02em}
.boot-bar{width:280px;height:10px;border-radius:99px;background:rgba(255,255,255,.12);overflow:hidden;margin:0 auto}
#bootFill{height:100%;width:0;background:linear-gradient(90deg,var(--teal),var(--gold));transition:width .2s}
#bootMsg{color:var(--ink-dim);margin-top:14px;font-size:14px}
@keyframes boot-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}

/* Quake 3 Arena Crosshair */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 998;
  display: none;
  filter: drop-shadow(0 0 2px rgba(0, 255, 200, 0.45));
}
body.playing:not(.panel-open):not(.orbiting):not(.cam-radial-open) #crosshair {
  display: block;
}

/* Spectator Mode Target Box around Character */
#spec-target-box {
  position: fixed;
  pointer-events: none;
  z-index: 997;
  box-sizing: border-box;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.12s ease-out;
}
#spec-target-box.hidden {
  display: none !important;
}
#spec-target-box .corner {
  position: absolute;
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px #00ff66) drop-shadow(0 0 12px rgba(0, 255, 102, 0.7));
}
#spec-target-box .corner.tl {
  top: -2px;
  left: -2px;
  border-top: 3.5px solid #00ff66;
  border-left: 3.5px solid #00ff66;
}
#spec-target-box .corner.tr {
  top: -2px;
  right: -2px;
  border-top: 3.5px solid #00ff66;
  border-right: 3.5px solid #00ff66;
}
#spec-target-box .corner.bl {
  bottom: -2px;
  left: -2px;
  border-bottom: 3.5px solid #00ff66;
  border-left: 3.5px solid #00ff66;
}
#spec-target-box .corner.br {
  bottom: -2px;
  right: -2px;
  border-bottom: 3.5px solid #00ff66;
  border-right: 3.5px solid #00ff66;
}
#spec-target-box .spec-target-label {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Cabinet Grotesk', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #00ff66;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.8), 0 1px 3px #000;
  background: rgba(0, 20, 10, 0.85);
  border: 1px solid rgba(0, 255, 102, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  padding: 3px 10px;
  border-radius: 4px;
  animation: specTargetPulse 1.1s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes specTargetPulse {
  0% { opacity: 0.85; transform: translateX(-50%) scale(0.97); }
  100% { opacity: 1.0; transform: translateX(-50%) scale(1.03); }
}

/* Floating HUD panels hidden as requested */
#quake-hud, #spectator-hud, #hint {
  display: none !important;
}

/* ================================================================ Mobile Dual Joystick Touch Controls */
#touch-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 38;
  display: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

body.playing.touch-device:not(.panel-open):not(.typing) #touch-controls {
  display: block;
}

/* Touch Zones */
#touch-joystick-zone {
  position: fixed;
  top: 70px;
  bottom: 0;
  left: 0;
  width: 50vw;
  z-index: 36;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#touch-look-zone {
  position: fixed;
  top: 70px;
  bottom: 0;
  right: 0;
  width: 50vw;
  z-index: 35;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

/* Dual Joysticks: Left (MOVE - Cyan), Right (TURN - Amber) */
#touch-joystick-base, #touch-look-base {
  position: fixed;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.50;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  z-index: 37;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Left Joystick (MOVE) */
#touch-joystick-base {
  left: calc(40px + env(safe-area-inset-left, 0px));
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle, rgba(14, 38, 56, 0.55) 0%, rgba(5, 16, 26, 0.82) 100%);
  border: 2px solid rgba(85, 238, 255, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(85, 238, 255, 0.12);
}

#touch-joystick-base.active {
  opacity: 0.95;
  border-color: rgba(85, 238, 255, 0.85);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(85, 238, 255, 0.25);
  transform: translate(-50%, -50%) scale(1.04) !important;
}

#touch-joystick-knob {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, #55eeff 0%, #0099bb 75%, #006688 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 14px rgba(85, 238, 255, 0.7), 0 3px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(0px, 0px);
  will-change: transform;
}

/* Right Joystick (TURN / AIM) */
#touch-look-base {
  right: calc(40px + env(safe-area-inset-right, 0px));
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle, rgba(56, 38, 14, 0.55) 0%, rgba(26, 16, 5, 0.82) 100%);
  border: 2px solid rgba(255, 200, 85, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(255, 200, 85, 0.12);
}

#touch-look-base.active {
  opacity: 0.95;
  border-color: rgba(255, 200, 85, 0.85);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 200, 85, 0.3);
  transform: translate(-50%, -50%) scale(1.04) !important;
}

#touch-look-knob {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe08a 0%, #f59e0b 75%, #b45309 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.7), 0 3px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transform: translate(0px, 0px);
  will-change: transform;
}

.touch-joystick-ring {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px dashed rgba(85, 238, 255, 0.25);
  pointer-events: none;
}

.touch-ring-look {
  border-color: rgba(255, 200, 85, 0.3) !important;
}

.touch-joystick-label {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  user-select: none;
}

/* Action Buttons (Fire, Zoom, Weapon Switch) */
#touch-actions {
  position: fixed;
  right: calc(30px + env(safe-area-inset-right, 0px));
  bottom: calc(175px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  z-index: 40;
  touch-action: none;
}

.touch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.08s ease, filter 0.08s ease;
  color: #fff;
  font-family: var(--font, sans-serif);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

#touch-btn-fire {
  width: 76px;
  height: 76px;
  border: 2px solid rgba(255, 140, 90, 0.95);
  background: radial-gradient(circle, #ff5e3a 0%, #d42200 85%);
  box-shadow: 0 0 20px rgba(255, 94, 58, 0.65), 0 4px 14px rgba(0, 0, 0, 0.6);
}

.touch-btn-sec {
  width: 54px;
  height: 54px;
  border: 1.5px solid rgba(0, 240, 255, 0.6);
  background: radial-gradient(circle, rgba(14, 38, 58, 0.92) 0%, rgba(5, 18, 30, 0.96) 85%);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35), 0 3px 8px rgba(0, 0, 0, 0.5);
}

.touch-btn-sec .touch-icon {
  font-size: 20px;
  line-height: 1;
}

.touch-btn-sec .touch-txt {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #7dd3fc;
  margin-top: 1px;
}

.touch-btn:active, .touch-btn.pressed {
  transform: scale(0.92);
  filter: brightness(1.3);
}

#touch-btn-fire .touch-icon {
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
}

#touch-btn-fire .touch-txt {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 2px #000;
}

/* Quake 3 Optics Zoom Vignette */
#zoom-scope {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 45;
  opacity: 0;
  transition: opacity 0.12s ease-out;
  background: radial-gradient(circle at center, transparent 32%, rgba(0, 15, 25, 0.55) 65%, rgba(0, 5, 10, 0.88) 100%);
  box-shadow: inset 0 0 120px rgba(0, 240, 255, 0.2);
}

body.zoomed #zoom-scope {
  opacity: 1;
}

/* ==========================================================================
   Quake 3 Arena Scoreboard Overlay (Tab)
   ========================================================================== */
#arena-scoreboard {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at center, rgba(10, 14, 24, 0.72) 0%, rgba(5, 7, 12, 0.88) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  animation: fadeInScore 0.14s ease-out;
}

#arena-scoreboard.hidden {
  display: none !important;
}

@keyframes fadeInScore {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

.score-card {
  width: 100%;
  max-width: 760px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(22, 28, 42, 0.95) 0%, rgba(13, 17, 26, 0.97) 100%);
  border: 1px solid rgba(255, 170, 0, 0.35);
  box-shadow: 0 0 35px rgba(255, 140, 0, 0.18), 0 20px 40px rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font, 'Inter', sans-serif);
  color: #f1f5f9;
}

.score-header {
  padding: 14px 20px;
  background: linear-gradient(90deg, rgba(255, 110, 0, 0.18) 0%, rgba(0, 240, 255, 0.08) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-title-group h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.45);
}

.score-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffaa00;
  text-transform: uppercase;
}

.score-online-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.score-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
  max-height: 55vh;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.score-table th {
  padding: 10px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
}

.score-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.score-row-self {
  background: rgba(0, 240, 255, 0.09) !important;
  box-shadow: inset 3px 0 0 #00f0ff;
}

.score-row-self td {
  font-weight: 600;
  color: #ffffff;
}

.score-ping {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.score-ping.good {
  color: #34d399;
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.35);
}

.score-ping.med {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.35);
}

.score-ping.bad {
  color: #f87171;
  text-shadow: 0 0 6px rgba(248, 113, 113, 0.35);
}

.score-footer {
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-footer kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
}

/* ================================================================ Camera Radial Wheel (Hold Scroll Wheel) */
.cam-radial-wheel {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: opacity 0.12s ease-out;
}
.cam-radial-wheel.hidden {
  display: none !important;
}

.cam-radial-wrap {
  position: relative;
  width: 320px;
  height: 320px;
  filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.85));
  animation: radialPop 0.14s cubic-bezier(0.18, 0.9, 0.3, 1.2);
}

@keyframes radialPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.cam-radial-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.radial-ring-outer {
  fill: none;
  stroke: rgba(0, 255, 204, 0.22);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
}

.radial-ring-inner {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1;
}

.radial-sector {
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  transform-origin: 150px 150px;
}

.sector-bg {
  fill: rgba(14, 20, 32, 0.88);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.8;
  transition: fill 0.12s ease, stroke 0.12s ease, stroke-width 0.12s ease;
}

.radial-sector.active .sector-bg {
  fill: rgba(0, 255, 204, 0.28);
  stroke: #00ffcc;
  stroke-width: 3;
  filter: drop-shadow(0 0 12px rgba(0, 255, 204, 0.7));
}

.radial-sector.current:not(.active) .sector-bg {
  stroke: rgba(0, 255, 204, 0.5);
  stroke-dasharray: 3 3;
}

.sector-icon {
  font-size: 20px;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.sector-label {
  font-family: 'Cabinet Grotesk', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  fill: #e2e8f0;
  text-anchor: middle;
  dominant-baseline: middle;
  transition: fill 0.12s ease;
  pointer-events: none;
}

.radial-sector.active .sector-label {
  fill: #00ffcc;
  font-weight: 900;
}

.sector-sub {
  font-family: 'Cabinet Grotesk', system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  fill: #94a3b8;
  text-anchor: middle;
  dominant-baseline: middle;
  transition: fill 0.12s ease;
  pointer-events: none;
}

.radial-sector.active .sector-sub {
  fill: #ffffff;
}

.radial-hub {
  fill: rgba(10, 14, 22, 0.94);
  stroke: rgba(0, 255, 204, 0.35);
  stroke-width: 2;
}

.radial-hub-title {
  font-family: 'Cabinet Grotesk', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  fill: #00ffcc;
  text-anchor: middle;
  dominant-baseline: middle;
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
  pointer-events: none;
}

.radial-hub-sub {
  font-family: 'Cabinet Grotesk', system-ui, sans-serif;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  fill: #94a3b8;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.radial-cursor-line {
  stroke: rgba(0, 255, 204, 0.45);
  stroke-width: 2;
  stroke-dasharray: 2 3;
}

.radial-cursor-trail {
  fill: rgba(0, 255, 204, 0.12);
  stroke: rgba(0, 255, 204, 0.35);
  stroke-width: 1.5;
}

.radial-cursor-pip {
  fill: #00ffcc;
  filter: drop-shadow(0 0 8px #00ffcc);
}

/* ================================================================ Quake 3 Arena FFA HUD */
#arena-hud {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.84), rgba(6, 10, 18, 0.92));
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  z-index: 32;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#arena-hud.hidden { display: none !important; }
body:not(.playing) #arena-hud { display: none !important; }
#arena-hud.dead { opacity: 0.4; filter: grayscale(0.7); }

.ahud-block {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 112px;
}
.ahud-icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
}
.ahud-health .ahud-icon {
  color: #4ade80;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.65);
}
.ahud-health.low .ahud-icon,
.ahud-health.low .ahud-val {
  color: #ff4545 !important;
  text-shadow: 0 0 16px rgba(255, 69, 69, 0.85);
  animation: hpPulse 0.65s infinite alternate;
}
.ahud-health.mid .ahud-icon,
.ahud-health.mid .ahud-val {
  color: #fbbf24 !important;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}
.ahud-health.overheal .ahud-icon,
.ahud-health.overheal .ahud-val {
  color: #38e8ff !important;
  text-shadow: 0 0 16px rgba(56, 232, 255, 0.85);
}
@keyframes hpPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.ahud-readout {
  display: flex;
  flex-direction: column;
  line-height: 1.0;
}
.ahud-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(203, 213, 225, 0.72);
  margin-bottom: 2px;
}
.ahud-val {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
  font-variant-numeric: tabular-nums;
}
.ahud-ammo.empty .ahud-val {
  color: #ff4d4d;
  text-shadow: 0 0 12px rgba(255, 77, 77, 0.75);
}

.ahud-weapons {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}
.ahud-slot {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  opacity: 0.6;
  transition: all 0.14s ease;
}
.ahud-slot.active {
  opacity: 1;
  background: rgba(0, 240, 255, 0.16);
  border-color: rgba(0, 240, 255, 0.72);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}
.ahud-slot.empty { opacity: 0.35; border-color: rgba(255, 80, 80, 0.35); }
.ahud-key {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
}
.ahud-wico { font-size: 15px; }
.ahud-wammo {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* Hitmarker */
#hitmarker {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  z-index: 48;
  opacity: 0;
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
}
#hitmarker svg line { stroke: #ffffff; filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.9)); }
#hitmarker.on { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
#hitmarker.fatal svg line { stroke: #ff3838; filter: drop-shadow(0 0 8px rgba(255, 45, 45, 0.95)); }

/* Damage Vignette */
#dmg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(220, 20, 20, 0) 46%, rgba(235, 24, 24, 0.72) 100%);
  transition: opacity 0.28s ease-out;
}
#dmg-vignette.on { opacity: 1; transition: opacity 0.04s ease-in; }

/* Killfeed */
#killfeed {
  position: fixed;
  top: 16px;
  right: 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  z-index: 33;
  pointer-events: none;
}
.kf-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 9px;
  background: rgba(10, 15, 24, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.kf-row.mine { border-color: rgba(0, 255, 204, 0.55); background: rgba(6, 28, 36, 0.86); }
.kf-row.victim-me { border-color: rgba(255, 72, 72, 0.65); background: rgba(42, 10, 12, 0.86); }
.kf-row.out { opacity: 0; transform: translateX(18px); }
.kf-atk { color: #38e8ff; }
.kf-atk.lion { color: #ffaa33; }
.kf-vic { color: #ff8585; }
.kf-ico { font-size: 14px; }

/* Death / Respawn Banner */
#death-overlay {
  position: fixed;
  left: 50%;
  bottom: 98px;
  transform: translateX(-50%);
  padding: 12px 26px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(46, 10, 14, 0.9), rgba(20, 6, 10, 0.94));
  border: 1.5px solid rgba(255, 72, 72, 0.65);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.72), 0 0 24px rgba(255, 45, 45, 0.25);
  text-align: center;
  z-index: 44;
  pointer-events: none;
}
#death-overlay.hidden { display: none !important; }
.death-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ff5555;
  text-shadow: 0 0 14px rgba(255, 65, 65, 0.7);
}
.death-sub {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

/* Always-Visible Spectator Self Character Marker */
#spec-self-marker {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 39;
  pointer-events: none;
  user-select: none;
}
#spec-self-marker.hidden { display: none !important; }
.spec-self-diamond {
  width: 14px;
  height: 14px;
  border: 2.5px solid #39ff14;
  background: rgba(57, 255, 20, 0.28);
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.95), inset 0 0 6px rgba(57, 255, 20, 0.7);
  animation: specDiamondPulse 1.1s ease-in-out infinite alternate;
}
@keyframes specDiamondPulse {
  from { transform: rotate(45deg) scale(0.92); opacity: 0.85; }
  to { transform: rotate(45deg) scale(1.18); opacity: 1; }
}
.spec-self-tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(4, 24, 8, 0.84);
  border: 1px solid rgba(57, 255, 20, 0.82);
  color: #6eff55;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.7);
}
