/* =========================================================
   仙侠搜打撤 · 横屏手机网页
   主色 #FF8A3D，辅色墨紫 / 灵玉 / 金
   ========================================================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* icons.css 把图标固定为 24px，这里改为跟随字号，页面内只写 font-size 即可 */
.mp-icon { width: 1em; height: 1em; }
:root {
  --orange: #FF8A3D;
  --orange-deep: #E2662A;
  --gold: #FFD08A;
  --gold-soft: #FFE7B8;
  --jade: #6BE3B0;
  --red: #FF6B6B;
  --ink: #0B0712;
  --ink-2: #140C1D;
  --ink-3: #1E1229;
  --paper: #FFF3DF;
  --muted: rgba(255, 226, 196, 0.62);
  --line: rgba(255, 196, 130, 0.22);
  --glass: rgba(20, 12, 27, 0.72);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--paper);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
.hidden { display: none !important; }

#stage { position: fixed; inset: 0; overflow: hidden; background: #0B0712; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 画面氛围：暗角 + 顶部灵光 */
#stage::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    radial-gradient(120% 90% at 48% 36%, rgba(255, 138, 61, 0.06), transparent 54%),
    radial-gradient(90% 80% at 50% 52%, transparent 46%, rgba(5, 3, 8, 0.58) 100%);
  mix-blend-mode: normal;
}

/* =========================================================
   HUD
   ========================================================= */
#hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  display: flex; align-items: flex-start; justify-content: space-between;
  pointer-events: none;
  transition: opacity .25s ease;
}
.is-home #hud, .is-result #hud { opacity: 0; pointer-events: none; }

.hud-left, .hud-right { display: flex; align-items: flex-start; gap: 8px; }
.hud-right { align-items: center; }

.player-plate {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px 7px 7px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28, 17, 38, 0.86), rgba(14, 8, 20, 0.78));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 226, 182, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.player-meta { min-width: 98px; }
.player-line { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.player-line b { font-size: 13px; letter-spacing: .02em; color: #FFF0DA; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.realm {
  font-size: 9px; color: var(--gold); opacity: .9;
  border: 1px solid rgba(255, 196, 130, 0.28);
  border-radius: 999px; padding: 2px 5px; line-height: 1;
  white-space: nowrap;
}
.hp-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.hp-bar {
  position: relative; width: 92px; height: 8px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
#hpFill {
  height: 100%; width: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #FF5F62 0%, #FF8A3D 62%, #FFC46B 100%);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.55);
  transition: width .2s ease-out;
}
#hpText { font-size: 10px; font-weight: 800; color: #FFD9C2; min-width: 20px; }

/* 头像 */
.avatar {
  position: relative; flex: 0 0 auto; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #FFE4B6, #FF9A4D 46%, #C9551F 100%);
  border: 1.5px solid rgba(255, 226, 182, 0.55);
  box-shadow: 0 3px 12px rgba(255, 122, 46, 0.34), inset 0 0 12px rgba(120, 40, 0, 0.3);
  color: #4A1E06; font-family: "STKaiti", "KaiTi", "Songti SC", serif; font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar span { font-size: 16px; line-height: 1; }
.avatar-sm { width: 34px; height: 34px; }
.avatar-sm span { font-size: 15px; }
.avatar-lg { width: 54px; height: 54px; }
.avatar-lg span { font-size: 23px; }

/* 任务条 */
.mission-plate {
  position: absolute; left: 50%; top: calc(10px + var(--safe-t));
  transform: translateX(-50%);
  width: min(320px, 34vw);
  padding: 7px 10px 9px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(30, 18, 41, 0.88), rgba(14, 8, 20, 0.8));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 226, 182, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}
.mission-main, .mission-side { display: flex; align-items: center; gap: 6px; }
.mission-main { min-width: 0; }
.mission-main .mp-icon { font-size: 14px; color: var(--gold); flex: 0 0 auto; }
.mission-main span {
  font-size: 11px; font-weight: 600; color: #FFE8C8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mission-side {
  position: absolute; right: 10px; top: 7px;
}
.mission-side .mp-icon { font-size: 12px; color: #FFE0A3; opacity: .8; }
.mission-side span { font-size: 13px; font-weight: 800; color: #FFE0A3; font-variant-numeric: tabular-nums; }
.mission-main { padding-right: 46px; }
.mission-track {
  margin-top: 6px; height: 4px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.1); overflow: hidden;
}
#missionFill {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  box-shadow: 0 0 8px rgba(255, 196, 107, 0.5);
  transition: width .22s ease-out, background .2s ease;
}
.mission-plate.ready #missionFill { background: linear-gradient(90deg, #4ED6A6, #B8FFDF); box-shadow: 0 0 10px rgba(107, 227, 176, 0.6); }
.mission-plate.ready .mission-main .mp-icon { color: var(--jade); }
.mission-plate.danger .mission-side span { color: #FF8B8B; animation: pulse 1s infinite; }

/* 背包 */
.bag-plate {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(28, 17, 38, 0.86), rgba(14, 8, 20, 0.78));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 226, 182, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bag-plate > .mp-icon { font-size: 20px; color: var(--gold); }
.bag-meta { display: flex; flex-direction: column; gap: 4px; }
.bag-line { display: flex; align-items: baseline; gap: 3px; line-height: 1; }
.bag-line b { font-size: 15px; color: var(--gold); font-weight: 800; }
.bag-line span { font-size: 9px; color: rgba(255, 214, 170, 0.55); }
.bag-pips { display: flex; gap: 2px; }
.bag-pips i {
  width: 6px; height: 6px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  transition: background .2s ease, box-shadow .2s ease;
}
.bag-pips i.on { background: linear-gradient(180deg, #FFE0A3, #FF9A4D); box-shadow: 0 0 5px rgba(255, 154, 77, 0.6); }

.icon-btn {
  pointer-events: auto;
  width: 38px; height: 38px; border-radius: 13px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 17, 38, 0.86), rgba(14, 8, 20, 0.78));
  color: #FFD9A8;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 226, 182, 0.1);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .12s ease, background .12s ease;
}
.icon-btn:active { transform: scale(.92); background: rgba(255, 138, 61, 0.3); }

/* =========================================================
   摇杆 / 技能
   ========================================================= */
#joyZone {
  position: absolute; left: 0; bottom: 0; width: 48%; height: 70%;
  z-index: 5; touch-action: none;
  transition: opacity .25s ease;
}
#joyBase {
  position: absolute; width: 122px; height: 122px; border-radius: 50%;
  left: calc(26px + var(--safe-l)); bottom: calc(24px + var(--safe-b));
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 180, 110, 0.18), rgba(24, 13, 32, 0.55) 64%, rgba(14, 8, 20, 0.34));
  border: 1.5px solid rgba(255, 196, 130, 0.3);
  box-shadow: inset 0 0 24px rgba(255, 150, 80, 0.14), 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  opacity: .92;
}
#joyRing {
  position: absolute; inset: 14px; border-radius: 50%;
  border: 1px dashed rgba(255, 196, 130, 0.16);
}
#joyKnob {
  position: absolute; width: 54px; height: 54px; border-radius: 50%;
  left: 50%; top: 50%; margin: -27px 0 0 -27px;
  background: radial-gradient(circle at 38% 30%, #FFE2B2, #FF9A4D 56%, #D95D22 100%);
  border: 1px solid rgba(255, 240, 214, 0.5);
  box-shadow: 0 5px 16px rgba(255, 120, 40, 0.46), inset 0 -3px 8px rgba(150, 50, 8, 0.4);
  transition: transform .06s linear;
  will-change: transform;
}

#skillBar {
  position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(24px + var(--safe-b));
  display: flex; align-items: flex-end; gap: 16px; z-index: 6;
  transition: opacity .25s ease;
}
.skill-wrap { position: relative; padding-bottom: 14px; }
.skill-btn {
  position: relative;
  width: 64px; height: 64px; border-radius: 50%;
  border: 1.5px solid rgba(255, 200, 140, 0.4);
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 180, 110, 0.34), rgba(48, 25, 58, 0.82) 72%);
  color: #FFF1DC; font-size: 27px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.36), inset 0 0 16px rgba(255, 150, 80, 0.16);
  transition: transform .1s ease, filter .1s ease, box-shadow .1s ease;
  touch-action: none;
}
.skill-btn.main {
  width: 82px; height: 82px; font-size: 34px;
  border-color: rgba(255, 236, 200, 0.72);
  background:
    radial-gradient(circle at 50% 28%, #FFE0A3 0%, #FFAE58 34%, #FF7A2E 72%, #D9571C 100%);
  box-shadow: 0 10px 26px rgba(255, 120, 40, 0.44), inset 0 -5px 12px rgba(150, 50, 0, 0.35), inset 0 2px 4px rgba(255, 245, 220, 0.45);
  color: #4A1B00;
}
.skill-btn:active { transform: scale(.9); filter: brightness(1.12); }
.skill-btn .mp-icon { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); }
.skill-name {
  position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: rgba(255, 226, 196, 0.82); white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.skill-btn .cd {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(12, 6, 18, 0.68);
  color: #FFE0A3; font-size: 16px; font-weight: 800;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(1px);
}
.skill-btn.cooling .cd { display: flex; }
.skill-btn.cooling { filter: saturate(.55); }

/* 提示 */
#toast {
  position: absolute; left: 50%; top: 21%; transform: translate(-50%, 0);
  padding: 9px 18px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(40, 23, 50, 0.92), rgba(18, 10, 26, 0.9));
  border: 1px solid rgba(255, 196, 130, 0.32);
  color: #FFE9CC; font-size: 13px; font-weight: 600; letter-spacing: .02em;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
  pointer-events: none; z-index: 8; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}
#toast.show { opacity: 1; transform: translate(-50%, -8px); }

/* =========================================================
   首页
   ========================================================= */
.home {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: #08040D; overflow: hidden;
  transition: opacity .34s ease, transform .34s ease;
}
.home.leaving { opacity: 0; pointer-events: none; transform: scale(1.035); }
.home-bg {
  position: absolute; inset: -3%;
  background: #0B0612 url("assets/home-hero.svg") center 46% / cover no-repeat;
}
.home-bg-img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center 50%;
  filter: saturate(1.08) contrast(1.03) brightness(1.03);
  transform: scale(1.03);
  animation: heroDrift 30s ease-in-out infinite alternate;
  will-change: transform;
}
.home-wash {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 3, 11, 0.92) 0%, rgba(6, 3, 11, 0.76) 20%, rgba(6, 3, 11, 0.34) 41%, rgba(6, 3, 11, 0.04) 59%, rgba(6, 3, 11, 0.5) 100%),
    linear-gradient(0deg, rgba(6, 3, 11, 0.9) 0%, rgba(6, 3, 11, 0.2) 26%, rgba(6, 3, 11, 0) 52%, rgba(6, 3, 11, 0.42) 100%),
    radial-gradient(78% 92% at 24% 42%, rgba(255, 116, 42, 0.17), transparent 62%),
    radial-gradient(56% 74% at 80% 24%, rgba(255, 164, 96, 0.09), transparent 66%);
}
.home-beams {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(116deg, transparent 35%, rgba(255, 214, 170, 0.1) 43%, transparent 49%, transparent 61%, rgba(255, 140, 60, 0.08) 69%, transparent 77%);
  mix-blend-mode: screen; opacity: .85;
  animation: beamShift 15s ease-in-out infinite alternate;
}
.home-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .26;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.42) 100%);
  mix-blend-mode: overlay;
}
.home-embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.home-embers i {
  position: absolute; bottom: -12px; left: 12%;
  width: 3px; height: 3px; border-radius: 50%;
  background: #FFE0A3;
  box-shadow: 0 0 7px 2px rgba(255, 150, 60, 0.65);
  opacity: 0;
  animation: emberRise linear infinite;
}
.home-frame { position: absolute; inset: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l)); pointer-events: none; opacity: .55; }
.home-frame i { position: absolute; width: 24px; height: 24px; border: 1px solid rgba(255, 196, 130, 0.38); }
.home-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.home-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
.home-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
.home-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }
.home-content {
  position: relative; z-index: 4;
  width: 100%; height: 100%;
  display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(300px, 0.86fr);
  align-items: center; gap: clamp(14px, 3vw, 58px);
  padding: clamp(14px, 3.2vh, 30px) calc(clamp(20px, 4vw, 64px) + var(--safe-r)) clamp(14px, 3.2vh, 30px) calc(clamp(20px, 4vw, 64px) + var(--safe-l));
}
.home-left { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.home-left::before {
  content: ""; position: absolute; left: -8%; top: 14%; width: 66%; height: 66%;
  background: radial-gradient(ellipse at 34% 46%, rgba(255, 122, 46, 0.13), transparent 66%);
  filter: blur(18px); pointer-events: none; z-index: -1;
}
.home-left > * { animation: homeRise .72s cubic-bezier(.16, .84, .3, 1) both; }
.home-left > *:nth-child(1) { animation-delay: .04s; }
.home-left > *:nth-child(2) { animation-delay: .09s; }
.home-left > *:nth-child(3) { animation-delay: .14s; }
.home-left > *:nth-child(4) { animation-delay: .19s; }
.home-left > *:nth-child(5) { animation-delay: .24s; }
.home-left > *:nth-child(6) { animation-delay: .29s; }

.brand-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: .16em; font-weight: 600;
  color: rgba(255, 218, 178, 0.68);
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.brand-mark {
  width: 23px; height: 23px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif; font-size: 14px; font-weight: 800;
  color: #3A1400;
  background: linear-gradient(145deg, #FFE0A3, #FF8A3D);
  box-shadow: 0 3px 12px rgba(255, 122, 46, 0.45), inset 0 1px 0 rgba(255, 247, 226, 0.8);
  letter-spacing: 0;
}
.brand-sep { width: 20px; height: 1px; background: rgba(255, 196, 130, 0.32); }
.brand-en { letter-spacing: .22em; opacity: .58; font-size: 9px; }

.game-title {
  position: relative;
  margin: 11px 0 0; display: flex; align-items: baseline; flex-wrap: wrap;
  font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
  font-weight: 800; line-height: .96; letter-spacing: .02em;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.55));
}
.title-cn {
  font-size: clamp(42px, 7.6vw, 92px);
  color: #FFF6E6;
  text-shadow: 0 2px 0 rgba(90, 34, 8, 0.3), 0 14px 38px rgba(0, 0, 0, 0.52);
}
.title-accent {
  position: relative;
  margin-left: .08em;
  font-size: clamp(42px, 7.6vw, 92px);
  background: linear-gradient(180deg, #FFEDC0 3%, #FFC46B 34%, #FF8A3D 78%, #E85B1F 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(110, 36, 6, 0.38)) drop-shadow(0 12px 26px rgba(255, 106, 34, 0.3));
}
.title-accent::before {
  content: ""; position: absolute; inset: -18% -12% -8%; z-index: -1;
  background: radial-gradient(ellipse at 50% 58%, rgba(255, 122, 46, 0.24), transparent 64%);
  filter: blur(14px);
}
.title-accent::after {
  content: ""; position: absolute; left: 1%; right: -3%; bottom: -10px; height: 11px;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 107, 0.58) 20%, rgba(255, 122, 46, 0.4) 58%, transparent);
  filter: blur(4px); transform: rotate(-1.2deg);
}

.title-rule {
  display: flex; align-items: center; gap: 9px;
  margin-top: 15px;
  font-size: 9px; letter-spacing: .26em; color: rgba(255, 214, 170, 0.62);
}
.title-rule i { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 196, 130, 0.56)); }
.title-rule i:last-child { background: linear-gradient(90deg, rgba(255, 196, 130, 0.56), transparent); }
.title-rule em {
  display: inline-flex; align-items: center; gap: 4px;
  font-style: normal; letter-spacing: .04em;
  padding: 3px 8px 3px 7px; border-radius: 999px;
  color: #FFE3B4; font-size: 9px;
  background: rgba(255, 138, 61, 0.14);
  border: 1px solid rgba(255, 196, 130, 0.3);
  box-shadow: inset 0 0 12px rgba(255, 122, 46, 0.1);
}
.title-rule em .mp-icon { font-size: 11px; color: #FFC46B; }

.game-slogan {
  margin: 16px 0 0;
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.78; letter-spacing: .04em;
  color: rgba(255, 232, 206, 0.82);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.play-loop {
  display: flex; align-items: center; gap: 4px;
  margin-top: 18px; padding: 6px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(34, 18, 40, 0.62), rgba(12, 7, 18, 0.5));
  border: 1px solid rgba(255, 196, 130, 0.16);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 226, 182, 0.08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.loop-step { display: flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 9px; }
.loop-step .mp-icon { font-size: 16px; color: #FFC46B; filter: drop-shadow(0 0 6px rgba(255, 150, 60, 0.45)); }
.loop-step b {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 17px; line-height: 1; color: #FFF1DC; font-weight: 800;
}
.loop-step span { font-size: 9px; letter-spacing: .08em; color: rgba(255, 214, 170, 0.55); }
.loop-arrow { display: flex; color: rgba(255, 196, 130, 0.26); }
.loop-arrow .mp-icon { font-size: 12px; }

.home-record { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.record-item { display: flex; flex-direction: column; gap: 2px; }
.record-item span { font-size: 9px; letter-spacing: .14em; color: rgba(255, 214, 170, 0.52); }
.record-item b {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 20px; color: #FFD08A; font-weight: 800;
  text-shadow: 0 0 16px rgba(255, 150, 60, 0.25);
}
.record-line { width: 1px; height: 26px; background: linear-gradient(180deg, transparent, rgba(255, 196, 130, 0.28), transparent); }

/* 通行令卡片 */
.home-right { display: flex; justify-content: flex-end; min-width: 0; }
.pass-card {
  position: relative;
  width: min(366px, 100%);
  padding: 16px 16px 13px;
  border-radius: 22px;
  background:
    linear-gradient(158deg, rgba(58, 31, 65, 0.9), rgba(19, 10, 27, 0.92) 56%, rgba(26, 14, 35, 0.95));
  border: 1px solid rgba(255, 200, 138, 0.3);
  box-shadow:
    0 26px 76px rgba(0, 0, 0, 0.58),
    0 2px 0 rgba(255, 220, 170, 0.06),
    inset 0 1px 0 rgba(255, 236, 202, 0.18),
    inset 0 0 60px rgba(255, 138, 61, 0.045);
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
  overflow: hidden;
  animation: cardIn .82s .14s cubic-bezier(.16, .84, .3, 1) backwards;
  transition: transform .25s ease, box-shadow .25s ease;
}
.pass-card::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 228, 178, 0.8), transparent);
}
.pass-card::after {
  content: ""; position: absolute; right: -70px; top: -80px; width: 210px; height: 210px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 138, 61, 0.2), transparent 64%);
  pointer-events: none;
}
@media (hover: hover) {
  .pass-card:hover { transform: translateY(-3px); box-shadow: 0 32px 86px rgba(0, 0, 0, 0.62), 0 2px 0 rgba(255, 220, 170, 0.08), inset 0 1px 0 rgba(255, 236, 202, 0.2), inset 0 0 60px rgba(255, 138, 61, 0.06); }
}
.card-glow {
  position: absolute; left: -30%; bottom: -55%; width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(255, 122, 46, 0.12), transparent 62%);
  pointer-events: none;
}
.pass-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.pass-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pass-label { font-size: 9px; letter-spacing: .18em; color: rgba(255, 214, 170, 0.52); }
.pass-who b {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 21px; line-height: 1.15; color: #FFF2DF;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.pass-realm { font-size: 10px; color: rgba(255, 214, 170, 0.64); }
.pass-seal {
  flex: 0 0 auto;
  width: 38px; height: 47px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: "STKaiti", "KaiTi", serif; font-size: 15px; line-height: 1.05;
  color: #FFE0B0;
  border: 1px solid rgba(255, 160, 90, 0.58);
  background: linear-gradient(180deg, rgba(148, 42, 26, 0.52), rgba(82, 23, 18, 0.58));
  box-shadow: inset 0 0 14px rgba(255, 120, 60, 0.16), 0 4px 12px rgba(0, 0, 0, 0.24);
  transform: rotate(3deg);
  text-align: center;
}
.pass-rule { height: 1px; margin: 13px 0 10px; background: linear-gradient(90deg, rgba(255, 196, 130, 0.28), rgba(255, 196, 130, 0.04)); }
.pass-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pass-note { font-size: 8px; letter-spacing: .1em; color: rgba(255, 196, 130, 0.44); }

.objective-list { list-style: none; margin: 8px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.objective-list li {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 196, 130, 0.09);
  box-shadow: inset 2px 0 0 rgba(255, 138, 61, 0.16);
}
.obj-icon {
  flex: 0 0 auto; width: 29px; height: 29px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(255, 174, 88, 0.22), rgba(255, 122, 46, 0.06));
  border: 1px solid rgba(255, 196, 130, 0.2);
  color: #FFD08A;
  box-shadow: inset 0 1px 0 rgba(255, 236, 202, 0.12);
}
.obj-icon .mp-icon { font-size: 16px; }
.obj-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.obj-text b { font-size: 12px; font-weight: 700; color: #FFEBD2; letter-spacing: .02em; }
.obj-text span { font-size: 9px; color: rgba(255, 214, 170, 0.52); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.objective-list em {
  font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .1em;
  color: rgba(255, 196, 130, 0.3); font-variant-numeric: tabular-nums;
}
.pass-risk {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 9px; padding: 6px 9px;
  border-radius: 9px;
  font-size: 9px; letter-spacing: .03em; color: rgba(255, 176, 150, 0.78);
  background: linear-gradient(90deg, rgba(255, 90, 70, 0.13), rgba(255, 90, 70, 0.03));
  border: 1px solid rgba(255, 120, 90, 0.17);
  box-shadow: inset 2px 0 0 rgba(255, 120, 90, 0.46);
}
.pass-risk .mp-icon { font-size: 12px; color: #FFA38A; flex: 0 0 auto; }

.start-btn {
  position: relative; width: 100%; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 17px; font-weight: 800; letter-spacing: .2em; color: #431A00;
  background:
    linear-gradient(180deg, #FFE8B4 0%, #FFBC68 42%, #FF8A3D 100%);
  box-shadow:
    0 12px 30px rgba(255, 120, 40, 0.46),
    0 0 0 1px rgba(255, 210, 150, 0.32),
    inset 0 -3px 0 rgba(160, 60, 8, 0.34),
    inset 0 2px 3px rgba(255, 248, 225, 0.78);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  overflow: hidden;
}
.start-btn::before {
  content: ""; position: absolute; left: -30%; top: 0; width: 28%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: sheen 3.6s ease-in-out infinite;
}
.start-btn::after {
  content: ""; position: absolute; inset: 1px; border-radius: 14px;
  border: 1px solid rgba(255, 240, 210, 0.28); pointer-events: none;
}
.start-btn .mp-icon { font-size: 21px; transition: transform .16s ease; }
.start-btn:active {
  transform: scale(.975); filter: brightness(1.07);
  box-shadow: 0 7px 18px rgba(255, 120, 40, 0.38), inset 0 -2px 0 rgba(160, 60, 8, 0.3), inset 0 2px 3px rgba(255, 248, 225, 0.6);
}
.start-btn:active .mp-icon { transform: translateX(3px); }
.pass-tip {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin-top: 10px; font-size: 9px; line-height: 1.4;
  color: rgba(255, 214, 170, 0.48);
  letter-spacing: .03em;
}
.pass-tip .mp-icon { font-size: 6px; color: var(--orange); }

/* =========================================================
   暂停 / 结算弹层
   ========================================================= */
.overlay {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  padding: 16px calc(16px + var(--safe-r)) 16px calc(16px + var(--safe-l));
  background:
    radial-gradient(circle at 50% 38%, rgba(74, 34, 70, 0.42), rgba(6, 3, 10, 0.86) 66%),
    rgba(6, 3, 10, 0.42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.panel {
  width: min(440px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px 20px 16px;
  border-radius: 22px;
  background:
    linear-gradient(170deg, rgba(48, 27, 56, 0.96), rgba(19, 10, 26, 0.97) 58%, rgba(25, 13, 33, 0.98));
  border: 1px solid rgba(255, 196, 130, 0.3);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 232, 194, 0.16);
  text-align: center;
  animation: panelIn .26s cubic-bezier(.2, .8, .2, 1);
  scrollbar-width: none;
}
.panel::-webkit-scrollbar { display: none; }
.panel-kicker {
  font-size: 9px; letter-spacing: .24em; font-weight: 700;
  color: rgba(255, 214, 170, 0.5);
}
.panel-title {
  margin-top: 4px;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(26px, 3.6vw, 34px); font-weight: 800; letter-spacing: .08em;
  background: linear-gradient(180deg, #FFF3D9 0%, #FFC46B 52%, #FF8A3D 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 14px rgba(255, 120, 40, 0.2));
}
.panel.fail .panel-title {
  background: linear-gradient(180deg, #FFE1D9 0%, #FF9B8A 52%, #E85B4A 100%);
  -webkit-background-clip: text; background-clip: text;
}
.panel-sub { margin: 5px 0 0; font-size: 11px; line-height: 1.6; color: rgba(255, 214, 170, 0.64); }
.panel-body { margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 196, 130, 0.1);
  font-size: 11px; color: rgba(255, 226, 196, 0.78);
}
.stat-row b { color: var(--gold); font-size: 14px; font-variant-numeric: tabular-nums; }
.result-head {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 2px 0 2px; font-size: 10px; letter-spacing: .12em;
  color: rgba(255, 214, 170, 0.5);
}
.result-head i { width: 22px; height: 1px; background: rgba(255, 196, 130, 0.24); }
.loot-list { display: flex; flex-direction: column; gap: 5px; max-height: 136px; overflow-y: auto; padding-right: 2px; scrollbar-width: none; }
.loot-list::-webkit-scrollbar { display: none; }
.loot-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}
.loot-icon {
  width: 24px; height: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}
.loot-icon .mp-icon { font-size: 14px; }
.loot-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.loot-name b { font-size: 11px; font-weight: 600; color: #FFEAD1; }
.loot-name span { font-size: 9px; color: rgba(255, 214, 170, 0.45); }
.loot-val { font-size: 11px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.loot-row.lost { opacity: .52; }
.loot-row.lost .loot-val { color: #FF8B8B; }
.empty-loot { font-size: 10px; color: rgba(255, 214, 170, 0.4); padding: 8px 0; }

.panel-actions { display: flex; gap: 8px; margin-top: 12px; }
.primary-btn {
  flex: 1; height: 46px; border-radius: 13px;
  font-size: 15px; font-weight: 800; letter-spacing: .12em;
  color: #431A00;
  background: linear-gradient(180deg, #FFE0A3, #FFB35C 46%, #FF8A3D 100%);
  box-shadow: 0 8px 20px rgba(255, 120, 40, 0.36), inset 0 -3px 0 rgba(160, 60, 8, 0.3), inset 0 2px 3px rgba(255, 248, 225, 0.6);
  transition: transform .1s ease, filter .1s ease;
}
.primary-btn:active { transform: scale(.97); filter: brightness(1.07); }
.ghost-btn {
  flex: 0 0 108px; height: 46px; border-radius: 13px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: rgba(255, 226, 196, 0.78);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 196, 130, 0.2);
  transition: transform .1s ease, background .1s ease;
}
.ghost-btn:active { transform: scale(.97); background: rgba(255, 255, 255, 0.1); }
.panel-tip { margin-top: 10px; font-size: 9px; line-height: 1.55; color: rgba(255, 214, 170, 0.4); letter-spacing: .04em; }

/* =========================================================
   动效
   ========================================================= */
@keyframes heroDrift {
  0% { transform: scale(1.03) translate3d(0, 0, 0); }
  100% { transform: scale(1.085) translate3d(-1.3%, -1.1%, 0); }
}
@keyframes beamShift {
  0% { opacity: .45; transform: translate3d(-1%, 0, 0); }
  100% { opacity: .9; transform: translate3d(1.4%, 1%, 0); }
}
@keyframes emberRise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.5); }
  12% { opacity: .9; }
  68% { opacity: .75; }
  100% { opacity: 0; transform: translate3d(var(--drift, 18px), -108vh, 0) scale(1.15); }
}
@keyframes homeRise {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.982); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes startFlash {
  0% { opacity: 0; transform: scale(.72); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.7); }
}
.start-flash {
  position: fixed; inset: 0; z-index: 24; pointer-events: none;
  background: radial-gradient(circle at 50% 62%, rgba(255, 234, 190, 0.96), rgba(255, 150, 66, 0.72) 28%, rgba(255, 122, 46, 0) 68%);
  animation: startFlash .68s ease-out forwards;
}
@keyframes sheen {
  0%, 58% { left: -34%; }
  82%, 100% { left: 118%; }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  .home-bg-img, .home-beams, .home-embers i, .start-btn::before,
  .home-left > *, .pass-card { animation: none !important; }
  .panel { animation: none; }
}

/* =========================================================
   横屏小屏适配
   ========================================================= */
@media (max-height: 440px) {
  .home-content { padding-top: 12px; padding-bottom: 12px; }
  .brand-line { font-size: 8px; letter-spacing: .12em; }
  .brand-en { display: none; }
  .game-title { margin-top: 6px; }
  .title-cn, .title-accent { font-size: clamp(34px, 6.8vw, 58px); }
  .title-rule { margin-top: 8px; font-size: 8px; }
  .game-slogan { margin-top: 9px; font-size: 11px; line-height: 1.55; }
  .play-loop { margin-top: 10px; padding: 4px 6px; gap: 2px; border-radius: 11px; }
  .loop-step { padding: 3px 5px; gap: 4px; }
  .loop-step .mp-icon { font-size: 14px; }
  .loop-step b { font-size: 15px; }
  .loop-step span { font-size: 8px; }
  .home-record { margin-top: 10px; gap: 10px; }
  .record-item b { font-size: 15px; }
  .pass-card { padding: 11px 12px 10px; border-radius: 17px; }
  .avatar-lg { width: 44px; height: 44px; }
  .avatar-lg span { font-size: 19px; }
  .pass-who b { font-size: 17px; }
  .pass-realm { font-size: 9px; }
  .pass-seal { width: 32px; height: 38px; font-size: 13px; }
  .pass-rule { margin: 8px 0 7px; }
  .pass-head { margin-bottom: 1px; }
  .objective-list { margin: 5px 0 6px; gap: 3px; }
  .objective-list li { padding: 4px 6px; }
  .obj-icon { width: 24px; height: 24px; border-radius: 7px; }
  .obj-icon .mp-icon { font-size: 14px; }
  .obj-text b { font-size: 11px; }
  .obj-text span { font-size: 8px; }
  .pass-risk { margin-bottom: 7px; padding: 4px 7px; font-size: 8px; }
  .pass-risk .mp-icon { font-size: 11px; }
  .start-btn { height: 42px; font-size: 14px; border-radius: 12px; }
  .pass-tip { margin-top: 6px; font-size: 8px; }
  .player-plate { padding: 5px 9px 5px 5px; }
  .avatar-sm { width: 30px; height: 30px; }
  .player-meta { min-width: 86px; }
  .hp-bar { width: 80px; height: 7px; }
  .mission-plate { width: min(280px, 34vw); padding: 6px 9px 7px; }
  .mission-main { padding-right: 40px; }
  .bag-plate { padding: 5px 8px; }
  .icon-btn { width: 34px; height: 34px; }
  #joyBase { width: 104px; height: 104px; left: calc(20px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); }
  #joyKnob { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  #skillBar { right: calc(16px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); gap: 13px; }
  .skill-btn { width: 56px; height: 56px; font-size: 23px; }
  .skill-btn.main { width: 72px; height: 72px; font-size: 30px; }
  .skill-name { bottom: -14px; font-size: 9px; }
  .skill-wrap { padding-bottom: 12px; }
  .panel { padding: 14px 16px 13px; }
  .loot-list { max-height: 108px; }
}

@media (max-height: 360px) {
  .game-slogan { display: none; }
  .home-record { display: none; }
  .title-rule { margin-top: 6px; }
  .pass-card { padding: 9px 11px 8px; }
  .play-loop { margin-top: 8px; }
  .objective-list { margin: 4px 0 6px; }
  .obj-text span { display: none; }
  .objective-list li { padding: 4px 6px; }
  .pass-tip { display: none; }
  .start-btn { height: 38px; font-size: 13px; }
  .pass-risk { padding: 3px 6px; margin-bottom: 6px; }
  .pass-rule { margin: 6px 0 5px; }
  .objective-list { gap: 2px; }
  .avatar-lg { width: 38px; height: 38px; }
  .pass-who b { font-size: 15px; }
  .pass-top { gap: 8px; }
  .panel { max-height: 94vh; }
  .panel-title { font-size: 24px; }
  .panel-sub { display: none; }
  .panel-body { margin-top: 8px; }
  .panel-tip { display: none; }
}

@media (max-width: 700px) {
  .home-content { grid-template-columns: minmax(0, 1fr) minmax(248px, .82fr); gap: 12px; padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
  .brand-en, .brand-sep { display: none; }
  .game-slogan { font-size: 11px; }
  .play-loop { gap: 1px; padding: 4px 5px; }
  .pass-card { width: 100%; padding: 11px 12px 10px; }
  .obj-text span { font-size: 8px; }
  .pass-tip { font-size: 8px; }
  .start-btn { height: 44px; }
  .home-record { gap: 9px; }
  .record-item b { font-size: 16px; }
  .mission-plate { width: min(240px, 32vw); }
  .mission-main span { font-size: 10px; }
}

@media (max-width: 620px) {
  .loop-step span { display: none; }
}

@media (max-width: 520px) {
  .title-rule em { display: none; }
  .title-rule { letter-spacing: .14em; gap: 6px; }
  .title-rule i { width: 18px; }
}

@media (max-width: 560px) {
  .home-content { grid-template-columns: minmax(0, .94fr) minmax(228px, 1fr); gap: 10px; padding-left: calc(12px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
  .title-cn, .title-accent { font-size: clamp(30px, 8.6vw, 48px); }
  .game-slogan { display: none; }
  .home-record { margin-top: 8px; }
  .pass-card { padding: 9px 10px 8px; border-radius: 15px; }
  .pass-top { gap: 7px; }
  .avatar-lg { width: 36px; height: 36px; }
  .pass-who b { font-size: 15px; }
  .pass-realm { font-size: 8px; }
  .pass-seal { display: none; }
  .obj-text span { display: none; }
  .objective-list li { padding: 4px 5px; }
  .obj-icon { width: 22px; height: 22px; }
  .start-btn { height: 40px; font-size: 13px; letter-spacing: .12em; }
  .pass-tip { display: none; }
  .play-loop { margin-top: 8px; }
  .loop-step { padding: 3px 4px; }
  .loop-step b { font-size: 14px; }
  .loop-arrow .mp-icon { font-size: 10px; }
  .bag-pips i { width: 5px; height: 5px; }
  .mission-plate { width: 200px; }
  .mission-main span { max-width: 140px; }
}

/* 竖屏时也保持单屏游戏布局，不出现竖屏挡板 */
@media (orientation: portrait) {
  .home-content { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; gap: 18px; }
  .home-left { align-items: center; text-align: center; }
  .home-left::before { left: 50%; transform: translateX(-50%); width: 100%; }
  .home-bg-img { object-position: center 40%; }
  .game-title { justify-content: center; }
  .title-rule { justify-content: center; }
  .home-right { justify-content: center; }
  .pass-card { width: min(360px, 92vw); }
  .brand-line { justify-content: center; }
  .home-record { justify-content: center; }
  .game-title { font-size: 44px; }
  .title-cn, .title-accent { font-size: 44px; }
  .game-slogan { display: none; }
}

/* ===== 首页：整张参考图铺满，点击区按图上位置百分比定位 ===== */
.home { background: #0B0712; }
.home-art { position: absolute; left: 50%; top: 50%; width: max(100vw, 150vh); height: max(100vh, 66.667vw); transform: translate(-50%, -50%); }
.home-art-img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.home-art .hit { position: absolute; background: transparent; padding: 0; transition: background .12s ease; }
.home-art .hit:active { background: rgba(255, 255, 255, 0.16); }
.home-art .hit-start { left: 72%; top: 84%; width: 26%; height: 12.5%; border-radius: 999px; }
.home-art .hit-card { left: 67.5%; top: 24%; width: 29.5%; height: 17.5%; border-radius: 10px; }

/* 首页：实机画面铺满，整屏点击进入 */
.home-art .hit-start { left: 0; top: 0; width: 100%; height: 100%; border-radius: 0; }
.home-art .hit-card { display: none; }
.home-art .hit:active { background: transparent; }

/* ===================== v2 · 按参考图重做的 HUD ===================== */
#hud { position: absolute; inset: 0; display: block; padding: 0; pointer-events: none; background: none; }
#hud > * { pointer-events: auto; }

/* 左上：圆形小地图 */
.hud-tl { position: absolute; left: calc(10px + var(--safe-l, 0px)); top: calc(8px + var(--safe-t, 0px)); display: flex; gap: 10px; align-items: flex-start; }
.mini-wrap { position: relative; width: 96px; height: 96px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, #8A6A3A, #F3D9A0, #8A6A3A, #F3D9A0, #8A6A3A); box-shadow: 0 4px 14px rgba(0,0,0,.45); }
#miniMap { width: 100%; height: 100%; border-radius: 50%; display: block; background: #1B2A22; }
.mini-key { position: absolute; left: -2px; top: -2px; width: 20px; height: 20px; border-radius: 6px; background: rgba(12,10,18,.8); border: 1px solid rgba(255,214,170,.45); color: #FFF0DA; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tl-col { display: flex; flex-direction: column; gap: 8px; }
.timer-pill { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: rgba(12,10,18,.55); color: #FFF0DA; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.timer-pill .mp-icon { font-size: 15px; color: #FFE0A3; }
.timer-pill.danger { color: #FF8B8B; animation: pulse 1s infinite; }
.hud-tl .player-plate { margin: 0; padding: 4px 10px 4px 4px; }

/* 顶部中间：灵宝 / 击败 */
#missionPlate.mission-plate { position: absolute; left: 50%; top: calc(8px + var(--safe-t, 0px)); transform: translateX(-50%); width: auto; min-width: 210px; max-width: 42vw; padding: 6px 16px 8px; border-radius: 14px; background: rgba(12,10,18,.58); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mission-stats { display: flex; gap: 16px; font-size: 13px; color: #FFF0DA; font-weight: 700; white-space: nowrap; }
.mission-stats b { font-size: 17px; color: #FFE0A3; margin-left: 5px; font-variant-numeric: tabular-nums; }
.mission-stats .kill b { color: #FF7A6B; }
#missionPlate .mission-main { padding: 0; }
#missionPlate .mission-main span { font-size: 11px; color: rgba(255,230,200,.82); white-space: nowrap; }
#missionPlate .mission-track { position: relative; left: auto; right: auto; bottom: auto; width: 100%; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }

/* 右上：行囊 + 暂停 */
#hud .hud-right { position: absolute; right: calc(10px + var(--safe-r, 0px)); top: calc(8px + var(--safe-t, 0px)); display: flex; align-items: center; gap: 8px; }

/* 右侧：撤离 */
.extract-btn { position: absolute; right: calc(14px + var(--safe-r, 0px)); top: 27%; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; background: none; border: 0; color: #FFE9C2; font-size: 17px; font-weight: 900; letter-spacing: .12em; text-shadow: 0 2px 4px rgba(0,0,0,.7); filter: grayscale(.85) brightness(.78); transition: filter .3s; }
.extract-btn .ex-ring { width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 38%, #FFE6A8, #E0A24A 60%, #8A5A1E); box-shadow: 0 0 0 3px rgba(255,236,190,.55), 0 0 18px rgba(255,190,90,.55); color: #5A3410; font-size: 32px; }
.extract-btn.on { filter: none; animation: exGlow 1.6s ease-in-out infinite; }
@keyframes exGlow { 50% { transform: scale(1.06); } }
.extract-dist { position: absolute; right: calc(10px + var(--safe-r, 0px)); top: calc(27% + 100px); padding: 4px 6px 4px 12px; border-radius: 999px; background: rgba(12,10,18,.58); color: #FFF0DA; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.extract-dist .mp-icon { font-size: 18px; }

/* 底部中间：气血 / 灵力 */
#vitals { position: absolute; left: 50%; bottom: calc(12px + var(--safe-b, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; }
.lv-ring { width: 44px; height: 44px; border-radius: 50%; background: rgba(12,10,18,.72); box-shadow: inset 0 0 0 2px #E8C98A, 0 2px 8px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; }
#vitals #hpText { min-width: 0; font-size: 14px; font-weight: 900; color: #FFF0DA; }
#vitals .bars { display: flex; flex-direction: column; gap: 4px; width: min(260px, 28vw); }
#vitals .hp-bar { width: 100%; height: 10px; border-radius: 6px; background: rgba(12,10,18,.7); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); overflow: hidden; }
#vitals #hpFill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #3FBF6A, #9BF2A8); box-shadow: 0 0 8px rgba(110,230,140,.55); transition: width .2s; }
#vitals .mp-bar { width: 100%; height: 6px; border-radius: 4px; background: rgba(12,10,18,.7); overflow: hidden; }
#mpFill { width: 100%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3B7BFF, #9CC7FF); box-shadow: 0 0 8px rgba(100,160,255,.55); }

/* 右下：大剑 + 遁影 */
#skillBar { position: absolute; right: calc(16px + var(--safe-r, 0px)); bottom: calc(12px + var(--safe-b, 0px)); display: flex; align-items: flex-end; gap: 12px; }
#skillBar .skill-wrap { padding-bottom: 0; }
#skillBar .skill-wrap:first-child { margin-bottom: 52px; }
#skillBar .skill-btn { width: 62px; height: 62px; border-radius: 50%; border: 0; background: radial-gradient(circle at 50% 42%, #C7A2FF, #6A35C9 58%, #23103F); box-shadow: 0 0 0 2px rgba(225,205,255,.55), 0 0 16px rgba(150,100,255,.55); color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; position: relative; }
#skillBar .skill-btn.main { width: 90px; height: 90px; background: radial-gradient(circle at 50% 38%, #EEF5FF, #7593C2 55%, #1A2640); box-shadow: 0 0 0 3px rgba(230,240,255,.6), 0 0 22px rgba(140,180,255,.6); font-size: 46px; }
#skillBar .skill-name { position: absolute; left: 50%; bottom: -15px; transform: translateX(-50%); font-size: 10px; white-space: nowrap; color: #FFF0DA; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
#skillBar .skill-btn .cd { border-radius: 50%; }

/* 左侧：自动挂机 / 寻宝打怪 */
.auto-panel { position: absolute; left: calc(10px + var(--safe-l, 0px)); top: 34%; width: 158px; display: flex; flex-direction: column; gap: 4px; }
.auto-btn { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px; border-radius: 21px; border: 1.5px solid rgba(255,255,255,.25); background: rgba(12,10,18,.66); color: #FFF0DA; font-size: 14px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.auto-btn .mp-icon { font-size: 20px; color: #FFD08A; flex: 0 0 auto; }
.auto-btn b { flex: 1; text-align: left; letter-spacing: .04em; }
.auto-btn.on { border-color: rgba(255,214,150,.7); box-shadow: 0 0 14px rgba(255,170,60,.4); }
.auto-btn .sw { position: relative; width: 34px; height: 20px; border-radius: 10px; background: rgba(255,255,255,.22); transition: background .2s; flex: 0 0 auto; }
.auto-btn .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.auto-btn.on .sw { background: #2FD46A; }
.auto-btn.on .sw::after { left: 16px; }
.auto-btn.hunt:not(.on) { opacity: .8; }
.auto-sub { padding-left: 14px; margin-bottom: 4px; font-size: 11px; color: rgba(255,236,210,.88); text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; }
@media (max-height: 380px) { .auto-panel { top: 32%; width: 140px; } .auto-btn { height: 36px; font-size: 13px; } }

/* 首页：新图铺满 */
.home-art { position: absolute; inset: 0; }
.home-art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.home .hit-start { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; border: 0; }
.home .hit-card { display: none; }

@media (max-height: 380px) {
  .mini-wrap { width: 78px; height: 78px; }
  .extract-btn .ex-ring { width: 52px; height: 52px; font-size: 27px; }
  .extract-dist { top: calc(27% + 86px); }
  #skillBar .skill-btn { width: 54px; height: 54px; font-size: 26px; }
  #skillBar .skill-btn.main { width: 78px; height: 78px; font-size: 40px; }
  #skillBar .skill-wrap:first-child { margin-bottom: 44px; }
}

/* 首页入口牌：仙侠卷轴风，仅提示，整屏仍可点击进入 */
.home-hint { position: absolute; left: 50%; bottom: 11%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 7px 28px 8px; pointer-events: none; background: linear-gradient(90deg, rgba(18, 12, 28, 0) 0, rgba(18, 12, 28, 0.72) 22%, rgba(18, 12, 28, 0.72) 78%, rgba(18, 12, 28, 0) 100%); border-top: 1px solid rgba(243, 217, 160, 0.55); border-bottom: 1px solid rgba(243, 217, 160, 0.55); animation: hintPulse 2s ease-in-out infinite; }
.home-hint b { font-size: 18px; font-weight: 900; letter-spacing: .4em; color: #FFE0A3; text-shadow: 0 0 10px rgba(255, 138, 61, 0.7), 0 1px 2px rgba(0, 0, 0, 0.8); }
.home-hint i { font-style: normal; font-size: 11px; letter-spacing: .2em; color: rgba(255, 230, 200, 0.7); }
.hh-gem { width: 8px; height: 8px; transform: rotate(45deg); background: #FF8A3D; box-shadow: 0 0 8px rgba(255, 138, 61, 0.9); }
@keyframes hintPulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

/* =========================================================
   开箱弹窗 / 背包 / 一次性技能按钮
   ========================================================= */
.modal { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 10px calc(12px + var(--safe-r, 0px)) 10px calc(12px + var(--safe-l, 0px)); background: radial-gradient(circle at 50% 40%, rgba(40, 20, 60, 0.45), rgba(4, 2, 8, 0.82) 70%); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.chest-card { width: min(520px, 94vw); max-height: 94vh; padding: 12px 18px 14px; border-radius: 20px; text-align: center; background: linear-gradient(170deg, rgba(52, 30, 60, 0.96), rgba(18, 10, 26, 0.98)); border: 1px solid rgba(255, 196, 130, 0.34); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 170, 60, 0.18); animation: panelIn .26s cubic-bezier(.2, .8, .2, 1); }
.spin-count { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: #FFE0A3; border: 3px solid #FFC46B; background: rgba(0, 0, 0, 0.55); box-shadow: 0 0 18px rgba(255, 190, 90, 0.55); font-variant-numeric: tabular-nums; }
.spin-tip { margin-top: 6px; font-size: 15px; font-weight: 700; letter-spacing: .12em; color: #FFEAD1; }
.reel-win { position: relative; margin: 10px auto 0; height: 84px; width: 100%; overflow: hidden; border-radius: 14px; background: rgba(0, 0, 0, 0.42); border: 1px solid rgba(255, 196, 130, 0.26); }
.reel-win::before, .reel-win::after { content: ''; position: absolute; top: 0; bottom: 0; width: 18%; z-index: 2; pointer-events: none; }
.reel-win::before { left: 0; background: linear-gradient(90deg, rgba(18, 10, 26, 0.95), transparent); }
.reel-win::after { right: 0; background: linear-gradient(270deg, rgba(18, 10, 26, 0.95), transparent); }
.reel-mark { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; z-index: 3; background: #FFD08A; box-shadow: 0 0 10px #FFB35C; }
.reel-strip { position: absolute; left: 0; top: 10px; display: flex; gap: 6px; will-change: transform; }
.reel-card { flex: 0 0 60px; height: 64px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)); border: 2px solid var(--rc, #fff); box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.4), 0 0 8px var(--rc, #fff); }
.reel-card b { font-size: 24px; color: var(--rc, #fff); text-shadow: 0 0 8px var(--rc, #fff); }
.reel-card i { font-style: normal; font-size: 10px; color: rgba(255, 240, 220, 0.8); }
.reward { min-height: 54px; margin-top: 8px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .25s ease, transform .25s ease; }
.reward.show { opacity: 1; transform: none; }
.rw-name { font-size: 22px; font-weight: 800; letter-spacing: .1em; text-shadow: 0 0 14px currentColor; }
.rw-meta { font-size: 11px; color: rgba(255, 226, 196, 0.76); }
.chest-actions { display: flex; gap: 10px; margin-top: 8px; }
.chest-actions .primary-btn { height: 42px; }
.chest-actions .ghost-btn { height: 42px; }
.chest-actions .primary-btn:disabled { filter: saturate(.5) brightness(.85); }

.bag-card { width: min(560px, 96vw); max-height: 96vh; padding: 10px 14px 12px; border-radius: 18px; background: linear-gradient(170deg, rgba(40, 24, 50, 0.97), rgba(16, 9, 22, 0.98)); border: 1px solid rgba(255, 196, 130, 0.32); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); animation: panelIn .26s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; gap: 8px; }
.bag-head { display: flex; align-items: center; gap: 10px; color: #FFEAD1; }
.bag-head b { font-size: 18px; letter-spacing: .2em; }
.bag-head span { flex: 1; font-size: 11px; color: var(--muted); }
.bag-grid { display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 38px; grid-auto-flow: dense; gap: 4px; padding: 6px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 196, 130, 0.12); }
.bag-empty { border-radius: 7px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.05); }
.bag-item { position: relative; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.25)); border: 2px solid var(--rc, #fff); box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45), 0 0 8px var(--rc, #fff); }
.bag-item.sel { outline: 2px solid #FFF3D9; outline-offset: 1px; }
.bag-item b { font-size: 18px; color: var(--rc, #fff); text-shadow: 0 0 8px var(--rc, #fff); }
.bag-item i { font-style: normal; font-size: 9px; color: rgba(255, 240, 220, 0.85); max-width: 96%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-item u { position: absolute; right: 3px; bottom: 1px; text-decoration: none; font-size: 8px; color: #FFD08A; }
.bag-detail { min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 11px; color: rgba(255, 226, 196, 0.78); }
.bag-detail .bd-name { font-size: 15px; font-weight: 800; }
.bag-detail .bd-eq { flex: 1 0 100%; color: var(--gold); }
.bag-detail .bd-btn { flex: 0 0 auto; height: 34px; padding: 0 18px; font-size: 13px; margin-left: auto; }
.bag-plate { cursor: pointer; }

#skillBar .skill-btn.item { width: 50px; height: 50px; font-size: 22px; background: radial-gradient(circle at 50% 40%, #FFE3A8, #C9751F 60%, #3A1A08); box-shadow: 0 0 0 2px var(--rc, rgba(255, 220, 160, .6)), 0 0 14px var(--rc, rgba(255, 170, 70, .5)); }
#skillBar .skill-btn.item.empty { filter: grayscale(.9) brightness(.6); box-shadow: 0 0 0 2px rgba(255, 255, 255, .18); }
#skillBar .skill-wrap:nth-child(1), #skillBar .skill-wrap:nth-child(2) { margin-bottom: 52px; }
#skillBar .skill-wrap:first-child { margin-bottom: 52px; }
@media (max-height: 440px) {
  .reel-win { height: 74px; }
  .reel-card { flex-basis: 60px; height: 54px; }
  .bag-grid { grid-auto-rows: 32px; }
  .spin-count { width: 46px; height: 46px; font-size: 24px; }
}

/* ===================== v3 · 装备图标 / 自动开箱 / 地图 / BOSS ===================== */
img:not([src]) { visibility: hidden; }
.item-art { display: block; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }

/* 开箱转盘：每格是参考图里的装备图标 */
.reel-win { height: 106px; }
.reel-card { flex: 0 0 76px; height: 86px; gap: 0; background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.35) 75%); }
.reel-card .item-art { width: 60px; height: 60px; border-radius: 8px; }
.reel-card i { font-size: 11px; font-weight: 700; color: #FFF3DF; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
.bag-item .item-art { width: 78%; height: 62%; }
.loot-icon img.item-art { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }

/* 右上第二排功能键 */
.feat-row { position: absolute; right: calc(10px + var(--safe-r, 0px)); top: calc(56px + var(--safe-t, 0px)); display: flex; gap: 8px; }
.feat-btn { position: relative; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; background: none; color: #FFF0DA; font-size: 11px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.feat-btn b { font-weight: 800; white-space: nowrap; }
.feat-btn .fi { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; background: rgba(12, 10, 18, 0.6); box-shadow: 0 0 0 1.5px rgba(255, 214, 150, 0.5), 0 3px 8px rgba(0, 0, 0, 0.45); transition: transform .12s, box-shadow .2s; }
.feat-btn .fi img { width: 100%; height: 100%; display: block; object-fit: cover; }
.feat-btn:active .fi { transform: scale(.9); }
.feat-btn.on .fi { box-shadow: 0 0 0 2px #FFD08A, 0 0 14px rgba(255, 170, 60, 0.8); }
.feat-badge { position: absolute; right: 0; top: 28px; min-width: 18px; height: 16px; padding: 0 4px; border-radius: 8px; background: #5A5560; color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.feat-btn.on .feat-badge { background: #2FD46A; }
.feat-btn.boss .fi { box-shadow: 0 0 0 1.5px rgba(255, 110, 110, 0.7), 0 0 12px rgba(255, 60, 60, 0.5); }
.feat-btn.done .fi { filter: grayscale(1) brightness(.6); }

/* 撤离键下移，给功能键让位 */
.extract-btn { top: calc(122px + var(--safe-t, 0px)); }
.extract-dist { top: calc(210px + var(--safe-t, 0px)); }

/* 妖王血条 */
.boss-bar { position: absolute; left: 50%; top: calc(72px + var(--safe-t, 0px)); transform: translateX(-50%); width: min(320px, 40vw); display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 22px; background: rgba(30, 6, 10, 0.74); border: 1px solid rgba(255, 90, 90, 0.5); box-shadow: 0 0 16px rgba(255, 50, 50, 0.35); pointer-events: none; }
.boss-bar img { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; }
.bb-main { flex: 1; min-width: 0; }
.bb-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #FFD9D0; font-variant-numeric: tabular-nums; }
.bb-line b { color: #FF9A9A; letter-spacing: .1em; }
.bb-track { height: 8px; margin-top: 3px; border-radius: 5px; background: rgba(0, 0, 0, 0.55); overflow: hidden; }
#bossHpFill { width: 100%; height: 100%; background: linear-gradient(90deg, #B3122A, #FF5A4A); transition: width .15s; }
.is-result #bossBar { display: none !important; }

/* 秘境地图 */
.mini-wrap { cursor: pointer; }
.map-card { max-width: 96vw; max-height: 96vh; padding: 10px 14px 12px; border-radius: 18px; background: linear-gradient(170deg, rgba(40, 24, 50, 0.97), rgba(16, 9, 22, 0.98)); border: 1px solid rgba(255, 196, 130, 0.32); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; gap: 8px; animation: panelIn .26s cubic-bezier(.2, .8, .2, 1); }
#bigMap { display: block; margin: 0 auto; border-radius: 12px; border: 1px solid rgba(255, 196, 130, 0.28); touch-action: none; cursor: crosshair; }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

@media (max-height: 440px) {
  .reel-win { height: 96px; }
  .reel-card { flex-basis: 76px; height: 78px; }
  .reel-card .item-art { width: 52px; height: 52px; }
}
@media (max-height: 380px) {
  .feat-row { top: calc(50px + var(--safe-t, 0px)); gap: 6px; }
  .feat-btn { width: 50px; font-size: 10px; }
  .feat-btn .fi { width: 36px; height: 36px; border-radius: 10px; }
  .feat-badge { top: 22px; }
  .extract-btn { top: calc(104px + var(--safe-t, 0px)); }
  .extract-dist { top: calc(180px + var(--safe-t, 0px)); }
  .boss-bar { top: calc(64px + var(--safe-t, 0px)); }
}

/* ===== 竖屏 HUD：分排摆放，功能按钮全部在屏内可点 ===== */
@media (orientation: portrait) {
  .mini-wrap { width: 68px; height: 68px; }
  .hud-tl { gap: 6px; }
  .hud-tl .player-meta .realm { display: none; }
  .hud-tl .player-plate { max-width: 34vw; overflow: hidden; }
  #hud .hud-right { gap: 6px; top: calc(214px + var(--safe-t, 0px)); left: calc(156px + var(--safe-l, 0px)); right: auto; }
  #missionPlate.mission-plate { top: calc(84px + var(--safe-t, 0px)); min-width: 0; width: 70vw; max-width: 92vw; }
  .feat-row { top: calc(150px + var(--safe-t, 0px)); right: calc(8px + var(--safe-r, 0px)); gap: 6px; }
  .auto-panel { top: calc(150px + var(--safe-t, 0px)); width: 140px; }
  .auto-btn { height: 38px; font-size: 13px; }
  .extract-btn { top: calc(264px + var(--safe-t, 0px)); }
  .extract-dist { top: calc(352px + var(--safe-t, 0px)); }
  #vitals { bottom: calc(168px + var(--safe-b, 0px)); }
  #vitals .bars { width: min(240px, 50vw); }
  #skillBar { right: calc(8px + var(--safe-r, 0px)); bottom: calc(14px + var(--safe-b, 0px)); gap: 8px; }
  #skillBar .skill-btn { width: 56px; height: 56px; font-size: 26px; }
  #skillBar .skill-btn.main { width: 82px; height: 82px; font-size: 42px; }
  #skillBar .skill-btn.item { width: 46px; height: 46px; }
  .modal .bag-card, .modal .map-card, .modal .chest-card { max-width: 96vw; max-height: 92vh; }
}

/* 竖屏：摇杆触控区只占下半屏，不盖住挂机面板和右侧功能键 */
@media (orientation: portrait) {
  #joyZone { width: 50%; height: 42%; }
  #hud { z-index: 6; }
  #vitals { pointer-events: none; }
}

/* 大背包（最多 80 格）：格子区限高，内部滚动 */
.bag-grid { max-height: 46vh; overflow-y: auto; }
