/* 經典天堂倖存者：村莊（大廳）、道具視窗（背包、衝裝、商店、倉庫、變身、魔法娃娃） */

/* ===== 村莊：上方角色資訊、右下按鈕 ===== */
#vhud { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.vh-top { position: absolute; left: 10px; top: 10px; display: flex; gap: 10px; align-items: center; pointer-events: auto;
  background: linear-gradient(rgba(42, 34, 22, .92), rgba(18, 13, 7, .92)); border: 2px solid #8c6d32; border-radius: 4px; padding: 6px 12px 6px 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .6); }
.vh-top .face { width: 58px; height: 58px; border: 1px solid #8c6d32; }
.vh-inf .nm { font-size: 18px; font-weight: 900; color: #f6e6b6; line-height: 1.2; }
.vh-inf .sub3 { font-size: 13px; color: #d4c7a2; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.vh-clan { color: #9fd0ff; display: inline-flex; gap: 3px; align-items: center; }
.vh-ad { display: flex; align-items: center; gap: 4px; font-size: 15px; color: #ffe28a; }
.vh-ad img { width: 22px; height: 22px; image-rendering: pixelated; }
.vh-btns { position: absolute; right: 10px; bottom: 12px; display: flex; gap: 8px; pointer-events: auto; }
.vb { font: inherit; font-size: 16px; font-weight: 700; color: #f6e6b6; min-width: 76px; height: 46px; padding: 0 12px; cursor: pointer; position: relative;
  background: linear-gradient(#5a4622, #2e2410); border: 2px solid #a8873e; border-radius: 4px; text-shadow: 0 1px 0 #000; box-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
.vb:hover { filter: brightness(1.2); }
.vb.go { font-size: 19px; min-width: 96px; background: linear-gradient(#8a6a2a, #4a3410); border-color: #f4d27a; color: #fff3c8; }
.vb i { position: absolute; right: 3px; top: 1px; font-style: normal; font-size: 10px; color: #a8915e; }
@media (max-width: 760px), (pointer: coarse) {
  .vh-top { left: 6px; top: 6px; padding: 4px 8px 4px 4px; gap: 6px; }
  .vh-top .face { width: 42px; height: 42px; }
  .vh-inf .nm { font-size: 15px; }
  .vh-inf .sub3 { font-size: 11px; }
  .vh-btns { right: 6px; bottom: 8px; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 64vw; }
  .vb { min-width: 58px; height: 44px; font-size: 14px; padding: 0 8px; }
  .vb.go { min-width: 70px; font-size: 16px; }
  .vb i { display: none; }
}

.vh-notice { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); max-width: min(560px, 60vw); padding: 5px 14px; pointer-events: none;
  background: rgba(60, 10, 6, .82); border: 1px solid #c0503e; color: #ffe0b0; font-size: 14px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .vh-notice { top: 62px; max-width: 92vw; font-size: 13px; } }
/* 全服線上、頻道人數（右上角，點了換頻道） */
.vh-online { position: absolute; right: 10px; top: 10px; max-width: min(340px, 44vw); padding: 4px 10px 5px; pointer-events: auto; cursor: pointer; text-align: right;
  background: rgba(20, 15, 8, .82); border: 1px solid #8c6d32; border-radius: 3px; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
.vh-online:hover { border-color: #f4d27a; }
.vo-l { font-size: 14px; font-weight: 700; color: #f6e6b6; line-height: 1.35; }
.vo-l b { color: #ffe28a; }
.vo-s { font-size: 11.5px; color: #bfae84; line-height: 1.3; }
@media (max-width: 760px), (pointer: coarse) { .vh-online { right: 6px; top: 6px; padding: 3px 7px 4px; max-width: 46vw; } .vo-l { font-size: 12px; } .vo-s { font-size: 10px; } }
.chlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.chlist .btn.cur { border-color: #f4d27a; color: #fff3c8; }
.chlist .btn[disabled] { opacity: .45; cursor: default; }

.btn.line { background: linear-gradient(#06c755, #03873a); border-color: #7dffb0; color: #fff; }

/* ===== 視窗外框 ===== */
.pnl-scr { background: rgba(4, 3, 2, .5); z-index: 8; }
.frame.pnl { width: 980px; max-height: 94vh; display: flex; flex-direction: column; padding: 10px 14px 12px; position: relative; }
.frame.pnl.set { width: 460px; }
.frame.pnl.poly { width: 900px; }
.pnl-hd { position: relative; }
.pnl-hd .ttl { margin-bottom: 8px; }
.pnl-x { position: absolute; right: -4px; top: -4px; width: 34px; height: 34px; font-size: 18px; color: #f4d27a; background: rgba(0, 0, 0, .4); border: 1px solid #8c6d32; border-radius: 3px; cursor: pointer; }
.pnl-body { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; touch-action: pan-y; overscroll-behavior: contain; }
.grid, .slist, .passl, .cxl, .scroll, .rank-body, .clan-body { touch-action: pan-y; overscroll-behavior: contain; }
.pflash { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); background: rgba(20, 60, 30, .92); border: 1px solid #6fd08a; color: #c8ffd8; padding: 6px 16px; border-radius: 3px;
  font-size: 15px; white-space: nowrap; pointer-events: none; animation: pfl 2.2s forwards; z-index: 2; }
@keyframes pfl { 0% { opacity: 0; transform: translate(-50%, 6px); } 10%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.dim { color: #8c7d5a; }
.bad { color: #ff8a70; }
.good { color: #7dff9a; }
.mid { color: #ffd76a; }
.warn { color: #ffbf6a; }
.eff { color: #9fe0ff; }

/* ===== 道具格子 ===== */
.ic { width: 46px; height: 46px; box-sizing: border-box; position: relative; flex: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, #2e2618, #0b0805); border: 1px solid #4e3e1e; border-radius: 2px; }
.ic img { width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; }
.ic.t2 { border-color: #3d6488; }
.ic.t3 { border-color: #a8701e; box-shadow: inset 0 0 8px rgba(255, 170, 40, .25); }
.ic:hover { border-color: #c9a24e; }
.ic.on { border-color: #f4d27a; box-shadow: 0 0 0 1px #f4d27a, inset 0 0 12px rgba(244, 210, 122, .35); }
.ic .en { position: absolute; left: 2px; top: 0; font-style: normal; font-size: 11px; font-weight: 900; color: #9fd0ff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.ic .cn { position: absolute; right: 2px; bottom: 0; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.ic.summon::before { content: "召喚中"; position: absolute; left: 0; right: 0; bottom: -1px; font-size: 9px; text-align: center; color: #7dff9a; background: rgba(0, 0, 0, .6); }
.ic.chk { border-color: #6fd08a; box-shadow: 0 0 0 1px #6fd08a; }
.ic.chk::after { content: "\2713"; position: absolute; right: 1px; top: -2px; font-size: 14px; font-weight: 900; color: #7dff9a; text-shadow: 0 0 3px #000; }
.ic.eq.empty { cursor: default; background: rgba(0, 0, 0, .35); border-style: dashed; border-color: #3a2e18; }
.ic.eq.empty span { font-size: 11px; color: #6a5a3a; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 46px); gap: 4px; align-content: start; padding: 6px; background: rgba(0, 0, 0, .4); border: 1px solid #4e3e1e;
  overflow-y: auto; max-height: 300px; min-height: 104px; }
.inm { font-weight: 900; color: #f6e6b6; }
.inm.t2 { color: #8fd0ff; }
.inm.t3 { color: #ffb84a; }

/* ===== 道具說明 ===== */
.info { background: rgba(0, 0, 0, .35); border: 1px solid #4e3e1e; padding: 8px 10px; min-height: 120px; font-size: 14px; line-height: 1.65; color: #e2d6b4; }
.i-nm { font-size: 17px; margin-bottom: 2px; }
.i-ds div { min-height: 1em; }
.i-act { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.info:empty { display: none; }

/* ===== 角色／背包 ===== */
.bag { display: flex; gap: 14px; }
.bag-l { width: 340px; flex: none; }
.bag-r { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dollw { display: flex; justify-content: center; gap: 6px; align-items: flex-start; }
.eqcol { display: flex; flex-direction: column; gap: 5px; }
.eqcol .ic { width: 50px; height: 50px; }
.pv { text-align: center; background: radial-gradient(ellipse at 50% 70%, rgba(140, 109, 50, .25), rgba(0, 0, 0, 0) 70%); }
.pv canvas { width: 180px; height: 250px; display: block; }
.pv-n { font-size: 16px; font-weight: 900; color: #f6e6b6; }
.pv-s { font-size: 12px; color: #bfae84; }
.sum { margin-top: 6px; font-size: 13px; }
.sum .sect { margin: 6px 0 4px; font-size: 14px; }
/* 出發時使用的藥水：兩欄，勾選＋圖示＋名稱＋數量；沒有的變暗 */
.brw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.brc { display: flex; align-items: center; gap: 5px; padding: 2px 6px; background: rgba(0, 0, 0, .35); border: 1px solid #3a2e18; cursor: pointer; white-space: nowrap; min-width: 0; font-size: 13px; color: #d4c7a2; }
.brc input { width: 16px; height: 16px; margin: 0; accent-color: #c9a24e; flex: none; }
.brc img { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.brc span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brc b { margin-left: auto; color: #ffe28a; }
.brc.none { opacity: .5; }
.dtw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.dtc { display: flex; align-items: baseline; gap: 6px; padding: 2px 6px; background: rgba(0, 0, 0, .35); border: 1px solid #3a2e18; white-space: nowrap; min-width: 0; overflow: hidden; }
.dtc span { color: #d4c7a2; } .dtc b { color: #8fd0ff; } .dtc small { margin-left: auto; color: #9f927a; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.apw { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.apn { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.apn img { width: 22px; height: 22px; image-rendering: pixelated; }
.apn b { color: #ffe28a; }
.apw.apr { flex-wrap: nowrap; white-space: nowrap; gap: 5px; }   /* 自動喝水一行排完（11-16 使用者：跑第二行） */
.apw.apr span { color: #e6c47c; }
.apw.apr select { min-width: 0; padding: 1px 2px; }
.apw select { font: inherit; font-size: 13px; color: #f0e6c8; background: #0c0a08; border: 1px solid #6a5530; padding: 1px 4px; }
/* 能力值（51 級起每級 1 點）：三欄兩列，有點數時旁邊一顆＋ */
.stw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.stc { display: flex; align-items: center; gap: 4px; padding: 2px 6px; background: rgba(0, 0, 0, .35); border: 1px solid #3a2e18; white-space: nowrap; min-width: 0; }
.stc span { color: #d4c7a2; }
.stc b { margin-left: auto; color: #f6e6b6; }
.stc b.up { color: #8fd0ff; }
.stc .stp { flex: none; padding: 0 6px; line-height: 18px; font-size: 13px; }
.mods { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.mods span { background: rgba(60, 100, 140, .2); border: 1px solid rgba(110, 170, 220, .35); color: #bfe4ff; padding: 1px 6px; border-radius: 2px; }
.sline { margin-top: 4px; color: #d4c7a2; }
.bag-hd { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #d4c7a2; }
.ad { display: inline-flex; align-items: center; gap: 3px; color: #ffe28a; font-weight: 700; margin-left: auto; }
.ad img { width: 20px; height: 20px; image-rendering: pixelated; }

/* ===== 衝裝 ===== */
.ench { text-align: center; padding: 6px 0; }
.en-big { width: 96px; height: 96px; margin: 4px auto 6px; position: relative; display: flex; align-items: center; justify-content: center; }
.en-ic { width: 76px; height: 76px; background: radial-gradient(circle, #2e2618, #0b0805); border: 2px solid #8c6d32; display: flex; align-items: center; justify-content: center; }
.en-ic img { width: 64px; height: 64px; image-rendering: pixelated; }
.en-big::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; opacity: 0; pointer-events: none; }
.en-big.fx-success::after { background: radial-gradient(circle, rgba(90, 160, 255, .9), rgba(40, 90, 255, 0) 70%); animation: enfx 1s ease-out; }
.en-big.fx-success.arm::after { background: radial-gradient(circle, rgba(230, 236, 255, .95), rgba(170, 180, 220, 0) 70%); }
.en-big.fx-protected::after { background: radial-gradient(circle, rgba(255, 240, 160, .9), rgba(255, 200, 60, 0) 70%); animation: enfx 1s ease-out; }
.en-big.gone .en-ic { border-color: #a8503e; animation: engone 1.2s forwards; }
.en-big.gone::after { background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(255, 120, 60, 0) 70%); animation: enfx .9s ease-out; }
@keyframes enfx { 0% { opacity: 0; transform: scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes engone { 0% { opacity: 1; } 100% { opacity: .15; filter: grayscale(1); } }
.en-nm { font-size: 20px; margin-bottom: 4px; }
.en-res { font-size: 16px; font-weight: 700; margin: 6px 0; }
.en-sc { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.en-opt { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #4e3e1e; background: rgba(0, 0, 0, .4); cursor: pointer; border-radius: 3px; font-size: 14px; }
.en-opt img { width: 32px; height: 32px; image-rendering: pixelated; }
.en-opt.on { border-color: #f4d27a; background: rgba(120, 90, 30, .3); }
.en-opt b { color: #ffe28a; }
.en-odds { font-size: 16px; margin: 10px 0 6px; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: #d4c7a2; cursor: pointer; margin: 4px 0; }
.chk input { width: 18px; height: 18px; accent-color: #c9a24e; }

/* ===== 商店 ===== */
.tabs .ad { margin-left: 12px; }
.flt { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.flt .mini.on { border-color: #f4d27a; color: #fff; background: linear-gradient(#7a5e2a, #3e3014); }
.shop { display: flex; gap: 12px; }
.slist { width: 380px; flex: none; max-height: 62vh; overflow-y: auto; border: 1px solid #4e3e1e; background: rgba(0, 0, 0, .35); }
.shop .info { flex: 1; min-width: 0; }
.srow { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid rgba(78, 62, 30, .5); cursor: pointer; font-size: 15px; }
.srow img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.srow span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow b { color: #ffe28a; font-weight: 700; }
.srow:hover { background: rgba(140, 109, 50, .15); }
.srow.on { background: rgba(140, 109, 50, .32); }
.srow.no { opacity: .5; }
.buy { margin-top: 10px; border-top: 1px solid #4e3e1e; padding-top: 8px; }
.qty { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; }
.inp.q { width: 70px; text-align: center; margin: 0; }
.tot { text-align: center; margin-top: 6px; font-size: 16px; }
.tot b { color: #ffe28a; }
.sellw { display: flex; gap: 12px; }
.sellw .grid { flex: 1; max-height: 52vh; }
.sellw .info { width: 330px; flex: none; }
.sellbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 15px; }
.sellbar b { color: #ffe28a; }

/* ===== 魔法娃娃、變身 ===== */
.dolls, .polys { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.dcard, .pcard { width: 160px; box-sizing: border-box; text-align: center; padding: 6px 6px 10px; background: rgba(0, 0, 0, .4); border: 2px solid #4e3e1e; border-radius: 4px; font-size: 13px; }
.dcard canvas { width: 150px; height: 140px; display: block; margin: 0 auto; max-width: 100%; object-fit: contain; }
.pcard canvas { width: 150px; height: 160px; display: block; margin: 0 auto; max-width: 100%; object-fit: contain; }
.dcard.on, .pcard.on { border-color: #f4d27a; background: rgba(120, 90, 30, .28); }
.pcard { cursor: pointer; }
.pcard:hover { border-color: #a8873e; }
.pcard.lock { cursor: default; filter: grayscale(1) brightness(.55); }
/* 金元寶商人（11-17，甲・列表版：一排一行、點了展開細項） */
.frame.pnl.ingot { width: 760px; max-width: 100%; }
.ig-hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; white-space: nowrap; }
.ig-hd > span:first-child { min-width: 0; overflow: hidden; }
.ig-hd b { color: #8fe08a; }
.ig-hd small { color: #a89a78; }
.coin { display: inline-flex; align-items: center; gap: 3px; color: #ffe28a; font-weight: 700; white-space: nowrap; }
.coin img { width: 22px; height: 22px; image-rendering: pixelated; }
.coin.big b { color: #ffe28a; font-size: 15px; }
.ig-list { display: flex; flex-direction: column; gap: 3px; }
.ig-tier { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 2px; padding: 3px 8px; background: rgba(120, 90, 30, .25); border-left: 3px solid #c9a040; white-space: nowrap; }
.ig-tier span { color: #ffe28a; font-weight: 700; font-size: 14px; }
.ig-tier small { color: #c9bb94; font-size: 12px; overflow: hidden; }
.ig-row { display: grid; grid-template-columns: 30px 46px minmax(0, 1fr) auto 64px; align-items: center; gap: 8px; padding: 2px 8px; border: 1px solid #3a2e18; background: rgba(0, 0, 0, .35); cursor: pointer; }
.ig-row:hover { border-color: #8c6d32; background: rgba(160, 120, 50, .15); }
.ig-row.mine { border-color: #a8873e; box-shadow: inset 0 0 0 1px rgba(244, 210, 122, .25); }
.ig-row.open { border-color: #f4d27a; background: rgba(120, 90, 30, .28); }
.ig-row > .ic { width: 28px; height: 28px; image-rendering: pixelated; }
.ig-row canvas { width: 46px; height: 56px; }
.ig-n { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; align-items: baseline; }
.ig-n b { color: #fff; font-size: 14px; white-space: nowrap; }
.ig-n small { color: #a89a78; font-size: 11px; white-space: nowrap; }
.ig-n span { grid-column: 1 / -1; font-size: 12px; color: #c9e8a0; white-space: nowrap; overflow: hidden; }
.ig-row .ig-t { font-size: 12px; color: #c9a95a; text-align: right; white-space: nowrap; }
.ig-det { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 10px; padding: 8px 10px; margin-bottom: 4px; border: 1px solid #6b5426; border-top: 0; background: rgba(20, 15, 8, .7); }
.ig-det .pv2 { display: flex; gap: 6px; }
.ig-det .pv2 canvas { width: 110px; height: 120px; background: rgba(0, 0, 0, .35); }
.ig-dr ul { margin: 0 0 6px; padding-left: 18px; color: #c9e8a0; font-size: 13px; line-height: 1.6; }
.ig-buy { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.btn.gold { border-color: #c9a040; color: #ffe08a; }
.ig-ft { margin-top: 8px; }
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) {
  .ig-row { grid-template-columns: 26px 40px minmax(0, 1fr) auto; }
  .ig-row .ig-t { display: none; }
  .ig-row canvas { width: 40px; height: 49px; }
  .ig-det { grid-template-columns: minmax(0, 1fr); }
  .ig-det .pv2 { justify-content: center; }
}
/* 變身視窗分頁、高等變身卡片（11-17） */
.ptabs { max-width: 360px; margin: 0 auto 8px; }
.pcard.hi { border-color: #8a6a26; }
.pcard .pcnt { margin-top: 2px; font-size: 12px; color: #8fe08a; }
.pcard .pcnt.bad { color: #ff8a6a; }
.pn { font-size: 16px; font-weight: 900; color: #f6e6b6; }
.plv { color: #9fd0ff; margin-bottom: 2px; }
.dcard .eff, .pcard .eff { min-height: 34px; line-height: 1.4; }
.dcard .btn { margin-top: 6px; }

/* ===== 倉庫 ===== */
.whw { display: flex; gap: 12px; margin-bottom: 8px; }
.whw > div { flex: 1; min-width: 0; }
.whw .grid { max-height: 38vh; }

/* ===== 設定 ===== */
.setw { text-align: center; }
.how2 { margin-top: 14px; font-size: 13px; line-height: 1.8; color: #d4c7a2; text-align: left; background: rgba(0, 0, 0, .35); border: 1px solid #4e3e1e; padding: 8px 10px; }
.how2 b { color: #f4d27a; }

/* ===== 結算：拿到的道具 ===== */
.loot { margin-top: 8px; }
.loot .sect { text-align: center; margin: 6px 0; }
.lgrid { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; max-width: 520px; margin: 0 auto; }
.lit { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.lit .ic { cursor: default; width: 40px; height: 40px; }
.lit i { font-style: normal; color: #ffbf6a; font-size: 11px; }

@media (max-width: 760px) {
  .frame.pnl { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; padding: 8px 8px 10px; }
  .pnl-scr { padding: 0; }
  .bag { flex-direction: column; gap: 8px; }
  .bag-l { width: auto; }
  .eqcol .ic { width: 44px; height: 44px; }
  .pv canvas { width: 130px; height: 180px; }
  .grid { grid-template-columns: repeat(auto-fill, 42px); max-height: 30vh; gap: 3px; padding: 4px; }
  .ic { width: 42px; height: 42px; }
  .shop { flex-direction: column; }
  .slist { width: auto; max-height: 34vh; }
  .sellw { flex-direction: column; }
  .sellw .info { width: auto; min-height: 0; }
  .sellw .grid { max-height: 34vh; }
  .whw { flex-direction: column; }
  .whw .grid { max-height: 22vh; }
  .dcard, .pcard { width: calc(50% - 6px); }
  .info { font-size: 13px; min-height: 0; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .frame.pnl { max-height: 100vh; height: 100%; padding: 6px 10px; }
  .pnl-hd .ttl { font-size: 17px; margin-bottom: 4px; }
  .pv canvas { width: 110px; height: 150px; }
  .grid { max-height: 40vh; }
}

/* ===== 商店：電腦版固定高度（11-16 使用者：「固定高度 不要隨著文字變高變矮」）=====
   視窗高度固定，購買／賣出／娃娃分頁一樣高；說明框、商品清單只在框裡捲動，視窗不跟著伸縮 */
@media (min-width: 761px) and (min-height: 521px) {
  .frame.pnl.shop { height: min(640px, 94vh); }
  .pnl.shop .pnl-body { display: flex; flex-direction: column; overflow: hidden; }
  .pnl.shop .pnl-body > * { flex: none; }
  .pnl.shop .pnl-body > .shop, .pnl.shop .pnl-body > .sellw { flex: 1 1 0; min-height: 0; }
  .pnl.shop .slist, .pnl.shop .sellw .grid { max-height: none; }
  .pnl.shop .shop .info, .pnl.shop .sellw .info { overflow-y: auto; min-height: 0; }
  .pnl.shop .pnl-body > .dolls { flex: 1 1 0; min-height: 0; overflow-y: auto; align-content: flex-start; }
}

/* ===== 手機：道具說明從底部跳出（11-16 使用者：直式點了裝備還要往下滑才看到說明，不人性化）=====
   沒選道具時的提示字在手機上不佔位；選了道具 .info.sel 固定在畫面底部，右上角 × 關掉 */
.sh-x { display: none; }
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) {
  #bagInfo:not(.sel), #sInfo:not(.sel), #whInfo:not(.sel) { display: none; }
  #pnl { translate: none !important; }
  .pnl .slist, .pnl .sellw .grid, .pnl .whw .grid { max-height: none; }   /* 說明改從底部跳出了，清單排滿整個視窗、整頁捲（11-16 使用者：只有一半，下面還很多道具） */   /* 手機的大視窗不拖曳：有位移的話底部說明框會被包在視窗裡、被切掉（11-16 使用者：吃字） */
  .pnl .info.sel { position: fixed; z-index: 30; left: 6px; right: 6px; bottom: 6px; max-height: 58%; overflow-y: auto; min-height: 0;
    padding: 10px 12px 12px; background: #0c0a08 !important; background-image: none !important; border: 1px solid #a8873e !important; box-shadow: 0 -6px 24px rgba(0, 0, 0, .85); }
  .pnl .info.sel .sh-x { display: block; position: sticky; top: -4px; float: right; width: 32px; height: 30px; margin: -6px -8px 0 6px; border: 0; cursor: pointer;
    background: url(../assets/ui/orig/s6125.png?v=2) center / 24px 22px no-repeat; }
  .pnl .info.sel .sh-x:active { background-image: url(../assets/ui/orig/s6126.png?v=2); }
}

/* ===== 永久天賦（11-16，照 docs/示意/天賦示意.html） ===== */
.frame.pnl.tal { width: 900px; max-width: 100%; }
@media (min-width: 761px) and (min-height: 521px) { .frame.pnl.tal { height: min(640px, 94vh); } }
.pnl.tal .pnl-body { display: flex; flex-direction: column; overflow: hidden; }
.tl-top { display: flex; align-items: center; gap: 14px; padding: 6px 8px; margin-bottom: 8px; background: rgba(0,0,0,.45); border: 1px solid #3a3226; font-size: 14px; color: #d4c7a2; flex: none; }
.tl-pt { font-size: 15px; white-space: nowrap; } .tl-pt b { font-size: 20px; color: #8dffb8; }
.tl-xp { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.tl-xp .bar { height: 10px; background: #0b0906; border: 1px solid #4e3e1e; margin-top: 3px; }
.tl-xp .bar i { display: block; height: 100%; background: linear-gradient(#e8c66a, #9a7425); }
.tl-xp small { color: #9f927a; }
.tl-main { flex: 1 1 0; min-height: 0; display: flex; gap: 10px; }
.tl-tabs { width: 150px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.tl-tab { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(0,0,0,.45); border: 1px solid #3a3226; cursor: pointer; color: #d4c7a2; font-size: 15px; }
.tl-tab img { width: 32px; height: 32px; image-rendering: pixelated; }
.tl-tab small { display: block; font-size: 12px; color: #9f927a; }
.tl-tab.on { border-color: #f4d27a; background: rgba(120, 90, 30, .3); color: #fff; }
.tl-list { flex: 1; min-width: 0; overflow-y: auto; background: rgba(0,0,0,.55); border: 1px solid #3a3226; touch-action: pan-y; overscroll-behavior: contain; }
.tr { border-bottom: 1px solid rgba(78, 62, 30, .6); }
.tr-h { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; }
.tr-h:hover { background: rgba(140, 109, 50, .12); }
.tr-h img { width: 34px; height: 34px; image-rendering: pixelated; flex: none; }
.tr-n { width: 112px; flex: none; font-size: 15px; font-weight: 700; color: #f6e6b6; white-space: nowrap; overflow: hidden; }
.tr-lv { width: 74px; flex: none; font-size: 12px; color: #9f927a; white-space: nowrap; }
.tr-lv i { display: inline-block; width: 8px; height: 8px; margin-right: 2px; background: #2a2218; border: 1px solid #5a4a30; }
.tr-lv i.on { background: #e8c66a; border-color: #f4d27a; }
.tr-e { flex: 1; min-width: 0; font-size: 13.5px; color: #d4c7a2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-e b { color: #8fd0ff; font-weight: 400; } .tr-e em { font-style: normal; color: #8dffb8; }
.tr .btn.sm { flex: none; min-width: 92px; }
.tr.lock .tr-h { opacity: .45; } .tr.lock .tr-e { color: #c98a6a; }
.tr.max .tr-e em { color: #ffd76a; }
.tr-d { display: none; padding: 2px 10px 10px 54px; font-size: 13px; color: #cfc3a3; }
.tr.open .tr-d { display: block; }
.tr-d table { border-collapse: collapse; width: 100%; max-width: 520px; }
.tr-d td { padding: 2px 8px; border-bottom: 1px dashed rgba(201, 162, 77, .2); white-space: nowrap; }
.tr-d td:first-child { width: 42px; color: #9f927a; } .tr-d td:last-child { width: 70px; text-align: right; color: #9f927a; }
.tr-d tr.got td { color: #8fd0ff; } .tr-d tr.got td:last-child::after { content: " ✓"; color: #8dffb8; }
.tr-d tr.nx td { color: #8dffb8; }
.tl-sec { padding: 6px 10px 4px; font-size: 12.5px; color: #e6c47c; background: rgba(120, 90, 30, .18); border-bottom: 1px solid #4e3e1e; }
.tl-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: #9f927a; }
.tl-foot b { color: #ffe28a; }
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) {
  .tl-top { flex-wrap: wrap; gap: 6px 10px; }
  .tl-top .mini { margin-left: auto; }
  .tl-xp { flex-basis: 100%; order: 3; font-size: 13px; } .tl-xp small, .tl-foot > span:first-child { display: none; }
  .tl-main { flex-direction: column; }
  .tl-tabs { width: auto; flex-direction: row; }
  .tl-tab { flex: 1; flex-direction: column; gap: 2px; padding: 4px 2px; font-size: 13px; text-align: center; }
  .tl-tab img { width: 28px; height: 28px; }
  .tr-h { flex-wrap: wrap; gap: 4px 8px; padding: 6px 8px; }
  .tr-n { width: auto; flex: 1; font-size: 14px; min-width: 0; }
  .tr-lv { width: auto; } .tr-lv i { display: none; }
  .tr-e { flex-basis: 100%; order: 5; padding-left: 42px; white-space: normal; font-size: 13px; }
  .tr .btn.sm { min-width: 76px; }
  .tr-d { padding-left: 10px; }
}

/* ===== 製作：安東（11-16，照 docs/示意/製作示意.html） ===== */
.frame.pnl.mk { width: 900px; max-width: 100%; }
@media (min-width: 761px) and (min-height: 521px) { .frame.pnl.mk { height: min(640px, 94vh); } }
.pnl.mk .pnl-body { display: flex; flex-direction: column; overflow: hidden; }
.mk-top { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 6px 8px; margin-bottom: 8px; background: rgba(0,0,0,.45); border: 1px solid #3a3226; font-size: 13px; color: #d4c7a2; }
.mk-top .chk { margin: 0; font-size: 13px; }
.mk-ad { margin-left: auto; } .mk-ad b { color: #ffe28a; }
.mk-main { flex: 1 1 0; min-height: 0; display: flex; gap: 10px; }
.mk-tabs { width: 150px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.mk-tab { padding: 8px 10px; background: rgba(0,0,0,.45); border: 1px solid #3a3226; cursor: pointer; color: #d4c7a2; font-size: 15px; }
.mk-tab small { display: block; font-size: 12px; color: #9f927a; }
.mk-tab.on { border-color: #f4d27a; background: rgba(120,90,30,.3); color: #fff; }
.mk-list { flex: 1; min-width: 0; overflow-y: auto; background: rgba(0,0,0,.55); border: 1px solid #3a3226; touch-action: pan-y; overscroll-behavior: contain; }
.cr { border-bottom: 1px solid rgba(78,62,30,.6); }
.cr-h { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; }
.cr-h:hover { background: rgba(140,109,50,.12); }
.cr-h img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.cr-n { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: #f6e6b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-s { font-size: 12.5px; color: #c98a6a; white-space: nowrap; } .cr-s.ok { color: #8dffb8; }
.cr .btn.sm { flex: none; min-width: 72px; }
.mk-list .cr-d { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px; padding: 4px 10px 6px 52px; }   /* 只限製作視窗：建角畫面的職業說明也叫 .cr-d（11-17 撞名，法師說明被擠成一窄條） */
.cm { display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; column-gap: 6px; padding: 3px 6px; background: rgba(0,0,0,.35); border: 1px solid #3a2e18; font-size: 13px; color: #d4c7a2; min-width: 0; }
.cm img { grid-row: span 2; width: 24px; height: 24px; image-rendering: pixelated; align-self: center; }
.cm span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm b { color: #8dffb8; font-weight: 400; white-space: nowrap; } .cm.lack b { color: #ff8a6a; }
.cm small { grid-column: 2 / 4; font-size: 11.5px; color: #9f927a; }
.mk-list .cr-i { padding: 2px 10px 10px 52px; font-size: 13px; line-height: 1.6; color: #cfc3a3; }
.mk-list .cr-i .i-nm { font-size: 14px; }
.lit .lc { color: #ffe28a; font-size: 12px; }
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) {
  .mk-main { flex-direction: column; }
  .mk-tabs { width: auto; flex-direction: row; }
  .mk-tab { flex: 1; text-align: center; padding: 4px 2px; font-size: 14px; }
  .mk-list .cr-d { grid-template-columns: minmax(0, 1fr); padding-left: 10px; }
  .mk-list .cr-i { padding-left: 10px; }
}

/* ===== 角色視窗三欄（11-16 使用者：好醜 → docs/示意/角色示意.html）===== */
.bag.cb3 { display: grid; grid-template-columns: 262px minmax(0, 1fr) 270px; gap: 10px; }
.cb-col { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cb-box { background: rgba(0, 0, 0, .5); border: 1px solid #3a3226; padding: 6px 8px; min-height: 0; }
.cb3 .dollw { gap: 4px; justify-content: space-between; }
.cb3 .eqcol .ic { width: 42px; height: 42px; }
.cb3 .pv { flex: 1; min-width: 0; }
.cb3 .pv canvas { width: 150px; height: 210px; margin: 0 auto; }
.cb-sum { margin-top: 0; overflow-y: auto; flex: 1 1 auto; }
.cb-sum .sect:first-child, .cb-pane .sect:first-child { margin-top: 0; }
.cb-bag { flex: 1 1 0; display: flex; flex-direction: column; }
.cb-bag .grid { flex: 1 1 0; max-height: none; min-height: 0; border: 0 !important; background: none !important; padding: 4px 0; }
.cb-bag .bag-hd small { font-size: 12px; }
/* 道具說明浮在上面（11-17 使用者：原本在背包下面要往下捲；中間整格給背包）：電腦版放在點的那一格旁邊（js/ui3.js placeBagInfo），原版視窗框；手機照舊從底部跳出 */
.bag.cb3 { position: relative; }
#bagInfo:not(.sel) { display: none; }
@media (min-width: 761px) and (min-height: 521px) {
  .bag.cb3 > #bagInfo.sel { position: absolute; z-index: 20; left: 0; top: 0; width: 280px; max-height: 100%; overflow-y: auto; min-height: 0; box-sizing: border-box;
    padding: 2px 8px 6px; background: #0d0b08 !important; border: 12px solid transparent !important; border-image: url(../assets/ui/o/frame.png?v=2) 33 fill / 12px stretch !important;   /* orig.css 的 .info 有 !important 底色、細框，要蓋過去 */
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .85)); }
  .bag.cb3 > #bagInfo.sel .sh-x { display: block; float: right; width: 24px; height: 22px; margin: 0 -4px 0 6px; border: 0; cursor: pointer;
    background: url(../assets/ui/orig/s6125.png?v=2) center / 20px 18px no-repeat; }
  .bag.cb3 > #bagInfo.sel .sh-x:active { background-image: url(../assets/ui/orig/s6126.png?v=2); }
}
#bagInfo .dbl { margin-top: 4px; font-size: 12px; color: #c9a95a; white-space: nowrap; }
.cb-tabs { display: flex; gap: 4px; flex: none; }
.cb-tab { flex: 1; text-align: center; padding: 6px 0; font-size: 13.5px; color: #d4c7a2; background: rgba(0, 0, 0, .45); border: 1px solid #3a3226; white-space: nowrap; cursor: pointer; }
.cb-tab.on { border-color: #f4d27a; background: rgba(120, 90, 30, .3); color: #fff; }
.cb-pane { flex: 1 1 0; overflow-y: auto; font-size: 13px; }
.cb-pane .dtw, .cb-pane .brw { grid-template-columns: minmax(0, 1fr); }
.cb-pane .stw { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 761px) and (min-height: 521px) {
  .frame.pnl.bag { height: min(640px, 94vh); }
  .pnl.bag .pnl-body { overflow: hidden; display: flex; flex-direction: column; }
  .pnl.bag .bag.cb3 { flex: 1 1 0; min-height: 0; }
  .pnl.bag .pnl-body > .ench { flex: 1 1 0; min-height: 0; overflow-y: auto; }   /* 強化視窗也用 bag 外框 */
}
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) {
  .bag.cb3 { grid-template-columns: minmax(0, 1fr); }
  .cb-bag, .cb-sum, .cb-pane { flex: none; }   /* 手機整個視窗往下捲，各區照內容高度 */
  .cb-bag .grid { flex: none; max-height: 30vh; min-height: 104px; }
  .cb-pane .stw { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-pane .dtw, .cb-pane .brw { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
