/* =====================================================================
   BỐ CỤC MỚI (body.ui2): thanh trên mỏng · bản đồ chiếm phần giữa · thanh dưới mỏng.
   Chỉ đổi cách hiển thị: mọi phần tử cũ giữ nguyên id, được chuyển vào khung nổi (Kho, Thống kê, Hệ phái & quan hệ).
   ===================================================================== */
body.ui2 { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; padding: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0; }
body.ui2 > h1, body.ui2 #help, body.ui2 #buyInfo, body.ui2 #bonusNow, body.ui2 .dtab, body.ui2 #wallBar, body.ui2 #colL, body.ui2 #colR { display: none !important; }
/* ---- thanh trên ---- */
body.ui2 #top { width: auto; max-width: none; margin: 0; padding: 3px 8px; gap: 6px; flex: 0 0 auto; flex-wrap: nowrap; border-width: 0 0 2px 0; border-radius: 0; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
body.ui2 #top .stat { margin-right: 4px; white-space: nowrap; font-size: 13px; }
body.ui2 #top .tbar { width: 54px; }
body.ui2 #top button { min-height: 44px; padding: 0 12px; white-space: nowrap; }
body.ui2 #top button.ico { min-width: 44px; padding: 0 8px; font-size: 16px; }
body.ui2 #top .spd { display: none; }
body.ui2 #btnSpeed { font-weight: 700; }
/* ---- phần giữa: bản đồ ---- */
body.ui2 #stage { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; margin: 0; display: flex; }
body.ui2 #mid { flex: 1 1 auto; min-width: 0; min-height: 0; padding: 0; display: flex; flex-direction: row; align-items: stretch; }
body.ui2 #mid #wrap { flex: 1 1 auto; width: 100% !important; max-width: none; min-height: 0 !important; min-width: 0; height: auto; border: 0; background: var(--c-deep2, #140d08); overflow: hidden; }
body.ui2 canvas#cv { max-width: none; }
/* góc bản đồ: hệ phái + quan hệ + hiệu ứng round; nút đường đi */
#mapHud { position: absolute; left: 6px; top: 6px; z-index: 12; display: flex; flex-direction: column; gap: 4px; line-height: 1.2; pointer-events: none; max-width: 60%; }
#mapChips { display: flex; flex-wrap: wrap; gap: 4px; pointer-events: auto; }
#mapHud #rFx { margin: 0; pointer-events: auto; }
.mchip { min-height: 32px; min-width: 32px; padding: 0 7px; background: rgba(27,18,11,.82); color: var(--c-text); border: 2px solid var(--c-line); font: inherit; font-size: 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.mchip b { color: var(--c-gold-l); }
.mchip.off { opacity: .6; }
.mapicon { position: absolute; right: 6px; top: 6px; z-index: 12; width: 44px; height: 44px; font-size: 20px; line-height: 1; background: rgba(27,18,11,.82); border: 2px solid var(--c-line); color: var(--c-text); cursor: pointer; }
.mapicon.on { border-color: var(--c-gold); box-shadow: 0 0 6px var(--c-gold-d); }
#mapMsg { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 13; padding: 6px 12px; background: rgba(27,18,11,.9); border: 2px solid var(--c-danger-l); color: var(--c-danger-l); font-size: 12px; line-height: 1.3; pointer-events: none; max-width: 90%; text-align: center; }
#mapMsg.warn { border-color: var(--c-gold); color: var(--c-gold-l); }
#mapMsg.hide { display: none; }
/* ---- thanh dưới ---- */
#bbar { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--c-surface); border-top: 2px solid var(--c-bronze); box-shadow: 0 -2px 0 rgba(0,0,0,.35); flex-wrap: wrap; }
#bbar .sp { flex: 1; }
#bWall { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
body:not(.wm) #bWall { display: none; }
#bWall #wallTray { min-height: 44px; } #bWall #wallTray .wp { min-width: 44px; min-height: 44px; }
#bWall #wallTray .dim { font-size: 11px; }
#bbar button { min-height: 44px; min-width: 44px; padding: 0 10px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
#bbar #wallRot, #bbar #wallPlace { padding: 0 8px; font-size: 18px; }
#bbar #wallPlace.hide, #bbar #wallCancel, #bbar #wallCount, #bbar #wallGate, #bbar #wallMsg { display: none; }
#bbar #shopTab, #bbar #shopTab.hide { display: inline-flex; align-items: center; gap: 6px; position: static; transform: none; padding: 0 12px; background: var(--btn-primary, #b3382a); }
#bbar #shopTab.open { filter: brightness(1.2); box-shadow: 0 0 0 2px var(--c-gold); }
#bbar .sbadge { font-style: normal; font-size: 11px; background: var(--c-deep); color: var(--c-gold-l); padding: 1px 5px; border: 1px solid var(--c-gold-d); }
#btnKho b { color: var(--c-gold-l); font-weight: 700; }
#bbar #wallRot:disabled { opacity: .4; }
/* ---- khung nổi: Kho, Thống kê, Hệ phái & quan hệ ---- */
.fpop { position: fixed; z-index: 47; left: 8px; bottom: 64px; width: min(420px, calc(100vw - 16px)); max-height: min(70vh, calc(100vh - 140px)); display: flex; flex-direction: column; background: var(--c-surface-d); border: 3px solid var(--c-bronze); box-shadow: 0 0 0 2px var(--c-wood-dk, #34220f), 0 8px 24px rgba(0,0,0,.6); }
.fpop.hide { display: none; }
#statsPop { left: auto; right: 8px; }
#sectPop { top: 60px; bottom: auto; }
.fphd { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-bottom: 2px solid var(--c-line-d); color: var(--c-gold); }
.fphd b { flex: 1; font-size: 13px; }
.fpx { min-width: 44px; min-height: 44px; font-size: 18px; cursor: pointer; }
.fpbody { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
#khoPop .fpbody #kho { flex: 1 1 auto; min-height: 260px; display: flex; flex-direction: column; }
#khoPop .fpbody #kho .ksec { min-height: 110px; }
#khoPop .fpbody #depot { flex: 0 0 auto; max-height: 34vh; overflow: auto; display: flex; flex-direction: column; }
#statsPop .ksec, #sectPop .ksec { flex: 0 0 auto; }
#statsPop #rDmgBody, #statsPop #rBuffBody, #sectPop .rbody { max-height: none; }
/* ---- khung nhỏ thông tin tower cạnh tower ---- */
#tmini { position: absolute; z-index: 14; width: 230px; background: rgba(36,25,16,.96); border: 2px solid var(--c-gold); box-shadow: 0 6px 18px rgba(0,0,0,.6); padding: 6px; line-height: 1.3; font-size: 12px; color: var(--c-text); }
#tmini.hide { display: none; }
#tmini .tmh { display: flex; gap: 6px; align-items: center; }
#tmini .tmh b { color: var(--c-gold-l); font-size: 13px; }
#tmini .tmh .x { margin-left: auto; min-width: 36px; min-height: 36px; cursor: pointer; }
#tmini .tms { margin: 4px 0; display: grid; grid-template-columns: auto auto; gap: 1px 10px; }
#tmini .tms span { color: var(--c-text-dim); } #tmini .tms b { text-align: right; font-weight: 400; }
#tmini .tmr { font-size: 11px; color: var(--c-gold-l); margin-bottom: 4px; }
#tmini .tmb { display: flex; flex-wrap: wrap; gap: 4px; }
#tmini .tmb button { min-height: 44px; flex: 1 1 45%; font: inherit; font-size: 12px; cursor: pointer; padding: 0 6px; }
#tmini .tmb button.gold { flex-basis: 100%; }
/* thông báo nằm trong khung bản đồ */
body.ui2 #relToast { top: 52px; }
body.ui2 #stage { align-items: stretch; gap: 0; }

/* ---- dải kho nhanh trên thanh dưới ---- */
#bbar { flex-wrap: nowrap; }
#qstrip { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; align-items: center; overflow: hidden; height: 44px; }
#qstrip.hide { display: flex !important; visibility: hidden; } /* kho trống: ô trống vô hình (vẫn đẩy nút sang phải, không đổi chiều cao) */
#qstrip .qs { flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; padding: 0; display: flex; align-items: center; justify-content: center; position: relative; background: var(--c-slot); border: 2px solid var(--c-slot-line); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
#qstrip .qs canvas { image-rendering: pixelated; pointer-events: none; }
#qstrip .qtower { border-color: var(--c-bronze); }
#qstrip .qs.on { border-color: var(--c-gold-l); box-shadow: 0 0 0 2px var(--c-gold), 0 0 8px var(--c-gold); }
#qstrip .qmore { color: var(--c-gold-l); font: inherit; font-weight: 700; font-size: 13px; }
#qstrip .qfu { position: absolute; left: 1px; top: 1px; font-style: normal; font-size: 9px; background: var(--c-gold); color: var(--c-deep2); padding: 0 2px; }
@media (max-width: 700px) {
  #bbar { gap: 4px; padding: 3px 4px; }
  #bbar .lbl { display: none; }
  #bbar button { padding: 0 6px; }
  #bbar #btnStats { display: none; } /* màn hẹp: ưu tiên Shop + mảnh tường; Thống kê mở từ nút ⚙ ở thanh trên */
  #bWall { gap: 3px; flex-wrap: nowrap; } #bWall #wallTray { gap: 3px; flex-wrap: nowrap; }
  #bbar .sbadge { padding: 0 3px; }
}
body.ui2 #rotBar { bottom: 62px; top: auto; } /* thanh "Đang cầm" nằm trên thanh dưới, không che dải kho */
#bbar > *:not(#qstrip) { flex-shrink: 0; }
@media (max-width: 700px) {
  body.ui2 #top { flex-wrap: wrap; row-gap: 2px; }
  body.ui2 #top .sp { display: none; }
  body.ui2 #top #btnStart { flex: 1 1 auto; }
  #bWall #wallTray .wp { padding: 1px; }
  #bbar #wallRot { padding: 0 4px; font-size: 16px; }
}

/* =====================================================================
   CỘT THÔNG TIN HAI BÊN BẢN ĐỒ (đặt vào dải trống, không làm bản đồ nhỏ đi)
   ===================================================================== */
.side { position: absolute; top: 0; bottom: 0; z-index: 11; display: flex; flex-direction: column; background: rgba(36,25,16,.94); border: 2px solid var(--c-bronze); line-height: 1.3; color: var(--c-text); font-size: 12px; overflow: hidden; }
.side.hide { display: none; }
#sideL { border-left: 0; } #sideR { border-right: 0; }
.sideHd { display: flex; align-items: center; gap: 4px; padding: 2px 2px 2px 8px; border-bottom: 2px solid var(--c-line-d); color: var(--c-gold); min-height: 46px; }
.sideHd b { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sideHd i { font-style: normal; color: var(--c-gold-l); }
.sideX, .sideTab { min-width: 44px; min-height: 44px; font: inherit; font-size: 14px; cursor: pointer; }
.sideTab { position: absolute; z-index: 11; top: 50%; transform: translateY(-50%); padding: 0 4px; background: rgba(36,25,16,.9); color: var(--c-text); border: 2px solid var(--c-bronze); }
.sideTab.hide { display: none; }
.sideBody { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 5px; display: flex; flex-direction: column; gap: 6px; }
#sideLBody #kho { flex: 1 1 auto; min-height: 200px; display: flex; flex-direction: column; }
#sideLBody #depot { flex: 0 0 auto; display: flex; flex-direction: column; }
/* cột thu gọn: chỉ biểu tượng và số */
.side.compact .lbl, .side.compact .cl2 { display: none; }
.side.compact .sideHd { padding-left: 4px; }
.qgrid { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.qgrid .qs { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; position: relative; background: var(--c-slot); border: 2px solid var(--c-slot-line); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.qgrid .qs canvas { image-rendering: pixelated; pointer-events: none; }
.qgrid .qtower { border-color: var(--c-bronze); }
.qgrid .qs.on { border-color: var(--c-gold-l); box-shadow: 0 0 0 2px var(--c-gold), 0 0 8px var(--c-gold); }
.qgrid .qmore { color: var(--c-gold-l); font: inherit; font-weight: 700; }
.qgrid .qfu { position: absolute; left: 1px; top: 1px; font-style: normal; font-size: 9px; background: var(--c-gold); color: var(--c-deep2); padding: 0 2px; }
body.sideL-on #qstrip { display: none !important; }
body.sideL-on #bbar .sp2 { flex: 1; }
body.sideL-on #bbar { padding-top: 2px; padding-bottom: 2px; }
/* khung ngữ cảnh */
.ctx h4 { margin: 0 0 4px; font-size: 12px; color: var(--c-gold); }
.ctx .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctx .cr { display: inline-flex; align-items: center; gap: 2px; background: var(--c-slot); border: 1px solid var(--c-slot-line); padding: 1px 4px 1px 1px; font-size: 12px; }
.ctx .cr canvas { image-rendering: pixelated; }
.ctx .big { font-size: 20px; color: var(--c-gold-l); font-weight: 700; }
.ctx .warn { color: var(--c-danger-l); font-weight: 700; }
.ctx .bar { height: 8px; background: var(--c-deep2); border: 1px solid var(--c-line-d); margin: 3px 0; } .ctx .bar u { display: block; height: 100%; background: var(--c-danger); text-decoration: none; }
.ctx .chips { display: flex; flex-wrap: wrap; gap: 4px; } .ctx .chip { border: 2px solid var(--c-line); padding: 1px 5px; font-size: 11px; }
.ctx button { min-height: 44px; font: inherit; font-size: 12px; cursor: pointer; padding: 0 8px; }
.ctx .sug { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; }
.ctx .tmini-in .tmb button { min-height: 44px; }
.side.compact .ctx .cr { padding: 1px; } .side.compact .ctx button { padding: 0 4px; }
#tmini.inside { position: static; width: auto; box-shadow: none; border: 0; background: transparent; padding: 0; }
/* điện thoại dọc: ngăn kéo từ dưới lên */
#drawer { position: fixed; left: 0; right: 0; bottom: 56px; z-index: 46; max-height: 55vh; display: flex; flex-direction: column; background: var(--c-surface-d); border-top: 3px solid var(--c-bronze); box-shadow: 0 -6px 18px rgba(0,0,0,.6); transition: transform .18s; touch-action: none; }
#drawer.hide { display: none; }
#drawerHandle { min-height: 44px; width: 100%; background: transparent; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#drawerHandle i { width: 56px; height: 6px; border-radius: 3px; background: var(--c-bronze); }
#drawerBody { overflow: auto; padding: 6px 8px 10px; font-size: 13px; line-height: 1.35; color: var(--c-text); }
#btnInfo.hide { display: none; }
/* điện thoại dọc: nút mở ngăn kéo nổi ngay trên thanh dưới (không chiếm chỗ của Shop / mảnh tường) */
#bbar #btnInfo { position: fixed; left: 50%; transform: translateX(-50%); bottom: 58px; z-index: 45; min-width: 140px; min-height: 44px; font-size: 13px; background: var(--c-surface); border: 2px solid var(--c-bronze); border-bottom: 0; }
#bbar #btnInfo.hide { display: none; }
body.ui2 #rotBar button { min-height: 44px; min-width: 44px; }
@media (max-width: 700px) and (orientation: portrait) { body.ui2 #rotBar { bottom: 112px; } } /* điện thoại dọc: thanh "Đang cầm" nằm trên nút Thông tin, không che nhau */

/* =====================================================================
   CHẾ ĐỘ TẬP TRUNG: màn "chọn 1 trong 3" phủ toàn màn hình trên cùng mọi thứ
   ===================================================================== */
body.ui2 #bonus, body.ui2 #buy { position: fixed; inset: 0; z-index: 300; background: rgba(12,8,5,.94); display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; line-height: 1.3; overflow: hidden; gap: 0; }
body.ui2 #bonus.hide, body.ui2 #buy.hide { display: none; }
body.ui2.focus #tmini, body.ui2.focus .side, body.ui2.focus .sideTab, body.ui2.focus #mapHud, body.ui2.focus .mapicon, body.ui2.focus #relToast, body.ui2.focus #toast, body.ui2.focus #rotBar, body.ui2.focus .fpop, body.ui2.focus #drawer, body.ui2.focus #tip { visibility: hidden; }
.fbox { max-height: 90vh; max-height: 90dvh; max-width: min(1120px, 96vw); overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--c-surface-d); border: 3px solid var(--c-bronze); box-shadow: 0 0 0 2px var(--c-wood-dk, #34220f), 0 10px 40px rgba(0,0,0,.7); padding: 14px 16px; box-sizing: border-box; }
.fbox h3 { margin: 0; text-align: center; color: var(--c-gold); font-size: 20px; }
.fcoin { font-size: 12px; color: var(--c-gold-l); }
body.ui2 #cardMain { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: none; margin: 0; }
body.ui2 #cardWrap { display: block; order: 1; width: auto; }
body.ui2 #cardTools { order: 2; }
body.ui2 #cardNext { display: none !important; } /* khung "Round kế…" không hiện trong màn chọn */
body.ui2 #bonusList, body.ui2 #buyList { display: grid; grid-template-columns: repeat(3, minmax(200px, 290px)); gap: 14px; justify-content: center; align-items: stretch; }
body.ui2 #bonusList .card { width: auto; min-width: 0; flex: none; }
body.ui2 #buyList .buyopt { width: auto; }
body.ui2 #buyBtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
body.ui2 #buyBtns button, body.ui2 #cardTools button, body.ui2 #cardBack { min-height: 44px; }
body.ui2 #cardPick { margin: 0; }
/* khung Chi tiết đè lên thẻ */
.card { position: relative; }
.cdpop { position: absolute; inset: 0; z-index: 5; background: var(--c-surface-d); border: 2px solid var(--c-gold); padding: 8px; overflow: auto; display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: default; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.cdpop .cdh { display: flex; align-items: center; gap: 6px; } .cdpop .cdh b { flex: 1; color: var(--c-gold-l); font-size: 14px; }
.cdpop .cdx { min-width: 44px; min-height: 44px; font-size: 16px; cursor: pointer; }
.cdpop .cdq { font-size: 12px; font-weight: 700; }
.cdpop .cl i { display: block; font-style: normal; font-size: 10px; color: var(--c-text-mute); text-transform: uppercase; }
@media (max-width: 760px) {
  body.ui2 #bonusList, body.ui2 #buyList { grid-template-columns: minmax(0, 440px); width: 100%; }
  .fbox { width: 100%; padding: 10px; }
  .fbox h3 { font-size: 16px; }
}
body.ui2 #bonusList, body.ui2 #buyList { grid-auto-rows: 1fr; } /* 3 thẻ luôn cùng kích thước (kể cả khi xếp dọc) */

/* =====================================================================
   MENU ĐẦU GAME (gọn)
   ===================================================================== */
body.ui2 #title { z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; overflow: auto; }
body.ui2 #title.hide { display: none; }
body.ui2 #settingsPop { z-index: 600; }
#title .tshade { background: radial-gradient(ellipse at 50% 45%, rgba(20,13,8,.35) 0, rgba(20,13,8,.6) 60%, rgba(20,13,8,.88) 100%); }
.tmenu { position: relative; z-index: 1; width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 20px; background: rgba(36,25,16,.82); border: 3px solid var(--c-bronze); box-shadow: 0 0 0 2px var(--c-wood-dk, #34220f), 0 12px 40px rgba(0,0,0,.6); box-sizing: border-box; margin: auto; }
.tmenu .tlogo { margin: 0; text-align: center; }
.tmenu .tsub { margin: 0 0 8px; }
.tbtns { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.tbtns button { min-height: 52px; width: 100%; font: inherit; font-size: 17px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tbtns button.tbig { min-height: 64px; font-size: 20px; font-weight: 700; }
.tbtns button small { font-size: 12px; font-weight: 400; opacity: .85; }
.tbest { font-size: 13px; color: var(--c-gold-l); margin-top: 4px; }
.tpanel { width: 100%; box-sizing: border-box; background: var(--c-surface-d); border: 2px solid var(--c-gold); padding: 10px; display: flex; flex-direction: column; gap: 8px; text-align: center; color: var(--c-text); }
.tpanel.hide { display: none; }
.tpbtn { display: flex; gap: 8px; } .tpbtn button { flex: 1; min-height: 44px; font: inherit; cursor: pointer; }
.tphd { display: flex; align-items: center; gap: 6px; } .tphd b { flex: 1; color: var(--c-gold); text-align: left; }
.tx { min-width: 44px; min-height: 44px; font-size: 16px; cursor: pointer; }
.tsupRow { display: flex; align-items: center; gap: 8px; text-align: left; border-top: 1px solid var(--c-line-d); padding-top: 6px; } .tsupRow > div { flex: 1; min-width: 0; overflow-wrap: anywhere; } .tsupRow span { color: var(--c-text-dim); font-size: 12px; }
.tcopy { min-height: 44px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.tsupEmpty { color: var(--c-text-dim); padding: 8px 0; }
.endBtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; } .endBtns button { min-height: 48px; min-width: 140px; font: inherit; font-size: 15px; cursor: pointer; }
body.ui2 #end { position: fixed; inset: 0; z-index: 320; overflow: auto; padding: 14px; box-sizing: border-box; }
@media (max-height: 480px) { .tmenu { padding: 12px; gap: 6px; } .tbtns { flex-direction: row; flex-wrap: wrap; } .tbtns button { flex: 1 1 45%; min-height: 48px; font-size: 15px; } .tbtns button.tbig { min-height: 52px; font-size: 16px; } }
@media (max-height: 480px) { .tbtns button { flex-direction: row; gap: 8px; } .tbtns button small { font-size: 12px; } } /* điện thoại ngang: "Chơi tiếp · Round N" trên một dòng */

/* =====================================================================
   BỐ CỤC KHÔNG THANH DƯỚI: mảnh tường ở cột trái (hoặc dải nổi), Shop ở cột phải (hoặc nút nổi)
   ===================================================================== */
body.ui2 #bbar { display: none !important; }
body.ui2 .sideX, body.ui2 .sideTab, #sideR .sideHd { display: none !important; }
body.ui2 #drawer { bottom: 0; }
body.ui2 .fpop { bottom: 8px; }
body.ui2 #rotBar { bottom: 8px; }
@media (max-width: 700px) and (orientation: portrait) { body.ui2 #rotBar { bottom: 8px; } }
/* khối Mảnh tường */
#wallBlock { display: flex; flex-direction: column; gap: 5px; padding: 6px; }
#sideLWall #wallBlock { border-bottom: 2px solid var(--c-line-d); }
#wallBlock .wbHd { color: var(--c-gold); font-weight: 700; font-size: 12px; }
#wallBlock #wallTray { display: flex; flex-wrap: wrap; gap: 5px; min-height: 48px; }
#wallBlock #wallTray .wp { min-width: 48px; min-height: 48px; padding: 2px; }
#wallBlock .wbRow { display: flex; gap: 5px; flex-wrap: wrap; }
#wallBlock .wbRow button { min-width: 48px; min-height: 44px; font-size: 18px; padding: 0 8px; cursor: pointer; flex: 1 1 0; }
#wallBlock .wbRow button.hide { display: none; }
#wallBlock .wbRow button:disabled { opacity: .4; }
#wallBlock #wallTray .dim { font-size: 11px; line-height: 1.3; }
#wallHint { font-size: 11px; color: var(--c-text-dim); line-height: 1.3; min-height: 0; }
#wallHint:empty { display: none; }
.side.compact #wallBlock .lbl { display: none; }
.side.compact #wallBlock #wallTray .wp { min-width: 44px; min-height: 44px; }
/* dải nổi mảnh tường trên mép dưới bản đồ (màn hẹp) */
#wallFloat { position: absolute; z-index: 13; transform: translateX(-50%); max-width: calc(100% - 80px); }
#wallFloat.hide { display: none; }
#wallFloat #wallBlock { flex-direction: row; align-items: center; flex-wrap: nowrap; background: rgba(36,25,16,.9); border: 2px solid var(--c-bronze); padding: 3px; }
#wallFloat .wbHd, #wallFloat #wallHint { display: none; }
#wallFloat #wallTray { flex-wrap: nowrap; min-height: 44px; } #wallFloat #wallTray .wp { min-width: 44px; min-height: 44px; }
#wallFloat .wbRow { flex-wrap: nowrap; } #wallFloat .wbRow button { flex: 0 0 auto; min-width: 44px; padding: 0 6px; }
#wallFloat #wallTray .dim { white-space: nowrap; font-size: 10px; }
/* nút nổi (màn hẹp): Shop, Kho, Thông tin */
#floatBtns { position: absolute; z-index: 13; display: flex; flex-direction: column-reverse; gap: 6px; align-items: flex-end; }
#floatBtns.hide { display: none; }
#floatBtns button { min-width: 48px; min-height: 48px; font: inherit; font-size: 13px; cursor: pointer; background: rgba(36,25,16,.92); border: 2px solid var(--c-bronze); color: var(--c-text); padding: 0 8px; }
#floatBtns #shopTab { display: inline-flex; position: static; transform: none; background: var(--btn-primary, #b3382a); }
#floatBtns #btnInfo, #floatBtns #btnKho { position: static; transform: none; min-width: 48px; }
#floatBtns .lbl { display: none; }
/* nút Shop to trên cùng cột phải */
#sideRShop { padding: 6px; border-bottom: 2px solid var(--c-line-d); }
#sideRShop #shopTab, #sideRShop #shopTab.hide { display: flex; width: 100%; min-height: 56px; position: static; transform: none; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 16px; font-weight: 700; flex-wrap: wrap; cursor: pointer; }
#sideRShop .sbadge { display: block; width: 100%; text-align: center; font-size: 11px; font-weight: 400; }
.side.compact #sideRShop #shopTab { font-size: 14px; }
.side.compact #sideRShop .lbl { display: inline; }
/* các khối thu gọn được */
.blk { border: 1px solid var(--c-line-d); background: rgba(27,18,11,.5); }
.blkHd { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 8px; background: transparent; border: 0; color: var(--c-gold); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; }
.blkHd i { font-style: normal; color: var(--c-text-dim); }
.blkBody { padding: 4px 8px 8px; }
.blkStats { width: 100%; min-height: 44px; font: inherit; font-size: 12px; cursor: pointer; }
#wallFloat { transform: none; overflow-x: auto; } /* dải mảnh tường: góc dưới trái bản đồ, nhường góc phải cho nút nổi */
#floatBtns button { width: 52px; min-width: 52px; padding: 0; position: relative; justify-content: center; }
#floatBtns #shopTab { width: 52px; padding: 0; justify-content: center; }
#floatBtns .sbadge { position: absolute; right: -4px; top: -6px; font-size: 10px; padding: 0 3px; }
#floatBtns #btnKho b { position: absolute; right: -4px; top: -6px; font-size: 10px; background: var(--c-deep); border: 1px solid var(--c-gold-d); padding: 0 3px; }
#floatBtns button, #floatBtns #shopTab { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; font-size: 20px; line-height: 1; }
body.ui2.narrow #relToast { top: 64px; }
#floatBtns > button, #floatBtns > #shopTab { position: relative; overflow: visible; }
#floatBtns #khoCount, #floatBtns .sbadge { position: absolute; top: -6px; right: -6px; min-width: 18px; padding: 1px 4px; font-size: 11px; line-height: 14px; border-radius: 8px; text-align: center; }
#floatBtns > button, #floatBtns > #shopTab { position: relative !important; inset: auto !important; transform: none !important; }
/* Bảng tower (giai đoạn 2): nằm dưới thanh trên cùng, nút điều hướng >= 44px */
body.ui2 #tpop { bottom: 0; height: auto; }
body.ui2 #tbox { max-height: 100%; }
body.ui2 #tnav button, body.ui2 #tbox.tcompact #tnav button, body.ui2 #ttabs button { min-height: 44px; min-width: 44px; }
body.ui2 #tclose { min-width: 44px; min-height: 44px; z-index: 3; }
body.ui2.towerOpen #floatBtns, body.ui2.towerOpen #wallFloat, body.ui2.towerOpen #tmini { visibility: hidden; }
body.ui2 #tbox { width: 100%; max-width: 100%; box-sizing: border-box; }
body.ui2.towerOpen #mapHud, body.ui2.towerOpen #mapMsg { visibility: hidden; }
/* ===== KHUNG TOWER – CHẾ ĐỘ TẬP TRUNG: phủ toàn bộ màn hình dưới thanh trên; ẩn mọi thứ của màn chính (hai cột, nút đường đi, nút nổi) ===== */
body.ui2.towerOpen #sideL, body.ui2.towerOpen #sideR, body.ui2.towerOpen .sideTab, body.ui2.towerOpen #sideLTab, body.ui2.towerOpen #sideRTab, body.ui2.towerOpen #drawer, body.ui2.towerOpen #relToast { visibility: hidden !important; }
body.ui2 #tpop { left: 0 !important; right: 0 !important; background: var(--c-deep, #120c08); }
body.ui2 #tbox { height: 100%; max-height: 100%; width: 100%; border-radius: 0; }
body.ui2 #tbox > .tz { min-width: 0; }
/* Tổng quan tower: không cuộn ngang, chỉ cuộn dọc */
body.ui2 #tZ3 { overflow-x: hidden !important; overflow-y: auto; }
body.ui2 #tZ3 * { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
body.ui2 #tZ3 table { width: 100%; table-layout: fixed; }
/* Chi tiết: nút Bán ở góc phải dòng tiêu đề, luôn thấy; phần thông tin cuộn riêng, chiếm hết chiều cao còn lại */
#tDetHd { display: flex; align-items: center; gap: 6px; min-height: 44px; }
#tDetSell { margin-left: auto; min-height: 44px; min-width: 44px; padding: 2px 12px; white-space: nowrap; flex: none; }
#tDetSell:disabled { opacity: .45; }
#tDetailWrap { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
#tDetail { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
#tDetBtns { display: none !important; }
/* Thanh "Đang cầm": MỘT dòng riêng cố định dưới tiêu đề khung; chỉ hiện nội dung khi đang cầm (chỗ luôn giữ sẵn nên bảng không nhảy) */
#tHoldRow { grid-column: 1 / -1; display: flex; align-items: center; min-height: 52px; box-sizing: border-box; padding: 2px 8px; border: 2px solid transparent; border-radius: 3px; }
#tHoldRow #tHoldHint { display: none; }
#tHoldRow.holding { border-color: var(--c-gold); background: #3a2c17; }
#rotBar.inrow { position: static !important; transform: none !important; inset: auto !important; box-shadow: none; border: 0; background: transparent; padding: 0; width: 100%; z-index: auto; }
#rotBar.inrow #rotName { flex: 1 1 auto; font-weight: bold; color: var(--c-gold); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#rotBar.inrow button { min-height: 44px; min-width: 64px; flex: none; }
/* Màn hẹp / điện thoại: 3 tab Túi đồ | Kho | Thông tin, mỗi lần một khu, chiếm cả khung */
body.ui2 #tbox.tcompact { grid-template-columns: minmax(0, 1fr) !important; overflow: hidden; }
body.ui2 #tbox.tcompact #ttabs { display: flex; width: 100%; gap: 4px; }
body.ui2 #tbox.tcompact #ttabs button { flex: 1; min-height: 44px; }
body.ui2 #tbox.tcompact #tnav { flex-wrap: wrap; padding-right: 54px; }
body.ui2 #tbox.tcompact .tz { display: none !important; height: var(--tzh) !important; max-height: none !important; grid-column: 1 / -1; }
body.ui2 #tbox.tcompact[data-tab="bag"] #tZ1, body.ui2 #tbox.tcompact[data-tab="kho"] #tZ2, body.ui2 #tbox.tcompact[data-tab="info"] #tZ3 { display: flex !important; }
body.ui2 #tbox.tcompact #tZ2 #tKho { flex: 0 0 auto; max-height: 52%; }
body.ui2 #tbox.tcompact #tDetailWrap { flex: 1 1 0; min-height: 120px; }
body.ui2 #tbox.tcompact #tclose { width: 48px; height: 44px; }
body.ui2 #tbox.tcompact #tHoldRow { min-height: 50px; }
/* mọi nút trong khung tower >= 44px (cảm ứng) */
body.ui2 #tbox button { min-height: 44px; }
body.ui2 #tbox #t3toggle { min-width: 44px; }
body.ui2 #tbox.tcompact #tZ2 #tKho { flex: 0 0 56% !important; max-height: none; min-height: 0; }
body.ui2 #tbox.tcompact #tHoldRow:not(.holding) { display: none; } /* điện thoại: không cầm thì không chiếm chỗ */
body.ui2 #tbox.tcompact #t3toggle { display: none; } /* điện thoại: không cần nút thu gọn Tổng quan */
/* ===== Bỏ hẳn dải trên của khung tower: không còn Tower trước / sau, số thứ tự, dòng tóm tắt; chỉ còn nút Đóng nhỏ nổi ở góc phải ===== */
body.ui2 #tbox:not(.tcompact) #tnav { display: none !important; }
body.ui2 #tnav #tprev, body.ui2 #tnav #tnext, body.ui2 #tnav #tnavlbl, body.ui2 #tnav #tstrip { display: none !important; }
body.ui2 #tbox.tcompact #tnav { padding: 0 54px 0 0; justify-content: flex-start; }
body.ui2 #tbox.tcompact #ttabs { width: 100%; }
body.ui2 #tbox { padding-top: 6px; }
body.ui2 #tclose { position: absolute !important; top: 6px; right: 6px; width: 44px !important; height: 44px !important; min-width: 44px; padding: 0; z-index: 5; font-size: 16px; }
body.ui2 #tbox:not(.tcompact) #tZ3 > .zt { padding-right: 54px; min-height: 40px; }
body.ui2 #tbox.tz3c #tZ3 { padding-top: 50px; }
/* Thanh "Đang cầm": chỉ hiện khi đang cầm, không giữ chỗ trống. Màn rộng: nằm trong cột Kho, ngay trên Chi tiết. Điện thoại: dưới hàng tab */
#tHoldRow:not(.holding) { display: none !important; }
body.ui2 #tZ2 > #tHoldRow { flex: none; margin: 6px 0 2px; }
/* Chữ phần ĐÁNH ĐỔI trên thẻ thưởng tô đỏ (điều bất lợi) */
.cl.dd { color: var(--c-danger-l); }
/* ===== Màn "Chọn tower" (chế độ tập trung): 3 thẻ gọn + khung Chi tiết cố định ===== */
body.ui2 #buyList { grid-template-columns: repeat(3, minmax(0, 250px)); grid-auto-rows: auto; }
.buycard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px 8px; background: var(--c-surface, #3a2a1a); border: 3px solid var(--c-bronze, #8a6a3c); border-radius: 3px; cursor: pointer; text-align: center; min-width: 0; box-sizing: border-box; }
.buycard:hover, .buycard:focus-visible { border-color: var(--c-gold-l, #f4d98c); outline: none; }
.buycard.on { border-color: var(--c-gold, #f4b41b); box-shadow: 0 0 0 2px var(--c-gold, #f4b41b), 0 0 14px rgba(244,180,27,.45); }
.buycard .bcinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.buycard .bcinfo b { color: var(--c-gold-l, #f4d98c); font-size: 15px; }
.buycard .bcinfo i { font-style: normal; font-size: 12px; font-weight: 700; }
.buycard .bcinfo span { font-size: 11px; }
.buycard .buyrel { font-size: 11px; color: #9fe0a0; }
.buycard .buyopt { width: 100%; min-height: 44px; margin-top: auto; }
#buyGift { color: #f4d98c; font-weight: 700; text-align: center; padding: 4px 10px; border: 1px dashed #f4d98c; border-radius: 3px; }
#buyDetail { width: 100%; max-width: 790px; min-height: 150px; max-height: 34vh; overflow-y: auto; box-sizing: border-box; padding: 8px 10px; background: var(--c-deep, #1c130b); border: 2px solid var(--c-bronze, #8a6a3c); font-size: 12px; line-height: 1.4; }
#buyDetail .bdh { font-size: 14px; margin-bottom: 4px; } #buyDetail .bdh b { color: var(--c-gold-l, #f4d98c); }
#buyDetail .bdgrid { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 10px; }
#buyDetail .bdt { font-size: 10px; text-transform: uppercase; color: var(--c-gold, #f4b41b); margin-bottom: 2px; }
#buyDetail .bdon { color: #7ee07e; } #buyDetail .bdkho { color: #f4d98c; }
#buyDetail .bdhint { text-align: center; padding-top: 50px; }
@media (max-width: 700px) {
  body.ui2 #buyList { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .buycard { padding: 6px 4px; gap: 3px; } .buycard .bcinfo b { font-size: 12px; } .buycard .bcinfo span { display: none; } .buycard .buyrel { font-size: 10px; }
  .buycard .buyopt { font-size: 11px; padding: 2px 4px; }
  #buyDetail { max-height: 38vh; } #buyDetail .bdgrid { grid-template-columns: 1fr; gap: 6px; } #buyDetail .bdhint { padding-top: 30px; }
}
/* Khay mảnh tường: mảnh được tặng sáng nhẹ; mọi mảnh tối thiểu 44px */
#wallTray .wp { min-width: 44px; min-height: 44px; }
#wallTray .wp.gift { box-shadow: 0 0 0 2px #f4d98c, 0 0 10px rgba(244,217,140,.75); animation: giftGlow 1.6s ease-in-out infinite alternate; }
@keyframes giftGlow { from { box-shadow: 0 0 0 2px #f4d98c, 0 0 4px rgba(244,217,140,.4); } to { box-shadow: 0 0 0 2px #f4d98c, 0 0 14px rgba(244,217,140,.9); } }
/* ===== Cột trái: khối Mảnh tường (tối đa ~40% chiều cao, cuộn bên trong) + Kho (luôn ≥ ~55%) ===== */
body.ui2 #sideL { display: flex; flex-direction: column; }
body.ui2 #sideL.hide { display: none; }
body.ui2 #sideLWall { flex: 0 1 auto; max-height: var(--wallMax, 40%); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.ui2 #sideLWall #wallBlock { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
#wallBlock .wbHd { flex: none; display: flex; align-items: center; gap: 4px; min-height: 30px; }
#wallBlock .wbHd .wbT { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#wallBlock #wallTotal { flex: none; font-size: 12px; color: var(--c-gold-l, #f4d98c); white-space: nowrap; }
#wallBlock .fold, #sideL .sideHd .fold { flex: none; min-width: 44px; min-height: 36px; padding: 0 6px; font-size: 13px; }
#wallBlock .wbRow { flex: none; }
body.ui2 #sideLWall #wallTray { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
#wallBlock.fold .wbRow, #wallBlock.fold #wallTray, #wallBlock.fold #wallHint { display: none !important; }
body.ui2 #sideL .sideHd { display: flex; align-items: center; gap: 4px; flex: none; }
body.ui2 #sideL .sideHd b { flex: 1 1 auto; }
body.ui2 #sideL #sideLBody { flex: 1 1 auto; min-height: var(--khoMin, 55%); overflow-y: auto; }
body.ui2 #sideL.khoFold #sideLBody { display: none; min-height: 0; }
#wallTray .wp { position: relative; }
#wallTray .wp .wpn { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 10px; line-height: 13px; padding: 0 3px; border-radius: 3px; background: rgba(0,0,0,.72); color: #f4d98c; pointer-events: none; }
/* màn hẹp: dải nổi trên mép dưới bản đồ, vuốt ngang */
body.ui2.narrow #wallFloat #wallBlock { flex-direction: row; align-items: center; gap: 4px; max-height: none; }
body.ui2.narrow #wallFloat #wallBlock .wbHd .wbT, body.ui2.narrow #wallFloat #wbFold, body.ui2.narrow #wallFloat #wallHint { display: none !important; }
body.ui2.narrow #wallFloat #wallBlock .wbHd { min-height: 0; }
body.ui2.narrow #wallFloat #wallTray { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 4px; max-width: 60vw; -webkit-overflow-scrolling: touch; }
body.ui2.narrow #wallFloat #wallTray .wp { flex: none; }
/* ===== Cột phải: Shop ghim trên, Đợt tới, khối Sát thương dùng hết phần còn lại ===== */
body.ui2 #sideR { display: flex; flex-direction: column; }
body.ui2 #sideR.hide { display: none; }
body.ui2 #sideRShop { flex: none; }
body.ui2 #sideRBody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.ui2 #sideRBody > .blk:not(.dmgBlk) { flex: none; max-height: 45%; overflow-y: auto; }
body.ui2 #sideRBody > .blk.dmgBlk { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; overflow: hidden; }
.blk.dmgBlk > .blkBody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dmgBox { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; cursor: pointer; }
.dmgHd { flex: none; font-size: 12px; font-weight: 700; color: var(--c-gold, #f4b41b); padding: 2px 0 4px; }
.dmgList { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.drow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-rows: auto 6px; column-gap: 6px; align-items: center; min-height: 32px; padding: 2px 0; color: var(--c-text, #e8d8b8); font-size: 12px; }
.drow img { grid-row: 1 / span 2; image-rendering: pixelated; }
.drow .dn { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.drow .dv { font-size: 11px; white-space: nowrap; }
.drow .dbar { grid-column: 2 / span 2; height: 5px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.drow .dbar u { display: block; height: 100%; background: #9c8a6a; }
.drow.top { color: #f4d98c; } .drow.top .dbar u { background: #f4b41b; }
.dmore, .dmgNone { font-size: 11px; padding: 4px 0; }
body.ui2 #sideR.compact .drow { grid-template-columns: 22px minmax(0, 1fr); } body.ui2 #sideR.compact .drow .dn { display: none; } body.ui2 #sideR.compact .drow .dbar { grid-column: 2; }
body.ui2 #sideR.compact .dmgHd { font-size: 10px; }
/* màn hẹp: dải Sát thương 3 tower mạnh nhất (bấm mở bảng đầy đủ) */
#dmgStrip { position: absolute; z-index: 30; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 8px; box-sizing: border-box; background: rgba(28,19,11,.88); border: 2px solid var(--c-bronze, #8a6a3c); border-radius: 3px; font-size: 11px; color: var(--c-text, #e8d8b8); cursor: pointer; max-width: 70vw; overflow: hidden; }
#dmgStrip.hide { display: none; }
#dmgStrip span { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
#dmgStrip span:first-of-type { color: #f4d98c; }
#dmgStrip img { image-rendering: pixelated; }
body.ui2.focus #dmgStrip, body.ui2.towerOpen #dmgStrip { visibility: hidden; }
body.ui2 #sideR.compact .drow .dp { display: none; }
body.ui2 #sideL.compact #wallHint { display: none; }
#wallBlock #wallHint { flex: none; }
body.ui2 #sideLWall { flex: 0 0 auto; }
body.ui2 #sideL #sideLBody { flex: 1 1 0; }
/* Hòm đồ đã tối đa + bảng chỉ số trước / sau dung hợp */
#bagMax { text-align: center; font-size: 11px; color: var(--c-gold-l, #f4d98c); opacity: .85; margin-top: 4px; }
#bagMax.hide { display: none; }
table.fuset { border-collapse: collapse; margin: 6px auto; font-size: 12px; }
table.fuset th { font-size: 10px; font-weight: 400; color: var(--c-text-mute, #b8a888); padding: 2px 6px; text-align: right; }
table.fuset td { padding: 2px 6px; text-align: right; } table.fuset td:first-child { text-align: left; }
table.fuset td:last-child b { color: #7ee07e; }
/* ===== Hấp thụ bí kíp ===== */
#absNote { position: fixed; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 6px; max-width: min(46vw, 620px); min-height: 32px; box-sizing: border-box; padding: 3px 10px; background: rgba(28,19,11,.94); border: 2px solid var(--c-gold, #f4b41b); border-radius: 3px; font-size: 12px; color: var(--c-text, #e8d8b8); pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
#absNote.hide { display: none; }
#absNote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#absNote img { image-rendering: pixelated; flex: none; }
#absNote i { color: #f4d98c; font-style: normal; }
body.narrow #absNote { max-width: 94vw; font-size: 11px; }
#tAbs .absrow { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-left: 3px solid #f4b41b; margin: 3px 0; background: rgba(244,180,27,.07); font-size: 12px; line-height: 1.35; min-height: 36px; }
#tAbs .absrow canvas { image-rendering: pixelated; flex: none; }
#tAbs .absrow b { color: #f4d98c; }
#tAbs .absnone { font-size: 11px; padding: 2px 4px; }
#tStats .absline { font-size: 12px; padding: 3px 4px; margin-top: 3px; border-top: 1px dashed rgba(244,217,140,.35); color: #f4d98c; }
#tFx .fxl.abs b { color: #f4d98c; }
.vslot.fresh { border-color: #f4d98c !important; box-shadow: 0 0 0 2px rgba(244,217,140,.6), 0 0 10px rgba(244,217,140,.55); animation: giftGlow 1.6s ease-in-out infinite alternate; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.vslot.fresh small { font-size: 10px; opacity: .85; }
#wallTray .wp .wpx { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; line-height: 18px; font-style: normal; font-size: 11px; text-align: center; border-radius: 50%; background: var(--c-danger, #b3382a); color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.5); pointer-events: none; }
/* Thẻ 'chọn 1 trong 3': không còn nút Chi tiết; khung chi tiết cố định dưới hàng thẻ (chiều cao cố định, không làm nhảy thẻ / nút) */
#cardDetail { width: 100%; max-width: 900px; height: 150px; overflow-y: auto; box-sizing: border-box; padding: 8px 10px; background: var(--c-deep, #1c130b); border: 2px solid var(--c-bronze, #8a6a3c); font-size: 12px; line-height: 1.4; text-align: left; margin: 0 auto; }
#cardDetail .cdh { margin-bottom: 4px; font-size: 13px; } #cardDetail .cdh b { color: var(--c-gold-l, #f4d98c); }
#cardDetail .cl i { display: block; font-style: normal; font-size: 10px; color: var(--c-text-mute, #b8a888); text-transform: uppercase; }
#cardDetail .cl { margin-top: 3px; } #cardDetail .cdhint { text-align: center; padding-top: 52px; }
#bonusList .card.hl { box-shadow: 0 0 0 3px var(--c-gold, #f4b41b), 0 0 16px rgba(244,180,27,.5); outline: none; }
#bonusList .card:focus-visible { outline: none; }
#bonusList .card .crow .cpick { flex: 1; min-height: 44px; }
@media (max-width: 700px) { #cardDetail { height: 132px; font-size: 11px; } #cardDetail .cdhint { padding-top: 44px; } }
/* thứ tự: hàng thẻ -> khung chi tiết -> nút Đổi thẻ / Bỏ qua */
body.ui2 #cardMain { display: flex !important; flex-direction: column; align-items: center; gap: 10px; }
body.ui2 #cardMain.hide { display: none !important; }
body.ui2 #cardMain > #cardWrap { order: 1; width: 100%; } body.ui2 #cardMain > #cardDetail { order: 2; } body.ui2 #cardMain > #cardTools { order: 3; }
/* điện thoại: 3 thẻ gọn trên một hàng (chữ đầy đủ ở khung chi tiết) */
@media (max-width: 700px) {
  body.ui2 #bonusList { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px; }
  body.ui2 #bonusList .card { padding: 6px 4px; min-width: 0; }
  body.ui2 #bonusList .card .cl, body.ui2 #bonusList .card .cnext, body.ui2 #bonusList .card .cloai { display: none; }
  body.ui2 #bonusList .card .cten { font-size: 12px; }
  body.ui2 #bonusList .card .cpick { font-size: 12px; padding: 2px 4px; }
}

/* ---- Thẻ trang bị lớn (màn chọn đồ sau round / sau boss): ảnh, tên, phẩm, chỉ số từng dòng, hiệu ứng, đúng chủ, Hợp với, Đề xuất ---- */
#cardPickList.icards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 300px)); justify-content: center; gap: 16px 14px; width: 100%; max-width: 980px; padding-top: 10px; }
.icard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 10px; background: var(--c-deep, #1c130b); border: 2px solid var(--qc); text-align: left; font-size: 12.5px; line-height: 1.4; cursor: pointer; min-width: 0; touch-action: manipulation; }
.icard.hl { box-shadow: 0 0 0 3px var(--c-gold, #f4b41b), 0 0 16px rgba(244,180,27,.5); }
.icard.rec { border-width: 3px; }
.icard:focus-visible { outline: none; }
.icrec { position: absolute; top: -12px; right: 10px; background: var(--c-gold, #f4b41b); color: #2a1a0c; font-weight: bold; font-size: 12px; padding: 1px 8px; border: 2px solid #2a1a0c; }
.ichd { display: flex; gap: 10px; align-items: center; }
.icimg { flex: 0 0 auto; min-width: 72px; min-height: 72px; padding: 4px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); border: 1px solid var(--qc); }
.icimg canvas { image-rendering: pixelated; }
.ichn { min-width: 0; } .icnm { font-size: 16px; display: block; } .icrar { font-size: 12px; }
.icsec { border-top: 1px solid rgba(138,106,60,.5); padding-top: 5px; }
.icsec > i { display: block; font-style: normal; font-size: 10px; color: var(--c-text-mute, #b8a888); text-transform: uppercase; margin-bottom: 2px; }
.icst { display: flex; align-items: center; gap: 6px; } .icst .ici { width: 16px; text-align: center; } .icst .n { margin-left: auto; color: #fff; font-weight: bold; }
.icno { font-size: 11px; margin-top: 2px; }
.icm { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } .icm.sub { font-size: 11.5px; }
.icti { width: 22px; height: 22px; image-rendering: pixelated; } .icti.off { filter: grayscale(1) brightness(.75); }
.icfull { font-size: 11.5px; margin-top: 3px; }
.icard .icpick { margin-top: auto; min-height: 44px; width: 100%; font-size: 15px; }
#cardPickDetail { width: 100%; max-width: 900px; height: 170px; overflow-y: auto; box-sizing: border-box; padding: 8px 10px; background: var(--c-deep, #1c130b); border: 2px solid var(--c-bronze, #8a6a3c); font-size: 12px; line-height: 1.4; text-align: left; margin: 0 auto; }
#cardPickDetail .cdhint { text-align: center; padding-top: 62px; }
@media (max-width: 760px) { #cardPickList.icards { grid-template-columns: minmax(0, 440px); } #cardPickDetail { height: 140px; font-size: 11px; } #cardPickDetail .cdhint { padding-top: 48px; } }
#cardPickList .icard .icpick { text-align: center; font-weight: bold; font-size: 15px; min-height: 44px; }

/* ---- Hộp thông báo "Nhận N mảnh tường" (trong màn chọn tower, hoặc nổi giữa trên khi không trùng lượt chọn) ---- */
#buyGift .wgh, .wgbox .wgh { font-size: 15px; margin-bottom: 4px; }
.wgl { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: flex-end; }
.wgi { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 8px; background: rgba(0,0,0,.3); border: 1px solid rgba(244,217,140,.5); }
.wgi canvas { image-rendering: pixelated; } .wgi b { font-size: 12px; color: #ece6d2; }
.wgs { font-size: 11px; font-weight: normal; margin-top: 4px; }
.wgbox { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 80; background: var(--c-deep, #1c130b); border: 2px solid #f4d98c; color: #f4d98c; font-weight: 700; text-align: center; padding: 10px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.6); max-width: calc(100vw - 20px); box-sizing: border-box; }
.wgbox .wgok { min-height: 44px; min-width: 96px; margin-top: 8px; }
/* bản đồ lớn hơn khung (hệ số nguyên CONFIG.PIXEL): cuộn thay vì thu nhỏ */
#wrap.mapScroll { overflow: auto !important; justify-content: flex-start !important; align-items: flex-start !important; }
#wrap.mapScroll > canvas { margin: 0 !important; flex: none; }
#cv { image-rendering: pixelated; }

/* luật đeo bí kíp: ô võ công bị chặn chuyển đỏ + thông báo ngắn cạnh ô */
.vslot.deny { outline: 2px solid #e04848 !important; background: rgba(224,72,72,.28) !important; }
#denyTip { position: fixed; z-index: 120; background: #3a1210; color: #ffd6cf; border: 2px solid #e04848; padding: 4px 8px; font-size: 13px; font-weight: bold; pointer-events: none; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.mwear { margin-top: 4px; } .mwear .no { color: #ff8a80; font-weight: bold; } .mwear .ok { color: #3fd6b4; }
.absmini { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; } .absmini span { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 4px; border: 1px solid rgba(138,106,60,.6); }

#cardPickList .popt em.mno { font-style: normal; color: #ff8a80; font-size: 11px; border: 1px solid #e04848; padding: 0 4px; margin-left: 4px; } #cardPickList .popt .mfit { color: #3fd6b4; font-size: 11px; }

/* MAP-FIRST, không cuộn trang: bản đồ luôn vừa một màn hình */
html, body.ui2 { overflow: hidden !important; }
body.ui2 #wrap, #wrap.mapScroll { overflow: hidden !important; }
#topBtns { display: inline-flex; gap: 4px; align-items: center; } #topBtns.hide { display: none; } #topBtns button { min-height: 36px; }
#wallDrawerBox { max-height: 70vh; } #wallDrawerBox .fpbody { overflow-y: auto; }
#sideLWall { overflow-y: auto; }

/* khi ẩn cột: nút Shop / Tường / Kho / Thông tin nằm trên thanh trên (không nổi trên bản đồ) */
#topBtns #shopTab, #topBtns #shopTab.hide { display: inline-flex !important; position: static !important; inset: auto !important; transform: none !important; align-items: center; gap: 4px; padding: 0 10px; min-height: 36px; font-size: 13px; background: var(--btn-primary, #b3382a); }
#topBtns #shopTab .sbadge { display: none; }
#topBtns button { position: static !important; }

/* KHÔI PHỤC KÍCH THƯỚC GIAO DIỆN: thanh trên gọn (tối đa ~6% chiều cao, nút >= 44 px), bản đồ sát thanh trên */
body.ui2 #top { padding-top: 2px !important; padding-bottom: 2px !important; min-height: 48px; max-height: max(48px, 6vh); box-sizing: border-box; align-items: center; overflow: hidden; }
body.ui2 #top button { min-height: 44px !important; max-height: 44px; padding-top: 0 !important; padding-bottom: 0 !important; }
body.ui2 #mid #wrap { align-items: flex-start !important; }

/* ô hòm đồ chưa mở: ổ khóa nhỏ + 'Lv.N' một dòng (không chồng chữ); câu đầy đủ khi di chuột / chạm */
.lockc { gap: 2px; padding: 2px; } .lockc b { font-size: 12px; line-height: 1; } .lockc span { font-size: 11px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; }

/* Tower đã tiến hóa: khung ảnh đại diện viền vàng + nhãn "Đã tiến hóa" */
canvas.evoPort { border: 2px solid #feae34; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); box-sizing: content-box; }
.evoTag { display: inline-block; margin-left: 4px; padding: 0 5px; font-size: 11px; line-height: 16px; color: #1a1209; background: #feae34; border-radius: 2px; vertical-align: middle; white-space: nowrap; }
/* Tiến hóa tự động: dòng thông báo ở góc dưới phải, (không chặn bấm) */
#evoNote { position: fixed; right: 8px; bottom: 46px; z-index: 61; max-width: min(560px, 72vw); padding: 6px 10px; font-size: 12px; line-height: 1.35; color: #1a1209; background: #feae34; border: 2px solid #73172d; border-radius: 3px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Phím tắt Shop: không đủ xu thì rung nhẹ nút Làm mới */
@keyframes btnShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
button.shake { animation: btnShake .35s steps(6, end); }
/* Phím tắt Shop: nhãn phím nhỏ ở góc nút (khung tối viền vàng mảnh, chữ sáng — giống một phím bàn phím) */
#btnHideShop, #btnFreeze, #btnReroll { position: relative; }
.kcap { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 16px; padding: 0 3px; box-sizing: border-box; font: 700 10px/14px monospace; text-align: center; color: #f4e4c1; background: #1a1209; border: 1px solid #d8a657; border-radius: 2px; box-shadow: 0 2px 0 #000; pointer-events: none; z-index: 2; letter-spacing: 0; }
/* bấm phím: nút lún xuống 0,15 giây */
button.kpress { transform: translateY(2px); filter: brightness(.88); box-shadow: inset 0 2px 0 rgba(0,0,0,.45) !important; }
button.kpress .kcap { box-shadow: none; top: -5px; }
/* nút Đóng băng đang bật: màu xanh băng */
#btnFreeze.ice.on { background: #2f7fa8 !important; color: #eafaff !important; border-color: #9be7ff #174a63 #174a63 #9be7ff !important; text-shadow: 0 1px 0 #0b2a3a; }
/* dòng chú thích phím ở cuối Shop */
#shopKeyHint { margin-top: 6px; font-size: 11px; text-align: center; color: var(--c-text-dim, #b9a888); opacity: .8; }
/* điện thoại / máy tính bảng (không có bàn phím): ẩn nhãn phím và dòng chú thích */
@media (hover: none) and (pointer: coarse) { .kcap, #shopKeyHint { display: none !important; } }
/* ===== Nội lực (giai đoạn 4): thanh trong bảng tower, giá ở góc thẻ đồ, ô kho chưa đủ cấp ===== */
#nlBar { display: flex; align-items: center; gap: 8px; min-height: 22px; margin: 2px 0 4px; font-size: 12px; line-height: 1.2; flex-wrap: wrap; }
#nlBar:empty { display: none; }
#nlBar .nlL { color: var(--c-gold-l, #feae34); font-weight: 700; white-space: nowrap; }
#nlBar .nlT { position: relative; flex: 1 1 120px; min-width: 100px; height: var(--nl-h, 14px); display: flex; background: var(--nl-bg, #1c130a); border: 2px solid #000; box-shadow: 0 0 0 1px rgba(196,145,63,.7); overflow: hidden; }
#nlBar .nlT > i { display: block; height: 100%; flex: none; box-shadow: inset -1px 0 0 rgba(0,0,0,.75); }
#nlBar .nlT > i.pv { animation: nlPulse .6s steps(2) infinite; }
#nlBar .nlT > i.pv.ok { background: var(--nl-ok); }
#nlBar .nlT > i.pv.bad { background: var(--nl-bad); }
#nlBar .nlT > b.cap { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; }
#nlBar .nlN { white-space: nowrap; font-variant-numeric: tabular-nums; }
#nlBar .nlN b.ok, #nlBar .nlM.ok { color: var(--nl-ok); }
#nlBar .nlN b.bad, #nlBar .nlM.bad { color: var(--nl-bad); }
#nlBar .nlM { font-weight: 700; white-space: nowrap; }
#nlBar.over .nlT { box-shadow: 0 0 0 1px var(--nl-bad); }
@keyframes nlPulse { 50% { opacity: .55; } }
.nlc { float: right; margin: 0 0 2px 6px; padding: 1px 4px; border: 1px solid; border-radius: 2px; font-size: 11px; font-weight: 700; white-space: nowrap; background: rgba(0,0,0,.35); }
.ichd .nlc { float: none; margin-left: auto; align-self: flex-start; }
.nlTag { position: absolute; right: 1px; bottom: 1px; font: 700 9px/1 var(--font, sans-serif); font-style: normal; padding: 1px 2px; border: 1px solid; border-radius: 2px; background: rgba(0,0,0,.7); pointer-events: none; z-index: 2; }
.nlLv { position: absolute; left: 1px; right: 1px; top: 50%; transform: translateY(-50%); text-align: center; font: 700 9px/1.1 var(--font, sans-serif); font-style: normal; background: rgba(0,0,0,.78); padding: 1px 0; pointer-events: none; z-index: 3; }
.slot.item.nlLow > canvas { opacity: var(--nlo, .4); filter: grayscale(.6); }
.nlsp.off .itl { color: #8f8574; }
.nlcmp { margin-top: 3px; }
.irow.sm { font-size: 11px; }
/* ===== Tự động dung hợp: bảng xem trước + thông báo góc ===== */
#confirm .aflist { margin: 6px 0; padding-left: 18px; max-height: 40vh; overflow-y: auto; text-align: left; }
#confirm .aflist li { margin: 2px 0; }
#confirm .afwarn { margin: 6px 0; font-weight: 700; }
#afNote { position: fixed; right: 8px; bottom: 84px; z-index: 60; padding: 6px 10px; background: rgba(20,13,8,.92); border: 2px solid var(--c-gold-l, #feae34); color: #f4e4c1; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .2s; }
#afNote.on { opacity: 1; }#nlRow { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
#nlRow #nlBar { flex: 1 1 auto; min-width: 0; margin: 0; }
#btnAutoFuse { flex: none; min-height: 44px; min-width: 44px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.15; white-space: nowrap; touch-action: manipulation; }
#btnAutoFuse .afi { font-size: 18px; line-height: 1; }
#btnAutoFuse .afk { opacity: .75; font-size: 11px; }
#btnAutoFuse.off { filter: grayscale(1); opacity: .5; cursor: help; }
@media (hover: none) and (pointer: coarse) { #btnAutoFuse .afk { display: none; } }
#tbox.tcompact #btnAutoFuse .aft { display: none; }
/* ===== Đồng hồ round (CONFIG.ROUND_CLOCK) ===== */
#roundClock { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 2px 12px; margin-right: 6px; border: 2px solid var(--c-gold-l, #feae34); background: rgba(20,13,8,.85); box-shadow: 0 0 0 1px #000; white-space: nowrap; }
#roundClock.hide { display: none; }
#roundClock .rcL { font-size: 11px; color: var(--c-text-dim, #b9a888); }
#roundClock .rcT { font-size: 24px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
#roundClock.prep { border-color: #7bd36a; } #roundClock.prep .rcT { color: #b8f0a8; }
#roundClock.warn { animation: rcBlink .5s steps(2) infinite; border-color: #ff6b55; } #roundClock.warn .rcT { color: #ffd2c8; }
@keyframes rcBlink { 50% { background: rgba(120,30,20,.85); } }
#btnStart.early { background: #2f5a1e; border-color: #7bd36a; color: #e8ffd8; }
/* ===== Menu: nút chế độ (Chiến dịch / Vô tận khóa) ===== */
.tmenu .tbtns button.tmodeBtn { min-height: 52px; height: auto !important; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 10px; line-height: 1.2; }
.tmenu .tbtns button.tmodeBtn small { position: static !important; display: block; font-size: 11px; opacity: .8; margin: 0; white-space: normal; transform: none !important; }
.tmodeBtn.locked { filter: grayscale(.85); opacity: .6; cursor: help; }
/* ---- Màn "Chọn 1 phần thưởng" gọn (03/12/2026): không khung chi tiết, không nút Đổi thẻ chung, thẻ chỉ còn biểu tượng / tên / độ hiếm / 1 dòng thưởng / nút ---- */
#bonus #cardDetail, #bonus #cardReroll { display: none !important; }
#bonusList .card { position: relative; overflow: hidden; }
#bonusList .card .cl { display: block !important; overflow-wrap: anywhere; }
#bonusList .card .cwarnIc { position: absolute; top: 6px; right: 8px; font-size: 14px; line-height: 1; color: var(--c-gold-l, #f4d98c); pointer-events: auto; }
@media (max-width: 700px) {
  body.ui2 #bonusList { grid-template-columns: minmax(0, 1fr) !important; gap: 8px; }
  body.ui2 #bonusList .card { padding: 8px 10px; }
  body.ui2 #bonusList .card .cl { font-size: 11px; }
}
/* nút "Đổi" riêng của từng thẻ: góc trên phải, đủ 44px, xa nút Chọn ở đáy; hàng biểu tượng luôn giữ 44px nên nút biến mất không làm thẻ nhảy */
#bonusList .card .ctop { min-height: 44px; display: flex; align-items: center; }
#bonusList .card .cdoi { position: absolute; top: 6px; right: 6px; min-width: 64px; min-height: 44px; padding: 0 12px; font-size: 13px; line-height: 1; cursor: pointer; touch-action: manipulation; z-index: 2;
  background: var(--c-surface-d, #2a1f14); color: var(--c-gold-l, #f4d98c); border: 2px solid var(--c-bronze, #8a6a3c); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }
#bonusList .card .cdoi:hover { filter: brightness(1.15); }
#bonusList .card .cdoi:active { transform: translateY(1px); }
#bonusList .card .cten { display: block; padding-right: 4px; }
#bonusList .card .cwarnIc { top: 18px; right: auto; left: 46px; }
@media (max-width: 700px) { /* điện thoại: thu khoảng cách để 3 thẻ + nút Bỏ qua + dòng xu vừa một màn, không cần cuộn */
  body.ui2 #bonusList .card { padding: 4px 10px 6px; }
  body.ui2 #bonusList .card .cten, body.ui2 #bonusList .card .cq { margin: 0; line-height: 1.35; }
  body.ui2 #bonusList .card .cl { margin: 2px 0 0; line-height: 1.35; }
  body.ui2 #bonusList .card .crow { margin-top: 6px; }
  body.ui2 #bonusList .card .cdoi { top: 4px; right: 6px; }
  body.ui2 #bonus #bonusTitle { margin: 4px 0 6px; }
}
@media (max-width: 700px) { /* điện thoại: biểu tượng ở góc trái, tên + độ hiếm nằm cạnh biểu tượng (cùng hàng với nút Đổi) -> mỗi thẻ thấp hơn ~40px */
  body.ui2 #bonusList .card .ctop { position: absolute; top: 8px; left: 10px; min-height: 0; }
  body.ui2 #bonusList .card .cten, body.ui2 #bonusList .card .cq { padding-left: 34px; padding-right: 76px; }
  body.ui2 #bonusList .card .cten { padding-top: 4px; }
  body.ui2 #bonusList .card { min-height: 0; }
  body.ui2 #bonusList .card .cwarnIc { top: 30px; left: 14px; }
}

/* ---- Ô đồ trong kho vuông đều (CONFIG.KHO_O) ---- */
#tKhoI, #kho .khogrid { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.slot.item.kvo { display: inline-flex; align-items: center; justify-content: center; position: relative; padding: 0; box-sizing: border-box; flex: none; overflow: hidden; }
.slot.item.kvo canvas.kvoimg { image-rendering: pixelated; image-rendering: crisp-edges; flex: none; }
.slot.item.kvo .kshape { position: absolute; right: 2px; bottom: 1px; font-size: 10px; line-height: 1; padding: 1px 2px; color: #f4e6c4; background: rgba(20,14,8,.75); border-radius: 2px; pointer-events: none; }
.kshapeMini { margin-bottom: 6px; } .kshapeMini .kgrid { display: grid; gap: 1px; margin-top: 3px; }
.kshapeMini .kgrid i { display: block; background: rgba(255,255,255,.06); } .kshapeMini .kgrid i.on { background: var(--kc, #f4d98c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.45); }

.slot.item.kvo .nlTag { top: 2px !important; right: 2px !important; bottom: auto !important; left: auto !important; } /* ô vuông kho: số Nội lực lên góc trên phải, góc dưới phải để chữ hình dạng */
.slot.item.kvo .fuseTag { top: 2px !important; left: 2px !important; bottom: auto !important; right: auto !important; }

/* ---- 200 trang bị – Bước 5: khung Cực phẩm (bản mệnh / di vật đôi) ---- */
.iblk.cpblk { border-left: 3px solid #f4d98c; padding-left: 6px; background: rgba(244,217,140,.06); }
.iblk.cpblk.off { border-left-color: #6b6354; background: rgba(255,255,255,.02); }
.iblk.cpblk.off .cpluat, .iblk.cpblk.off .cptang { opacity: .75; }
.iblk.cpblk .cptang.cur { font-weight: bold; }
.iblk.cpblk .cpbar { height: 6px; margin: 3px 0 4px; background: rgba(0,0,0,.45); border: 1px solid #6b5a3a; }
.iblk.cpblk .cpbar i { display: block; height: 100%; background: #f4b41b; }
button.cpnang { display: block; width: 100%; min-height: 44px; margin: 8px 0 2px; font-size: 13px; cursor: pointer; touch-action: manipulation; }
button.cpnang:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Cộng dồn hiệu ứng trùng (CONFIG.CONG_DON_HIEU_UNG): dòng gộp trong bảng tower (cỡ chữ đặt từ config) ---- */
.cdrow { padding: 4px 6px; min-height: 22px; line-height: 1.35; color: #e8dcc0; border-bottom: 1px dashed rgba(255,255,255,.12); cursor: help; touch-action: manipulation; }
.cdrow.max { color: #f2c94c; }
.cdghichu { color: #9fd36b; }

/* ---- Khung viền phẩm cấp PixelLab (CONFIG.KHUNG_PHAM): 9-slice bằng border-image; số liệu (góc, lề hover) do JS đặt vào biến --kp* ---- */
.kp { border-style: solid !important; border-image-source: var(--kp) !important; border-image-slice: var(--kpg, 8) !important; border-image-width: var(--kpgw, 8px) !important; border-image-outset: 0 !important; border-image-repeat: stretch !important; }
.kp:hover, .kp.sel, .kp.on { border-image-source: var(--kph) !important; border-image-slice: var(--kphs) !important; border-image-width: var(--kphw) !important; border-image-outset: var(--kpho) !important; }
#qstrip .qs.kp.on, .qgrid .qs.kp.on { box-shadow: none; }

/* ---- Tôi luyện: nút + Bảo hộ ở khung Chi tiết; nhãn ★ dung hợp góc dưới trái ô kho ---- */
.dhNhan.fuseTag { padding: 0; background: none !important; border-radius: 0; image-rendering: pixelated; }
.pvw > .dhNhan.fuseTag { position: absolute; }
.slot.item.kvo .fuseTag.dhNhan { top: auto !important; bottom: 2px !important; left: 2px !important; right: auto !important; }
.tlhang { margin-top: 6px; }
button.cpnang.tlnut { border-width: 2px; border-style: solid; font-weight: bold; }
button.cpnang.tlbaoho { margin-top: 4px; }
button.cpnang.tlbaoho.on { background: #2d4a2a; color: #cfeec4; border-color: #6fcf97; }
.tlhang .tlrui { margin-top: 3px; }
#qstrip .qfu.qtl, .qgrid .qfu.qtl { left: auto; right: 1px; background: rgba(20,14,8,.85); font-weight: bold; }
#qstrip .qfu.qdh, .qgrid .qfu.qdh { top: auto; bottom: 1px; }

/* Biến cố round (CONFIG.BIEN_CO): biểu tượng màu trên chip */
.fxchip .bcico { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-size: 16px; vertical-align: -2px; }


/* Màn thưởng: dòng phần thưởng luôn giữ chỗ cố định (3 dòng trên máy tính, 2 dòng trên điện thoại) để khi bấm "Đổi" ra thẻ có chữ dài / ngắn hơn, thẻ và nút Chọn không xê dịch */
#bonusList .card .cl { line-height: 1.4; min-height: 4.2em; }
@media (max-width: 700px) { body.ui2 #bonusList .card .cl { line-height: 1.35; min-height: 2.7em; } }

/* ===== Thanh hệ phái đang kích hoạt: nằm CÙNG HÀNG thanh trên (giữa Xu/Máu/Round và cụm đồng hồ/nút), không đè bản đồ =====
   Kích thước lấy từ CONFIG.UI2.sectBar (js/config.js) qua biến --sb-*. JS (sectBarFit) thêm lớp .sectRow khi hàng không đủ chỗ. */
body.ui2 #top #mapChips { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: var(--sb-gap, 4px); margin: 0 var(--sb-side, 8px); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; pointer-events: auto; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
body.ui2 #top #mapChips::-webkit-scrollbar { display: none; }
body.ui2 #top #mapChips.empty { display: none; }
body.ui2 #top .mchip { flex: none; min-height: var(--sb-h, 44px) !important; max-height: var(--sb-h, 44px); min-width: 44px; padding: 0 var(--sb-padx, 8px) !important; font-size: var(--sb-font, 12px); line-height: 1.2; white-space: nowrap; box-sizing: border-box; background: rgba(27,18,11,.82); border-width: 2px; border-style: solid; border-radius: 3px; box-shadow: none; color: var(--c-text); touch-action: manipulation; }
body.ui2 #top .mchip:hover { filter: brightness(1.18); }
body.ui2 #top .mchip b { color: var(--c-gold-l); }
/* không đủ chỗ: thanh hệ phái xuống một dòng riêng ngay dưới thanh trên (kéo ngang nếu vẫn chật) */
body.ui2 #top.sectRow { flex-wrap: wrap; row-gap: var(--sb-rowgap, 2px); max-height: none; }
body.ui2 #top.sectRow #mapChips { order: 99; flex: 1 1 100%; margin: 0; padding-bottom: 2px; }
body.ui2 #top #mapChips.ovf { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); } /* còn ô khuất bên phải: mép mờ báo kéo ngang được */
body.ui2 #top.sectRow #mapChips .mchip:first-child { margin-left: auto; } body.ui2 #top.sectRow #mapChips .mchip:last-child { margin-right: auto; } /* căn giữa, tràn thì vẫn kéo được từ ô đầu */

/* nhãn Đã / Chưa sở hữu trên thẻ chọn tower: chiếm một dòng cố định (thẻ nào cũng có), không làm thẻ dài ra hay lệch */
.buycard .bcinfo .bcown { display: block; height: 16px; line-height: 16px; font-style: normal; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 #000; }
@media (max-width: 700px) { .buycard .bcinfo .bcown { font-size: 10px; height: 14px; line-height: 14px; } }
/* Chi tiết: chỉ trỏ chuột (xem trước) thì nút Bán mờ hẳn, không bấm được */
#tDetSell.xemtruoc, #tDetSell.xemtruoc:disabled { opacity: .4; filter: grayscale(1); cursor: not-allowed; }
/* Nhãn +N dạng chữ pixel (CONFIG.NHAN_FU): góc trên phải món; ở ô kho đứng ngay bên trái số Nội lực */
.fuNhan.fuseTag { padding: 0; background: none !important; border-radius: 0; image-rendering: pixelated; left: auto; right: 2px; top: 2px; }
.kgocP { position: absolute; display: flex; gap: 2px; align-items: flex-start; pointer-events: none; z-index: 2; }
.kgocP > .fuseTag, .kgocP > .nlTag { position: static !important; }
.pvw { position: relative; display: inline-block; flex: none; line-height: 0; } .pvw > .fuNhan.fuseTag { position: absolute; left: auto; }
.pvw > canvas.pv { display: block; margin: 0; }
/* Màn chọn tower: đã chọn đủ số lượt (CONFIG.TOWER_RULES) thì các thẻ còn lại mờ và không bấm được */
#buyList.khoa .buycard { opacity: .45; pointer-events: none; filter: grayscale(.5); }
/* ===== Màn Chi tiết tower – bố cục mới (CONFIG.TPOP_A): biểu tượng bí kíp cạnh tên ở cột Tổng quan, lọc theo phẩm ở Kho đồ + Hòm đồ ===== */
#tInfo .hd .tbk { margin-left: 4px; flex: none; align-self: center; }
#tSlots.nho { display: block; }
#tSlots .vslot.nho { flex-direction: row; justify-content: flex-start; align-items: center; gap: 6px; padding: 3px 6px; text-align: left; box-sizing: border-box; min-height: 44px; font-size: 11px; }
#tSlots .vslot.nho:not(.filled) { justify-content: center; text-align: center; opacity: .75; border-style: dashed; }
#tInfo .hd .tbk canvas { width: auto !important; height: auto !important; border: 0 !important; background: none !important; flex: none; image-rendering: pixelated; }
.vbtx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; line-height: 1.15; }
.vbtx b { color: var(--c-text); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vbtx span { font-size: 10px; }
.vbbar { display: block; height: 4px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.12); text-decoration: none; }
.vbbar > u { display: block; height: 100%; text-decoration: none; }
.locPham { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; flex: none; padding: 2px 0 4px; scrollbar-width: thin; }
.locPham .lpn { flex: none; min-height: var(--lph, 44px); font-size: 11px; padding: 0 8px; border: 2px solid var(--lpc, var(--c-line)); color: var(--lpc, var(--c-text)); background: var(--c-deep); white-space: nowrap; }
.locPham .lpn.on { background: var(--lpc, var(--c-line)); color: #140d08; font-weight: 700; }
.locPham .lpn[data-v="all"].on { color: var(--c-gold-l); }
body.ui2 #tbox:not(.tcompact) .locPham.nho .lpn { min-height: 28px; font-size: 10px; padding: 0 6px; } /* máy tính: hàng lọc trên hòm đồ thấp hơn để lưới có thêm chỗ; điện thoại vẫn 44 px */
#tbox.tcompact #tSlots .vslot.nho { width: 124px !important; } /* điện thoại: biểu tượng bí kíp hẹp hơn để tên nhân vật không xuống dòng */
/* ===== Gắn bộ khung UI PixelLab (CONFIG.UI_THEME): lớp phủ toàn màn hình không còn viền vàng code quanh mép màn hình; hộp bên trong (.fbox) mang khung hộp thoại ===== */
#bonus, #buy, #confirm { border-color: transparent !important; box-shadow: none !important; border-radius: 0 !important; }
#confirm .cfbox { max-width: min(560px, 94vw); gap: 14px; }
/* Nút vàng PixelLab (nut-vang): chữ tối để đọc rõ trên nền vàng (cùng danh sách với CONFIG.UI_THEME.buttons.gold.sel) */
button.gold, button.primary, button.on:not(.lpn):not(.slot), #btnPlay, #btnAgain, .buyopt { color: #2a1a0d !important; text-shadow: 0 1px 0 rgba(255,236,190,.35) !important; }
button.gold *, button.primary *, #btnPlay *, #btnAgain *, .buyopt * { color: inherit !important; }
/* ===== CHỮ DỄ ĐỌC + Ô KHÓA (CONFIG.CHU_GIAO_DIEN → biến CSS): tương phản >= 4,5:1, cỡ chữ tối thiểu, không làm mờ chữ cả khối ===== */
#tbox, #shopBox, #sideR, #colL, #colR, #bonus .fbox, #buy .fbox, #confirm .fbox { font-size: max(var(--co-min, 12px), 1em); }
.zt, .zt2 { font-size: var(--co-min, 12px) !important; color: var(--chu-tieu-de, var(--c-gold)) !important; text-shadow: var(--bong-chu); letter-spacing: .3px; font-weight: 700; }
.lpn, .mtier, .nlTag, .kshape, .kcap, .ptag, .xpline, .itl, .relef, .relst, .reltag, .afk, .dhint, .dtag, #tDetSell, .relbtn, .nlc, #ttabs button, .vbtx b, .vbtx span, #tBagHead, #shopKeyHint, .relrow, .dmgNone, .absnone { font-size: var(--co-min, 12px) !important; }
#tbox .dim, #shopBox .dim, #sideR .dim, #colL .dim, #colR .dim { font-size: max(var(--co-min, 12px), 1em); color: var(--c-text-dim); }
.dhint, .dhint.sm { color: var(--c-text-dim) !important; text-shadow: var(--bong-chu); }
/* Chi tiết: tiêu đề mục tách hẳn nội dung (màu + khoảng cách), nội dung chữ sáng */
#tDetail .itl, .iblk .itl { color: var(--chu-tieu-de, var(--c-gold)) !important; font-weight: 700; letter-spacing: .4px; margin-top: 8px; padding-bottom: 2px; border-bottom: 1px solid rgba(196,145,63,.25); text-shadow: var(--bong-chu); }
#tDetail .irow { color: var(--c-text); }
/* tên tầng bí kíp: màu tầng pha sáng để đọc được trên nền tối */
.vbtx span { color: color-mix(in srgb, var(--tcol, var(--c-text-dim)) 45%, var(--c-text)) !important; }
/* thẻ quan hệ chưa đủ điều kiện: chỉ làm tối nền + hình, chữ giữ tương phản */
.relrow { opacity: 1 !important; background: #1d150e !important; }
.relrow:not(.on) canvas, .relrow:not(.on) .relgi { filter: grayscale(.75) brightness(.6); }
.relrow:not(.on) b { color: var(--c-text-dim); } .relrow .relst, .relrow .relef { color: var(--c-text-dim) !important; } .relrow .reltag { color: var(--c-gold-l) !important; } .relrow.on .relst { color: var(--chu-tot) !important; }
.relrow.drop { border-style: dashed; }
/* nút: vô hiệu vẫn đọc được; Bán lúc chỉ xem trước: không mờ cả nút, viền nét đứt + chữ phụ */
button:disabled { color: var(--c-text-dim) !important; }
#tDetSell.xemtruoc, #tDetSell.xemtruoc:disabled { opacity: 1 !important; filter: none !important; color: var(--c-text-dim) !important; outline: 1px dashed var(--c-text-mute); outline-offset: -4px; cursor: not-allowed; }
#ttabs button.on, button.dtab.on, button.tmode.on { color: #fff3d6 !important; text-shadow: 0 1px 0 #000 !important; }
.locPham .lpn[data-v="all"].on { background: var(--c-bronze) !important; color: #140d08 !important; }
/* chữ nằm trên hình nhiều chi tiết: nền tối mờ phía sau */
.nlTag, .kshape, .ptag, .kcap, .mtier { text-shadow: var(--bong-chu); }
.nlTag, .kshape, .ptag, .kcap { background: var(--nen-chu-hinh, rgba(12,8,5,.82)) !important; }
/* dòng trạng thái rỗng: căn giữa vùng trống, có biểu tượng, không chìm */
.kgrid > .khoTrong { flex: 1 1 100%; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; color: var(--c-text-dim); font-size: max(var(--co-min, 12px), 13px); text-align: center; text-shadow: var(--bong-chu); }
.khoTrong i { font-style: normal; font-size: 24px; line-height: 1; }
/* Ô HÒM ĐỒ CHƯA MỞ: một ổ khóa nhỏ giữa ô + cấp mở; ô mở kế tiếp nổi bật; các hàng xa gộp thành một dải */
#bagLocks .lockc { background: none !important; border: 1px dashed rgba(196,145,63,.22) !important; border-image: none !important; color: var(--khoa-chu-gan, #e6d6b4) !important; text-shadow: var(--bong-chu); gap: 1px; opacity: 1 !important; }
#bagLocks .lockc b { font-size: 14px !important; line-height: 1; }
#bagLocks .lockc span { font-size: var(--co-min, 12px) !important; font-weight: 700; }
#bagLocks .lockc.ke { border: 2px solid var(--khoa-vien-ke, #c4913f) !important; background: rgba(196,145,63,.14) !important; color: var(--khoa-chu-ke, #f6d77a) !important; }
#bagLocks .lockc.ke span { font-size: 15px !important; }
#bagLocks .lockc.ke small { font-size: var(--co-min, 12px); color: var(--c-text-dim); font-weight: 600; white-space: nowrap; letter-spacing: -.3px; }
#bagLocks .lockDai { display: flex; align-items: center; justify-content: center; background: var(--khoa-nen-dai, rgba(8,5,3,.55)); border: 1px solid rgba(196,145,63,.2); color: var(--khoa-chu-dai, #dccaa6); font-size: max(var(--co-min, 12px), 13px); font-weight: 600; text-shadow: var(--bong-chu); text-align: center; padding: 0 6px; box-sizing: border-box; }
/* điện thoại: cỡ chữ tối thiểu lớn hơn */
@media (max-width: 600px) {
  #tbox, #shopBox, #sideR, #colL, #colR, #bonus .fbox, #buy .fbox, #confirm .fbox { font-size: max(var(--co-min-dt, 13px), 1em); }
  .zt, .zt2, .lpn, .mtier, .nlTag, .kshape, .kcap, .ptag, .xpline, .itl, .relef, .relst, .reltag, .afk, .dhint, .dtag, #tDetSell, .relbtn, .nlc, #ttabs button, .vbtx b, .vbtx span, #tBagHead, #shopKeyHint, .relrow, .dmgNone, .absnone, #bagLocks .lockc span, #bagLocks .lockc.ke small { font-size: var(--co-min-dt, 13px) !important; }
  #tbox .dim, #shopBox .dim, #sideR .dim { font-size: max(var(--co-min-dt, 13px), 1em); }
}
/* mục "THUỘC TÍNH" (CONFIG.THUOC_TINH.coChu): máy tính tối thiểu 12px; điện thoại (bảng tower dạng gọn, cả dọc lẫn ngang) tối thiểu 14px */
#tFx .fxl { font-size: max(var(--co-min, 12px), var(--tt-co, 12px)); }
#tbox.tcompact #tFx .fxl, #tbox.tcompact #tFx .zt2 { font-size: max(var(--co-min-dt, 13px), var(--tt-co-dt, 14px)) !important; }
#tbox.tcompact #tFx .fxl .dim { font-size: 1em !important; }

/* ===== THẺ BÍ KÍP LỚN ở đầu cột Tổng quan (CONFIG.TPOP_A.theBiKip; số liệu đưa vào biến CSS --bk-*). Cạnh tên nhân vật; cột hẹp thì xuống hàng dưới tên, rộng hết cột ===== */
#tInfo .hd { flex-wrap: wrap; row-gap: 8px; }
#tInfo .hd > div:not(.tbk) { flex: 0 1 auto; min-width: 9em; }
#tInfo .hd .tbk { flex: 1 1 var(--bk-rong, 250px); min-width: min(100%, var(--bk-rong, 250px)); margin-left: 0; align-self: stretch; }
#tSlots.nho { display: block; width: 100%; }
#tSlots .vslot.nho.lon { width: 100% !important; height: auto !important; min-height: var(--bk-cao, 112px); display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--bk-gap, 10px); padding: var(--bk-dem, 8px); box-sizing: border-box; cursor: pointer; opacity: 1; transition: filter .12s, box-shadow .12s; }
#tSlots .vslot.nho.lon:hover, #tSlots .vslot.nho.lon:focus-visible, #tSlots .vslot.nho.lon.sel { filter: brightness(1.12); box-shadow: 0 0 0 2px var(--bkcol, var(--c-gold-l)), 0 0 12px rgba(244,217,140,.35); outline: none; }
#tSlots .vslot.nho.lon.over { filter: brightness(1.25); background-color: #3a2a12 !important; outline: 3px solid var(--c-gold-l); outline-offset: 2px; box-shadow: 0 0 18px rgba(244,217,140,.6); } /* đang kéo bí kíp vào: cả thẻ là vùng nhận thả */
#tSlots .vslot.nho.lon.over:not(.filled) span { color: var(--c-gold-l); }
#tSlots .vslot.lon .bkhinh { flex: none; line-height: 0; }
#tInfo .hd .tbk #tSlots .vslot.lon .bkhinh canvas { width: var(--px, 96px) !important; height: var(--px, 96px) !important; image-rendering: pixelated; }
#tSlots .vslot.lon .bktx { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; text-align: left; line-height: 1.2; }
#tSlots .vslot.lon .bkten { color: var(--c-text) !important; font-size: var(--bk-ten, 15px) !important; font-weight: 700; white-space: normal; overflow: visible; overflow-wrap: break-word; text-shadow: var(--bong-chu, 0 1px 0 #000); }
#tSlots .vslot.lon .bktang { display: flex; align-items: center; gap: 6px; font-size: var(--bk-tang, 13px) !important; color: var(--c-gold-l) !important; text-shadow: var(--bong-chu, 0 1px 0 #000); }
#tSlots .vslot.lon .bktang i { flex: none; width: 10px; height: 10px; border: 1px solid #000; }
#tSlots .vslot.lon .bkbar { display: block; height: var(--bk-thanh, 8px); background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.18); text-decoration: none; }
#tSlots .vslot.lon .bkbar > u { display: block; height: 100%; text-decoration: none; }
#tSlots .vslot.lon .bkso { font-size: var(--bk-so, 12px) !important; color: var(--c-text-dim) !important; text-shadow: var(--bong-chu, 0 1px 0 #000); }
#tSlots .vslot.lon .bkgoi { font-size: 12px; color: var(--c-gold-l); opacity: 0; transition: opacity .12s; }
#tSlots .vslot.lon:hover .bkgoi, #tSlots .vslot.lon:focus-visible .bkgoi { opacity: 1; }
@media (hover: none) { #tSlots .vslot.lon .bkgoi { display: none; } }
#tSlots .vslot.nho.lon:not(.filled) { justify-content: center; text-align: center; background-color: #120c08; color: var(--c-text-dim); font-size: 14px; border-style: dashed; }
#tSlots .vslot.nho.lon:not(.filled) span { font-size: 14px; color: var(--c-text-dim); text-shadow: var(--bong-chu, 0 1px 0 #000); }
/* điện thoại (tab Tower): thẻ chiếm cả chiều ngang, chữ >= 14 px, vùng chạm >= 44 px */
#tbox.tcompact #tInfo .hd .tbk { flex-basis: 100%; }
#tbox.tcompact #tSlots .vslot.nho.lon { width: 100% !important; min-height: max(44px, var(--bk-cao, 112px)); }
#tbox.tcompact #tSlots .vslot.lon .bkten, #tbox.tcompact #tSlots .vslot.lon .bktang, #tbox.tcompact #tSlots .vslot.lon .bkso, #tbox.tcompact #tSlots .vslot.nho.lon:not(.filled) span { font-size: max(var(--bk-dt, 14px), 1em) !important; }
#tbox.tcompact #tSlots .vslot.lon .bkten { font-size: max(var(--bk-dt, 14px), var(--bk-ten, 15px)) !important; }
/* nút Tự động dung hợp lúc không có gì để dung hợp: không mờ cả nút (chữ vẫn đạt tương phản), chỉ xám hình + viền nét đứt */
#btnAutoFuse.off { opacity: 1 !important; filter: none !important; color: var(--c-text-dim) !important; outline: 1px dashed var(--c-text-mute); outline-offset: -4px; }
#btnAutoFuse.off .afi { filter: grayscale(1) brightness(.85); }
#btnAutoFuse.off { background: rgba(0, 0, 0, .45) !important; border-color: var(--c-text-mute) !important; box-shadow: none !important; } /* 05/12: nhìn rõ là chưa dùng được (nền tối, viền xám); bấm vào hiện dòng lý do #afLyDo ngay dưới */
#btnAutoFuse .afk { opacity: 1 !important; color: var(--c-text-dim); }
@media (max-width: 600px) { #bagLocks .lockc.ke small { white-space: normal; text-align: center; line-height: 1.05; letter-spacing: 0; } } /* ô hẹp: 'còn M cấp' xuống 2 dòng, không bị cắt */
@media (max-width: 600px) { #bagLocks .lockc.ke b { display: none; } #bagLocks .lockc.ke span { font-size: 14px !important; } } /* ô hẹp: bỏ ổ khóa của ô kế tiếp (viền vàng đồng đã cho biết), đủ chỗ cho cấp + 'còn M cấp' */

/* ---- Đổi đồ trong round: dấu ✕ nhỏ trên hòm đồ khi tower đang bị choáng (CONFIG.TRONG_ROUND) ---- */
#doiDoVong { position: absolute; top: 3px; right: 3px; z-index: 6; width: var(--dd-px, 30px); height: var(--dd-px, 30px); border-radius: 50%; pointer-events: none;
  background: #7a2a1e; box-shadow: 0 0 0 2px #1b120b; display: flex; align-items: center; justify-content: center; line-height: 1; }
#doiDoVong::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #1b120b; }
#doiDoVong b { position: relative; color: #f3e7cc; font-size: 13px; font-weight: bold; }
#doiDoVong.hide { display: none; }

/* ---- Xem trước round sau: mẫu đợt quái + biến cố (biểu tượng tạm: chữ trong vòng tròn) ---- */
#dotToi { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; }
#dotToi.hide { display: none; }
#dotToi .dtL { font-size: 12px; color: var(--chu-phu, #dccaa6); margin-right: 2px; white-space: nowrap; }
#dotToi button.dtB { min-width: 44px; min-height: 44px; width: 44px; height: 44px; padding: 0; margin: 0; background: none !important; border: 0 !important; box-shadow: none !important; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
#dotToi .dtO { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: bold 13px/1 monospace; color: #1b120b; border: 2px solid #1b120b; box-shadow: 0 0 0 1px #f3e7cc55; }
#dotToi .dtO.bc { background: #3a2a1a; color: #f3e7cc; font-size: 15px; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; }
#dotToi .dtO.boss { background: #b13e53; color: #f3e7cc; font-size: 12px; }
#dotToiPop { position: fixed; z-index: 60; max-width: min(340px, 92vw); padding: 8px 10px; background: rgba(27,18,11,.96); border: 2px solid #c4913f; color: #f3e7cc; font-size: 13px; line-height: 1.35; pointer-events: none; }
#dotToiPop.hide { display: none; }
#dotToiPop b { color: #f0c45c; }
@media (max-width: 700px) { #dotToi .dtL { display: none; } #dotToi { margin: 0; } } /* điện thoại: biểu tượng nằm trong hàng cạnh Xu/Máu/Vòng (không nổi ở góc: nút cao 44px nổi đè xuống nút ⏸ ở dòng dưới) */

/* ---- Việc 6 (kiểm tra giao diện): màn hẹp (máy tính bảng / điện thoại) thanh trên được xuống dòng và hiện đủ nút.
   Trước đây "max-height + overflow: hidden" ép 1 dòng nên nút Bắt đầu round / Tạm dừng / Cài đặt nằm ngoài màn hình. Bản đồ tự tính số hàng theo chiều cao thanh trên thật. ---- */
@media (max-width: 1100px) {
  body.ui2 #top { flex-wrap: wrap !important; max-height: none !important; overflow: visible !important; row-gap: 2px; }
  body.ui2 #top .sp { display: none; }
}
@media (max-width: 700px) { body.ui2 #topBtns { flex-wrap: wrap; max-width: 100%; } body.ui2 #topBtns button { padding: 0 7px !important; font-size: 12px; min-width: 44px; } } /* điện thoại: nhóm Shop / Tường / Kho / Thông tin không tràn mép phải */
@media (max-width: 1100px) { body.ui2.towerOpen #top { flex-wrap: nowrap !important; max-height: max(48px, 6vh) !important; overflow: hidden !important; } } /* đang mở bảng tower (phủ kín bản đồ): thanh trên thu về 1 dòng như cũ, bảng tower được nhiều chỗ hơn */

/* ---- Thả đồ lên nút (CONFIG.THA_DO): đang kéo thì sáng chỗ thả được; nút Bán đỏ nhạt + chữ "Thả để bán (+xu)" ---- */
/* (05/12) đang cầm / kéo: nút Bán ở Chi tiết ẨN HẲN (lớp anCam do game.js gắn theo CONFIG.THA_DO.chiTietAnKhiCam) — chỉ còn một vùng bán ở thanh "Đang cầm" */
#tDetSell.anCam { display: none !important; }
#tDetHang:has(#tDetSell.anCam) { min-height: 0; }
#tDetHang:has(#tDetSell.anCam):not(:has(#tDetNut > *)) { display: none; }
#tDetSell.nho { white-space: nowrap; }
body.dangKeo #rotSell { background: #f2b0a4 !important; background-image: none !important; border-image: none !important; border-style: solid !important; border-width: 2px !important; color: #5a1208 !important; border-color: #b13e53 !important; box-shadow: 0 0 0 2px #b13e53, 0 0 10px 2px rgba(240,120,100,.75) !important; opacity: 1 !important; font-size: 0 !important; min-width: 44px; min-height: 44px; cursor: copy; }
@media (max-width: 600px), (max-height: 500px) { body.dangKeo #rotSell::after { font-size: 14px !important; } #tDetSell { font-size: 14px !important; } } /* (05/12) điện thoại: chữ "Thả để bán" không nhỏ hơn 14 */
body.dangKeo #rotSell::after { content: attr(data-keo); font-size: 13px; font-weight: bold; }
body.dangKeo #tKho, body.dangKeo #tZ2 .ksec, body.dangKeo #bagwrap { box-shadow: 0 0 0 2px #f0c45c, 0 0 8px 1px rgba(240,196,92,.6) !important; }
body.keoBiKip #bagwrap { box-shadow: none !important; }
body.keoBiKip .vslot { box-shadow: 0 0 0 2px #f0c45c !important; }

/* ---- KHU THÔNG BÁO CHUNG (CONFIG.THONG_BAO): MỘT khu giữa phía trên bản đồ, ngay dưới thanh trên (#top); game.js đặt "top" theo chiều cao thật của #top + cachThanhTrenPx ----
   Bên trong: tối đa toiDaCungLuc khung cuộn giấy .tbMuc (hình khung có sẵn gắn qua config_ui), xếp từ trên xuống. Khu + khung KHÔNG chặn bấm; chỉ nút đóng × bấm được. */
#mapMsg.khuTB { position: fixed !important; left: 50% !important; right: auto !important; bottom: auto !important; transform: translateX(-50%); z-index: 95; pointer-events: none !important; visibility: visible !important;
  display: flex; flex-direction: column; align-items: center; gap: var(--tb-gian, 4px); box-sizing: border-box; width: var(--tb-rong, min(560px, calc(100vw - 16px))); max-width: calc(100vw - 16px);
  margin: 0; padding: 0 !important; background: none !important; border: 0 !important; border-image: none !important; box-shadow: none !important; text-align: center; }
#mapMsg.khuTB.hide { display: none !important; }
#mapMsg .tbMuc { position: relative; pointer-events: none !important; display: flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; width: max-content; max-width: 100%; min-height: 40px; padding: 6px 22px; margin: 0;
  font: bold var(--tb-co, 14px)/1.3 'Segoe UI', system-ui, sans-serif; text-align: center; text-shadow: none; letter-spacing: 0; background-color: #cbb88a; color: var(--tb-mau, #3a1f08); }
#mapMsg .tbMuc .tbC { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; word-break: normal; min-width: 0; }
#mapMsg .tbMuc .tbI { flex: none; font-size: 1.05em; }
#mapMsg .tbMuc.thongtin { --tb-mau: #3a1f08; } #mapMsg .tbMuc.canhbao { --tb-mau: #6b3400; } #mapMsg .tbMuc.loi { --tb-mau: #7a0f0f; } #mapMsg .tbMuc.thanhcong { --tb-mau: #1e4d12; }
#mapMsg .tbMuc.uuTien { box-shadow: 0 0 0 2px #7a0f0f, 0 2px 6px rgba(0,0,0,.45); }
#mapMsg .tbMuc.coX { padding-right: 40px; }
/* nút đóng ×: hình 26px, vùng chạm tàng hình 44px (--tb-cham); là chỗ DUY NHẤT trong khu bắt được bấm */
#mapMsg .tbMuc .tbX { pointer-events: auto !important; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  font: bold 18px/1 'Segoe UI', system-ui, sans-serif; color: #3a1f08; background-color: rgba(255,248,230,.55); border-radius: 3px; cursor: pointer; user-select: none; touch-action: manipulation; }
#mapMsg .tbMuc .tbX::after { content: ''; position: absolute; left: 50%; top: 50%; width: var(--tb-cham, 44px); height: var(--tb-cham, 44px); transform: translate(-50%, -50%); }
#mapMsg .tbMuc .tbX:focus-visible { outline: 2px solid #3a1f08; outline-offset: 2px; }
#mapMsg .tbMuc.ra { animation: tbRa var(--tb-cuon, .18s) ease-out; transform-origin: 50% 50%; }
#mapMsg .tbMuc.vao { animation: tbVao var(--tb-cuon, .18s) ease-in forwards; }
@keyframes tbRa { from { clip-path: inset(0 45% 0 45%); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes tbVao { from { clip-path: inset(0 0 0 0); opacity: 1; } to { clip-path: inset(0 45% 0 45%); opacity: 0; } }
body.ui2.towerOpen #mapMsg.khuTB, body.ui2.focus #mapMsg.khuTB { visibility: visible !important; }
#toast, #relToast, #tNote, #evoNote, #denyTip { display: none !important; } /* kiểu thông báo cũ: chỉ còn giữ chữ (ẩn), hiện bằng khung chung */

/* ===== NHÃN "ĐÁNH QUÁI BAY" (CONFIG.DANH_BAY): tower đánh được trời (do nhân vật hoặc trang bị) + món Rất hiếm đánh bay. Chữ sáng trên nền xanh đậm (tương phản > 7:1); vùng chạm nới rộng tàng hình ~44 px ===== */
.airTag { position: relative; display: inline-flex; align-items: center; gap: 3px; min-height: 26px; padding: 2px 8px; margin: 3px 0 0; box-sizing: border-box; background: #0f2c42; border: 1px solid #7fc8ff; color: #d8f0ff !important; font-size: max(var(--co-min, 12px), 12px) !important; font-weight: 700; font-style: normal; line-height: 1.1; white-space: nowrap; cursor: help; text-shadow: 0 1px 0 #000; vertical-align: middle; }
.airTag::after { content: ''; position: absolute; left: -4px; right: -4px; top: -9px; bottom: -9px; }
.airTag:focus-visible { outline: 2px solid #d8f0ff; outline-offset: 2px; }
.airKey { color: #9fdcff !important; font-weight: 700; }
.iblk.airblk { border-left: 3px solid #7fc8ff; padding-left: 6px; }
#tbox.tcompact .airTag, body.narrow .airTag { min-height: 30px; font-size: max(var(--co-min-dt, 13px), 13px) !important; }

/* ===== BÁN ĐỒ (CONFIG.BAN_DO): nút "Bán tất cả" theo bộ lọc phẩm, hộp hỏi lại, nút / dấu khóa món. Chữ sáng trên nền tối (tương phản > 4,5:1); nút cao >= 44 px ===== */
#banTatCaHang { display: flex; padding: 0 0 4px; flex: none; }
#banTatCaHang .lpn.banTatCaLoc { flex: 1 1 auto; min-height: var(--lph, 44px); padding: 0 10px; border: 2px solid #e0b24a; background: #3a2410; color: #ffe7a8 !important; font-weight: 700; font-size: max(var(--co-min, 12px), 13px); white-space: normal; text-shadow: 0 1px 0 #000; }
#banTatCaHang .lpn.banTatCaLoc:hover, #banTatCaHang .lpn.banTatCaLoc:focus-visible { background: #55361a; }
.banHoi { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: max(var(--co-min, 12px), 14px); color: var(--c-text); }
.banHoi > b { font-size: max(var(--co-min, 12px), 15px); }
.banHoi .banDs { margin: 2px 0 0 18px; padding: 0; }
.banHoi .banDs li { margin: 2px 0; }
.banHoi .banGiu { color: #bfe6a0; }
.banHoi .banCanhBao { color: #ffb3a8; font-weight: 700; border: 1px solid #e0705a; background: rgba(140,30,20,.35); padding: 6px 8px; }
#confirmBtns .banTatCaNut { min-height: 44px; color: #ffe7a8 !important; }
/* nhấn giữ để bán (Cực phẩm): lớp phủ đỏ chạy từ trái sang phải trong giuNutMs; nằm giữa khung nút và chữ (isolation) */
#confirmBtns .banTatCaNut.giuDeBan { position: relative; isolation: isolate; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#confirmBtns .banTatCaNut.giuDeBan::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(224,90,70,.7); z-index: -1; pointer-events: none; }
#confirmBtns .banTatCaNut.giuDeBan.dangGiu::before { animation: giuBan var(--giu-ms, 1000ms) linear forwards; }
@keyframes giuBan { from { width: 0; } to { width: 100%; } }
.khoaNut { display: inline-flex; align-items: center; justify-content: center; min-height: var(--kh, 44px); margin-top: 6px; padding: 0 12px; font-size: max(var(--co-min, 12px), 13px); }
.khoaNut.on { border-color: #e0b24a; color: #ffe7a8 !important; }
.slot.item .khoaTag { position: absolute; left: 1px; bottom: 1px; z-index: 3; font-size: 12px; line-height: 1; padding: 1px 2px; background: rgba(12,8,5,.85); border-radius: 2px; pointer-events: none; }
@media (max-width: 600px) { .banHoi, .banHoi > b, .khoaNut, #banTatCaHang .lpn.banTatCaLoc { font-size: max(var(--co-min-dt, 13px), 14px) !important; } }

/* ===== MÀN CHI TIẾT TOWER – TỐI ƯU (04/12, CONFIG.MAN_TOWER) ===== */
/* A1. bỏ dòng "HÒM ĐỒ …" + dãy lọc ở hòm đồ (hòm đồ lên sát trên, to hơn) */
#tBagHead.hide, #locHom.hide { display: none !important; }
/* A1. nút "?" cạnh tiêu đề ĐANG ĐEO + hộp gợi ý */
#tZ1 { position: relative; }
#tZ1Title { display: flex; align-items: center; gap: 6px; }
.goiYNut { position: relative; width: 22px; height: 22px; min-height: 0 !important; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 13px !important; font-weight: 700; line-height: 1; color: #ffe7a8 !important; border-radius: 50%; cursor: help; }
.goiYNut::after { content: ''; position: absolute; inset: -11px; } /* vùng chạm ~44 px */
.goiYNut.mo { outline: 2px solid #f4d98c; }
#tGoiYHop { position: absolute; left: 8px; right: 8px; top: 34px; z-index: 30; padding: 8px 10px; background: #1a120b; border: 2px solid #c4913f; box-shadow: 0 4px 12px rgba(0,0,0,.6); color: var(--c-text); font-size: max(var(--co-min, 12px), 13px); line-height: 1.35; }
#tGoiYHop b { color: var(--c-gold-l); }
#tGoiYHop ul { margin: 4px 0 0 16px; padding: 0; }
#tGoiYHop li { margin: 2px 0; }
/* A3. Nội lực + nút Tự động dung hợp: MỘT hàng, cùng chiều cao; số "8/20" ngay cạnh thanh; ô phím "U" (ẩn trên cảm ứng) */
#nlRow { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; min-height: 28px; flex-wrap: nowrap; }
#nlRow #nlBar { flex: 1 1 auto; min-width: 0; margin: 0; flex-wrap: nowrap; gap: 6px; }
#nlRow #nlBar .nlT { flex: 1 1 60px; min-width: 30px; }
#nlRow #nlBar .nlM { display: none; } /* chữ "+N Nội lực" khi kéo: đã có màu trên thanh và số "a → b" */
#btnAutoFuse { position: relative; min-height: 28px !important; height: 28px; min-width: 0 !important; padding: 0 8px !important; gap: 5px; font-size: max(var(--co-min, 12px), 12px) !important; }
#btnAutoFuse .afi { font-size: 15px; }
#btnAutoFuse kbd.afk { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 3px; font: 700 11px/1 var(--font, monospace); color: #1a120b !important; background: #e8d9b8; border: 1px solid #fff4d6; border-bottom-width: 3px; border-bottom-color: #8a7350; border-radius: 3px; opacity: 1 !important; }
@media (hover: none) and (pointer: coarse) { #btnAutoFuse kbd.afk { display: none !important; } }
#tbox.tcompact #btnAutoFuse { height: 32px; min-height: 32px !important; padding: 0 10px !important; }
#tbox.tcompact #btnAutoFuse::after { content: ''; position: absolute; left: -2px; right: -2px; top: -6px; bottom: -6px; } /* điện thoại: vùng chạm 44 px */
#tbox.tcompact #nlRow #nlBar .nlT { min-width: 24px; }
/* B4. KHO GỘP: một khu, một lưới cuộn; dòng ngăn "Bí kíp" / "Đồ" */
#tZ2 #tKho .ksec#tKhoSec { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#tKhoCuon { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 4px; }
#tKhoCuon .kgrid { overflow: visible !important; min-height: 0; }
#tKhoCuon #tKhoMwrap, #tKhoCuon #tKhoIwrap { flex: none !important; }
#tKhoCuon .khoNgan { font-size: max(var(--co-min, 12px), 12px); color: var(--c-gold-l); font-weight: 700; letter-spacing: .3px; padding: 2px 0; margin: 2px 0 3px; border-bottom: 1px solid rgba(196,145,63,.35); text-shadow: var(--bong-chu, 0 1px 0 #000); }
#tKhoCuon .khoTrong { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; color: var(--c-text-dim); font-size: max(var(--co-min, 12px), 13px); text-align: center; text-shadow: var(--bong-chu); }
#tKhoCuon .khoTrong i { font-style: normal; font-size: 24px; line-height: 1; }
#tKhoCuon > .hide, #tKhoCuon .hide { display: none !important; }
/* B5. nút lọc Kho thấp 50% (22 px), một hàng, không cuộn ngang (chật thì xuống 2 hàng); điện thoại: vùng chạm vô hình >= 44 px */
.locPham.khoLoc { flex-wrap: wrap; overflow: visible !important; gap: var(--lgap, 3px); padding: 2px 0 4px; row-gap: var(--lgap, 3px); }
.locPham.khoLoc .lpn { position: relative; flex: 1 1 auto; min-height: var(--lph, 22px) !important; height: var(--lph, 22px); padding: 0 5px !important; font-size: max(var(--co-min, 12px), var(--lco, 12px)) !important; line-height: 1; border-width: 2px; }
#tbox.tcompact .locPham.khoLoc .lpn, body.narrow .locPham.khoLoc .lpn { font-size: max(var(--co-min-dt, 13px), var(--lcodt, 14px)) !important; }
#tbox.tcompact .locPham.khoLoc .lpn.h1::after { content: ''; position: absolute; left: 0; right: 0; top: calc((var(--lph, 22px) - var(--lcham, 44px)) / 2); bottom: calc((var(--lph, 22px) - var(--lcham, 44px)) / 2); }
#tbox.tcompact .locPham.khoLoc .lpn.hTren::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--lph, 22px) - var(--lcham, 44px)); }
#tbox.tcompact .locPham.khoLoc .lpn.hDuoi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--lph, 22px) - var(--lcham, 44px)); }
#tbox.tcompact .locPham.khoLoc[data-hang="1"] { margin: 11px 0; } /* điện thoại, 1 hàng: chừa chỗ cho vùng chạm vô hình trên / dưới */
#tbox.tcompact .locPham.khoLoc[data-hang="2"] { margin: 22px 0 22px; row-gap: 0; }
.locPham.khoLoc.luoi3 { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.locPham.khoLoc.luoi3 .lpn { width: 100%; min-width: 0; overflow: hidden; text-overflow: clip; }
.locPham.khoLoc .lpn.on { box-shadow: 0 0 0 1px #fff4d6 inset; }

/* ===== BỐ CỤC TRÀN (CONFIG.MAPSIZE.boCucTran): bỏ hai cột, bản đồ tràn ngang; thanh dưới = mảnh tường + đại hiệp trong kho ===== */
body.ui2.tran #sideL, body.ui2.tran #sideR, body.ui2.tran #colL, body.ui2.tran #wallFloat, body.ui2.tran #wallDrawerBox { display: none !important; }
#thanhDuoi.hide { display: none !important; }
body.ui2.tran #thanhDuoi { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tdH, 64px); z-index: 40; display: flex; align-items: center; gap: 8px; padding: 0 6px; box-sizing: border-box; background: var(--c-surface-d, #241910); border-top: 3px solid var(--c-bronze, #8a5a2b); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
#tdTuong { flex: 0 0 auto; display: flex; align-items: center; min-width: 0; height: 100%; }
#tdTuong.trong #wallTray, #tdTuong.trong #wallHint { display: none !important; }
#tdTuong #wallBlock { flex-direction: row; align-items: center; gap: 4px; padding: 0; max-height: none; border: 0; }
#tdTuong #wallBlock .wbHd { min-height: 0; flex-direction: column; align-items: flex-start; gap: 0; }
#tdTuong #wallBlock .wbHd .wbT, #tdTuong #wbFold { display: none !important; }
#tdTuong #wallTotal { font-size: 12px; white-space: nowrap; }
#tdTuong #wallTray { display: flex; flex-wrap: nowrap; gap: 4px; min-height: 44px; overflow: visible; }
#tdTuong #wallTray .wp { flex: none; min-width: 44px; min-height: 44px; }
#tdTuong .wbRow { flex-wrap: nowrap; gap: 4px; }
#tdTuong .wbRow button { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 0 6px; }
#tdTuong #wallHint { font-size: 12px; line-height: 1.25; max-width: 150px; white-space: normal; }
#tdKho { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; height: 100%; padding-left: 8px; border-left: 2px solid var(--c-line-d, #5a3d22); }
#tdKho.trong { flex: 0 0 auto; }
#tdKho.trong #tdKhoDs, #tdKho.trong #tdHuongDan { display: none; }
#tdKho .tdNhan { flex: none; font-size: 12px; color: var(--c-gold, #f0c45c); white-space: nowrap; max-width: 90px; white-space: normal; line-height: 1.2; }
#tdKhoDs { flex: 0 1 auto; display: flex; gap: 4px; min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.tdTw { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 56px; min-height: 44px; height: calc(var(--tdH, 64px) - 9px); padding: 0 4px; font-size: 12px; line-height: 1.1; overflow: hidden; cursor: pointer; } .tdTw canvas { flex: none; }
.tdTw span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
.tdTw.on { outline: 2px solid var(--c-gold, #f0c45c); outline-offset: -2px; background: #5a3d22; }
#tdHuongDan { flex: 0 1 auto; min-width: 0; font-size: 12px; color: #f4d98c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tdHuongDan:empty { display: none; }
body.ui2.tran #drawer { bottom: var(--tdH, 64px); }
body.ui2.tran .fpop { bottom: calc(var(--tdH, 64px) + 8px); }
body.ui2.tran #statsPop { left: auto; right: 0; bottom: var(--tdH, 64px); top: auto; width: min(400px, 94vw); max-height: calc(100vh - var(--tdH, 64px) - 64px); border-right: 0; } /* ngăn kéo bên phải */
body.ui2.tran #topBtns button { min-height: 44px; font-size: 13px; }
body.ui2.tran #topBtns #btnInfo b, body.ui2.tran #topBtns #btnKho b { font-weight: 700; color: #f4d98c; }
@media (max-width: 700px) {
  body.ui2.tran #thanhDuoi { gap: 6px; }
  body.ui2.tran #thanhDuoi, .tdTw, #tdKho .tdNhan, #tdHuongDan, #tdTuong #wallTotal, #tdTuong #wallHint { font-size: 14px; }
  #tdTuong #wallHint { display: none !important; }
  body.ui2.tran #topBtns .lbl { display: none; }
  body.ui2.tran #topBtns button { font-size: 14px !important; }
  body.ui2.tran #statsPop { left: 0; right: 0; width: auto; max-height: 60vh; } /* điện thoại: ngăn kéo từ dưới lên */
}body.ui2.tran #stage, body.ui2.tran #mid, body.ui2.tran #wrap { background: #23381c; } /* vài px lẻ hai mép (canvas làm tròn theo điểm ảnh logic): cùng màu cỏ tối ở mép, không dải đen */
#btnThem { display: none; }
@media (max-width: 1100px) { body.ui2.tran #topBtns .lbl { display: none; } body.ui2.tran #top .tbar { display: none; } }
@media (max-width: 1000px) {
  body.ui2.tran #topBtns { position: relative; }
  body.ui2.tran #btnThem { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; font-size: 18px; }
  body.ui2.tran #topBtns:not(.mo) #btnKho, body.ui2.tran #topBtns:not(.mo) #btnStats, body.ui2.tran #topBtns:not(.mo) #btnSettings { display: none !important; }
  body.ui2.tran #topBtns.mo #btnKho, body.ui2.tran #topBtns.mo #btnStats, body.ui2.tran #topBtns.mo #btnSettings { position: absolute !important; right: 0; z-index: 60; min-width: 150px; justify-content: flex-start; }
  body.ui2.tran #topBtns.mo #btnKho { top: calc(100% + 4px); } body.ui2.tran #topBtns.mo #btnStats { top: calc(100% + 52px); } body.ui2.tran #topBtns.mo #btnSettings { top: calc(100% + 100px); width: 150px; } body.ui2.tran #topBtns.mo #btnSettings::after { content: " Cài đặt"; font-size: 13px; }
  body.ui2.tran #topBtns.mo #btnKho .lbl, body.ui2.tran #topBtns.mo #btnStats .lbl { display: inline; }
}
@media (max-width: 1000px) { body.ui2.tran #btnInfo .dai { display: none; } body.ui2.tran #top { column-gap: 4px; } body.ui2.tran #topBtns button { padding: 0 6px !important; } body.ui2.tran #btnStart { padding-left: 8px; padding-right: 8px; } }

/* ===== MENU TẠM DỪNG (CONFIG.MENU_TAM_DUNG): nền mờ tối, khung tpanel sẵn có giữa màn hình, nút to (>= 44px), chữ trắng ===== */
#pauseMenu { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 12px; box-sizing: border-box; }
#pauseMenu.hide { display: none !important; }
#pmBox { position: relative; width: min(var(--pm-rong, 360px), 94vw); max-height: 92vh; overflow-y: auto; box-sizing: border-box; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; background-color: #1d140c; color: #fff; }
#pmBox .pmHd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#pmBox .pmHd b { color: #ffe7a8; font-size: max(var(--co-min, 12px), 16px); letter-spacing: .5px; text-shadow: 0 1px 0 #000; }
#pmBox #pmX { position: relative; width: var(--pm-x, 36px); height: var(--pm-x, 36px); min-height: 0; flex: none; padding: 0; font-size: 18px; color: #fff !important; }
#pmBox #pmX::after { content: ''; position: absolute; inset: -4px; } /* vùng chạm ~44 px */
#pmBox .pmNut { display: flex; flex-direction: column; gap: 10px; }
#pmBox .pmNut.hai { flex-direction: row; } #pmBox .pmNut.hai .pmChon { flex: 1 1 0; }
#pmBox .pmChon { min-height: var(--pm-nut, 52px); font-size: max(var(--co-min, 12px), var(--pm-co, 16px)) !important; color: #fff !important; text-shadow: 0 1px 0 #000 !important; font-weight: 700; padding: 0 14px; }
#pmBox .pmChon.gold { color: #2a1a0d !important; text-shadow: none !important; }
#pmBox .pmChon.nho { min-height: 44px; }
#pmBox .pmChon:focus-visible, #pmBox input:focus-visible { outline: 2px solid #ffe7a8; outline-offset: 2px; }
#pmBox .pmAm { display: flex; flex-direction: column; gap: 10px; font-size: max(var(--co-min, 12px), 15px); color: #fff; }
#pmBox .pmAm label { color: #fff; }
#pmBox .pmBat { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
#pmBox .pmBat input { width: 22px; height: 22px; }
#pmBox input[type=range] { width: 100%; min-height: 32px; }
#pmBox .pmGhiChu { color: #d9c9a8; font-size: max(var(--co-min, 12px), 13px); }
#pmBox .pmHoi { color: #fff; font-size: max(var(--co-min, 12px), 16px); line-height: 1.4; }
@media (max-width: 600px) { #pmBox .pmChon { font-size: max(var(--co-min-dt, 13px), var(--pm-codt, 16px), 14px) !important; } #pmBox .pmAm, #pmBox .pmHoi { font-size: max(var(--co-min-dt, 13px), 15px); } #pmBox .pmGhiChu { font-size: 14px; } }
body.ui2.tran #stage, body.ui2.tran #mid { overflow: hidden; } body.ui2.tran #wrap { display: flex; justify-content: center; overflow: visible; } body.ui2.tran #cv { flex: none; } /* nền rộng hơn màn vài px: căn giữa, phần thừa bị cắt, không có thanh cuộn */

/* ===== HỘP CHỌN NHÁNH TIẾN HÓA (js/tienhoa2.js, CONFIG.TIEN_HOA_2.nhanh) ===== */
#hopNhanh { left: 50%; right: auto; transform: translateX(-50%); width: min(760px, 96vw); max-height: var(--hn-cao, 50vh); display: flex; flex-direction: column; z-index: 58; font-size: var(--hn-co, 14px); }
#hopNhanh.hide { display: none; }
#hopNhanh .fpbody { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
#hopNhanh .hnGhi { color: #ffd27a; font-size: 13px; }
#hopNhanh .hnDs { display: flex; gap: 8px; }
#hopNhanh .hnThe { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--hn-mau, #ffd75e); background: rgba(20,13,8,.55); }
#hopNhanh .hnDau { display: flex; align-items: center; gap: 6px; }
#hopNhanh .hnLoai { color: var(--hn-mau, #ffd75e); font-size: 15px; }
#hopNhanh .hnChung { color: #f4e4c1; }
#hopNhanh .hnTk { color: #e8d8b8; line-height: 1.35; }
#hopNhanh .hnChon { min-height: var(--hn-nut, 48px); font-size: 15px; font-weight: 700; margin-top: auto; border-color: var(--hn-mau, #ffd75e); cursor: pointer; }
#hopNhanh .hnSau { min-height: 44px; align-self: center; padding: 0 16px; font-size: 13px; cursor: pointer; }
#hopNhanh .hnDong { min-width: 44px; min-height: 44px; }
.hnIc { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.hnCham { display: inline-block; width: 14px; height: 14px; border: 2px solid #1a1c2c; }
.thNhanh { margin: 6px 0; padding: 6px 8px; border-left: 4px solid var(--hn-mau, #c9a25a); background: rgba(20,13,8,.35); font-size: 13px; line-height: 1.4; }
.thNhanh .hnIc { width: 24px; height: 24px; vertical-align: middle; }
.thNhanh.cho { border-left-color: #ffd27a; }
.thNhanh .thChonNhanh { min-height: 44px; padding: 0 12px; margin-left: 6px; font-weight: 700; cursor: pointer; }
@media (max-width: 700px) {
  #hopNhanh { font-size: var(--hn-codt, 15px); max-height: var(--hn-cao, 50vh); }
  #hopNhanh .hnDs { flex-direction: column; }
  #hopNhanh .hnGhi, .thNhanh { font-size: 14px; }
}
/* ===== HỘP CHỌN BÍ KÍP TRUYỀN THỪA (thủ lĩnh vòng 10, 20, 30...: js/tienhoa2.js moHopTT, CONFIG.TIEN_HOA_2.truyenThua). Chữ từ 14 px, nút từ 44 px, không che quá nửa màn hình ===== */
#hopTruyenThua { left: 50%; right: auto; transform: translateX(-50%); width: min(820px, 96vw); max-height: var(--hn-cao, 50vh); display: flex; flex-direction: column; z-index: 59; font-size: max(14px, var(--hn-co, 14px)); }
#hopTruyenThua.hide { display: none; }
#hopTruyenThua .fphd b { font-size: 15px; }
#hopTruyenThua .fpbody { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; }
#hopTruyenThua .hnChan { flex: none; display: flex; justify-content: center; padding: 4px 0 2px; border-top: 1px solid rgba(255,215,94,.25); }
#hopTruyenThua .hnGhi { color: #ffd27a; font-size: 14px; }
#hopTruyenThua .hnDs { display: flex; gap: 8px; }
#hopTruyenThua .hnThe { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--hn-mau, #ffd75e); background: rgba(20,13,8,.55); }
#hopTruyenThua .hnLoai { color: var(--hn-mau, #ffd75e); font-size: 16px; }
#hopTruyenThua .hnDau { display: flex; align-items: center; gap: 8px; } /* hình riêng bí kíp truyền thừa bên trái tên (04/12/2026) */
#hopTruyenThua .hnBk { flex: none; line-height: 0; }
#hopTruyenThua .hnBk canvas { image-rendering: pixelated; }
#hopTruyenThua .hnChung { color: #f4e4c1; }
#hopTruyenThua .hnTk { color: #e8d8b8; line-height: 1.35; }
#hopTruyenThua .hnThieu { color: #f4c9a8; line-height: 1.35; }
#hopTruyenThua .hnThieu ul { margin: 2px 0 0; padding-left: 18px; }
#hopTruyenThua .hnDu { color: #9be38f; }
#hopTruyenThua .hnChon { min-height: var(--hn-nut, 48px); font-size: 15px; font-weight: 700; margin-top: auto; border-color: var(--hn-mau, #ffd75e); cursor: pointer; }
#hopTruyenThua .hnSau { min-height: 44px; align-self: center; padding: 0 16px; font-size: 14px; cursor: pointer; }
#hopTruyenThua .hnDong { min-width: 44px; min-height: 44px; }
#nutTruyenThua { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 57; min-height: var(--hn-nut, 48px); padding: 0 16px; font-size: 15px; font-weight: 700; color: #ffe9a8; background: #5a3c08; border: 2px solid #ffd75e; cursor: pointer; max-width: 92vw; }
#nutTruyenThua.hide { display: none; }
body.ui2.tran #nutTruyenThua { bottom: calc(var(--tdH, 64px) + 8px); } /* nằm trên thanh đại hiệp dưới cùng, không che */
@media (max-height: 500px) { /* điện thoại xoay ngang: bớt dòng ghi chú để còn chỗ cho thẻ bí kíp */
  #hopTruyenThua .hnGhi { display: none; }
  #hopTruyenThua .fphd { padding-top: 0; padding-bottom: 0; min-height: 0; }
  #hopTruyenThua .hnDong { display: none; } /* nút ✕ trùng việc với nút "Chọn sau" ở chân hộp: ẩn khi màn thấp */
  #hopTruyenThua .hnThe { padding: 4px 8px; gap: 2px; }
}
.thNguon { color: #ffd27a; }
@media (max-width: 700px) {
  #hopTruyenThua { font-size: max(14px, var(--hn-codt, 15px)); }
  #hopTruyenThua .hnDs { flex-direction: column; }
}
/* Chí mạng: nhãn "Tối đa" và dòng phần dư đổi thành sát thương chí mạng (màu vàng nhạt trên nền tối, tương phản trên 4,5) */
#tStats .cmmax { display:inline-block; font-size:12px; padding:0 5px; margin-left:4px; border-radius:3px; background:#5a3c08; color:#ffe9a8; font-weight:bold; }
#tStats .cmdu { font-size:12px; padding:3px 4px; color:#f4d98c; border-bottom:1px solid rgba(255,255,255,.08); }
@media (pointer: coarse), (max-width: 760px) {
  #tStats .srow { min-height:44px; align-items:center; font-size:14px; }
  #tStats .cmmax, #tStats .cmdu { font-size:14px; }
}
@media (pointer: coarse), (max-width: 760px) {
  /* bảng giải thích nổi (chạm vào dòng chỉ số): chữ tối thiểu 14px trên điện thoại */
  #tip .itl, #tip .irow { font-size:14px; }
}

/* ===== (04/12) KHUNG CHI TIẾT: dòng bản mệnh + hàng nút góc trên bên phải + bảng so sánh (CONFIG.CHI_TIET_NUT) ===== */
.ihd .cpdau { margin: 3px 0 2px; line-height: 1.35; }
.ihd .cpdau b { font-size: 13px; }
.ihd .cpcomat { display: inline-block; font-size: 12px; padding: 0 5px; border: 1px solid; border-radius: 3px; white-space: nowrap; }
#tDetHd { flex-wrap: wrap; row-gap: 4px; }
#tDetHang { display: flex; gap: 4px; margin-left: auto; justify-content: flex-end; align-items: stretch; min-width: 0; }
#tDetHang:has(#tDetSell.nho) { flex: 1 1 100%; min-height: 58px; } /* hàng nút luôn nằm dòng riêng, cao cố định: đổi món không làm khung Chi tiết nhảy chiều cao */ /* có nút Tôi luyện / Nâng cấp: cả hàng nút xuống dòng riêng ngay dưới chữ CHI TIẾT, dồn sang phải */
#tDetNut { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
#tDetNut:empty { display: none; }
#tDetHang #tDetSell { margin-left: 0; }
#tDetNut .ctnut { min-width: 44px; padding: 2px 5px; border-width: 2px; border-style: solid; font-weight: bold; white-space: normal; line-height: 1.2; cursor: pointer; touch-action: manipulation; flex: 1 1 0; max-width: 190px; }
#tDetNut .ctnut .ctn1, #tDetNut .ctnut .ctn2 { display: block; }
#tDetNut .ctnut .ctn2 { font-weight: normal; }
#tDetNut .ctnut.ncnut { border-color: #f4d98c; }
#tDetNut .ctnut.mo { opacity: 1; color: #c2b8a3; border-style: dashed; filter: grayscale(.6); cursor: not-allowed; } /* mờ nhưng chữ vẫn đủ tương phản */
#tDetSell.nho { padding: 2px 6px; font-weight: normal; white-space: normal; line-height: 1.2; flex: none; }
#tDetSell.nho .ctn1, #tDetSell.nho .ctn2 { display: block; }
.ctss { position: fixed; z-index: 9000; pointer-events: none; background: #1f1a14; color: #efe6d2; border: 2px solid #8a6d3b; box-shadow: 0 4px 14px rgba(0,0,0,.6); padding: 6px 8px; line-height: 1.4; }
.ctss.hide { display: none; }
.ctss .sstd { font-weight: bold; color: #f4d98c; margin-bottom: 3px; }
.ctss .ssr { margin: 1px 0; }
.ctss .dim { color: #c2b8a3; }
.ctss .ssthieu { font-weight: bold; }
.tlhang .tlgoi { margin-bottom: 2px; }
@media (max-width: 600px) { .ihd .cpdau b { font-size: 14px; } .ihd .cpcomat { font-size: 14px; } }
#btnInfo .ptcb { color: #ffb37a; font-weight: bold; white-space: nowrap; } /* (04/12) Đợt tới: vòng sau thủ lĩnh phá tường */
#tDetHd .dtag { line-height: 18px; } #tDetHd .dtag:empty { display: inline-block; visibility: hidden; width: 0; padding: 0; border-width: 1px 0; } #tDetHd .dtag:empty::before { content: '\00a0'; } /* (04/12) nhãn trống vẫn giữ chỗ: dòng CHI TIẾT không đổi chiều cao */

/* bảng điều kiện tiến hóa lần 2 (js/tienhoa2.js) */
.thLan2 { margin: 6px 0; padding: 6px 8px; border-left: 4px solid #8a6a3a; background: rgba(20,13,8,.35); font-size: 13px; line-height: 1.4; }
.thLan2.xong { border-left-color: #ffd75e; color: #ffe9a8; }
.thLan2 ul { list-style: none; margin: 4px 0 0; padding: 0; }
.thLan2 li { display: flex; gap: 6px; padding: 2px 0; }
.thLan2 li .dau { flex: none; width: 16px; text-align: center; font-weight: 700; }
.thLan2 li.ok { color: #b8f5a0; } .thLan2 li.ok .dau { color: #62d26f; }
.thLan2 li.chua { color: #c9bfae; } .thLan2 li.chua .dau { color: #8a8070; }
@media (max-width: 700px) { .thLan2 { font-size: 14px; } }
