:root {
  --panel: rgba(24, 18, 12, 0.95);
  --panel-2: #3a2c1a;
  --border: #8a6d3b;
  --border-hi: #c9a24a;
  --gold: #e8c766;
  --text: #eadfc8;
  --dim: #a8987a;
  --font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;   /* 思源黑體（index.html 從 Google Fonts 載入；老闆 11-18），連不上用正黑體、蘋方 */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--text); font-family: var(--font); font-size: 13px; user-select: none; -webkit-user-select: none; }   /* iPhone 只認 -webkit-（長按字會跳出拷貝選單） */
/* 輸入框照樣能打字、選字（iPhone 上面不能選的話，有的版本連打字都不行） */
input, textarea, [contenteditable] { user-select: text; -webkit-user-select: text; }
/* 數字一律等高（Georgia 預設的數字有高有低，血量、防禦、經驗值排不齊） */
html { font-variant-numeric: lining-nums; }
/* iPhone 從主畫面打開、網頁比螢幕矮一截時（js/screen.js 量，--app-h 螢幕的高）：body 照螢幕的高度，
   position: fixed 的介面改以 body 為準（transform），排到螢幕最下面；body 本身 fixed，不會多出可以捲動的一截 */
html.app-fill body { position: fixed; left: 0; top: 0; width: 100%; height: var(--app-h); transform: translateZ(0); }canvas { display: block; }
button { font-family: var(--font); font-size: 13px; color: var(--text); background: linear-gradient(#5e4a30, #36281a); border: 1px solid var(--border); border-radius: 3px; padding: 4px 10px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 230, 160, 0.15); }
button:hover { background: linear-gradient(#745a38, #44321f); color: #fff; border-color: var(--border-hi); }
button.primary { background: linear-gradient(#9a7430, #5c4416); color: #fff3cf; border-color: var(--border-hi); }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.bad { color: #ff8a6b; }
.good { color: #9fe39f; }
.pad { padding: 10px; }
.pad-s { padding: 6px 12px 2px; }

/* 頂端 */
#topbar { position: fixed; top: 8px; right: 10px; display: flex; gap: 8px; align-items: center; }
#topbar > button { white-space: nowrap; flex: none; height: 28px; }   /* 一行寫完，不要被擠成兩行 */
#btn-sound { display: inline-flex; align-items: center; justify-content: center; padding-left: 8px; padding-right: 8px; }
#btn-sound svg { display: block; }
#btn-sound.off { color: var(--dim); }
#btn-art { white-space: nowrap; }
/* 攻略・討論：用途和其他按鈕不同，金色凸顯，玩家才會注意到有討論版 */
button.guide-btn { background: linear-gradient(#a87e34, #5c4416); color: #fff3cf; border-color: var(--border-hi); font-weight: bold; }
button.guide-btn:hover { background: linear-gradient(#c49440, #6e521c); color: #fff; }
/* 有新消息（討論版的新文章、攻略的更新）：右上角紅點 */
button.guide-btn { position: relative; overflow: visible; white-space: nowrap; }
button.guide-btn.has-new::after { content: ''; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ff3b2e; border: 2px solid #1a120a; box-shadow: 0 0 6px rgba(255, 59, 46, 0.8); animation: guide-ping 2s ease-in-out infinite; }
html.mobile #mmenu button.guide-btn.has-new::after { top: 50%; right: 10px; margin-top: -5px; }   /* 選單裡：紅點在按鈕右邊 */
/* 遊戲裡的問號（老闆 11-07：討論版、交易版、客服有消息都用這個紅點，點了圈出在哪裡，js/guide.js openHelp） */
#btn-help { position: relative; }
#btn-help.has-new::after { content: ''; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; box-sizing: border-box; border-radius: 50%; background: #ff3b2e; border: 1px solid #1a120a; box-shadow: 0 0 5px rgba(255, 59, 46, 0.9); animation: guide-ping 2s ease-in-out infinite; pointer-events: none; z-index: 2; }
html.mobile #btn-help.has-new::after { top: 0; right: 0; width: 12px; height: 12px; border-width: 2px; }
/* 攻略・討論收在 ☰ 選單裡：有新文章時 ☰ 也亮紅點 */
html.mobile #btn-menu { position: relative; overflow: visible; }
html.mobile #btn-menu.has-new::after { content: ''; position: absolute; top: -4px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #ff3b2e; border: 2px solid #1a120a; box-shadow: 0 0 6px rgba(255, 59, 46, 0.8); animation: guide-ping 2s ease-in-out infinite; }
@keyframes guide-ping { 50% { box-shadow: 0 0 0 4px rgba(255, 59, 46, 0.25), 0 0 6px rgba(255, 59, 46, 0.8); } }
#hud-zone { color: var(--gold); font-weight: bold; text-shadow: 0 1px 2px #000, 0 0 6px #000; background: rgba(0, 0, 0, 0.45); padding: 2px 8px; border-radius: 4px; }   /* 底色：雪地上也看得清楚 */
#hud-zone .clock { margin-left: 10px; color: var(--text); font-weight: normal; }
/* 所在的區域：電腦版在右下角、快捷列上面；手機在左上角地名下面 */
#zone-tag { position: fixed; right: 14px; bottom: calc(var(--hudh) + 8px); pointer-events: none; }
#zone-tag b { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); text-shadow: 0 1px 2px #000; }
#zone-tag .safety { color: #8fe08f; border-color: rgba(120, 220, 120, 0.5); }
#zone-tag .normal { color: #e8e0d0; }
#zone-tag .combat { color: #ff7a66; border-color: rgba(255, 110, 90, 0.6); }
/* 地名（電腦，原版介面才顯示：css/orig.css；現代介面的地名在上面那排 #hud-zone） */
#place-tag { display: none; position: fixed; pointer-events: none; }
#zone-tag .place { margin-right: 6px; }
#buffs { position: fixed; top: 8px; left: 10px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 55vw; }
/* 狀態圖示：一格一個圖示，下面是剩下的時間；不好的狀態紅框 */
.bicon { position: relative; width: 30px; height: 30px; border: 1px solid #6b5636; border-radius: 3px; background: #120d08; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.bicon img { display: block; width: 100%; height: 100%; }
.bicon b { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 14px; color: var(--gold); }
.bicon span { position: absolute; left: -2px; right: -2px; bottom: -2px; font-size: 10px; line-height: 11px; text-align: center; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 2px #000; }
.bicon.bad { border-color: #c0483c; }
.bicon.dim img, .bicon.dim b { opacity: 0.15; }

/* 訊息 */
/* 對話框、聊天視窗裡的「討論版」（js/ui.js L.linkBoard）：底線，點了打開討論版；對話框不接觸控的介面也點得到 */
.board-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; pointer-events: auto; }
#log .who { cursor: pointer; } #log .who:hover { text-decoration: underline; }   /* 點名字是密語他（js/main.js，老闆 11-18） */
#log { position: fixed; left: 10px; bottom: 124px; width: 430px; max-width: calc(100vw - 20px); height: 150px; overflow-y: auto; padding: 6px 10px; background: linear-gradient(rgba(10, 8, 6, 0.55), rgba(10, 8, 6, 0.7)); border: 1px solid rgba(138, 109, 59, 0.4); border-radius: 4px; line-height: 1.55; text-shadow: 0 1px 1px #000; }
#chat-input { position: fixed; left: 10px; bottom: 94px; width: 430px; max-width: calc(100vw - 20px); padding: 4px 8px; background: rgba(10, 8, 6, 0.85); color: #f0e6d0; border: 1px solid #8a6d3b; border-radius: 4px; font: inherit; z-index: 30; }
#btn-chat { position: fixed; }
html.mobile #btn-chat { left: calc(6px + var(--sl)); bottom: calc(66px + var(--sb)); padding: 2px 10px; font-size: 12px; }
html.mobile #chat-input { left: calc(62px + var(--sl)); bottom: calc(64px + var(--sb)); width: min(380px, calc(100vw - 70px)); }
#chat-size { display: none; }   /* 對話框高度的按鈕：只有電腦的原版介面有（css/classic.css、orig.css） */
#log::-webkit-scrollbar { width: 6px; } #log::-webkit-scrollbar-thumb { background: #5a4630; }

/* 下方狀態列 */
#hud { position: fixed; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(#4a3a26, #241a10 40%, #18120a); border-top: 2px solid var(--border); box-shadow: 0 -2px 0 #1a120a, 0 -6px 16px rgba(0, 0, 0, 0.5); display: flex; align-items: center; gap: 16px; padding: 6px 14px 16px; }
.hud-left { width: 250px; display: flex; flex-direction: column; gap: 4px; }
.bar { position: relative; height: 17px; background: #0e0a06; border: 1px solid #6a5230; border-radius: 9px; overflow: hidden; box-shadow: inset 0 1px 3px #000; }
.bar .fill { position: absolute; inset: 0 auto 0 0; transition: width 0.15s; border-radius: 9px; }
.bar.hp .fill { background: linear-gradient(#f06a5a, #b02a1e 55%, #7a140c); }
.bar.hp .fill.poison { background: linear-gradient(#8ae06a, #3a9a2a 55%, #1a5a12); }
.bar.mp .fill { background: linear-gradient(#6a9af0, #2a50b0 55%, #142a70); }
.bar .lbl { position: absolute; left: 8px; top: 0; font-size: 11px; font-weight: bold; line-height: 17px; text-shadow: 0 1px 1px #000; }
.bar .val { position: absolute; right: 8px; top: 0; font-size: 11px; line-height: 17px; text-shadow: 0 1px 1px #000; }
.hud-info { display: flex; gap: 8px; font-size: 12px; white-space: nowrap; align-items: center; } .hud-info b { color: var(--gold); }
.coin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4b0, #e8c547 45%, #9a7a1a); box-shadow: 0 0 0 1px #5a4410; vertical-align: -2px; }
.weight-ico { display: inline-block; width: 11px; height: 11px; background: #8a8f98; clip-path: polygon(25% 0, 75% 0, 100% 100%, 0 100%); margin-left: 4px; }
.warn { color: #ff8a6b !important; }
.hud-right { margin-left: auto; display: flex; gap: 6px; }
.exp { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: #0e0a06; border-top: 1px solid #3a2c1a; }
.exp .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffe28a, #c9a227 60%, #7a5a10); }
.exp span { position: absolute; right: 8px; top: 0; font-size: 9px; line-height: 10px; text-shadow: 0 1px 1px #000; }

#hotbar { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, 0.35); border: 1px solid #4a3a26; border-radius: 4px; }
.hot { position: relative; width: 44px; height: 44px; background: radial-gradient(#2a2016, #120d08); border: 1px solid #6a5230; border-radius: 3px; cursor: pointer; }
.hot:hover { border-color: var(--border-hi); box-shadow: 0 0 6px rgba(232, 199, 102, 0.4); }
.hot .key { position: absolute; left: 3px; top: 1px; font-size: 10px; color: var(--dim); z-index: 2; text-shadow: 0 1px 1px #000; }
.hot .icon { position: absolute; inset: 3px; width: auto; height: auto; }

/* 圖示 */
.icon { position: relative; width: 38px; height: 38px; border-radius: 3px; display: flex; align-items: center; justify-content: center; }
.icon img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7)); pointer-events: none; }   /* 格子不是正方形（手機的快捷列）時圖示不變形 */
.icon.empty img { filter: grayscale(1) brightness(0.45); }
.icon.empty.grey img { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7)); }   /* 灰色的圖已經做好了（js/ui.js dimIcon）：和一般的圖一樣畫，不用濾鏡變灰（老闆 11-10 快捷格上灰色的肉抖 1 像素） */
/* 祝福的圖示偏亮偏黃、詛咒的整個偏紅，字也一樣（uvl3.com 的台版清單） */
/*   祝福的道具：格子底色深紅褐、一圈淡米金色的框（老闆 11-15 的原版截圖「祝福的周圍應該長這樣」；從截圖取色：邊上 #381a0e、中間 #4f2015，框 #e4caa8，
     框內側一圈暗的）。背包、交易、紙娃娃整格上色，快捷列、商店清單是圖示那一塊 */
.icon.blessed { background: radial-gradient(ellipse at 50% 50%, #52221a 0%, #44200f 55%, #371909 100%); box-shadow: inset 0 0 0 1px #e2c8a6, inset 0 0 0 2px rgba(110, 80, 52, 0.75); }
:is(.slot, .dslot) > .icon.blessed { background: none; box-shadow: none; }
:is(.slot, .dslot):has(> .icon.blessed),
html.orig :is(#inv-grid, #trade-theirs, #trade-mine, #wh-grid, #stall-bag) .slot:has(> .icon.blessed),
html.orig #win-char .dslot:has(> .icon.blessed) { background: radial-gradient(ellipse at 50% 50%, #52221a 0%, #44200f 55%, #371909 100%) !important; box-shadow: inset 0 0 0 1px #e2c8a6, inset 0 0 0 2px rgba(110, 80, 52, 0.75) !important; }
html.orig #inv-grid .slot.sel:has(> .icon.blessed) { box-shadow: inset 0 0 0 1px #e2c8a6, inset 0 0 0 2px #e8c766 !important; }
/*   圖示本身的黃光（老闆 11-16「剛測試祝武捲 的確沒發光」「受祝福的道具 自己上網查詢」）：uvl3.com 2005 台版〈天堂中的祝福和詛咒道具〉
     「受祝福的物品外觀會有黃色的光芒，且物品的文字是黃色的」「被詛咒的物品外觀會泛著紅光」，附的台版截圖（C68 祝武卷、C43 祝福雙手劍、C25 祝福治癒藥水）
     圖示一圈黃光、字黃色。11-15 改成格子底色時把光拿掉了，兩樣都留：底色照老闆的截圖，圖示照台版的光。只用 drop-shadow（快捷格不會抖） */
.icon.blessed img { filter: drop-shadow(0 0 1px rgba(255, 228, 110, 1)) drop-shadow(0 0 2px rgba(255, 206, 60, 0.95)) drop-shadow(0 0 4px rgba(255, 190, 40, 0.6)); }
/* 羊皮紙地圖上自己的位置（js/ui.js placeMapMark）：紅點一閃一閃 */
#map-me { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #e02020; box-shadow: 0 0 0 1.5px #fff8e0, 0 0 4px 1px rgba(0, 0, 0, 0.6); pointer-events: none; z-index: 3; animation: map-me-blink 1s steps(2, jump-none) infinite; }
@keyframes map-me-blink { 0% { opacity: 1; } 100% { opacity: 0.25; } }
/* 用了鑑定卷軸、在選道具：滑過道具是放大鏡（原版 common.bin 第 9 個游標，熱點在左上角；沒有原版圖時用瀏覽器的放大鏡） */
html.pick-identify :is(.slot, .dslot, .shop-row)[data-uid], html.pick-identify :is(.slot, .dslot)[data-uid] * { cursor: url("../assets/local/ui/pc/cursor-magnify.png") 0 0, zoom-in; }
.icon.cursed img { filter: grayscale(1) sepia(1) saturate(3.2) hue-rotate(-48deg) brightness(0.72) contrast(1.1); }
.n-bless { color: #f4f2be !important; }
.n-curse { color: #ff3a3a !important; }
.icon .cnt { position: absolute; right: 2px; bottom: 0; font-size: 10px; text-shadow: 0 0 2px #000, 0 1px 1px #000; }
.icon .badge { position: absolute; left: 2px; top: 0; font-size: 10px; color: var(--gold); text-shadow: 0 1px 1px #000; }
/* 角色限定的那疊（背包裡另外還有同一樣不限定的，js/ui.js gridHtml）：左下角一個金色的鎖（服務台 11-20 #1459） */
.slot.bnd .icon::after { content: ''; position: absolute; left: 1px; bottom: 1px; width: 9px; height: 11px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M2.5 5.5V3.8a2.5 2.5 0 0 1 5 0v1.7' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3Cpath d='M2.5 5.5V3.8a2.5 2.5 0 0 1 5 0v1.7' fill='none' stroke='%23e8c766' stroke-width='1.3'/%3E%3Crect x='1' y='5.3' width='8' height='6.2' rx='1' fill='%23e8c766' stroke='%23000' stroke-width='0.8'/%3E%3C/svg%3E") no-repeat center / contain; }
.icon .ench { position: absolute; right: 2px; top: 0; font-size: 10px; color: #ffffff; text-shadow: 0 1px 1px #000; }   /* 強化值：原版是白色（老闆） */

/* 視窗 */
.win { position: fixed; background: var(--panel); border: 1px solid var(--border); border-radius: 5px; box-shadow: 0 0 0 1px #1a120a, 0 8px 24px rgba(0, 0, 0, 0.65); }
.win-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 12px; background: linear-gradient(#5a4426, #34261a); color: var(--gold); font-weight: bold; border-bottom: 1px solid var(--border); border-radius: 5px 5px 0 0; letter-spacing: 2px; text-shadow: 0 1px 1px #000; }
.win-head .close { padding: 0 6px; background: none; border: none; box-shadow: none; }
#win-inv { right: 12px; bottom: 104px; width: 316px; }
#win-wh { right: 320px; bottom: 104px; width: 284px; }
#win-char { right: 320px; bottom: 104px; width: 250px; }
#win-spell { right: 320px; top: 50px; width: 270px; display: flex; flex-direction: column; max-height: calc(100vh - 150px); }
#spell-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#win-party { right: 600px; top: 50px; width: 260px; }
/* 原版介面才有的按鈕（說明、選項、結束）；選項視窗 */
.cl-only { display: none; }
#win-opt { right: 16px; bottom: 214px; width: 196px; }
#win-opt .opt-list button { white-space: nowrap; }
/* 音量（js/sound.js）：設定視窗、手機選單裡一行「音量 ──●── 80」，和上下的選項同樣的字 */
.vol-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 15px; color: #e8dcc0; text-shadow: 0 1px 0 #000; white-space: nowrap; border-top: 1px solid rgba(0, 0, 0, 0.35); }
.vol-row input { flex: 1; min-width: 70px; accent-color: #c8a050; }
.vol-row .vol-num { min-width: 2.2em; text-align: right; font-weight: normal; }
html.orig .vol-row + button { border-top: 1px solid rgba(0, 0, 0, 0.35) !important; }
#win-opt .opt-list { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
#win-trade { left: 16px; top: 50px; width: 300px; }   /* 原版：交易視窗在畫面左邊（客戶端說明 helptra），右邊是背包 */
html:not(.online) .online-only { display: none !important; }
/* 管理員帳號才看得到的（設定裡的「前往後台」，js/net.js 登入時加上 html.gm）；後台開在遊戲裡的那一層（js/ui.js openAdmin） */
html:not(.gm) .gm-only { display: none !important; }
/* 管理員的工作模式（老闆 11-19「管理員介面把聊天視窗隱藏 並且在遊戲明顯部位標示 目前為管理員身分 … 不需要快捷鍵 以及社群或任何選單
   只需需要後台管理 G M指 背包 也不需要…左下角介面圖示 聊天視窗 完全只是用來處理工作的帳號角色」）：只在管理員自己的畫面（html.gm）。
   對話框、輸入欄、快捷列、主介面（狀態、選單）、手機的選單和圓鈕、面對面的動作列都收起來；上面中間一條紅色的「管理員帳號」列（後台管理、GM 指令、背包，
   js/gmpanel.js），整個畫面框一圈紅邊。訊息（指令的結果、系統訊息）在 GM 指令視窗裡 */
html.gm #log, html.gm #mf-lv, html.gm #chat-input, html.gm #ime, html.gm #btn-chat, html.gm #win-chat, html.gm #hud, html.gm #mmenu, html.gm #side-btns,
html.gm #mob-party, html.gm #btn-autoheal-pc, html.gm #face-menu, html.gm #topbar button, html.gm #btn-gm, html.gm #btn-pickup, html.gm #btn-pk, html.gm #mode-bar { display: none !important; }
#gm-bar { display: none; position: fixed; top: calc(var(--st, 0px) + 6px); left: 50%; transform: translateX(-50%); z-index: 8000; align-items: center; gap: 6px; padding: 5px 8px;
  background: rgba(110, 0, 0, 0.92); border: 2px solid #ff4a4a; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); white-space: nowrap; }
html.gm.ingame #gm-bar { display: flex; }
#gm-bar .gm-tag { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 1px; padding: 0 6px 0 2px; }
#gm-bar .gm-tag small { display: block; font-size: 11px; font-weight: 400; color: #ffc8c8; letter-spacing: 0; }
#gm-bar button { font: inherit; font-size: 14px; font-weight: 700; color: #fff; background: #3a0606; border: 1px solid #ff8080; border-radius: 4px; padding: 5px 10px; cursor: pointer; }
#gm-bar button:hover { background: #5a0b0b; }
html.gm.ingame::after { content: ''; position: fixed; inset: 0; border: 4px solid #e02020; pointer-events: none; z-index: 7999; }
#gm-msgs { max-height: 180px; overflow-y: auto; margin-top: 6px; padding: 4px 6px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.15); font-size: 13px; line-height: 1.45; }
#gm-msgs:empty::before { content: '指令的結果、系統訊息會出現在這裡。'; color: #999; }
/* 管理員畫面上的聊天紀錄（js/gmpanel.js buildChat；後台「聊天紀錄」搬出來，老闆 11-19）：左下角；全螢幕（.full）整個畫面、縮小（.min）只剩標題列。
   一般玩家、選角畫面不出現 */
#gm-chat { display: none; position: fixed; left: 10px; bottom: 10px; z-index: 7998; width: min(640px, calc(100vw - 20px)); flex-direction: column;
  background: rgba(10, 6, 6, 0.8); border: 1px solid #a03030; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); color: #ddd; font-size: 13px; }
html.gm.ingame #gm-chat { display: flex; }
#gm-chat.full { left: 10px; right: 10px; top: calc(var(--st, 0px) + 58px); bottom: 10px; width: auto; }
#gm-chat .gc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 6px; border-bottom: 1px solid rgba(255, 128, 128, 0.3); }
#gm-chat .gc-head b { color: #ffc8c8; font-size: 13px; margin-right: 2px; }
#gm-chat select, #gm-chat input[type="text"], #gm-chat input:not([type]) { font: inherit; font-size: 12px; color: #eee; background: #1d1414; border: 1px solid #6a3030; border-radius: 3px; padding: 2px 4px; width: 84px; }
#gm-chat select { width: auto; }
#gm-chat label { font-size: 12px; color: #ccc; display: inline-flex; align-items: center; gap: 2px; }
#gm-chat .gc-btns { margin-left: auto; display: inline-flex; gap: 4px; }
#gm-chat .gc-btns button { font: inherit; font-size: 12px; color: #fff; background: #3a0606; border: 1px solid #ff8080; border-radius: 3px; padding: 2px 7px; cursor: pointer; }
#gm-chat-list { height: 210px; overflow-y: auto; padding: 4px 8px; line-height: 1.45; overflow-wrap: anywhere; }
#gm-chat.full #gm-chat-list { height: auto; flex: 1; }
#gm-chat.min #gm-chat-list, #gm-chat.min .gc-foot, #gm-chat.min .gc-head select, #gm-chat.min .gc-head input, #gm-chat.min .gc-head label, #gm-chat.min #gc-older, #gm-chat.min #gc-new { display: none; }
#gm-chat-list:empty::before { content: '讀取中…'; color: #999; }
#gm-chat .gc-t, #gm-chat .gc-p { color: #8a8a8a; font-size: 11px; }
#gm-chat .gc-who { cursor: pointer; text-decoration: underline dotted; }
#gm-chat .gc-foot { padding: 2px 8px 4px; font-size: 11px; }
html.mobile #gm-chat-list { height: 140px; font-size: 12px; }
/*   手機（iPhone 的瀏海、狀態列）：裡面的後台從安全區域開始畫（老闆 11-15 截圖「上面會被瀏海擋到」：標題、分頁被狀態列蓋住） */
#admin-overlay { position: fixed; inset: 0; z-index: 9000; background: #0d0b09; display: flex; flex-direction: column; box-sizing: border-box; padding: var(--st, 0px) var(--sr, 0px) var(--sb, 0px) var(--sl, 0px); }
#admin-overlay.hidden { display: none; }
/*   手機 App 的外框把遊戲轉了 90 度（play.html 的 data-frot）：後台反轉回來，跟手機一樣正（老闆 11-18「後台一律直式」：
     直拿玩橫的遊戲時按前往後台，後台跟著遊戲躺著）。框裡的 100vw × 100vh 是遊戲的寬高，後台用手機的寬高（對調）。
     上面留手機的安全區（瀏海）：cw 時手機的上面是遊戲的左邊（--sa-l） */
html[data-frot="cw"] #admin-overlay { inset: auto; left: 0; top: 0; width: 100vh; height: 100vw; transform-origin: 0 0; transform: translateY(100vh) rotate(-90deg); padding: var(--sa-l, 0px) 0 0 0; }
html[data-frot="ccw"] #admin-overlay { inset: auto; left: 0; top: 0; width: 100vh; height: 100vw; transform-origin: 0 0; transform: translateX(100vw) rotate(90deg); padding: 0; }
html[data-frot="cw"] #admin-overlay .admin-back { top: calc(8px + var(--sa-l, 0px)); right: 12px; }
html[data-frot="ccw"] #admin-overlay .admin-back { top: 8px; right: 12px; }
#admin-overlay iframe { flex: 1; width: 100%; border: 0; background: #0d0b09; }
#admin-overlay .admin-back { position: absolute; top: calc(8px + var(--st, 0px)); right: calc(12px + var(--sr, 0px)); z-index: 1; padding: 6px 14px; border: 1px solid #8a6a3a; border-radius: 4px; background: #2a2016; color: #f8f8b8; font-size: 14px; cursor: pointer; }
/* 瞬間移動的記憶座標：點一下選取的那列（按兩下傳送、Delete 刪除；js/ui.js openTeleport） */
#tele-body .shop-row.sel { background: rgba(255, 215, 120, 0.14); outline: 1px solid rgba(255, 215, 120, 0.5); }
/* 電腦的快捷列：點一下選取的那格（按兩下、按滾輪才使用；原版介面另有圖，css/orig.css） */
html.pc .hot.sel { outline: 2px solid #ffd594; outline-offset: -2px; }
/* 背包裡按住 Shift 一起選的道具（js/ui.js multi） */
.slot.msel { outline: 2px solid #ffd76a; outline-offset: -2px; }
/* 魔法模式（Ctrl+X，js/main.js）：畫面左下角最後用的魔法 */
#magic-mode { position: fixed; left: 10px; bottom: 220px; z-index: 25; padding: 3px; line-height: 0; background: rgba(0, 0, 0, 0.55); border: 1px solid #c9a227; pointer-events: none; }
#magic-mode.hidden { display: none; }
/* 個人商店（2.21）關著時沒有擺攤的按鈕（js/ui.js 加 no-pshop） */
html.no-pshop #btn-stall, html.no-pshop #btn-stall-m, html.no-pshop [data-same="btn-stall"] { display: none !important; }
html:not(.is-elf) .elf-only { display: none !important; }
/* 詢問視窗：畫面中間，蓋在所有視窗（包括攻略）上面 */
#ask { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); }
#ask.hidden { display: none; }
.ask-box { width: min(340px, calc(100vw - 32px)); padding: 14px; background: var(--panel); border: 1px solid var(--border-hi); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7); }
#ask-text { margin: 0 0 10px; line-height: 1.6; white-space: pre-line; }
#ask-input { width: 100%; padding: 7px 10px; color: var(--text); background: #120d08; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 16px; }
#ask-input.hidden, #ask-fields.hidden, #ask-quick.hidden { display: none; }
/* 手機的數字鍵盤（js/numpad.js，老闆 11-18「做一個萬用數字鍵盤」）：直拿在下面、橫拿在右邊；問數量、商店倉庫的數量視窗讓開 */
#numpad { position: fixed; z-index: 1200; left: 50%; bottom: calc(6px + var(--sb, 0px)); transform: translateX(-50%); width: min(400px, calc(100vw - 12px)); box-sizing: border-box;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 50px; gap: 6px; padding: 8px; background: rgba(20, 15, 10, 0.97); border: 1px solid #8a6a34; border-radius: 8px;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.6); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#numpad.hidden { display: none; }
#numpad button { margin: 0; padding: 0; min-width: 0; font: 22px/1 var(--font); color: #f2e6c8; background: linear-gradient(#3a3026, #231c15); border: 1px solid #6b5432; border-radius: 6px; box-shadow: none; -webkit-tap-highlight-color: transparent; }
#numpad button:active, #numpad button.down { filter: brightness(1.35); }   /* .down：手指按著（touchstart 擋掉預設後 iPhone 沒有 :active） */
#numpad .np-back, #numpad .np-clear { font-size: 18px; color: #e8c890; }
#numpad .np-ok { grid-row: span 2; font-size: 20px; color: #1a1208; background: linear-gradient(#e8c06a, #b98a34); border-color: #f0d08a; }
html.numpad-on #ask, html.numpad-on #qty-pop { box-sizing: border-box; padding-bottom: var(--np-h, 0px); }
@media (orientation: landscape) {
  #numpad { left: auto; right: calc(6px + var(--sr, 0px)); top: 50%; bottom: auto; transform: translateY(-50%); width: 280px; grid-auto-rows: 42px; gap: 5px; padding: 7px; }
  html.numpad-on #ask, html.numpad-on #qty-pop { padding-bottom: 0; padding-right: var(--np-w, 0px); }
}
/* 面對面的動作選項（js/facemenu.js，老闆 11-18「2人面對面1秒 就會出現…第一個優先放交易 要在不影響打怪的地方」）：畫面最上面中間一小排，
   字是原版沒有圖的那種黃色底線字（像 買/賣）；電腦在原版那一張的上緣、照介面倍數放大 */
#face-menu { position: fixed; z-index: 8; left: 50%; top: calc(6px + var(--st, 0px)); transform: translateX(-50%); transform-origin: 50% 0; display: flex; align-items: center; gap: 2px;
  padding: 2px 4px 2px 8px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(138, 106, 52, 0.8); border-radius: 3px; white-space: nowrap; font: 13px/1.2 var(--font, serif);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#face-menu.hidden { display: none; }
#face-menu .fm-who { color: #cfc6b0; margin-right: 4px; max-width: 9em; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px #000; }
#face-menu button { margin: 0; padding: 5px 6px !important; min-width: 0; background: none !important; border: 0 !important; box-shadow: none !important; font: inherit !important;
  color: #f8f8b8 !important; text-decoration: underline; text-underline-offset: 3px; text-shadow: 0 1px 1px #000 !important; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#face-menu button.fm-first { color: #fff27a !important; font-weight: bold !important; }
#face-menu button.fm-x { color: #a89c84 !important; text-decoration: none; padding: 5px 6px 5px 8px !important; }
#face-menu button:hover { color: #ffffff !important; }
html.orig.pc #face-menu { top: calc(var(--f-top, 0px) + 6px * var(--hk, 1)); transform: translateX(-50%) scale(var(--hk, 1)); }
html.mobile #face-menu { font-size: 15px; }
html.mobile #face-menu button { padding: 8px 8px !important; }
@media (orientation: portrait) { html.mobile #face-menu { top: calc(var(--st, 0px) + 54px); } }   /* 直拿：左上角的輔助喝水圓鈕（#side-btns）下面，不蓋到它 */
/* 數量快速鍵（交易金幣 ＋1千／＋1萬／＋10萬／＋100萬／全部／清除）：一排，手指點得到 */
#ask-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#ask-quick button { flex: 1 1 0; min-width: 56px; min-height: 34px; padding: 6px 4px; font-size: 15px; white-space: nowrap; }
#ask-fields label { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
#ask-fields span { flex: none; color: var(--gold); }
#ask-fields input { flex: 1; min-width: 0; padding: 7px 10px; color: var(--text); background: #120d08; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 16px; }
.ask-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.ask-picks button { padding: 8px 4px; }
#ask-ok.hidden { display: none; }
.ask-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.ask-btns button { padding: 6px 18px; }
/* 擺攤：上面販賣 8 格、收購 8 格（格子下面是單價），宣傳文字＋開始擺攤，下面是背包的格子 */
/*   視窗高度有上限，東西多時背包那塊捲動。背包的東西拖到格子上；手指在背包直接滑是捲動、按住一下才拖 */
#win-stall { right: min(600px, calc(100vw - 368px)); top: 50px; width: 352px; display: flex; flex-direction: column; max-height: calc(100vh - 170px); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#win-stall.hidden { display: none; }
.stall-sec { flex: none; padding: 6px 10px 2px; color: var(--gold); font-size: 12px; }
.stall-grid { flex: none; display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; padding: 0 8px; }
.scell { display: flex; flex-direction: column; align-items: center; min-width: 0; touch-action: none; }
.scell:not(.empty) { cursor: grab; }
.scell .slot { width: 100%; aspect-ratio: 1; height: auto; }
.scell.empty .slot { border-style: dashed; opacity: 0.6; }
.scell .pr { max-width: 100%; min-height: 14px; overflow: hidden; font-size: 10px; line-height: 14px; color: #ffe9a0; white-space: nowrap; }
.stall-go-row { flex: none; display: flex; gap: 6px; padding: 8px; }
#stall-title { flex: 1; min-width: 0; padding: 5px 8px; color: var(--text); background: #120d08; border: 1px solid var(--border); border-radius: 4px; font: inherit; user-select: text; -webkit-user-select: text; }
#stall-title.hidden { display: none; }
.stall-go-row:has(#stall-title.hidden) { justify-content: center; }
#stall-title.hidden + #stall-go { min-width: 120px; }
#stall-title.need { border-color: #d05a4a; box-shadow: 0 0 6px rgba(208, 90, 74, 0.6); }
#stall-go { flex: none; }
#stall-bag-head { border-top: 1px solid #3a2c1a; margin-top: 4px; }
#stall-bag { flex: 1 1 auto; min-height: 48px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 3px; padding: 2px 8px 8px; align-content: start; }
#stall-bag .slot { width: 40px; height: 40px; cursor: grab; touch-action: pan-y; }
.drag-ghost { position: fixed; z-index: 1200; width: 40px; height: 40px; pointer-events: none; opacity: 0.6; }
#stall-bag .slot.on { opacity: 0.35; }   /* 已經放上去的 */
#win-board { left: 50%; top: 14%; transform: translateX(-50%); width: 360px; max-height: 70vh; overflow-y: auto; }
#win-board .shop-row { cursor: pointer; }
#win-letter { left: 50%; top: 14%; transform: translateX(-50%); width: 360px; max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
#win-letter input, #win-letter textarea { box-sizing: border-box; }
/* 信紙、信件的輸入欄：和問數量的輸入欄（#ask-input）一樣深色底、亮字（畫面檢查 11-10：瀏覽器預設的白底在石框裡很刺眼） */
:is(#win-letter, #win-mail) :is(input, textarea) { padding: 6px 8px; color: var(--text); background: #120d08; border: 1px solid var(--border); border-radius: 4px; font: inherit; }
:is(#win-letter, #win-mail) :is(input, textarea)::placeholder { color: rgba(240, 230, 204, 0.45); }
/* 信件（js/ui.js renderMail）：和信紙同一個位置、大小；上面三個分頁，目錄一封一行（沒讀的 ● 和亮一點的字） */
#win-mail { left: 50%; top: 14%; transform: translateX(-50%); width: 380px; max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
#win-mail input, #win-mail textarea { box-sizing: border-box; }
/* 料理書（js/ui.js renderCook）：一道一行（成品圖示、名稱、食譜），右邊「製作」 */
#win-cook { left: 50%; top: 14%; transform: translateX(-50%); width: 420px; max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
#cook-body .shop-row .grow { min-width: 0; overflow-wrap: anywhere; }
#cook-body .shop-row button { flex: none; }
.mail-tabs { display: flex; gap: 4px; padding: 6px 8px 0; }
.mail-tabs button { flex: 1; padding: 4px 0; font-size: 13px; }
.mail-tabs button.on { border-color: var(--border-hi); color: #fff3cf; }
.mail-list { padding: 4px 8px; }
.mail-row { display: flex; gap: 6px; align-items: baseline; padding: 5px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer; font-size: 13px; }
.mail-row:hover { background: rgba(255, 240, 200, 0.08); }
.mail-row.unread .mail-sub { color: #fff3cf; font-weight: bold; }
.mail-dot { width: 10px; flex: none; color: #ffd34d; }
/*   名字、主旨不裁掉（畫面檢查 11-10：名字固定 82 寬、主旨一行，長的被「…」切掉）：名字照字的寬，主旨長的換行 */
.mail-row > .dim { flex: none; }
.mail-who { flex: none; white-space: nowrap; }
.mail-sub { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#win-auction { left: 50%; top: 12%; transform: translateX(-50%); width: 400px; max-height: 72vh; overflow-y: auto; }
#win-clanpick { left: 50%; top: 12%; transform: translateX(-50%); width: 320px; max-height: 72vh; overflow-y: auto; }
#win-emblem { left: 50%; top: 12%; transform: translateX(-50%); width: 300px; }
.emblem-box { display: flex; justify-content: center; padding: 10px; }
#emblem-edit { width: 256px; height: 192px; image-rendering: pixelated; border: 1px solid var(--border-hi); cursor: crosshair; touch-action: none; }
.emblem-tools { display: flex; align-items: center; gap: 8px; padding: 0 10px 6px; }
#emblem-pal { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; flex: 1; }
#emblem-pal button { height: 20px; min-width: 0; padding: 0; border: 1px solid #000; }
#emblem-pal button.on { outline: 2px solid #ffe08a; outline-offset: 0; }
#emblem-color { width: 40px; height: 44px; padding: 0; border: 1px solid var(--border); background: none; }
#emblem-up { flex: 1; }
#win-trade .grid { min-height: 44px; }
#win-trade .grid > .dim { grid-column: 1 / -1; }
#party-body .bar.mini { height: 8px; margin-top: 3px; }
/* 社交視窗（現代介面）：標題、一行一個選項、說明小字（原版介面在 css/orig.css） */
#party-body .soc-title { font-weight: bold; margin: 6px 8px; }
#party-body .soc-opt { margin: 4px 8px; }
#party-body .soc-opt button { width: 100%; text-align: left; }
#party-body .soc-note { margin: 6px 8px; font-size: 12px; }
#win-shop, #win-learn { left: 12px; top: 50px; width: 350px; }
#shop-body, #learn-body { max-height: 460px; overflow-y: auto; }

/* 紙娃娃 */
.doll { display: flex; gap: 6px; padding: 8px 10px 4px; border-bottom: 1px solid #3a2c1a; background: radial-gradient(ellipse at 30% 60%, rgba(120, 90, 50, 0.25), transparent 70%); }
.doll-figure { position: relative; width: 110px; height: 150px; }
#doll-canvas { width: 110px; height: 150px; }
#doll-turn { position: absolute; left: 2px; bottom: 2px; padding: 0 6px; font-size: 12px; }
#doll-slots { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; align-content: start; }
.dslot { width: 44px; height: 44px; background: radial-gradient(#2a2016, #120d08); border: 1px solid #4a3a26; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #5a4a36; }
.dslot[data-uid] { border-color: #8a6d3b; cursor: pointer; }
.dslot .icon { width: 40px; height: 40px; }

.inv-gold { padding: 6px 12px; display: flex; align-items: center; gap: 6px; } .inv-gold b { color: var(--gold); }
.inv-w { margin-left: auto; }
#inv-trash { display: flex; padding: 3px; border: 1px solid #5a4a3a; border-radius: 3px; color: #b8a890; }
#inv-trash.over { color: #ff8a70; border-color: #c05040; background: #3a1a14; }
#inv-sort { display: flex; margin-left: 6px; padding: 3px; border: 1px solid #5a4a3a; border-radius: 3px; color: #b8a890; cursor: pointer; }   /* 一鍵整理（老闆 11-16「用圖示」） */
#inv-sort svg { width: 16px; height: 16px; }
html.mobile #inv-trash { display: none; }
.grid { display: grid; grid-template-columns: repeat(6, 42px); gap: 3px; padding: 4px 10px 10px; max-height: 260px; overflow-y: auto; overflow-x: hidden; }
.slot { width: 42px; height: 42px; background: radial-gradient(#241a12, #100b06); border: 1px solid #34281a; border-radius: 3px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.slot:hover { border-color: var(--border-hi); }
.slot.pick, .dslot.pick { border-color: #7fb2ff; box-shadow: 0 0 6px #7fb2ff; }
.slot.lit { box-shadow: inset 0 0 10px rgba(255, 210, 110, 0.65); }
/* 拖著的道具縮圖：半透明（老闆 11-14「手機板 拖曳 道具 應該也要有半透明道具縮圖」；之前 0.85 看起來是實的），在所有視窗上面 */
#drag-ghost { position: fixed; z-index: 1300; width: 36px; height: 36px; pointer-events: none; opacity: 0.6; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); }

.tip-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tip-head img { width: 28px; height: 28px; }
.tip-bound { color: #ffb070; }   /* 不可轉移（預約禮包開出來的） */
.tip-note { color: #e8dcb0; }   /* 道具的用途（新手救濟包，L.ITEM_NOTE） */

#char-body { padding: 10px 12px; }
.char-name { font-size: 15px; font-weight: bold; color: var(--gold); margin-bottom: 8px; }
.char-grid { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin-bottom: 10px; }
.char-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; padding: 8px 0; border-top: 1px solid #4a3a26; }
.stat-row { display: flex; justify-content: space-between; gap: 8px; }

.spell-row, .shop-row { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid #2e2416; cursor: pointer; }
.spell-row:hover, .shop-row:hover { background: rgba(255, 220, 150, 0.06); }
.shop-row { cursor: default; } .shop-row .grow { flex: 1; } .shop-row .price { color: var(--gold); min-width: 46px; text-align: right; }
.shop-row.poor .price { color: #b55; }
.shop-row.cant b { color: var(--dim); }
.tabs { display: flex; gap: 4px; padding: 6px 8px 0; }
.tab.active { background: linear-gradient(#9a7430, #5c4416); color: #fff3cf; }
.help p { margin: 5px 0; line-height: 1.55; }

#tooltip { position: fixed; z-index: 30; max-width: 260px; padding: 7px 9px; background: rgba(12, 9, 6, 0.96); border: 1px solid var(--border); border-radius: 4px; line-height: 1.55; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); }
#tooltip b { color: var(--gold); } #tooltip .hint { color: #9fd3ff; }

/* 創角與死亡 */
#login, #select, #create { z-index: 40; }   /* 登入、選角、創角蓋住遊戲畫面上的聊天輸入框等（z-index 30） */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(30, 24, 14, 0.75), rgba(4, 6, 12, 0.92)); }
.panel { width: 360px; max-width: calc(100vw - 32px); padding: 20px 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; text-align: center; box-shadow: 0 0 0 1px #1a120a, 0 10px 40px rgba(0, 0, 0, 0.7); }
.panel h1 { margin: 0 0 10px; font-size: 22px; color: var(--gold); letter-spacing: 6px; text-shadow: 0 2px 4px #000; }
.create-panel { width: 470px; }
/* 選角：等待刪除的角色變灰，下面寫還剩多久 */
.slot-col.deleting { position: relative; }
.slot-col.deleting canvas { filter: grayscale(1) brightness(0.65); }
.del-left { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; color: #ffb0a0; text-shadow: 0 1px 2px #000; pointer-events: none; }
/* 結束視窗（重新開始、離開遊戲、取消）：死掉時取消可以關掉看屍體，點遊戲畫面再打開；背景只稍微變暗，看得到躺在地上的自己 */
#dead { background: rgba(4, 6, 12, 0.35); }
.choice { display: flex; gap: 4px; justify-content: center; margin-bottom: 6px; } .choice .gap { width: 14px; }
.choice button.active { background: linear-gradient(#9a7430, #5c4416); color: #fff3cf; border-color: var(--gold); }
.desc { min-height: 36px; margin: 6px 0; line-height: 1.5; }
.hpmp { margin: 4px 0 0; color: var(--gold); }
.create-main { display: flex; gap: 18px; align-items: center; justify-content: center; }
#create-preview { width: 120px; height: 130px; background: radial-gradient(ellipse at 50% 80%, rgba(140, 110, 60, 0.35), transparent 70%); }
#create-die { font-size: 34px; }
#create-die.spin { animation: spin 0.45s ease-out; }
@keyframes spin { from { transform: rotate(-360deg) scale(0.6); } to { transform: rotate(0) scale(1); } }
#create-stats { width: 160px; text-align: left; }
#create-stats .stat-row { padding: 2px 0; white-space: nowrap; }
.create-panel .choice button { white-space: nowrap; }   /* 視窗窄時「王族」不要折成兩行 */
#create-stats .stat-row.main span { color: var(--gold); }
#create-stats .stat-row { align-items: center; } #create-stats .stat-row span { margin-right: auto; }
#create-stats b { color: #fff; min-width: 20px; text-align: center; }
#create-stats .st-btn { width: 22px; height: 18px; padding: 0; font-size: 12px; line-height: 16px; } #create-stats .st-btn:disabled { opacity: 0.35; cursor: default; }
#create-stats .total { border-top: 1px solid #4a3a26; margin-top: 4px; padding-top: 4px; } #create-stats .total b { color: var(--gold); }
#create-name { margin: 8px 0 12px; width: 100%; padding: 6px 8px; font-family: var(--font); font-size: 14px; color: var(--text); background: #120d08; border: 1px solid var(--border); border-radius: 3px; text-align: center; }
/* 登入（連線版） */
.login-panel { width: 300px; max-width: calc(100vw - 32px); }
/* 開頭動畫（index.html）：蓋住一切，鋪滿畫面（橫的畫面放橫式、直的放直式）。
   底色要黑：iPhone 從主畫面打開時，狀態列的顏色取自一開始蓋在最上面的東西（老闆 11-07 的截圖：一直是這裡的天空藍） */
#opening { position: fixed; inset: 0; z-index: 5000; overflow: hidden; background: #000; cursor: pointer; touch-action: none; transition: opacity 0.4s; }
#opening.out { opacity: 0; }
#opening video { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-aspect-ratio: 1/1) { #opening video { object-fit: contain; } }
/* 停在第一格時下面一行「開始遊戲」（index.html）：一閃一閃（老闆 11-09「開始遊戲閃動再稍微明顯一點」：字大一點、金色發光，暗的時候更暗、亮的時候稍微放大） */
#opening-tap { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font: 900 24px/1.4 "PMingLiU", "MingLiU", "Noto Serif TC", serif; letter-spacing: 6px; text-indent: 6px; color: #fff3c8;
  text-shadow: 0 0 2px #000, 0 0 6px #000, 0 2px 4px #000, 0 0 14px rgba(255, 196, 80, 0.9); pointer-events: none; animation: opening-tap 0.9s ease-in-out infinite alternate; }
#opening-tap.hidden { display: none; }
/* 開頭動畫還在的時候，底下的登入畫面先藏起來（老闆 11-09「開頭就在問密碼了」：iPhone 的「密碼」看到畫面上有帳號、密碼欄就跳出「登入：使用你的密碼？」，
   登入畫面在動畫底下已經排好了，動畫一開就問）。動畫播完拿掉 #opening 才顯示，到登入畫面才問 */
#opening ~ #login { visibility: hidden; }
@keyframes opening-tap { from { opacity: 0.2; transform: scale(0.96); } to { opacity: 1; transform: scale(1.06); } }
/* 第一次執行的下載畫面（js/preload.js） */
#preload { z-index: 30; align-items: flex-end; justify-content: center; padding-bottom: 12vh; }   /* 手機的 .overlay 靠左排，這裡要置中 */
#preload.boot .first { display: none; }   /* 不是第一次：只有進度條 */
#preload { background: radial-gradient(ellipse at center, #1e180e, #040509) #040509; }   /* 不透明：後面的介面一點都不露出來（原版介面另外換成標誌，css/orig.css） */
.preload-box { width: 320px; max-width: calc(100vw - 32px); text-align: center; color: #f0e6cc; text-shadow: 0 1px 3px #000; }
.preload-box p { margin: 4px 0; }
.preload-track { height: 8px; margin: 10px 0 4px; background: rgba(0, 0, 0, 0.6); border: 1px solid #6a5a3a; }
#preload-bar { width: 0; height: 100%; background: linear-gradient(#e8c766, #a07a2a); transition: width 0.2s; }
/* 下載比較久時的說明（js/preload.js busy；第一次執行、之後開網頁都會出現） */
.preload-busy { margin: 0 0 10px; padding: 10px 12px; background: rgba(0, 0, 0, 0.55); border: 1px solid #6a5a3a; border-radius: 4px; }
.preload-busy.hidden, .preload-busy .hidden { display: none; }
.preload-busy .pb-title { color: #ffd98a; font-weight: bold; }
.preload-busy .pb-tip { min-height: 1.5em; color: #e6dcc0; font-size: 0.92em; transition: opacity 0.4s; }
.preload-busy .pb-tip:empty { display: none; }   /* 程式還沒下載完時還沒有小提示：不留空白 */
.preload-busy .dim { font-size: 0.86em; }
.login-guide { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid #3a2c1a; text-align: center; color: var(--dim); font-size: 13px; }
.login-guide a { color: var(--gold); font-weight: bold; }
.login-panel input { display: block; margin: 0 0 10px; width: 100%; padding: 7px 8px; font-family: var(--font); font-size: 15px; color: var(--text); background: #120d08; border: 1px solid var(--border); border-radius: 3px; }
/* 登入畫面的提醒視窗（密碼錯誤、要不要建立新帳號；js/net.js loginAsk）：仿登入圖左邊公告欄——
   深褐色半透明底、細金框裡再一圈暗金線、楷書的字、金色的字當按鈕（像圖上的「登錄」「離開遊戲」）；蓋在登入圖上，後面壓暗 */
.login-panel { position: relative; }
.login-dlg { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); }
.login-dlg.hidden { display: none; }
.login-dlg-box { width: min(270px, 92%); padding: 18px 18px 12px; text-align: center; color: #f4ecd8;
  font-family: "DFKai-SB", "BiauKai", "Kaiti TC", "STKaiti", "KaiTi", serif;
  background: rgba(30, 20, 11, 0.95); border: 1px solid #d2ab5f;
  box-shadow: inset 0 0 0 3px rgba(30, 20, 11, 0.95), inset 0 0 0 4px #7d5626, 0 0 0 1px #2a1a0a, 0 6px 24px rgba(0, 0, 0, 0.85); }
.login-dlg-box p { margin: 0; font-size: 16px; line-height: 1.6; white-space: pre-line; text-shadow: 0 1px 2px #000; }
/*   分隔線：兩邊淡掉的金線，中間一顆菱形（公告欄每段之間的花樣） */
.login-dlg-sep { position: relative; height: 9px; margin: 10px 8px 6px; background: linear-gradient(90deg, transparent, #b8893c 30%, #b8893c 70%, transparent) center / 100% 1px no-repeat; }
.login-dlg-sep::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; transform: translate(-50%, -50%) rotate(45deg); background: #e2c27a; box-shadow: 0 0 0 2px rgba(30, 20, 11, 0.95), 0 0 6px rgba(226, 194, 122, 0.6); }
.login-dlg-btns { display: flex; justify-content: center; gap: 32px; }
#login .login-dlg-btns button, #notice-dlg .login-dlg-btns button, #queue-dlg .login-dlg-btns button { min-width: 0; padding: 2px 8px; font: inherit; font-size: 18px; color: #f2d48a; background: none; border: 0; border-radius: 0; box-shadow: none;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(210, 171, 95, 0.35); cursor: pointer; }
#login .login-dlg-btns button:hover, #login .login-dlg-btns button:focus-visible,
#notice-dlg .login-dlg-btns button:hover, #notice-dlg .login-dlg-btns button:focus-visible { color: #fff4cc; text-shadow: 0 1px 2px #000, 0 0 10px rgba(255, 220, 140, 0.8); outline: none; }
#login .login-dlg-btns button.hidden, #notice-dlg .login-dlg-btns button.hidden { display: none; }
/* 其他畫面的提醒視窗（創角、選角、討論版……；js/ui.js L.notice）：和登入的同一個樣子，蓋住整個畫面（引導 #tut 之上） */
#notice-dlg { position: fixed; z-index: 4000; }
/* 排隊（伺服器人數滿了，js/net.js queue）：和提醒視窗同一個樣子，蓋在登入畫面、遊戲畫面之上 */
#queue-dlg { position: fixed; z-index: 4001; }
#queue-dlg .login-dlg-box { width: min(320px, 92%); }
#queue-dlg .login-dlg-btns button:hover, #queue-dlg .login-dlg-btns button:focus-visible { color: #fff4cc; outline: none; }
/* 新角色的引導（js/tutorial.js）：整個畫面擋住，要看的地方挖亮一塊、金邊一閃一閃，說明是泡泡框（和擺攤的招牌同一個樣子：淺色細框、尖角、白字） */
.learn-mats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.learn-mats button { padding: 1px 6px; font-size: 12px; }
.g-steps { margin: 6px 0 12px; padding-left: 1.6em; }
.g-steps li { margin: 6px 0; line-height: 1.65; }
#tut { position: fixed; inset: 0; z-index: 3000; touch-action: none; }
#tut.hidden { display: none; }
#tut .tut-dim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.66); pointer-events: none; }
#tut .tut-hole { position: fixed; border-radius: 8px; pointer-events: none; box-sizing: border-box; outline: 2px solid #f2d48a; outline-offset: 0; animation: tut-pulse 1.2s ease-in-out infinite; }
@keyframes tut-pulse { 50% { outline-color: rgba(242, 212, 138, 0.25); } }
#tut .tut-tip { position: fixed; max-width: min(420px, calc(100vw - 24px)); padding: 12px 18px; text-align: center; color: #fff; font-family: var(--font); font-size: 17px; line-height: 1.45; }
#tut .tut-frame { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#tut .tut-frame path { fill: none; stroke-linejoin: round; }
#tut .tut-frame .o { fill: rgba(0, 0, 0, 0.74); stroke: rgba(0, 0, 0, 0.55); stroke-width: 3.5px; }
#tut .tut-frame .i { stroke: rgba(255, 250, 230, 0.95); stroke-width: 1.4px; }
#tut .tut-tip p { position: relative; margin: 0; white-space: pre-line; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 2px #000; }
/* 自動播放：泡泡裡一條細線走完就換下一段（知道不是當機，也不用找「下一步」） */
#tut .tut-bar { display: none; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; background: rgba(255, 250, 230, 0.8); transform-origin: 0 50%; }
#tut .tut-tip.auto { padding-bottom: 15px; }
#tut .tut-tip.auto .tut-bar { display: block; }
#tut .tut-tip.pop { animation: tut-pop 0.3s 0.2s both; }
#tut .tut-tip.pop.auto .tut-bar { animation: tut-bar linear both; }
@keyframes tut-pop { from { opacity: 0; transform: translateY(4px); } }
@keyframes tut-bar { from { transform: scaleX(0); } }
#tut .tut-tip.nudge { animation: tut-nudge 0.35s; }
@keyframes tut-nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { #tut .tut-hole { animation: none; } }
/* 選擇角色 */
/* 選擇角色（照原版）：黑色的畫面，上面一排打光的欄位（js/render.js L.drawSelectSlot），下面左邊是角色資料、右邊是按鈕 */
#select { background: #000; }
.select-panel { --sh: min(292px, 52vh); display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: calc(100vw - 16px); margin: auto; }
#select-slots { display: grid; grid-template-columns: repeat(6, calc(var(--sh) * 132 / 292)); gap: 3px; }
.slot-col { height: var(--sh); cursor: pointer; box-shadow: 0 0 0 1px #141414; }
.slot-col canvas { display: block; width: 100%; height: 100%; }
.select-bottom { display: flex; gap: 14px; align-items: stretch; width: 100%; max-width: 640px; }
#select-info { flex: 1; min-width: 0; display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 18px; padding: 10px 12px; background: linear-gradient(#0c0c0c, #050505); border: 1px solid #2a2622;
  font: 13px/1 "Times New Roman", "PMingLiU", "MingLiU", serif; text-align: left; }
#select-info.empty { visibility: hidden; }
#select-info > div { display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 3px 6px; }
#select-info label { color: #f0d890; text-shadow: 0 0 4px rgba(255, 200, 90, 0.35); white-space: nowrap; line-height: 18px; }
#select-info label::after { content: "　:"; color: #c8c0b0; }
#select-info label.hp { color: #f0b0a8; }
#select-info label.mp { color: #a8c4f0; }
#select-info span { height: 18px; line-height: 18px; padding: 0 6px; background: #1a1a1a; border: 1px solid #2c2c2c; color: #f0ece0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--font); font-size: 12px; }
#select-info i { grid-column: 1 / -1; height: 6px; }
.select-bottom .btns { display: flex; flex-direction: column; gap: 6px; margin: 0; width: 120px; }
.select-bottom .btns button { width: 100%; margin: 0; }
.btns button:disabled { opacity: 0.4; cursor: default; }
.btns { display: flex; gap: 10px; justify-content: center; }
.btns button { padding: 6px 18px; font-size: 14px; }

/* 電腦介面的視窗很窄時（手機介面在檔案最後面） */
@media (max-width: 760px) {
  html.pc:not(.cw) #hud { flex-wrap: wrap; height: auto; gap: 6px; padding-bottom: 16px; }
  html.pc:not(.cw) .hud-left { width: 100%; }
  html.pc:not(.cw) .hot { width: 36px; height: 36px; }
  html.pc:not(.cw) #log { bottom: 160px; height: 100px; }
  html.pc:not(.cw) #chat-input { bottom: 132px; }
  html.pc:not(.cw) #win-inv, html.pc:not(.cw) #win-char, html.pc:not(.cw) #win-spell, html.pc:not(.cw) #win-shop, html.pc:not(.cw) #win-learn, html.pc:not(.cw) #win-wh, html.pc:not(.cw) #win-party, html.pc:not(.cw) #win-trade, html.pc:not(.cw) #win-stall { left: 16px; right: 16px; width: auto; top: 50px; bottom: auto; }
}

/* NPC 對話、傳送、變身、地圖 */
#win-npc { left: 50%; top: 18%; transform: translateX(-50%); width: 400px; max-width: calc(100vw - 20px); }
#npc-text { margin: 0; line-height: 1.6; max-height: 56vh; overflow-y: auto; }
#npc-text p { margin: 0 0 8px; }
#npc-text p:last-child { margin-bottom: 0; }
#npc-text .shop-row { padding: 6px 2px; gap: 8px; }
#npc-text .shop-row button { padding: 4px 8px; }
.npc-opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
#win-tele, #win-poly, #win-blank { left: 50%; top: 18%; transform: translateX(-50%); width: 340px; }
#win-pet { left: 50%; top: 22%; transform: translateX(-50%); width: 320px; }
#pet-body { line-height: 1.7; }
#pet-body .bar { margin: 2px 0 4px; }
#pet-cmds button.active { background: linear-gradient(#9a7430, #5c4416); color: #fff3cf; border-color: var(--gold); }
#tele-body, #poly-body, #blank-body { max-height: 320px; overflow-y: auto; }
/* 變身清單：依等級分段的名字格子，解除變身固定在最下面 */
#win-poly { width: 400px; }
#poly-body { display: flex; flex-direction: column; overflow: hidden; max-height: min(460px, 70vh); }
.poly-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 10px 8px; }
.poly-lv { color: var(--gold); font-size: 12px; margin: 8px 0 4px; padding-bottom: 2px; border-bottom: 1px solid #3a2c1a; }
.poly-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.poly-pick { padding: 5px 2px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poly-pick:disabled { opacity: 0.35; cursor: default; }
.poly-pick.now { border-color: var(--gold); color: #fff3cf; }
.poly-off { flex: none; padding: 8px 10px; border-top: 1px solid #3a2c1a; text-align: right; }
.poly-off button { color: #ffb4a0; }
.tele-foot { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid #3a2c1a; }
.tele-foot input { flex: 1; min-width: 0; padding: 4px 6px; font-family: var(--font); color: var(--text); background: #120d08; border: 1px solid var(--border); border-radius: 3px; }
#win-map { left: 50%; top: 50px; transform: translateX(-50%); }
.map-wrap { position: relative; padding: 8px; max-width: 90vw; max-height: 72vh; overflow: auto; }
#map-canvas { image-rendering: pixelated; width: min(680px, 86vw); }
/* 世界地圖（地圖:大陸全圖，js/ui.js openWorldMap）：底圖 #wm-img 放大縮小、拖曳只改 #wm-layer 的 transform（不重畫圖）；
   #wm-over 是照視窗大小的畫布（地名、城堡、沒開放的地區），#wm-me 自己的位置（紅點和一圈一圈擴散的紅色光圈，CSS 動畫）。
   電腦置中的大視窗；手機接近滿版 */
#win-world { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1100px, calc(100vw - 80px)); height: min(740px, calc(100vh - 70px)); display: flex; flex-direction: column; z-index: 35; }
#wm-view { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #144e71; touch-action: none; cursor: grab; }
#wm-view.drag { cursor: grabbing; }
#wm-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#wm-img, #wm-cv { display: block; width: 100%; height: 100%; image-rendering: auto; pointer-events: none; -webkit-user-drag: none; }
#wm-over { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: auto; }
#wm-me { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #ff2a18; box-shadow: 0 0 0 2px #fff4d0, 0 0 6px 2px rgba(0, 0, 0, 0.7); pointer-events: none; z-index: 2; }
#wm-me::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; box-sizing: border-box; border: 3px solid #ff3a20; border-radius: 50%; box-shadow: 0 0 6px rgba(255, 60, 30, 0.8); animation: wm-ping 1.1s ease-out infinite; }
@keyframes wm-ping { from { transform: scale(0.25); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
#wm-msg { position: absolute; left: 0; top: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--gold); text-shadow: 0 1px 2px #000; pointer-events: none; }
/*   --wk：按鈕、下面那行字放大幾倍（電腦的原版介面跟著 --hk，css/orig.css；地名牌子 js/ui.js wmDraw 也照這個） */
#wm-btns { position: absolute; right: calc(8px * var(--wk, 1)); bottom: calc(8px * var(--wk, 1)); z-index: 3; display: flex; flex-direction: column; gap: calc(4px * var(--wk, 1)); }
#wm-btns button { width: calc(32px * var(--wk, 1)); height: calc(32px * var(--wk, 1)); padding: 0; font-weight: bold; font-size: calc(17px * var(--wk, 1)); line-height: 1; color: #f2d98c; background: rgba(20, 14, 8, 0.86); border: 1px solid #c9a24e; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85); }
#wm-where { flex: none; height: calc(26px * var(--wk, 1)); padding: calc(5px * var(--wk, 1)) calc(10px * var(--wk, 1)); font-size: calc(13px * var(--wk, 1)); line-height: calc(16px * var(--wk, 1)); color: #f0e2bc; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mobile #win-world { left: calc(4px + var(--sl, 0px)); right: calc(4px + var(--sr, 0px)); top: calc(4px + var(--st, 0px)); bottom: calc(4px + var(--sb, 0px)); width: auto; height: auto; max-height: none; transform: none; z-index: 50; }
html.mobile #wm-btns button { width: 40px; height: 40px; font-size: 20px; }
/* 座標查詢（老闆 11-16）：左上角兩格數字＋查詢；查到的位置是黃點 #wm-pin（不閃，和自己的紅點分得出來）。
   手機（老闆「注意行動裝置操作舒適度」）：按鈕、格子 40 高好按，字 16px（iPhone 輸入框的字小於 16 會自動放大畫面） */
#wm-find { position: absolute; left: calc(8px * var(--wk, 1)); top: calc(8px * var(--wk, 1)); z-index: 3; display: flex; gap: calc(4px * var(--wk, 1)); margin: 0; }
#wm-find input, #wm-find button { box-sizing: border-box; height: calc(30px * var(--wk, 1)); font-size: calc(14px * var(--wk, 1)); color: #f2d98c; background: rgba(20, 14, 8, 0.86); border: 1px solid #c9a24e; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85); outline: none; }
#wm-find input { width: calc(76px * var(--wk, 1)); padding: 0 calc(6px * var(--wk, 1)); font-family: inherit; user-select: text; -webkit-user-select: text; }
#wm-find input::placeholder { color: #9c8a64; }
#wm-find input:focus { border-color: #ffe066; }
#wm-find button { padding: 0 calc(10px * var(--wk, 1)); font-weight: bold; cursor: pointer; }
html.mobile #wm-find { left: 6px; top: 6px; gap: 6px; }
html.mobile #wm-find input, html.mobile #wm-find button { height: 40px; font-size: 16px; }
html.mobile #wm-find input { width: 88px; }
html.mobile #wm-find button { min-width: 60px; }
/* 搜尋地名、NPC（老闆 11-16「打吉倫 就標出位置」）：座標那一排的下面，同一套樣子；手機一樣 40 高、字 16px */
#wm-name { position: absolute; left: calc(8px * var(--wk, 1)); top: calc(42px * var(--wk, 1)); z-index: 3; display: flex; gap: calc(4px * var(--wk, 1)); margin: 0; }
#wm-name input, #wm-name button { box-sizing: border-box; height: calc(30px * var(--wk, 1)); font-size: calc(14px * var(--wk, 1)); color: #f2d98c; background: rgba(20, 14, 8, 0.86); border: 1px solid #c9a24e; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85); outline: none; }
#wm-name input { width: calc(156px * var(--wk, 1)); padding: 0 calc(6px * var(--wk, 1)); font-family: inherit; user-select: text; -webkit-user-select: text; -webkit-appearance: none; appearance: none; }
#wm-name input::placeholder { color: #9c8a64; }
#wm-name input:focus { border-color: #ffe066; }
#wm-name button { padding: 0 calc(10px * var(--wk, 1)); font-weight: bold; cursor: pointer; }
html.mobile #wm-name { left: 6px; top: 52px; gap: 6px; }
html.mobile #wm-name input, html.mobile #wm-name button { height: 40px; font-size: 16px; }
html.mobile #wm-name input { width: 182px; }
html.mobile #wm-name button { min-width: 60px; }
#wm-pin { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #ffd84a; box-shadow: 0 0 0 2px #3a2a08, 0 0 0 4px #ffd84a, 0 0 8px 3px rgba(0, 0, 0, 0.7); pointer-events: none; z-index: 2; }
html.mobile #wm-where { height: 24px; font-size: 12px; padding: 4px 8px; }

/* ───────── 手機介面（html.mobile；電腦介面不受影響）───────── */
/* --hudh：左上角狀態框（HP、MP、經驗值）的高度；視窗開在它下面，不會把它蓋住 */
/* --vt、--vb：瀏覽器的網址列、工具列蓋在網頁上的高度（js/screen.js 量 visualViewport），上下的東西避開它們 */
/* 安全區：手機在外框 play.html 的框裡時，外框量好、照轉的方向換過，放在 --sa-t／r／b／l（框裡的 env() 量不到） */
:root { --st: calc(var(--sa-t, env(safe-area-inset-top, 0px)) + var(--vt, 0px)); --sr: var(--sa-r, env(safe-area-inset-right, 0px)); --sb: calc(var(--sa-b, env(safe-area-inset-bottom, 0px)) + var(--vb, 0px)); --sl: var(--sa-l, env(safe-area-inset-left, 0px)); --hudh: 90px; }
/* iPhone 的 Home 橫條（老闆 11-07：貼齊下緣時下面的按鈕被擋到，要和最上面一樣留空，背景黑色；11-01 那時是貼齊的）：
   介面整塊往上（--sb），橫條那一條塗黑。瀏覽器裡這個高度是 0，不會多出來 */
html.mobile body::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: var(--sa-b, env(safe-area-inset-bottom, 0px)); background: #000; z-index: 4500; pointer-events: none; }
html:not(.mobile) .only-mobile { display: none !important; }
html.mobile .only-pc, html.mobile .kbd, html.mobile .hot .key { display: none !important; }
/* 原版介面的 ☰（手機的設定）不放玩家廣場（老闆 11-09「設定裡面拿掉玩家廣場」；從右下角的問號開）；現代介面的 ☰ 是唯一的入口，照舊 */
html.classic #btn-guide-m { display: none !important; }
html.mobile { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* 手機：視窗（魔法列表等）捲到頂再往下拉，不會變成瀏覽器的下拉重新整理 */
html.mobile, html.mobile body { overscroll-behavior: none; }
html.mobile * { overscroll-behavior: contain; }
html.mobile body { font-size: 12px; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
/* iPhone 不理會禁止縮放：連點兩下不放大（manipulation），輸入框的字至少 16px（小於 16px 時 Safari 一點輸入框就放大，而且不會縮回來） */
html.mobile, html.mobile body { touch-action: manipulation; }
html.mobile input, html.mobile textarea, html.mobile select { font-size: 16px !important; }
html.mobile button { touch-action: manipulation; }
html.mobile #game, html.mobile #hotbar, html.mobile #btn-pickup, html.mobile #btn-pk { touch-action: none; }

/* 狀態列拆開放在畫面四周，中間留給遊戲畫面 */
html.mobile #hud { position: fixed; inset: 0; height: auto; padding: 0; display: block; background: none; border: 0; box-shadow: none; pointer-events: none; }
html.mobile #hud > * { pointer-events: auto; }
html.mobile #hud > .hud-left { position: absolute; left: calc(6px + var(--sl)); top: calc(6px + var(--st)); width: 196px; gap: 3px; padding: 5px 7px; background: rgba(14, 10, 6, 0.62); border: 1px solid rgba(138, 109, 59, 0.55); border-radius: 6px; pointer-events: none; }
html.mobile .bar { height: 14px; }
html.mobile .bar .lbl, html.mobile .bar .val { font-size: 10px; line-height: 14px; }
html.mobile .hud-left .exp { position: relative; height: 11px; border: 1px solid #4a3a26; border-radius: 5px; overflow: hidden; }
html.mobile .hud-left .exp span { font-size: 9px; line-height: 10px; }
html.mobile .hud-info { font-size: 11px; gap: 5px; }
html.mobile .hud-right { position: absolute; right: calc(6px + var(--sr)); top: calc(6px + var(--st)); margin: 0; gap: 4px; }
html.mobile .hud-right button { width: 48px; height: 36px; padding: 0; }
/* 橫的：右上角一排（視窗、☰；攻略・討論在 ☰ 選單裡），選單往下開；撿取在右下角 */
html.mobile #mmenu { top: calc(48px + var(--st)); right: calc(6px + var(--sr)); }
html.mobile #btn-pickup { right: calc(14px + var(--sr)); bottom: calc(14px + var(--sb)); }
html.mobile #btn-pk { top: calc(48px + var(--st)); }
/* 地名在狀態框下面（右上角的按鈕一排很長，橫的時候放中間會被蓋住） */
html.mobile #topbar { top: calc(90px + var(--st)); left: calc(8px + var(--sl)); right: auto; pointer-events: none; }
html.mobile #topbar > button { display: none; }
html.mobile #zone-tag { position: static; align-self: flex-start; }
html.mobile #zone-tag b { font-size: 10px; padding: 1px 5px; }
html.mobile #hud-zone { font-size: 11px; text-align: left; white-space: nowrap; }
html.mobile #hud-zone .clock { display: block; margin: 1px 0 0; font-size: 10px; }
html.mobile #buffs { left: calc(6px + var(--sl)); top: calc(124px + var(--st)); max-width: 45vw; pointer-events: none; }
html.mobile #buffs .bicon { pointer-events: auto; }   /* 點圖示看名稱、剩下的時間（js/ui.js）；圖示中間的空隙照樣點到遊戲 */
html.mobile .bicon { width: 26px; height: 26px; }
html.mobile #log { left: calc(6px + var(--sl)); bottom: calc(94px + var(--sb)); width: min(330px, 42vw); height: 72px; padding: 3px 6px; font-size: 12.5px; line-height: 1.35; overflow: hidden; pointer-events: none; background: linear-gradient(rgba(10, 8, 6, 0), rgba(10, 8, 6, 0.5)); border: 0; }
html.mobile #hotbar { position: absolute; left: 50%; bottom: calc(10px + var(--sb)); transform: translateX(-50%); padding: 3px; background: rgba(0, 0, 0, 0.4); }
html.mobile .hot { width: 44px; height: 44px; }
html.mobile .hot:active { transform: scale(0.93); }
.hot.assign { border-color: #7fb2ff; box-shadow: 0 0 8px #7fb2ff; }

/* 手機的聊天模式（js/chat.js、index.html #win-chat；老闆 11-18「第一次點擊輸入框時就要出現聊天模式 聊天模式可以占滿整個螢幕 但裡面必須融合
   看到聊天內容的區塊 可以將區塊放在上面 等於是將原本的聊天視窗放大 容納更多功能 然後底色維持原本的復古灰色」）：
   整個畫面（上緣 --chat-t、高度 --chat-h：打字時只蓋看得到的範圍、鍵盤上面，js/chat.js fit），上面聊天內容、下面密語對象／頻道／常用語、最下面輸入欄；
   底色是原本聊天視窗的灰（css/classic.css html.classic #win-chat）。問數量的視窗（#ask 1100）、數字鍵盤（1200）還是在上面 */
#win-chat { position: fixed; z-index: 1090; left: 0; top: var(--chat-t, 0px); right: 0; height: var(--chat-h, 100%); box-sizing: border-box; display: flex; flex-direction: column;
  padding: var(--st, 0px) var(--sr, 0px) var(--sb, 0px) var(--sl, 0px); background: none; border: 0; border-radius: 0; box-shadow: none; overscroll-behavior: contain; }
/*   半透明（老闆 11-20「把手機板聊天介面 做可以調整半透明程度的功能」）：上面那條的「透明」拉桿 0～90%（js/chat.js，記在這台裝置）。
     只有底色變淡：底色畫在 ::before（原版介面的石紋在 css/classic.css），透明度 --chat-a；聊天內容那塊的暗底 --chat-la 跟著淡。
     字、按鈕、輸入欄照舊；調淡時聊天內容的字加黑邊，後面是遊戲畫面也看得清楚 */
#win-chat::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: rgba(12, 9, 6, 0.97); opacity: var(--chat-a, 1); }
#win-chat.see #chat-list, #win-chat.see .chat-tabs button, #win-chat.see .chat-see { text-shadow: 0 0 2px #000, 0 0 2px #000, 1px 1px 1px #000; }
.chat-see { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 2px 0 6px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.chat-see input { flex: 0 1 84px; min-width: 44px; margin: 0; accent-color: #c8a050; }
.chat-see b { min-width: 2.4em; text-align: right; font-weight: normal; }
#win-chat.kb { padding-bottom: 0; }   /* 鍵盤出來：下面不用留 Home 橫條的空 */
#win-chat.hidden { display: none; }
html.chat-open #log, html.chat-open #chat-input { display: none !important; }
.chat-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0 6px; border-bottom: 1px solid rgba(0, 0, 0, 0.45); }
.chat-tabs { display: flex; }
.chat-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; padding: 6px 14px; color: var(--dim); font-size: 14px; }
.chat-tabs button.on { color: #fff3cf; border-bottom-color: var(--gold); }
#chat-close { width: 44px; height: 34px; padding: 0; background: none; border: 0; box-shadow: none; color: #e8dcc0; font-size: 20px; }
.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-lw { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
#chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px; font-size: 14px; line-height: 1.5; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: rgba(0, 0, 0, var(--chat-la, 0.28)); }
#chat-list > div { padding: 1px 0; word-break: break-word; }
#chat-list .c-sys { color: #b8ab92; }   /* 系統訊息和一般聊天同樣大小（老闆 11-19「手機版聊天視窗系統至於一般字體大小不同 依照一般字體為主」：之前 12px） */
#chat-list [data-from] { cursor: pointer; }
#chat-list[data-tab="chat"] .c-sys, #chat-list[data-tab="sys"] .c-chat { display: none; }
#chat-new { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 3px 12px; border-radius: 12px; font-size: 12px; color: #fff3cf; background: rgba(90, 68, 38, 0.95); }
#chat-new.hidden { display: none; }
.chat-side { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 0; }
.chat-chans { flex: none; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.chat-chans::-webkit-scrollbar { display: none; }
.chat-chans button { flex: none; padding: 5px 10px; border-radius: 13px; font-size: 13px; }
/*   選中的頻道：金底深色粗字。手機點過的鈕會一直算「滑鼠指著」（:hover），經典介面的 button:hover 把金底換成灰石底、只剩金框，
     看不出選了哪個（老闆 11-18「聊天頻道選擇圈選按鈕不明顯 一開始一般是黃色 後來點其他的變成只有外框」）→ 選中的一律蓋過 hover */
.chat-chans button.on, .chat-chans button.on:hover { color: #2a1e0a !important; background: var(--gold) !important; border-color: var(--gold) !important; font-weight: bold; }
/*   常用語：直拿兩排、往右滑看更多 */
#cc-phrases { flex: none; display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 34px); grid-auto-columns: max-content; gap: 6px; overflow-x: auto; scrollbar-width: none; }
#cc-phrases::-webkit-scrollbar { display: none; }
#cc-phrases button { min-width: 52px; height: 34px; padding: 0 10px; font-size: 14px; white-space: nowrap; }
.chat-row { flex: none; display: flex; gap: 6px; padding: 6px; }
.chat-row input { min-width: 0; height: 42px; padding: 0 12px; color: var(--text); background: #0d0a07; border: 1px solid var(--gold); border-radius: 8px; font: inherit; font-size: 16px; }
#chat-to { flex: 0 0 96px; }
#chat-text { flex: 1; }
#chat-go { flex: none; height: 42px; padding: 0 16px; font-size: 16px; }
/*   橫拿：聊天內容在左邊、頻道和常用語在右邊一欄（鍵盤出來只剩一百多點高，上下疊放不下）；鍵盤出來時分頁那條收起來 */
@media (orientation: landscape) {
  .chat-body { flex-direction: row; }
  .chat-side { width: 42%; max-width: 380px; padding: 6px 6px 0 8px; overflow-y: auto; scrollbar-width: none; }
  .chat-side::-webkit-scrollbar { display: none; }
  .chat-side .chat-chans { flex-wrap: wrap; overflow: visible; }
  #cc-phrases { display: flex; flex-wrap: wrap; overflow: visible; }
  #cc-phrases button { min-width: 0; height: 32px; }
  #win-chat.kb .chat-head { display: none; }
}
#chat-unread { position: absolute; top: -7px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e0402e; color: #fff; font-size: 11px; font-style: normal; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #1a120a; }
#chat-unread.hidden { display: none; }
/* ☰ 選單：不常用的功能；離開遊戲另外一排、紅字 */
#mmenu { position: fixed; z-index: 30; display: flex; flex-direction: column; gap: 4px; min-width: 150px; padding: 6px; background: rgba(16, 12, 8, 0.96); border: 1px solid var(--border-hi); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7); }
#mmenu button { height: 42px; padding: 0 14px; text-align: left; font-size: 14px; }
#mmenu button.hidden { display: none; }
#mmenu .mm-leave { margin-top: 6px; color: #ffb0a0; border-color: #7a3a2a; }
#btn-pk-m.on { color: #fff; background: linear-gradient(#a8402e, #6a1e12); border-color: #ff9a80; }
#btn-menu.open { border-color: var(--gold); color: var(--gold); }
/* 撿取：附近有東西時才出現，顯示最近那個東西的圖 */
#btn-pickup { position: fixed; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 6px; border-radius: 22px; font-size: 14px; font-weight: bold; touch-action: none;
  background: linear-gradient(#5a4628, #33261a); border-color: var(--border-hi); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); animation: pick-in 0.18s ease-out; }
#btn-pickup img { width: 32px; height: 32px; }
#btn-pickup:active { transform: scale(0.94); }
@keyframes pick-in { from { opacity: 0; transform: translateY(6px); } }
/* 強制攻擊開著時：上方一個紅色的提醒，點了就關掉 */
#btn-pk { position: fixed; right: calc(6px + var(--sr)); height: 30px; padding: 0 14px; border-radius: 15px; font-size: 13px; font-weight: bold; color: #fff; background: linear-gradient(#b8442e, #6a1e12); border-color: #ff9a80; box-shadow: 0 0 10px rgba(255, 90, 60, 0.7); }
/* 選目標、選物品的提示：小小一條，不擋畫面 */
#mode-bar { position: fixed; left: 50%; top: calc(46px + var(--st)); transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 6px; max-width: calc(100vw - 16px); padding: 2px 3px 2px 10px; font-size: 12px; color: #ffe066; white-space: nowrap; background: rgba(12, 9, 6, 0.72); border: 1px solid rgba(201, 162, 74, 0.5); border-radius: 14px; }
#mode-text { overflow: hidden; text-overflow: ellipsis; }
#mode-bar button { flex: none; padding: 1px 9px; border-radius: 11px; font-size: 12px; }
/* 釣魚：魚上鉤時畫面中間偏下的「拉竿！」（js/ui.js fishBite），手機拇指按得到 */
#fish-bite { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); z-index: 16; display: flex; align-items: center; gap: 8px; padding: 8px 18px; font-size: 18px; font-weight: bold;
  color: #ffe9a8; background: rgba(18, 13, 8, 0.92); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 0 12px rgba(255, 220, 120, 0.6); cursor: pointer; animation: fish-bite 0.4s ease-in-out infinite alternate; }
#fish-bite.hidden { display: none; }
/*   手機：貼在主介面上方（畫面檢查 11-10：橫拿時 58% 會壓到體力、魔力條） */
html.mobile #fish-bite { top: auto; bottom: calc(var(--hudh, 0px) + var(--sb, 0px) + 10px); }
#fish-bite img { width: 32px; height: 32px; image-rendering: pixelated; }
@keyframes fish-bite { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.08); } }

/* 視窗：左邊放角色、魔法、商店、倉庫，右邊放背包，其他置中 */
html.mobile .win { display: flex; flex-direction: column; max-height: calc(100% - var(--hudh) - 6px - var(--st) - var(--sb)); }
html.mobile .win-head { flex: none; padding: 3px 4px 3px 12px; }
html.mobile .win-head .close { width: 38px; height: 30px; font-size: 16px; }
html.mobile #char-body, html.mobile #spell-list, html.mobile #shop-body, html.mobile #learn-body, html.mobile #wh-grid, html.mobile #tele-body, html.mobile #poly-body, html.mobile #blank-body, html.mobile .help, html.mobile .map-wrap, html.mobile #npc-text { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
html.mobile #win-poly #poly-body { overflow: hidden; }
html.mobile #win-char, html.mobile #win-spell, html.mobile #win-shop, html.mobile #win-learn, html.mobile #win-wh, html.mobile #win-party, html.mobile #win-trade, html.mobile #win-stall { left: calc(6px + var(--sl)); right: auto; top: calc(var(--hudh) + var(--st)); bottom: auto; width: min(420px, calc(40vw - 9px)); transform: none; }
html.mobile #win-npc, html.mobile #win-tele, html.mobile #win-poly, html.mobile #win-blank, html.mobile #win-map, html.mobile #win-pet, html.mobile #win-board, html.mobile #win-letter, html.mobile #win-mail, html.mobile #win-cook, html.mobile #win-auction, html.mobile #win-emblem, html.mobile #win-clanpick { left: 50%; right: auto; top: calc(var(--hudh) + var(--st)); bottom: auto; transform: translateX(-50%); width: min(480px, calc(100vw - 12px)); }
html.mobile .map-wrap { max-width: none; }
html.mobile #map-canvas { width: 100%; }
html.mobile #tooltip { max-width: 240px; font-size: 11px; }
html.mobile .spell-row .hotset { margin-left: auto; padding: 5px 10px; }

/* 背包：橫向時紙娃娃在左、物品在右，下方是選取物品的說明與按鈕 */
html.mobile #win-inv { left: auto; right: calc(6px + var(--sr)); top: calc(6px + var(--st)); bottom: calc(6px + var(--sb)); width: min(560px, calc(60vw - 9px)); max-height: none; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; grid-template-areas: "head head" "doll grid" "gold grid" "detail detail"; }
html.mobile #win-inv > .win-head { grid-area: head; }
html.mobile #win-inv > .doll { grid-area: doll; padding: 6px 8px 2px; border-bottom: 0; }
html.mobile #win-inv > .inv-gold { grid-area: gold; align-self: start; padding: 4px 10px; }
html.mobile #inv-grid { grid-area: grid; min-height: 0; max-height: none; align-content: start; grid-template-columns: repeat(auto-fill, 44px); padding: 6px 8px; border-left: 1px solid #3a2c1a; }
html.mobile #win-inv > .detail { grid-area: detail; }
html.mobile .doll-figure, html.mobile #doll-canvas { width: 88px; height: 120px; }
html.mobile #doll-slots { grid-template-columns: repeat(3, 40px); gap: 3px; }
html.mobile .dslot { width: 40px; height: 40px; }
html.mobile .dslot .icon { width: 36px; height: 36px; }
html.mobile .slot { width: 44px; height: 44px; }
html.mobile .slot.sel, html.mobile .dslot.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 8px rgba(232, 199, 102, 0.55); }
html.mobile #wh-grid { grid-template-columns: repeat(auto-fill, 44px); }
html.mobile .win > .detail { flex: none; }
.detail { display: flex; gap: 8px; padding: 6px 8px 8px 10px; border-top: 1px solid #3a2c1a; min-height: 64px; }
.detail:empty { display: none; }   /* 沒選物品時不顯示 */
.detail .info { flex: 1; min-width: 0; max-height: 100px; overflow-y: auto; font-size: 11px; line-height: 1.45; }
.detail .info b { color: var(--gold); }
.detail .info .tip-head img { width: 24px; height: 24px; }
.detail .acts { display: grid; grid-template-columns: repeat(2, minmax(68px, auto)); gap: 4px; align-content: start; }
.detail .acts button { padding: 6px 8px; }
.detail .acts .danger { color: #ffb0a0; }

/* 手機的畫面（js/screen.js）：網址列擋住時的提醒、全螢幕、還原縮放 */
#screen-tip { position: fixed; left: 50%; top: calc(50px + var(--st)); transform: translateX(-50%); z-index: 55; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 16px); padding: 4px 4px 4px 12px; color: var(--gold); background: rgba(12, 9, 6, 0.94); border: 1px solid var(--border-hi); border-radius: 16px; }
#screen-tip.hidden, #screen-tip button.hidden, #btn-full.hidden, #btn-unzoom.hidden { display: none; }
#btn-unzoom { position: fixed; left: 8px; top: 8px; z-index: 70; padding: 8px 16px; font-size: 16px; border-radius: 18px; }
#screen-tip button { flex: none; padding: 2px 10px; border-radius: 12px; }
/* 手機左邊的兩顆圓鈕（index.html #side-btns；老闆 11-09「左邊精簡、原始一個 icon 切換就好，直式橫式也是，不需要文字」）：
   深色石頭的圓、青銅框，只有圖示；圖示畫的是按了會變成的樣子。介面那顆只有橫式有（精簡介面是橫拿的排法），直式只留直式／橫式那顆 */
/* 手機的隊友、寵物快選（js/ui.js refreshMobParty）：左上一排，一格 30 點高（手指點得到）；選目標中框變金色 */
#mob-party { position: fixed; z-index: 6; left: calc(6px + var(--sl, 0px)); top: calc(6px + var(--st, 0px)); display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
#mob-party.hidden { display: none; }
#mob-party .mp-row { pointer-events: auto; display: flex; flex-direction: column; justify-content: center; width: 92px; height: 30px; padding: 2px 6px; margin: 0; background: rgba(10, 8, 6, 0.6); border: 1px solid rgba(200, 170, 110, 0.35); border-radius: 4px; color: #f0e6cc; font: 12px/14px var(--font); text-align: left; text-shadow: 0 1px 0 #000; }
#mob-party .mp-n { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#mob-party .mp-bar { display: block; height: 5px; margin-top: 3px; background: rgba(0, 0, 0, 0.65); }
#mob-party .mp-bar i { display: block; height: 100%; background: #d03a28; }
#mob-party .mp-row.far { opacity: 0.45; }
#mob-party .mp-row.dead .mp-bar i { background: #666; }
#mob-party.arm .mp-row:not(.far) { border-color: #ffe08a; box-shadow: 0 0 4px rgba(255, 224, 138, 0.6); }
/*   精簡介面：左上是狀態圖示和兩顆圓鈕，放右上 */
html.mobile:not(.orig) #mob-party { left: auto; right: calc(6px + var(--sr, 0px)); top: calc(68px + var(--st, 0px)); }
#side-btns { position: fixed; z-index: 5; left: calc(6px + var(--sl)); top: calc(68px + var(--st)); display: flex; flex-direction: column; gap: 10px; }
#side-btns.hidden, #home-guide.hidden { display: none !important; }
.side-btn { position: relative; display: block; width: 36px; height: 36px; margin: 0; padding: 0; background: none !important; border: 0 !important; box-shadow: none !important; touch-action: manipulation; }
.side-btn .c { display: block; width: 36px; height: 36px; box-sizing: border-box; padding: 5px; border-radius: 50%; color: #e8d8a8;
  background: radial-gradient(#3a342c, #16120e); border: 1px solid #8a6a34; box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0, 0, 0, 0.7); }
.side-btn svg { width: 100%; height: 100%; display: block; }
.side-btn::after { content: ''; position: absolute; inset: -5px -6px; }   /* 按的範圍大一點 */
.side-btn:active .c { filter: brightness(0.8); }
#btn-orient .o-land, #btn-orient.to-land .o-port { display: none; }
#btn-orient.to-land .o-land { display: block; }
#btn-ui .u-orig, #btn-ui.to-orig .u-lite { display: none; }
#btn-ui.to-orig .u-orig { display: block; }
/*   直拿：只有直橫那顆，放在主介面上面的左下角（畫面檢查 11-10：放在 30% 高時，倉庫、商店、交易兩個視窗並排、信件視窗都會蓋住它；
     視窗都從上面開，主介面上面這一段蓋不到） */
@media (orientation: portrait) { #btn-ui { display: none; } #side-btns { top: auto; bottom: calc(var(--hudh, 0px) + var(--sb, 0px) + 10px); } }

/* ── 輔助喝水（老闆 11-15「輔助喝水的開關拉出來做成一個圖示，點下去開啟輔助喝水介面 … 介面要美觀好用」；
   index.html .ah-btn、#win-autoheal，js/ui.js refreshAuto、renderAutoHeal）── */
/*   圖示：和手機左邊的圓鈕同一個樣子（深色石頭的圓、青銅框；手機的就在那排裡），裡面是下一瓶要喝的藥水（道具圖示）。
     自動喝水開著：金框、淡淡的光，右下角百分比；關著：圖是灰的；開著但身上沒有治癒藥水：紅框、紅底的百分比 */
.ah-btn .c { display: flex !important; align-items: center; justify-content: center; padding: 0 !important; overflow: hidden; }
.ah-btn .ah-ico { display: block; width: 30px; height: 30px; object-fit: contain; filter: grayscale(1) brightness(0.72); opacity: 0.7; pointer-events: none; }
.ah-btn.on .ah-ico { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8)); opacity: 1; }
.ah-btn.on .c { border-color: #e8c060; box-shadow: 0 0 0 1px #000, 0 0 7px rgba(255, 205, 110, 0.55), 0 2px 6px rgba(0, 0, 0, 0.7); }
.ah-btn.none .c { border-color: #e0604a; box-shadow: 0 0 0 1px #000, 0 0 8px rgba(255, 90, 60, 0.7), 0 2px 6px rgba(0, 0, 0, 0.7); }
.ah-btn.open .c { background: radial-gradient(#5e4c2e, #1e170e); }
.ah-btn .ah-pct { position: absolute; right: -7px; bottom: -3px; min-width: 25px; padding: 0 3px; box-sizing: border-box; font: bold 10px/13px var(--font); color: #2a1a06; text-align: center; letter-spacing: 0;
  background: linear-gradient(#ffe7a0, #cf9f3e); border: 1px solid #1a1206; border-radius: 7px; pointer-events: none; }
.ah-btn .ah-pct:empty { display: none; }
.ah-btn.none .ah-pct { color: #fff; background: linear-gradient(#ee6a52, #a42a18); }
/* 開著但沒水（老闆 11-16「自動喝水沒水 左下圖示還是顯示有水的狀態」）：藥水圖變灰、變暗（和關著一樣），角落寫「沒水」 */
.ah-btn.on.none .ah-ico { filter: grayscale(1) brightness(0.55); opacity: 0.55; }
/*   電腦（現代介面）：右下角、安全區域的字上面（原版介面在遊戲畫面左下角，css/orig.css） */
#btn-autoheal-pc { position: fixed; right: 14px; bottom: calc(var(--hudh) + 34px); width: 36px; height: 36px; padding: 0; background: none !important; border: 0 !important; box-shadow: none !important; cursor: pointer; }
#btn-autoheal-pc .c { width: 36px; height: 36px; box-sizing: border-box; border-radius: 50%; color: #e8d8a8; background: radial-gradient(#3a342c, #16120e); border: 1px solid #8a6a34; box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0, 0, 0, 0.7); }
#btn-autoheal-pc:hover .c { border-color: #ffe090; }
#btn-autoheal-pc:active .c { filter: brightness(0.85); }
/* 管理員指令視窗（js/gmpanel.js；老闆 11-16）：畫面中間偏上，一欄一欄填，下面是會送出的指令；手機照寬度縮 */
#win-gm { left: 50%; top: 70px; transform: translateX(-50%); width: 360px; max-width: calc(100vw - 12px); max-height: calc(100vh - 90px); display: flex; flex-direction: column; z-index: 60; }
#win-gm.hidden { display: none; }
#win-gm .gm-body { overflow-y: auto; padding: 6px 12px 10px; font-size: 14px; }
#win-gm .gm-f { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
#win-gm .gm-f > span { flex: 0 0 96px; color: #d8c8a0; }
#win-gm .gm-f :is(input, select) { flex: 1 1 auto; min-width: 0; font-size: 15px; padding: 4px 6px; background: #1c1812; color: #f0e6d0; border: 1px solid #6a5838; }
#win-gm .gm-out { margin: 10px 0 6px; padding: 6px 8px; background: #120f0a; border: 1px solid #4a3c24; word-break: break-all; }
#win-gm .gm-out code { color: #9fe09f; font-size: 14px; }
#win-gm .gm-out code.bad { color: #ff9a8a; }
#win-gm .gm-row { display: flex; align-items: center; gap: 10px; }
#win-gm .gm-row button { padding: 6px 18px; font-size: 15px; white-space: nowrap; min-width: 76px; flex: 0 0 auto; }
#win-gm .gm-row button:disabled { opacity: 0.45; }
#win-gm .gm-tip { font-size: 13px; margin: 8px 0 0; line-height: 1.5; color: #d8c8a0; }
/* .稱號 的顏色（點了加上 \f 代碼）和預覽（老闆 11-20「稱號(要可以打顏色)」） */
#win-gm .gm-pal { display: flex; flex-wrap: wrap; gap: 3px; margin: 2px 0 6px 104px; }
#win-gm .gm-pal button { width: 18px; height: 18px; min-width: 0; padding: 0; border: 1px solid #6a5838; border-radius: 2px; cursor: pointer; }
#win-gm .gm-tprev { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
#win-gm .gm-tprev > span { flex: 0 0 96px; color: #d8c8a0; }
#win-gm .gm-tprev b { flex: 1 1 auto; min-height: 22px; padding: 2px 8px; background: #4a4436; font-weight: normal; font-size: 15px; text-shadow: 0 0 2px #000, 0 0 2px #000; word-break: break-all; }
#win-gm .gm-tprev small { color: #a89878; white-space: nowrap; }
/* GM 指令的按鈕（老闆 11-18「GM指令從設定拉出來 放在螢幕右下角」）：管理員才有，右下角一顆小圓鈕，位置在 js/gmpanel.js 量好 HUD 再放 */
#btn-gm { position: fixed; right: 8px; bottom: 8px; z-index: 55; width: 40px; height: 40px; padding: 0; border-radius: 50%; font: bold 13px/1 sans-serif; color: #ffe090;
  background: radial-gradient(#3a342c, #16120e); border: 1px solid #b08a3a; box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0, 0, 0, 0.7); cursor: pointer; }
#btn-gm:hover { border-color: #ffe090; }
#btn-gm:active { filter: brightness(0.85); }
/* 外掛檢測的框（js/botcheck.js；老闆 11-18「輸入框不要擋到怪」）：最上面中間一條，不擋中間的角色和怪；手機多一排數字鍵 */
#botcheck { position: fixed; left: 50%; top: 4px; transform: translateX(-50%); z-index: 1095; display: flex; flex-direction: column; align-items: center; gap: 4px;
  max-width: calc(100vw - 12px); padding: 4px 8px; box-sizing: border-box; color: #f0e6d0; font-size: 14px;
  background: rgba(20, 16, 10, 0.85); border: 1px solid #b08a3a; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
#botcheck.hidden { display: none; }
/*   電腦：放在畫面中間偏上（老闆 11-19「桌機版放在太上面 很容易沒看到」「要下來一點 中間上面一點」）：角色頭上留一段，不擋角色；字大一點 */
html.pc #botcheck { top: 22%; padding: 8px 14px; font-size: 16px; border-width: 2px; }
html.pc #bc-code { font-size: 26px; }
html.pc #bc-in { font-size: 18px; width: 5em; }
html.pc #bc-go { font-size: 16px; padding: 4px 14px; }
#botcheck .bc-line { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#bc-code { font-size: 20px; color: #ffe066; letter-spacing: 2px; }
#bc-in { width: 4.6em; font-size: 16px; padding: 2px 4px; text-align: center; letter-spacing: 2px; background: #1c1812; color: #f0e6d0; border: 1px solid #6a5838; }
#bc-go { padding: 3px 10px; font-size: 14px; }
#bc-left { min-width: 3.2em; text-align: right; color: #d8c8a0; }
#botcheck .bc-keys { display: none; }
html.mobile #botcheck .bc-keys { display: flex; gap: 3px; }
html.mobile #botcheck .bc-keys button { width: 30px; height: 32px; padding: 0; font-size: 16px; touch-action: manipulation; }
html.mobile #botcheck .bc-t { font-size: 13px; }
#bc-msg { color: #ff9a8a; font-size: 13px; }
#bc-msg:empty { display: none; }
/*   視窗：上面自動喝水（三段，一段一行；選藥水時一種一格，和背包的格子一樣的圖示）、下面自動回卷；選到的金色，點的範圍手指按得到 */
#win-autoheal { right: 14px; bottom: calc(var(--hudh) + 80px); width: 300px; display: flex; flex-direction: column; max-height: calc(100vh - var(--hudh) - 96px); }
#win-autoheal.hidden { display: none; }
#ah-body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 2px 10px 8px; }
.ah-sec { padding: 8px 0 6px; }
.ah-sec + .ah-sec { border-top: 1px solid rgba(201, 162, 74, 0.25); }
.ah-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ah-head b { flex: none; color: var(--gold); font-size: 14px; letter-spacing: 1px; text-shadow: 0 1px 1px #000; }
.ah-note { min-width: 0; color: var(--dim); font-size: 12px; text-align: right; }
.ah-note.warn, .ah-next.warn { color: #ff9a7a; }
.ah-seg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #5a4628; border-radius: 4px; overflow: hidden; background: #0e0a06; box-shadow: inset 0 1px 3px #000; }
.ah-seg button { height: 32px; min-width: 0; padding: 0; color: var(--dim); font-size: 14px; background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.ah-seg button + button { border-left: 1px solid #3a2c1a !important; }
.ah-seg button:hover { color: var(--text); background: rgba(255, 230, 160, 0.08) !important; }
.ah-seg button.on { color: #2a1a06 !important; font-weight: bold; text-shadow: none; background: linear-gradient(#ffe7a0, #c9962e) !important; }
.ah-pots { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.ah-pot { position: relative; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 3px 1px 2px; color: var(--text); background: none !important; border: 0 !important; border-radius: 4px !important; box-shadow: none !important; }
.ah-pot:hover { background: rgba(255, 230, 160, 0.07) !important; }
.ah-slot { position: relative; flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: radial-gradient(#241a12, #100b06); border: 1px solid #4a3a26; border-radius: 3px; }
.ah-slot .icon { width: 40px; height: 40px; }
.ah-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; max-width: 4.3em; margin: 0 auto; min-height: 26px; font-size: 11px; line-height: 13px; text-align: center; word-break: break-all; }
.ah-pot.on .ah-slot { border-color: #ffd76a; box-shadow: 0 0 0 1px #ffd76a, 0 0 9px rgba(255, 215, 106, 0.6); }
.ah-pot.on .ah-name:not(.n-bless):not(.n-curse) { color: #ffe08a; }
.ah-pot.on::after { content: '✓'; position: absolute; top: -1px; right: 2px; width: 15px; height: 15px; font: bold 10px/15px sans-serif; color: #2a1a06; text-align: center; background: #ffd76a; border-radius: 50%; box-shadow: 0 0 0 1px #000; }
.ah-pot.ghost .ah-slot { border-style: dashed; }
.ah-pot.cant { opacity: 0.5; }
/*   身上沒有治癒藥水（老闆「如果沒有就顯示沒有任何治療藥水」）：和格子一樣高的虛線框 */
.ah-empty { flex: 1 1 120px; align-self: flex-start; display: flex; align-items: center; justify-content: center; height: 46px; margin-top: 3px; padding: 0 8px; color: #ffb38a; font-size: 13px; text-align: center;
  background: rgba(0, 0, 0, 0.28); border: 1px dashed rgba(201, 162, 74, 0.5); border-radius: 4px; }
.ah-next { margin: 4px 0 0; color: var(--dim); font-size: 12px; line-height: 1.45; }
.ah-next b { color: var(--text); font-weight: normal; }
/*   自動喝水三段（老闆 11-20）：一段一行，左邊藥水（點了下面列出身上的藥水），右邊「− 70% ＋」；關著的那行淡一點，開著但沒藥水的紅框 */
.ah-tier { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.ah-tier + .ah-tier, .ah-pots + .ah-tier { border-top: 1px solid rgba(201, 162, 74, 0.13); }
.ah-potbtn { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 0; color: var(--text); text-align: left; background: none !important; border: 0 !important; border-radius: 4px !important; box-shadow: none !important; }
.ah-potbtn:hover { background: rgba(255, 230, 160, 0.07) !important; }
.ah-potbtn .ah-name { width: auto; max-width: none; min-height: 0; margin: 0; font-size: 13px; line-height: 16px; text-align: left; }
.ah-slot.empty { color: var(--dim); font-size: 22px; border-style: dashed; }
.ah-tier.open .ah-slot { border-color: #ffd76a; box-shadow: 0 0 0 1px #ffd76a, 0 0 9px rgba(255, 215, 106, 0.6); }
.ah-tier.off .ah-potbtn { opacity: 0.7; }
.ah-slot .icon.none .cnt { color: #ff8a6a; }   /* 選了但身上沒有：圖照畫、數量 0 是紅的（老闆 11-20） */
.ah-tier.out .ah-slot { border-color: #e0604a; box-shadow: 0 0 0 1px #e0604a; }
.ah-tier.out .ah-name { color: #ff9a7a !important; }
.ah-step { flex: none; display: flex; align-items: center; border: 1px solid #5a4628; border-radius: 4px; overflow: hidden; background: #0e0a06; box-shadow: inset 0 1px 3px #000; }
.ah-step button { width: 32px; height: 32px; min-width: 0; padding: 0; color: var(--gold); font-size: 18px; line-height: 32px; background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.ah-step button:hover:not(:disabled) { background: rgba(255, 230, 160, 0.1) !important; }
.ah-step button:disabled { opacity: 0.25; cursor: default; }
.ah-step b { min-width: 46px; color: #ffe08a; font-size: 14px; line-height: 32px; text-align: center; border-left: 1px solid #3a2c1a; border-right: 1px solid #3a2c1a; }
.ah-tier.off .ah-step b { color: var(--dim); font-weight: normal; }
.ah-heal .ah-pots { margin: 2px 0 5px; padding: 4px 2px 2px; background: rgba(0, 0, 0, 0.28); border-radius: 4px; }
/*   手機：上面置中（和其他視窗一樣），按鈕、格子大一點；橫拿時左右兩欄（左邊喝水、回卷，右邊藥水），不用捲 */
html.mobile #win-autoheal { left: 50%; right: auto; top: calc(var(--hudh) + var(--st)); bottom: auto; transform: translateX(-50%); width: min(340px, calc(100vw - 12px)); max-height: calc(100% - var(--hudh) - 12px - var(--st) - var(--sb)); }
html.mobile .ah-seg button { height: 40px; font-size: 15px; }
html.mobile .ah-head b { font-size: 15px; }
html.mobile .ah-note, html.mobile .ah-next { font-size: 12.5px; }
html.mobile .ah-pot { width: 62px; }
html.mobile .ah-name { font-size: 11.5px; line-height: 13.5px; min-height: 27px; }
html.mobile .ah-potbtn .ah-name { font-size: 14px; line-height: 17px; min-height: 0; }
html.mobile .ah-step button { width: 40px; height: 40px; font-size: 20px; line-height: 40px; }
html.mobile .ah-step b { min-width: 50px; font-size: 15px; line-height: 40px; }
/*   橫拿：左邊自動喝水（三段），右邊自動回卷，不用捲 */
@media (orientation: landscape) {
  html.mobile #win-autoheal { width: min(620px, calc(100vw - 12px - var(--sl) - var(--sr))); }
  html.mobile #ah-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "heal home"; column-gap: 14px; align-items: start; }
  html.mobile .ah-heal { grid-area: heal; }
  html.mobile .ah-home { grid-area: home; border-top: 0 !important; border-left: 1px solid rgba(201, 162, 74, 0.25); padding-left: 12px; }
  html.mobile .ah-sec { padding: 5px 0 3px; }
  html.mobile .ah-head { margin-bottom: 4px; }
  html.mobile .ah-seg button { height: 36px; }
  html.mobile .ah-step button { height: 36px; line-height: 36px; }
  html.mobile .ah-step b { line-height: 36px; }
}
/* 精簡介面的血魔框可以拖（js/main.js L.hpmpTip）：第一次看到時框右邊一句「按住可以拖曳」、框亮兩下（老闆 11-09「要怎麼讓玩家知道血魔可以拖曳」） */
#hpmp-tip { position: fixed; z-index: 6; left: calc(var(--fbx, calc(56px + var(--sl))) + var(--pw, 250px) + 6px); top: calc(var(--fby, calc(6px + var(--st))) + var(--ph, 53px) / 2 - 12px);
  height: 24px; padding: 0 10px; border: 1px solid #8a6a34; border-radius: 12px; background: rgba(16, 12, 8, 0.86); color: #ffd870;
  font: 900 13px/22px "PMingLiU", "MingLiU", "Noto Serif TC", serif; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
html:not(.mfight) #hpmp-tip { display: none; }
@media (orientation: portrait) { #hpmp-tip { display: none; } }   /* 精簡介面只有橫的 */
#hpmp-tip::before { content: ''; position: absolute; left: -6px; top: 7px; border: 5px solid transparent; border-left: 0; border-right-color: #8a6a34; }
html.hpmp-hint #hud .bar.hp::before { animation: hpmp-hint 0.7s ease-in-out 4 alternate; }
@keyframes hpmp-hint { from { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); } to { filter: drop-shadow(0 0 7px rgba(255, 210, 110, 0.95)) brightness(1.2); } }
/* iPhone 用 Safari 開的：教「加入主畫面」的圖（蓋在登入畫面上；z-index 比登入 40 高、比轉向 6000 低） */
#home-guide { position: fixed; inset: 0; z-index: 4500; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(0, 0, 0, 0.72); }
#home-guide .hg-box { width: min(420px, 100%); max-height: calc(100% - 8px); overflow-y: auto; box-sizing: border-box; padding: 14px 16px 12px; color: #efe3c0;
  background: linear-gradient(#2a241c, #15110d); border: 1px solid #8a6a34; border-radius: 4px; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 220, 150, 0.12), 0 6px 20px rgba(0, 0, 0, 0.8);
  font: 500 15px/1.45 "PMingLiU", "MingLiU", "Noto Serif TC", serif; }
#home-guide h3 { margin: 0 0 10px; text-align: center; font: 900 18px/1.4 "PMingLiU", "MingLiU", "Noto Serif TC", serif; color: #ffd98a; letter-spacing: 2px; }
#home-guide ol { margin: 0; padding: 0; list-style: none; counter-reset: hg; }
#home-guide li { counter-increment: hg; display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(220, 190, 130, 0.18); }
#home-guide li::before { content: counter(hg); flex: none; width: 22px; height: 22px; border-radius: 50%; text-align: center; font: 900 14px/22px sans-serif; color: #15110d; background: #d8b870; }
#home-guide .hg-ico { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: #1a7cf5; background: #f4f4f6; border-radius: 10px; }
#home-guide .hg-ico svg { width: 30px; height: 30px; }
#home-guide .hg-add { width: 52px; color: #1a7cf5; font: 700 15px/44px -apple-system, "PingFang TC", sans-serif; }
#home-guide .hg-app { flex: none; width: 44px; height: 44px; border-radius: 10px; }
#home-guide small { display: block; color: #b8a888; font-size: 13px; }
#home-guide .hg-dots { display: inline-block; padding: 0 5px; color: #1a7cf5; background: #f4f4f6; border-radius: 8px; font: 900 14px/18px sans-serif; }
#home-guide .hg-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
#home-guide .hg-btns button { min-width: 112px; height: 38px; font: 900 15px/1 "PMingLiU", "MingLiU", "Noto Serif TC", serif; color: #efe3c0; background: linear-gradient(#3a3026, #1a140e); border: 1px solid #8a6a34; border-radius: 3px; }
#home-guide #home-guide-skip { color: #b8a888; }
@media (orientation: landscape) and (max-height: 500px) { #home-guide .hg-box { width: min(560px, 100%); } #home-guide ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; } #home-guide li { padding: 6px 0; } }
#mf-lv { display: none; }   /* 手機橫拿精簡模式的等級、經驗那一排（css/classic.css 才顯示） */
/* 手機的買賣、倉庫數量視窗（js/ui.js qtyPop；老闆 11-10「購買東西的體驗太差 要重新設計」）：置中，大的 －／＋、可以打數量、快捷數量、總價 */
#qty-pop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); }
#qty-pop.hidden { display: none; }
#qty-pop .qp-box { width: min(320px, calc(100vw - 24px)); box-sizing: border-box; padding: 14px 16px 12px; color: #e8dcc0; font: 14px/1.4 var(--font);
  background: linear-gradient(#26221c, #15120e); border: 1px solid #a07c40; border-radius: 6px; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #4a3a1c, 0 10px 30px rgba(0, 0, 0, 0.7); }
#qty-pop .qp-head { display: flex; align-items: center; gap: 12px; }
#qty-pop .qp-head .icon { flex: none; width: 44px; height: 44px; background: #0c0a08; border: 1px solid #5a4a30; border-radius: 4px; }
#qty-pop .qp-text { min-width: 0; }
#qty-pop .qp-name { font-size: 16px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#qty-pop .qp-sub { margin-top: 2px; font-size: 13px; color: #d8c48c; }
/* 商店武器、防具的數值（攻擊力、防禦、可使用職業、材質、重量）：在名字下面，和說明框同樣的字 */
#qty-pop .qp-detail { margin: 8px 2px 2px; padding: 6px 8px; font-size: 13px; line-height: 1.5; color: #e8e2d0; background: rgba(0,0,0,0.28); border-radius: 4px; }
#qty-pop .qp-qty { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
#qty-pop .qp-step { flex: none; width: 52px; height: 46px; padding: 0; font: bold 26px/1 sans-serif; color: #ffe6a8; background: linear-gradient(#5a4220, #2e200c); border: 1px solid #c9a35a; border-radius: 6px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
#qty-pop .qp-step:active { filter: brightness(1.3); }
#qty-pop .qp-qty input { flex: 1; min-width: 0; height: 46px; box-sizing: border-box; padding: 0 8px; text-align: center; font: bold 20px/1 sans-serif; color: #fff; background: #0c0a08; border: 1px solid #8a6a3a; border-radius: 6px; }
#qty-pop .qp-quick { display: flex; gap: 6px; }
#qty-pop .qp-quick button { flex: 1; min-width: 0; height: 34px; padding: 0 4px; font-size: 14px; color: #e8dcc0; background: #221a10; border: 1px solid #6a5232; border-radius: 5px; touch-action: manipulation; }
#qty-pop .qp-total { min-height: 20px; margin: 10px 0 2px; font-size: 14px; color: #f0d27a; }
#qty-pop .qp-total.poor { color: #ff8a70; }
#qty-pop .qp-btns { display: flex; gap: 10px; margin-top: 10px; }
#qty-pop .qp-btns button { flex: 1; height: 44px; font-size: 17px; border-radius: 6px; touch-action: manipulation; }
#qty-pop .qp-ok { color: #2a1a06; font-weight: bold; background: linear-gradient(#f0cf80, #b8892e); border: 1px solid #ffe9a8; }
#qty-pop .qp-ok.off { filter: grayscale(1) brightness(0.6); }
#qty-pop .qp-cancel { color: #e8dcc0; background: #2a2218; border: 1px solid #6a5232; }
/* 電腦的全螢幕按鈕（js/main.js）：視窗右上角，有黑邊時在黑邊上 */
/*   亮一點、明顯一點（老闆 11-10「全螢幕按鈕作票亮稍微明顯一點」）：金色字、亮框、淡淡的光 */
/* 全螢幕鈕再明顯一點（老闆 11-12「用圖示＋文字」）：四角展開的圖示＋字，大一點、亮一點的金框，剛出現時亮幾下 */
#btn-pcfull { position: fixed; right: 8px; top: 8px; z-index: 90; display: flex; align-items: center; gap: 7px; padding: 7px 14px 7px 11px; font: bold 16px/20px var(--font); color: #fff2c8; background: rgba(58, 40, 14, 0.96); border: 2px solid #e0b860; border-radius: 0; box-shadow: 0 0 10px rgba(255, 206, 110, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.6); text-shadow: 0 1px 1px #000; cursor: pointer; animation: pcfull-glow 1.2s ease-in-out 3; }
#btn-pcfull svg { width: 18px; height: 18px; flex: none; }
#btn-pcfull.hidden { display: none; }
/* 全螢幕時同一顆變成「離開全螢幕」（老闆 11-16「右上要有退出全螢幕按鈕」）：小一點、不閃，不搶畫面 */
#btn-pcfull .ic-exit, #btn-pcfull.exit .ic-enter { display: none; }
#btn-pcfull.exit .ic-exit { display: inline; }
#btn-pcfull.exit { animation: none; padding: 4px 10px 4px 8px; gap: 5px; font-size: 14px; line-height: 18px; opacity: 0.8; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6); }
#btn-pcfull.exit svg { width: 14px; height: 14px; }
#btn-pcfull.exit:hover { opacity: 1; }
#btn-pcfull:hover { color: #fff; border-color: #ffe090; background: rgba(92, 64, 22, 0.98); box-shadow: 0 0 14px rgba(255, 216, 130, 0.85), inset 0 0 0 1px rgba(0, 0, 0, 0.6); }
@keyframes pcfull-glow { 50% { box-shadow: 0 0 18px rgba(255, 216, 130, 0.95), inset 0 0 0 1px rgba(0, 0, 0, 0.6); } }

/* 創角、死亡畫面：放不下時可以捲動 */
html.mobile .overlay { align-items: flex-start; justify-content: flex-start; overflow-y: auto; padding: calc(8px + var(--st)) calc(8px + var(--sr)) calc(8px + var(--sb)) calc(8px + var(--sl)); }
html.mobile .overlay > .panel { margin: auto; max-width: 100%; }

@media (orientation: landscape) {
  html.mobile .create-panel { width: 760px; padding: 12px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; align-items: center; grid-template-areas: "main h1" "main choice" "main desc" "hpmp bonus" "hpmp name" "hpmp btns"; }
  html.mobile .create-panel h1 { grid-area: h1; margin: 0; font-size: 19px; }
  html.mobile .create-panel .choice { grid-area: choice; margin: 4px 0; flex-wrap: wrap; }
  html.mobile #create-desc { grid-area: desc; min-height: 0; margin: 2px 0; }
  html.mobile .create-main { grid-area: main; }
  html.mobile #create-hpmp { grid-area: hpmp; align-self: start; }
  html.mobile #create-bonus { grid-area: bonus; margin: 4px 0; }
  html.mobile #create-name { grid-area: name; margin: 4px 0; }
  html.mobile .create-panel .btns { grid-area: btns; }
  /* 手機橫向的選擇角色：左邊三欄兩排的角色欄位，右邊角色資料與按鈕 */
  html.mobile .select-panel { --sh: 44vh; flex-direction: row; align-items: center; gap: 12px; }
  html.mobile #select-slots { grid-template-columns: repeat(3, calc(var(--sh) * 132 / 292)); }
  html.mobile .select-bottom { flex-direction: column; width: 330px; }
  html.mobile .select-bottom .btns { flex-direction: row; width: auto; }
}

/* 直向：上面狀態，下面快捷列與按鈕；背包在下半部，其他視窗在上半部 */
@media (orientation: portrait) {
  /* 視窗按鈕排在最下面一排（拇指點得到）；攻略・討論在 ☰ 選單裡 */
  html.mobile .hud-right { top: auto; left: calc(6px + var(--sl)); bottom: calc(6px + var(--sb)); display: flex; gap: 4px; }
  html.mobile .hud-right button { flex: 1; height: 40px; font-size: 14px; }
  html.mobile .hud-right #btn-menu { flex: 0 0 52px; font-size: 18px; }
  html.mobile #mmenu { top: auto; right: calc(6px + var(--sr)); bottom: calc(52px + var(--sb)); }
  html.mobile #btn-pickup { right: calc(10px + var(--sr)); bottom: calc(164px + var(--sb)); }
  html.mobile #btn-pk { top: calc(48px + var(--st)); }
  html.mobile #buffs { max-width: calc(100vw - 16px); }
  /* 底部由下往上：視窗按鈕 → 快捷列 → 訊息欄（左邊留給聊天按鈕），中間不留空 */
  html.mobile #log { left: calc(56px + var(--sl)); right: calc(6px + var(--sr)); width: auto; bottom: calc(100px + var(--sb)); height: calc(4.05em + 6px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9px); mask-image: linear-gradient(to bottom, transparent 0, #000 9px); }   /* 三行；頂端淡出，舊的那行露出一點也看不到 */
  html.mobile #btn-chat { bottom: calc(100px + var(--sb)); }
  html.mobile #chat-input { bottom: calc(100px + var(--sb)); }
  html.mobile #hotbar { bottom: calc(52px + var(--sb)); gap: 3px; }
  html.mobile .hot { width: 40px; height: 40px; }
  html.mobile #mode-bar { top: auto; bottom: calc(170px + var(--sb)); }   /* 選目標的提示在拇指附近 */
  html.mobile #win-inv { left: calc(6px + var(--sl)); width: auto; top: auto; bottom: calc(52px + var(--sb)); height: 56%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; grid-template-areas: "head" "doll" "gold" "grid" "detail"; }
  html.mobile #win-inv > .doll { justify-content: center; }
  html.mobile #doll-slots { flex: 1; max-width: 255px; grid-template-columns: repeat(auto-fill, 40px); align-content: center; }
  html.mobile #inv-grid { border-left: 0; border-top: 1px solid #3a2c1a; }
  html.mobile #win-char, html.mobile #win-spell, html.mobile #win-shop, html.mobile #win-learn, html.mobile #win-wh, html.mobile #win-party, html.mobile #win-trade, html.mobile #win-stall { right: calc(6px + var(--sr)); width: auto; max-height: calc(42% - 12px - var(--hudh) - var(--st)); }
  /* 魔法列表：最多佔畫面 70%（不蓋到最下面的視窗按鈕） */
  html.mobile #win-spell { max-height: min(70%, calc(100% - 64px - var(--hudh) - var(--st) - var(--sb))); }
  /* 擺攤：自己一個視窗（不開背包），從狀態框下面到視窗按鈕上面 */
  html.mobile #win-stall { max-height: calc(100% - 64px - var(--hudh) - var(--st) - var(--sb)); }
  html.mobile .create-panel { padding: 14px 12px; }
  html.mobile .create-main { gap: 8px; }
  html.mobile #create-preview { width: 96px; height: 104px; }
  html.mobile #create-stats { width: 148px; }
  html.mobile #create-die { font-size: 26px; }
  html.mobile .select-panel { --sh: min(calc((100vw - 24px) / 3 * 292 / 132), 30vh); }
  html.mobile #select-slots { grid-template-columns: repeat(3, calc(var(--sh) * 132 / 292)); }
  html.mobile .select-bottom { flex-direction: column; }
  html.mobile .select-bottom .btns { flex-direction: row; width: auto; }
}
/* 原版介面（電腦）才有的：左邊五列狀態、青銅龍框、對話框捲軸（css/classic.css） */
.cl-stat, .cl-frame, .cl-scroll { display: none; }
/* 斷線重連中的提示（js/net.js retryTip）：畫面最上面置中，蓋在登入畫面上、不擋點擊 */
#net-retry { position: fixed; top: calc(10px + var(--st, 0px)); left: 50%; transform: translateX(-50%); z-index: 3000; width: max-content; max-width: calc(100vw - 24px); padding: 6px 16px; box-sizing: border-box;
  background: rgba(20, 12, 6, 0.9); border: 1px solid #8a6a34; border-radius: 4px; color: #ffd98a; font-size: 15px; line-height: 1.5; text-align: center; pointer-events: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
#net-retry.hidden { display: none; }
/* 伺服器更新時遊戲畫面留著等（js/net.js hold）：變暗、擋住點擊，提示（#net-retry）在上面 */
#net-hold { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2990; background: rgba(0, 0, 0, 0.35); }
#net-hold.hidden { display: none; }
#preload .upd { display: none; }
#preload.upd .upd { display: block; }
