/* ============================================================
   钢铁前线4 STEEL FRONT 4 — 现代战术军事风
   主色：墨绿黑 #0d0f0c · 橄榄 #1a1e16 · 岩灰 #242a20
   强调：琥珀橙 #e8a33d · 战术绿 #7a8c5f · 敌方红 #c94f3d
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg-0: #0d0f0c;
  --bg-1: #13160f;
  --bg-2: #1a1e16;
  --bg-3: #242a20;
  --line: #333b2c;
  --amber: #e8a33d;
  --amber-hi: #f5c562;
  --amber-lo: #9c6a1e;
  --olive: #7a8c5f;
  --text: #e5e3d8;
  --text-dim: #8a8d7e;
  --red: #c94f3d;
  --green: #7fbf6a;
  --cut: 14px; /* 切角尺寸 */
}

html, body {
  width: 100%; height: 100%;
  width: 100vw; height: 100vh; height: 100dvh;
  margin: 0; padding: 0; overflow: hidden;
  background: var(--bg-0);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#app { position: fixed; inset: 0; width: 100%; height: 100%; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; }

/* 模板印刷字 */
.stencil, .game-title, .panel-title, .mode-name, .garage-title, .levels-title, .lobby-title {
  font-family: "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .18em;
}

/* ---------------- 屏幕切换 ---------------- */
.screen {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: none; flex-direction: column; overflow: hidden;
}
.screen.active { display: flex; }

/* ---------------- 通用：顶栏 / 金币 ---------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }

.sim-chip {
  font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center;
  background: linear-gradient(180deg, #20251b, #151811);
  border: 1px solid #5a4a22;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  padding: 7px 14px;
  font-size: 13px; font-weight: 800; letter-spacing: .18em;
  color: var(--amber-hi);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 8px rgba(0,0,0,.45);
  transition: transform .08s, filter .15s;
}
.sim-chip:hover { filter: brightness(1.18); border-color: var(--amber); }
.sim-chip:active { transform: translateY(1px) scale(.96); }

.gold-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #20251b, #151811);
  border: 1px solid #3d4530;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  padding: 7px 16px 7px 9px;
  font-size: 18px; font-weight: 700; color: var(--amber-hi);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 8px rgba(0,0,0,.45);
  letter-spacing: .5px;
}
.coin-icon {
  width: 22px; height: 22px; flex: none; position: relative;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--amber) 55%, #8a5f00);
}
.coin-icon::after {
  content: "G"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #4a3200;
}
.gold-num.bump { animation: goldBump .45s ease; }
@keyframes goldBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: #fff; } 100% { transform: scale(1); } }

.icon-btn {
  width: 42px; height: 42px;
  background: linear-gradient(180deg, #232a1d, #171b12);
  border: 1px solid #3d4530;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  color: var(--text); font-size: 19px; cursor: pointer;
  transition: transform .08s, filter .15s;
}
.icon-btn:active { transform: translateY(1px) scale(.96); filter: brightness(1.2); }

/* ---------------- 通用：按钮（切角战术风） ---------------- */
.btn {
  font-family: inherit; cursor: pointer; color: var(--text);
  border: none; position: relative;
  background: linear-gradient(180deg, #29311f, #1a1f14);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -3px 6px rgba(0,0,0,.35);
  transition: transform .08s ease, filter .15s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  font-weight: 800; letter-spacing: .14em;
}
.btn::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid #46523a;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); filter: brightness(1.25); }
.btn:disabled, .btn.disabled { cursor: not-allowed; filter: grayscale(.75) brightness(.55); transform: none; }

.btn-gold {
  background: linear-gradient(180deg, var(--amber-hi), var(--amber) 45%, var(--amber-lo));
  color: #241800; text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -4px 8px rgba(90,60,0,.45), 0 6px 20px rgba(232,163,61,.28);
}
.btn-gold::before { border-color: #8a6a1e; }

.btn-xl { font-size: 23px; letter-spacing: .35em; text-indent: .35em; padding: 14px 54px; --cut: 18px; }
.btn-lg { font-size: 17px; padding: 13px 26px; }
.btn-sm { font-size: 14px; padding: 9px 16px; --cut: 9px; }
.btn-metal { background: linear-gradient(180deg, #2b3324, #1a2013); }
.btn-practice {
  height: 42px; padding: 0 16px; font-size: 14px; font-weight: 800; letter-spacing: .12em;
  color: #dfe8cc; background: linear-gradient(180deg, #33402a, #202816);
}
.btn-practice::before { border-color: #57683f; }

/* ---------------- 面板（切角） ---------------- */
.panel {
  background: linear-gradient(180deg, rgba(30,36,25,.94), rgba(18,22,14,.94));
  position: relative;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid #3a4430;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.panel-title {
  font-size: 13px; color: var(--text-dim); letter-spacing: .3em;
  border-left: 3px solid var(--amber); padding-left: 8px; margin-bottom: 10px;
  text-transform: uppercase;
}
/* 斜纹警戒条 */
.hazard {
  background: repeating-linear-gradient(-45deg, var(--amber) 0 12px, #14170f 12px 24px);
}

/* ============================================================
   首页 · 仓库场景（角色站在仓库里）
   ============================================================ */
.hangar-bg {
  position: absolute; inset: 0;
  background: url('assets/home_bg.png') center / cover no-repeat;
}
.hangar-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 75% 55% at 50% 8%, rgba(232,163,61,.10), transparent 55%),
    linear-gradient(180deg, rgba(10,12,8,.55), rgba(10,12,8,.15) 40%, rgba(10,12,8,.75));
}

/* 三角洲式主界面 */
.home-brand { display: flex; flex-direction: column; line-height: 1.15; }
.home-brand b {
  font-size: 20px; font-weight: 900; letter-spacing: .12em;
  background: linear-gradient(180deg, #fff8e6, var(--amber-hi) 55%, #b07a24);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-brand span { font-size: 10px; color: var(--text-dim); letter-spacing: .22em; }

.lobby-main {
  position: relative; z-index: 5;
  flex: 1; min-height: 0;
  display: flex; align-items: stretch; justify-content: space-between;
  padding: 0 3.5vw;
}
.lobby-left {
  width: 250px; flex: none;
  display: flex; flex-direction: column; gap: 14px; justify-content: center;
}
.callsign-chip {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: rgba(14, 18, 12, .85); padding: 12px 14px; cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  border: 1px solid #3d4530; color: var(--text);
  transition: filter .15s;
}
.callsign-chip:hover { filter: brightness(1.15); }
.chip-rank {
  width: 38px; height: 38px; flex: none; font-style: normal; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--amber) 55%, #8a5f00);
  color: #4a3200;
}
.chip-name { font-size: 16px; font-weight: 800; letter-spacing: .1em; flex: 1; }
.callsign-chip em { font-style: normal; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.callsign-chip em b { color: var(--amber-hi); font-size: 13px; }
.rail-btns { display: flex; flex-direction: column; gap: 10px; }
.rail-btns .btn { width: 100%; text-align: left; padding: 13px 16px; }
.lobby-notice { font-size: 12px; color: #68705a; line-height: 1.8; letter-spacing: .08em; }

.lobby-stage {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.lobby-right { width: 250px; flex: none; }

.char-stage { position: relative; width: min(46vw, 430px); }
.char-stage canvas {
  display: block; position: relative; z-index: 2;
  width: auto !important; height: min(52vh, 520px) !important;
  max-width: 100%; margin: 0 auto;
}
.char-shadow {
  position: absolute; left: 50%; bottom: 2px; z-index: 1;
  width: 240px; height: 34px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 68%);
}
.home-char-tag {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 18px; margin-top: 2px;
  background: rgba(14,17,10,.72);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.home-char-tag b { font-size: 19px; letter-spacing: .2em; color: var(--amber-hi); }
.home-char-tag span { font-size: 13px; color: var(--text-dim); letter-spacing: .14em; }

.mode-dock {
  position: relative; z-index: 6;
  display: flex; gap: 14px; justify-content: center;
  padding: 1vh 3.5vw 1.6vh;
}
.mode-entry {
  flex: 1; max-width: 300px; position: relative;
  display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto auto;
  column-gap: 12px; text-align: left;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(32,38,26,.92), rgba(16,20,12,.92));
  border: 1px solid #3a4430; border-left: 3px solid var(--amber);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  color: var(--text); cursor: pointer;
  transition: filter .15s, transform .12s;
  font-family: inherit;
}
.mode-entry:hover { filter: brightness(1.18); transform: translateY(-3px); }
.mode-entry-loot { border-left-color: #f5c040; }
.mode-entry-loot b { color: #f5d98a; }
.mode-entry i {
  grid-row: 1 / 4; font-style: normal; font-size: 30px;
  align-self: center; text-align: center;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: rgba(232,163,61,.12); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.mode-entry b { font-size: 19px; font-weight: 900; letter-spacing: .22em; color: #eef0e2; }
.mode-entry span { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.mode-entry .mode-go { font-style: normal; font-size: 12px; font-weight: 800; color: var(--amber-hi); letter-spacing: .18em; margin-top: 6px; }
.char-float { animation: charFloat 3.4s ease-in-out infinite; }
@keyframes charFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.char-shadow {
  position: absolute; left: 50%; bottom: 2px; z-index: 1;
  width: 240px; height: 34px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 68%);
  animation: shadowPulse 3.4s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .85; }
  50% { transform: translateX(-50%) scale(.92); opacity: .6; }
}
.home-char-tag {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 18px; margin-top: -6px;
  background: rgba(14,17,10,.72);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  border: none; position: relative;
}
.home-char-tag b { font-size: 19px; letter-spacing: .2em; color: var(--amber-hi); }
.home-char-tag span { font-size: 13px; color: var(--text-dim); letter-spacing: .14em; }

.name-tag {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 8px 14px;
  background: rgba(14, 18, 12, .78);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.name-tag-label { color: var(--amber-hi); font-size: 13px; font-weight: 800; letter-spacing: .18em; white-space: nowrap; }
.name-tag-input {
  width: min(180px, 42vw); height: 34px;
  padding: 0 12px;
  border: 1px solid #4a5538; background: #10140c;
  color: #eef0e2; font-size: 15px; font-weight: 700;
  letter-spacing: .06em; outline: none;
}
.name-tag-input::placeholder { color: #68705a; font-weight: 600; }
.name-tag-input:focus { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(232,163,61,.18); }

.home-footer {
  position: relative; z-index: 5;
  text-align: center; color: #5c6250; font-size: 12px;
  letter-spacing: .15em; padding: 6px 0 10px;
}
.home-version {
  position: absolute; right: 18px; bottom: 14px; z-index: 6;
  color: #68705a; font-size: 13px; font-weight: 700; letter-spacing: .14em;
  pointer-events: none;
}
.btn-server {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 18px; color: #d4dcc2; font-size: 14px; letter-spacing: .12em;
}
.btn-server::before { border-color: #57683f; }
.btn-server .server-label { font-weight: 700; opacity: .9; }
.btn-server .server-id {
  min-width: 36px; padding: 3px 10px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  background: linear-gradient(180deg, #f5c562, #e8a33d);
  color: #1a1400; font-weight: 900; font-size: 16px; letter-spacing: .08em; text-align: center;
}
.btn-server:hover { color: #eef3df; }

/* ============================================================
   军营 / 角色详情
   ============================================================ */
#screen-barracks { position: relative; }
.hangar-main {
  position: relative; z-index: 5;
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(280px, 1fr) 1.25fr;
  gap: 14px; padding: 4px 16px 10px;
}
.hangar-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.char-card { flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 240px; }
.char-card canvas { max-width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.char-name { font-size: 20px; font-weight: 800; letter-spacing: .12em; margin-top: 4px; }
.char-name em { font-style: normal; color: var(--amber-hi); }
/* ── 装备配置 ── */
.gear-panel { padding: 10px 12px 12px; flex-shrink: 0; }
.gear-panel .panel-title { font-size: 13px; padding-bottom: 8px; }
.gear-grid { display: flex; flex-direction: column; gap: 10px; }
.gear-row { background: #131711; border: 1px solid #333b2c; padding: 8px 9px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.gr-head { display: flex; align-items: baseline; gap: 6px; padding-bottom: 6px; }
.gr-head i { font-size: 15px; font-style: normal; }
.gr-head b { font-size: 13px; letter-spacing: .08em; }
.gr-head em { font-style: normal; font-size: 11px; color: #9aa28c; margin-left: auto; }
.lv-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.lv-cell {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 5px;
  background: #0e120c; border: 1px solid #2c3327; border-top: 2px solid var(--rc, #555);
  color: var(--text); font-family: inherit; cursor: pointer; transition: all .12s; text-align: center;
}
.lv-cell b { font-size: 11px; letter-spacing: .02em; }
.lv-cell i { font-style: normal; font-size: 9px; color: var(--rc, #9aa28c); font-weight: 700; }
.lv-cell em { font-style: normal; font-size: 9px; color: #8a927c; transform: scale(.92); }
.lv-cell.shop:hover { border-color: var(--amber); background: #171b12; transform: translateY(-1px); }
.lv-cell.shop:hover em { color: var(--amber-hi); }
.lv-cell.own { background: #141a10; border-color: #46523a; }
.lv-cell.own em { color: #b8c49a; }
.lv-cell.own:hover { border-color: var(--amber); transform: translateY(-1px); }
.lv-cell.eq { background: #1c2412; border-color: var(--amber); box-shadow: 0 0 10px rgba(232,163,61,.22) inset; }
.lv-cell.eq em { color: var(--amber-hi); font-weight: 800; }
.weapon-slot {
  margin-top: 8px; width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #151a10; border: 1px solid #4a5a2a; color: var(--text);
  font-family: inherit; text-align: left; cursor: pointer; transition: all .12s;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  border-left: 3px solid var(--amber);
}
.weapon-slot:hover { border-color: var(--amber-hi); background: #1b2114; }
.weapon-slot > i { font-size: 22px; font-style: normal; }
.ws-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ws-info b { font-size: 14px; letter-spacing: .06em; }
.ws-info span { font-size: 11px; color: #9aa28c; }
.weapon-slot em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--amber-hi); }
.wpn-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.wpn-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #131711; border: 1px solid #333b2c; color: var(--text);
  font-family: inherit; text-align: left; cursor: pointer; transition: all .12s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.wpn-row:hover { border-color: var(--amber); background: #181d13; }
.wpn-row.eq { border-color: var(--amber); border-left: 3px solid var(--amber); }
.wp-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wp-main b { font-size: 14px; letter-spacing: .06em; }
.wp-main span { font-size: 11px; color: #9aa28c; }
.wpn-row em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--amber-hi); white-space: nowrap; }
.wpn-row.eq em { color: var(--ok); }

.upgrade-col { display: flex; flex-direction: column; gap: 10px; }
.btn-upgrade {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 13px 10px; font-size: 19px; font-weight: 800; letter-spacing: .1em;
  background: linear-gradient(180deg, #33321e, #1c1a10);
}
.btn-upgrade::before { border-color: #6a5a28; }
.btn-upgrade:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,220,130,.16), inset 0 -3px 6px rgba(0,0,0,.4); }
.up-name { pointer-events: none; }
.up-sub { font-size: 12px; font-weight: 500; color: var(--amber-hi); letter-spacing: .04em; pointer-events: none; }
.btn-upgrade:disabled .up-sub { color: #8a8d7e; }

.hangar-stats { display: flex; flex-direction: column; min-height: 0; }
.stats-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; }
.stats-scroll::-webkit-scrollbar { width: 8px; }
.stats-scroll::-webkit-scrollbar-thumb { background: #3a4530; }

.stat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stat-label { width: 44px; font-size: 15px; font-weight: 700; color: #ccd2ba; flex: none; }
.stat-bar { flex: 1; height: 12px; background: #10130c; border: 1px solid #333b2c; overflow: hidden;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a5a14, var(--amber) 60%, var(--amber-hi));
  box-shadow: 0 0 8px rgba(232,163,61,.5);
  transition: width .5s ease;
}
.stat-num { width: 34px; text-align: right; font-weight: 800; color: var(--amber-hi); font-size: 15px; flex: none; }
.stat-num .up { color: var(--green); font-size: 12px; }
.stats-h { font-size: 13px; color: var(--text-dim); letter-spacing: .25em; margin: 16px 0 8px; border-top: 1px dashed #333b2c; padding-top: 14px; }
.stats-p { font-size: 14px; line-height: 1.8; color: #bcc2ac; }
.skill-box {
  margin-top: 6px; padding: 10px 12px;
  background: rgba(20,25,15,.7);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  border-left: 2px solid var(--amber);
}
.skill-box .sk-name { font-size: 16px; font-weight: 900; color: var(--amber-hi); letter-spacing: .1em; }
.skill-box .sk-cd { font-size: 12px; color: var(--text-dim); margin-left: 8px; }
.skill-box .sk-desc { font-size: 13px; color: #bcc2ac; margin-top: 5px; line-height: 1.7; }

.hangar-bottom {
  position: relative; z-index: 5;
  display: flex; justify-content: center; align-items: center; gap: 16px;
  padding: 10px 16px 18px;
}
.btn-home { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; color: var(--amber-hi); --cut: 16px; }
.btn-lobby { color: #b8cf8f; }
.btn-lobby::before { border-color: #57683f; }

/* ============================================================
   我的兵营（角色网格）
   ============================================================ */
#screen-roster {
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(232,163,61,.06), transparent 55%),
    linear-gradient(180deg, #10130c, #0a0c08 60%);
  overflow: hidden; display: none;
}
#screen-roster.active { display: flex; }
.garage-title, .levels-title, .lobby-title {
  text-align: center; font-size: 30px; font-weight: 900;
  letter-spacing: .28em; text-indent: .28em; margin: 8px 0 6px;
  color: #eef0e2;
}
.garage-tip, .levels-tip {
  text-align: center; font-size: 13px; color: var(--text-dim); margin-bottom: 12px; letter-spacing: .1em;
}
.tank-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; padding: 4px 18px 26px;
  align-content: start;
}
.char-grid-card {
  position: relative;
  background: linear-gradient(180deg, #1e2417, #14180f);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  padding: 12px; cursor: pointer;
  transition: filter .15s, transform .12s;
}
.char-grid-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid #3a4430;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.char-grid-card:hover { filter: brightness(1.15); transform: translateY(-2px); }
.char-grid-card.selected::before { border-color: var(--amber); box-shadow: inset 0 0 18px rgba(232,163,61,.18); }
.char-grid-card .cg-canvas { width: 100%; height: 150px; display: block; }
.cg-rarity {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; font-weight: 900; letter-spacing: .12em;
  padding: 3px 8px;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  background: #2a3120; color: #c8ceb6;
}
.cg-rarity.r-elite { background: #2e3a4a; color: #9ec8f0; }
.cg-rarity.r-epic { background: #3c2e4a; color: #d0a8f0; }
.cg-rarity.r-mythic { background: #4a3a1e; color: var(--amber-hi); }
.cg-name { font-size: 17px; font-weight: 900; letter-spacing: .1em; margin-top: 8px; }
.cg-name em { font-style: normal; font-size: 12px; color: var(--text-dim); margin-left: 6px; letter-spacing: .06em; }
.cg-stats { font-size: 12px; color: #9aa28c; margin-top: 4px; line-height: 1.6; }
.cg-btn { margin-top: 10px; width: 100%; }
.cg-owned-tag { color: var(--green); font-weight: 800; }

/* ============================================================
   关卡选择
   ============================================================ */
#screen-levels {
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(232,163,61,.06), transparent 55%),
    linear-gradient(180deg, #10130c, #0a0c08 60%);
}
.batch-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 12px; }
.pager-btn { width: 44px; height: 44px; font-size: 24px; }
.batch-label { font-size: 15px; color: #c8ceb6; letter-spacing: .12em; min-width: 210px; text-align: center; }
.level-list {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; padding: 4px 18px 26px; align-content: start;
}
.level-card {
  position: relative; padding: 16px 14px 14px;
  background: linear-gradient(180deg, #1e2417, #12160d);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  cursor: pointer; transition: filter .15s, transform .12s;
}
.level-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid #3a4430;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.level-card:hover { filter: brightness(1.15); transform: translateY(-2px); }
.level-card.locked { filter: grayscale(.8) brightness(.55); cursor: not-allowed; }
.level-card.done::before { border-color: #4a6a3a; }
.lv-num { font-size: 26px; font-weight: 900; color: var(--amber-hi); font-family: "Arial Black", sans-serif; }
.lv-name { font-size: 16px; font-weight: 800; letter-spacing: .12em; margin-top: 2px; }
.lv-meta { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.7; }
.lv-state { position: absolute; top: 12px; right: 12px; font-size: 13px; font-weight: 900; }
.level-card.done .lv-state { color: var(--green); }
.level-card.locked .lv-state { color: #6a705c; }

/* ============================================================
   联机大厅
   ============================================================ */
#screen-lobby {
  background:
    radial-gradient(ellipse 60% 35% at 50% 0%, rgba(122,140,95,.10), transparent 55%),
    linear-gradient(180deg, #0e120a, #080a06 60%);
  overflow-y: auto;
}
.lobby-tip { text-align: center; font-size: 13px; color: var(--text-dim); margin-bottom: 12px; padding: 0 16px; }
.lobby-tip span, .lobby-tip b { color: var(--amber-hi); font-weight: 800; letter-spacing: .08em; }
.friends-add-row {
  display: flex; justify-content: center; gap: 10px; padding: 0 16px 16px; flex-wrap: wrap;
}
.friend-code-input {
  width: min(220px, 58vw); height: 38px; padding: 0 14px;
  border: 1px solid #4a5538; background: #10140c; color: #eef0e2;
  font-size: 15px; font-weight: 700; letter-spacing: .14em; outline: none;
}
.friend-code-input:focus { border-color: var(--amber); }
.lobby-split {
  width: min(980px, 94%); margin: 0 auto 18px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 760px) { .lobby-split { grid-template-columns: 1fr; } }
.lobby-col { min-height: 120px; }
.friends-panel { display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.friend-row {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #1e2417, #14180f);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  padding: 10px 12px; font-size: 14px;
}
.friend-row .fr-name { flex: 1; font-weight: 800; }
.friend-row .fr-on { color: var(--green); font-size: 12px; }
.friend-row .fr-off { color: var(--text-dim); font-size: 12px; }
.f-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: #c94f3d; color: #fff; font-size: 11px; line-height: 18px;
}
.f-badge.hidden { display: none; }
.inbox-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: #161b10; border: 1px solid #3a4430; font-size: 13px; }
.inbox-row span { flex: 1; }
.lobby-room-bar {
  display: flex; gap: 8px; padding: 0 0 10px; flex-wrap: wrap;
}
.room-code-input {
  width: min(200px, 50vw); height: 38px; padding: 0 14px;
  border: 1px solid #4a5538; background: #10140c; color: #eef0e2;
  font-size: 15px; font-weight: 700; letter-spacing: .14em; outline: none;
}
.room-code-input:focus { border-color: var(--amber); }
.room-list-wrap { width: min(860px, 94%); margin: 0 auto 16px; }
.room-list-title { font-size: 13px; color: var(--text-dim); letter-spacing: .25em; margin-bottom: 8px; }
.room-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.room-row {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #1e2417, #14180f);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  padding: 10px 16px; font-size: 14px;
}
.room-row .rr-id { color: var(--amber-hi); font-weight: 900; letter-spacing: .1em; }
.room-row .rr-name { flex: 1; font-weight: 700; }
.room-row .rr-meta { color: var(--text-dim); font-size: 12px; }
.room-row .btn { font-size: 13px; padding: 7px 14px; }
.friends-empty { text-align: center; color: #6a705c; padding: 30px 16px; font-size: 14px; }

.lobby-modes {
  width: min(1080px, 96%); margin: 0 auto 28px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px;
  padding: 0 8px;
}
.mode-card {
  position: relative; text-align: center;
  background: linear-gradient(180deg, #1e2417, #12160d);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  padding: 18px 16px 16px;
}
.mode-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid #3a4430;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}
.mode-icon { font-size: 34px; }
.mode-name { font-size: 20px; font-weight: 900; letter-spacing: .2em; margin: 8px 0 6px; color: #eef0e2; }
.mode-desc { font-size: 13px; color: var(--text-dim); line-height: 1.8; min-height: 48px; }
.mode-config { margin: 10px 0 4px; }
.cfg-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; font-size: 14px; color: #c8ceb6; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 30px; height: 30px; cursor: pointer; color: var(--text); font-size: 17px; font-weight: 900;
  background: #242b1c; border: 1px solid #46523a;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.stepper b { min-width: 28px; text-align: center; color: var(--amber-hi); font-size: 16px; }
.mode-start { margin-top: 12px; width: 100%; }

.match-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 8, 5, .82); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.match-overlay.hidden { display: none; }
.match-panel {
  width: min(430px, 92%); text-align: center; padding: 28px 26px;
  background: linear-gradient(180deg, #20261a, #13170e);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  border-left: 3px solid var(--amber);
}
.match-title { font-size: 20px; font-weight: 900; letter-spacing: .2em; }
.match-count { font-size: 34px; font-weight: 900; color: var(--amber-hi); margin: 12px 0 8px; font-family: "Arial Black", sans-serif; }
.match-bar { height: 8px; background: #10130c; border: 1px solid #333b2c; margin-bottom: 14px;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
.match-bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber-lo), var(--amber)); transition: width .3s; }
.match-names { font-size: 12px; color: var(--text-dim); line-height: 1.9; min-height: 66px; margin-bottom: 14px; }

/* ============================================================
   战斗
   ============================================================ */
#screen-battle { background: #060705; }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.battle-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px; pointer-events: none;
  gap: 12px;
}
.battle-hud .gold-chip, .battle-hud .icon-btn { pointer-events: auto; }
.hud-left {
  display: flex; flex-direction: column; gap: 5px;
  background: rgba(10, 13, 8, .66); padding: 10px 14px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.hp-label { font-size: 11px; color: var(--text-dim); letter-spacing: .3em; }
.hp-bar { width: min(210px, 34vw); height: 12px; background: #10130c; border: 1px solid #333b2c;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); overflow: hidden; }
.hp-bar div { height: 100%; width: 100%; background: linear-gradient(90deg, #4a7a3a, #7fbf6a); transition: width .18s; }
.hp-bar div.low { background: linear-gradient(90deg, #8a3a28, var(--red)); }
.hp-text { font-size: 13px; font-weight: 800; color: #d8dcc6; letter-spacing: .06em; }
.ammo-row { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; }
.ammo-label { font-size: 11px; color: var(--text-dim); letter-spacing: .3em; }
.ammo-text { font-size: 19px; font-weight: 900; color: var(--amber-hi); font-family: "Arial Black", sans-serif; letter-spacing: .04em; }
.ammo-text.reloading { color: var(--red); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

.hud-center {
  text-align: center; background: rgba(10, 13, 8, .66); padding: 9px 22px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
#hudLevelName { font-size: 15px; font-weight: 900; letter-spacing: .18em; color: #eef0e2; }
#hudEnemies { font-size: 12px; color: var(--amber-hi); letter-spacing: .14em; margin-top: 3px; }
.hud-right { display: flex; gap: 10px; align-items: center; }

.level-banner {
  position: absolute; top: 34%; left: 50%; transform: translateX(-50%);
  z-index: 30; text-align: center; pointer-events: none;
  font-size: clamp(30px, 5vw, 46px); font-weight: 900; letter-spacing: .3em; text-indent: .3em;
  color: var(--amber-hi); text-shadow: 0 2px 0 rgba(0,0,0,.8), 0 0 34px rgba(232,163,61,.45);
  animation: bannerIn .5s ease;
}
.level-banner small { display: block; font-size: 15px; color: #d8dcc6; letter-spacing: .2em; margin-top: 8px; }
.level-banner.hidden { display: none; }
@keyframes bannerIn { 0% { opacity: 0; transform: translateX(-50%) scale(1.25); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }

/* 触屏控件 */
.joystick {
  position: absolute; left: 26px; bottom: 26px; z-index: 22;
  width: 128px; height: 128px; border-radius: 50%;
  background: rgba(16, 20, 12, .5); border: 1px solid #3d4530;
  display: none;
}
.joystick.on { display: block; }
.joy-knob {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #3d4732, #1c2114);
  border: 1px solid #57683f;
}
.fire-btn {
  position: absolute; right: 30px; bottom: 40px; z-index: 22;
  width: 96px; height: 96px; border-radius: 50%;
  display: none;
  font-size: 20px; font-weight: 900; letter-spacing: .2em; text-indent: .2em;
  color: #241800;
  background: radial-gradient(circle at 35% 30%, var(--amber-hi), var(--amber) 55%, var(--amber-lo));
  border: 2px solid #8a6a1e;
}
.fire-btn.on { display: block; }
.mini-btn {
  position: absolute; z-index: 22; display: none;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(16, 20, 12, .72); border: 1px solid #7a8a5a;
  color: #d8e0c0; font-size: 17px; font-weight: 800; cursor: pointer;
}
.mini-btn.on { display: block; }
#jumpBtn { right: 30px; bottom: 152px; }
#stanceBtn { right: 96px; bottom: 158px; }
.stance-row, .loot-row {
  margin-top: 6px; font-size: 13px; color: #cfd8bc; letter-spacing: .08em;
}
.stance-row b { color: var(--amber-hi); margin: 0 6px; }
.stance-row .hk { color: #8a9478; font-size: 11px; margin-left: 8px; }
.loot-row { color: #f0d9a0; font-weight: 700; }
.loot-row b { color: var(--amber-hi); font-size: 16px; }
.interact-hint {
  position: absolute; left: 50%; bottom: 21%; transform: translateX(-50%);
  z-index: 21; pointer-events: none;
  padding: 8px 20px; font-size: 14px; font-weight: 700; letter-spacing: .12em;
  color: var(--amber-hi); background: rgba(12, 14, 8, .72);
  border: 1px solid rgba(232, 163, 61, .5); border-radius: 3px;
}
/* ── 摸金：全屏搜索/背包界面 ── */
.loot-screen {
  position: absolute; inset: 0; z-index: 26;
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding: 3.5vh 3vw; gap: 12px;
  background: rgba(4, 6, 4, .9); backdrop-filter: blur(3px);
}
.ls-inner { display: flex; gap: 26px; align-items: stretch; flex: 1; min-height: 0; width: 100%; }
.ls-col {
  flex: 1; width: auto; overflow-y: auto; padding: 20px 22px 18px;
  background: rgba(12, 15, 10, .96); border: 1px solid rgba(232, 163, 61, .4);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.ls-title { font-size: 17px; font-weight: 800; letter-spacing: .12em; color: var(--text); padding-bottom: 12px; }
.ls-title em { font-style: normal; font-size: 11px; color: #c06050; margin-left: 10px; font-weight: 400; letter-spacing: .04em; }
.ls-title.safe { color: var(--amber-hi); margin-top: 16px; border-top: 1px dashed #333b2c; padding-top: 16px; }
.ls-title.safe em { color: #7fbf6a; }
.ls-title span { float: right; font-size: 12px; color: #9aa28c; }
.ls-tip { font-size: 12px; color: #77816a; letter-spacing: .08em; text-align: center; }
.cp-slots { display: flex; flex-direction: column; gap: 12px; }
.cp-slot {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px;
  padding: 14px 18px; background: #0b0e09; border: 1px solid #262c20; overflow: hidden;
}
.cp-slot.searching { border-color: #3a4430; }
.cp-slot.done { border-color: var(--rc, #555); border-left-width: 4px; background: #10130c; }
.cp-scan { font-size: 28px; animation: cpScan 1s ease-in-out infinite alternate; }
@keyframes cpScan { from { transform: translateX(0) rotate(-8deg); opacity: .7; } to { transform: translateX(12px) rotate(8deg); opacity: 1; } }
.cp-searching-txt { font-size: 14px; color: #77816a; letter-spacing: .12em; }
.cp-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: #1c2117; }
.cp-bar i { display: block; height: 100%; background: var(--amber); transition: width .1s linear; }
.cp-item b { font-size: 17px; color: var(--rc, #ddd); letter-spacing: .04em; }
.cp-item em { font-style: normal; font-size: 12px; color: #9aa28c; margin-left: 10px; }
.cp-item .cp-take { margin-left: auto; font-size: 12px; color: var(--amber-hi); font-weight: 700; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; min-height: 44px; align-content: start; }
.bp-cell {
  display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; cursor: pointer;
  background: #0e120c; border: 1px solid #2c3327; border-left: 3px solid var(--rc, #555);
  color: var(--text); font-family: inherit; text-align: left; transition: all .12s;
}
.bp-cell:hover { border-color: var(--amber); transform: translateY(-1px); }
.bp-cell b { font-size: 14px; color: var(--rc, #ddd); }
.bp-cell em { font-style: normal; font-size: 11px; color: #8a927c; }
.bp-cell.empty { cursor: default; border-left-color: #2c3327; align-items: center; justify-content: center; color: #3c4434; font-size: 11px; min-height: 46px; }
.bp-cell.empty:hover { border-color: #2c3327; transform: none; }
/* ── 全面战场：开局载具选择 ── */
.veh-select {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 5, .78); backdrop-filter: blur(3px);
}
.vs-panel { width: 900px; max-width: 94vw; padding: 26px 28px 18px;
  background: rgba(14, 17, 11, .95); border: 1px solid rgba(232, 163, 61, .5);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
.vs-title { font-size: 20px; font-weight: 900; letter-spacing: .18em; color: var(--amber-hi); padding-bottom: 16px; }
.vs-title span { font-size: 10px; color: #68705a; letter-spacing: .3em; margin-left: 12px; }
.vs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; }
.vs-card i, .vs-card b, .vs-card em { pointer-events: none; }
.vs-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px 14px;
  background: #10140d; border: 1px solid #2c3327; cursor: pointer; font-family: inherit;
  color: var(--text); transition: all .15s;
}
.vs-card:hover { border-color: var(--amber); transform: translateY(-3px); background: #151a10; }
.vs-card i { font-style: normal; font-size: 34px; }
.vs-card b { font-size: 15px; letter-spacing: .1em; color: var(--amber-hi); }
.vs-card em { font-style: normal; font-size: 10.5px; color: #8a927c; line-height: 1.6; text-align: center; }
.vs-tip { padding-top: 14px; font-size: 11px; color: #68705a; letter-spacing: .06em; text-align: center; }
.skill-btn {
  position: absolute; right: 140px; bottom: 52px; z-index: 22;
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: rgba(16, 20, 12, .72); border: 1px solid var(--amber);
  color: var(--amber-hi); font-size: 24px; cursor: pointer;
}
.skill-btn i {
  position: absolute; left: 0; bottom: 0; right: 0; height: 0%;
  background: rgba(232,163,61,.28); pointer-events: none;
}
.skill-btn.cd { border-color: #3d4530; color: #6a705c; }

/* 3D FPS 准星 */
#crosshair {
  position: absolute; left: 50%; top: 50%; z-index: 24;
  width: 0; height: 0; pointer-events: none;
}
#crosshair i {
  position: absolute; background: rgba(245,197,98,.92);
  box-shadow: 0 0 3px rgba(0,0,0,.8);
  transition: transform .1s;
}
#crosshair .ch-t { width: 2px; height: 9px; left: -1px; top: -17px; }
#crosshair .ch-b { width: 2px; height: 9px; left: -1px; top: 8px; }
#crosshair .ch-l { width: 9px; height: 2px; left: -17px; top: -1px; }
#crosshair .ch-r { width: 9px; height: 2px; left: 8px; top: -1px; }
#crosshair b {
  position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px;
  background: rgba(245,197,98,.95); border-radius: 50%;
}
#crosshair.hit i { background: #ff5a3a; transform: scale(1.35); }
#crosshair.hit b { background: #ff5a3a; }

/* 锁定提示 */
#lockHint {
  position: absolute; inset: 0; z-index: 26;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,8,5,.45);
  pointer-events: none; /* 点击穿透到画布触发锁定，不遮挡 HUD */
}
#lockHint.hidden { display: none; }
.lock-panel {
  text-align: center; padding: 22px 34px;
  background: rgba(14,18,10,.88);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  border-top: 2px solid var(--amber);
}
.lock-panel b { display: block; font-size: 20px; letter-spacing: .2em; color: var(--amber-hi); margin-bottom: 8px; }
.lock-panel span { font-size: 13px; color: var(--text-dim); letter-spacing: .08em; }

#hitVignette {
  position: absolute; inset: 0; z-index: 25; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 46%, rgba(190, 40, 20, .55));
  transition: opacity .1s;
}

.death-choice-bar {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  z-index: 28; text-align: center; padding: 16px 26px;
  background: rgba(10, 13, 8, .85);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.death-choice-bar.hidden { display: none; }
.death-choice-tip { font-size: 16px; color: #e0b0a0; letter-spacing: .12em; margin-bottom: 12px; }
.death-choice-btns { display: flex; gap: 12px; justify-content: center; }
.btn-death-spectate { padding: 10px 26px; }
.btn-death-exit { padding: 10px 26px; background: linear-gradient(180deg, #4a2a20, #2a1810); color: #e8c0b0; }

.battle-overlay {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(6, 8, 5, .8); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.battle-overlay.hidden { display: none; }
.overlay-panel {
  width: min(480px, 92%); text-align: center; padding: 30px 28px;
  background: linear-gradient(180deg, #20261a, #12160c);
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  border-top: 3px solid var(--amber);
}
.overlay-title { font-size: 34px; font-weight: 900; letter-spacing: .3em; text-indent: .3em; color: var(--amber-hi); }
.overlay-title.lose { color: var(--red); }
.overlay-title.draw { color: #c4c8b4; }
.overlay-stats { margin: 18px 0; font-size: 15px; line-height: 2.1; color: #c8ceb6; }
.overlay-stats b { color: var(--amber-hi); font-size: 19px; }
.overlay-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   通用菜单 / 提示
   ============================================================ */
.game-menu {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(6, 8, 5, .72);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.game-menu.hidden { display: none; }
.game-menu-panel {
  width: min(430px, 94%); padding: 22px;
  background: linear-gradient(180deg, #20261a, #13170e);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  border-left: 3px solid var(--amber);
}
.game-menu-panel.wide { width: min(720px, 94%); }
.game-menu-title { font-size: 19px; font-weight: 900; letter-spacing: .2em; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-x { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #bcc2ac; font-size: 14px; line-height: 1; transition: all .15s; }
.menu-x:hover { background: rgba(224,74,58,.25); border-color: rgba(224,74,58,.6); color: #ff9a8a; }
.game-menu-body { font-size: 14px; color: #bcc2ac; line-height: 1.9; margin-bottom: 16px; }
.game-menu-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.game-toast {
  position: fixed; left: 50%; bottom: 13%; transform: translateX(-50%);
  z-index: 80; padding: 10px 22px;
  background: rgba(14, 18, 10, .92); color: var(--amber-hi);
  font-size: 15px; font-weight: 700; letter-spacing: .1em;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  animation: toastIn .22s ease;
  pointer-events: none; white-space: nowrap;
}
.game-toast.hidden { display: none; }
@keyframes toastIn { 0% { opacity: 0; transform: translateX(-50%) translateY(12px); } 100% { opacity: 1; transform: translateX(-50%); } }

.hidden { display: none !important; }

@media (max-width: 860px) {
  .hangar-main { grid-template-columns: 1fr; overflow-y: auto; }
  .char-card canvas { max-height: 240px; }
  .btn-xl { font-size: 20px; padding: 15px 40px; }
  .game-title { font-size: 46px; }
  .skill-btn { right: 20px; bottom: 150px; }
}

/* ── 战区仓库 ── */
.stash-toolbar { display: flex; justify-content: flex-end; max-width: 1080px; margin: 0 auto 10px; padding: 0 18px; }
.stash-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
  max-width: 1080px; margin: 0 auto; padding: 0 18px 30px; overflow-y: auto;
}
.stash-card {
  border: 1px solid rgba(255,255,255,.1);
  border-left: 4px solid var(--rc);
  background: linear-gradient(160deg, rgba(20,24,16,.92), rgba(12,15,10,.94));
  border-radius: 8px; padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.sc-head { display: flex; align-items: center; gap: 8px; }
.sc-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 8px var(--rc); flex: 0 0 auto; }
.sc-head b { color: var(--rc); font-size: 14px; letter-spacing: .04em; }
.sc-val { color: var(--amber-hi); font-size: 13px; font-weight: 700; }
.sc-sell { align-self: flex-end; }
.stash-empty {
  grid-column: 1 / -1; text-align: center; color: var(--text-dim);
  padding: 60px 20px; font-size: 14px; line-height: 2;
  border: 1px dashed rgba(255,255,255,.12); border-radius: 10px;
}

/* ── 摸金背包：回血按钮 ── */
.bp-cell { position: relative; }
.bp-heal {
  display: inline-block; margin-top: 4px; padding: 2px 8px;
  border-radius: 5px; font-size: 11px; font-weight: 700; cursor: pointer;
  color: #7dffa0; border: 1px solid rgba(110,255,150,.45); background: rgba(60,180,90,.14);
  transition: all .15s;
}
.bp-heal:hover { background: rgba(80,220,110,.3); box-shadow: 0 0 8px rgba(110,255,150,.4); }

/* ── 作战模拟器 ── */
.sim-map-sec {
  font-size: 11px; letter-spacing: .16em; color: var(--text-dim);
  margin: 14px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sim-map-sec:first-child { margin-top: 0; }
.sim-map-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.sim-map-grid.highland { grid-template-columns: repeat(4, 1fr); }
.sim-map-btn {
  font-family: inherit; cursor: pointer; color: var(--text);
  background: #10140d; border: 1px solid #2c3327;
  padding: 16px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color .15s, transform .08s;
}
.sim-map-btn:hover { border-color: var(--amber); transform: translateY(-2px); }
.sim-map-btn b { font-size: 26px; font-weight: 400; }
.sim-map-btn span { font-size: 12px; letter-spacing: .12em; color: var(--amber-hi); }
@media (max-width: 700px) {
  .sim-map-grid.highland { grid-template-columns: repeat(2, 1fr); }
}

.sim-editor {
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none;
  background: none;
}
.sim-editor.hidden { display: none !important; }
#screen-battle.sim-editing .battle-hud,
#screen-battle.sim-editing .joystick,
#screen-battle.sim-editing .fire-btn,
#screen-battle.sim-editing .mini-btn,
#screen-battle.sim-editing .skill-btn {
  display: none !important;
}
.sim-rail {
  pointer-events: auto;
  position: absolute; left: 12px; top: 12px; bottom: 12px;
  width: 118px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 8px 10px;
  background: rgba(8, 10, 6, .92);
  border: 1px solid #3d4530;
  border-left: 3px solid var(--amber);
  overflow-y: auto;
}
.sim-rail-title {
  text-align: center;
  font-size: 11px; font-weight: 800;
  letter-spacing: .22em; color: var(--amber-hi);
  padding-bottom: 6px;
  border-bottom: 1px solid #2c3327;
}
.sim-palette {
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: auto;
}
.sim-item {
  font-family: inherit; cursor: pointer; color: var(--text);
  width: 100%; padding: 8px 4px 7px;
  background: #10140d; border: 1px solid #2c3327;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.sim-item i { font-style: normal; font-size: 20px; pointer-events: none; }
.sim-item em { font-style: normal; font-size: 11px; letter-spacing: .08em; color: #8a927c; pointer-events: none; }
.sim-item.on, .sim-item:hover { border-color: var(--amber); background: #181e12; }
.sim-item.on em { color: var(--amber-hi); }
.sim-bar {
  pointer-events: none;
  position: absolute; top: 12px; left: 142px; right: 12px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.sim-editor-top { text-align: left; pointer-events: none; padding-top: 4px; }
.sim-editor-top b { display: block; font-size: 15px; letter-spacing: .18em; color: var(--amber-hi); }
.sim-editor-top span { font-size: 11px; color: #8a927c; letter-spacing: .06em; }
.sim-bar-right {
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.sim-counts {
  font-size: 12px; letter-spacing: .1em; color: #d8dcc6;
  background: rgba(10,13,8,.78); padding: 6px 14px;
  border: 1px solid #2c3327;
}
.sim-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  pointer-events: auto;
}
.sim-actions .btn {
  min-width: 92px;
  letter-spacing: .08em;
  clip-path: none;
  border: 1px solid #46523a;
}
.sim-actions .btn::before { display: none; }
.sim-actions .btn-gold { border-color: #8a6a1e; }

@media (max-width: 720px) {
  .sim-rail { width: 96px; left: 8px; top: 8px; bottom: 8px; }
  .sim-bar { left: 114px; right: 8px; top: 8px; flex-direction: column; align-items: stretch; }
  .sim-bar-right { align-items: stretch; }
  .sim-actions { justify-content: flex-start; }
  .sim-actions .btn { flex: 1 1 40%; min-width: 0; }
}

/* 联机房间 / 邀请弹窗 */
.sf4-room {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(6, 8, 5, .92);
  display: flex; flex-direction: column;
  padding: 16px 18px 22px;
}
.sf4-room.hidden { display: none !important; }
.sf4-room-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 4px 14px; border-bottom: 1px solid #2c3327;
}
.sf4-room-title { font-size: 20px; font-weight: 900; letter-spacing: .16em; }
.sf4-room-meta { font-size: 13px; color: var(--amber-hi); margin-top: 4px; letter-spacing: .12em; }
.sf4-room-bar-btns { display: flex; gap: 8px; }
.sf4-room-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px;
  padding-top: 14px;
}
@media (max-width: 800px) { .sf4-room-body { grid-template-columns: 1fr; overflow: auto; } }
.sf4-room-head {
  font-size: 12px; letter-spacing: .2em; color: var(--text-dim); margin: 4px 0 8px;
}
.sf4-slots, .sf4-invite-list, .sf4-mode-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sf4-slot, .sf4-mode-opt, .sf4-invite-row {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #1e2417, #14180f);
  border: 1px solid #3a4430; padding: 10px 12px; font-size: 14px; cursor: pointer;
}
.sf4-slot.host { border-color: var(--amber); }
.sf4-slot .sl-team { font-size: 12px; font-weight: 800; }
.sf4-slot .sl-team.ally { color: var(--green); }
.sf4-slot .sl-team.enemy { color: #e07a62; }
.sf4-mode-opt.on { border-color: var(--amber); }
.sf4-chat {
  height: 120px; overflow-y: auto; background: #10140c; border: 1px solid #2c3327;
  padding: 8px 10px; font-size: 13px; line-height: 1.7; color: #c8ceb6; margin-bottom: 8px;
}
.sf4-chat-form { display: flex; gap: 8px; }
.sf4-chat-form input {
  flex: 1; height: 36px; padding: 0 10px; border: 1px solid #4a5538; background: #10140c; color: #eef0e2; outline: none;
}
.invite-pop {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,8,5,.55);
}
.invite-pop.hidden { display: none; }
.invite-card {
  width: min(380px, 90%); padding: 22px 20px;
  background: linear-gradient(180deg, #20261a, #13170e);
  border-left: 3px solid var(--amber); text-align: center;
}
.invite-card b { display: block; font-size: 16px; line-height: 1.6; margin-bottom: 16px; }
.invite-actions { display: flex; justify-content: center; gap: 10px; }
