/* ==========================================================================
 * 輕鬆點天堂 WebClient — 手機版獨立樣式層（橫式 Landscape ＋ 直式 Portrait）
 * 鐵則：本檔「所有」規則均嚴格加上 html.wp-mobile 前綴，PC 版 0 條規則命中！
 * 視覺對齊官方 Logo：午夜黑曜 #0B0D19 × 香檳金 #DFC07D / #FDDE9D × 象牙白 #F5EFE2
 * ========================================================================== */

html.wp-mobile,
html.wp-mobile body {
  color-scheme: dark;
  width: 100%;
  height: var(--m-vh, 100dvh);
  min-height: var(--m-vh, 100dvh);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #080a14 !important;
  background-image: none;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html.wp-mobile.orient-landscape {
  --m-edge-l: min(env(safe-area-inset-left, 0px), 12px);
  --m-edge-r: min(env(safe-area-inset-right, 0px), 12px);
  --m-edge-b: min(env(safe-area-inset-bottom, 0px), 8px);
}

/* ---------- 1. 登入／公告／選角畫面手機自適應 ---------- */
html.wp-mobile #scr-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw !important;
  height: 100dvh !important;
  position: fixed !important;
  inset: 0 !important;
  background: radial-gradient(ellipse at 50% 28%, rgba(44, 34, 22, 0.52), #0b0d19 74%) !important;
}
html.wp-mobile #scr-login .bg {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  opacity: 0.45;
  pointer-events: none;
}
html.wp-mobile #scr-login #login-stack {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(350px, 90vw);
  height: auto !important;
  min-height: 0 !important;
  z-index: 2;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html.wp-mobile #scr-login #login-logo {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: min(210px, 56vw) !important;
  height: auto !important;
  border-radius: 50%;
  clip-path: circle(47.2% at 50% 50%);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.72));
}
html.wp-mobile.orient-landscape #scr-login #login-stack {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 24px;
  width: min(620px, 92vw);
  height: auto !important;
  min-height: 0 !important;
  padding-bottom: 18px;
}
html.wp-mobile.orient-landscape #scr-login #login-logo {
  width: min(176px, 28vw) !important;
  flex-shrink: 0;
}
html.wp-mobile.orient-landscape #scr-login #login-box {
  flex: 1;
  max-width: 356px;
}
html.wp-mobile #scr-login #login-box {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 16px 18px 14px !important;
  border-radius: 10px !important;
}
html.wp-mobile #scr-login #login-box .row {
  margin: 8px 0 !important;
  gap: 8px;
}
html.wp-mobile #scr-login #login-box label {
  width: 48px !important;
  font-size: 15px !important;
}
html.wp-mobile #scr-login #login-box input {
  height: 40px !important;
  font-size: 16px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  -webkit-user-select: text;
  user-select: text;
}
html.wp-mobile #scr-login #login-box .btns {
  gap: 12px !important;
  margin-top: 12px !important;
}
html.wp-mobile #scr-login #login-box .db-btn {
  flex: 1;
  height: 44px !important;
  font-size: 16px !important;
  line-height: 42px !important;
  border-radius: 7px !important;
}
html.wp-mobile #scr-login #login-box .login-site-row {
  margin-top: 10px !important;
  padding-top: 10px !important;
}
html.wp-mobile #login-site-link {
  height: 40px !important;
  gap: 8px !important;
  padding: 0 12px !important;
  border-radius: 7px !important;
  font-size: 14.5px !important;
  letter-spacing: 1px !important;
}
html.wp-mobile #login-site-link .site-ic {
  width: 24px !important;
  height: 24px !important;
  border-radius: 4px !important;
}
html.wp-mobile #login-site-link .site-ext {
  font-size: 13px !important;
}
html.wp-mobile.orient-landscape #scr-login #login-box .login-site-row {
  margin-top: 8px !important;
  padding-top: 8px !important;
}
html.wp-mobile.orient-landscape #login-site-link {
  height: 36px !important;
  font-size: 13.5px !important;
}
html.wp-mobile.orient-landscape #login-site-link .site-ic {
  width: 22px !important;
  height: 22px !important;
}
html.wp-mobile #scr-login #login-footer {
  position: fixed !important;
  bottom: max(8px, env(safe-area-inset-bottom, 8px)) !important;
  left: 0 !important;
  right: 0 !important;
  text-align: center;
  font-size: 11px !important;
  z-index: 2;
}
/* 登入頁「加入主畫面全螢幕玩」輕量教學提示列與彈窗 */
html.wp-mobile #scr-login #open-gate {
  left: 0 !important;
  right: 0 !important;
}
html.wp-mobile #m-pwa-tip {
  width: 100%;
  margin-top: 34px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(223, 192, 125, 0.48);
  background: rgba(14, 18, 34, 0.88);
  color: #efe3c2;
  font-size: 12px;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}
html.wp-mobile #m-pwa-tip .mpt-txt { flex: 1; min-width: 0; }
html.wp-mobile #m-pwa-tip .mpt-txt strong { color: #ffe39e; }
html.wp-mobile #m-pwa-how {
  flex-shrink: 0;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #fdde9d;
  background: linear-gradient(180deg, #b88b37, #755319);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
html.wp-mobile #m-pwa-x {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b8ae94;
  font-size: 13px;
}
html.wp-mobile.orient-landscape #scr-login #m-pwa-tip {
  display: none;
}
html.wp-mobile #m-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 980;
  background: rgba(4, 6, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
}
html.wp-mobile #m-pwa-modal.hidden { display: none !important; }
html.wp-mobile #m-pwa-modal .mpm-card {
  width: min(360px, 92vw);
  max-height: 84dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, #151a2e, #0b0e1b);
  border: 1.5px solid #dfc07d;
  border-radius: 12px;
  padding: 14px 16px;
  color: #f3ead4;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.88);
}
html.wp-mobile #m-pwa-modal .mpm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 15px;
  color: #fdde9d;
}
html.wp-mobile #m-pwa-modal #m-pwa-close {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(223, 192, 125, 0.45);
  background: rgba(25, 30, 50, 0.9);
  color: #f5efe2;
  font-size: 14px;
}
html.wp-mobile #m-pwa-modal .mpm-sub {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #d6cbb2;
}
html.wp-mobile #m-pwa-modal .mpm-sub strong { color: #ffe39e; }
html.wp-mobile #m-pwa-modal .mpm-sec {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(223, 192, 125, 0.25);
  background: rgba(8, 10, 18, 0.65);
  margin-bottom: 8px;
}
html.wp-mobile #m-pwa-modal .mpm-sec.hi {
  border-color: rgba(253, 222, 157, 0.65);
  background: rgba(34, 28, 16, 0.55);
}
html.wp-mobile #m-pwa-modal .mpm-t {
  font-size: 13px;
  font-weight: 800;
  color: #ffe39e;
  margin-bottom: 5px;
}
html.wp-mobile #m-pwa-modal ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.55;
  color: #ebe2cc;
}
html.wp-mobile #m-pwa-modal ol li { margin-bottom: 3px; }
html.wp-mobile #m-pwa-modal #m-pwa-ok {
  width: 100%;
  height: 40px;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #fdde9d;
  background: linear-gradient(180deg, #c7a45b, #7a581d);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

/* 選角／創角隱藏重複舊按鈕，改由底部手機操作列接管 */
html.wp-mobile #scr-select #select-btns,
html.wp-mobile #scr-create #cc-ok,
html.wp-mobile #scr-create #cc-cancel {
  display: none !important;
}

/* 世界畫布 */
html.wp-mobile body.m-in-world #stage {
  position: fixed !important;
  background: #000 !important;
  z-index: 1 !important;
}
html.wp-mobile #world {
  touch-action: none !important;
}

/* ---------- 2. 隱藏 PC 專用 HUD ---------- */
html.wp-mobile #ui {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100vw !important;
  height: var(--m-vh, 100dvh) !important;
  pointer-events: none !important;
  z-index: 500 !important;
}
html.wp-mobile #ui-in {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  pointer-events: none !important;
}
html.wp-mobile body #ui #ui-in > #u-char,
html.wp-mobile body #ui #ui-in > #u-buffs,
html.wp-mobile body #ui #ui-in > #u-tr,
html.wp-mobile body #ui #ui-in > #u-hot,
html.wp-mobile body #ui #ui-in > #u-act,
html.wp-mobile body #ui #ui-in > #u-exp,
html.wp-mobile body #ui #ui-in > #u-leftbot,
html.wp-mobile body #ui #ui-in > #u-chatbtn,
html.wp-mobile body #ui #ui-in > #u-target,
html.wp-mobile body #ui #ui-in > #u-party,
html.wp-mobile body #ui #ui-in > #u-hunting,
html.wp-mobile body #ui #ui-in > #world-btns {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
/* 寵物／召喚獸控制列：保留 100% PC 原圖按鈕（/api/ui/1181~1194）；直式 2 排、橫式頂端置中 1 排 */
html.wp-mobile body #ui #ui-in > #u-petctl:not(.hidden) {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(min(env(safe-area-inset-bottom, 0px), 10px) + 358px) !important;
  transform: translateX(-50%) !important;
  z-index: 248 !important;
  pointer-events: auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, auto) !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 3px 5px !important;
  width: fit-content !important;
  max-width: calc(100vw - 20px) !important;
  overflow: visible !important;
  background: rgba(11, 13, 25, 0.88) !important;
  border: 1px solid rgba(223, 192, 125, 0.55) !important;
  border-radius: 10px !important;
  padding: 4px 7px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.78) !important;
  cursor: default !important;
}
html.wp-mobile body #ui #ui-in > #u-petctl:not(.hidden) .pt {
  font-size: 11px !important;
  line-height: 1.1 !important;
  margin-right: 0 !important;
  padding: 2px 3px !important;
  white-space: nowrap !important;
  color: #fdde9d !important;
}
html.wp-mobile body #ui #ui-in > #u-petctl:not(.hidden) button {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0 !important;
}
html.wp-mobile body #ui #ui-in > #u-petctl:not(.hidden) button img {
  width: 26px !important;
  height: 26px !important;
}
html.wp-mobile body #ui #ui-in > #u-petctl:not(.hidden) button.warn {
  margin-left: 0 !important;
}
@media (min-width: 600px) {
  html.wp-mobile.orient-portrait body #ui #ui-in > #u-petctl:not(.hidden) {
    bottom: calc(min(env(safe-area-inset-bottom, 0px), 10px) + 374px) !important;
  }
}
@media (max-width: 679px) {
  html.wp-mobile.orient-portrait body #ui #ui-in > #u-petctl:not(.hidden) {
    left: auto !important;
    right: calc(env(safe-area-inset-right, 0px) + 8px) !important;
    transform: none !important;
  }
}
@media (max-width: 519px) {
  html.wp-mobile.orient-portrait body #ui #ui-in > #u-petctl:not(.hidden) {
    bottom: calc(min(env(safe-area-inset-bottom, 0px), 10px) + 358px) !important;
    gap: 2px 3px !important;
    padding: 3px 5px !important;
  }
  html.wp-mobile.orient-portrait body #ui #ui-in > #u-petctl:not(.hidden) .pt {
    font-size: 10px !important;
    padding: 1px 2px !important;
  }
  html.wp-mobile.orient-portrait body #ui #ui-in > #u-petctl:not(.hidden) button {
    width: 25px !important;
    height: 25px !important;
  }
  html.wp-mobile.orient-portrait body #ui #ui-in > #u-petctl:not(.hidden) button img {
    width: 23px !important;
    height: 23px !important;
  }
}
html.wp-mobile.orient-landscape body #ui #ui-in > #u-petctl:not(.hidden) {
  left: 50% !important;
  right: auto !important;
  top: calc(env(safe-area-inset-top, 0px) + 6px) !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 3px !important;
  max-width: calc(100vw - 416px) !important;
  padding: 3px 6px !important;
}
@media (max-width: 760px) {
  html.wp-mobile.orient-landscape #m-tl-card,
  html.wp-mobile.orient-landscape #m-buff-box {
    width: 206px;
  }
  html.wp-mobile.orient-landscape #m-nav {
    gap: 4px;
  }
  html.wp-mobile.orient-landscape .m-nav-btn {
    width: 40px;
    height: 40px;
  }
  html.wp-mobile.orient-landscape body #ui #ui-in > #u-petctl:not(.hidden) {
    gap: 2px !important;
    padding: 2px 5px !important;
    max-width: calc(100vw - 384px) !important;
  }
  html.wp-mobile.orient-landscape body #ui #ui-in > #u-petctl:not(.hidden) .pt {
    font-size: 10px !important;
  }
  html.wp-mobile.orient-landscape body #ui #ui-in > #u-petctl:not(.hidden) button {
    width: 22px !important;
    height: 22px !important;
  }
  html.wp-mobile.orient-landscape body #ui #ui-in > #u-petctl:not(.hidden) button img {
    width: 20px !important;
    height: 20px !important;
  }
}
html.wp-mobile #buffcast-box {
  max-width: 92vw !important;
  max-height: 82dvh !important;
  overflow-y: auto !important;
  z-index: 870 !important;
  pointer-events: auto !important;
}
/* 系統廣播：柔和香檳字＋兩端淡出，固定獨立軌道絕不壓狀態/Buff/小地圖/目標框，省電時隱藏 */
html.wp-mobile body #ui #ui-in > #u-bc {
  position: fixed !important;
  left: calc(env(safe-area-inset-left, 0px) + 8px) !important;
  right: calc(env(safe-area-inset-right, 0px) + 8px) !important;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  overflow: hidden !important;
  text-align: center !important;
  z-index: 12 !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.9) !important;
  pointer-events: none !important;
}
html.wp-mobile body #ui #ui-in > #u-bc .bcl {
  display: none !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  margin: 0 0 2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
html.wp-mobile.orient-portrait body #ui #ui-in > #u-bc {
  position: absolute !important;
  top: auto !important;
  bottom: calc(min(env(safe-area-inset-bottom, 0px), 10px) + 138px) !important;
  max-height: 22px !important;
  white-space: nowrap !important;
}
html.wp-mobile.orient-portrait body #ui #ui-in > #u-bc .bcl {
  margin: 0 !important;
  line-height: 22px !important;
}
html.wp-mobile.orient-portrait body #ui #ui-in > #u-bc .bcl:last-child {
  display: block !important;
}
@media (min-width: 600px) {
  html.wp-mobile.orient-portrait body #ui #ui-in > #u-bc {
    bottom: calc(min(env(safe-area-inset-bottom, 0px), 10px) + 154px) !important;
  }
}
html.wp-mobile.orient-landscape body #ui #ui-in > #u-bc {
  top: calc(env(safe-area-inset-top, 0px) + 135px) !important;
  bottom: auto !important;
  left: calc(var(--m-edge-l, 0px) + 252px) !important;
  right: calc(var(--m-edge-r, 0px) + 206px) !important;
  max-height: 44px !important;
}
html.wp-mobile.orient-landscape body #ui #ui-in > #u-bc .bcl:nth-last-child(-n+2) {
  display: block !important;
}
@media (max-width: 780px) {
  html.wp-mobile.orient-landscape body #ui #ui-in > #u-bc {
    left: calc(var(--m-edge-l, 0px) + 228px) !important;
    right: calc(var(--m-edge-r, 0px) + 184px) !important;
  }
}
html.wp-mobile.m-ps-on body #ui #ui-in > #u-bc {
  display: none !important;
}
html.wp-mobile #u-shopclose {
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + 64px) !important;
  right: 10px !important;
  z-index: 320 !important;
  pointer-events: auto !important;
  height: 36px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}

/* ---------- 3. 手機專屬 HUD 容器 (#m-hud) — 全面通透無框化 ---------- */
html.wp-mobile #m-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: 100vw;
  height: var(--m-vh, 100dvh);
  z-index: 220;
  pointer-events: none;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  color: #f5efe2;
}
html.wp-mobile #m-hud.hidden { display: none !important; }
html.wp-mobile #m-hud button,
html.wp-mobile #m-hud .m-tap {
  pointer-events: auto;
  font-family: inherit;
  touch-action: none;
}

/* 頂部列：完全透明無暗幕，橫式貼齊左右兩側邊緣（避開動態島中段但不內縮浪費） */
html.wp-mobile #m-top {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  display: block;
  padding: 4px 8px 0;
  background: none;
  pointer-events: none;
  z-index: 250;
}
html.wp-mobile.orient-landscape #m-top {
  top: 0;
  left: var(--m-edge-l, 0px);
  right: var(--m-edge-r, 0px);
  padding: 6px 8px 0;
}

/* 左上垂直 Flex 堆疊欄（狀態 → 地圖膠囊 → Buff → 隊友，物理 0% 重疊） */
html.wp-mobile #m-left-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  pointer-events: none;
}
html.wp-mobile.orient-landscape #m-left-stack {
  gap: 3px;
}

/* 左上角角色資訊：平時無背框僅留頭像/名字/HP/MP，點擊左上才展開背框與 4 欄屬性（防禦/魔防/負重/飽食） */
html.wp-mobile #m-tl-card {
  width: 214px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 2px 3px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  pointer-events: auto;
}
html.wp-mobile #m-tl-card.expanded {
  padding: 6px 7px;
  background: linear-gradient(180deg, rgba(16, 20, 36, 0.86) 0%, rgba(9, 11, 22, 0.78) 100%);
  border-color: rgba(223, 192, 125, 0.48);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
}
html.wp-mobile.orient-landscape #m-tl-card {
  width: 238px;
  gap: 3px;
  padding: 1px 3px;
}
html.wp-mobile.orient-landscape #m-tl-card.expanded {
  padding: 4px 6px;
}
@media (max-width: 740px) {
  html.wp-mobile.orient-landscape #m-left-stack {
    gap: 2px;
  }
  html.wp-mobile.orient-landscape #m-tl-card {
    width: 204px;
  }
}
@media (max-width: 519px) {
  html.wp-mobile.orient-portrait #m-left-stack {
    gap: 4px;
  }
  html.wp-mobile.orient-portrait #m-tl-card {
    width: 206px;
    gap: 4px;
    padding: 2px 3px;
  }
  html.wp-mobile.orient-portrait #m-tl-card.expanded {
    padding: 5px 6px;
  }
}
html.wp-mobile #m-stat {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  width: 100%;
  min-width: 0;
  cursor: pointer;
}
html.wp-mobile #m-stat-chev {
  font-size: 9px;
  line-height: 1;
  color: #f2d58a;
  opacity: 0.88;
  flex-shrink: 0;
  margin-left: auto;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  transition: transform 0.14s ease;
}
html.wp-mobile #m-tl-card.expanded #m-stat-chev {
  transform: rotate(180deg);
}
html.wp-mobile #m-stat-strip {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding-top: 4px;
  border-top: 1px solid rgba(223, 192, 125, 0.22);
}
html.wp-mobile #m-tl-card.expanded #m-stat-strip {
  display: grid;
}
html.wp-mobile #m-stat-acts {
  display: none;
  align-items: center;
  gap: 4px;
}
html.wp-mobile #m-tl-card.expanded #m-stat-acts {
  display: flex;
}
html.wp-mobile #m-stat-detail {
  flex: 1;
  height: 19px;
  padding: 0 6px;
  border: 1px solid rgba(223, 192, 125, 0.42);
  border-radius: 5px;
  background: rgba(24, 28, 48, 0.88);
  color: #fdde9d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
html.wp-mobile #m-stat-fold {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 19px;
  padding: 0;
  border: 1px solid rgba(223, 192, 125, 0.35);
  border-radius: 5px;
  background: rgba(24, 28, 48, 0.86);
  color: #fdde9d;
  cursor: pointer;
}
html.wp-mobile #m-stat-fold svg {
  pointer-events: none;
}
html.wp-mobile .m-sc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 1px;
  border-radius: 5px;
  background: rgba(8, 10, 18, 0.56);
  border: 1px solid rgba(223, 192, 125, 0.16);
  line-height: 1.1;
}
html.wp-mobile .m-sc .m-sk {
  font-size: 8.5px;
  color: #cfb784;
  letter-spacing: 0.3px;
}
html.wp-mobile .m-sc b {
  font-size: 10.5px;
  font-weight: 800;
  color: #fff4d4;
  text-shadow: 0 1px 2px #000;
}
@media (max-width: 410px) {
  html.wp-mobile.orient-portrait #m-stat {
    gap: 5px;
  }
  html.wp-mobile.orient-portrait #m-port {
    width: 38px;
    height: 38px;
  }
}
html.wp-mobile #m-port {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid #dfc07d;
  background: radial-gradient(circle at 35% 30%, #2a2417, #0c0e1a);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85), 0 3px 10px rgba(0, 0, 0, 0.82);
}
@media (max-width: 519px) {
  html.wp-mobile.orient-portrait #m-port {
    width: 38px;
    height: 38px;
  }
}
html.wp-mobile.orient-landscape #m-port {
  width: 36px;
  height: 36px;
}
html.wp-mobile.orient-landscape #m-stat-strip {
  padding-top: 3px;
}
html.wp-mobile.orient-landscape .m-sc {
  padding: 1px;
}
html.wp-mobile #m-port-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
html.wp-mobile #m-lv {
  position: absolute;
  left: -4px;
  bottom: -4px;
  min-width: 20px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: linear-gradient(180deg, #2b2213, #110d08);
  border: 1px solid #e5bd67;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff4cf;
  font: italic 700 10.5px/1 Georgia, serif;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.88);
}
html.wp-mobile #m-bars {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
html.wp-mobile #m-nm-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 0 2px;
  border-radius: 0;
  background: none;
  font-size: 12px;
  font-weight: 700;
  color: #fff6de;
  text-shadow: 0 1px 2px #000, 0 0 4px #000, 1px 0 2px #000, -1px 0 2px #000;
  white-space: nowrap;
  overflow: hidden;
}
html.wp-mobile #m-nm {
  overflow: hidden;
  text-overflow: ellipsis;
}
html.wp-mobile #m-ac-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: #f2d58a;
  flex-shrink: 0;
}
html.wp-mobile #m-ac-pill img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #000);
}
html.wp-mobile .m-bar {
  position: relative;
  height: 12px;
  border-radius: 4px;
  background: rgba(8, 10, 16, 0.78);
  border: 1px solid rgba(223, 192, 125, 0.46);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.76), inset 0 1px 2px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
html.wp-mobile .m-bar.mp {
  border-color: rgba(126, 168, 224, 0.52);
}
html.wp-mobile .m-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.05) 48%, transparent 52%);
  z-index: 2;
  pointer-events: none;
}
html.wp-mobile .m-bar i {
  display: block;
  height: 100%;
  width: 0%;
  transition: width 0.15s linear;
}
html.wp-mobile .m-bar.hp i {
  background: linear-gradient(90deg, #98161d, #db2c35 65%, #f5594f);
}
html.wp-mobile .m-bar.mp i {
  background: linear-gradient(90deg, #164187, #2870d9 65%, #52a5ff);
}
html.wp-mobile .m-bar span {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

html.wp-mobile #m-warn-pill {
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
  flex-shrink: 0;
}
html.wp-mobile #m-warn-pill.hidden { display: none !important; }
html.wp-mobile #m-warn-pill.yel { background: rgba(130, 88, 12, 0.88); color: #ffe799; }
html.wp-mobile #m-warn-pill.red { background: rgba(160, 26, 26, 0.92); color: #ffdada; }

/* Buff 欄（對齊角色卡寬度；收合時完全無背框，點擊展開全部時才顯示背框與收合 ▲） */
html.wp-mobile #m-buff-box {
  width: 214px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 1px 3px;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
}
html.wp-mobile #m-buff-box.expanded {
  border-color: rgba(223, 192, 125, 0.55);
  background: rgba(9, 11, 22, 0.78);
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
html.wp-mobile.orient-landscape #m-buff-box {
  width: 238px;
  padding: 1px 3px;
}
html.wp-mobile.orient-landscape #m-buff-box.expanded {
  padding: 3px;
}
@media (max-width: 740px) {
  html.wp-mobile.orient-landscape #m-buff-box {
    width: 204px;
  }
}
@media (max-width: 519px) {
  html.wp-mobile.orient-portrait #m-buff-box {
    width: 206px;
    padding: 1px 3px;
  }
  html.wp-mobile.orient-portrait #m-buff-box.expanded {
    padding: 3px;
  }
  html.wp-mobile.orient-portrait #m-buffs {
    gap: 2px;
  }
  html.wp-mobile.orient-portrait #m-buffs .mb-ic {
    width: 23px;
    height: 23px;
  }
}
html.wp-mobile #m-buff-box.hidden { display: none !important; }
html.wp-mobile #m-buffs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  overflow: visible;
  pointer-events: none;
}
html.wp-mobile.orient-portrait #m-buff-box.expanded #m-buffs {
  max-height: 105px;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  pointer-events: auto;
}
@media (max-width: 519px) {
  html.wp-mobile.orient-portrait #m-buff-box.expanded #m-buffs {
    max-height: 60px;
  }
}
html.wp-mobile.orient-landscape #m-buffs {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
}
html.wp-mobile.orient-landscape #m-buff-box.expanded #m-buffs {
  max-height: 66px;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  pointer-events: auto;
}
@media (max-width: 740px) {
  html.wp-mobile.orient-landscape #m-buff-box.expanded #m-buffs {
    max-height: 52px;
  }
}
html.wp-mobile.orient-landscape #m-buffs .mb-ic {
  width: 21px;
  height: 21px;
}
html.wp-mobile #m-buffs:empty { display: none; }
html.wp-mobile #m-buffs .mb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
}
html.wp-mobile #m-buffs .mb-ic {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(223, 192, 125, 0.48);
  background: rgba(11, 13, 25, 0.85) center/contain no-repeat;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fdde9d;
  box-sizing: border-box;
}
html.wp-mobile #m-buffs .mb-ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
html.wp-mobile #m-buffs .mb-tm {
  margin-top: 1px;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  white-space: nowrap;
  text-align: center;
}
html.wp-mobile #m-buffs .mb-more {
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(253, 222, 157, 0.65);
  background: radial-gradient(circle at 50% 30%, rgba(120, 88, 30, 0.85), rgba(26, 20, 10, 0.92));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffeab3;
  box-sizing: border-box;
}
html.wp-mobile #m-buffs .mb-more-n { font-size: 9px; font-weight: 900; line-height: 1; }
html.wp-mobile #m-buffs .mb-more-arr { font-size: 8px; line-height: 0.9; color: #ffd77a; }
html.wp-mobile #m-buff-fold {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 15px;
  margin-top: 3px;
  padding: 0;
  border: 1px solid rgba(223, 192, 125, 0.35);
  border-radius: 5px;
  background: rgba(24, 28, 48, 0.86);
  color: #fdde9d;
  cursor: pointer;
}
html.wp-mobile.orient-landscape #m-buff-fold {
  height: 14px;
  margin-top: 2px;
}
html.wp-mobile #m-buff-fold svg {
  pointer-events: none;
}
html.wp-mobile #m-buff-fold.hidden { display: none !important; }

/* 隊伍精簡條（直式／橫式皆 2 欄緊湊網格，限高內捲，自然排在 Buff 下方，永不互撞） */
html.wp-mobile #m-party {
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: auto;
}
html.wp-mobile.orient-portrait #m-party {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 4px;
  width: 214px;
  max-height: 46px;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
}
@media (max-width: 519px) {
  html.wp-mobile.orient-portrait #m-party {
    width: 206px;
  }
}
html.wp-mobile.orient-landscape #m-party {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 106px));
  gap: 2px 4px;
  max-height: 45px;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
}
html.wp-mobile #m-party.hidden { display: none !important; }
html.wp-mobile #m-party .mp-row {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 118px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(11, 13, 25, 0.68);
  border: 1px solid rgba(154, 208, 255, 0.36);
  color: #eaf4ff;
  font-size: 11px;
  text-align: left;
  text-shadow: 0 1px 2px #000;
}
html.wp-mobile #m-hud #m-party .mp-row {
  touch-action: pan-y;
}
html.wp-mobile.orient-portrait #m-party .mp-row {
  width: 100%;
  box-sizing: border-box;
  padding: 2px 5px;
  font-size: 10.5px;
}
html.wp-mobile.orient-landscape #m-party .mp-row {
  width: 100%;
  padding: 2px 5px;
}
html.wp-mobile #m-party .mp-row.sel {
  border-color: #fdde9d;
  box-shadow: 0 0 8px rgba(253, 222, 157, 0.45);
  background: rgba(45, 36, 18, 0.82);
}
html.wp-mobile #m-party .mp-hp {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
html.wp-mobile #m-party .mp-hp i { display: block; height: 100%; background: #4cd964; }

/* 右上工具列：4 大選單鈕（直式 2×2、橫式 1×4）＋ 小地圖卡（含所在地/安全區/遊戲時間） */
html.wp-mobile #m-top-r {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
  flex-shrink: 0;
}
html.wp-mobile #m-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
html.wp-mobile.orient-portrait #m-nav {
  display: grid;
  grid-template-columns: repeat(2, 46px);
  gap: 5px;
}
html.wp-mobile .m-nav-btn {
  position: relative;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 2px 1px 1px;
  border-radius: 10px;
  border: 1px solid rgba(223, 192, 125, 0.24);
  background: radial-gradient(circle, rgba(16, 20, 36, 0.76) 24%, rgba(11, 13, 25, 0.48) 100%);
  color: #f5e6c4;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
html.wp-mobile.orient-portrait .m-nav-btn {
  width: 46px;
  height: 44px;
}
html.wp-mobile .m-nav-btn.ico i {
  display: block;
  width: 26px;
  height: 26px;
  background: center/contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.92));
}
html.wp-mobile .m-nav-btn .mn-svg.big {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.92));
}
html.wp-mobile .m-nav-btn small {
  font-size: 9.5px;
  color: #f6e3b6;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
html.wp-mobile .m-nav-btn:active {
  transform: scale(0.9);
  background: radial-gradient(circle, rgba(199, 164, 91, 0.42), transparent 80%);
}
html.wp-mobile #m-mm-card {
  pointer-events: auto;
  width: 104px;
  border-radius: 8px;
  border: 1px solid rgba(223, 192, 125, 0.65);
  background: rgba(9, 11, 22, 0.78);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
  cursor: pointer;
}
html.wp-mobile.orient-landscape #m-mm-card {
  width: 118px;
}
html.wp-mobile #m-minimap {
  position: relative;
  width: 100%;
  height: 68px;
  background: #0b0a08;
  overflow: hidden;
  opacity: 0.78;
  transition: opacity 0.15s ease;
}
html.wp-mobile #m-mm-card:active #m-minimap {
  opacity: 0.92;
}
html.wp-mobile.orient-landscape #m-minimap {
  height: 76px;
}
html.wp-mobile #m-mm {
  display: block;
  width: 100%;
  height: 100%;
}
html.wp-mobile #m-mm-xy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #ffe8a8;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
  line-height: 1.1;
}
html.wp-mobile #m-mm-info {
  padding: 3px 5px 4px;
  border-top: 1px solid rgba(223, 192, 125, 0.3);
  background: linear-gradient(180deg, rgba(14, 18, 32, 0.9), rgba(8, 10, 18, 0.95));
  display: flex;
  flex-direction: column;
  gap: 1px;
}
html.wp-mobile #m-mm-loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  font-size: 9.5px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
}
html.wp-mobile #m-mm-loc {
  color: #f6e7c2;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
html.wp-mobile #m-mm-zone {
  font-size: 8.5px;
  font-weight: 700;
  flex-shrink: 0;
}
html.wp-mobile #m-mm-zone.z-safe { color: #7dff8a; }
html.wp-mobile #m-mm-zone.z-norm { color: #ffd479; }
html.wp-mobile #m-mm-zone.z-pvp  { color: #ff6b6b; }
html.wp-mobile #m-mm-time {
  font-size: 8.5px;
  color: #cbb88b;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
}
html.wp-mobile #m-ps-float {
  pointer-events: auto;
  height: 26px;
  padding: 0 9px;
  border-radius: 13px;
  border: 1px solid rgba(223, 192, 125, 0.55);
  background: rgba(11, 13, 25, 0.78);
  color: #fdde9d;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}
html.wp-mobile #m-ps-float.hidden { display: none !important; }

/* 鎖定目標列（直式 <520px 置於 #m-left-stack 內順排；直式 >=520px 與橫式置頂置中避開寵物列） */
html.wp-mobile #m-target {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(11, 13, 25, 0.86);
  border: 1px solid rgba(255, 118, 92, 0.58);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.68);
  z-index: 255;
  pointer-events: auto;
  max-width: min(240px, calc(100vw - 348px));
}
html.wp-mobile.orient-portrait #m-target {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  transform: none;
  width: 214px;
  max-width: 214px;
  box-sizing: border-box;
  padding: 3px 7px;
  gap: 4px;
  z-index: 2;
}
@media (max-width: 519px) {
  html.wp-mobile.orient-portrait #m-target {
    width: 206px;
    max-width: 206px;
  }
}
html.wp-mobile.orient-portrait #m-tg-info {
  min-width: 0;
}
@media (min-width: 680px) {
  html.wp-mobile.orient-portrait #m-target {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    max-width: min(240px, calc(100vw - 464px));
    padding: 4px 8px;
    gap: 6px;
    z-index: 255;
  }
}
html.wp-mobile.orient-landscape #m-target {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 7px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: auto;
  max-width: min(220px, calc(100vw - 432px));
}
html.wp-mobile.orient-landscape.has-petctl #m-target {
  top: calc(env(safe-area-inset-top, 0px) + 46px);
}
html.wp-mobile #m-target.hidden { display: none !important; }
html.wp-mobile #m-tg-info { flex: 1; min-width: 96px; max-width: 160px; }
html.wp-mobile #m-tg-nm {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffe3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
html.wp-mobile #m-tg-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.75);
  overflow: hidden;
}
html.wp-mobile #m-tg-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d32f2f, #ff7043);
}
html.wp-mobile #m-tg-act,
html.wp-mobile #m-tg-clr {
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(223, 192, 125, 0.52);
  background: rgba(34, 28, 16, 0.92);
  color: #fdde9d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
html.wp-mobile #m-tg-clr {
  padding: 0 6px;
  background: rgba(24, 26, 38, 0.85);
  color: #ccc;
}

/* 可對話 NPC 頭頂正中央精巧聊天氣泡（26×26px 視覺 ＋ 44×44px 舒適手指熱區） */
html.wp-mobile #m-npc-pins {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 215;
}
html.wp-mobile #m-npc-pins .m-npc-ico {
  position: fixed;
  width: 26px;
  height: 26px;
  padding: 0;
  transform: translate(-50%, -100%);
  border-radius: 50%;
  border: 1px solid rgba(242, 207, 126, 0.85);
  background: rgba(11, 13, 25, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}
html.wp-mobile #m-npc-pins .m-npc-ico::after {
  content: '';
  position: absolute;
  inset: -9px;
}
html.wp-mobile #m-npc-pins .m-npc-ico svg {
  width: 15px;
  height: 15px;
}
html.wp-mobile #m-npc-pins .m-npc-ico:active {
  transform: translate(-50%, -100%) scale(0.86);
  border-color: #fff3c4;
}

/* 給予目標模式：畫面上所有可接收 NPC 頭頂浮出「給予 {NPC名稱}」金色按鈕（絕不顯示於玩家） */
html.wp-mobile #m-give-pins {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 260;
}
html.wp-mobile #m-give-pins .m-give-btn {
  position: fixed;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  max-width: 170px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid #f4cf7a;
  background: linear-gradient(180deg, rgba(54, 38, 14, 0.96), rgba(20, 14, 7, 0.96));
  color: #fff2cc;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.8), 0 0 10px rgba(244, 207, 122, 0.42), inset 0 1px 0 rgba(255, 240, 195, 0.35);
}
html.wp-mobile #m-give-pins .m-give-btn:active {
  transform: translate(-50%, -100%) scale(0.92);
  border-color: #fff4c6;
  filter: brightness(1.15);
}

/* ---------- 4. 動態浮動午夜藍金雙細環搖桿 (#m-joy-wrap：閒置隱藏，滑動才於觸控點出現) ---------- */
html.wp-mobile #m-joy-wrap {
  position: fixed;
  left: 0;
  top: 0;
  width: 112px;
  height: 112px;
  margin-left: -56px;
  margin-top: -56px;
  z-index: 245;
  pointer-events: none !important;
  touch-action: none;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
html.wp-mobile #m-joy-wrap.active {
  display: flex;
  opacity: 0.94;
}
html.wp-mobile #m-joy-base {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 20, 36, 0.36) 0%, rgba(8, 10, 20, 0.72) 100%);
  border: 1.5px solid rgba(223, 192, 125, 0.54);
  box-shadow: inset 0 0 0 5px rgba(11, 13, 25, 0.44), inset 0 0 0 6px rgba(223, 192, 125, 0.22), 0 4px 16px rgba(0, 0, 0, 0.58);
}
html.wp-mobile #m-joy-base .mj-dir {
  position: absolute;
  width: 5px;
  height: 5px;
  background: rgba(253, 222, 157, 0.65);
  transform: rotate(45deg);
  pointer-events: none;
}
html.wp-mobile #m-joy-base .mj-dir.n { left: 50%; top: 8px; margin-left: -2.5px; }
html.wp-mobile #m-joy-base .mj-dir.s { left: 50%; bottom: 8px; margin-left: -2.5px; }
html.wp-mobile #m-joy-base .mj-dir.w { top: 50%; left: 8px; margin-top: -2.5px; }
html.wp-mobile #m-joy-base .mj-dir.e { top: 50%; right: 8px; margin-top: -2.5px; }
html.wp-mobile #m-joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  margin-top: -21px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2b3452 0%, #14192a 60%, #090b14 100%);
  border: 1.5px solid #dfc07d;
  box-shadow: inset 0 0 0 3px #0b0d19, inset 0 0 0 4px rgba(223, 192, 125, 0.38), 0 4px 12px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}
html.wp-mobile #m-joy-wrap.active #m-joy-knob {
  border-color: #fdde9d;
  box-shadow: inset 0 0 0 3px #0b0d19, inset 0 0 0 4px rgba(253, 222, 157, 0.72), 0 0 14px rgba(253, 222, 157, 0.45);
}

/* ---------- 5. 底部控制區：直式 Dock（2×4 滿寬快捷列 ＋ 上方右側圓鈕群）vs 橫式（單排快捷列 ＋ 右下圓鈕群） ---------- */
html.wp-mobile #m-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 240;
  pointer-events: none;
}
html.wp-mobile.orient-portrait #m-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(18, 22, 38, 0.96) 0%, #0c0f1d 22%, #080a14 100%);
  border-top: 1px solid rgba(212, 170, 82, 0.52);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 236, 184, 0.2);
  padding: 5px 8px calc(6px + min(env(safe-area-inset-bottom, 0px), 10px));
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
}
html.wp-mobile #m-dock-mid {
  display: contents;
}
html.wp-mobile.orient-landscape #m-dock-mid {
  position: fixed;
  left: calc(var(--m-edge-l, 0px) + 124px);
  right: calc(var(--m-edge-r, 0px) + 180px);
  bottom: calc(var(--m-edge-b, 0px) + 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 242;
}
html.wp-mobile #m-chat-mini {
  pointer-events: none !important;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 2px 4px;
  min-height: 20px;
  max-height: 82px;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.36;
  color: #f4eedc;
  text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, 0.96), 1px 0 2px #000, -1px 0 2px #000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
html.wp-mobile.orient-portrait #m-chat-mini {
  position: absolute;
  left: 8px;
  right: 198px;
  bottom: calc(100% + 84px);
}
html.wp-mobile.orient-landscape #m-chat-mini {
  position: static;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  max-height: 82px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
html.wp-mobile #m-chat-mini .mc-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 專屬聊天開啟鈕（直式在快捷列左上方、橫式在左下單排最左側，皆 >= 44×44） */
html.wp-mobile #m-chat-open {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 54px;
  height: 44px;
  padding: 2px 4px;
  border-radius: 10px;
  border: 1.5px solid rgba(223, 192, 125, 0.62);
  background: radial-gradient(circle at 40% 25%, #232b45 0%, #121728 65%, #080a14 100%);
  color: #fdde9d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  pointer-events: auto;
  box-shadow: inset 0 1px 0 rgba(255, 236, 184, 0.24), 0 3px 10px rgba(0, 0, 0, 0.72);
}
html.wp-mobile #m-chat-open svg {
  width: 18px;
  height: 18px;
  display: block;
}
html.wp-mobile #m-chat-open small {
  font-size: 9.5px;
  font-weight: 700;
  color: #f5e6c4;
}
html.wp-mobile #m-chat-open:active {
  transform: scale(0.92);
  border-color: #ffe39e;
  box-shadow: 0 0 12px rgba(253, 222, 157, 0.55);
}
html.wp-mobile.orient-portrait #m-chat-open {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 32px);
}
html.wp-mobile.orient-landscape #m-chat-open {
  position: static;
  width: 50px;
  height: 46px;
}

html.wp-mobile #m-ctrl-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  width: 100%;
}
html.wp-mobile.orient-landscape #m-ctrl-row {
  position: static;
  width: 100%;
  max-width: 500px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

/* 純 F5～F12 快捷鍵網格（直式 2×4 滿寬；橫式 1×8 置中單排） */
html.wp-mobile #m-hot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
  width: 100%;
  pointer-events: auto;
}
html.wp-mobile.orient-landscape #m-hot-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  max-width: 444px;
  flex: 1;
  min-width: 0;
}
html.wp-mobile .m-hk {
  position: relative;
  box-sizing: border-box;
  height: 50px;
  min-width: 0;
  border-radius: 9px;
  border: 1.5px solid rgba(212, 170, 82, 0.56);
  background: radial-gradient(circle at 50% 24%, rgba(34, 41, 68, 0.92), #111424 62%, #090b15 100%);
  color: #f5efe2;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 236, 184, 0.25), inset 0 0 0 2px rgba(8, 10, 20, 0.85), 0 3px 8px rgba(0, 0, 0, 0.65);
  transition: transform 0.08s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}
@media (min-width: 600px) {
  html.wp-mobile.orient-portrait #m-hot-grid {
    gap: 8px;
  }
  html.wp-mobile.orient-portrait .m-hk {
    height: 58px;
  }
}
html.wp-mobile.orient-landscape .m-hk {
  height: 46px;
}
html.wp-mobile .m-hk::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 6px;
  border: 1px solid rgba(212, 170, 82, 0.18);
  pointer-events: none;
}
html.wp-mobile .m-hk.pressing {
  transform: scale(0.93);
  border-color: #ffe39e;
  box-shadow: 0 0 14px rgba(253, 222, 157, 0.68);
}
html.wp-mobile .m-hk.drag-out {
  transform: scale(0.95);
  border-color: #ff6b6b !important;
  background: radial-gradient(circle at 50% 30%, rgba(100, 33, 43, 0.94), #3e121a 70%, #280b10 100%) !important;
  box-shadow: 0 0 16px rgba(255, 107, 107, 0.78) !important;
}
html.wp-mobile .m-hk.empty {
  border-color: rgba(212, 170, 82, 0.28);
  background: rgba(10, 12, 22, 0.62);
}
html.wp-mobile.orient-landscape .m-hk.empty {
  background: rgba(10, 12, 22, 0.52);
  border-color: rgba(212, 170, 82, 0.24);
}
html.wp-mobile .m-hk.gone { opacity: 0.42; filter: grayscale(0.8); }
html.wp-mobile .m-hk.bl { border-color: #ffe066; box-shadow: inset 0 0 10px rgba(255, 224, 102, 0.3); }
html.wp-mobile .m-hk img,
html.wp-mobile .m-hk .mk-spi {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: center/contain no-repeat;
  pointer-events: none;
}
html.wp-mobile .m-hk .mk-lb {
  position: absolute;
  left: 4px;
  top: 2px;
  font-size: 9.5px;
  font-weight: 700;
  color: #dfc07d;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
html.wp-mobile .m-hk .mk-cnt {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}
html.wp-mobile .m-hk .mk-cd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: rgba(6, 8, 16, 0.68);
  color: #ffe39e;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* 拖曳移除浮動提示標籤 */
html.wp-mobile #m-hk-drag-ghost {
  position: fixed;
  transform: translate(-50%, -100%);
  z-index: 990;
  pointer-events: none;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1.5px solid #ff9e9e;
  background: linear-gradient(180deg, #64212b, #3e121a);
  color: #fff5f5;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
}
html.wp-mobile #m-hk-drag-ghost.hidden { display: none !important; }

/* 鍛金立體圓形動作鈕群：直式在快捷列上方右側；橫式在右下角（100% 圓形 + 哥德鍛金立體感） */
html.wp-mobile #m-act-col {
  position: absolute;
  right: 8px;
  bottom: calc(100% + 32px);
  width: 184px;
  height: 184px;
  pointer-events: none;
  flex-shrink: 0;
}
html.wp-mobile.orient-landscape #m-act-col {
  position: fixed;
  right: calc(var(--m-edge-r, 0px) + 6px);
  bottom: calc(var(--m-edge-b, 0px) + 8px);
  width: 170px;
  height: 174px;
}
html.wp-mobile .m-act-btn,
html.wp-mobile #m-act-col .g-btn {
  position: absolute;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  padding: 0;
  border: none !important;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 32% 26%, #2c3756 0%, #161d33 48%, #0a0e1b 82%, #05070e 100%) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.82), 0 2px 6px rgba(0, 0, 0, 0.9), inset 0 2px 6px rgba(255, 235, 180, 0.24), inset 0 -8px 16px rgba(0, 0, 0, 0.75) !important;
  color: #f7dfa0 !important;
  font-family: "Times New Roman", "Microsoft JhengHei", serif;
  transition: transform 0.12s ease, box-shadow 0.22s ease, filter 0.2s ease;
}
html.wp-mobile #m-act-col .g-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(155deg, rgba(255, 244, 210, 0.16) 0%, rgba(255, 255, 255, 0.02) 42%, transparent 55%);
  pointer-events: none;
}
html.wp-mobile #m-act-col .g-btn:active { transform: scale(0.94); }
html.wp-mobile #m-act-col .g-btn .g-orn {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  pointer-events: none;
}
html.wp-mobile #m-act-col .g-btn .auto-crest {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  pointer-events: none;
}

/* 圓形撿取鈕 */
html.wp-mobile #m-act-col .g-btn.pick {
  right: 16px;
  bottom: 126px;
  width: 58px;
  height: 58px;
}
html.wp-mobile.orient-landscape #m-act-col .g-btn.pick {
  right: 8px;
  bottom: 118px;
  width: 52px;
  height: 52px;
}
html.wp-mobile #m-act-col .g-btn.pick .btn-ico {
  position: relative;
  z-index: 2;
  width: 19px;
  height: 19px;
  color: #f5d88d;
  filter: drop-shadow(0 1px 2px #000);
}
html.wp-mobile #m-act-col .g-btn.pick .lbl {
  position: relative;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 800;
  color: #f2e2be;
  text-shadow: 0 1px 3px #000;
  margin-top: 1px;
  max-width: 86%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 圓形 PVP 鈕 */
html.wp-mobile #m-act-col .g-btn.pvp {
  right: 124px;
  bottom: 34px;
  width: 58px;
  height: 58px;
}
html.wp-mobile.orient-landscape #m-act-col .g-btn.pvp {
  right: 118px;
  bottom: 16px;
  width: 52px;
  height: 52px;
}
html.wp-mobile #m-act-col .g-btn.pvp .btn-ico {
  position: relative;
  z-index: 2;
  width: 18px;
  height: 18px;
  color: #e8c77b;
  margin-bottom: -1px;
  filter: drop-shadow(0 1px 2px #000);
}
html.wp-mobile #m-act-col .g-btn.pvp .lbl {
  position: relative;
  z-index: 2;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #f6dca0;
  text-shadow: 0 1px 3px #000;
}
html.wp-mobile #m-act-col .g-btn.pvp.on {
  background: radial-gradient(circle at 35% 30%, #8e1c27 0%, #4d0c14 58%, #220408 92%) !important;
  box-shadow: 0 0 24px rgba(255, 58, 72, 0.85), 0 0 44px rgba(220, 20, 40, 0.45), 0 8px 20px rgba(0, 0, 0, 0.85), inset 0 0 18px rgba(255, 110, 110, 0.48) !important;
}
html.wp-mobile #m-act-col .g-btn.pvp.on .btn-ico,
html.wp-mobile #m-act-col .g-btn.pvp.on .lbl {
  color: #ffd8d8 !important;
  filter: drop-shadow(0 0 4px rgba(255, 80, 90, 0.85));
}
html.wp-mobile #m-act-col .g-btn.pvp.on .g-orn {
  animation: spinSlow 14s linear infinite;
  will-change: transform;
}

/* 核心正圓 AUTO（哥德鍛金雙環徽章 + 開啟黃金旋轉光焰） */
html.wp-mobile #m-act-col .g-btn.auto {
  right: 0;
  bottom: 0;
  width: 116px;
  height: 116px;
}
html.wp-mobile.orient-landscape #m-act-col .g-btn.auto {
  width: 108px;
  height: 108px;
  bottom: 4px;
}
html.wp-mobile #m-act-col .g-btn.auto .lbl {
  position: relative;
  z-index: 2;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff8dc 0%, #f5d382 48%, #b9852c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.95));
}
html.wp-mobile #m-act-col .g-btn.auto.on {
  background: radial-gradient(circle at 38% 30%, #74511a 0%, #3b2609 52%, #191005 88%) !important;
  box-shadow: 0 0 28px rgba(255, 196, 74, 0.68), 0 0 56px rgba(255, 156, 36, 0.34), 0 10px 26px rgba(0, 0, 0, 0.82), inset 0 0 22px rgba(255, 212, 110, 0.42) !important;
}
html.wp-mobile #m-act-col .g-btn.auto.on .g-orn {
  animation: spinSlow 14s linear infinite;
  will-change: transform;
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

html.wp-mobile #m-act-col .g-btn.pick.lit {
  background: radial-gradient(circle at 38% 30%, rgba(30, 96, 46, 0.96), rgba(10, 38, 19, 0.98)) !important;
  box-shadow: 0 0 16px rgba(125, 255, 138, 0.62), inset 0 1px 0 rgba(200, 255, 208, 0.35) !important;
}
html.wp-mobile #m-act-col .g-btn.pick.lit .btn-ico,
html.wp-mobile #m-act-col .g-btn.pick.lit .lbl {
  color: #e4ffe6;
}
html.wp-mobile #m-act-col .g-btn.pick #m-pick-cnt {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 4;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: linear-gradient(180deg, #32c852, #1b7e31);
  border: 1.5px solid #e6ffea;
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}
html.wp-mobile #m-act-col .g-btn.pick #m-pick-cnt.hidden { display: none !important; }

/* 底部經驗條 */
html.wp-mobile #m-foot-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
html.wp-mobile.orient-landscape #m-foot-row {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  padding: 0;
  pointer-events: none;
}
html.wp-mobile #m-exp-bar {
  position: relative;
  flex: 1;
  height: 13px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(223, 192, 125, 0.28);
  overflow: hidden;
}
html.wp-mobile.orient-landscape #m-exp-bar {
  height: 4px;
  border-radius: 0;
  border: 0;
}
html.wp-mobile #m-exp-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #b8882e, #ffdf80); }
html.wp-mobile #m-exp-bar span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
html.wp-mobile.orient-landscape #m-exp-bar span { display: none; }

@media (max-width: 780px) {
  html.wp-mobile.orient-landscape #m-minimap {
    width: 96px;
    height: 68px;
  }
}

/* ---------- 6. 聊天視窗關閉鈕 ---------- */
html.wp-mobile #m-chat-x {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(223, 192, 125, 0.45);
  background: linear-gradient(180deg, #252b3f, #131726);
  color: #f5efe2;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- 7. 手機聊天抽屜 (#m-chatbox，獨立掛 body，實底不透殘影＋頻道過濾) ---------- */
html.wp-mobile #m-chatbox {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 8px);
  right: calc(env(safe-area-inset-right, 0px) + 8px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  max-width: 520px;
  margin: 0 auto;
  height: min(310px, 56dvh);
  background: rgba(11, 13, 25, 0.985);
  border: 1px solid #dfc07d;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(223, 192, 125, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 760;
  pointer-events: auto;
  overflow: hidden;
  font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
  color: #f5efe2;
}
html.wp-mobile #m-chatbox.hidden { display: none !important; }
html.wp-mobile #m-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: linear-gradient(180deg, #1a2036, #111526);
  border-bottom: 1px solid rgba(223, 192, 125, 0.3);
}
html.wp-mobile #m-chat-chs { display: flex; gap: 4px; flex-wrap: wrap; }
html.wp-mobile #m-chat-chs button {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(223, 192, 125, 0.32);
  background: transparent;
  color: #cfc4a8;
  font-size: 11.5px;
  font-weight: 700;
}
html.wp-mobile #m-chat-chs button.on { background: rgba(223, 192, 125, 0.24); border-color: #fdde9d; color: #fdde9d; }
html.wp-mobile #m-chat-log {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.48;
  touch-action: pan-y;
}
html.wp-mobile #m-chat-log .c-alert { color: #ffcf5c !important; font-weight: 700; }
html.wp-mobile #m-chat-log[data-flt="global"] > div:not(.c-global):not(.c-shout):not(.c-sys):not(.c-announce):not(.c-alert) { display: none; }
html.wp-mobile #m-chat-log[data-flt="clan"] > div:not(.c-clan):not(.c-sys):not(.c-announce):not(.c-alert) { display: none; }
html.wp-mobile #m-chat-log[data-flt="party"] > div:not(.c-party):not(.c-sys):not(.c-announce):not(.c-alert) { display: none; }
html.wp-mobile #m-chat-log[data-flt="whisper"] > div:not(.c-whisper):not(.c-sys):not(.c-announce):not(.c-alert) { display: none; }
html.wp-mobile #m-chat-form {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid rgba(223, 192, 125, 0.25);
  background: #080a14;
}
html.wp-mobile #m-chat-to {
  width: 86px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid rgba(223, 192, 125, 0.44);
  background: #0d101e;
  color: #ff8ae0;
  font-size: 16px;
  padding: 0 6px;
  -webkit-user-select: text;
  user-select: text;
}
html.wp-mobile #m-chat-in {
  flex: 1;
  min-width: 0;
  height: 38px;
  border-radius: 6px;
  border: 1px solid rgba(223, 192, 125, 0.45);
  background: #0d101e;
  color: #f5efe2;
  font-size: 16px;
  padding: 0 10px;
  -webkit-user-select: text;
  user-select: text;
}
html.wp-mobile #m-chat-send {
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid #fdde9d;
  background: linear-gradient(180deg, #c7a45b, #7a581d);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* 準心施法頂部狀態條 */
html.wp-mobile #m-aim-bar {
  position: fixed;
  box-sizing: border-box;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(18, 22, 38, 0.96);
  border: 1.5px solid #fdde9d;
  color: #fff4cf;
  font-size: 13px;
  font-weight: 700;
  z-index: 790;
  pointer-events: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  max-width: 92vw;
}
html.wp-mobile #m-aim-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 679px) {
  html.wp-mobile.orient-portrait #m-aim-bar {
    top: auto;
    bottom: calc(min(env(safe-area-inset-bottom, 0px), 10px) - var(--m-vh-extra, 0px) + 305px);
    left: calc(env(safe-area-inset-left, 0px) + 8px);
    transform: none;
    max-width: calc(100vw - 208px);
    padding: 4px 8px;
    gap: 6px;
    font-size: 11.5px;
  }
  html.wp-mobile.orient-portrait #m-aim-no {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }
}
@media (min-width: 600px) and (max-width: 679px) {
  html.wp-mobile.orient-portrait #m-aim-bar {
    bottom: calc(min(env(safe-area-inset-bottom, 0px), 10px) - var(--m-vh-extra, 0px) + 321px);
  }
}
@media (min-width: 680px) {
  html.wp-mobile.orient-portrait #m-aim-bar {
    max-width: min(320px, calc(100vw - 464px));
  }
  html.wp-mobile.orient-portrait.has-target #m-aim-bar {
    top: calc(env(safe-area-inset-top, 0px) + 52px);
  }
}
html.wp-mobile.orient-landscape #m-aim-bar {
  max-width: min(260px, calc(100vw - 442px));
}
html.wp-mobile.orient-landscape.has-target #m-aim-bar {
  top: calc(env(safe-area-inset-top, 0px) + 48px);
}
html.wp-mobile.orient-landscape.has-petctl #m-aim-bar {
  top: calc(env(safe-area-inset-top, 0px) + 46px);
}
html.wp-mobile.orient-landscape.has-petctl.has-target #m-aim-bar {
  top: calc(env(safe-area-inset-top, 0px) + 88px);
}
html.wp-mobile #m-aim-bar.hidden { display: none !important; }
html.wp-mobile #m-aim-no {
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid #fdde9d;
  background: linear-gradient(180deg, #b88b37, #7a581d);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* ---------- 8. 真省電防誤觸鎖屏 (#m-powersave，獨立掛 body z=950) ---------- */
html.wp-mobile #m-powersave {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 8, 0.97);
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: auto;
  color: #dfc07d;
  text-align: center;
  padding: 24px;
  font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
}
html.wp-mobile #m-powersave.hidden { display: none !important; }
html.wp-mobile #m-ps-clock { font-size: 40px; font-weight: 800; letter-spacing: 2px; color: #fdde9d; }
html.wp-mobile #m-ps-stat { font-size: 14px; color: #d8d0be; line-height: 1.7; }
html.wp-mobile #m-ps-unlock {
  margin-top: 12px;
  height: 48px;
  padding: 0 28px;
  border-radius: 24px;
  border: 1.5px solid #fdde9d;
  background: rgba(34, 28, 16, 0.9);
  color: #fdde9d;
  font-size: 15px;
  font-weight: 700;
}

/* ---------- 9. 既有全部視窗在手機上統一抽屜／全螢幕化 ---------- */
html.wp-mobile body.gv5 #ui #ui-in > .win:not(.hidden),
html.wp-mobile body.gv5 #ui #ui-in > #win-skill:not(.hidden),
html.wp-mobile body.gv5 #ui #ui-in > #win-map:not(.hidden),
html.wp-mobile body #ui #ui-in > .win:not(.hidden),
html.wp-mobile body #ui #ui-in > #npc:not(.hidden) {
  position: fixed !important;
  left: calc(env(safe-area-inset-left, 0px) + 8px) !important;
  right: calc(env(safe-area-inset-right, 0px) + 8px) !important;
  top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 680 !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  pointer-events: auto !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.88) !important;
  box-sizing: border-box !important;
}
html.wp-mobile body.gv5 #ui #ui-in > .win.hidden,
html.wp-mobile body.gv5 #ui #ui-in > #win-skill.hidden,
html.wp-mobile body.gv5 #ui #ui-in > #win-map.hidden,
html.wp-mobile body.gv5 #ui #ui-in > #win-auto.hidden,
html.wp-mobile body #ui #ui-in > .win.hidden,
html.wp-mobile body #ui #ui-in > #npc.hidden {
  display: none !important;
}
/* NPC 對話框在直式改自適應置中彈窗，不留 70% 死黑空區 */
html.wp-mobile.orient-portrait body #ui #ui-in > #npc {
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  height: auto !important;
  max-height: 78dvh !important;
}
html.wp-mobile body #ui #ui-in > .win .wh,
html.wp-mobile body #ui #ui-in > #npc #npc-head {
  min-height: 46px !important;
  height: auto !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
  color: #fdde9d !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 6px 10px 6px 14px !important;
  flex-shrink: 0 !important;
  cursor: default !important;
}
html.wp-mobile body #ui #ui-in > .win .wh .m-wh-t,
html.wp-mobile body #ui #ui-in > #npc #npc-title {
  flex: 1 !important;
  color: #fdde9d !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 1.5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
html.wp-mobile body #ui #ui-in > .win .wx,
html.wp-mobile body #ui #ui-in > .win .wx2,
html.wp-mobile body #ui #ui-in > #npc #npc-x {
  position: static !important;
  margin-left: auto !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  font-size: 18px !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
}
html.wp-mobile .win .wb,
html.wp-mobile #npc-body,
html.wp-mobile #menu-grid {
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  max-height: none !important;
}

/* 選單頂部三大貨幣條 ＋ 手機快捷條（視野／省電／直式搖桿）＋ 隱藏 PC 鍵盤熱鍵標籤 */
html.wp-mobile #m-menu-quick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 4px;
  flex-shrink: 0;
}
html.wp-mobile #m-menu-curs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
html.wp-mobile #m-menu-curs span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 6px;
  border-radius: 8px;
  background: rgba(8, 10, 18, 0.85);
  border: 1px solid rgba(223, 192, 125, 0.28);
  font-size: 12px;
  color: #ffe39e;
  font-variant-numeric: tabular-nums;
}
html.wp-mobile #m-menu-curs img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}
html.wp-mobile #m-menu-curs small {
  color: #b8ae94;
  font-size: 11px;
}
html.wp-mobile #m-menu-qbtns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
html.wp-mobile #m-menu-quick button {
  flex: 1;
  min-height: 38px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(223, 192, 125, 0.45);
  background: linear-gradient(180deg, #1d243b, #111526);
  color: #f5e6c4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
html.wp-mobile #m-menu-quick button.on {
  border-color: #fdde9d;
  background: linear-gradient(180deg, #7d5f25, #473513);
  color: #fff6dc;
}
html.wp-mobile #menu-grid kbd,
html.wp-mobile #menu-grid .hk-cap {
  display: none !important;
}

/* 背包＆魔法（修復橫式背包直柱破版＋加入強化／回收憑證選目標醒目橫幅） */
html.wp-mobile #m-pick-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid #ff9b7a;
  background: linear-gradient(90deg, rgba(132, 34, 24, 0.94), rgba(74, 22, 18, 0.94));
  color: #fff2db;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
}
html.wp-mobile #m-pick-banner button {
  min-height: 30px !important;
  padding: 0 10px !important;
  border-radius: 6px !important;
  border: 1px solid #ffd5a6 !important;
  background: rgba(16, 18, 28, 0.85) !important;
  color: #ffe3b8 !important;
  font-size: 12px !important;
  flex-shrink: 0;
}
html.wp-mobile #win-inv .wb.inv,
html.wp-mobile #win-skill .wb.sk {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
}
html.wp-mobile.orient-landscape #win-inv .wb.inv,
html.wp-mobile.orient-landscape #win-skill .wb.sk {
  flex-direction: row !important;
}
html.wp-mobile body #ui #ui-in #win-inv .wb.inv .il,
html.wp-mobile body #ui #ui-in #win-skill .wb.sk .il {
  flex: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
html.wp-mobile #inv-tabs,
html.wp-mobile #sk-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
  overflow-x: auto !important;
  flex-shrink: 0 !important;
}
html.wp-mobile body #ui #ui-in #win-inv #inv-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  grid-auto-rows: max-content !important;
  row-gap: 7px !important;
  column-gap: 7px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  flex: 1 !important;
  overflow-y: auto !important;
  touch-action: pan-y !important;
  align-content: start !important;
  padding: 2px !important;
  box-sizing: border-box !important;
}
html.wp-mobile.orient-landscape body #ui #ui-in #win-inv #inv-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}
html.wp-mobile body #ui #ui-in #win-inv #inv-grid .is {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1 !important;
  background-size: 100% 100% !important;
  border-radius: 8px !important;
}
html.wp-mobile #inv-grid .is img { width: 72% !important; height: 72% !important; object-fit: contain !important; }
html.wp-mobile #inv-grid .is.sel { outline: 2px solid #fdde9d !important; box-shadow: 0 0 10px rgba(253, 222, 157, 0.55) !important; }
html.wp-mobile #sk-rows { flex: 1 !important; overflow-y: auto !important; touch-action: pan-y !important; padding-right: 2px !important; }
html.wp-mobile #sk-rows .skrow { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; margin-bottom: 10px !important; }
html.wp-mobile #sk-rows .skc { min-width: 68px !important; min-height: 66px !important; padding: 6px 4px !important; border-radius: 8px !important; }
html.wp-mobile body #ui #ui-in #win-inv .det,
html.wp-mobile body #ui #ui-in #win-skill .det,
html.wp-mobile body #ui #ui-in #inv-detail,
html.wp-mobile body #ui #ui-in #sk-detail {
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 128px !important;
  max-height: 42dvh !important;
  overflow-y: auto !important;
  touch-action: pan-y !important;
  border-top: 1px solid rgba(223, 192, 125, 0.35) !important;
  border-left: 0 !important;
  padding: 10px !important;
  background: rgba(8, 10, 20, 0.78) !important;
  border-radius: 8px !important;
}
html.wp-mobile.orient-landscape body #ui #ui-in #win-inv .det,
html.wp-mobile.orient-landscape body #ui #ui-in #win-skill .det,
html.wp-mobile.orient-landscape body #ui #ui-in #inv-detail,
html.wp-mobile.orient-landscape body #ui #ui-in #sk-detail {
  width: min(295px, 38vw) !important;
  max-width: min(295px, 38vw) !important;
  flex: 0 0 min(295px, 38vw) !important;
  max-height: none !important;
  border-top: 0 !important;
  border-left: 1px solid rgba(223, 192, 125, 0.35) !important;
}
html.wp-mobile body #ui #ui-in #inv-detail .dbtn {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 8px !important;
}
html.wp-mobile body #ui #ui-in #sk-detail .dbtn {
  display: flex !important;
  gap: 8px !important;
  margin-top: 8px !important;
}
html.wp-mobile body #ui #ui-in #inv-detail .dbtn button,
html.wp-mobile body #ui #ui-in #sk-detail .dbtn button {
  flex: 1 !important;
  width: 100% !important;
  min-height: 42px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}
html.wp-mobile .hkpick {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-top: 8px !important;
}
html.wp-mobile .hkpick .hl2 {
  grid-column: 1 / -1 !important;
  font-size: 12px !important;
  color: #dfc07d !important;
}
html.wp-mobile .hkpick button {
  min-width: 0 !important;
  min-height: 36px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}
html.wp-mobile #inv-detail button,
html.wp-mobile #sk-detail button,
html.wp-mobile .tabs button,
html.wp-mobile #win-auto button,
html.wp-mobile #win-shop button {
  min-height: 38px !important;
  font-size: 13px !important;
  padding: 5px 11px !important;
}

/* 角色視窗 #win-char（修復直式重疊截字 ＋ 橫式裝備飄離剪影） */
html.wp-mobile #win-char #ch-body {
  padding: 10px !important;
}
html.wp-mobile.orient-portrait #win-char .ch-wrap {
  display: flex !important;
  flex-direction: column-reverse !important;
  align-items: stretch !important;
  gap: 12px !important;
}
html.wp-mobile.orient-portrait #win-char .ch-left {
  width: 100% !important;
  flex: none !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px 10px !important;
}
html.wp-mobile.orient-portrait #win-char .ch-right {
  width: 100% !important;
  flex: none !important;
  display: flex !important;
  justify-content: center !important;
}
html.wp-mobile.orient-portrait #win-char .ch-doll {
  width: 300px !important;
  max-width: 100% !important;
  min-height: 390px !important;
  flex: none !important;
}
html.wp-mobile.orient-landscape #win-char .ch-wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 14px !important;
}
html.wp-mobile.orient-landscape #win-char .ch-left {
  flex: 1 !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px 10px !important;
}
html.wp-mobile.orient-landscape #win-char .ch-doll {
  flex: 0 0 290px !important;
  width: 290px !important;
  max-width: 290px !important;
}

/* 商店與個人商店擺攤設定（修復直式擺攤 421px 爆框與 13px 招牌字） */
html.wp-mobile #shop-body { padding: 10px !important; }
html.wp-mobile #shop-body input.ps-sign {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 40px !important;
  font-size: 16px !important;
  -webkit-user-select: text !important;
  user-select: text !important;
}
html.wp-mobile #shop-body input[type=checkbox] {
  width: 22px !important;
  height: 22px !important;
}
html.wp-mobile.orient-portrait #shop-body table.ps-tbl,
html.wp-mobile.orient-portrait #shop-body table.ps-tbl tbody {
  display: block !important;
  width: 100% !important;
}
html.wp-mobile.orient-portrait #shop-body table.ps-tbl thead { display: none !important; }
html.wp-mobile.orient-portrait #shop-body table.ps-tbl tr {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px !important;
  margin-bottom: 8px !important;
  border-radius: 8px !important;
  background: rgba(18, 22, 38, 0.85) !important;
  border: 1px solid rgba(223, 192, 125, 0.28) !important;
}
html.wp-mobile.orient-portrait #shop-body table.ps-tbl td {
  border: 0 !important;
  padding: 0 !important;
}
html.wp-mobile.orient-portrait #shop-body table.ps-tbl td.nm {
  flex: 1 1 60% !important;
  white-space: normal !important;
  font-size: 13px !important;
}
html.wp-mobile .num-w { display: inline-flex !important; align-items: center !important; gap: 4px !important; }
html.wp-mobile .num-w .num-b { width: 34px !important; height: 34px !important; min-width: 34px !important; font-size: 16px !important; border-radius: 6px !important; }
html.wp-mobile .num-w input,
html.wp-mobile #win-auto input[type=number],
html.wp-mobile #win-shop input[type=number] {
  min-height: 34px !important;
  font-size: 16px !important;
  text-align: center !important;
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* 選單網格加大好點（16 項對齊 4×4／橫向 8×2 零落單） */
html.wp-mobile #menu-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding: 10px 10px 14px !important;
  align-content: start !important;
}
html.wp-mobile.orient-landscape #menu-grid { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; gap: 7px !important; }
html.wp-mobile #menu-grid button { min-height: 70px !important; font-size: 12px !important; border-radius: 10px !important; }

/* 內掛視窗（P0 修復 .pkl 下拉選單 z=920 ＋ 直式頁籤「○」不腰斬＋單欄卡片） */
html.wp-mobile .pkl {
  z-index: 920 !important;
  max-width: 92vw !important;
  max-height: 55dvh !important;
  overflow-y: auto !important;
  touch-action: pan-y !important;
}
html.wp-mobile .pkl .pki {
  min-height: 40px !important;
  font-size: 14px !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto:not(.hidden),
html.wp-mobile body.gv5 #ui #ui-in #win-auto:not(.dragged):not(.hidden),
html.wp-mobile body #ui #ui-in > #win-auto:not(.hidden) {
  position: fixed !important;
  left: calc(env(safe-area-inset-left, 0px) + 8px) !important;
  right: calc(env(safe-area-inset-right, 0px) + 8px) !important;
  top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  box-sizing: border-box !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto .wb.au,
html.wp-mobile #win-auto .wb.au {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 10px !important;
  overflow: hidden !important;
  flex: 1 !important;
}
html.wp-mobile.orient-landscape body.gv5 #ui #ui-in #win-auto .wb.au,
html.wp-mobile.orient-landscape #win-auto .wb.au {
  flex-direction: row !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto #au-tabs,
html.wp-mobile body #ui #ui-in #au-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  height: auto !important;
  flex-shrink: 0 !important;
  padding: 2px 0 4px !important;
  scrollbar-width: none !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto #au-tabs::-webkit-scrollbar { display: none !important; }
html.wp-mobile.orient-portrait body.gv5 #ui #ui-in #win-auto #au-tabs .au-state,
html.wp-mobile.orient-portrait body.gv5 #ui #ui-in #win-auto #au-tabs .au-hang {
  margin-top: 0 !important;
  white-space: nowrap !important;
  padding: 3px 8px !important;
  font-size: 11.5px !important;
}
html.wp-mobile.orient-landscape body.gv5 #ui #ui-in #win-auto #au-tabs,
html.wp-mobile.orient-landscape body #ui #ui-in #au-tabs {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 118px !important;
  overflow-y: auto !important;
  touch-action: pan-y !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto #au-tabs button,
html.wp-mobile body #ui #ui-in #au-tabs button {
  flex: 0 0 auto !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  font-size: 13px !important;
}
html.wp-mobile.orient-portrait body.gv5 #ui #ui-in #win-auto #au-body,
html.wp-mobile.orient-portrait body #ui #ui-in #au-body {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}
html.wp-mobile.orient-portrait body.gv5 #ui #ui-in #win-auto #au-body .card,
html.wp-mobile.orient-portrait body #ui #ui-in #au-body .card {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 12px !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto .aur,
html.wp-mobile #win-auto .aur {
  flex: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: hidden !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto #au-body,
html.wp-mobile #au-body {
  flex: 1 !important;
  overflow-y: auto !important;
  touch-action: pan-y !important;
  padding-right: 4px !important;
}
html.wp-mobile body.gv5 #ui #ui-in #win-auto #au-start,
html.wp-mobile body #ui #ui-in #au-start {
  height: 46px !important;
  min-height: 46px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 9px !important;
  flex-shrink: 0 !important;
}

/* NPC 對話框選項卡片 */
html.wp-mobile #npc-body { padding: 14px 16px !important; font-size: 15px !important; line-height: 1.8 !important; color: #efe7d4 !important; }
html.wp-mobile #npc-body a.npc-a {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 38px !important;
  padding: 6px 14px !important;
  margin: 5px 6px 5px 0 !important;
  border-radius: 8px !important;
  border: 1px solid rgba(223, 192, 125, 0.45) !important;
  background: linear-gradient(180deg, rgba(28, 36, 62, 0.92), rgba(16, 20, 36, 0.95)) !important;
  color: #ffe39e !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45) !important;
}
html.wp-mobile #npc-body a.npc-a:active { transform: scale(0.96); border-color: #fff0c2 !important; background: rgba(68, 52, 24, 0.95) !important; }

/* 設定視窗與大地圖（含三選一香檳金高亮＋橫式大地圖不裁切） */
html.wp-mobile #set-body { padding: 10px 12px !important; }
html.wp-mobile #set-body .setsec summary { min-height: 42px !important; display: flex !important; align-items: center !important; font-size: 15px !important; }
html.wp-mobile #set-body .setrow { min-height: 44px !important; font-size: 14px !important; }
html.wp-mobile #set-body .seg button.on {
  background: linear-gradient(180deg, #c7a45b, #7d5c22) !important;
  border-color: #fdde9d !important;
  color: #fffaf0 !important;
  font-weight: 800 !important;
}
html.wp-mobile #win-map #map-big {
  width: 100% !important;
  height: auto !important;
  max-height: calc(100dvh - 116px) !important;
  object-fit: contain !important;
}

/* ---------- 10. 變身卷軸 / 記憶傳送 / 公告 / 選角 / 創角 ---------- */
/* P0 修復：變身清單與祝瞬記憶座標窗手機全螢幕抽屜化，橫式絕不飛出頂端 */
html.wp-mobile #yn-box.poly-box,
html.wp-mobile #yn-box.bm-box {
  position: fixed !important;
  left: calc(env(safe-area-inset-left, 0px) + 8px) !important;
  right: calc(env(safe-area-inset-right, 0px) + 8px) !important;
  top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  z-index: 860 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}
html.wp-mobile #yn-box.poly-box .poly-head {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}
html.wp-mobile #yn-box.poly-box .poly-title { flex: 1 !important; }
html.wp-mobile #yn-box.poly-box .poly-close {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(223, 192, 125, 0.55) !important;
  background: linear-gradient(180deg, #252b3f, #131726) !important;
  color: #f5efe2 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  cursor: pointer;
}
html.wp-mobile #yn-box.poly-box .poly-body-all,
html.wp-mobile #yn-box.bm-box .bm-list {
  flex: 1 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  touch-action: pan-y !important;
}
html.wp-mobile #yn-box.poly-box .poly-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
html.wp-mobile.orient-landscape #yn-box.poly-box .poly-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
html.wp-mobile #yn-box.poly-box .poly-spr {
  width: 68px !important;
  height: 68px !important;
  object-fit: contain !important;
}

html.wp-mobile #scr-news {
  -webkit-mask-image: none !important;
  mask-image: none !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
}
html.wp-mobile #scr-news .bg { width: 100% !important; height: 100% !important; object-fit: cover !important; }
html.wp-mobile #scr-news #news-box {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(366px, 92vw) !important;
  height: min(460px, 76dvh) !important;
  box-sizing: border-box !important;
  padding: 14px 16px !important;
  border-radius: 12px !important;
  z-index: 20 !important;
}
html.wp-mobile #scr-news #news-text { font-size: 14px !important; line-height: 1.65 !important; touch-action: pan-y !important; }
html.wp-mobile #scr-news #btn-news-ok { width: 100% !important; height: 46px !important; font-size: 16px !important; line-height: 44px !important; border-radius: 8px !important; }

/* 選角底部大按鈕列（含精簡數值摘要） */
html.wp-mobile #m-sel-bar {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 900;
  pointer-events: auto;
}
html.wp-mobile #m-sel-bar.hidden { display: none !important; }
html.wp-mobile #m-sel-summary {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #f3dca0;
  background: rgba(11, 13, 25, 0.86);
  border: 1px solid rgba(223, 192, 125, 0.36);
  border-radius: 8px;
  padding: 4px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.wp-mobile #m-sel-btns { display: flex; gap: 8px; }
html.wp-mobile #m-sel-bar button {
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(223, 192, 125, 0.55);
  background: rgba(16, 20, 36, 0.94);
  color: #f5efe2;
  font-size: 14px;
  font-weight: 800;
  padding: 0 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
}
html.wp-mobile #m-sel-bar button.primary {
  flex: 1.6;
  border-color: #fdde9d;
  background: linear-gradient(180deg, #c6963d, #7f5a1b);
  color: #fffaf0;
  font-size: 16px;
}
html.wp-mobile #m-sel-bar button.danger { border-color: rgba(255, 110, 110, 0.55); color: #ff9c9c; }

/* 創角輔助列 */
html.wp-mobile #m-cc-bar {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 8px);
  right: calc(env(safe-area-inset-right, 0px) + 8px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(11, 13, 25, 0.95);
  border: 1px solid rgba(223, 192, 125, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 910;
  pointer-events: auto;
}
html.wp-mobile #m-cc-bar.hidden { display: none !important; }
html.wp-mobile #m-cc-name {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(223, 192, 125, 0.55);
  background: #0a0d1a;
  color: #f5efe2;
  font-size: 16px;
  padding: 0 10px;
  -webkit-user-select: text;
  user-select: text;
}
html.wp-mobile #m-cc-ok,
html.wp-mobile #m-cc-no { height: 40px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 800; white-space: nowrap; }
html.wp-mobile #m-cc-ok { border: 1px solid #fdde9d; background: linear-gradient(180deg, #c6963d, #7f5a1b); color: #fff; }
html.wp-mobile #m-cc-no { border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(28, 32, 48, 0.92); color: #ddd; }

/* 斷線重連提示卡 */
html.wp-mobile #m-reconn {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 16, 0.84);
  z-index: 960;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
}
html.wp-mobile #m-reconn.hidden { display: none !important; }
html.wp-mobile #m-reconn .mr-card {
  width: min(320px, 88vw);
  background: rgba(16, 20, 36, 0.98);
  border: 1.5px solid #dfc07d;
  border-radius: 14px;
  padding: 20px 18px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
}
html.wp-mobile #m-reconn h3 { margin: 0 0 8px; color: #fdde9d; font-size: 18px; }
html.wp-mobile #m-reconn p { margin: 0 0 16px; color: #d4cbb8; font-size: 13px; line-height: 1.5; }
html.wp-mobile #m-reconn button {
  width: 100%;
  height: 46px;
  border-radius: 9px;
  border: 1px solid #fdde9d;
  background: linear-gradient(180deg, #c6963d, #7f5a1b);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

/* 互動選單、確認框、驗證碼與 Toast（#toast 已移至 body z=980，置於底部控制區上方絕不壓頂部！） */
html.wp-mobile #u-ctx {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(270px, 84vw) !important;
  z-index: 880 !important;
  padding: 12px !important;
  border-radius: 12px !important;
  pointer-events: auto !important;
}
html.wp-mobile #u-ctx button { min-height: 42px !important; font-size: 14px !important; padding: 6px 12px !important; }
html.wp-mobile #u-ctx .cg { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 6px !important; }
html.wp-mobile #yn-box,
html.wp-mobile #u-dead,
html.wp-mobile #u-confirm,
html.wp-mobile #u-captcha {
  z-index: 890 !important;
  pointer-events: auto !important;
}
html.wp-mobile.orient-landscape #u-captcha {
  align-items: flex-start !important;
  padding-top: 10px !important;
  overflow-y: auto !important;
}
html.wp-mobile #yn-box .yn-r button,
html.wp-mobile #u-confirm button,
html.wp-mobile #u-dead button,
html.wp-mobile #u-captcha button { min-height: 42px !important; font-size: 15px !important; }
html.wp-mobile #yn-box input,
html.wp-mobile #u-cap-in {
  font-size: 16px !important;
  min-height: 40px !important;
  -webkit-user-select: text !important;
  user-select: text !important;
}
html.wp-mobile body.gv5 #toast,
html.wp-mobile body > #toast,
html.wp-mobile body #toast {
  position: fixed !important;
  top: auto !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 307px) !important;
  left: calc(env(safe-area-inset-left, 0px) + 8px) !important;
  right: auto !important;
  transform: none !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-width: min(170px, calc(100vw - 204px)) !important;
  padding: 4px 10px !important;
  border-radius: 10px !important;
  z-index: 980 !important;
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  word-break: break-word !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
}
@media (min-width: 520px) {
  html.wp-mobile.orient-portrait body.gv5 #toast,
  html.wp-mobile.orient-portrait body > #toast,
  html.wp-mobile.orient-portrait body #toast {
    max-width: min(340px, calc(100vw - 214px)) !important;
  }
}
@media (min-width: 600px) {
  html.wp-mobile.orient-portrait body.gv5 #toast,
  html.wp-mobile.orient-portrait body > #toast,
  html.wp-mobile.orient-portrait body #toast {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 323px) !important;
  }
}
@media (max-width: 679px) {
  html.wp-mobile.orient-portrait.has-aim body.gv5 #toast,
  html.wp-mobile.orient-portrait.has-aim body > #toast,
  html.wp-mobile.orient-portrait.has-aim body #toast {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 344px) !important;
  }
}
@media (min-width: 600px) and (max-width: 679px) {
  html.wp-mobile.orient-portrait.has-aim body.gv5 #toast,
  html.wp-mobile.orient-portrait.has-aim body > #toast,
  html.wp-mobile.orient-portrait.has-aim body #toast {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 360px) !important;
  }
}
html.wp-mobile.orient-landscape body.gv5 #toast,
html.wp-mobile.orient-landscape body > #toast,
html.wp-mobile.orient-landscape body #toast {
  top: calc(env(safe-area-inset-top, 0px) + 182px) !important;
  bottom: auto !important;
  left: calc(var(--m-edge-l, 0px) + 230px) !important;
  right: calc(var(--m-edge-r, 0px) + 174px) !important;
  width: fit-content !important;
  max-width: min(320px, calc(100vw - 404px)) !important;
  margin: 0 auto !important;
  transform: none !important;
}
