/* Túi đồ & Đan Lô dùng icon vẽ mới (web/js/dan_phuong.js) */
.dp-slot img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8)); }
/* viền ô theo phẩm 2.0: Trắng · Lục · Lam · Tím · Cam */
.item-slot.r-0 { --q: #94a3b8; }
.item-slot.r-1 { --q: #22c55e; }
.item-slot.r-2 { --q: #0284c7; }
.item-slot.r-3 { --q: #a855f7; }
.item-slot.r-4 { --q: #f97316; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(249, 115, 22, 0.45), 0 0 6px rgba(249, 115, 22, 0.55); }

.dp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: #e7d9b8;
}
.dp-head img { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.dp-head b { color: var(--gold-soft); }
.dp-mua { margin-left: auto; padding: 4px 10px; font-size: 11.5px; }

.dp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dp-tabs button { padding: 5px 11px; font-size: 12px; }
.dp-tabs button i { font-style: normal; opacity: 0.7; font-size: 10.5px; }

.dp-nhom { font-size: 12.5px; font-weight: 800; color: var(--gold-soft); margin: 12px 0 6px; }
.dp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(40, 24, 11, 0.9), rgba(20, 12, 5, 0.92));
  border: 1px solid #5c3a14;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 7px;
}
.dp-row.khoa { opacity: 0.6; }
.dp-row.khoa .item-slot { filter: grayscale(0.8); }
.dp-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dp-row-ten { font-size: 13px; font-weight: 800; color: #fde047; }
.dp-row-ghi { font-size: 11px; color: var(--text-muted); line-height: 1.35; }
.dp-row > button { flex: none; }

.dp-pham { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; vertical-align: middle; }
.dp-pham.p0 { color: #e7d9b8; background: rgba(214, 185, 138, 0.18); }
.dp-pham.p1 { color: #4ade80; background: rgba(74, 222, 128, 0.15); }
.dp-pham.p2 { color: #c084fc; background: rgba(192, 132, 252, 0.15); }
.dp-pham.p3 { color: #fb923c; background: rgba(251, 146, 60, 0.18); }

.dp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dp-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #e7d9b8;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(146, 64, 14, 0.6);
  border-radius: 12px;
  padding: 1px 7px 1px 2px;
}
.dp-chip img { width: 20px; height: 20px; object-fit: contain; }
.dp-chip b { color: #4ade80; }
.dp-chip.thieu b { color: #f87171; }

@media (max-width: 560px) {
  .dp-row { flex-wrap: wrap; }
  .dp-row > button { width: 100%; }
}

/* ==================== TÚI ĐỒ THEO BẢN 2.0 (#backpack-modal, p311) ==================== */
.tui2 {
  --wx-gold: #e8c46a; --wx-gold-hi: #f6d77b; --wx-gold-dim: #a77b2c; --wx-bronze: #6b4318;
  --wx-text: #efe3c4; --wx-muted: #bba77d; --wx-panel-2: rgba(12, 7, 3, 0.78);
  color: var(--wx-text);
}
.tui2-body { display: flex; gap: 8px; align-items: stretch; }
.tui2-trai {
  flex: 0 0 256px;
  background: var(--wx-panel-2);
  border: 1px solid var(--wx-bronze);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}
.tui2-giua { flex: 0 0 70px; display: flex; flex-direction: column; gap: 6px; }
.tui2-giua button {
  flex: 1 1 0;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  background: linear-gradient(180deg, #2a180a, #140b04);
  border: 1px solid var(--wx-bronze);
  border-radius: 8px;
  color: #f1e3bf;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.tui2-giua button:hover { border-color: var(--wx-gold); }
.tui2-giua img { width: 30px; height: 30px; object-fit: contain; }
.tui2-phai {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--wx-panel-2);
  border: 1px solid var(--wx-bronze);
  border-radius: 10px;
}

/* tab túi + ô chọn sắp xếp */
.tui2-tabs { display: flex; gap: 3px; margin-bottom: 8px; align-items: stretch; }
.tui2-tab {
  flex: 1 1 auto;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 4px;
  border-radius: 7px;
  background: linear-gradient(180deg, #3a210d, #1f1107);
  border: 1px solid var(--wx-bronze);
  color: #d9c79c;
  text-shadow: 0 1px 0 #000;
  cursor: pointer;
  white-space: nowrap;
}
.tui2-tab.active {
  background: linear-gradient(180deg, #8a2a12, #4a1307);
  color: #fde68a;
  border-color: var(--wx-gold);
  box-shadow: 0 0 10px rgba(232, 196, 106, 0.3), inset 0 1px 0 rgba(255, 230, 160, 0.2);
}
.tui2-sort {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  color: #efe3c4;
  background: #1f1107;
  border: 1px solid var(--wx-bronze);
  border-radius: 7px;
  padding: 0 4px;
}

/* lưới ô: 54px như 2.0, 5 hàng nhìn thấy, cuộn dọc */
.tui2-luoi {
  display: grid;
  grid-template-columns: repeat(auto-fill, 54px);
  grid-auto-rows: 54px;
  gap: 6px;
  justify-content: center;
  align-content: start;
  max-height: 306px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}
.tui2-slot {
  position: relative;
  width: 54px;
  height: 54px;
  box-sizing: border-box;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 38%, #2a190c 0%, #120a04 80%);
  border: 1px solid #5f4019;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tui2-slot.trong { cursor: default; }
.tui2-slot img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8)); pointer-events: none; }
.tui2-slot.q0 { border: 2px solid #94a3b8; }
.tui2-slot.q1 { border: 2px solid #22c55e; box-shadow: inset 0 0 6px rgba(34, 197, 94, 0.45); }
.tui2-slot.q2 { border: 2px solid #0284c7; box-shadow: inset 0 0 7px rgba(2, 132, 199, 0.55); }
.tui2-slot.q3 { border: 2px solid #a855f7; box-shadow: 0 0 5px rgba(168, 85, 247, 0.5), inset 0 0 6px rgba(168, 85, 247, 0.45); }
.tui2-slot.q4 { border: 2px solid #f97316; box-shadow: 0 0 6px rgba(249, 115, 22, 0.6), inset 0 0 7px rgba(249, 115, 22, 0.5); }
.tui2-slot:not(.trong):hover { border-color: var(--wx-gold); }
.tui2-slot.chon { border-color: var(--wx-gold-hi); box-shadow: 0 0 10px rgba(246, 215, 123, 0.6), inset 0 0 8px rgba(0, 0, 0, 0.8); }
.tui2-sl {
  position: absolute;
  right: 4px;
  bottom: 1px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 2px #000;
}

/* khung trang bị quanh nhân vật (lưới 4×5, nhân vật chiếm 2 cột × 3 hàng giữa) */
.tui2-tb { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tui2-tb-luoi { display: grid; grid-template-columns: repeat(4, 54px); grid-template-rows: repeat(5, 54px); gap: 6px; }
.tui2-tb-o {
  border-radius: 7px;
  background: radial-gradient(circle at 50% 40%, #241509 0%, #0e0703 85%);
  border: 1px solid #5f4019;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.tui2-tb-o span { font-size: 9.5px; font-weight: 700; color: rgba(187, 167, 125, 0.45); line-height: 1.1; }
.tui2-tb-giua {
  grid-column: 2 / 4;
  grid-row: 2 / 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 72%, rgba(232, 196, 106, 0.18), transparent 62%);
}
.tui2-nv {
  width: 110px;
  height: 150px;
  background-repeat: no-repeat;
  background-position: var(--x0) var(--y0);
  animation-name: tui2-nv;
  animation-iteration-count: infinite;
}
@keyframes tui2-nv { from { background-position: var(--x0) var(--y0); } to { background-position: var(--x1) var(--y0); } }
.tui2-tb-ten { font-size: 12px; font-weight: 800; color: #fde68a; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.tui2-tb-cg { font-size: 10.5px; color: var(--wx-muted); white-space: nowrap; }
.tui2-tb-dg { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: #f9a8d4; }
.tui2-tb-dg b { font-size: 19px; color: #f0abfc; text-shadow: 0 0 8px rgba(240, 171, 252, 0.35); }
.tui2-tb-kiem { font-size: 11.5px; color: var(--wx-muted); }
.tui2-tb-kiem b { color: #38bdf8; }
.tui2-buffs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.tui2-buffs span { font-size: 10.5px; color: #fde68a; background: rgba(120, 53, 15, 0.45); border: 1px solid #92400e; border-radius: 10px; padding: 1px 7px; }

/* bảng chi tiết "Vật Phẩm" (p311) */
.tui2-ct { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.tui2-ct-hd {
  position: relative;
  text-align: center;
  font-family: "Playfair Display", "Palatino Linotype","Times New Roman", serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--wx-gold-hi);
  padding: 4px 30px 8px;
  border-bottom: 1px solid rgba(232, 196, 106, 0.28);
}
.tui2-ct-hd button {
  position: absolute;
  right: 0;
  top: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
}
.tui2-ct-top {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(232, 196, 106, 0.28);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}
.tui2-o {
  flex: none;
  width: 52px;
  height: 52px;
  box-sizing: border-box;
  border-radius: 7px;
  border: 2px solid #94a3b8;
  background: radial-gradient(circle, rgba(43, 33, 22, 0.9), rgba(12, 9, 6, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
}
.tui2-o img { width: 42px; height: 42px; object-fit: contain; }
.tui2-o.q1 { border-color: #22c55e; }
.tui2-o.q2 { border-color: #0284c7; }
.tui2-o.q3 { border-color: #a855f7; box-shadow: 0 0 9px -2px #a855f7; }
.tui2-o.q4 { border-color: #f97316; box-shadow: 0 0 9px -2px #f97316; }
.tui2-ct-hm { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tui2-ct-ten { font-size: 14.5px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 1px #000; }
.tui2-badge { font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; color: #fff; padding: 1px 9px; border-radius: 9px; background: #64748b; }
.tui2-badge.q1 { background: #16a34a; }
.tui2-badge.q2 { background: #0284c7; }
.tui2-badge.q3 { background: #9333ea; }
.tui2-badge.q4 { background: #ea580c; }
.tui2-ct-meta { font-size: 11.5px; color: #d2bf97; }
.tui2-ct-meta b { color: #fbf3e2; }
.tui2-ct-sec { border: 1px solid rgba(232, 196, 106, 0.28); border-radius: 6px; padding: 7px 9px; background: rgba(0, 0, 0, 0.2); }
.tui2-ct-tde { text-align: center; font-family: "Playfair Display", "Palatino Linotype","Times New Roman",serif; font-size: 12.5px; font-weight: 800; letter-spacing: 1px; color: var(--wx-gold-hi); margin-bottom: 5px; }
.tui2-ct-txt { font-size: 12px; line-height: 1.45; color: #fbf3e2; }
.tui2-ct-note { font-size: 11.5px; line-height: 1.45; font-style: italic; color: #d2bf97; border: 1px solid rgba(232, 196, 106, 0.2); border-radius: 6px; padding: 7px 9px; background: rgba(0, 0, 0, 0.18); }
.tui2-ct-nut { margin-top: auto; display: flex; justify-content: center; padding-top: 6px; border-top: 1px solid rgba(232, 196, 106, 0.28); }
.tui2-ct-nut:empty { display: none; }
.tui2-ct-nut button { min-width: 110px; font-weight: 900; letter-spacing: 0.5px; }

/* chân bảng: tiền tệ + nút */
.tui2-chan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(42, 22, 9, 0.95), rgba(16, 9, 4, 0.98));
  border-top: 1px solid var(--wx-gold-dim);
  border-radius: 0 0 6px 6px;
}
.tui2-tien { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12.5px; color: #e7d9b8; }
.tui2-tien span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tui2-tien img { width: 20px; height: 20px; object-fit: contain; }
.tui2-tien .vang { color: #facc15; }
.tui2-tien .lam { color: #38bdf8; }
.tui2-tien .luc { color: #4ade80; }
.tui2-tien .do { color: #ef4444; }
.tui2-nuts { display: flex; gap: 6px; flex-shrink: 0; }
.tui2-nuts button { font-size: 12.5px; font-weight: 800; padding: 5px 10px; border-radius: 7px; min-height: 32px; white-space: nowrap; }

/* màn hẹp: xếp dọc, lối tắt thành hàng ngang */
@media (max-width: 760px) {
  .tui2-body { flex-direction: column; }
  .tui2-trai { flex: none; }
  .tui2-giua { flex-direction: row; }
  .tui2-giua button { min-height: 48px; flex-direction: row; gap: 6px; }
  .tui2-giua img { width: 24px; height: 24px; }
  .tui2-tabs { flex-wrap: wrap; }
  .tui2-luoi { max-height: none; }
  .tui2-chan { flex-direction: column; align-items: stretch; }
  .tui2-nuts button { flex: 1; }
}

/* Canh lửa: thanh hỏa hầu, vùng vừa lửa, kim chạy qua lại */
.dp-lua { padding: 10px 4px 4px; }
.dp-lua-top { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.dp-lua-thanh {
  position: relative; height: 26px; border-radius: 13px; overflow: hidden;
  border: 1px solid var(--wx-gold-dim, #a77b2c);
  background: linear-gradient(90deg, #2a1206, #7a2a0a 35%, #d9521a 60%, #ffd56a 85%, #fff4c4);
}
.dp-lua-vung {
  position: absolute; top: 0; bottom: 0;
  background: rgba(74, 222, 128, 0.35); border-left: 2px solid #4ade80; border-right: 2px solid #4ade80;
}
.dp-lua-kim {
  position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px;
  background: #fff; box-shadow: 0 0 0 1px #3a1a06; border-radius: 2px;
}
.dp-lua-nut { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.dp-lua-nut .dp-mua { margin-left: 0; }

/* Đan độc ở đầu Đan Lô */
.dp-head b.luc { color: #4ade80; }
.dp-head b.vang { color: #facc15; }
.dp-head b.do { color: #ef4444; }

/* Cấp nghề Luyện đan ở đầu Đan Lô */
.dp-nghe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 10px; font-size: 12px; color: #e7d9b8; }
.dp-nghe b { color: var(--gold-soft); }
.dp-nghe em { font-style: normal; opacity: 0.8; font-size: 11.5px; }
.dp-nghe-thanh {
  position: relative; flex: 1; min-width: 150px; max-width: 280px; height: 15px; border-radius: 8px; overflow: hidden;
  border: 1px solid #5c3a14; background: rgba(0, 0, 0, 0.55);
}
.dp-nghe-thanh i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #a16207, #facc15); }
.dp-nghe-thanh span { position: relative; display: block; text-align: center; font-size: 10.5px; line-height: 13px; color: #fff; text-shadow: 0 1px 1px #000; }
.dp-cap { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; vertical-align: middle; color: #fde68a; background: rgba(250, 204, 21, 0.14); }
.dp-cap.thieu { color: #fca5a5; background: rgba(239, 68, 68, 0.16); }
/* ô Pháp Bảo có Hồn Phiên bản mệnh */
.tui2-tb-o.co { border-color: #2f7a4a; box-shadow: inset 0 0 12px rgba(74, 222, 128, 0.25); }
.tui2-tb-o.co img { width: 46px; height: 46px; object-fit: contain; }
.tui2-tb-kiem.hp b { color: #4ade80; }
