:root {
  --acid: #d6ff45;
  --acid-soft: rgba(214, 255, 69, 0.5);
  --ink: #e6efdc;
  --muted: #96a48d;
  --panel: rgba(12, 17, 12, 0.78);
  --line: rgba(214, 255, 69, 0.22);
  --red: #ff4f45;
  --font: "DIN Alternate", "Bahnschrift", "HarmonyOS Sans SC", "PingFang SC",
    "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #080b08;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#app { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.hidden { display: none !important; }

/* ================= HUD ================= */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }

#vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
  opacity: .9;
}

#damageFlash {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(180, 20, 10, 0) 35%, rgba(180, 20, 10, 0.75) 100%);
  opacity: 0; transition: opacity .18s ease-out;
}

#topLeft { position: absolute; top: 20px; left: 24px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.mission-tag {
  font-size: 10px; letter-spacing: .22em; color: var(--acid);
  opacity: .9; margin-bottom: 4px;
}
.mission-name { font-size: 17px; font-weight: 700; letter-spacing: .06em; margin-bottom: 10px; }
.stat-row { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 11px; margin-top: 3px; }
.stat-label { color: var(--muted); letter-spacing: .12em; min-width: 56px; }
.stat-value { color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.stat-unit { color: var(--muted); font-size: 10px; }

#compass {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 620px; max-width: 60vw; height: 44px; opacity: .95;
}

#mapWrap { position: absolute; top: 20px; right: 24px; text-align: right; }
#minimap {
  width: 180px; height: 180px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 9, 0.66);
  box-shadow: 0 8px 26px rgba(0,0,0,.45);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.map-label { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; color: var(--muted); margin-top: 6px; }

#killfeed {
  position: absolute; top: 248px; right: 26px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
}
.kill-item {
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  background: rgba(8, 13, 9, .7); border-left: 2px solid var(--acid);
  padding: 5px 9px; color: #dbe6cf;
  animation: feedIn .22s ease-out;
}
.kill-item b { color: var(--acid); }
.kill-item .head { color: #ffcf5a; }
@keyframes feedIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* 生命体征 */
#vitals { position: absolute; left: 24px; bottom: 26px; width: 264px; display: flex; flex-direction: column; gap: 7px; }
.vital { display: flex; align-items: center; gap: 8px; }
.vital-icon { width: 13px; font-size: 11px; color: var(--muted); text-align: center; }
.vital .bar {
  position: relative; flex: 1; height: 9px; background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.12); overflow: hidden;
}
.vital .bar i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #8fbf3a, var(--acid));
  transition: width .12s linear;
}
.vital .bar.armor i { background: linear-gradient(90deg, #3f7f9c, #7fd4ff); }
.vital .bar.stamina { height: 5px; }
.vital .bar.stamina i { background: linear-gradient(90deg, #b9a63d, #f0e07a); }
.vital-num { font-family: var(--mono); font-size: 11px; color: #fff; width: 26px; text-align: right; }
.vital.small .vital-num { font-size: 9px; color: var(--muted); }

/* 武器 */
#weaponPanel {
  position: absolute; right: 26px; bottom: 26px;
  display: flex; align-items: flex-end; gap: 14px;
  padding: 10px 16px 12px 14px;
  background: linear-gradient(180deg, rgba(10,15,10,0) 0%, rgba(10,15,10,.68) 100%);
  border-right: 2px solid var(--acid);
}
.weapon-slots { display: flex; flex-direction: column; gap: 5px; margin-bottom: 3px; }
.slot {
  font-family: var(--mono); font-size: 9px; width: 16px; height: 16px;
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid rgba(255,255,255,.14);
}
.slot.active { color: #0c1108; background: var(--acid); border-color: var(--acid); font-weight: 700; }
.weapon-main { text-align: right; margin-right: 4px; }
.weapon-name { font-size: 19px; font-weight: 700; letter-spacing: .1em; }
.weapon-type { font-size: 10px; color: var(--muted); letter-spacing: .1em; margin-top: 2px; }
.ammo { font-family: var(--mono); display: flex; align-items: baseline; gap: 3px; }
#ammoClip { font-size: 36px; font-weight: 700; line-height: .9; color: #fff; letter-spacing: -.02em; }
.ammo-sep { font-size: 18px; color: var(--muted); }
#ammoReserve { font-size: 15px; color: var(--muted); }

/* 准星 */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.ch { position: absolute; background: rgba(235, 245, 225, .88); box-shadow: 0 0 3px rgba(0,0,0,.9); }
.ch-t, .ch-b { width: 1.5px; height: 7px; left: -.75px; }
.ch-l, .ch-r { height: 1.5px; width: 7px; top: -.75px; }
.ch-t { bottom: var(--gap, 8px); }
.ch-b { top: var(--gap, 8px); }
.ch-l { right: var(--gap, 8px); }
.ch-r { left: var(--gap, 8px); }
#crosshair.ads .ch { opacity: .35; }
#hitmarker {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px;
  opacity: 0; transform: scale(.7);
  background:
    linear-gradient(45deg, transparent 44%, #fff 45%, #fff 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #fff 45%, #fff 55%, transparent 56%);
  transition: opacity .1s, transform .1s;
}
#hitmarker.show { opacity: 1; transform: scale(1); }
#hitmarker.kill {
  background:
    linear-gradient(45deg, transparent 42%, #ff5a4a 43%, #ff5a4a 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #ff5a4a 43%, #ff5a4a 57%, transparent 58%);
}

/* 交互提示 */
#prompt {
  position: absolute; left: 50%; bottom: 20%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(8, 13, 9, .82); border: 1px solid var(--line);
  padding: 8px 14px 8px 8px; backdrop-filter: blur(3px);
}
.key {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--acid); color: #0b1007;
}
.prompt-body { min-width: 130px; }
.prompt-text { font-size: 12px; letter-spacing: .06em; margin-bottom: 4px; }
.prompt-bar { height: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
.prompt-bar i { display: block; height: 100%; width: 0%; background: var(--acid); }

/* 撤离进度 */
#extractPanel {
  position: absolute; left: 50%; bottom: 27%; transform: translateX(-50%);
  width: 320px; text-align: center;
}
.extract-label { font-size: 11px; letter-spacing: .18em; color: var(--acid); margin-bottom: 6px; }
.extract-bar { height: 6px; background: rgba(0,0,0,.6); border: 1px solid var(--line); }
.extract-bar i { display: block; height: 100%; width: 0%; background: var(--acid); box-shadow: 0 0 14px var(--acid-soft); }
.extract-time { font-family: var(--mono); font-size: 11px; color: #fff; margin-top: 5px; }

/* 提示 & 通知 */
#toasts {
  position: absolute; right: 26px; bottom: 128px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.toast {
  font-size: 12px; padding: 7px 12px; letter-spacing: .04em;
  background: rgba(8, 13, 9, .86); border-left: 2px solid var(--acid);
  animation: toastIn .2s ease-out, toastOut .4s ease-in 2.2s forwards;
  display: flex; gap: 10px; align-items: baseline;
}
.toast .tier { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; opacity: .8; }
.toast b { font-family: var(--mono); font-size: 12px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

#notice {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%);
  font-size: 26px; font-weight: 700; letter-spacing: .3em;
  color: var(--acid); text-shadow: 0 0 24px rgba(214,255,69,.5);
  opacity: 0; transition: opacity .3s;
  white-space: nowrap;
}
#notice.show { opacity: 1; }

#statusHint {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .1em; color: rgba(200, 215, 190, .35);
}
#statusHint b { color: rgba(214, 255, 69, .55); font-weight: 600; }

/* ================= 覆盖层 ================= */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(30, 46, 26, .55), transparent 60%),
    rgba(5, 8, 5, .84);
  backdrop-filter: blur(6px);
  padding: 24px;
}
#menu { background: linear-gradient(105deg, rgba(5, 9, 5, .95) 0%, rgba(5, 9, 5, .82) 46%, rgba(5, 9, 5, .55) 100%); }

.menu-frame {
  width: min(1180px, 94vw); max-height: 92vh; overflow: auto;
  border: 1px solid rgba(214, 255, 69, .18);
  background: linear-gradient(160deg, rgba(14, 20, 13, .92), rgba(9, 13, 9, .96));
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  padding: 26px 32px 28px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), calc(100% - 34px) 100%, 0 100%);
}
.menu-top { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--acid); color: var(--acid); font-size: 17px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: rgba(214, 255, 69, .07);
}
.eyebrow { font-family: var(--mono); font-size: 9px; letter-spacing: .34em; color: var(--muted); }
h1 { font-size: 40px; letter-spacing: .1em; line-height: 1; margin-top: 6px; font-weight: 800; }
h1 span { color: var(--acid); margin-left: 8px; }
.build { font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: .12em; }

.menu-body { display: grid; grid-template-columns: 1.35fr 1fr; gap: 34px; padding-top: 22px; }
.op-title { font-size: 19px; font-weight: 700; letter-spacing: .04em; margin-bottom: 10px; }
.op-desc { font-size: 13px; line-height: 1.85; color: #b9c6ae; max-width: 560px; }
.op-desc b { color: var(--acid); font-weight: 600; }
.op-meta { display: flex; gap: 26px; margin: 18px 0 20px; }
.op-meta div { font-size: 11px; color: #cfdcc4; }
.op-meta span { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--muted); margin-bottom: 4px; }

.diff-head { font-family: var(--mono); font-size: 9px; letter-spacing: .22em; color: var(--muted); margin-bottom: 8px; }
.diff-row { display: flex; gap: 8px; margin-bottom: 22px; }
.diff-btn {
  flex: 1; text-align: left; padding: 9px 12px; cursor: pointer;
  background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.1);
  color: #d5e0cb; font-family: var(--font); transition: .16s;
}
.diff-btn b { display: block; font-size: 12px; letter-spacing: .08em; margin-bottom: 3px; }
.diff-btn i { font-style: normal; font-size: 9px; color: var(--muted); line-height: 1.4; display: block; }
.diff-btn:hover { border-color: rgba(214,255,69,.4); }
.diff-btn.active { border-color: var(--acid); background: rgba(214,255,69,.09); }
.diff-btn.active b { color: var(--acid); }

.primary-btn {
  font-family: var(--font); font-size: 14px; font-weight: 700; letter-spacing: .16em;
  padding: 14px 30px; cursor: pointer; color: #0b1007; background: var(--acid);
  border: none; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: transform .12s, box-shadow .2s;
  box-shadow: 0 0 0 rgba(214,255,69,0);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(214,255,69,.25); }
.primary-btn .btn-key { margin-right: 8px; font-size: 11px; }
.menu-tip { font-size: 10px; color: var(--muted); margin-top: 10px; letter-spacing: .06em; }

.controls-card, .intel-card {
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.015);
  padding: 16px 18px;
}
.intel-card { margin-top: 14px; }
.card-title { font-family: var(--mono); font-size: 9px; letter-spacing: .24em; color: var(--acid); margin-bottom: 12px; }
.ctrl { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.06); font-size: 11px; color: #c4d1b9; }
.ctrl:last-child { border-bottom: none; }
.ctrl b { font-family: var(--mono); font-size: 10px; color: #fff; letter-spacing: .08em; background: rgba(255,255,255,.06); padding: 3px 7px; }
.intel-card ul { list-style: none; }
.intel-card li { font-size: 11px; line-height: 1.6; color: #b4c2a8; padding-left: 13px; position: relative; margin-bottom: 5px; }
.intel-card li::before { content: "›"; position: absolute; left: 0; color: var(--acid); }

.panel {
  width: min(520px, 92vw); padding: 30px 32px;
  background: rgba(12, 18, 12, .96);
  border: 1px solid rgba(214,255,69,.2);
  box-shadow: 0 30px 90px rgba(0,0,0,.7);
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
}
.panel h2 { font-size: 26px; letter-spacing: .12em; margin: 6px 0 8px; }
.panel .muted { font-size: 12px; color: var(--muted); line-height: 1.7; }
.panel-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.ghost-btn {
  font-family: var(--font); font-size: 12px; letter-spacing: .12em;
  padding: 13px 22px; cursor: pointer; color: #cfdcc4;
  background: transparent; border: 1px solid rgba(255,255,255,.2);
}
.ghost-btn:hover { border-color: var(--acid); color: var(--acid); }

.menu-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
#whBtn { font-size: 13px; letter-spacing: .08em; padding: 14px 22px; }
#whBtn span { color: var(--acid); font-family: var(--mono); }

/* 仓库面板 */
.wh-panel {
  width: min(640px, 94vw); max-height: 86vh;
  display: flex; flex-direction: column; text-align: left;
}
.wh-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.wh-inf { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 400; }
.wh-wallet { font-family: var(--mono); font-size: 12px; color: #c4d1b9; margin-top: 7px; letter-spacing: .06em; }
.wh-wallet b { color: var(--acid); margin-left: 4px; }
.wh-msg { font-family: var(--mono); font-size: 11px; color: var(--acid); letter-spacing: .04em; min-height: 16px; margin: 0 2px 12px; opacity: 0; transition: opacity .25s; }
.wh-sell {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  padding: 5px 11px; cursor: pointer; color: #0b1007;
  background: var(--acid); border: none; white-space: nowrap;
}
.wh-sell:hover { filter: brightness(1.1); }
.wh-summary {
  display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.015);
  margin-bottom: 14px; font-size: 12px; color: #c4d1b9;
}
.wh-summary b { color: var(--acid); font-family: var(--mono); margin-left: 4px; }
.wh-list {
  overflow-y: auto; max-height: 46vh; display: flex; flex-direction: column; gap: 1px;
  background: rgba(255,255,255,.05);
}
.wh-item {
  display: grid; grid-template-columns: 14px 1fr auto auto auto auto; align-items: center; gap: 10px;
  padding: 9px 12px; background: rgba(12,18,12,.94); font-size: 12px;
}
.wh-item:nth-child(even) { background: rgba(16,22,16,.94); }
.wh-dot { width: 11px; height: 11px; border-radius: 2px; }
.wh-name { color: #e6efdc; letter-spacing: .03em; }
.wh-tier { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; }
.wh-x { font-family: var(--mono); color: #fff; }
.wh-val { font-family: var(--mono); color: var(--acid); min-width: 64px; text-align: right; }
.wh-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12px; }
.wh-panel .panel-actions { margin-top: 16px; justify-content: flex-start; }
.pause-stats { display: flex; justify-content: center; gap: 34px; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.pause-stats span { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .16em; color: var(--muted); margin-bottom: 4px; }
.pause-stats b { font-family: var(--mono); font-size: 15px; color: #fff; }

.result-panel { width: min(600px, 94vw); }
.result-banner { font-size: 30px; font-weight: 800; letter-spacing: .22em; color: var(--acid); }
.result-panel.failed .result-banner { color: var(--red); }
.result-sub { font-size: 12px; color: var(--muted); margin-top: 8px; letter-spacing: .04em; }
.result-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px 0 6px; text-align: left; }
.result-value { flex: 1; }
.rv-label { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .2em; color: var(--muted); margin-bottom: 4px; }
.rv-num { font-family: var(--mono); font-size: 40px; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.rv-unit { font-size: 10px; color: var(--muted); margin-left: 6px; }
.grade {
  font-size: 62px; font-weight: 800; line-height: 1; color: var(--acid);
  text-shadow: 0 0 30px rgba(214,255,69,.35); min-width: 90px; text-align: center;
}
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.07); margin-top: 18px; }
.result-grid div { background: rgba(12,18,12,.96); padding: 12px 6px; }
.result-grid span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: .14em; color: var(--muted); margin-bottom: 5px; }
.result-grid b { font-family: var(--mono); font-size: 14px; color: #fff; }

@media (max-width: 900px) {
  #compass { max-width: 52vw; }
  .menu-body { grid-template-columns: 1fr; gap: 22px; }
  #mapWrap { transform: scale(.8); transform-origin: top right; }
  #vitals { width: 200px; }
  #weaponPanel { padding: 8px 10px; }
  #ammoClip { font-size: 28px; }
  h1 { font-size: 30px; }
}
