/* ============ CS:WEB 样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a0a0c;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#app { position: relative; width: 100%; height: 100%; }
#c3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hidden { display: none !important; }

/* ---------- 准星 ---------- */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 6px; }
#crosshair .ch { position: absolute; background: #4dff6a; box-shadow: 0 0 2px rgba(0,0,0,.9); }
#crosshair .ch-t, #crosshair .ch-b { width: 2px; height: 7px; left: -1px; }
#crosshair .ch-l, #crosshair .ch-r { height: 2px; width: 7px; top: -1px; }
#crosshair .ch-t { bottom: var(--gap); }
#crosshair .ch-b { top: var(--gap); }
#crosshair .ch-l { right: var(--gap); }
#crosshair .ch-r { left: var(--gap); }
#ch-dot { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: #4dff6a; box-shadow: 0 0 2px rgba(0,0,0,.9); }

/* 命中标记 */
#hitmarker {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  opacity: 0;
}
#hitmarker.show { opacity: .95; }
#hitmarker.kill { filter: drop-shadow(0 0 3px #ff3b3b); }
#hitmarker.head { filter: drop-shadow(0 0 3px #ffd23b); }

/* ---------- 狙击镜 ---------- */
#scope { position: absolute; inset: 0; }
#scope .scope-shadow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0vmin 27vmin, #000 27.5vmin 100vmin);
}
#scope .scope-h i, #scope .scope-v i { position: absolute; background: rgba(0,0,0,.85); }
#scope .scope-h i { left: 50%; top: 50%; width: 34vmin; height: 1px; transform: translate(-50%, -50%); }
#scope .scope-h i:last-child { display: none; }
#scope .scope-v i { left: 50%; top: 50%; width: 1px; height: 34vmin; transform: translate(-50%, -50%); }
#scope .scope-h::before, #scope .scope-h::after { content: ""; }
.scope-lens-line { }

/* ---------- 全屏特效 ---------- */
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#blood-vignette {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(140, 0, 0, .55) 100%);
}
#damage-dirs { position: absolute; left: 50%; top: 50%; }
.dmg-dir {
  position: absolute; width: 90px; height: 90px; left: -45px; top: -45px;
  pointer-events: none;
}
.dmg-dir::before {
  content: ""; position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  border: 12px solid transparent; border-bottom-color: rgba(255, 40, 40, .85);
  filter: drop-shadow(0 0 2px #000);
}

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; }

#radar-wrap {
  position: absolute; left: 14px; top: 14px;
  background: rgba(10, 14, 20, .72);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  padding: 4px;
}
#radar { display: block; }

#topbar {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  background: rgba(10, 14, 20, .72);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  padding: 6px 16px;
  color: #e8e8e8;
}
#timer { font-size: 20px; font-weight: 600; min-width: 58px; text-align: center; font-variant-numeric: tabular-nums; }
#timer.low { color: #ff4d4d; }
#score { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
#score .t-side { color: #e8c15a; font-size: 13px; font-weight: 700; }
#score .ct-side { color: #6fa8dc; font-size: 13px; font-weight: 700; }
#alive { font-size: 14px; color: #b9c2cc; font-variant-numeric: tabular-nums; }
#alive-sep { margin: 0 6px; color: #7a838d; }

#money {
  position: absolute; right: 16px; top: 14px;
  color: #9fd68a; font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px #000;
}
#money.neg { color: #ff6b6b; }

#killfeed {
  position: absolute; right: 16px; top: 52px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.kf {
  display: flex; align-items: center; gap: 6px;
  background: rgba(10, 14, 20, .72);
  border-radius: 3px; padding: 3px 8px;
  font-size: 12.5px; color: #e6e6e6;
  animation: kfin .18s ease-out;
  white-space: nowrap;
}
@keyframes kfin { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.kf .who { font-weight: 600; }
.kf .who.t { color: #e8c15a; }
.kf .who.ct { color: #6fa8dc; }
.kf .wpn { color: #aeb6bf; font-size: 12px; }
.kf .hs { color: #ffd23b; font-weight: 700; }
.kf.fade { opacity: 0; transition: opacity .5s; }

#bomb-timer {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%);
  color: #ff5b4d; font-size: 24px; font-weight: 800;
  text-shadow: 0 0 8px rgba(255, 60, 40, .6), 0 1px 3px #000;
  font-variant-numeric: tabular-nums;
  animation: bombpulse 1s infinite;
}
@keyframes bombpulse { 50% { opacity: .55; } }

#bottom-left { position: absolute; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.stat { display: flex; align-items: center; gap: 8px; color: #e8e8e8; text-shadow: 0 1px 3px #000; }
.stat .icon { width: 26px; height: 26px; fill: #7bd88f; filter: drop-shadow(0 1px 2px #000); }
#armor-stat .icon { fill: #6fa8dc; }
.stat span { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
#hp-stat.low span, #hp-stat.low .icon { color: #ff5b4d; fill: #ff5b4d; }
#armor-stat.zero { opacity: .25; }

#bottom-right { position: absolute; right: 16px; bottom: 16px; text-align: right; }
#weapon-name { color: #cfd6de; font-size: 14px; letter-spacing: 1px; text-shadow: 0 1px 3px #000; text-transform: uppercase; }
#ammo { color: #fff; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px #000; line-height: 1.1; }
#ammo-sep { color: #8a929c; margin: 0 4px; font-size: 22px; }
#ammo-res { color: #aeb6bf; font-size: 22px; }
#slots { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.slot {
  min-width: 34px; padding: 2px 6px; text-align: center;
  background: rgba(10,14,20,.72); border: 1px solid rgba(255,255,255,.12);
  border-radius: 3px; color: #9aa2ab; font-size: 11px;
}
.slot b { color: #ffd23b; font-size: 10px; margin-right: 4px; }
.slot.active { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(40,48,60,.85); }
.slot.empty { opacity: .35; }

#progress { position: absolute; left: 50%; bottom: 24%; transform: translateX(-50%); width: 260px; text-align: center; }
#progress-track { height: 12px; background: rgba(10,14,20,.8); border: 1px solid rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
#progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #6fa8dc, #4d9de0); }
#progress-label { color: #fff; font-size: 14px; margin-top: 6px; text-shadow: 0 1px 3px #000; letter-spacing: 2px; }

#banner {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%);
  text-align: center; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.8);
}
#banner-title { font-size: 42px; font-weight: 800; letter-spacing: 4px; }
#banner-title.win { color: #7bd88f; }
#banner-title.lose { color: #ff6b6b; }
#banner-sub { font-size: 16px; color: #cfd6de; margin-top: 8px; letter-spacing: 2px; }

#center-msg {
  position: absolute; left: 50%; top: 24%; transform: translateX(-50%);
  color: #ffd23b; font-size: 20px; font-weight: 700; letter-spacing: 3px;
  text-shadow: 0 1px 6px rgba(0,0,0,.9); white-space: nowrap;
}
#freeze-tag {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%);
  color: #6fa8dc; font-size: 15px; letter-spacing: 6px; font-weight: 600;
  text-shadow: 0 1px 4px #000;
}
#hint-msg {
  position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%);
  color: #e8e8e8; font-size: 14px; letter-spacing: 1px;
  background: rgba(10,14,20,.72); padding: 4px 12px; border-radius: 3px;
}

/* ---------- 死亡观战 ---------- */
#dead-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding-top: 18vh;
  background: radial-gradient(ellipse at center, rgba(60,0,0,.25), rgba(0,0,0,.55) 90%);
}
#dead-title { color: #ff5b4d; font-size: 34px; font-weight: 800; letter-spacing: 6px; text-shadow: 0 2px 10px #000; }
#dead-by { color: #e8e8e8; font-size: 16px; margin-top: 10px; text-shadow: 0 1px 4px #000; }
#spectate-hint { color: #9aa2ab; font-size: 12.5px; margin-top: 26px; }

/* ---------- 记分板 ---------- */
#scoreboard { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5, 8, 12, .55); }
.sb-panel { width: 640px; background: rgba(12, 16, 22, .95); border: 1px solid rgba(255,255,255,.16); border-radius: 6px; overflow: hidden; }
.sb-team { padding: 14px 18px; }
.sb-team + .sb-team { border-top: 1px solid rgba(255,255,255,.1); }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sb-name { font-size: 14px; font-weight: 700; letter-spacing: 2px; }
.t-team .sb-name { color: #e8c15a; }
.ct-team .sb-name { color: #6fa8dc; }
.sb-score { font-size: 30px; font-weight: 800; color: #fff; }
.sb-team table { width: 100%; border-collapse: collapse; font-size: 13px; color: #d6dbe1; }
.sb-team th { text-align: left; color: #7a838d; font-weight: 500; font-size: 11px; padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sb-team td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.05); font-variant-numeric: tabular-nums; }
.sb-team tr.me td { color: #fff; background: rgba(111, 168, 220, .12); }
.sb-team tr.dead td { color: #6a727c; }
.sb-tag { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.t-team .sb-tag { background: rgba(232, 193, 90, .2); color: #e8c15a; }
.ct-team .sb-tag { background: rgba(111, 168, 220, .2); color: #6fa8dc; }

/* ---------- 购买菜单 ---------- */
#buymenu { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); }
.buy-panel { background: rgba(12, 16, 22, .94); border: 1px solid rgba(255,255,255,.16); border-radius: 6px; padding: 14px 18px; min-width: 560px; }
.buy-title { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.buy-hint { color: #7a838d; font-size: 11px; font-weight: 400; letter-spacing: 0; }
.buy-cols { display: flex; gap: 18px; }
.buy-col { flex: 1; }
.buy-col h4 { color: #9aa2ab; font-size: 11px; letter-spacing: 2px; margin-bottom: 6px; font-weight: 600; }
.buy-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; margin-bottom: 4px; border-radius: 3px;
  background: rgba(255,255,255,.05); border: 1px solid transparent;
  color: #d6dbe1; font-size: 13px; cursor: pointer; pointer-events: auto;
}
.buy-item:hover { background: rgba(111, 168, 220, .18); border-color: rgba(111, 168, 220, .4); }
.buy-item .key { color: #ffd23b; font-size: 11px; margin-right: 8px; font-weight: 700; }
.buy-item .price { color: #9fd68a; font-variant-numeric: tabular-nums; font-size: 12px; }
.buy-item.cant { opacity: .38; }
.buy-item.cant:hover { background: rgba(255, 80, 80, .12); border-color: rgba(255, 80, 80, .35); }

/* ---------- 全屏菜单 ---------- */
.screen {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1c2836 0%, #0a0e14 70%);
  pointer-events: auto; z-index: 10;
}
.menu-box { width: 760px; max-width: 92vw; text-align: center; color: #e8e8e8; }
.menu-box.small { width: 420px; }
.menu-box h1 { font-size: 64px; font-weight: 900; letter-spacing: 4px; color: #fff; text-shadow: 0 4px 24px rgba(111, 168, 220, .35); }
.menu-box h1 .go { color: #e8c15a; }
.menu-box h2 { font-size: 34px; font-weight: 800; letter-spacing: 6px; margin-bottom: 18px; }
.subtitle { color: #8fa0b0; letter-spacing: 3px; font-size: 14px; margin: 6px 0 26px; }

.settings { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; padding: 16px 20px; margin-bottom: 22px; text-align: left; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; }
.set-row + .set-row { border-top: 1px solid rgba(255,255,255,.06); }
.set-row label { color: #b9c2cc; font-size: 13.5px; }
.set-row input[type=range] { width: 220px; accent-color: #e8c15a; }
.set-row span { color: #e8c15a; font-variant-numeric: tabular-nums; }
.seg { display: flex; gap: 6px; }
.seg button {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #b9c2cc;
  padding: 5px 14px; border-radius: 3px; font-size: 13px; cursor: pointer;
}
.seg button.on { background: #e8c15a; color: #14181f; border-color: #e8c15a; font-weight: 700; }
.seg button:hover { border-color: rgba(255,255,255,.4); }

button {
  pointer-events: auto; font-family: inherit;
}
#btn-play, #btn-resume, #btn-again {
  background: linear-gradient(180deg, #e8c15a, #c9a13e); color: #14181f;
  border: none; border-radius: 4px; padding: 13px 58px;
  font-size: 18px; font-weight: 800; letter-spacing: 6px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(232, 193, 90, .25);
}
#btn-play:hover, #btn-resume:hover, #btn-again:hover { filter: brightness(1.1); }
button.ghost {
  display: block; margin: 12px auto 0; background: none; color: #8fa0b0;
  border: 1px solid rgba(255,255,255,.2); border-radius: 4px;
  padding: 9px 34px; font-size: 14px; letter-spacing: 3px; cursor: pointer;
}
button.ghost:hover { color: #fff; border-color: rgba(255,255,255,.5); }

.controls { display: flex; gap: 26px; margin-top: 30px; text-align: left; }
.ctrl-col { flex: 1; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 6px; padding: 14px 16px; }
.ctrl-col h3 { color: #e8c15a; font-size: 13px; letter-spacing: 3px; margin-bottom: 8px; }
.ctrl-col p { color: #9aa2ab; font-size: 12.5px; line-height: 1.9; }
.ctrl-col b { color: #d6dbe1; background: rgba(255,255,255,.08); border-radius: 3px; padding: 0 6px; font-size: 11.5px; }

.end-score { font-size: 46px; font-weight: 900; color: #fff; margin: 10px 0 16px; font-variant-numeric: tabular-nums; }
.end-stats { color: #9aa2ab; font-size: 13.5px; line-height: 2; margin-bottom: 20px; }
.end-stats b { color: #e8e8e8; }
