* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0a0c10;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #e8eef8;
  user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #6a8aaa;
  pointer-events: none;
}
#game.playing { pointer-events: auto; }

#esp {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none !important;
}

/* 启动/暂停/结束 */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a2030 0%, #05060a 75%);
  pointer-events: auto !important;
}
.boot.hidden {
  display: none !important;
  pointer-events: none !important;
}
.boot-card {
  width: min(400px, 92vw);
  padding: 32px 28px;
  border-radius: 16px;
  background: #121820;
  border: 1px solid #3a4a66;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  text-align: center;
  pointer-events: auto !important;
}
.boot-card h1 {
  font-size: 52px;
  letter-spacing: 0.28em;
  margin-bottom: 8px;
  color: #2dd4a8;
  text-shadow: 0 0 24px rgba(45, 212, 168, 0.35);
}
.boot-card h2 { font-size: 28px; margin-bottom: 12px; }
.boot-card p { color: #9ab; font-size: 14px; line-height: 1.5; margin: 8px 0; }
.boot-card p.sub { color: #2dd4a8; font-size: 13px; letter-spacing: 0.08em; }
.boot-card .err { color: #f66; min-height: 1.2em; font-size: 13px; }
.boot-card .hint { font-size: 11px; color: #678; margin-top: 16px; }
.boot-card .hint.dim { color: #556; margin-top: 6px; }
.boot-card .hint b { color: #2dd4a8; }

.boot-card.aim-card {
  width: min(520px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
}
.aim-report { padding: 4px 0 8px; }
.aim-rank {
  font-size: 56px;
  font-weight: 900;
  text-align: center;
  line-height: 1;
  letter-spacing: 0.08em;
}
.aim-title {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  margin: 4px 0 10px;
}
.aim-score {
  text-align: center;
  color: #cde;
  font-size: 14px;
  margin-bottom: 6px;
}
.aim-reason {
  text-align: center;
  color: #889;
  font-size: 12px;
  margin-bottom: 12px;
}
.aim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #bcd;
}
.aim-table td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.aim-table td:nth-child(2) { text-align: right; color: #fff; }
.aim-table td:nth-child(3) {
  text-align: right;
  color: #2dd4a8;
  font-size: 11px;
  font-weight: 700;
  width: 38%;
}
.aim-note {
  margin-top: 10px;
  font-size: 10px;
  color: #667;
  text-align: center;
}

.play-big {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 18px 16px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.12em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(90deg, #e33, #c40);
  pointer-events: auto !important;
  position: relative;
  z-index: 10000;
}
.play-big:hover { filter: brightness(1.1); }
.play-big:active { transform: scale(0.98); }
.play-big.secondary {
  background: #2a3344;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
}

.hidden { display: none !important; }

/* HUD layout */
#hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none !important;
}

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; transform: translate(-50%, -50%);
}
.ch { position: absolute; background: rgba(255,255,255,0.9); box-shadow: 0 0 2px #000; }
.ch-h { left: 0; top: 8px; width: 18px; height: 2px; }
.ch-v { left: 8px; top: 0; width: 2px; height: 18px; }

#hitmarker {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; transform: translate(-50%, -50%) scale(0.6);
  opacity: 0; border: 2px solid #fff; border-radius: 2px; rotate: 45deg;
}
#hitmarker.show { opacity: 1; }
#hitmarker.kill { border-color: #f44; }

/* 左上计时 */
#timers {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}
#matchTimer {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #f2f6ff;
  line-height: 1;
}
#killTimer {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(200, 210, 220, 0.85);
  letter-spacing: 0.03em;
}
#killTimer.warn { color: #fc6; }
#killTimer.danger { color: #f55; animation: pulse 0.5s ease infinite alternate; }
@keyframes pulse {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

/* 左下：feed + HP */
#bottomLeft {
  position: absolute;
  left: 16px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: min(360px, 42vw);
}
#killfeed {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  width: 100%;
  max-height: 160px;
  overflow: hidden;
  font-size: 12px;
  text-align: left;
}
#killfeed div {
  padding: 3px 8px;
  background: rgba(20, 24, 30, 0.55);
  border-radius: 3px;
  color: #c8d0da;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: feedIn 0.2s ease;
}
#killfeed div.me { color: #e8eef8; }
#killfeed div .who { color: #9cf; }
#killfeed div .whom { color: #f88; }
@keyframes feedIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

#hpBar {
  position: relative;
  height: 22px;
  width: 180px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
#hpFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #2a8f4a, #5dca6a);
  transition: width 0.12s linear;
}
#hpText {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* 右下弹药 */
#weaponHud {
  position: absolute;
  right: 18px;
  bottom: 18px;
  text-align: right;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}
#wpnName {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(220, 228, 240, 0.85);
  margin-bottom: 2px;
}
#ammo {
  font-size: 32px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #f2f6ff;
  line-height: 1;
  letter-spacing: 0.02em;
}
#ammo.low { color: #fc6; }
#ammo.empty { color: #f55; }

#dmgOverlay {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 60px rgba(255,0,0,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.05s linear;
}
#dmgOverlay.show { opacity: 1; }


#centerMsg {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px #000;
  opacity: 0;
  pointer-events: none;
  color: #fff;
}
#centerMsg.show { opacity: 1; }
