/* 零区冲突 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; }
#cv { position: fixed; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }

/* ---------- 通用覆盖层 ---------- */
.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: 14px; align-items: stretch; flex-wrap: nowrap; justify-content: center;
  width: min(100%, 760px); max-height: 96vh; max-width: 96vw; overflow: hidden; padding: 8px;
}
.menu-hist { width: 300px; flex: 1 1 0; min-width: 0; padding: 18px 16px; text-align: left;
  display: flex; flex-direction: column; max-height: min(92vh, 680px); }
.mh-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; color: var(--gold); letter-spacing: 2px; flex-shrink: 0; }
.menu-hist .board-table {
  flex: 1; font-size: 12px; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; justify-content: flex-start;
  scrollbar-width: none; -ms-overflow-style: none;
}
.menu-hist .board-table::-webkit-scrollbar { display: none; width: 0; height: 0; }
.menu-hist .board-table .brow.head {
  flex: 0 0 auto; position: sticky; top: 0; z-index: 1;
  background: rgba(10, 14, 24, .96);
}
.menu-hist .brow {
  flex: 0 0 auto; min-height: 28px;
  grid-template-columns: 24px 1fr 40px 40px 40px 42px;
  padding: 0 4px; font-size: 11px;
}
.menu-hist .panel-hint { flex-shrink: 0; margin-top: 6px; }
.menu-card { width: 340px; flex: 1 1 0; min-width: 0; max-width: none; padding: 20px 22px; 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);
  max-height: min(92vh, 680px); overflow: hidden; display: flex; flex-direction: column; }
.menu-logo {
  width: 64px; height: 64px; margin: 0 auto 6px; display: block; flex-shrink: 0;
  border-radius: 14px; object-fit: cover;
  box-shadow: 0 0 24px rgba(53,224,255,.28), 0 0 36px rgba(255,77,157,.16);
}
.small-card { width: 300px; flex: none; max-height: none; overflow: auto; display: block; }
.title { font-size: 32px; letter-spacing: 6px; font-weight: 800; flex-shrink: 0;
  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: 2px 0 2px; font-size: 11px; letter-spacing: 3px; color: #7fa8c9; flex-shrink: 0; }
.menu-profile { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 2px;
  font-size: 13px; color: var(--gold); flex-shrink: 0; }
.menu-profile b { color: #ffe9a0; }
.login-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(255,77,157,.2); color: #ff8ec4; border: 1px solid rgba(255,77,157,.45); }
.menu-actions { display: flex; gap: 6px; justify-content: center; margin: 4px 0 6px; flex-wrap: nowrap; flex-shrink: 0; }
.menu-actions .btn { flex: 1; min-width: 0; padding: 6px 6px; font-size: 12px; margin-bottom: 0; }
.online-line { margin: 4px 0 8px; font-size: 12px; color: #9fd8ef; flex-shrink: 0; }
#menuBossHint { color: var(--gold); }
#nameInput { width: 100%; padding: 9px 12px; margin-bottom: 4px; font-size: 15px; text-align: center;
  color: #fff; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 8px; outline: none; flex-shrink: 0; }
#nameInput:focus { border-color: var(--neon); box-shadow: 0 0 12px rgba(53,224,255,.25); }
.pass-hint { margin: 0 0 6px; font-size: 11px; line-height: 1.35; color: #8fa8bd; min-height: 0; flex-shrink: 0; text-align: center; }
.pass-hint.warn { color: #f0b86c; }
.pass-hint.ok { color: #7dcea0; }
.oauth-bar { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0 0 6px; flex-shrink: 0; }
.oauth-bar .oauth-btn { width: 100%; margin-bottom: 0; }
.oauth-session {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px 7px 12px;
  background: rgba(125, 206, 160, 0.08);
  border: 1px solid rgba(125, 206, 160, 0.28);
  border-radius: 8px;
}
.oauth-status {
  flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; color: #9fe7c2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.oauth-logout {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  margin: 0; padding: 5px 12px; font-size: 12px; font-weight: 700; font-family: inherit;
  line-height: 1; white-space: nowrap; cursor: pointer;
  color: #cfe6f5; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.16); border-radius: 6px;
  transition: background .15s, border-color .15s;
}
.oauth-logout:hover { background: rgba(255,120,120,.12); border-color: rgba(255,140,140,.4); color: #ffb4b4; }
.pass-field { width: 100%; padding: 10px 14px; margin-bottom: 8px; font-size: 15px; text-align: center;
  color: #fff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; outline: none; }
.pass-field:focus { border-color: var(--neon); box-shadow: 0 0 12px rgba(53,224,255,.2); }
.pass-card .pass-field { margin-bottom: 8px; }
.btn { display: block; width: 100%; padding: 10px; margin-bottom: 6px; font-size: 15px; 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; flex-shrink: 0; }
.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; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.14); font-size: 13px; padding: 7px; margin-bottom: 4px; }
.btn.ghost:hover { background: rgba(255,255,255,.06); box-shadow: none; }
.help { margin-top: 8px; padding: 8px 10px; text-align: left; background: rgba(255,255,255,.03); border-radius: 8px;
  flex: 1; min-height: 0; overflow: hidden; }
.help-title { font-size: 11px; color: var(--neon); margin-bottom: 4px; letter-spacing: 2px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; font-size: 11px; color: #a8c4dc; }
.menu-tip { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.06); font-size: 10px; color: #f0b86c; line-height: 1.4; }
.menu-err { margin-top: 4px; min-height: 16px; color: #ff7b7b; font-size: 12px; flex-shrink: 0; }
.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, #optGyroSens { width: 120px; accent-color: var(--neon); touch-action: pan-x; }

/* ---------- 准星 / 命中 ---------- */
#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.show { animation: hitpop .22s ease-out; }
#hitmarker.crit.show { animation: hitpopCrit .3s 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); } }
#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; }
#cookRing { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; z-index: 10; pointer-events: none; }
#cookRing svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cook-ring-bg { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 4; }
.cook-ring-fg { fill: none; stroke: #ff9c3c; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 175.93; stroke-dashoffset: 0; filter: drop-shadow(0 0 4px rgba(255,140,60,.55)); }
#cookRing.urgent .cook-ring-fg { stroke: #ff3d2e; filter: drop-shadow(0 0 8px rgba(255,60,40,.85)); animation: cookPulse .45s ease-in-out infinite alternate; }
#cookRingText { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 4px #000; }
@keyframes cookPulse { from { filter: drop-shadow(0 0 6px rgba(255,60,40,.7)); } to { filter: drop-shadow(0 0 12px rgba(255,100,40,1)); } }

/* ---------- 左上：金币 & 昼夜 & 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; }
#onlineChip { padding: 6px 12px; font-size: 13px; font-weight: 700; color: #9fe8c8;
  background: var(--bg); border: 1px solid rgba(120,220,170,.35); 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; }
.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; }
#bossBar.amiya .boss-name { color: #ffb0cc; text-shadow: 0 0 10px rgba(255,140,180,.55); }
#bossBar.amiya .boss-hp { border-color: rgba(255,140,180,.45); }
#bossBar.amiya #bossFill { background: linear-gradient(90deg, #c43a6a, #ff8fb8); box-shadow: 0 0 12px rgba(255,120,170,.65); }
#bossWound { margin-top: 5px; }
.boss-wound-label { font-size: 11px; font-weight: 700; color: #d4b0ff; text-shadow: 0 0 8px rgba(160,100,255,.5); margin-bottom: 3px; }
.boss-wound-label #bossWoundNum { color: #f0e6ff; }
.boss-wound-hp { height: 9px; background: rgba(0,0,0,.55); border: 1px solid rgba(160,100,255,.45); border-radius: 6px; overflow: hidden; }
#bossWoundFill { height: 100%; width: 0%; background: linear-gradient(90deg, #6b2dff, #c49bff); box-shadow: 0 0 10px rgba(150,90,255,.7); transition: width .25s ease-out; }
#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; }

/* ---------- 中央提示 ---------- */
#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; }
#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; }
#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.kill { color: #ffc9a8; font-weight: 700; font-style: normal; }
.cmsg.sys.shop { color: #d0a9ff; }
.cmsg.sys.priv { color: #7ec8a0; font-style: italic; opacity: 0.92; }
#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; }

/* ---------- 关于作者 ---------- */
.about-card { width: 480px; }
.about-head { text-align: center; margin-bottom: 14px; }
.about-avatar { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.about-name { font-size: 24px; font-weight: 900; color: var(--neon); letter-spacing: 2px; }
.about-tag { margin-top: 6px; font-size: 12px; color: #7fa8c9; }
.about-contact { margin-bottom: 14px; padding: 10px 14px; text-align: center; font-size: 13px; color: #9fc3dd;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; }
.about-contact a { color: var(--gold); text-decoration: none; font-weight: 700; }
.about-contact a:hover { text-decoration: underline; }
.about-murmur { text-align: left; font-size: 14px; line-height: 1.85; color: #b8d4ea; max-height: 42vh; overflow-y: auto;
  padding-right: 4px; }
.about-murmur p { margin: 0 0 12px; }
.about-murmur p:last-of-type { margin-bottom: 0; }
.about-sign { margin-top: 16px; text-align: right; font-size: 13px; font-style: italic; color: #7fa8c9; }
.about-actions { margin: 14px 0 4px; display: flex; justify-content: center; }

/* ---------- 枪械模型展 ---------- */
.arsenal-card { width: min(820px, 96vw); }
.arsenal-body { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#arsenalCv {
  width: min(720px, 90vw); height: auto; aspect-ratio: 720 / 420;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(53,224,255,.12), transparent 55%),
    linear-gradient(160deg, #0a1220, #121a2c 60%, #0c1018);
  border: 1px solid var(--line); display: block;
}
.arsenal-names {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  max-width: 720px; width: 100%;
}
.arsenal-chip {
  appearance: none; border: 1px solid var(--line); background: rgba(0,0,0,.35);
  color: #b8d4ea; border-radius: 999px; padding: 5px 10px; font-size: 12px;
  cursor: pointer; font-family: inherit; transition: .15s ease;
}
.arsenal-chip:hover { border-color: var(--neon); color: #fff; }
.arsenal-chip.active {
  background: rgba(53,224,255,.18); border-color: var(--neon); color: #fff;
  box-shadow: 0 0 12px rgba(53,224,255,.25);
}

.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; }

/* ---------- 商店 ---------- */
.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: 4px; }
.shop-item .si-hint { font-size: 11px; color: #9fd8ef; margin-bottom: 8px; opacity: .9; }
.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; }

/* ---------- 七日登录 / 换装 ---------- */
.login-card { width: 560px; }
.login-hint { font-size: 13px; color: #8fb8d8; margin: 4px 0 12px; text-align: center; }
.login-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 14px; }
.login-day { padding: 10px 4px; text-align: center; border-radius: 10px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12); font-size: 11px; }
.login-day .ld-day { font-weight: 800; color: #9fc3dd; margin-bottom: 4px; }
.login-day .ld-ico { font-size: 22px; margin: 4px 0; }
.login-day .ld-coin { color: var(--gold); font-weight: 700; }
.login-day .ld-name { color: #cfe6f5; margin-top: 2px; line-height: 1.2; min-height: 28px; }
.login-day.done { opacity: .55; border-color: rgba(142,240,177,.35); }
.login-day.current { border-color: var(--neon); box-shadow: 0 0 14px rgba(53,224,255,.25); }
.login-day.locked { opacity: .4; }
.login-msg { margin-top: 10px; min-height: 18px; text-align: center; font-size: 13px; color: #8ef0b1; }
.login-msg.bad { color: #ff8a8a; }
.wardrobe-card { width: 720px; }
#wardStage { flex: 0 0 220px; text-align: center; }
#wardCv { width: 220px; height: 300px; border-radius: 10px; background:
  radial-gradient(ellipse at 50% 80%, rgba(255,77,157,.1), rgba(8,12,24,.6)); border: 1px solid var(--line); }
#wardGrid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start; }
.ward-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.ward-pager .btn.small { min-width: 88px; padding: 6px 12px; font-size: 13px; }
#wardPageInfo { font-size: 13px; color: #9fc3dd; font-weight: 700; min-width: 52px; text-align: center; }

/* ---------- 死亡 ---------- */
#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; }
#deathKeep { margin: 4px 0 8px; font-size: 14px; color: #ffd27a; text-shadow: 0 0 12px rgba(255,180,60,.35); }
#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, #protectHint, #statLine, #reloadBar, #cookRing { 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));
  font-size: 34px; border-color: rgba(255,90,90,.55); }
.tFire:active { background: rgba(255,60,60,.32); }
.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; }
.tReload { width: 56px; height: 56px; right: calc(118px + env(safe-area-inset-right, 0px)); bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  border-color: rgba(120,200,255,.55); font-size: 20px; font-weight: 700; letter-spacing: 0; }
.tReload:active { background: rgba(80,180,255,.32); }
.tInspect { width: 52px; height: 52px; right: calc(178px + env(safe-area-inset-right, 0px)); bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  border-color: rgba(180,140,255,.55); font-size: 18px; font-weight: 700; letter-spacing: 0; }
.tInspect:active { background: rgba(150,110,255,.32); }
.tInspect.on { background: rgba(180,140,255,.35); border-color: #c9a0ff; }
/* 观战自由飞行升降键：右下竖排，小而半透明，不挡视野 */
.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)); }
body.mobile .tMenu, body.mobile .tBoard, body.mobile .tChat { top: calc(2px + 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: auto;
  top: calc(52px + env(safe-area-inset-top, 0px));
  right: calc(4px + env(safe-area-inset-right, 0px));
  gap: 3px;
  z-index: 25;
  pointer-events: auto;
}
body.mobile #vitals {
  top: calc(2px + env(safe-area-inset-top, 0px));
  bottom: auto !important;
  left: calc(8px + env(safe-area-inset-left, 0px));
  width: min(200px, 42vw);
  z-index: 12;
}
body.mobile #vitals .bar-row { margin-top: 3px; gap: 5px; }
body.mobile #vitals .bar-row:first-child { margin-top: 0; }
body.mobile #vitals .bar { height: 15px; }
body.mobile #vitals .bar-ico { font-size: 13px; width: 17px; }
body.mobile #vitals .bar span { font-size: 10px; }
body.mobile #topLeft { top: calc(64px + env(safe-area-inset-top, 0px)); }
body.mobile #killfeed { top: calc(124px + env(safe-area-inset-top, 0px)); }
body.mobile #bossBar { top: calc(2px + env(safe-area-inset-top, 0px)); width: min(320px, 52vw); }
body.mobile #bossTimer { top: calc(2px + env(safe-area-inset-top, 0px)); }
body.mobile #chatBox {
  left: calc(8px + env(safe-area-inset-left, 0px));
  right: auto;
  top: auto;
  bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  transform: none;
  width: min(50vw, 260px);
  max-width: 50vw;
}
body.mobile #chatMsgs { max-height: 72px; align-items: flex-start; }
body.mobile #chatMsgs .cmsg { text-align: left; font-size: 12px; opacity: 0.88; }
body.mobile.chat-focus #chatBox {
  left: 50%;
  right: auto;
  bottom: 44vh;
  transform: translateX(-50%);
}
body.mobile #joyHint {
  left: calc(24px + env(safe-area-inset-left, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 104px; height: 104px;
}
body.mobile #joyBase { width: 104px; height: 104px; }
body.mobile #joyStick { left: 28px; top: 28px; width: 48px; height: 48px; }
body.mobile #interactHint { bottom: 34%; }
body.mobile .wslot { min-width: 138px; max-width: none; padding: 3px 6px; font-size: 10px; gap: 4px; border-radius: 6px;
  pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
body.mobile .wkey { font-size: 9px; padding: 0 3px; }
body.mobile .wico { font-size: 12px; }
body.mobile .wname { font-size: 10px; }
body.mobile .wammo { font-size: 9px; white-space: nowrap; }
body.mobile #reloadBar { width: 138px; height: 12px; }
body.mobile #cookRing { width: 64px; height: 64px; }
body.mobile #cookRingText { font-size: 11px; }
body.mobile #statLine {
  right: calc(10px + env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

/* 触屏 / 窄屏：保持两列，压缩内容以去掉滚动条 */
@media (pointer: coarse), (max-width: 820px), (max-height: 560px) {
  .menu-wrap {
    gap: 6px; width: 100%; max-width: 100vw; max-height: 100%;
    padding: max(4px, env(safe-area-inset-top, 0px)) max(4px, env(safe-area-inset-right, 0px))
      max(4px, env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
  }
  .menu-card, .menu-hist {
    width: auto; padding: 8px 8px; max-height: 100%;
    border-radius: 10px;
  }
  .menu-logo { width: 36px; height: 36px; margin-bottom: 2px; border-radius: 9px; }
  .title { font-size: 18px; letter-spacing: 2px; }
  .subtitle { display: none; }
  .online-line { margin: 1px 0 3px; font-size: 10px; }
  .pass-hint { display: none; }
  .oauth-bar { margin: 0 0 4px; gap: 4px; }
  .oauth-session { padding: 5px 8px; gap: 8px; }
  .oauth-status { font-size: 11px; }
  .oauth-logout { padding: 4px 10px; font-size: 11px; }
  .menu-profile { margin: 1px 0; font-size: 11px; }
  .menu-actions { margin: 2px 0 3px; gap: 3px; }
  .menu-actions .btn { padding: 5px 2px; font-size: 10px; white-space: nowrap; }
  .menu-card > .btn { padding: 6px; margin-bottom: 3px; font-size: 12px; }
  #btnAbout { display: block; padding: 5px; margin-bottom: 0; font-size: 11px; }
  .help { display: none !important; }
  .menu-tip { display: none; }
  .mh-title { font-size: 12px; margin-bottom: 3px; letter-spacing: 1px; }
  .menu-hist .panel-hint { display: none; }
  .menu-hist .brow {
    grid-template-columns: 16px minmax(0, 1fr) 28px 32px;
    padding: 0 1px; font-size: 10px;
  }
  .menu-hist .brow .num { overflow: hidden; text-overflow: ellipsis; }
  /* 移动端隐藏：死亡、BOSS，保留 击杀 / 连杀 */
  .menu-hist .brow > :nth-child(4),
  .menu-hist .brow > :nth-child(5) { display: none; }
  #nameInput { padding: 6px 6px; margin-bottom: 2px; font-size: 13px; }
  .menu-err { min-height: 12px; font-size: 10px; margin-top: 1px; }
  .shop-body { flex-direction: column; align-items: center; }
  #shopStage, #wardStage { flex: none; }
  #wardGrid, #shopGrid { grid-template-columns: repeat(2, 1fr); }
  .login-days { grid-template-columns: repeat(4, 1fr); }
  .panel-card { padding: 16px 14px; }
  .arsenal-card { width: 96vw; }
  #arsenalCv { width: 100%; }
  .about-murmur { max-height: 32vh; }
}
/* 超矮横屏：再压一档，保证「关于作者」仍可见 */
@media (pointer: coarse) and (max-height: 400px), (max-width: 820px) and (max-height: 400px) {
  .menu-logo { width: 28px; height: 28px; margin-bottom: 0; }
  .title { font-size: 15px; letter-spacing: 1px; }
  .menu-card > .btn { padding: 4px; margin-bottom: 2px; font-size: 11px; }
  #btnAbout { padding: 4px; font-size: 10px; }
  .menu-actions .btn { padding: 3px 1px; font-size: 9px; }
  .mh-title { font-size: 11px; margin-bottom: 2px; }
  .menu-hist .brow { font-size: 9px; }
}
@media (max-width: 480px) {
  body:not(.mobile) #vitals, body:not(.mobile) #weaponPanel { width: auto; min-width: 0; }
  .wslot { min-width: 120px; }
  #bossBar { width: 260px; }
}

/* 移动端竖屏提示（iOS 等无法程序锁屏时的兜底） */
#rotateHint { z-index: 200; background: rgba(4, 6, 12, .96); backdrop-filter: blur(6px); pointer-events: auto; }
.rotate-card { text-align: center; padding: 28px 32px; }
.rotate-icon { font-size: 52px; margin-bottom: 16px; animation: rotate-phone 2.2s ease-in-out infinite; }
.rotate-title { font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--neon); margin-bottom: 8px; }
.rotate-sub { font-size: 13px; color: #8fb8d8; letter-spacing: 1px; margin-bottom: 10px; }
.rotate-tip { font-size: 12px; line-height: 1.55; color: #ffb45c; max-width: 300px; margin: 0 auto 16px; padding: 8px 12px;
  background: rgba(255, 180, 92, .08); border: 1px solid rgba(255, 180, 92, .25); border-radius: 8px; }
.rotate-btn { margin-top: 4px; min-width: 200px; }
.rotate-status { margin-top: 12px; font-size: 12px; color: #7fa8c9; min-height: 18px; }
body.mobile #rowLandscape { display: flex; }
#rowLandscape { display: none; }
body.mobile #rowTouchLayout { display: flex; }
#rowTouchLayout { display: none; }

/* 触屏自定义按键布局：JS 写入 left/top 后覆盖 CSS 默认锚点 */
body.touch-layout-active .tbtn,
body.touch-layout-active #joyHint {
  right: auto !important;
  bottom: auto !important;
}

/* 按键布局编辑模式 */
#touchEditBar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 120;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
  background: linear-gradient(180deg, rgba(4, 8, 16, .94) 0%, rgba(4, 8, 16, .55) 100%);
  border-bottom: 1px solid rgba(53, 224, 255, .25);
  pointer-events: auto;
}
.touch-edit-tip { font-size: 12px; color: #9ec8e8; text-align: center; line-height: 1.45; }
.touch-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
body.touch-edit #touchLayer { pointer-events: auto; }
body.touch-edit #joyHint {
  pointer-events: auto; opacity: 1 !important;
  border-color: rgba(53, 224, 255, .65);
  box-shadow: 0 0 0 2px rgba(255, 210, 60, .35);
}
body.touch-edit .tbtn {
  box-shadow: 0 0 0 2px rgba(255, 210, 60, .45);
  z-index: 130;
}
body.touch-edit .tbtn::after,
body.touch-edit #joyHint::after {
  content: attr(data-touch-label);
  position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; color: #ffe08a; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
  pointer-events: none;
}
body.touch-edit #joyHint::after { bottom: -20px; }

@keyframes rotate-phone {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-90deg); }
  65% { transform: rotate(-90deg); }
}
