/* =====================================================================
 * lineage-next — mobile.css(手機直向 360~430px 優先,並含橫向 landscape)
 * 只在 @media(max-width:932px) 內生效;真桌機(≥933px)零影響。
 * 註:breakpoint 由 820→932,是為了涵蓋橫向手機(CSS 寬 844~932,如 iPhone landscape),
 *     否則橫向時會落回桌機版,頁首鈕擠成直排、標題斷行(實測 830px 破版)。
 * 注意:本檔在 index.html 內嵌 <style> 與各 JS 注入 <style> 之前載入,
 *       覆蓋既有屬性一律加 !important(後載者同權重會贏,靠 !important 反制)。
 * ===================================================================== */
@media (max-width: 932px) {

  /* ---------- 0. 通用:防水平捲軸 / 點擊區 / 防 iOS 聚焦放大 ---------- */
  body { overflow-x: hidden; }                    /* 只鎖 body 層;fixed 全螢幕場景(#hub/#rt/#cs-mask)不受影響 */
  #wrap { padding: 8px !important; }

  /* 所有可打字控件 font-size ≥16px:iOS Safari 聚焦 <16px 會整頁放大(本專案前科,務必保留) */
  input:not([type=checkbox]):not([type=radio]),
  select, textarea { font-size: 16px !important; }

  /* 最小點擊高度 40px(勾選框除外,否則 15px 的 checkbox 會被撐爆) */
  button,
  select,
  input:not([type=checkbox]):not([type=radio]) { min-height: 40px; }
  /* 例外:面板內的小型內嵌鈕,40px 會撐壞行高的地方縮回 32px(仍達可點下限) */
  .sub .quick button, .pd-back, .nx-ig-menu button, .wh-btn, .wh-gin, .wh-gout { min-height: 32px; }

  /* ---------- 1. 頁首 header:緊湊化、可換行 ---------- */
  header { flex-wrap: wrap !important; gap: 5px 6px !important; margin-bottom: 6px !important; }
  header h1 { font-size: 16px !important; }
  header .tag { display: none !important; }       /* 「重構原型 · Phase 0」小標手機不顯示 */
  header button { padding: 6px 9px !important; font-size: 12px !important; min-height: 36px; }
  #srv-save-hint { font-size: 12px !important; }
  /* hub.js 動態塞進 header 的「🏰 回主城」鈕 + charselect 的「角色/登出」鈕:手機壓緊,別讓「登出」被擠到多佔一整排 */
  .hub-open, .cs-hdrbtn { margin-left: 0 !important; padding: 5px 8px !important; font-size: 12px !important; min-height: 34px !important; }
  .cs-hdrbtn img, .hub-open img { height: 16px !important; width: 16px !important; }
  /* audio.js 注入的音效控制盒(🎵/🔊+兩支滑桿):手機收窄,少佔寬度→帳號鈕塞得進同一排 */
  #nx-audio-ctl { margin-left: 0 !important; padding: 2px 6px !important; gap: 4px !important; }
  #nx-audio-ctl input[type=range] { width: 38px !important; }

  /* 🎛️ 帳號區三顆鈕(回主城／角色／登出):三顆等寬平分剩餘空間、內容置中、外觀統一。
     原本各自照內容決定寬度(回主城帶圖示最寬),又一起被推到最右邊 →
     左邊留一段空白、三顆大小不一,看起來鬆散。 */
  header .hub-open, header .cs-hdrbtn {
    flex: 1 1 0 !important;          /* 等分剩餘寬度 */
    min-width: 0 !important;         /* 允許縮到比內容窄,才不會把整排撐爆換行 */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 5px 6px !important;
    min-height: 34px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }
  /* 音效盒固定寬度,不跟著三顆鈕一起被拉伸 */
  #nx-audio-ctl { flex: 0 0 auto !important; }
  /* header 的彈性間隔在手機會把按鈕整團推到最右邊 → 收掉,讓上面的 flex:1 自己分配 */
  header .sp { flex: 0 0 0 !important; }

  /* ---------- 2. 頂部狀態列 .topbar:單欄堆疊 ---------- */
  .topbar { grid-template-columns: 1fr !important; padding: 8px 10px !important; gap: 5px !important; margin-bottom: 8px !important; }
  .topbar .hero { font-size: 14px !important; }
  /* 📱 2026-08-25 倍率列改用圖示,避免「經驗×1.2 金幣×1.2 掉落×1.2」擠出第五排 */
  .topbar .rate-lb { display: none !important; }
  .topbar .rate-it { display: inline !important; margin-right: 1px; }
  .topbar .rate-ic { display: none !important; }
  .topbar .srvrate { white-space: nowrap !important; font-size: 12px !important; }
  .topbar .res { grid-column: 1 !important; gap: 4px 10px !important; font-size: 12px !important; }

  /* 頂部 header 手機減負:藏開發標籤 + 跟「更多」抽屜重複的功能鈕(卡丁車/排行/競技場/隊伍/跳跳皆已在更多) */
  header .tag { display: none !important; }
  header #kart-enter, header #lb-enter, header #ar-enter, header #pt-enter, header #mo-enter, header #st-enter { display: none !important; }
  header h1 { font-size: 16px !important; }
  /* 角色列(手機)只留 金幣/鑽石(靈魂)/本服倍率;拿掉攻擊/防禦/爆率/傷害倍率 */
  .topbar .res span[title="攻擊"],
  .topbar .res span[title="防禦"],
  .topbar .res span[title="爆擊率"],
  .topbar .res span.mult { display: none !important; }
  /* (A) 角色列 + 冒險地區:手機改「上下堆疊」(角色卡整寬在上、地區下拉整寬在下)——並排會把角色卡擠成一行一個字 */
  /* 角色列(名稱/等級/金幣)與 地圖下拉 併同一排:topbar 佔左、下拉縮小靠右 */
  .headrow { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 6px !important; margin-bottom: 8px !important; }
  .headrow .topbar { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; margin-bottom: 0 !important; }
  .headrow .zonebar { flex: 1 1 0 !important; width: auto !important; max-width: none !important; min-width: 0 !important; margin-bottom: 0 !important; padding: 5px 7px !important; }   /* 📱 與左側角色框等寬(各佔一半) */
  .headrow .zonebar .lbl { display: none !important; }
  .headrow .zonesel { max-width: 100% !important; min-width: 0 !important; padding: 6px 8px !important; }

  /* ---------- 3. 主畫面 .main:單欄(戰鬥上、面板下,DOM 順序天然正確) ---------- */
  /* ⚠️ 關鍵:用 minmax(0,1fr) 而非裸 1fr。裸 1fr 的最小值=內容 min-content,面板內有寬元件(紙娃娃/背包格)時,
     整條軌道會被撐到 ~650px 超出手機 500px 視窗 → 面板/戰鬥畫面/聊天全部溢出被裁切。minmax(0,1fr)+min-width:0 讓軌道回到視窗寬。 */
  .main { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
  .main > .stage, .main > .panel { min-width: 0 !important; }
  .stage { min-height: 42vh !important; max-height: 46vh !important; }   /* 固定高度戰鬥畫面:夠玩又不會把下方分頁推出畫面外 */
  .stage .herohp { width: 96px !important; bottom: 128px !important; }
  .hero-sprite .hero-img { height: 112px !important; }
  .mobslot .mobsprite { height: 88px !important; }
  .mobslot.boss .mobsprite { height: 118px !important; }
  .mobcard .bar.mob { width: 120px !important; }
  .zonebar { padding: 6px 8px !important; }
  .zonesel { padding: 8px 10px !important; }      /* font-size 已由通用 16px 規則接手 */
  /* 任務列壓成一排:不換行、獎勵不再各自佔整行、藏掉「(擊殺達標…)」子字(有 inline style 可辨識) */
  .questbar { font-size: 12px !important; flex-wrap: nowrap !important; white-space: nowrap; overflow: hidden; align-items: center; padding: 6px 10px !important; gap: 4px 8px !important; }
  .questbar .qr { width: auto !important; }
  .questbar .qr[style] { display: none !important; }

  /* 📢 倍率前的喇叭符號:手機畫面寬度寶貴,拿掉它多兩個字的空間(桌機保留) */
  .srvrate .rate-ic { display: none !important; }

  /* 📜 任務列:按鈕永遠不被裁掉,任務名稱放不下就跑馬燈
     —— 原本整條 overflow:hidden,最右邊的「▶ 前往 / 🎁 領取獎勵」會被切掉點不到。 */
  .questbar .qtext { flex: 1 1 auto !important; min-width: 0 !important; overflow: hidden !important; }
  .questbar .qtin  { display: inline-block; white-space: nowrap; will-change: transform; }
  .questbar .qtext.marq .qtin { animation: nxQMarq var(--qd, 10s) ease-in-out infinite alternate; }
  @keyframes nxQMarq { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(var(--qx, 0)); } }
  /* 按鈕與進度數字:不參與壓縮,寧可讓名稱跑馬燈也不能把按鈕擠掉 */
  .questbar .qgo, .questbar .qstory, .questbar .qclaim, .questbar .qp { flex: 0 0 auto !important; }

  /* 主城工具列(手機):下移到 top:96px,別擋住頂部的傳送下拉(.hub-maps 在 top:12px);桌機維持原位 */
  #hub .hub-tools { top: 96px !important; max-width: 96vw !important; }
  .progress { padding: 6px 10px !important; }
  /* 📱 2026-08-25 進度條:寬度對齊上方的「冒險地區」下拉選單(headrow .zonebar 的 44%),
     並靠右,兩者上下對齊成一直行;任務列維持自己一行。
     ★ 不碰 .headrow 的 flex 設定——它是單行三欄結構,加 wrap 會整個垮掉。 */
  /* 📱 2026-08-25 右上角一欄:地圖選單在上、進度條在下,兩者同寬,
     且與左邊角色框等寬——寬度由 flex 對半決定,不用百分比逼近(gap/padding 會對不齊)。 */
  .headcol { flex: 1 1 0 !important; min-width: 0 !important; display: flex !important; flex-direction: column !important; gap: 6px !important; }
  .headcol .zonebar { flex: none !important; width: 100% !important; max-width: none !important; margin: 0 !important; }
  .headcol .progress { flex: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .headcol .progress .bar.zone { height: 26px !important; }
  .headcol .progress .bar.zone span { font-size: 10px !important; line-height: 26px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; padding: 0 4px !important; }
  /* 任務列在手機自己一行、整行寬 */
  .qrow { display: block !important; }
  .qrow .questbar { width: 100% !important; }

  /* 戰鬥底部常駐聊天:視窗縮小、輸入不被鍵盤擋(在文流內,聚焦時瀏覽器會自動捲入視野) */
  .battlebottom { margin-top: 6px !important; }
  .chatlog { height: 78px !important; margin-bottom: 6px !important; font-size: 12px !important; }
  .chatin { padding: 9px 10px !important; }       /* 16px 由通用規則保證 */
  .chatsend { padding: 0 14px !important; }
  #loot-toasts { bottom: 130px !important; }      /* 掉寶浮訊避開聊天輸入列 */

  /* ---------- 4. 分頁列 .tabs:橫向滑動、不換行、大點擊區、置頂常駐 ---------- */
  /* sticky top:0 → 捲動時分頁列黏在畫面頂端,隨時可切分頁,下方面板在其下捲動 */
  .tabs { position: sticky !important; top: 0; z-index: 30;
          overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; scrollbar-width: none;
          box-shadow: 0 3px 8px rgba(0,0,0,.5); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { flex: 0 0 auto !important; min-height: 40px; padding: 9px 13px !important; white-space: nowrap; font-size: 13px !important; }

  /* 右側面板:手機在下方,別再撐 340px 最小高;明確可垂直捲動、內容不被 clip */
  .panel { min-height: 0 !important; max-height: 62vh !important; padding: 10px !important;
           overflow-y: auto !important; overflow-x: hidden !important;
           -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .panel > .sub:first-child { margin-top: 0 !important; }   /* 首個標題(如「裝備 · 紙娃娃」)別被上緣吃掉 */

  /* ---------- 5. 面板內容模組微調 ---------- */
  /* 收藏(collection-ui):格子改 1/3 寬、字級升到 12px */
  .nxc-cell { width: calc(33.33% - 4px) !important; }
  .nxc-cell.card { width: calc(50% - 3px) !important; }
  .nxc-nm, .nxc-lv, .nxc-meta { font-size: 12px !important; }
  .nxc-book { min-height: 40px; }
  /* 倉庫(hub.js shop-mask 內):左右兩欄改上下堆疊 */
  .wh-cols { flex-direction: column !important; }
  .wh-btn, .wh-gin, .wh-gout { min-height: 40px !important; padding-left: 12px !important; padding-right: 12px !important; }
  .wh-qty, .wh-gv { min-height: 40px !important; font-size: 16px !important; }
  .wh-action-status { font-size: 12px !important; }
  /* 紙娃娃(手機):比照桌機「圖示紙娃娃」排版,只把格子/立繪縮小以塞進手機寬度。
     角色立繪居中、左右各一排裝備格、下方飾品 5 欄格;點任一格 → 屬性小卡(卸下/更換/賣出)。 */
  .paperdoll { flex-direction: row !important; align-items: center !important; justify-content: center !important; gap: 6px !important; margin: 4px 0 8px !important; }
  .pd-hero { flex: 1 !important; min-height: 118px !important; }
  .pd-fig { height: 118px !important; }
  .pd-fig.emoji { font-size: 62px !important; }
  .pd-col { display: flex !important; flex-direction: column !important; width: auto !important; gap: 6px !important; }
  .pd-acc { display: grid !important; grid-template-columns: repeat(5, 1fr) !important; gap: 6px !important; width: 100% !important; margin-top: 2px; justify-items: center; }
  .pd-slot { width: 48px !important; height: 48px !important; min-width: 0; min-height: 0 !important; flex-direction: column !important; justify-content: center !important; gap: 0 !important; padding: 0 !important; box-sizing: border-box; }
  .pd-slot .iico { width: 36px !important; height: 36px !important; flex: none; }
  .pd-slot .pd-lbl { display: block !important; }   /* 空格顯示部位名(比照桌機) */
  .pd-slot .pd-en { display: block !important; }    /* 強化角標 */
  .pd-info { display: none !important; }            /* 手機不再用文字清單 */
  .eqhint { margin-top: 6px !important; }
  /* 屬性小卡 / 道具點擊選單:字級與動作鈕手機加大(≥12px 文字、≥40px 鈕) */
  .eqd-btns button { min-height: 44px !important; font-size: 13px !important; }
  .nx-ig-menu { min-width: 150px !important; }
  .nx-ig-menu button { min-height: 40px !important; font-size: 13px !important; }
  .nx-ig-attrs .row { font-size: 12.5px !important; }
  /* 統計/能力表:字級保底 + 一致行高 + 過長數值換行不撐破(防面板內橫向溢出) */
  .strow { font-size: 12.5px !important; min-height: 34px; gap: 6px; }
  .strow span { flex: none; }
  .strow b { min-width: 0; text-align: right; overflow-wrap: anywhere; }
  .stgrid { gap: 6px 8px !important; }

  /* ---------- 6. 主城 hub:頂列 flex 一排(在線 / 地圖下拉 / 換角·登出),下拉彈性填中間、永不重疊 ---------- */
  .hub-topbar { display: flex !important; position: absolute !important; top: 8px !important; left: 8px !important; right: 8px !important; z-index: 9 !important; align-items: center !important; gap: 6px !important; }
  .hub-topbar > .hub-count { position: static !important; top: auto !important; left: auto !important; flex: 0 0 auto; font-size: 12px !important; padding: 7px 9px !important; white-space: nowrap; }
  .hub-topbar > .hub-maps-wrap { position: static !important; top: auto !important; left: auto !important; right: auto !important; transform: none !important; flex: 1 1 auto; min-width: 0; max-width: none !important; width: auto !important; }
  .hub-topbar > .hub-maps-wrap .hmc-trig { padding: 7px 8px !important; font-size: 12.5px !important; }
  .hub-topbar > .hub-acct { position: static !important; top: auto !important; right: auto !important; flex: 0 0 auto; gap: 5px !important; }
  .hub-acct button { padding: 7px 9px !important; font-size: 12px !important; }
  .hub-shop { top: 50px !important; right: 10px !important; padding: 8px 10px !important; font-size: 13px !important; z-index: 9 !important; }
  .hub-exit { top: 50px !important; right: 10px !important; padding: 8px 12px !important; z-index: 9 !important; }
  .hub-shop { top: 52px !important; right: 10px !important; padding: 8px 10px !important; font-size: 13px !important; z-index: 9 !important; }
  .hub-exit { top: 52px !important; right: 10px !important; padding: 8px 12px !important; z-index: 9 !important; }
  /* 聊天:視窗縮小、輸入列貼底 + 瀏海機安全區 */
  .hub-chat { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important; }
  .hub-log { max-height: 15vh !important; max-width: none !important; font-size: 12px !important; }
  .hub-inbar { max-width: none !important; }
  .hub-inbar input { padding: 9px 10px !important; }   /* 16px 由通用規則保證 */
  .hub-inbar button { padding: 0 14px !important; }
  /* NPC 名牌 / 玩家名牌字級縮小 */
  .hub-npc .npc-plate b { font-size: 12px !important; }
  .hub-npc .npc-plate i { font-size: 12px !important; }
  .hub-npc .npc-fig { height: 96px !important; }
  .hub-p .nm { font-size: 12px !important; }
  /* 主城路人/玩家立繪:手機縮小(桌機 idle 150px / 走路 181px 在手機太大→佔半螢幕、互相重疊) */
  .hub-p img, .hub-p .emoji { height: 66px !important; }
  .hub-p img.wf { height: 80px !important; }
  .hub-p .emoji { font-size: 36px !important; }
  .hub-p .bubble { max-width: 56vw !important; white-space: normal !important; font-size: 12.5px !important; padding: 5px 10px !important; margin-bottom: 12px !important; }
  /* 主城工具列:手機大幅壓縮(按鈕/圖示/滑桿都縮小),少佔上半畫面、讓城市與角色看得到 */
  /* 工具列:移到地圖傳送下拉「下方」+ 改成「單行橫排、可左右滑」(不再 3×3 方塊佔掉半個畫面) */
  #hub .hub-tools { top: 58px !important; left: 50% !important; transform: translateX(-50%) !important; gap: 3px !important; padding: 2px 6px !important; flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; justify-content: flex-start !important; align-items: center !important; max-width: 94vw !important; -webkit-overflow-scrolling: touch; }
  #hub .hub-tools::-webkit-scrollbar { display: none; }
  /* 👉 可左右滑提示:右緣常駐漸層 + 箭頭(貼在可視區右側,滑動時跟著);告訴玩家工具列能左右滑看更多 */
  #hub .hub-tools::after { content: '›'; position: sticky; right: 0; flex: 0 0 auto !important; align-self: stretch; display: flex !important; align-items: center; padding: 0 4px 0 20px; margin-left: -16px; color: #ffd27f; font-size: 20px; font-weight: bold; line-height: 1; background: linear-gradient(90deg, rgba(10,15,22,0), rgba(10,15,22,.92) 62%); pointer-events: none; animation: hubToolsHint 1.6s ease-in-out infinite; }
  @keyframes hubToolsHint { 0%,100% { transform: translateX(0); opacity: .75; } 50% { transform: translateX(3px); opacity: 1; } }
  #hub .hub-tools > * { flex: 0 0 auto !important; }
  #hub .hub-tools button { white-space: nowrap !important; }
  #hub .hub-tools .hub-vol input[type=range] { width: 46px !important; }
  #hub .hub-tools button { padding: 2px 8px !important; font-size: 11px !important; line-height: 1.15 !important; min-height: 30px !important; }   /* 覆蓋通用 button min-height:40px → 免得橫排上下留一堆空白 */
  #hub .hub-tools .hub-ico { height: 14px !important; width: 14px !important; margin-right: 2px !important; }
  #hub .hub-tools .hub-vol { min-height: 0 !important; height: 30px !important; align-items: center !important; flex-wrap: nowrap !important; }   /* 音量區原本 62px 撐高整條 → 壓到 30px */
  #hub .hub-tools .hv-mute { min-height: 30px !important; padding: 3px 6px !important; }
  #hub .hub-tools .hub-vol img { height: 18px !important; width: auto !important; }
  #hub .hub-tools .hub-vol input[type=range] { width: 54px !important; }

  /* ---------- 7. 即時獵場 #rt:HUD 縮小靠左上、離開鈕加大、提示縮短 ---------- */
  .rt-hud { top: 8px !important; left: 8px !important; min-width: 0 !important; max-width: 46vw; padding: 6px 10px !important; font-size: 12px !important; }
  .rt-hud .hpt, .rt-hud .mpt { font-size: 12px !important; }
  .rt-exit { top: 8px !important; right: 8px !important; padding: 12px 16px !important; font-size: 15px !important; min-height: 44px; }
  .rt-tip { bottom: calc(8px + env(safe-area-inset-bottom)) !important; font-size: 12px !important; max-width: 92vw; white-space: normal; text-align: center; padding: 5px 10px !important; }
  .rt-dmg.miss, .rt-dmg.exp { font-size: 13px !important; }
  /* 每日簽到浮動鈕:手機從 top:96(撞到頂部 回主城/角色/登出 列)挪到右下角、縮小 */
  #nx-ci-btn { top: auto !important; bottom: 92px !important; right: 8px !important; padding: 7px 11px !important; font-size: 12px !important; }

  /* ---------- 8. 選角 / 創角:2 欄補齊 + 取名輸入 16px 防放大 ---------- */
  #cs-mask { padding: 16px 10px !important; }
  #cs-mask h2 { font-size: 18px !important; margin: 4px 0 12px !important; }
  .cs-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)) !important; width: 100%; max-width: 400px; gap: 10px !important; }
  .cs-cls { grid-template-columns: repeat(2, minmax(140px, 1fr)) !important; width: 100%; max-width: 400px; gap: 10px !important; }
  .cs-gender button { padding: 9px 20px !important; min-height: 42px; }
  .cs-namebar { flex-wrap: wrap; justify-content: center; }
  .cs-namebar input { width: min(220px, 70vw) !important; min-height: 44px; }   /* 16px 由通用規則保證 */
  .cs-namebar button { min-height: 44px; padding: 10px 22px !important; }
  .cs-back { min-height: 40px; }

  /* ---------- 9. 登入 / 離線收益彈窗:窄幅收斂 ---------- */
  .login-box { width: min(320px, 92vw) !important; padding: 24px 20px !important; }
  .ofl-box { min-width: min(260px, 88vw) !important; padding: 18px 20px !important; }

  /* ---------- 10. 「更多」抽屜:攤平成單一 5 欄格 → 每排 5 張橫式卡,共 10 項剛好 2 排 ---------- */
  /* 把 4 個分類(功能/組隊/娛樂/帳號)攤平:.mgrid 用 display:contents 讓按鈕直接進 .sheet 這個 5 欄格;隱藏分類標題 */
  #nx-msheet .sheet { display: grid !important; grid-template-columns: repeat(5, 1fr) !important; gap: 7px !important; align-content: start !important; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)) !important; }
  #nx-msheet .grip { grid-column: 1 / -1 !important; }
  #nx-msheet .msec { display: none !important; }
  #nx-msheet .mgrid { display: contents !important; }
  #nx-msheet .mgrid button { flex-direction: row !important; justify-content: center !important; align-items: center !important; gap: 5px !important; padding: 9px 4px !important; border-radius: 9px !important; min-height: 0 !important; font-size: 12px !important; }
  #nx-msheet .mgrid button .mi { font-size: 18px !important; }
  #nx-msheet .mgrid button.logout { grid-column: auto !important; }   /* 登出當一般橫式卡,不再整排 */

  /* ---------- 11. buff/狀態列(#nx-hud):手機一欄約放 8 個就往左換第二欄 ---------- */
  /* 每個圖示 38px + gap 7px ≈ 45px;8 個 ≈ 360px。桌機維持 game_hud.js 內嵌的 calc(100% - 16px) 不受影響。 */
  #nx-hud { max-height: 360px !important; }

  /* ---------- 12. 🔠 字級(大/特大)下的 vw 限寬要除回倍率 ----------
     字級是對 <body> 下 CSS zoom,但 vw/vh 不會跟著換算
     (實測 Chrome:視窗寬 390px、body zoom 1.25 時,100vw 會算成 488px = 390×1.25)。
     於是所有用 vw 限寬的東西在大/特大字級下都比螢幕寬,而 body 又是 overflow-x:hidden
     → 超出去的直接被裁掉,玩家看到的就是「面板跑掉」。
     這裡把 vw 除以該級距的倍率(1.12 / 1.25),實際寬度回到原本設計的比例;字仍然是放大的。 */
  html.nx-fs1 #hub .hub-tools { max-width: 83.9vw !important; }   /* 94 / 1.12 */
  html.nx-fs2 #hub .hub-tools { max-width: 75.2vw !important; }   /* 94 / 1.25 */
  html.nx-fs1 .rt-tip { max-width: 82.1vw !important; }           /* 92 / 1.12 */
  html.nx-fs2 .rt-tip { max-width: 73.6vw !important; }           /* 92 / 1.25 */
  html.nx-fs1 .hub-p .bubble { max-width: 50vw !important; }      /* 56 / 1.12 */
  html.nx-fs2 .hub-p .bubble { max-width: 44.8vw !important; }    /* 56 / 1.25 */

  /* ---------- 13. 底部導航列與「更多」抽屜:大/特大字級下必須還在畫面內 ----------
     底部導航列是 8 顆固定寬圖示鈕的 flex 列,字級放大後每顆的最小內容寬也跟著放大,
     總和超過螢幕 → 最右邊的「☰ 更多」被擠出畫面。實測特大時 right=428 而可用寬只有 375,
     elementFromPoint 直接回報點不到 → 玩家在放大狀態下連主選單都開不了。
     導航列是主要導航,「一定要在畫面內」優先於「跟著字級變大」;
     做法沿用 ui.js 既有的 `html.nx-fs1/2 #nx-wm-canvas{zoom:1}`(戰場畫布不跟著放大)——
     把倍率抵銷回 1,導航列在三個字級下的版面完全一致(實測皆 375px 滿版、貼齊畫面底端)。
     抽屜的 5 欄格子則是 grid 項目的 min-width:auto 撐開欄寬造成溢出(特大時 404px),
     min-width:0 讓 1fr 欄位可以縮到內容寬以下,實測三個字級都回到 375px。 */
  html.nx-fs1 #nx-mnav { zoom: 0.892857; }   /* 1 / 1.12 */
  html.nx-fs2 #nx-mnav { zoom: 0.8; }        /* 1 / 1.25 */
  #nx-msheet .mgrid button { min-width: 0 !important; }

  /* 🔧 fszoom-fix-20260829:字級「大/特大」對 body 下 CSS zoom，而手機 in-app webview / 舊 iOS 對 body{zoom}+position:fixed 的觸控命中座標會偏移（看得到按鈕、點下去偏、要按好幾次）。反向抵銷每個固定元件會漏掉某一塊，故手機一律取消「版面縮放」，只保留字重加粗（ui.js 的 font-weight 規則不受影響）。桌機 ≥933px 在此 @media 之外，完全不受影響。 */
  html.nx-fs1 body, html.nx-fs2 body { zoom: 1 !important; }
  html.nx-fs1 #nx-mnav, html.nx-fs2 #nx-mnav { zoom: 1 !important; }   /* 抵銷既有反向 counter-zoom，避免 body 回 1 後導航反被縮小 */
}
