/* ============ 尸潮幸存者 — 主题与 HUD ============ */
:root {
  --bg: #08090b;
  --panel: rgba(14, 17, 21, 0.96);
  --panel-2: #171c22;
  --line: #2a323b;
  --line-2: #3a444f;
  --text: #dbe3ea;
  --dim: #8b97a3;
  --accent: #c8452f;      /* 血红 */
  --accent-dim: #7e2a1d;
  --green: #4f9e5c;
  --gold: #d9a441;
  --blue: #5b8db8;
  --purple: #9a6ad9;
  --hp: #c0392b;
  --armor: #5b8db8;
  --xp: #c9a227;
  --font-cn: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-num: "Cascadia Mono", Consolas, "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: var(--font-cn);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
#app { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #0b0d10; }
.hidden { display: none !important; }
.gold { color: var(--gold); }
.dim { color: var(--dim); }
.red { color: var(--accent); }
.green { color: var(--green); }
.spacer { flex: 1; }
button { font-family: inherit; }

/* ============ HUD ============ */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud-tl { position: absolute; left: 18px; top: 16px; display: flex; flex-direction: column; gap: 6px; }
.hud-tc { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 420px; }
.hud-tr { position: absolute; right: 18px; top: 16px; text-align: right; display: flex; flex-direction: column; gap: 4px; font-family: var(--font-num); }
.hud-bl { position: absolute; left: 18px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.hud-br { position: absolute; right: 18px; bottom: 16px; }

.bar { position: relative; overflow: hidden; background: rgba(0,0,0,0.55); border: 1px solid var(--line-2); border-radius: 6px; }
.bar .fill { position: absolute; inset: 1px auto 1px 1px; width: 100%; border-radius: 4px; transition: width 0.15s linear; }
.bar.hp { width: 260px; height: 22px; }
.bar.hp .fill { background: linear-gradient(180deg, #e05545, var(--hp)); }
.bar.hp span { position: absolute; inset: 0; text-align: center; font-family: var(--font-num); font-size: 13px; line-height: 22px; text-shadow: 0 1px 2px #000; }
.bar.boss { width: 380px; height: 14px; border-color: #6b2b22; }
.bar.boss .fill { background: linear-gradient(180deg, #d9534f, #7e2a1d); }
.row { display: flex; gap: 6px; align-items: center; }
.chip { font-size: 12px; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(0,0,0,0.45); color: var(--dim); }
#armorChip { color: #9fc3e0; border-color: #35506b; }
#reviveChip { color: #ffd479; border-color: #7a5c1e; }
#regenChip { color: #90d69d; border-color: #2f5a38; }
#radioBox { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-width: 380px; }
.radio-line {
  font-size: 12.5px; line-height: 1.55; color: #b8f0c8; background: rgba(8, 16, 12, 0.74);
  border-left: 2px solid #3f6b46; padding: 4px 9px; border-radius: 4px;
  text-shadow: 0 0 8px rgba(120, 255, 170, 0.25); animation: radioIn 0.25s ease-out;
}
.radio-line.fade { opacity: 0; transition: opacity 0.6s; }
@keyframes radioIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

#waveBox { display: flex; gap: 14px; align-items: baseline; font-family: var(--font-num); font-size: 20px; letter-spacing: 1px; text-shadow: 0 2px 6px #000; }
#waveText { color: #f0d9a0; }
#enemyLeft { font-size: 13px; color: var(--dim); }
#comboBox { display: flex; align-items: center; gap: 8px; }
#comboBox #comboText { font-family: var(--font-num); font-size: 18px; letter-spacing: 1px; color: #ffd479; text-shadow: 0 0 14px rgba(217, 164, 65, 0.65); }
#comboBox .cbar { width: 130px; height: 5px; background: rgba(0,0,0,0.55); border: 1px solid #6b5220; border-radius: 3px; overflow: hidden; }
#comboBox .cbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #d9a441, #ff8a3c); }
.hint #btnReroll { margin-left: 8px; padding: 4px 14px; font-size: 13px; border-color: var(--line-2); }
.hint #btnReroll:disabled { opacity: 0.35; cursor: default; }
#curseHint { font-size: 12px; color: #c9a35a; margin-top: 6px; min-height: 16px; }
#bossBox { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#bossName { font-size: 14px; letter-spacing: 4px; color: #ff9c8a; text-shadow: 0 0 12px rgba(200,69,47,0.8); }
#bannerBox { text-align: center; margin-top: 10px; animation: bannerIn 0.35s ease-out; }
#bannerMain { font-size: 30px; letter-spacing: 8px; color: #f2e3c0; text-shadow: 0 0 20px rgba(217,164,65,0.45), 0 2px 8px #000; }
#bannerSub { font-size: 13px; color: var(--dim); letter-spacing: 2px; margin-top: 4px; }
@keyframes bannerIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: none; } }

.hud-tr #timeText { font-size: 18px; color: #cfd8e0; }
.hud-tr #killText, .hud-tr #serumText { font-size: 13px; color: var(--dim); }
.hud-tr #serumText { color: var(--gold); }

#weaponSlots { display: flex; gap: 8px; }
.wslot {
  width: 168px; padding: 7px 10px 9px; border: 1px solid var(--line-2); border-radius: 8px;
  background: rgba(10,12,15,0.72); position: relative; overflow: hidden;
}
.wslot.active { border-color: #b98b35; box-shadow: 0 0 0 1px rgba(217,164,65,0.35), 0 4px 14px rgba(0,0,0,0.5); }
.wslot .wname { font-size: 13px; color: #e6d9b8; display: flex; justify-content: space-between; }
.wslot .wlvl { color: var(--gold); font-family: var(--font-num); }
.wslot .wammo { font-family: var(--font-num); font-size: 19px; margin-top: 2px; }
.wslot .wammo .mag { color: #fff; }
.wslot .wammo .reloading { color: #ffcf6e; font-size: 13px; }
.wslot .wbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #23282e; }
.wslot .wbar i { display: block; height: 100%; background: var(--gold); width: 0%; }
.wslot.empty { opacity: 0.4; }

#consumables { display: flex; gap: 8px; }
.cons {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  border: 1px solid var(--line-2); border-radius: 7px; background: rgba(10,12,15,0.72);
  font-size: 13px; color: #cdd6de;
}
.cons .ico { font-size: 15px; }
.cons .cnt { font-family: var(--font-num); color: var(--gold); }
.cons .key { font-family: var(--font-num); font-size: 11px; color: var(--dim); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; }
.cons.unavail { opacity: 0.35; }

#minimap { width: 220px; height: 150px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(6,8,10,0.78); }

#toasts { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast {
  padding: 6px 14px; border-radius: 999px; background: rgba(12,14,17,0.88); border: 1px solid var(--line-2);
  font-size: 13px; color: #d7e0e8; animation: toastIn 0.25s ease-out;
}
.toast.warn { border-color: #7a3a2a; color: #ffb39f; }
.toast.good { border-color: #3c6b46; color: #a9e0b3; }
.toast.gold { border-color: #7a5c1e; color: #ffd479; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transition: opacity 0.4s; }

#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(140, 12, 12, 0.42) 100%); }
#lowHpPulse { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(190, 20, 20, 0.30) 100%); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.85; } }

#fpsDebug {
  position: absolute; left: 10px; bottom: 10px; z-index: 99; font-family: var(--font-num); font-size: 11px;
  color: #8fd48f; background: rgba(0,0,0,0.6); padding: 4px 8px; border-radius: 4px; pointer-events: none; white-space: pre;
}

/* ============ 屏幕（菜单/面板） ============ */
.screen {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(30, 12, 8, 0.55), rgba(4, 5, 6, 0.88) 70%), rgba(5, 6, 8, 0.82);
  backdrop-filter: blur(3px);
  animation: screenIn 0.18s ease-out;
}
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
.panel {
  width: min(680px, 92vw); max-height: 88vh; overflow: auto; padding: 22px 26px;
  background: linear-gradient(180deg, rgba(22,26,32,0.98), rgba(13,16,20,0.98));
  border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
}
.panel.wide { width: min(960px, 94vw); }
.panel.small { width: min(420px, 90vw); }
.panel h2 { font-size: 22px; letter-spacing: 3px; font-weight: 600; }
.panel h3 { font-size: 14px; letter-spacing: 2px; color: var(--dim); margin: 18px 0 8px; text-transform: uppercase; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { flex: 0 0 auto; }
.panel-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 18px; }
.panel-actions.col { flex-direction: column; align-items: stretch; }
.panel-actions.col .btn { text-align: center; }

.btn {
  pointer-events: auto; cursor: pointer; padding: 10px 18px; font-size: 15px; letter-spacing: 2px;
  color: var(--text); background: linear-gradient(180deg, #232a31, #1a2026);
  border: 1px solid var(--line-2); border-radius: 8px; transition: all 0.12s ease;
}
.btn:hover { border-color: #55606c; background: linear-gradient(180deg, #2a323a, #1e252c); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, #a03a27, #7e2a1d); border-color: #c8452f; color: #ffe9e0; }
.btn.primary:hover { background: linear-gradient(180deg, #bd4430, #8f3122); box-shadow: 0 0 18px rgba(200,69,47,0.35); }
.btn.danger { border-color: #7a2f26; color: #e8a99b; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); padding: 6px 10px; }
.btn.ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); border-color: var(--line); }
.btn.big { padding: 12px 30px; font-size: 17px; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }

/* 主菜单 */
.menu-panel { text-align: center; padding: 30px 40px; }
.logo {
  font-size: 58px; letter-spacing: 14px; font-weight: 800; color: #f3e6c8; text-indent: 14px;
  text-shadow: 0 0 26px rgba(200, 69, 47, 0.55), 0 4px 12px #000;
}
.logo-sub { font-family: var(--font-num); font-size: 12px; letter-spacing: 6px; color: #8a6c3f; margin: 10px 0 30px; text-indent: 6px; }
.menu-buttons { display: flex; flex-direction: column; gap: 10px; width: 280px; margin: 0 auto; }
.credits { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.credits-title { font-size: 12px; letter-spacing: 8px; color: var(--dim); text-indent: 8px; }
.credits-names { font-size: 15px; color: #e2d3ae; letter-spacing: 3px; margin-top: 7px; }
.credits-note { font-size: 11px; color: #6d7883; margin-top: 5px; letter-spacing: 2px; }
.menu-foot { display: flex; gap: 18px; justify-content: center; margin-top: 22px; font-size: 12px; color: var(--dim); font-family: var(--font-num); }

/* 命名登记 */
.name-panel { text-align: center; }
.name-tip { font-size: 13px; line-height: 1.8; margin: 10px 0 16px; }
.name-input {
  width: 100%; padding: 12px 14px; font-size: 18px; text-align: center; letter-spacing: 3px;
  color: #f0e4c8; background: rgba(0,0,0,0.35); border: 1px solid var(--line-2); border-radius: 8px; font-family: inherit;
}
.name-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217, 164, 65, 0.25); }
.name-inline { flex: 1; text-align: left; font-size: 15px; letter-spacing: 1px; padding: 8px 12px; }

/* 档案室 */
.intel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.intel-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #14181d; }
.intel-item.locked { opacity: 0.45; }
.intel-item .i-title { font-size: 13px; color: #cfe6ff; }
.intel-item .i-map { font-size: 11px; color: var(--dim); margin-left: 6px; }
.intel-item .i-body { font-size: 12px; color: #aab6c2; line-height: 1.6; margin-top: 4px; }

/* 结局尾声 */
.epilogue {
  margin-top: 12px; padding: 12px 14px; border: 1px solid #6b5220; border-left: 3px solid var(--gold);
  border-radius: 8px; background: rgba(217, 164, 65, 0.06); font-size: 13px; line-height: 1.85; color: #e6dcc2;
}

/* 地图选择 */
.map-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.map-card {
  text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, #171c22, #12161a); transition: all 0.12s ease; position: relative; overflow: hidden;
}
.map-card:hover { border-color: #4a5560; }
.map-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217,164,65,0.4); }
.map-card.locked { opacity: 0.45; cursor: not-allowed; }
.map-card .mc-num { font-family: var(--font-num); font-size: 11px; color: var(--dim); }
.map-card .mc-name { font-size: 16px; margin: 3px 0 4px; letter-spacing: 1px; }
.map-card .mc-mech { font-size: 11px; color: #c9a35a; }
.map-card .mc-lock { font-size: 11px; color: #b06a5a; margin-top: 4px; }
.map-card .mc-swatch { position: absolute; right: -14px; top: -14px; width: 46px; height: 46px; border-radius: 50%; opacity: 0.5; }
.map-detail { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,0.25); min-height: 108px; }
.map-detail .md-title { font-size: 18px; letter-spacing: 2px; }
.map-detail .md-desc { font-size: 13px; color: var(--dim); margin-top: 6px; line-height: 1.6; }
.map-detail .md-mech { font-size: 13px; color: #e0b96a; margin-top: 6px; }
.diff-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.diff-row .label { font-size: 13px; color: var(--dim); letter-spacing: 2px; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg .seg-btn { padding: 7px 16px; font-size: 13px; background: #161b21; color: var(--dim); border: 0; cursor: pointer; letter-spacing: 2px; }
.seg .seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg .seg-btn.active { background: linear-gradient(180deg, #a03a27, #7e2a1d); color: #ffe9e0; }
.seg .seg-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* 升级三选一 */
.levelup-wrap { text-align: center; width: min(1000px, 95vw); }
.levelup-head { font-size: 24px; letter-spacing: 4px; margin-bottom: 22px; text-shadow: 0 0 22px rgba(217,164,65,0.4); }
.cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.card {
  width: 262px; text-align: left; padding: 18px; cursor: pointer; border-radius: 12px;
  background: linear-gradient(180deg, #1a2026, #12161a); border: 1px solid var(--line-2);
  transition: all 0.13s ease; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.card .c-cat { font-size: 11px; letter-spacing: 3px; color: var(--dim); }
.card .c-name { font-size: 20px; margin: 6px 0 8px; letter-spacing: 2px; }
.card .c-desc { font-size: 13px; color: #aab6c2; line-height: 1.65; min-height: 44px; }
.card .c-lv { font-family: var(--font-num); font-size: 12px; color: var(--gold); margin-top: 10px; }
.card .c-key { position: absolute; right: 12px; top: 10px; font-family: var(--font-num); font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.card.cat-weapon { border-left: 3px solid #c8452f; }
.card.cat-passive { border-left: 3px solid #4f9e5c; }
.card.cat-tactic { border-left: 3px solid #5b8db8; }
.hint { margin-top: 18px; color: var(--dim); font-size: 13px; letter-spacing: 2px; }

/* 结算 */
.stat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; margin-top: 14px; }
.stat-list.horizontal { grid-template-columns: repeat(4, 1fr); }
.stat-item { display: flex; justify-content: space-between; padding: 7px 10px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.stat-item .k { color: var(--dim); }
.stat-item .v { font-family: var(--font-num); color: #eef3f7; }
.stat-item .v.gold { color: var(--gold); }
#resultTitle { letter-spacing: 8px; }
#resultTitle.win { color: #ffd479; text-shadow: 0 0 30px rgba(217,164,65,0.5); }
#resultTitle.lose { color: #ff8a72; text-shadow: 0 0 30px rgba(200,69,47,0.5); }
#resultUnlocks { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.unlock-line { font-size: 13px; color: #ffd479; border: 1px solid #7a5c1e; border-radius: 8px; padding: 8px 12px; background: rgba(217,164,65,0.08); }

/* 永久强化 */
.meta-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.meta-item { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #14181d; }
.meta-item.maxed { border-color: #7a5c1e; }
.meta-item .mi-body { flex: 1; }
.meta-item .mi-name { font-size: 15px; letter-spacing: 1px; }
.meta-item .mi-desc { font-size: 12px; color: var(--dim); margin-top: 3px; }
.meta-item .mi-lv { font-family: var(--font-num); font-size: 12px; color: var(--gold); margin-top: 4px; }
.meta-item .btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }

/* 成就与战绩 */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ach { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #14181d; }
.ach.locked { opacity: 0.42; }
.ach .a-name { font-size: 13px; }
.ach .a-desc { font-size: 11px; color: var(--dim); margin-top: 3px; }
.table-wrap { overflow: auto; }
table.hist { width: 100%; border-collapse: collapse; font-size: 13px; }
table.hist th, table.hist td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; font-family: var(--font-num); }
table.hist th { color: var(--dim); font-weight: 500; }
table.hist td.win { color: #ffd479; }
table.hist td.lose { color: #d98a7a; }

/* 设置 */
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; align-items: center; gap: 14px; }
.field .f-label { width: 130px; font-size: 14px; color: #c8d2dc; }
.field input[type="range"] { flex: 1; accent-color: var(--accent); }
.field .f-val { width: 46px; text-align: right; font-family: var(--font-num); font-size: 13px; color: var(--gold); }
.field .switch { position: relative; width: 46px; height: 24px; }
.field .switch input { opacity: 0; width: 0; height: 0; }
.field .switch i {
  position: absolute; inset: 0; border-radius: 999px; background: #262d35; border: 1px solid var(--line-2); transition: 0.15s;
}
.field .switch i::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #8a97a3; transition: 0.15s;
}
.field .switch input:checked + i { background: #6e2c1f; border-color: var(--accent); }
.field .switch input:checked + i::after { left: 24px; background: #ffd0c0; }

/* 帮助 */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
table.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
table.keys td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.keys td:first-child { color: #e0c68c; font-family: var(--font-num); width: 46%; }
.tips { margin: 4px 0 0 18px; font-size: 13px; color: #aab6c2; line-height: 1.9; }

/* ============ 触屏 ============ */
#touch { position: absolute; inset: 0; z-index: 15; pointer-events: none; }
.touch-zone { position: absolute; top: 0; bottom: 0; width: 50%; pointer-events: none; }
#touchLeft { left: 0; }
#touchRight { right: 0; }
body.touch-mode .touch-zone { pointer-events: auto; }
.stick-hint {
  position: absolute; bottom: calc(34px + env(safe-area-inset-bottom)); width: 116px; height: 116px;
  border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.14); display: none;
}
.stick-hint i {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.08);
}
#stickHintL { left: calc(30px + env(safe-area-inset-left)); }
#stickHintR { right: calc(30px + env(safe-area-inset-right)); }
body.touch-mode .stick-hint { display: block; }
.stick { position: absolute; width: 150px; height: 150px; display: none; pointer-events: none; }
body.touch-mode .stick.active { display: block; }
.stick .ring {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,0.16); background: rgba(10,12,15,0.25);
}
.stick .knob {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: rgba(220, 230, 240, 0.22); border: 2px solid rgba(255,255,255,0.3);
}
#touchTop {
  position: absolute; right: calc(14px + env(safe-area-inset-right)); top: calc(10px + env(safe-area-inset-top));
  display: none; gap: 8px;
}
#touchButtons {
  position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(180px + env(safe-area-inset-bottom));
  display: none; flex-direction: column; gap: 10px; pointer-events: none;
}
.tbtn {
  pointer-events: auto; width: 74px; height: 54px; border-radius: 12px; font-size: 14px; color: #e8eef4;
  background: rgba(20, 24, 30, 0.72); border: 1px solid rgba(255,255,255,0.2); letter-spacing: 2px;
}
.tbtn.big { height: 74px; background: rgba(120, 40, 28, 0.78); border-color: rgba(255,120,90,0.5); }
.tbtn:active { background: rgba(255,255,255,0.2); }
.tbtn.small { width: 52px; height: 44px; font-size: 13px; letter-spacing: 0; background: rgba(16, 20, 26, 0.66); }
body.touch-mode #touchButtons, body.touch-mode #touchTop { display: flex; }

/* ============ 移动端：竖屏提示 / 紧凑 HUD / 安全区 ============ */
#rotateHint {
  position: absolute; left: 50%; bottom: 176px; transform: translateX(-50%); z-index: 16; pointer-events: none;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; color: #ffe9c4;
  background: rgba(20, 14, 8, 0.78); border: 1px solid #6b5220; display: none;
}
@media (orientation: portrait) {
  body.touch-mode #rotateHint { display: block; }
  .hud-tc { width: 94vw; top: calc(8px + env(safe-area-inset-top)); }
  #waveBox { font-size: 17px; gap: 10px; }
  #radioBox { max-width: 60vw; }
  .radio-line { font-size: 11.5px; }
  .bar.hp { width: 172px; height: 20px; }
  .hud-bl { bottom: calc(10px + env(safe-area-inset-bottom)); }
  .wslot { width: 126px; padding: 5px 7px 8px; }
  .wslot .wammo { font-size: 16px; }
  #minimap { width: 116px; height: 80px; }
  .hud-tr #timeText { font-size: 15px; }
  #touchButtons { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .tbtn { width: 64px; height: 48px; font-size: 13px; }
  .tbtn.big { height: 62px; }
  #toasts { bottom: 92px; }
}
body.touch-mode .hud-tl { left: calc(12px + env(safe-area-inset-left)); top: calc(10px + env(safe-area-inset-top)); }
body.touch-mode .hud-tr { right: calc(12px + env(safe-area-inset-right)); top: calc(10px + env(safe-area-inset-top)); }
body.touch-mode .hud-bl { left: calc(12px + env(safe-area-inset-left)); bottom: calc(10px + env(safe-area-inset-bottom)); }
body.touch-mode .hud-br { right: calc(12px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); }
body.touch-mode .btn { min-height: 46px; }
body.touch-mode .menu-buttons .btn { min-height: 52px; font-size: 16px; }

/* 响应式 */
@media (max-width: 980px) {
  .hud-tc { width: 300px; }
  .bar.hp { width: 190px; }
  #minimap { width: 150px; height: 104px; }
  .wslot { width: 138px; padding: 6px 8px; }
  .logo { font-size: 40px; letter-spacing: 8px; }
  .help-grid { grid-template-columns: 1fr; }
  .stat-list { grid-template-columns: 1fr; }
  .stat-list.horizontal { grid-template-columns: repeat(2, 1fr); }
}
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: 0.001s !important;
  transition-duration: 0.001s !important;
}

/* ============ 像素 UI 皮肤（后置覆盖） ============ */
:root {
  --bg: #07080a;
  --panel: rgba(20, 16, 12, 0.97);
  --panel-2: #1d1712;
  --line: #3a2f24;
  --line-2: #5a4630;
  --text: #ecdfc4;
  --dim: #a08f74;
  --gold: #e0b04a;
  --font-num: "PixelNum", "Cascadia Mono", Consolas, monospace;
}
body { background: #07080a; }
.panel {
  border: 2px solid var(--line-2);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(34, 27, 20, 0.98), rgba(18, 14, 11, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 6px);
  box-shadow:
    inset 0 0 0 2px #120e0b,
    inset 0 0 0 4px rgba(0, 0, 0, 0.35),
    0 0 0 2px #05060a,
    0 14px 40px rgba(0, 0, 0, 0.65);
}
.panel h2 { letter-spacing: 4px; color: #f0e2c2; text-shadow: 0 2px 0 #000; }
.btn {
  border-radius: 2px;
  border: 2px solid var(--line-2);
  background: linear-gradient(180deg, #2a2119, #1a1410);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 0 #0a0806;
  color: #ecdfc4;
  letter-spacing: 3px;
  font-weight: 600;
}
.btn:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, #34281d, #1f1712);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 0 #0a0806;
}
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 0 #0a0806; }
.btn.primary {
  background: linear-gradient(180deg, #a03a27, #6f2317);
  border-color: #d9533b;
  color: #ffe9d8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 3px 0 #3a0f08;
}
.btn.primary:hover {
  background: linear-gradient(180deg, #bd4430, #82291b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 0 #3a0f08, 0 0 18px rgba(200, 69, 47, 0.35);
}
.btn.ghost { letter-spacing: 1px; }
.logo {
  font-size: 62px;
  letter-spacing: 16px;
  color: #f3e2b8;
  text-shadow: 0 3px 0 #4a1a12, 0 6px 0 #1a0d08, 0 0 28px rgba(200, 69, 47, 0.5);
}
.logo-sub { color: #b08a4e; letter-spacing: 8px; }
.card {
  border-radius: 3px;
  border: 2px solid var(--line-2);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.4), 0 5px 0 rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #241c15, #14100c);
}
.card:hover {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.4), 0 7px 0 rgba(0, 0, 0, 0.5), 0 0 22px rgba(224, 176, 74, 0.25);
}
.c-key { border-radius: 2px; border-width: 2px; }
.map-card { border-radius: 2px; border: 2px solid var(--line-2); background: linear-gradient(180deg, #221a13, #14100c); }
.map-card.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px #120e0b, 0 0 0 2px #05060a, 0 0 20px rgba(224, 176, 74, 0.25);
}
.bar { border-radius: 2px; border-width: 2px; background: #0a0806; }
.bar.hp .fill { background: repeating-linear-gradient(90deg, #c0392b 0 6px, #a82f22 6px 8px); }
.bar.boss .fill { background: repeating-linear-gradient(90deg, #d9534f 0 9px, #a13a2e 9px 12px); }
.wslot {
  border-radius: 2px;
  border-width: 2px;
  background: linear-gradient(180deg, rgba(26, 21, 16, 0.88), rgba(12, 10, 8, 0.88));
}
.wslot.active { box-shadow: 0 0 0 1px rgba(224, 176, 74, 0.35), inset 0 0 0 1px rgba(224, 176, 74, 0.2), 0 4px 14px rgba(0, 0, 0, 0.55); }
.chip { border-radius: 2px; }
.radio-line { border-left-width: 3px; border-radius: 2px; background: rgba(6, 14, 10, 0.82); }
#minimap { border-radius: 2px; border-width: 2px; }
.seg { border-width: 2px; border-radius: 2px; }
.seg .seg-btn { background: #1a1410; letter-spacing: 2px; }
.seg .seg-btn.active { background: linear-gradient(180deg, #a03a27, #6f2317); }
.toast { border-width: 2px; border-radius: 2px; background: rgba(16, 12, 9, 0.9); }
.stat-item { border-bottom-color: #3a2f24; }

/* 像素数字字体（只用于数字/拉丁文，中文自动回退系统字体） */
@font-face {
  font-family: "PixelNum";
  src: url("../assets/fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}
.looks-pixel, .hud-tr, #waveBox, .wammo, .stat-item .v, .menu-foot, .radio-line { -webkit-font-smoothing: none; }
.logo-sub, .menu-foot, #menuVersion { font-family: "PixelNum", "Cascadia Mono", monospace; letter-spacing: 1px; }
