/* 經典天堂倖存者：電腦版下方狀態列（照原版 uistatus86，800×125）與原版物品欄（ReInventory，189×281）
   位置全部照原版介面檔的座標（像素），整個元件用 transform: scale 等比放大（--hk、--ik 由 js/hud.js 依視窗大小設定）
   只有電腦（滑鼠、寬 761 以上）用；手機照原本的村莊按鈕 */

/* ---------- 下方狀態列 ---------- */
.lh { display: none; }
@media (min-width: 761px) and (pointer: fine) {
  #vhud.lhon .vh-top, #vhud.lhon .vh-btns { display: none; }
  #vhud.lhon .lh { display: block; }
}
.lh { position: absolute; left: 50%; bottom: 0; width: 800px; height: 125px; transform: translateX(-50%) scale(var(--hk, 1)); transform-origin: 50% 100%;
  pointer-events: none; z-index: 3; color: #f0e6c8; font-size: 11px; text-shadow: 0 1px 1px #000, 0 0 2px #000; }
.lh > div { position: absolute; pointer-events: auto; }
.lh img { position: absolute; display: block; }
.lh i { position: absolute; font-style: normal; line-height: 12px; white-space: nowrap; }

/* 左：數值框 s3168（等級、金幣、防禦／魔防、擊殺／出征、背包／倉庫） */
.lh-l { left: 0; top: -2px; width: 138px; height: 127px; background: url(../assets/ui/orig/s3168.png?v=2) no-repeat; cursor: help; }   /* 框高 127、狀態列 125：往上提 2，最下面的外框才不會被切掉（11-17） */
.lh-l .lvbar { left: 25px; top: 26px; }
.lh-l .lvi { left: 8px; top: 23px; }
.lh-l .adi { left: 8px; top: 42px; }
.lh-l .ali { left: 10px; top: 86px; }
.lh-l .w1 { left: 8px; top: 104px; }
.lh-l .w2 { left: 71px; top: 104px; }
.lh-l .gg { position: absolute; top: 107px; width: 34px; height: 14px; overflow: hidden; }   /* 對準底圖的格子（量過：左格 29～62、右格 89～121、上下 107～120） */
.lh-l .gg img { left: 0; top: 0; }
#lhG1 { left: 29px; } #lhG2 { left: 89px; }
#lhLv { left: 43px; top: 29px; font-weight: 700; color: #fff; }
#lhCh { left: 72px; top: 29px; color: #e8d29a; }
#lhAd { left: 30px; width: 92px; top: 47px; text-align: right; color: #ffe9a8; overflow: hidden; }
/* 數值照底圖每一格置中（11-17 使用者：要對準；原本從固定位置往右排，數字一長就超出格子）；太長 js/fit.js 自動縮小 */
#lhAc, #lhMr, #lhKill, #lhRun, #lhBag, #lhWh { width: 34px; height: 13px; line-height: 13px; text-align: center; overflow: hidden; }
#lhAc { left: 29px; top: 68px; } #lhMr { left: 89px; top: 68px; }
#lhKill { left: 29px; top: 87px; } #lhRun { left: 89px; top: 87px; }
#lhBag { left: 29px; top: 107px; } #lhWh { left: 89px; top: 107px; }
/* 說明框（11-17 使用者：滑鼠移上去或點一下要出現說明，玩家才知道是什麼）：在數值框正上方，滑到哪一格那一行亮起來 */
.lh-tip { position: absolute; left: 0; bottom: 131px; width: 372px; box-sizing: border-box; padding: 2px 6px 4px; pointer-events: none; z-index: 5;
  border-style: solid; border-width: 12px; border-image: url(../assets/ui/o/frame.png?v=2) 33 fill / 12px stretch; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .7));
  color: #e9e1c8; font-size: 11px; line-height: 15px; text-shadow: 0 1px 1px #000; }
.lh-tip .tr { display: grid; grid-template-columns: 56px 54px minmax(0, 1fr); gap: 8px; padding: 1px 4px; white-space: nowrap; }
.lh-tip .tr b { color: #f4d27a; font-weight: 700; }
.lh-tip .tr span { color: #fff; text-align: right; }
.lh-tip .tr small { color: #a89a78; font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.lh-tip .tr.on { background: rgba(255, 210, 120, .16); outline: 1px solid rgba(255, 210, 120, .35); }

/* 中：聊天（原版聊天框 s3279 底＋s3280 外框，輸入列 s2273、頻道標籤）
   原版 CENTER_WINDOW 在畫面 (129, 470)＝狀態列上緣再高 5 像素；外框圖從上緣開始畫、高度 130（到畫面底） */
.lh-c { left: 129px; top: -5px; width: 362px; height: 130px; background: url(../assets/ui/orig/s3280.png?v=2) 0 0 / 362px 249px no-repeat, url(../assets/ui/orig/s3279.png?v=2) 0 0 / 362px 245px no-repeat; }
.lh-c .chat { position: absolute !important; left: 0 !important; top: 0 !important; right: auto !important; bottom: auto !important; width: 362px !important; height: 130px; }
.lh-c .chat-log { position: absolute; left: 10px; top: 23px; width: 337px; height: 85px; box-sizing: border-box; padding: 2px 4px; font-size: 12px; line-height: 15px;
  background: none !important; -webkit-mask-image: none !important; mask-image: none !important; scrollbar-width: thin; scrollbar-color: #6a5a3a transparent; }
.lh-c .chat-in { position: absolute; left: 10px; top: 109px; width: 345px; height: 21px; box-sizing: border-box; padding: 0 4px 0 3px; display: flex !important; gap: 4px;
  background: url(../assets/ui/orig/s2273.png?v=2) 0 0 / 345px 21px no-repeat; }
.lh-c .chat-in input { height: 18px; font-size: 12px; }
.lh-c .chat-in .mini { display: none; }

/* 小地圖（原版 MINI_MAP_WINDOW 在畫面 (485, 475)：框 s3275 貼齊左上、地圖底 s3274 在框裡 (12, 20)；畫布在 js/hud.js） */
.lh-m { left: 485px; top: 0; width: 158px; height: 125px; }
.lh-m canvas { position: absolute; left: 12px; top: 20px; width: 135px; height: 101px; background: #000; }
.lh-m .mf { position: absolute; inset: 0; background: url(../assets/ui/orig/s3275.png?v=2) no-repeat; pointer-events: none; }

/* 右：快捷列 s3176（F5～F12）＋原版選單鈕 */
.lh-r { left: 643px; top: 1px; width: 157px; height: 124px; background: url(../assets/ui/orig/s3176.png?v=2) no-repeat; }
/* 狀態列兩端外角改圓弧（11-17 使用者：直角太死板）：底圖搬到 ::before 才能只圓底圖、不切到上面跳出來的說明框 */
.lh-l, .lh-r { isolation: isolate; }
.lh-l::before, .lh-r::before { content: ""; position: absolute; inset: 0; z-index: -1; background: inherit; pointer-events: none; box-shadow: 0 -2px 6px rgba(0, 0, 0, .45); }
.lh-l { background: none !important; } .lh-l::before { background: url(../assets/ui/orig/s3168.png?v=2) no-repeat; border-top-left-radius: 22px 26px; }
.lh-r { background: none !important; } .lh-r::before { background: url(../assets/ui/orig/s3176.png?v=2) no-repeat; border-top-right-radius: 22px 26px; }
/* 快捷列空格：蓋掉底圖印的 F5～F12（網頁不能按 F 鍵，11-17 使用者） */
.lh-key.blank::before, .lh-key.off::before, .lh-key.rk.empty::before { content: ""; position: absolute; left: 3px; top: 3px; right: 3px; bottom: 3px; background: #0d0a07; border-radius: 2px; pointer-events: none; }
.lh-tab { position: absolute; top: 5px; width: 22px; height: 15px; border: 0; padding: 0; background: transparent center / 22px 15px no-repeat; cursor: pointer; }
.lh-key { position: absolute; width: 34px; height: 33px; cursor: pointer; }
.lh-key img { left: 1px; top: 0; width: 32px; height: 32px; image-rendering: pixelated; }
.lh-key b { position: absolute; left: 0; right: 0; bottom: -1px; text-align: center; font-size: 10px; font-weight: 400; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 1px #000; pointer-events: none; }
.lh-key:hover img { filter: brightness(1.3); }
.lh-key.off { pointer-events: none; cursor: default; } .lh-key.off > * { display: none; }   /* 商城關閉：格子留著蓋成空格（不露出底圖印的 F11） */
#chatTab { display: none !important; }   /* 11-16 使用者：不要公頻分頁圖（.lh img 會把它改回 block，所以這裡要 !important） */
.lh-btn { position: absolute; top: 93px; width: 19px; height: 31px; border: 0; padding: 0; cursor: pointer; background: transparent 0 0 / 19px 31px no-repeat; }

/* ---------- 原版物品欄（ReInventory p3212，189×281） ---------- */
.iw { position: fixed; right: 14px; top: 58px; width: 189px; height: 281px; z-index: 6; pointer-events: auto; transform: scale(var(--ik, 1)); transform-origin: 100% 0;
  background: url(../assets/ui/orig/p3212.png?v=2) no-repeat; color: #f0e6c8; font-size: 11px; text-shadow: 0 1px 1px #000; user-select: none; }
.iw-x { position: absolute; left: 166px; top: 7px; width: 20px; height: 19px; border: 0; padding: 0; cursor: pointer; background: url(../assets/ui/orig/s9183.png?v=2) no-repeat; }
.iw-x:active { background-image: url(../assets/ui/orig/s9184.png?v=2); }
.iw-grid { position: absolute; left: 26px; top: 25px; width: 136px; height: 204px; overflow-y: scroll; overflow-x: hidden; scrollbar-width: none;
  display: grid; grid-template-columns: repeat(4, 34px); grid-auto-rows: 34px; align-content: start; }
.iw-grid::-webkit-scrollbar { display: none; }
.iw-c { position: relative; width: 34px; height: 34px; cursor: pointer; }
.iw-c > img { position: absolute; left: 1px; top: 1px; width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; }
.iw-c.eq::before { content: ""; position: absolute; left: 1px; top: 1px; width: 32px; height: 32px; background: url(../assets/icons/2700.png) no-repeat; }
.iw-c.eq::after { content: ""; position: absolute; left: 2px; top: 2px; width: 32px; height: 32px; background: url(../assets/icons/2701.png) no-repeat; pointer-events: none; }
.iw-c.on > .sel { position: absolute; inset: 0; background: url(../assets/ui/orig/s536.png?v=2) 0 0 / 34px 34px no-repeat; pointer-events: none; }
.iw-c i { position: absolute; font-style: normal; font-size: 10px; font-weight: 700; text-shadow: 0 0 2px #000, 0 0 2px #000; pointer-events: none; }
.iw-c .en { left: 2px; top: 1px; color: #9fd0ff; }
.iw-c .cn { right: 2px; bottom: 1px; color: #fff; }
.iw-c.summon > img { filter: drop-shadow(0 0 2px #7dff9a); }
body.picking .iw-c, body.picking .ic { cursor: crosshair; }
/* 捲軸（原版 s2040 上、s2039 軌道、s2044 拉桿、s2042 下） */
.iw-sb { position: absolute; left: 167px; top: 34px; width: 12px; height: 195px; }
.iw-sb .up, .iw-sb .dn { position: absolute; left: 0; width: 12px; height: 14px; border: 0; padding: 0; cursor: pointer; background: no-repeat; }
.iw-sb .up { top: 0; background-image: url(../assets/ui/orig/s2040.png?v=2); } .iw-sb .up:active { background-image: url(../assets/ui/orig/s2041.png?v=2); }
.iw-sb .dn { top: 181px; background-image: url(../assets/ui/orig/s2042.png?v=2); } .iw-sb .dn:active { background-image: url(../assets/ui/orig/s2043.png?v=2); }
.iw-sb .tr { position: absolute; left: 0; top: 14px; width: 12px; height: 167px; background: url(../assets/ui/orig/s2039.png?v=2) no-repeat; }
.iw-sb .kb { position: absolute; left: 0; top: 14px; width: 11px; height: 16px; background: url(../assets/ui/orig/s2044.png?v=2) no-repeat; cursor: grab; }
/* 分頁（s2048：全部、裝備、消耗品、魔法娃娃） */
/* 分頁（11-16 使用者：沒對到）：原版 s2048 只拆到「第 1 頁選中」那格，改用 o/iw_tabs_off.png（四頁都沒選）＋ 選中那頁疊 o/iw_tab_on0～3.png（凸起、變亮） */
.iw-tabs { position: absolute; left: 26px; top: 230px; width: 139px; height: 23px; background: url(../assets/ui/o/iw_tabs_off.png?v=1) no-repeat; }
.iw-tabs button { position: absolute; top: 0; width: 35px; height: 23px; border: 0; padding: 0; background: transparent no-repeat; cursor: pointer; }
.iw-tabs button:hover:not(.on) { filter: brightness(1.25); background-image: url(../assets/ui/o/iw_tabs_off.png?v=1); }
.iw-tabs button[data-i="1"]:hover:not(.on) { background-position: -35px 0; } .iw-tabs button[data-i="2"]:hover:not(.on) { background-position: -70px 0; } .iw-tabs button[data-i="3"]:hover:not(.on) { background-position: -105px 0; }
.iw-tabs button[data-i="0"].on { background-image: url(../assets/ui/o/iw_tab_on0.png?v=1); } .iw-tabs button[data-i="1"].on { background-image: url(../assets/ui/o/iw_tab_on1.png?v=1); }
.iw-tabs button[data-i="2"].on { background-image: url(../assets/ui/o/iw_tab_on2.png?v=1); } .iw-tabs button[data-i="3"].on { background-image: url(../assets/ui/o/iw_tab_on3.png?v=1); }
.iw-count { position: absolute; left: 26px; top: 259px; width: 81px; height: 16px; line-height: 16px; text-align: left; color: #f0e6c8; }
.iw-sort { position: absolute; left: 126px; top: 258px; width: 18px; height: 18px; border: 0; padding: 0; cursor: pointer; background: url(../assets/ui/orig/p3214.png?v=2) no-repeat; }
.iw-sort:hover { background-image: url(../assets/ui/orig/p3215.png?v=2); } .iw-sort:active { background-image: url(../assets/ui/orig/p11587.png?v=2); }
/* 道具說明（點道具才出現，在物品欄左邊；原版視窗框） */
.iw-info { position: absolute; right: 193px; top: 0; width: 236px; box-sizing: border-box; padding: 2px 6px 6px; font-size: 12px; line-height: 1.55; color: #e9e1c8;
  border-style: solid; border-width: 16px; border-image: url(../assets/ui/o/frame.png?v=2) 33 fill / 16px stretch; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .7)); }
.iw-info .i-nm { font-size: 13px; }
.iw-info .i-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.iw-info .i-act .mini { font-size: 12px; padding: 0 8px; line-height: 18px; }
.iw-info .tip { color: #a89a78; font-size: 11px; margin-top: 4px; }

/* 天堂式強化：選卷軸後的提示（畫面上方黃字） */
.pick-hint { position: fixed; left: 50%; top: 9%; transform: translateX(-50%); z-index: 40; pointer-events: none; white-space: nowrap;
  color: #ffe85a; font-size: 17px; font-weight: 700; text-shadow: 0 0 4px #000, 0 2px 3px #000, 0 0 10px #000; }
.sys-msg { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 40; pointer-events: none; white-space: nowrap;
  color: #f0e6c8; font-size: 18px; font-weight: 700; text-shadow: 0 0 4px #000, 0 2px 3px #000, 0 0 12px #000; animation: sysin .25s ease-out; }
.sys-msg.success { color: #8fd0ff; } .sys-msg.protected { color: #ffe85a; } .sys-msg.gone { color: #ff7a5a; }
@keyframes sysin { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.c-ench { color: #8fd0ff; } .c-ench b { color: #6ab8ff; }

/* 視窗可以用滑鼠拖（js/drag.js）：拖標題列或框；按鈕、道具、輸入框照常 */
@media (pointer: fine) {
  .pnl-hd, .iw, .iw-count, #dlg .frame, #scrPause .frame > .ttl { cursor: move; }
  .iw-grid, .iw-info { cursor: default; }
  #dlg .frame input, #dlg .frame textarea { cursor: text; }
}
body.win-drag, body.win-drag * { cursor: move !important; user-select: none !important; }
.iw-info.r { right: auto; left: 193px; }   /* 物品欄拖到左邊：說明框改放右邊 */

/* 聊天頻道鈕（11-17）：狀態列的輸入列比較矮 */
.lh-c .chat-ch { height: 16px; line-height: 14px; font-size: 11px; padding: 0 3px; }
.lh-c .chat-menu { bottom: 26px; left: 4px; }
