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

/* ===== 村莊：上方角色資訊、右下按鈕 ===== */
#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; } }

.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; }
.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); }
.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; }
}
