/* 手機介面整理（body.mui＝觸控裝置，見 mobile_ui.js）。電腦版不受影響。目標：375×812 中間至少 60% 沒有 UI。 */
/* 上方：小地圖縮小；等級／金幣／在線合成一條細列；任務小字可收起 */
body.mui #topbar, body.mui #social { display:none !important; }
body.mui #minimap { left:8px; top:calc(24px + env(safe-area-inset-top)); width:84px; border-radius:10px; opacity:.88; }
body.mui #prog { position:absolute; left:98px; top:calc(24px + env(safe-area-inset-top)); display:flex; flex-wrap:nowrap; align-items:center; gap:6px; padding:2px 8px; height:20px; border-radius:999px; background:rgba(255,250,240,.72); border:1px solid rgba(0,0,0,.08); font-size:11px; max-width:calc(100vw - 106px); pointer-events:none; }
body.mui #prog[hidden] { display:none; }
body.mui #prog .pg-lv { display:flex; align-items:center; gap:4px; } body.mui #prog .pg-lv b { font-size:11px; }
body.mui #prog .pg-bar { width:46px; height:10px; } body.mui #prog .pg-bar em { font-size:8px; line-height:10px; }
body.mui #prog .pg-coin { display:flex; align-items:center; gap:3px; padding:0; background:none; border:none; font-size:11px; } body.mui #prog .pg-coin .coin { width:11px; height:11px; } body.mui #prog .pg-coin b { font-size:11px; }
body.mui #prog #netstat { position:static; padding:0; border:none; background:none; font-size:10px; white-space:nowrap; }
body.mui #prog #netstat.online::before, body.mui #prog #netstat.off::before, body.mui #prog #netstat.reconnecting::before, body.mui #prog #netstat.offline::before { width:6px; height:6px; margin-right:3px; }
body.mui #prog #progGuest { font-size:9px; white-space:nowrap; opacity:.8; max-width:92px; overflow:hidden; text-overflow:ellipsis; }
body.mui #statBtn { display:none; }      /* 抽屜裡已有「素質」 */
body.mui #btnQuests { position:absolute; left:8px; top:calc(24px + 63px + 6px + env(safe-area-inset-top)); padding:2px 8px 2px 6px; font-size:11px; min-height:0; height:22px; border-radius:999px; background:rgba(255,250,240,.78); }
body.mui #btnQuests .ic { font-size:12px; width:auto; } body.mui #btnQuests .lb { font-size:11px; } body.mui #btnQuests i { top:-6px; right:-4px; min-width:14px; height:14px; font-size:9px; line-height:14px; }
body.mui #btnQuests.mb-fold .lb { display:none; }
body.mui #mbFold { position:absolute; left:calc(8px + 78px); top:calc(24px + 63px + 6px + env(safe-area-inset-top)); width:22px; height:22px; padding:0; border-radius:50%; font-size:11px; background:rgba(255,250,240,.7); border:1px solid rgba(0,0,0,.1); }
body.mui.mb-hint-fold #mbFold { left:calc(8px + 40px); }
/* 提示、浮動訊息改小字 */
body.mui #toast { top:calc(50px + env(safe-area-inset-top)); font-size:12px; padding:4px 12px; background:rgba(255,250,240,.82); max-width:78vw; }
body.mui #prompt { padding:3px 9px; border-radius:9px; background:rgba(255,250,240,.82); } body.mui #prompt b { font-size:12px; } body.mui #prompt small { font-size:10px; }
body.mui .pill { font-size:11px; padding:2px 7px 2px 5px; }
body.mui #statcard { top:calc(24px + 63px + 34px + env(safe-area-inset-top)); }
/* 右側：3 顆大按鈕（快速配對、聊天／發話、選單）；跳和互動留在右下 */
body.mui #mbBig { position:absolute; right:calc(10px + env(safe-area-inset-right)); bottom:calc(214px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:10px; align-items:stretch; z-index:5; }
body.mui #mbBig button { width:74px; height:64px; padding:4px 2px; margin:0; border-radius:20px; font-size:15px; font-weight:800; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; line-height:1.1;
  background:rgba(255,250,240,.9); color:#3a2f4a; border:2px solid rgba(255,176,32,.9); box-shadow:0 3px 10px rgba(0,0,0,.2); order:0; position:static; }
body.mui #mbBig button .ic { font-size:22px; line-height:1; width:auto; height:auto; } body.mui #mbBig button .lb { font-size:13px; line-height:1.1; }
body.mui #mbBig #btnQuick { background:rgba(255,176,32,.95); }
body.mui #mbBig #mbMenu { background:rgba(58,47,74,.92); color:#fff; border-color:#fff; }
body.mui #act { right:calc(14px + env(safe-area-inset-right)); bottom:calc(22px + env(safe-area-inset-bottom)); width:80px; height:80px; font-size:18px; }
body.mui #r11jump { right:calc(22px + env(safe-area-inset-right)); bottom:calc(112px + env(safe-area-inset-bottom)); width:56px; height:56px; }
body.mui #joy { bottom:calc(20px + env(safe-area-inset-bottom)); }
/* 抽屜：兩欄格子 */
#mbBackdrop { position:fixed; inset:0; background:rgba(0,0,0,.3); z-index:90; pointer-events:auto; }
#mbBackdrop[hidden], #mbDrawer[hidden] { display:none; }
#mbDrawer { position:fixed; left:8px; right:8px; bottom:calc(8px + env(safe-area-inset-bottom)); max-height:62vh; overflow-y:auto; z-index:91; background:var(--card, #fffaf0); border-radius:20px; border-top:4px solid var(--acc, #ffb020); padding:8px 10px 12px; box-shadow:0 -6px 24px rgba(0,0,0,.28); pointer-events:auto; touch-action:pan-y; }
#mbDrawer .mb-head { display:flex; justify-content:space-between; align-items:center; padding:2px 4px 6px; } #mbDrawer .mb-x { padding:4px 10px; border-radius:50%; }
#mbDrawer .mb-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
#mbDrawer .mb-grid button { position:static !important; width:auto !important; min-height:42px; padding:6px 10px !important; font-size:14px !important; font-weight:700; display:flex !important; align-items:center; justify-content:center; gap:6px; border-radius:14px; margin:0 !important; transform:none !important; }
#mbDrawer .mb-grid button .lb { display:inline !important; } #mbDrawer .mb-grid button kbd { display:none; }
#mbDrawer .mb-grid #frBadge { position:static; display:inline-block; }
/* 新手引導氣泡：縮成小字，點標題列可收起 */
body.mui .gd-bub { padding:4px 8px 4px; border-width:1.5px; border-radius:12px; opacity:.92; width:200px !important; }
body.mui .gd-top b { font-size:11px; } body.mui .gd-top em { font-size:10px; padding:0 6px; } body.mui .gd-bub p { font-size:11px; margin:2px 0 3px; line-height:1.35; }
body.mui .gd-btns button { padding:1px 8px; font-size:10px; } body.mui .gd-top { pointer-events:auto; }
body.mui #guide.gd-fold .gd-bub p, body.mui #guide.gd-fold .gd-btns { display:none; }
/* 彈出的面板改成貼著畫面下方、不蓋右側按鈕 */
body.mui #pop, body.mui #r7menu { left:8px !important; right:8px !important; width:auto !important; transform:none !important; bottom:calc(8px + env(safe-area-inset-bottom)) !important; max-height:46vh; }

/* ---- 手機：場景標籤／名牌縮小 ---- */
body.mui .rtag .nm, body.mui #nameplate .nm { font-size:10px; padding:0 6px; } body.mui .rtag .ti, body.mui #nameplate .ti { font-size:9px; padding:0 5px; }
body.mui .pill b { font-size:9px; } body.mui .pill.mini { font-size:10px; padding:1px 6px; }

/* ---- 手機：捏角色＝全螢幕頁（上方預覽角色、下方分頁＋選項可捲動、底部固定「取消／儲存」；分頁列可橫向滑） ---- */
.cr-preview { display:none; }
body.mui #creator .cr-panel { -webkit-backdrop-filter:none; backdrop-filter:none; left:0; right:0; top:0; bottom:0; width:auto; height:auto; border-radius:0; border:none; box-shadow:none; padding:0; gap:0; background:linear-gradient(to bottom, transparent 0, transparent 36vh, var(--card, #fffaf0) 36vh); }
body.mui .cr-preview { display:block; flex:0 0 36vh; pointer-events:none; }
body.mui #creator .cr-panel > :not(.cr-preview) { margin-left:12px; margin-right:12px; }
body.mui #creator .cr-head { padding-top:8px; } body.mui .cr-head h2 { font-size:18px; } body.mui .cr-head small { font-size:12px; }
body.mui .cr-name { padding:2px 0 4px; } body.mui .cr-name label { font-size:12px; } body.mui .cr-name input { font-size:16px; padding:6px 12px; } body.mui .cr-name small { font-size:12px; min-height:0; }
body.mui .cr-name small .cr-rn, body.mui #crRenameNote .cr-rn { margin-left:4px; padding:3px 10px; font-size:12px; border-radius:999px; background:#fff3d8; color:#8a5b00; border:1px solid var(--acc); }
body.mui .cr-tabs { flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; flex:none; padding:4px 0 6px; -webkit-overflow-scrolling:touch; touch-action:pan-x; scrollbar-width:none; }
body.mui .cr-tabs::-webkit-scrollbar { display:none; } body.mui .cr-tabs button { flex:none; min-height:40px; padding:6px 14px; font-size:14px; }
body.mui .cr-opts { flex:1 1 0; min-height:0; overflow-y:auto; grid-template-columns:repeat(auto-fill, minmax(84px, 1fr)); gap:8px; padding:4px 2px 10px; touch-action:pan-y; -webkit-overflow-scrolling:touch; }
body.mui .cr-opt { min-height:48px; font-size:14px; padding:8px 4px; }
body.mui .cr-reg, body.mui .cr-msg { font-size:12px; }
body.mui #creator .cr-actions { margin:0; padding:8px 12px calc(10px + env(safe-area-inset-bottom)); background:var(--card, #fffaf0); border-top:1px solid var(--line, #eee); }
body.mui .cr-actions button { min-height:48px; font-size:16px; }
body.mui .cr-hint { display:none; }

/* ---- 手機：所有彈窗（包包、商店、市場、簡介、說明、設定…）全螢幕、底部固定關閉鍵；字至少 14px、按鈕至少 44px 高 ---- */
body.mui #gwin, body.mui #r6, body.mui #r11ov, body.mui #modal { padding:0 !important; align-items:stretch !important; justify-content:stretch !important; background:var(--card, #fffaf0) !important; }
body.mui #gwin .gw-card, body.mui #r6 .r6-card, body.mui #r11ov .r11card, body.mui #modal .card { width:100% !important; max-width:none !important; height:100%; max-height:none !important; border-radius:0 !important; border-left:none; border-right:none; box-shadow:none;
  padding-top:calc(10px + env(safe-area-inset-top)); padding-bottom:calc(76px + env(safe-area-inset-bottom)) !important; }
body.mui #gwin .gw-card { padding-top:0; padding-bottom:0 !important; }
body.mui #gwin .gw-card header { padding-top:calc(10px + env(safe-area-inset-top)); }
body.mui #gwin .gw-body { flex:1; padding-bottom:calc(84px + env(safe-area-inset-bottom)); }
body.mui.creating #hud, body.mui.creating #guide, body.mui.creating #marquee, body.mui.creating #labels, body.mui.creating #rlayer { display:none !important; }
body.mui #gwClose, body.mui #r6 .r6-x, body.mui #statcard .sc-x, body.mui #r11ov .pf-x { position:fixed !important; left:12px; right:12px; bottom:calc(10px + env(safe-area-inset-bottom)); top:auto !important; width:auto !important; height:50px !important; margin:0 !important; border-radius:16px; font-size:0 !important; z-index:95; background:var(--acc, #ffb020); color:var(--acc-tx, #3a2f4a); border:2px solid #fff; box-shadow:0 4px 14px rgba(0,0,0,.28); }
body.mui #gwClose::after, body.mui #r6 .r6-x::after, body.mui #statcard .sc-x::after, body.mui #r11ov .pf-x::after { content:'關閉'; font-size:17px; font-weight:800; }
body.mui #r11ov .r11card [data-m="close"], body.mui #r11ov .r11card .pm-c { position:sticky; bottom:0; }
body.mui #gwin button, body.mui #r6 button, body.mui #r11ov button, body.mui #modal button, body.mui #boardwin button { min-height:44px; }
body.mui #gwin, body.mui #r6, body.mui #r11ov, body.mui #modal, body.mui #boardwin { font-size:14px; }
body.mui #gwin small, body.mui #r6 small, body.mui #r11ov small, body.mui #boardwin small, body.mui #gwin .gw-note, body.mui #r6 .r6-note, body.mui #gwin label, body.mui #r6 label, body.mui #gwin td, body.mui #gwin th, body.mui #gwin li, body.mui #r11ov li, body.mui #r11ov label { font-size:14px !important; }
body.mui #boardwin { padding:0 !important; align-items:stretch !important; background:var(--card, #fffaf0) !important; }
body.mui #statcard { left:0 !important; right:0 !important; top:0 !important; width:auto !important; max-height:none !important; height:100%; transform:none !important; border-radius:0 !important; padding-bottom:calc(76px + env(safe-area-inset-bottom)); z-index:30; }
body:not(.touch) #social button { white-space:nowrap; }
/* 說明頁（#r11help）也全螢幕＋底部固定關閉 */
body.mui #r11help { padding:0 !important; align-items:stretch !important; background:var(--card, #fffaf0) !important; }
body.mui #r11help .hp-card { width:100% !important; max-height:none !important; height:100%; border-radius:0 !important; border:none; box-shadow:none; padding-bottom:calc(76px + env(safe-area-inset-bottom)); }
body.mui #r11help .hp-h { padding-top:calc(12px + env(safe-area-inset-top)); }
body.mui #r11help .hp-x { position:fixed !important; left:12px; right:12px; bottom:calc(10px + env(safe-area-inset-bottom)); height:50px; width:auto; margin:0; border-radius:16px; font-size:0 !important; z-index:95; background:var(--acc, #ffb020); color:var(--acc-tx, #3a2f4a); border:2px solid #fff; box-shadow:0 4px 14px rgba(0,0,0,.28); }
body.mui #r11help .hp-x::after { content:'關閉'; font-size:17px; font-weight:800; }
body.mui #r11help .hp-tabs button { min-height:44px; font-size:14px; }
