:root {
  --text: #ffffff;
  --muted: #a9c4e0;
  --accent: #38e1ff;
  --ally: #3aa8ff;
  --enemy: #ff4a3a;
  --danger: #ff3b3b;
  --good: #2ee86b;
  --blue: #3d9bff;
  --panel: rgba(6, 12, 24, 0.66);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050a14;
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
}

canvas { display: block; }

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

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
}
#crosshair::before, #crosshair::after {
  content: "";
  position: absolute;
  background: #ffffff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.9);
}
#crosshair::before { left: 9px; top: 0; width: 2px; height: 20px; }
#crosshair::after { top: 9px; left: 0; width: 20px; height: 2px; }

#hitmarker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s;
}
#hitmarker::before, #hitmarker::after {
  content: "";
  position: absolute;
  background: var(--text);
}
#hitmarker::before { left: 13px; top: 0; width: 2px; height: 28px; }
#hitmarker::after { top: 13px; left: 0; width: 28px; height: 2px; }
#hitmarker.show { opacity: 1; transition: none; }
#hitmarker.kill::before, #hitmarker.kill::after { background: var(--danger); }

#damage {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(220, 20, 20, 0.75) 100%);
  opacity: 0;
}

#banner {
  position: absolute;
  top: 28%;
  width: 100%;
  text-align: center;
  font-size: 44px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--accent);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.4s;
}
#banner.show { opacity: 1; }

#top-left, #bottom-left, #bottom-right {
  position: absolute;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid rgba(120, 180, 255, 0.25);
  border-radius: 8px;
  font-size: 16px;
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
#top-left { top: 16px; left: 16px; line-height: 1.6; }
#top-left span { color: var(--accent); font-weight: 600; }
#top-left span.ally, #feed .ally { color: var(--ally); }
#top-left span.enemy, #feed .enemy { color: var(--enemy); }

#objective {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 4px 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
#points { display: flex; gap: 8px; }
.point {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
  border: 2px solid rgba(223, 228, 234, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}
.point span { position: relative; }
.point .fill { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0.55; }
.point .fill.ally { background: var(--ally); }
.point .fill.enemy { background: var(--enemy); }
.point.ally { border-color: var(--ally); box-shadow: 0 0 10px rgba(58, 168, 255, 0.6); }
.point.enemy { border-color: var(--enemy); box-shadow: 0 0 10px rgba(255, 74, 58, 0.6); }
.point.here { transform: scale(1.12); }
.point.contested { animation: blink 0.5s infinite alternate; }
@keyframes blink { to { border-color: #fff; } }
.tickets {
  min-width: 56px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--panel);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}
.tickets.ally { color: var(--ally); border-bottom: 3px solid var(--ally); }
.tickets.enemy { color: var(--enemy); border-bottom: 3px solid var(--enemy); }
#obj-status { grid-column: 1 / -1; text-align: center; font-size: 14px; letter-spacing: 1px; color: var(--muted); }

#markers > div {
  position: absolute;
  left: 0;
  top: 0;
  margin: -16px 0 0 -16px;
  width: 32px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
#markers b {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto;
  line-height: 22px;
  border-radius: 50%;
  border: 2px solid #dfe4ea;
  background: rgba(6, 12, 24, 0.5);
  font-size: 14px;
}
#markers small { font-size: 11px; color: var(--muted); }
#markers .ally b { border-color: var(--ally); color: var(--ally); }
#markers .enemy b { border-color: var(--enemy); color: var(--enemy); }
#markers .contested b { animation: blink 0.5s infinite alternate; }

#feed {
  position: absolute;
  top: 16px;
  right: 16px;
  text-align: right;
  font-size: 14px;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
#feed > div { padding: 0 8px; background: rgba(6, 12, 24, 0.5); border-radius: 4px; margin-bottom: 3px; }

#respawn {
  position: absolute;
  top: 60%;
  width: 100%;
  text-align: center;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--enemy);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
#respawn.hidden { display: none; }

#bottom-left { bottom: 16px; left: 16px; width: 240px; }
.label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
#health-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  overflow: hidden;
}
#health-fill {
  height: 100%;
  width: 100%;
  background: var(--good);
  box-shadow: 0 0 8px rgba(46, 232, 107, 0.6);
  transition: width 0.15s, background 0.3s;
}
#health-text { margin-top: 6px; font-weight: 600; }

#bottom-right { bottom: 16px; right: 16px; text-align: right; }
#slots { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; font-size: 12px; }
#slots span { padding: 2px 6px; border-radius: 4px; color: var(--muted); background: rgba(61, 155, 255, 0.15); }
#slots span.active { color: #061018; background: var(--accent); font-weight: 600; }
#slots span.empty { text-decoration: line-through; }
#weapon-name { color: var(--muted); font-size: 13px; letter-spacing: 1px; white-space: pre; }

#crosshair { transition: opacity 0.1s; }

#scope {
  position: absolute;
  inset: 0;
  display: none;
  background:
    linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.85)) center / 100% 1px no-repeat,
    linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.85)) center / 1px 100% no-repeat,
    radial-gradient(circle at center, transparent 0, transparent 34vmin, #0b0c0d 34.4vmin);
}
#scope.show { display: block; }
#ammo { font-size: 26px; font-weight: 600; }
#reserve { color: var(--muted); font-size: 18px; }
#reload-hint { color: var(--accent); font-size: 13px; min-height: 16px; }

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10, 20, 50, 0.35), rgba(2, 4, 12, 0.8));
}
#overlay.hidden { display: none; }

#panel {
  background: var(--panel);
  padding: 32px 44px;
  border: 1px solid rgba(120, 180, 255, 0.3);
  border-radius: 12px;
  text-align: center;
  min-width: 340px;
  backdrop-filter: blur(8px);
}
#panel h1 { margin: 0 0 6px; letter-spacing: 3px; color: var(--accent); text-shadow: 0 0 18px rgba(56, 225, 255, 0.5); }
#subtitle { color: var(--muted); margin: 0 auto 20px; max-width: 460px; }

#play {
  font: inherit;
  font-size: 18px;
  padding: 10px 28px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #7aeeff, #1fb6e6);
  color: #10161f;
  font-weight: 600;
  cursor: pointer;
}
#play:hover { filter: brightness(1.1); }

#controls {
  margin: 22px auto 0;
  border-collapse: collapse;
  font-size: 14px;
}
#controls td, #controls th { padding: 3px 10px; text-align: left; }
#controls th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
#controls td:first-child { color: var(--muted); text-align: right; }

