/* 霓虹竞技场 UI —— 暗色 + 霓虹青/品红 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --neon: #35e0ff; --neon2: #ff4d9d; --gold: #ffd23c;
  --bg: rgba(10, 14, 24, .82); --line: rgba(53, 224, 255, .35);
}
html, body { width: 100%; height: 100%; overflow: hidden; background: #05070d;
  font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif; color: #e8f4ff;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#cv { position: fixed; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }
#landscapePrompt { display: none; }

/* ---------- 通用覆盖层 ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50; }
#menu { background: radial-gradient(ellipse at 50% 30%, rgba(20,30,60,.55), rgba(4,6,12,.92)); backdrop-filter: blur(3px); }
.menu-wrap { display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; justify-content: center; max-height: 96vh; overflow: auto; }
.menu-hist { width: 320px; padding: 22px 20px; text-align: left; display: flex; flex-direction: column; }
.mh-title { font-size: 17px; font-weight: 800; margin-bottom: 10px; color: var(--gold); letter-spacing: 2px; }
.menu-hist .board-table { flex: 1; font-size: 13px; }
.menu-hist .brow { grid-template-columns: 26px 1fr 42px 42px 42px 46px; padding: 6px 6px; font-size: 12px; }
.menu-card { width: 380px; max-width: 92vw; padding: 28px 30px; text-align: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 0 60px rgba(53,224,255,.12), inset 0 0 30px rgba(53,224,255,.04); }
.small-card { width: 300px; }
.title { font-size: 40px; letter-spacing: 8px; font-weight: 800;
  background: linear-gradient(90deg, var(--neon), #7db4ff 55%, var(--neon2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(53,224,255,.25); }
.subtitle { margin: 6px 0 4px; font-size: 12px; letter-spacing: 4px; color: #7fa8c9; }
.mode-badge { display: inline-block; margin: 5px 0 8px; padding: 4px 10px; border: 1px solid rgba(80,220,255,.35); border-radius: 999px; color: #8fe8ff; background: rgba(20,100,130,.18); font-size: 11px; letter-spacing: 1px; }
body[data-game-mode="guard"] .mode-badge { color: #ffd77a; border-color: rgba(255,190,70,.5); background: rgba(130,80,10,.22); }
.online-line { margin: 10px 0 14px; font-size: 13px; color: #9fd8ef; }
#menuBossHint { color: var(--gold); }
#nameInput { width: 100%; padding: 11px 14px; margin-bottom: 12px; font-size: 16px; text-align: center;
  color: #fff; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 8px; outline: none; }
#nameInput:focus { border-color: var(--neon); box-shadow: 0 0 12px rgba(53,224,255,.25); }
.btn { display: block; width: 100%; padding: 12px; margin-bottom: 10px; font-size: 16px; font-weight: 700;
  color: #cfeeff; background: rgba(53,224,255,.08); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  transition: all .15s; font-family: inherit; }
.btn:hover { background: rgba(53,224,255,.2); box-shadow: 0 0 16px rgba(53,224,255,.3); }
.btn.primary { background: linear-gradient(90deg, rgba(53,224,255,.25), rgba(125,120,255,.25)); border-color: var(--neon); }
.btn.small { width: auto; display: inline-block; padding: 8px 18px; font-size: 14px; }
.help { margin-top: 14px; padding: 12px; text-align: left; background: rgba(255,255,255,.03); border-radius: 8px; }
.help-title { font-size: 12px; color: var(--neon); margin-bottom: 8px; letter-spacing: 2px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; font-size: 12px; color: #a8c4dc; }
.menu-err { margin-top: 8px; min-height: 18px; color: #ff7b7b; font-size: 13px; }
.pause-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.lost-text { color: #ffb45c; font-size: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px; font-size: 14px; color: #cfe6f5; }
.opt-toggle { padding: 5px 16px; font-size: 13px; font-weight: 700; color: #05202c; background: var(--neon);
  border: none; border-radius: 6px; cursor: pointer; font-family: inherit; min-width: 76px; }
.opt-toggle.off { background: rgba(255,255,255,.14); color: #8fa8bd; }
#optSens { width: 120px; accent-color: var(--neon); }
.set-hint { margin: -2px 0 7px; color: #8099a5; font-size: 9px; line-height: 1.45; text-align: left; }
.feedback-card { width: 600px; max-height: calc(100dvh - 20px); overflow: auto; text-align: left; }
#playtestFeedback { z-index: 70; background: rgba(2,7,12,.72); backdrop-filter: blur(3px); }
.feedback-card .pause-title { text-align: center; }
.feedback-privacy { margin: -5px 0 15px; padding: 8px 10px; color: #9fc1ce; border: 1px solid rgba(90,205,230,.2); border-radius: 7px; background: rgba(50,140,165,.08); font-size: 10px; line-height: 1.5; }
.feedback-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; margin-bottom: 14px; }
.feedback-grid label { display: flex; flex-direction: column; gap: 5px; color: #a8c4d0; font-size: 11px; }
.feedback-grid label.wide { grid-column: 1 / -1; }
.feedback-grid select, .feedback-grid textarea, #feedbackOutput { width: 100%; padding: 9px 10px; color: #eafaff; border: 1px solid rgba(90,205,230,.34); border-radius: 7px; background: rgba(5,18,27,.88); outline: none; font: inherit; user-select: text; -webkit-user-select: text; }
.feedback-grid textarea { min-height: 70px; resize: vertical; }
#feedbackOutput { min-height: 180px; margin-bottom: 10px; resize: vertical; font-size: 11px; line-height: 1.55; }
.feedback-status { min-height: 18px; margin: -2px 0 5px; color: #7fe9b3; font-size: 11px; text-align: center; }

/* ---------- 准星 / 命中 ---------- */
#crosshair { position: fixed; left: 50%; top: 50%; z-index: 10; pointer-events: none; }
.ch { position: absolute; background: var(--neon); box-shadow: 0 0 4px rgba(53,224,255,.9); }
.ch.t { width: 2px; height: 9px; left: -1px; top: calc(-11px - var(--sp, 0px)); }
.ch.b { width: 2px; height: 9px; left: -1px; top: calc(3px + var(--sp, 0px)); }
.ch.l { width: 9px; height: 2px; top: -1px; left: calc(-11px - var(--sp, 0px)); }
.ch.r { width: 9px; height: 2px; top: -1px; left: calc(3px + var(--sp, 0px)); }
.ch.dot { width: 2px; height: 2px; left: -1px; top: -1px; border-radius: 50%; }
#hitmarker { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); z-index: 11;
  font-size: 30px; font-weight: 900; color: #fff; opacity: 0; pointer-events: none; text-shadow: 0 0 8px #fff; }
#hitmarker.crit { color: var(--gold); }
#hitmarker.kill { color: #ff7466; text-shadow: 0 0 11px rgba(255,72,58,.95); }
#hitmarker.show { animation: hitpop .22s ease-out; }
#hitmarker.crit.show { animation: hitpopCrit .3s ease-out; }
#hitmarker.kill.show { animation: hitpopKill .34s ease-out; }
@keyframes hitpopCrit { 0% { opacity: 1; transform: translate(-50%,-50%) scale(1.7); } 60% { transform: translate(-50%,-50%) scale(1.05); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(.85); } }
@keyframes hitpop { 0% { opacity: 1; transform: translate(-50%,-50%) scale(1.25); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(.7); } }
@keyframes hitpopKill { 0% { opacity: 1; transform: translate(-50%,-50%) scale(1.9) rotate(0); } 55% { transform: translate(-50%,-50%) scale(1.15) rotate(45deg); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(.85) rotate(45deg); } }
#scope { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.scope-ring { position: absolute; left: 50%; top: 50%; width: min(88vh, 88vw); height: min(88vh, 88vw);
  transform: translate(-50%,-50%); border-radius: 50%; border: 2px solid rgba(53,224,255,.5);
  box-shadow: 0 0 0 200vmax rgba(0,0,0,.93); }
.scope-line { position: absolute; background: rgba(53,224,255,.45); }
.scope-line.h { left: 8%; right: 8%; top: 50%; height: 1px; }
.scope-line.v { top: 8%; bottom: 8%; left: 50%; width: 1px; }

/* ---------- 生命 / 武器面板 ---------- */
#vitals { position: fixed; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 10; width: 250px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bar-ico { font-size: 15px; width: 20px; text-align: center; filter: drop-shadow(0 0 3px rgba(0,0,0,.8)); }
.bar { position: relative; flex: 1; height: 17px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.18); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; width: 0%; transition: width .18s; border-radius: 3px; }
#hpFill { background: linear-gradient(90deg, #2eff8b, #b7ff4d); box-shadow: 0 0 10px rgba(46,255,139,.5); }
.bar.hp.low #hpFill { background: linear-gradient(90deg, #ff3b3b, #ff7c4d); }
#arFill { background: linear-gradient(90deg, #3aa0ff, #6ee0ff); }
#shFill { background: linear-gradient(90deg, #b09bff, #e2c6ff); }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
#weaponPanel { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 10; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.wslot { display: flex; align-items: center; gap: 8px; min-width: 190px; padding: 7px 12px;
  background: var(--bg); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; font-size: 14px; opacity: .55; transition: all .12s; }
.wslot.active { opacity: 1; border-color: var(--neon); box-shadow: 0 0 14px rgba(53,224,255,.25); }
.wslot.empty { opacity: .25; }
.wslot.out { border-color: #ff5252; box-shadow: 0 0 12px rgba(255,60,60,.3); }
.wslot.out .wammo { color: #ff5c5c; font-weight: 800; }
.wkey { font-size: 11px; padding: 1px 6px; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; color: #9fc3dd; }
.wico { font-size: 18px; }
.wname { flex: 1; font-weight: 600; }
.wammo { font-weight: 800; color: var(--gold); font-size: 15px; }
#reloadBar { position: relative; width: 190px; height: 16px; background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
#reloadFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), #ffef7a); }
#reloadText { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }

/* ---------- 左上：金币 & 昼夜 & BUFF ---------- */
#topLeft { position: fixed; left: calc(20px + env(safe-area-inset-left, 0px)); top: calc(18px + env(safe-area-inset-top, 0px)); z-index: 10; }
.tl-row { display: flex; gap: 8px; align-items: center; }
#coinBox { display: inline-block; padding: 6px 14px; font-size: 16px; font-weight: 800; color: var(--gold);
  background: var(--bg); border: 1px solid rgba(255,210,60,.4); border-radius: 8px; }
#dayChip { padding: 6px 12px; font-size: 13px; font-weight: 700; color: #bfd9f0;
  background: var(--bg); border: 1px solid rgba(150,190,230,.3); border-radius: 8px; }
#buffRow { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; max-width: 320px; }
.buff-chip { display: flex; align-items: center; gap: 5px; padding: 4px 9px; font-size: 12px; font-weight: 700;
  background: var(--bg); border: 1px solid var(--bc, var(--line)); border-radius: 20px; color: var(--bc, #fff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--bc, #35e0ff) 40%, transparent); }

/* ---------- 击杀播报 ---------- */
#killfeed { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 10; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.kf { padding: 5px 12px; font-size: 13px; background: rgba(8,12,22,.78); border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; animation: kfIn .2s ease-out; }
.kf b { font-weight: 700; }
.kf .wp { margin: 0 7px; opacity: .9; }
@keyframes kfIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- BOSS ---------- */
#bossBar { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 10; width: 420px; max-width: 60vw; text-align: center; }
#bossBar.guard-midboss { top: calc(205px + env(safe-area-inset-top, 0px)); width: 360px; max-width: 58vw; }
.boss-name { font-size: 14px; font-weight: 800; color: #ff9c5c; text-shadow: 0 0 10px rgba(255,90,40,.6); margin-bottom: 4px; }
.boss-hp { height: 13px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,120,60,.5); border-radius: 7px; overflow: hidden; }
#bossFill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff3d2e, #ff9c3c); box-shadow: 0 0 12px rgba(255,80,40,.7); transition: width .2s; }
#bossTimer { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 10;
  font-size: 12px; color: #c9a06a; background: rgba(8,12,22,.6); padding: 4px 12px; border-radius: 12px; }
#guardPhase { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 11;
  display: flex; align-items: center; gap: 10px; padding: 7px 15px; border-radius: 18px; white-space: nowrap;
  color: #ffe4a3; background: rgba(28,20,8,.82); border: 1px solid rgba(255,190,70,.5); box-shadow: 0 0 16px rgba(255,170,40,.18); }
#guardPhase.hidden { display: none; }
#guardPhaseName { font-size: 13px; font-weight: 800; letter-spacing: 1px; }
#guardWaveProgress { padding-left: 9px; border-left: 1px solid rgba(255,228,163,.3); font-size: 11px; color: #d9e7f2; }
#guardPhaseTime { min-width: 28px; font-size: 12px; color: #fff3cf; text-align: right; }
#guardObjective { position: fixed; left: 50%; top: calc(58px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 11;
  width: 300px; max-width: 58vw; color: #d9e7f2; text-align: center; }
#guardObjective.hidden { display: none; }
.guard-objective-title { margin-bottom: 4px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 1px 3px #000; }
.guard-objective-title span { margin-left: 5px; color: #91a3b5; font-size: 10px; font-weight: 500; }
.guard-objective-bar { position: relative; height: 14px; overflow: hidden; border: 1px solid rgba(120,210,255,.55); border-radius: 8px; background: rgba(0,0,0,.65); }
#guardObjectiveFill { height: 100%; width: 100%; background: linear-gradient(90deg, #36c6ff, #78f0d0); transition: width .2s; }
#guardObjectiveHp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px #000; }
#guardTeamProgression { position: fixed; left: 50%; top: calc(96px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 11;
  width: 250px; max-width: 52vw; color: #e8ddff; text-align: center; }
#guardTeamProgression.hidden { display: none; }
.guard-team-level { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-bottom: 3px; font-size: 10px; font-weight: 700; text-shadow: 0 1px 3px #000; }
.guard-team-level strong { color: #d8adff; font-size: 15px; }
.guard-team-level span { color: #b8c5d4; font-size: 9px; font-weight: 500; }
.guard-team-xp-bar { height: 6px; overflow: hidden; border: 1px solid rgba(191,130,255,.55); border-radius: 5px; background: rgba(0,0,0,.62); }
#guardTeamXpFill { height: 100%; width: 0; background: linear-gradient(90deg, #865dff, #e7a8ff); transition: width .2s; }
#guardRunResource { margin-top: 4px; color: #ffd991; font-size: 10px; font-weight: 600; text-shadow: 0 1px 3px #000; }
#guardRunResource strong { color: #fff0bb; font-size: 12px; }
#guardLanePressure { position: fixed; left: 50%; top: calc(160px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 11;
  display: flex; gap: 5px; color: #d8e6ef; font-size: 9px; text-shadow: 0 1px 3px #000; }
#guardLanePressure.hidden { display: none; }
.guard-lane-chip { min-width: 76px; padding: 4px 7px; text-align: center; border: 1px solid rgba(115,186,220,.35); border-radius: 9px; background: rgba(9,24,36,.72); }
.guard-lane-chip strong { margin-left: 3px; color: #9de0ff; }
.guard-lane-chip.danger { color: #ffd2bd; border-color: rgba(255,100,65,.75); background: rgba(70,16,10,.86); animation: guardLanePulse .8s infinite alternate; }
.guard-lane-chip.danger strong { color: #ff8f6b; }
.guard-lane-chip em { margin-left: 4px; color: #ff9bd2; font-size: 8px; font-style: normal; font-weight: 800; }
.guard-lane-chip.emergency { border-color: rgba(255,82,180,.8); background: rgba(66,12,48,.88); }
@keyframes guardLanePulse { to { box-shadow: 0 0 12px rgba(255,75,40,.42); } }
#guardCombatGuide { position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); top: calc(178px + env(safe-area-inset-top, 0px)); z-index: 11;
  width: min(300px, calc(100vw - 40px)); padding: 11px 13px; color: #dff7ff; border: 1px solid rgba(78,195,230,.4); border-left: 4px solid #55caeb;
  border-radius: 10px; background: rgba(6,20,30,.84); box-shadow: 0 8px 26px rgba(0,0,0,.3); pointer-events: none; transition: opacity .16s, transform .16s; }
#guardCombatGuide.hidden { display: none; }
.guard-guide-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: #7bdcff; font-size: 9px; letter-spacing: 1px; }
#guardGuideTitle { font-size: 14px; font-weight: 900; line-height: 1.35; }
#guardGuideDetail { margin-top: 3px; color: #a9c2cc; font-size: 10px; line-height: 1.45; }
#guardCombatGuide[data-tone="danger"] { border-left-color: #ff614d; background: rgba(40,10,12,.9); }
#guardCombatGuide[data-tone="danger"] .guard-guide-head { color: #ff8a72; }
#guardCombatGuide[data-tone="boss"] { border-left-color: #d98cff; background: rgba(31,10,42,.9); }
#guardCombatGuide[data-tone="boss"] .guard-guide-head { color: #e6a8ff; }
#guardCombatGuide[data-tone="rescue"] { border-left-color: #63e6a6; background: rgba(7,34,25,.9); }
#guardCombatGuide[data-tone="rescue"] .guard-guide-head { color: #8bf0bd; }
#guardCombatGuide[data-tone="supply"], #guardCombatGuide[data-tone="prepare"] { border-left-color: #ffd36b; }
#guardCombatGuide[data-tone="supply"] .guard-guide-head, #guardCombatGuide[data-tone="prepare"] .guard-guide-head { color: #ffe199; }
#guardCombatGuide.urgent { animation: guardGuidePulse .8s ease-out 2; }
@keyframes guardGuidePulse { 50% { transform: translateX(-5px); box-shadow: 0 0 24px rgba(255,90,70,.28); } }
#guardDecisionBackdrop { position: fixed; inset: 0; z-index: 60; background: rgba(2,7,12,.55); backdrop-filter: blur(2px); }
#guardDecisionBackdrop.hidden { display: none; }
#guardOnboarding, #guardMapChoice, #guardTalentChoice, #guardRoleChoice, #guardRequisition { position: fixed; left: 50%; top: 50%; z-index: 61;
  transform: translate(-50%, -50%); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto;
  animation: guardDecisionIn .16s ease-out; }
@keyframes guardDecisionIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); } }
#guardOnboarding { width: 620px; padding: 24px; color: #e7f7ff; border: 1px solid rgba(87,204,255,.7); border-radius: 18px;
  background: rgba(8,25,38,.98); box-shadow: 0 18px 70px rgba(0,0,0,.65), 0 0 34px rgba(55,173,225,.24); }
#guardOnboarding.hidden { display: none; }
#guardMapChoice { width: 760px; padding: 24px; color: #e7f7ff; border: 1px solid rgba(255,184,75,.68); border-radius: 18px;
  background: rgba(10,20,29,.98); box-shadow: 0 18px 70px rgba(0,0,0,.68), 0 0 34px rgba(255,145,45,.2); }
#guardMapChoice.hidden { display: none; }
.guard-map-title { color: #ffe1a0; font-size: 24px; font-weight: 900; text-align: center; letter-spacing: 3px; }
#guardMapChoice > p { margin: 8px 0 18px; color: #9fb8c3; font-size: 11px; line-height: 1.6; text-align: center; }
.guard-map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.guard-map-card { position: relative; min-height: 176px; overflow: hidden; padding: 20px; text-align: left; color: #eafaff;
  border: 1px solid rgba(99,216,244,.38); border-radius: 13px; background: linear-gradient(145deg, rgba(15,62,78,.86), rgba(7,23,32,.95)); cursor: pointer; }
.guard-map-card[data-tone="amber"] { border-color: rgba(255,164,67,.55); background: linear-gradient(145deg, rgba(89,49,18,.88), rgba(25,20,15,.96)); }
.guard-map-card[data-tone="toxic"] { border-color: rgba(157,176,95,.58); background: linear-gradient(145deg, rgba(65,69,38,.92), rgba(24,25,18,.97)); }
.guard-map-card:hover { transform: translateY(-2px); border-color: #7ee7ff; box-shadow: 0 10px 24px rgba(0,0,0,.34); }
.guard-map-card[data-tone="amber"]:hover { border-color: #ffb454; }
.guard-map-card strong, .guard-map-card span, .guard-map-card em { display: block; }
.guard-map-card strong { margin-bottom: 8px; color: #bff5ff; font-size: 21px; }
.guard-map-card[data-tone="amber"] strong { color: #ffd19a; }
.guard-map-card[data-tone="toxic"] strong { color: #d8e49b; }
.guard-map-card span { min-height: 48px; color: #c4d4db; font-size: 12px; line-height: 1.65; }
.guard-map-card em { margin-top: 13px; color: #72dfff; font-size: 10px; font-style: normal; font-weight: 800; }
.guard-map-card[data-tone="amber"] em { color: #ffb765; }
.guard-map-card[data-tone="toxic"] em { color: #becf72; }
.guard-onboarding-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(120,215,255,.2); }
.guard-onboarding-head span { color: #7bdcff; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.guard-onboarding-head strong { color: #fff0b2; font-size: 17px; }
.guard-onboarding-pages section { min-height: 250px; padding: 20px 8px 10px; text-align: center; }
.guard-onboarding-pages section.hidden { display: none; }
.guard-onboarding-icon { font-size: 46px; filter: drop-shadow(0 0 12px rgba(96,210,255,.4)); }
.guard-onboarding-pages h2 { margin: 11px 0 8px; color: #dff8ff; font-size: 23px; }
.guard-onboarding-pages p { max-width: 500px; margin: 0 auto; color: #c6d8df; font-size: 13px; line-height: 1.75; }
.guard-onboarding-callout { margin: 18px auto 0; padding: 11px 13px; color: #ffe5a1; border: 1px solid rgba(255,207,92,.32); border-radius: 9px; background: rgba(85,59,12,.32); font-size: 11px; line-height: 1.5; }
.guard-onboarding-actions { display: flex; justify-content: space-between; gap: 10px; }
.guard-onboarding-actions button { min-width: 118px; padding: 10px 16px; color: #b9ccd3; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(255,255,255,.06); cursor: pointer; }
.guard-onboarding-actions button.primary { color: #072332; border-color: #73dcff; background: #73dcff; font-weight: 850; }
.tutorial-replay { width: 100%; margin-top: 10px; }
#guardTalentChoice { width: 680px; padding: 22px; border: 1px solid rgba(194,145,255,.7); border-radius: 16px;
  background: rgba(17,12,31,.97); box-shadow: 0 18px 70px rgba(0,0,0,.58), 0 0 35px rgba(125,75,210,.3); }
#guardTalentChoice.hidden { display: none; }
.guard-talent-title, .guard-role-title { margin-bottom: 16px; text-align: center; font-size: 22px; font-weight: 900; letter-spacing: 2px; }
.guard-talent-title { color: #eedcff; }
.guard-talent-title span, .guard-role-title span { display: block; margin-top: 5px; color: #aab3c0; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.guard-choice-grid { display: grid; gap: 10px; }
.talent-grid { grid-template-columns: repeat(3, 1fr); }
.role-grid { grid-template-columns: repeat(2, 1fr); }
#guardTalentChoice button { display: flex; min-height: 104px; width: 100%; flex-direction: column; justify-content: center; gap: 8px; padding: 14px; text-align: center;
  color: #e9f1f8; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(55,43,82,.72); cursor: pointer; }
#guardTalentChoice button:hover { border-color: rgba(216,173,255,.7); background: rgba(80,55,122,.86); }
#guardTalentChoice button strong { color: #d8adff; font-size: 17px; }
#guardTalentChoice button span { font-size: 11px; line-height: 1.5; }
#guardTalentStatus { position: fixed; right: calc(18px + env(safe-area-inset-right, 0px)); top: calc(115px + env(safe-area-inset-top, 0px)); z-index: 11;
  max-width: 250px; padding: 6px 10px; color: #ddc3ff; font-size: 10px; border: 1px solid rgba(194,145,255,.4); border-radius: 10px; background: rgba(17,12,31,.74); }
#guardTalentStatus.hidden { display: none; }
#guardRoleChoice { width: 620px; padding: 22px; border: 1px solid rgba(80,205,235,.7); border-radius: 16px;
  background: rgba(8,28,36,.97); box-shadow: 0 18px 70px rgba(0,0,0,.58), 0 0 35px rgba(35,185,220,.28); }
#guardRoleChoice.hidden, #guardRoleAbility.hidden { display: none; }
.guard-role-title { color: #d8f8ff; }
#guardRoleChoice button { display: flex; min-height: 86px; width: 100%; flex-direction: column; justify-content: center; gap: 6px; padding: 13px; text-align: center;
  color: #e9f7fa; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(25,70,80,.72); cursor: pointer; }
#guardRoleChoice button:hover { border-color: rgba(105,225,245,.72); background: rgba(30,90,105,.88); }
#guardRoleChoice button strong { color: #78e8ff; font-size: 16px; }
#guardRoleChoice button em { color: #ffd978; font-size: 9px; font-style: normal; font-weight: 800; }
#guardRoleChoice button span { font-size: 11px; line-height: 1.4; }
#guardRoleAbility { position: fixed; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(112px + env(safe-area-inset-bottom, 0px)); z-index: 12;
  min-width: 205px; padding: 8px 11px; text-align: left; color: #dffaff; border: 1px solid rgba(80,205,235,.52); border-radius: 9px;
  background: rgba(8,35,43,.82); cursor: pointer; }
#guardRoleAbility:disabled { opacity: .55; cursor: not-allowed; }
#guardRoleAbility strong, #guardRoleAbility span { display: block; }
#guardRoleAbility strong { color: #78e8ff; font-size: 11px; }
#guardRoleAbility span { margin-top: 2px; color: #c7dce1; font-size: 9px; }
#guardRequisition { width: 760px; max-height: calc(100vh - 30px); padding: 20px; overflow-y: auto; color: #f7e8bd; border: 1px solid rgba(238,190,92,.65); border-radius: 16px;
  background: rgba(29,22,10,.97); box-shadow: 0 18px 70px rgba(0,0,0,.58), 0 0 32px rgba(190,135,45,.25); }
#guardRequisition.hidden { display: none; }
.guard-req-title { text-align: center; font-size: 19px; font-weight: 850; letter-spacing: 2px; }
.guard-req-title span { margin-left: 5px; color: #a9a18d; font-size: 9px; font-weight: 500; }
#guardReqBalance { margin: 6px 0 12px; text-align: center; color: #ffd873; font-size: 12px; font-weight: 700; }
.guard-req-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.guard-req-section { padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; }
.guard-req-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.guard-req-section-title strong { font-size: 12px; }
.guard-req-section-title span { text-align: right; color: #aeb7be; font-size: 8px; }
.req-weapons { border-color: rgba(74,196,255,.42); background: rgba(12,48,68,.52); }
.req-weapons .guard-req-section-title strong { color: #72d9ff; }
.req-upgrades { border-color: rgba(187,126,255,.42); background: rgba(48,25,69,.52); }
.req-upgrades .guard-req-section-title strong { color: #d3a6ff; }
.req-supplies { grid-column: 1 / -1; border-color: rgba(104,224,151,.42); background: rgba(18,61,42,.52); }
.req-supplies .guard-req-section-title strong { color: #8aefb0; }
.guard-req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.guard-req-grid button { min-height: 52px; padding: 7px; text-align: left; color: #f3ead5; border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  background: rgba(255,255,255,.055); cursor: pointer; }
.req-weapons .guard-req-grid button:hover:not(:disabled) { border-color: rgba(114,217,255,.78); background: rgba(20,82,108,.88); }
.req-upgrades .guard-req-grid button:hover:not(:disabled) { border-color: rgba(211,166,255,.78); background: rgba(79,42,108,.88); }
.req-supplies .guard-req-grid button:hover:not(:disabled) { border-color: rgba(138,239,176,.78); background: rgba(30,91,61,.88); }
.guard-req-grid button:disabled { opacity: .38; cursor: not-allowed; }
.guard-req-grid button:disabled span { color: #e5b96c; font-weight: 700; }
.guard-req-grid button strong, .guard-req-grid button span { display: block; }
.guard-req-grid button strong { font-size: 10px; }
.req-weapons .guard-req-grid button strong { color: #a7e8ff; }
.req-upgrades .guard-req-grid button strong { color: #dfc1ff; }
.req-supplies .guard-req-grid button strong { color: #acf4c7; }
.guard-req-grid button span { margin-top: 3px; color: #c9c1af; font-size: 9px; }
#guardReqStatus { margin-top: 8px; color: #bcb4a3; font-size: 9px; }
.guard-decision-done { display: block; min-width: 150px; margin: 14px auto 0; padding: 9px 18px; color: #2a210d;
  border: 0; border-radius: 9px; background: #ffd873; font-weight: 850; cursor: pointer; }
#guardDowned { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 14; min-width: 280px;
  padding: 18px 24px; text-align: center; border: 1px solid rgba(255,115,80,.72); border-radius: 14px;
  background: rgba(38,8,8,.88); box-shadow: 0 0 32px rgba(255,65,35,.28); color: #ffe0d2; }
#guardDowned.hidden { display: none; }
.guard-downed-title { font-size: 27px; font-weight: 900; letter-spacing: 4px; color: #ff8b62; text-shadow: 0 0 14px rgba(255,80,45,.55); }
#guardDownedTime { margin-top: 8px; font-size: 17px; font-weight: 800; color: #fff1c4; }
.guard-downed-hint { margin-top: 7px; font-size: 11px; color: #d8aaa0; }

/* ---------- 中央提示 ---------- */
#notice { position: fixed; left: 50%; top: 60%; transform: translateX(-50%); z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.notice-item { padding: 5px 16px; font-size: 14px; font-weight: 700; color: #d7f6ff; background: rgba(8,14,26,.72);
  border: 1px solid var(--line); border-radius: 18px; animation: noticeIn 2.6s forwards; }
.notice-item.gold { color: var(--gold); border-color: rgba(255,210,60,.5); }
@keyframes noticeIn { 0% { transform: translateY(12px); opacity: 0; } 8% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
#bigNotice { position: fixed; left: 50%; top: 26%; transform: translateX(-50%); z-index: 12; font-size: 30px; font-weight: 900;
  color: var(--gold); text-shadow: 0 0 24px rgba(255,180,40,.8), 0 2px 4px #000; opacity: 0; pointer-events: none; letter-spacing: 3px; }
#bigNotice.show { animation: bigIn 2.4s forwards; }
@keyframes bigIn { 0% { opacity: 0; transform: translateX(-50%) scale(1.6); } 12% { opacity: 1; transform: translateX(-50%) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; } }
#interactHint { position: fixed; left: 50%; bottom: 26%; transform: translateX(-50%); z-index: 10; cursor: pointer;
  padding: 8px 20px; font-size: 15px; background: rgba(8,14,26,.8); border: 1px solid var(--gold); border-radius: 8px; color: #ffe9a8; }
#guardReviveHint { position: fixed; left: 50%; bottom: 26%; transform: translateX(-50%); z-index: 21; min-width: 240px;
  padding: 9px 18px; font: 800 14px inherit; color: #dfffee; background: rgba(7,28,22,.9); border: 1px solid #65e6a5;
  border-radius: 9px; cursor: pointer; touch-action: none; user-select: none; box-shadow: 0 0 18px rgba(75,230,150,.18); }
#guardReviveHint i { display: block; height: 5px; margin-top: 7px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.13); }
#guardReviveFill { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #48d890, #b5ffd8); transition: width .08s linear; }
#guardReviveHint.active { color: #fff; border-color: #b5ffd8; }
#guardSupplyHint { position: fixed; left: 50%; bottom: 26%; z-index: 20; transform: translateX(-50%); min-width: 220px;
  padding: 8px 14px; text-align: center; color: #dffaff; border: 1px solid rgba(72,218,255,.68); border-radius: 9px;
  background: rgba(6,28,38,.9); box-shadow: 0 0 18px rgba(55,210,255,.18); pointer-events: none; }
#guardSupplyHint.hidden { display: none; }
#guardSupplyHint strong, #guardSupplyHint span { display: block; }
#guardSupplyHint strong { color: #81e5ff; font-size: 13px; }
#guardSupplyHint span { margin-top: 2px; color: #a9c9d3; font-size: 9px; }
#protectHint { position: fixed; left: 50%; bottom: 20%; transform: translateX(-50%); z-index: 10; font-size: 13px; color: #9fd8ef; }

/* ---------- 受击方向指示 / BOSS 降临闪屏 ---------- */
#dmgDirWrap { position: fixed; left: 50%; top: 50%; z-index: 9; pointer-events: none; }
.dmg-arc { position: absolute; left: -70px; top: -70px; width: 140px; height: 140px; border-radius: 50%;
  border: 4px solid transparent; border-top-color: rgba(255,45,45,.9); opacity: 0;
  filter: drop-shadow(0 0 6px rgba(255,30,30,.8)); }
.dmg-arc.show { animation: dmgArc .8s ease-out; }
@keyframes dmgArc { 0% { opacity: 1; transform: scale(.85) rotate(var(--ang)); } 100% { opacity: 0; transform: scale(1.15) rotate(var(--ang)); } }
#bossFlash { position: fixed; inset: 0; z-index: 8; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255,60,20,.4) 100%); }
#bossFlash.show { animation: bossFl 1.2s ease-out; }
@keyframes bossFl { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.bar.hp.low #hpFill { animation: hpPulse 1s infinite; }
@keyframes hpPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.7); } }

/* ---------- 受击 / 状态滤镜 ---------- */
#dmgVignette { position: fixed; inset: 0; z-index: 8; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255,20,20,.55) 100%); transition: opacity .1s; }
#zombieTint { position: fixed; inset: 0; z-index: 7; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(60,255,60,.06), rgba(30,180,40,.22)); transition: opacity .4s; }
#flashWhite { position: fixed; inset: 0; z-index: 13; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0%, #fff 55%, #eef6ff 100%); }
#statLine { position: fixed; right: 8px; bottom: 4px; z-index: 10; font-size: 10px; color: rgba(160,200,220,.55); }

/* ---------- 聊天 ---------- */
#chatBox { position: fixed; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: 110px; z-index: 11; width: 340px; max-width: 45vw; transition: bottom .15s; }
@media (pointer: fine) and (min-width: 721px) {
  body[data-game-mode="guard"] #chatBox { bottom: 180px; }
}
#chatMsgs { display: flex; flex-direction: column; gap: 3px; max-height: 200px; overflow: hidden; justify-content: flex-end; }
.cmsg { font-size: 13px; padding: 3px 9px; background: rgba(6,10,18,.62); border-radius: 5px; line-height: 1.45;
  word-break: break-all; animation: kfIn .15s ease-out; }
.cmsg .cname { font-weight: 700; }
.cmsg.sys { color: #8fb8d8; font-style: italic; }
.cmsg.sys.boss { color: #ffb45c; font-weight: 700; font-style: normal; }
.cmsg.sys.streak { color: var(--gold); font-weight: 700; font-style: normal; }
.cmsg.sys.shop { color: #d0a9ff; }
#chatInputRow { margin-top: 6px; display: flex; gap: 6px; }
#chatInput { flex: 1; min-width: 0; padding: 8px 12px; font-size: 14px; color: #fff; background: rgba(8,14,26,.85);
  border: 1px solid var(--neon); border-radius: 6px; outline: none; font-family: inherit; }
#chatSendBtn { flex: 0 0 auto; padding: 8px 16px; font-size: 13px; font-weight: 700; color: #05202c;
  background: var(--neon); border: none; border-radius: 6px; cursor: pointer; font-family: inherit; }
body.chat-focus #chatBox { bottom: 44vh; }

/* ---------- 面板（排行榜/商店） ---------- */
.panel { background: rgba(3,5,10,.5); }
.panel-card { position: relative; width: 520px; max-width: 94vw; max-height: 86vh; overflow: auto; padding: 20px 24px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 0 50px rgba(53,224,255,.1); }
.panel-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; z-index: 5;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #cfe6f5; font-size: 19px; line-height: 1; cursor: pointer; font-family: inherit; }
.panel-close:hover { background: rgba(255,80,80,.25); border-color: rgba(255,120,120,.5); }
.panel-title { font-size: 20px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.panel-sub { font-size: 12px; color: #7fa8c9; font-weight: 400; }
.panel-hint { margin-top: 12px; text-align: center; font-size: 11px; color: #7591ad; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 16px; font-size: 13px; color: #9fc3dd; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.14); border-radius: 6px; cursor: pointer; font-family: inherit; }
.tab.active { color: #05202c; background: var(--neon); border-color: var(--neon); font-weight: 700; }
.board-table { font-size: 14px; }
.brow { display: grid; grid-template-columns: 32px 1fr 50px 50px 56px 56px; padding: 7px 10px; border-radius: 6px; align-items: center; }
.brow.head { color: #7fa8c9; font-size: 12px; }
.brow .num.streak-hot { color: #ff8a3c; font-weight: 800; }
.brow:nth-child(even):not(.head) { background: rgba(255,255,255,.035); }
.brow.me { background: rgba(53,224,255,.14); border: 1px solid rgba(53,224,255,.35); }
.brow .rank { font-weight: 800; color: #9fc3dd; }
.brow .rank.r1 { color: var(--gold); } .brow .rank.r2 { color: #d8dee6; } .brow .rank.r3 { color: #d99a5b; }
.brow .num { text-align: right; font-weight: 700; }
#board.guard-board .panel-card { width: 620px; }
#board.guard-board .brow { grid-template-columns: 32px 1fr 72px 82px 58px 58px; }

/* ---------- 商店 ---------- */
.shop-card { width: 780px; }
.shop-coins { margin-left: auto; font-size: 16px; color: var(--gold); font-weight: 800; }
.shop-body { display: flex; gap: 14px; align-items: flex-start; }
#shopStage { flex: 0 0 240px; text-align: center; }
#shopCv { width: 240px; height: 320px; border-radius: 10px; background:
  radial-gradient(ellipse at 50% 80%, rgba(53,224,255,.12), rgba(8,12,24,.6)); border: 1px solid var(--line); }
.stage-cap { margin-top: 6px; font-size: 11px; color: #7fa8c9; }
#shopGrid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item { padding: 12px; text-align: center; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; }
.shop-item .si-preview { font-size: 34px; margin-bottom: 6px; }
.shop-item .si-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.shop-item .si-price { font-size: 13px; color: var(--gold); margin-bottom: 8px; }
.shop-item button { padding: 5px 14px; font-size: 12px; border-radius: 5px; cursor: pointer; font-family: inherit;
  color: #05202c; background: var(--neon); border: none; font-weight: 700; }
.shop-item button.owned { background: rgba(255,255,255,.15); color: #cfe6f5; }
.shop-item button.equipped { background: var(--gold); }
.shop-item button:disabled { background: rgba(255,255,255,.08); color: #6b8296; cursor: not-allowed; }
#shopMsg { margin-top: 10px; min-height: 18px; text-align: center; font-size: 13px; color: #8ef0b1; }
#shopMsg.bad { color: #ff8a8a; }

/* ---------- 死亡 ---------- */
#death { background: radial-gradient(ellipse at center, rgba(60,0,0,.35), rgba(10,0,0,.75)); }
.death-card { text-align: center; }
.death-title { font-size: 44px; font-weight: 900; color: #ff5252; letter-spacing: 6px; text-shadow: 0 0 30px rgba(255,40,40,.6); }
#deathBy { margin: 12px 0 6px; font-size: 16px; color: #ffc9c9; }
#deathCount { margin-bottom: 16px; font-size: 15px; color: #9fd8ef; }

/* ---------- 观战 ---------- */
#specBar { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10; text-align: center;
  padding: 10px 26px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; max-width: 92vw; }
#specMode { font-size: 13px; color: var(--neon); font-weight: 700; letter-spacing: 2px; }
#specTarget { font-size: 17px; font-weight: 800; margin: 3px 0; min-height: 22px; }
.spec-keys { font-size: 12px; color: #8fb3cd; }
.spec-keys b { color: var(--gold); cursor: pointer; }
/* 手机观战触屏控件：桌面隐藏（走键位提示），手机显示按钮组 */
.spec-touch { display: none; }
body.mobile .spec-touch { display: flex; gap: 5px; justify-content: center; align-items: center; margin-top: 4px; flex-wrap: wrap; }
body.mobile #specKeys { display: none; }
/* 观战是"看比赛"，控件尽量小、半透明、贴底，别挡视野 */
body.mobile #specBar { padding: 4px 9px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(8,12,22,.42); border-radius: 9px; }
body.mobile #specMode { font-size: 9px; letter-spacing: .5px; }
body.mobile #specTarget { font-size: 11.5px; font-weight: 700; margin: 0; min-height: 14px; }
.spec-btn { min-width: 34px; height: 32px; padding: 0 7px; font-size: 12px; font-weight: 700; font-family: inherit;
  color: #dff6ff; background: rgba(53,224,255,.12); border: 1px solid var(--line); border-radius: 7px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.spec-btn:active { background: rgba(53,224,255,.34); }
.spec-btn.wide { min-width: 50px; }
.spec-btn.active { background: rgba(53,224,255,.3); border-color: var(--neon); color: #fff; }
.spec-btn.join { color: #05202c; background: rgba(255,210,60,.9); border-color: var(--gold); }
.spec-btn:disabled { opacity: .3; }

/* ============================================================
   移动端触控层：摇杆 / 视角拖拽区 / 功能按钮
   所有元素 pointer-events:none，实际触摸判定统一在 JS 里按坐标分发
   （摇杆区 vs 视角拖拽区），按钮各自处理自己的 pointer-events:auto
   ============================================================ */
#touchLayer { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#joyHint, #joyBase, #joyStick { pointer-events: none; }
#joyHint { position: fixed; left: calc(34px + env(safe-area-inset-left, 0px));
  bottom: calc(34px + env(safe-area-inset-bottom, 0px)); width: 112px; height: 112px;
  border-radius: 50%; border: 2px dashed rgba(255,255,255,.14); }
#joyBase { position: fixed; width: 112px; height: 112px; border-radius: 50%;
  background: rgba(255,255,255,.05); border: 2px solid rgba(53,224,255,.45); opacity: 0; }
#joyBase.show { opacity: 1; }
#joyStick { position: absolute; left: 31px; top: 31px; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(53,224,255,.5); box-shadow: 0 0 14px rgba(53,224,255,.55); }

.tbtn { position: fixed; pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(10,14,24,.5); border: 2px solid rgba(53,224,255,.4); color: #dff6ff;
  font-size: 22px; user-select: none; }
.tbtn:active { background: rgba(53,224,255,.3); }
.tbtn.on { background: rgba(255,210,60,.4); border-color: var(--gold); }

/* 纯展示型 HUD 不拦截指针/触摸：移动端手指落在血条/播报/BOSS条上也能正常拖动视角 */
#vitals, #topLeft, #killfeed, #bossBar, #bossTimer, #guardPhase, #guardObjective, #guardTeamProgression, #guardLanePressure, #guardDowned, #protectHint, #statLine, #reloadBar { pointer-events: none; }
.tFire { width: 82px; height: 82px; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  flex-direction: column; gap: 0; font-size: 34px; border-color: rgba(255,90,90,.55); }
.tFire span { line-height: .85; pointer-events: none; }
.tFire small { margin-top: 5px; color: #ffd3d3; font-family: inherit; font-size: 8px; font-weight: 800; line-height: 1; letter-spacing: .4px; pointer-events: none; }
.tFire:active { background: rgba(255,60,60,.32); }
.tFire.aiming { border-color: #ff8b75; background: rgba(255,60,60,.34); box-shadow: 0 0 22px rgba(255,75,55,.38); }
.tJump { width: 60px; height: 60px; right: calc(118px + env(safe-area-inset-right, 0px)); bottom: calc(44px + env(safe-area-inset-bottom, 0px)); }
.tScope { width: 56px; height: 56px; right: calc(34px + env(safe-area-inset-right, 0px)); bottom: calc(122px + env(safe-area-inset-bottom, 0px));
  border-color: rgba(255,210,60,.5); font-size: 24px; }
.tAbility { width: 54px; height: 54px; right: calc(98px + env(safe-area-inset-right, 0px)); bottom: calc(122px + env(safe-area-inset-bottom, 0px));
  border-color: rgba(80,220,240,.6); color: #bdf7ff; font-size: 18px; font-weight: 900; }
.tThrow { width: 56px; height: 56px; right: calc(160px + env(safe-area-inset-right, 0px)); bottom: calc(116px + env(safe-area-inset-bottom, 0px));
  border-color: rgba(255,178,88,.72); color: #ffe0aa; font-size: 22px; }
.tThrow small { position: absolute; right: -2px; bottom: -2px; min-width: 20px; height: 20px; padding: 0 3px;
  color: #15100a; border-radius: 10px; background: #ffbd67; font: 900 10px/20px inherit; }
.tThrow:disabled { opacity: .28; filter: grayscale(1); }
/* 观战自由飞行升降键：右下竖排，小而半透明，不挡视野 */
.tUp   { width: 44px; height: 44px; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); font-size: 19px; opacity: .55; }
.tDown { width: 44px; height: 44px; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(36px + env(safe-area-inset-bottom, 0px)); font-size: 19px; opacity: .55; }
.tUp:active, .tDown:active { opacity: .95; }
.tMenu, .tBoard, .tChat { width: 42px; height: 42px; font-size: 18px; top: calc(8px + env(safe-area-inset-top, 0px)); }
.tMenu { right: calc(12px + env(safe-area-inset-right, 0px)); }
.tBoard { right: calc(60px + env(safe-area-inset-right, 0px)); }
.tChat { right: calc(108px + env(safe-area-inset-right, 0px)); }

/* 触屏下武器栏挪高，避开右下角按钮群；生命条略微收窄 */
body.mobile #weaponPanel { bottom: calc(184px + env(safe-area-inset-bottom, 0px)); pointer-events: auto; }
body.mobile #vitals { width: 210px; }
body.mobile #interactHint { bottom: 34%; }
body.mobile #guardReviveHint { bottom: 34%; }
body.mobile #guardSupplyHint { bottom: calc(190px + env(safe-area-inset-bottom, 0px)); min-width: 190px; padding: 6px 10px; }
body.mobile .wslot { min-width: 150px; min-height: 38px; padding: 6px 9px; font-size: 12px; cursor: pointer; pointer-events: auto;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body.mobile .wslot:active { transform: scale(.97); border-color: var(--gold); }
body.mobile #guardRoleAbility { display: none !important; }
body.guard-decision-open #touchLayer { display: none !important; }

/* 触屏 / 窄屏：菜单与提示收缩，避免溢出小屏 */
@media (pointer: coarse), (max-width: 720px) {
  .title { font-size: 30px; letter-spacing: 5px; }
  .menu-card { padding: 20px 18px; }
  .help-grid { grid-template-columns: 1fr; font-size: 11px; }
  .menu-hist { width: 100%; max-width: 380px; }
  .shop-body { flex-direction: column; align-items: center; }
  #shopStage { flex: none; }
  .panel-card { padding: 16px 14px; }
  #guardOnboarding, #guardMapChoice, #guardTalentChoice, #guardRoleChoice, #guardRequisition { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 16px; overscroll-behavior: contain; }
  .guard-map-grid { grid-template-columns: 1fr; }
  .guard-map-card { min-height: 128px; padding: 14px; }
  #guardCombatGuide { left: auto; right: 10px; top: calc(204px + env(safe-area-inset-top, 0px)); bottom: auto; width: min(280px, calc(100vw - 20px)); }
  .guard-onboarding-pages section { min-height: 220px; padding-top: 14px; }
  .guard-onboarding-pages h2 { font-size: 19px; }
  .guard-onboarding-head, .guard-talent-title, .guard-role-title, .guard-req-title { position: sticky; top: -16px; z-index: 3; padding: 12px 0; background: inherit; }
  .guard-onboarding-actions { position: sticky; bottom: -16px; z-index: 3; margin-bottom: -16px; padding: 10px 0 16px; background: inherit; }
  .guard-decision-done { position: sticky; bottom: 0; z-index: 3; }
  .guard-req-sections { grid-template-columns: 1fr; }
  .req-supplies { grid-column: auto; }
  .talent-grid, .role-grid { grid-template-columns: 1fr; }
  #guardTalentChoice button, #guardRoleChoice button { min-height: 68px; }
  .guard-talent-title, .guard-role-title { font-size: 18px; }
  .feedback-card { width: calc(100vw - 16px); padding: 18px 15px; }
  .feedback-grid { grid-template-columns: 1fr; }
  .feedback-grid label.wide { grid-column: auto; }
}
@media (orientation: portrait) {
  body.mobile #landscapePrompt { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
    padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    background: rgba(2,7,12,.94); backdrop-filter: blur(7px); }
  .landscape-prompt-card { width: min(340px, 88vw); padding: 28px 24px; text-align: center; color: #eafaff;
    border: 1px solid rgba(80,215,255,.58); border-radius: 18px; background: rgba(8,25,38,.98); box-shadow: 0 20px 70px rgba(0,0,0,.65); }
  .landscape-prompt-card strong, .landscape-prompt-card span { display: block; }
  .landscape-prompt-card strong { margin: 10px 0 8px; color: #ffe39a; font-size: 24px; }
  .landscape-prompt-card span { color: #b9d0da; font-size: 13px; line-height: 1.65; }
  .landscape-phone { display: inline-block; font-size: 46px; animation: landscapeRotate 1.8s ease-in-out infinite; }
  @keyframes landscapeRotate { 0%, 30% { transform: rotate(0); } 65%, 100% { transform: rotate(90deg); } }
}
@media (pointer: coarse) and (max-height: 520px) and (orientation: landscape) {
  #guardOnboarding, #guardMapChoice, #guardTalentChoice, #guardRoleChoice, #guardRequisition { width: calc(100vw - 16px); max-width: 760px; padding: 12px 14px; }
  .guard-map-grid { grid-template-columns: repeat(2, 1fr); }
  .guard-map-card { min-height: 116px; padding: 11px 13px; }
  .guard-map-card strong { margin-bottom: 4px; font-size: 17px; }
  .guard-map-card span { min-height: 0; font-size: 10px; }
  .guard-map-card em { margin-top: 5px; }
  .guard-onboarding-pages section { min-height: 150px; padding: 8px 4px 4px; }
  .guard-onboarding-icon { font-size: 30px; }
  .guard-onboarding-pages h2 { margin: 4px 0; font-size: 17px; }
  .guard-onboarding-callout { margin-top: 7px; padding: 6px 8px; }
  .role-grid, .talent-grid { grid-template-columns: repeat(2, 1fr); }
  #guardRoleChoice button, #guardTalentChoice button { min-height: 54px; padding: 7px; }
  #guardCombatGuide { top: calc(168px + env(safe-area-inset-top, 0px)); width: 260px; }
  #guardGuideDetail { display: none; }
  body.mobile #weaponPanel { bottom: calc(126px + env(safe-area-inset-bottom, 0px)); }
  body.mobile #guardSupplyHint { bottom: calc(126px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
  #vitals, #weaponPanel { width: auto; min-width: 0; }
  .wslot { min-width: 120px; }
  #bossBar { width: 260px; }
}

/* 移动端战斗 HUD：避免微信等高 DPR 内置浏览器放大字幕后遮住主要视野。 */
body.mobile #topLeft { left: calc(9px + env(safe-area-inset-left, 0px)); top: calc(7px + env(safe-area-inset-top, 0px)); }
body.mobile #coinBox { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
body.mobile #dayChip { padding: 4px 7px; font-size: 9px; border-radius: 6px; }
body.mobile #buffRow { position: fixed; left: calc(9px + env(safe-area-inset-left, 0px)); top: calc(82px + env(safe-area-inset-top, 0px)); gap: 3px; margin-top: 0; max-width: 180px; }
body.mobile .buff-chip { gap: 3px; padding: 3px 6px; font-size: 8px; }

body.mobile #guardPhase { top: calc(4px + env(safe-area-inset-top, 0px)); gap: 5px; padding: 4px 8px; border-radius: 12px; }
body.mobile #guardPhaseName { font-size: 8px; letter-spacing: .3px; }
body.mobile #guardWaveProgress { max-width: 220px; padding-left: 5px; overflow: hidden; font-size: 7px; text-overflow: ellipsis; }
body.mobile #guardPhaseTime { min-width: 18px; font-size: 8px; }
body.mobile #guardObjective { top: calc(29px + env(safe-area-inset-top, 0px)); width: 190px; }
body.mobile .guard-objective-title { margin-bottom: 1px; font-size: 8px; letter-spacing: .3px; }
body.mobile .guard-objective-title span { margin-left: 2px; font-size: 6px; }
body.mobile .guard-objective-bar { height: 8px; }
body.mobile #guardObjectiveHp { font-size: 7px; }
body.mobile #guardTeamProgression { top: calc(50px + env(safe-area-inset-top, 0px)); width: 155px; }
body.mobile .guard-team-level { gap: 3px; margin-bottom: 1px; font-size: 7px; }
body.mobile .guard-team-level strong { font-size: 10px; }
body.mobile .guard-team-level span { font-size: 6px; }
body.mobile .guard-team-xp-bar { height: 3px; }
body.mobile #guardRunResource { margin-top: 1px; font-size: 7px; }
body.mobile #guardRunResource strong { font-size: 8px; }
body.mobile #guardLanePressure { top: calc(82px + env(safe-area-inset-top, 0px)); gap: 2px; font-size: 6px; }
body.mobile .guard-lane-chip { min-width: 48px; padding: 2px 4px; border-radius: 6px; }
body.mobile .guard-lane-chip em { margin-left: 2px; font-size: 5px; }

body.mobile #guardCombatGuide { left: 50%; right: auto; top: calc(102px + env(safe-area-inset-top, 0px)); width: auto; max-width: 240px;
  padding: 4px 9px; transform: translateX(-50%); border-left-width: 3px; border-radius: 12px; white-space: nowrap; }
body.mobile .guard-guide-head, body.mobile #guardGuideDetail { display: none; }
body.mobile #guardGuideTitle { overflow: hidden; font-size: 8px; line-height: 1.25; text-overflow: ellipsis; }
body.mobile #guardCombatGuide.urgent { animation: none; }

body.mobile #weaponPanel { left: 50%; right: auto; bottom: calc(7px + env(safe-area-inset-bottom, 0px)); display: grid;
  grid-template-columns: 50px 132px 50px; gap: 3px; align-items: center; transform: translateX(-50%); }
body.mobile .wslot { min-width: 0; width: 50px; max-width: none; min-height: 30px; justify-content: center; gap: 4px; padding: 4px 5px; font-size: 8px; border-radius: 6px; }
body.mobile .wslot.active { width: 132px; justify-content: flex-start; }
body.mobile .wkey { padding: 1px 4px; font-size: 8px; }
body.mobile .wico { font-size: 13px; }
body.mobile .wname { display: none; }
body.mobile .wammo { margin-left: auto; font-size: 9px; white-space: nowrap; }
body.mobile #reloadBar { grid-column: 1 / -1; width: 170px; height: 9px; justify-self: center; }
body.mobile #reloadText { font-size: 8px; }

body.mobile #vitals { left: calc(9px + env(safe-area-inset-left, 0px)); top: calc(40px + env(safe-area-inset-top, 0px)); bottom: auto; width: 130px; }
body.mobile .bar-row { gap: 5px; margin-top: 3px; }
body.mobile .bar-ico { width: 14px; font-size: 11px; }
body.mobile .bar { height: 12px; }
body.mobile .bar span { font-size: 8px; }

body.mobile #chatBox { left: calc(9px + env(safe-area-inset-left, 0px)); bottom: calc(67px + env(safe-area-inset-bottom, 0px)); width: 240px; max-width: 32vw; }
body.mobile #chatMsgs { gap: 2px; max-height: 96px; }
body.mobile .cmsg { padding: 2px 6px; font-size: 9px; line-height: 1.3; background: rgba(6,10,18,.48); }
body.mobile:not(.chat-focus) #chatMsgs { display: none; }
body.mobile #killfeed, body.mobile #guardTalentStatus { display: none !important; }

body.mobile #notice { top: 61%; gap: 2px; }
body.mobile .notice-item { max-width: 58vw; padding: 4px 10px; text-align: center; font-size: 10px; border-radius: 12px; }
body.mobile #bigNotice { top: 24%; font-size: 20px; letter-spacing: 1px; }
body.mobile #guardDowned { min-width: 220px; padding: 12px 16px; border-radius: 10px; }
body.mobile .guard-downed-title { font-size: 20px; letter-spacing: 2px; }
body.mobile #guardDownedTime { margin-top: 5px; font-size: 13px; }
body.mobile .guard-downed-hint { margin-top: 4px; font-size: 9px; }

@media (orientation: landscape) and (max-height: 600px) {
  body.mobile #guardCombatGuide { top: calc(102px + env(safe-area-inset-top, 0px)); }
  body.mobile #weaponPanel { bottom: calc(7px + env(safe-area-inset-bottom, 0px)); }
  body.mobile #bossBar, body.mobile #bossBar.guard-midboss { top: calc(126px + env(safe-area-inset-top, 0px)); width: 220px; }
  body.mobile .boss-name { margin-bottom: 2px; font-size: 9px; }
  body.mobile .boss-hp { height: 8px; }
}
