/* =====================================================================
   1.26.12 — Đồng bộ toàn bộ cửa sổ: MỘT phông chữ, MỘT cỡ chữ, MỘT kiểu nút ✕,
   cửa sổ không bám sát mép màn hình; HUD góc trên phải / dải chat / nút Tự động như ảnh mẫu.
   (nạp SAU cùng)
   ===================================================================== */
:root{
  --ufs: 13px;      /* cỡ chữ duy nhất trong mọi cửa sổ (đơn vị thiết kế, phóng theo cửa sổ) */
  --uts: 15px;      /* tiêu đề khung cửa sổ */
  --fw-h: .84;      /* cửa sổ cao tối đa 84% màn hình: luôn chừa lề trên / dưới */
  --xs: 34px;       /* nút ✕ */
}
@media (max-height: 560px), (max-width: 900px) {
  :root{ --ufs: 12px; --uts: 13px; --fw-h: .84; --xs: 28px; }
}
/* Cửa sổ thường: cũng chừa lề hai bên (không chạm mép trái / phải) */
#screen-game .window{
  --fwk: min(calc(var(--vwn, 1280) * .9 / var(--W)), calc(var(--vhn, 720) * var(--fw-h) / var(--H)), var(--fw-smax)) !important;
}

/* ---------- Một phông chữ cho mọi thứ hiện lên trong game ---------- */
#screen-game .window, #screen-game .window *, .qty-modal, .qty-modal *, #item-pop, #item-pop *, #chat-panel, #chat-panel *,
#screen-game .mk2-modal *, #pinvite, #pinvite *, #hud .menu-grid *, #hud .ev-icons *{
  font-family: var(--font) !important;
}
/* ---------- Một cỡ chữ cho toàn bộ nội dung cửa sổ ----------
   Chỉ chừa: tiêu đề khung, số Lực chiến, chữ danh hiệu dạng tranh, số đếm nhỏ trên ô đồ, chấm đỏ, phím tắt. */
:is(#screen-game .window, .qty-modal, #item-pop, #chat-panel, #screen-game .mk2-modal, #pinvite)
  :is(*):not(.parch-title, .parch-title *, .dk-title, .dk-title *, .cw-power b, .ti-pill.big, .cw-eq .eq, .q, .pl, .qs-count, .dot-badge, .badge, kbd, .zc-num, .rw-cell *, .inv-slot *, svg, svg *){
  font-size: var(--ufs) !important;
}
:is(#screen-game .window) :is(.parch-title, .dk-title, .dk-title span){ font-size: var(--uts) !important; }
#chat-panel .cp-title, #chat-panel .cp-title span{ font-size: var(--uts) !important; }

/* ---------- Nút ✕ giống hệt nhau ở mọi cửa sổ / bảng ---------- */
:is(#screen-game .dk-x, #screen-game .window.parch-win > .parch > .parch-close, #chat-panel .cp-close, #item-pop.item-pop .ip-x, .item-pop .ip-x, .pm-close, #mk-x){
  width: var(--xs) !important; height: var(--xs) !important; min-width: 0 !important; padding: 0 !important;
  top: calc(var(--xs) * -.3) !important; right: calc(var(--xs) * -.3) !important; left: auto !important; bottom: auto !important;
  border-radius: 7px !important; font-size: calc(var(--xs) * .5) !important; line-height: 1 !important; font-weight: 900 !important;
  display: flex !important; align-items: center; justify-content: center; z-index: 6 !important;
}
/* Kiểu mặc định (ảnh "Nút đóng ✕" quản trị tải lên luôn được ưu tiên vì nạp sau) */
:where(.dk-x, .parch-close, .cp-close, .ip-x, .pm-close){
  background: linear-gradient(180deg, #d84a2a, #8a1f10); border: 2px solid #f0c878; color: #fff3d6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* ---------- Nhân vật (lề trái) · Hành trang (lề phải): chừa lề, Hành trang thấp hơn, thẳng đáy với Nhân vật ---------- */
#screen-game{
  --cbH: 560; --cbWc: 600; --cbWb: 470; --cell: 64px; --cg: 6px; --eqs: 74px; --cbm: 5vw;
  --cbk: min(calc(var(--vwn, 1280) * .9 / (var(--cbWc) + var(--cbWb))), calc(var(--vhn, 720) * .86 / var(--cbH)), 1.2) !important;
}
@media (max-height: 560px), (max-width: 900px) {
  #screen-game{ --cbH: 336; --cbWc: 430; --cbWb: 310; --cell: 40px; --cg: 4px; --eqs: 40px; --cbm: 5vw;
    --cbk: min(calc(var(--vwn, 844) * .9 / (var(--cbWc) + var(--cbWb))), calc(var(--vhn, 390) * .86 / var(--cbH)), 1.2) !important; }
}
#screen-game #win-bag.window.dock > .dk-wrap{
  height: auto !important; max-height: calc(var(--cbH) * 1px) !important;
  top: calc(50% + var(--cbH) * var(--cbk) * .5px) !important;
  transform: translateY(-100%) scale(var(--cbk)) !important; transform-origin: 100% 100% !important;
}
#screen-game #win-bag .dk{ min-width: 0 !important; }
#win-bag .inv-grid > .inv-slot{ min-width: 0 !important; max-width: none !important; }
#screen-game #win-bag .bag-body{ flex: 0 0 auto !important; }

/* ---------- Góc trên phải: bản đồ nhỏ + tên bản đồ · khu là MỘT khung; bản đồ luôn nhỏ, bấm vào mở Bản đồ thế giới ---------- */
#hud .minimap, #hud .minimap.small{
  width: 168px !important; height: 56px !important; opacity: 1 !important;
  border-radius: 8px 8px 0 0 !important; box-shadow: none !important; border: 2px solid #c99a56; border-bottom: 0; box-sizing: border-box;
  background: #1b140c !important;
}
@media (max-height: 560px), (max-width: 900px) { #hud .minimap, #hud .minimap.small{ width: 136px !important; height: 46px !important; } }
#hud > .mm-label{
  height: 22px !important; margin-top: 0 !important; padding: 0 6px !important; border: 2px solid #c99a56 !important; border-top: 1px solid rgba(201, 154, 86, .45) !important;
  border-radius: 0 0 8px 8px !important; background: rgba(18, 11, 5, .88) !important; box-shadow: 0 3px 8px rgba(0, 0, 0, .5) !important;
  font-size: 11.5px !important; font-weight: 800 !important; color: #fff3d6 !important; border-image: none !important;
}
@media (max-height: 560px), (max-width: 900px) { #hud > .mm-label{ height: 19px !important; font-size: 10px !important; } }

/* Mũi tên ẩn / hiện 4 biểu tượng: nhỏ gọn; quản trị thay được bằng ảnh "Nút mũi tên ẩn / hiện biểu tượng sự kiện" */
#hud .top-right > .ev-toggle{
  width: 18px !important; height: calc(var(--tb) * .8) !important; align-self: center; border-radius: 6px !important; padding: 0 !important;
  transition: transform .18s;
}
#hud .top-right > .ev-toggle .arr{ width: 7px; height: 7px; border: solid #ffe7b0; border-width: 0 2.5px 2.5px 0; transform: translateX(-1px) rotate(-45deg); }
#hud .top-right > .ev-toggle[aria-expanded="false"]{ transform: scaleX(-1); }

/* ---------- Biểu tượng (bảng ☰ và hàng sự kiện): chỉ hình biểu tượng, không vòng viền, không mờ ---------- */
#hud #menu-grid.menu-grid .mi, #hud .ev-icons .mi{
  background-color: transparent !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
  background-size: contain !important; background-position: center !important; background-repeat: no-repeat !important;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)) !important; opacity: 1 !important;
}
#hud #menu-grid.menu-grid button{ animation: none !important; opacity: 1 !important; }
#hud #menu-grid.menu-grid button, #hud .ev-icons button{ color: #fff !important; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 2px #000 !important; }

/* ---------- Dưới giữa: dải chat hẹp, chữ dài tự xuống dòng; nút Tự động nhỏ đứng ngay bên trái dải chat ---------- */
:root{ --chw: min(300px, 36vw); --chh: 54px; }
@media (max-height: 560px), (max-width: 900px) { :root{ --chw: min(280px, 34vw); --chh: 46px; } }
#hud > #chat-mini.chat-mini{
  width: var(--chw) !important; height: var(--chh) !important; padding: 4px 9px !important; justify-content: flex-end !important; overflow: hidden !important;
}
#hud > #chat-mini .cm-line{
  white-space: normal !important; overflow: visible !important; text-overflow: clip !important; word-break: break-word; line-height: 1.3 !important;
  font-size: 11px !important;
}
@media (max-height: 560px), (max-width: 900px) { #hud > #chat-mini .cm-line{ font-size: 10px !important; } }
#touch #btn-auto.auto-btn{
  right: auto !important; left: calc(50% - var(--chw) / 2 - 42px) !important; bottom: calc(14px + var(--sb, 0px) + (var(--chh) - 36px) / 2) !important;
  width: 36px !important; height: 36px !important; padding: 6px !important;
}
@media (max-height: 560px), (max-width: 900px) {
  #touch #btn-auto.auto-btn{ width: 32px !important; height: 32px !important; padding: 5px !important; left: calc(50% - var(--chw) / 2 - 38px) !important; bottom: calc(14px + var(--sb, 0px) + (var(--chh) - 32px) / 2) !important; }
}
/* Hàng ô dùng nhanh dời sát góc phải (chỗ nút Tự động cũ) */
#touch .quickslots.potion-row{ right: var(--pad-r) !important; }
/* Ô trang bị: tên ô chữ nhỏ vừa ô (ô trống), không tràn */
#screen-game .cw-eq .eq{ font-size: 11px !important; overflow: hidden; white-space: nowrap; text-overflow: clip; letter-spacing: -.2px; }
@media (max-height: 560px), (max-width: 900px) { #screen-game .cw-eq .eq{ font-size: 8.5px !important; } }
#screen-game .cw-exp .cw-xprow span, #screen-game .cw-exp .cw-xprow b{ white-space: nowrap; }

/* ---------- Mọi cửa sổ lệch xuống một chút: chừa hàng HUD trên cùng (khung máu, biểu tượng, bản đồ nhỏ) và lề dưới ---------- */
:root{ --wdy: 2.5vh; }
#screen-game .window.parch-win:not(.kb):not(#_) > .parch{ top: calc(50% + var(--wdy)) !important; }
#screen-game .window.dock:not(.kb):not(#_):not(#__):not(#___):not(#____) > .dk-wrap{ top: calc(50% + var(--wdy)) !important; }
#screen-game #win-bag.window.dock:not(.kb):not(#_):not(#__):not(#___):not(#____) > .dk-wrap{ top: calc(50% + var(--wdy) + var(--cbH) * var(--cbk) * .5px) !important; }
/* Khung trò chuyện mở rộng: cũng chừa lề trên / dưới / trái */
#chat-panel.dk-chat{ top: 10vh !important; bottom: 5vh !important; left: calc(2vw + var(--sl, 0px)) !important; }
body.kb-open #chat-panel.dk-chat{ top: 4px !important; }
/* Điện thoại: chân Hành trang hai hàng (Ngọc · Vàng / số ô · nút) để không chồng chữ */
@media (max-height: 560px), (max-width: 900px) {
  #screen-game{ --cbH: 352; --cell: 38px; }
  #win-bag .bag-foot{ flex-direction: column !important; align-items: stretch !important; gap: 4px !important; }
  #win-bag .bag-money{ display: flex !important; justify-content: space-between; }
  #win-bag .bag-money .bm-gem:first-child{ display: none !important; }
  #win-bag .bag-money span{ font-size: inherit !important; }
  #win-bag .bag-acts{ justify-content: flex-end; }
}
/* Cài đặt là cửa sổ nhỏ hơn nên được phóng to hơn: hạ cỡ chữ thiết kế để chữ trên màn hình bằng đúng các cửa sổ khác */
#screen-game #win-settings{ --ufs: 12px; --uts: 14px; }
@media (max-height: 560px), (max-width: 900px) { #screen-game #win-settings{ --ufs: 11.6px; --uts: 12.6px; } }

/* =================== 1.26.13 =================== */
/* Nút ✕ nằm GỌN trong góc trên phải khung (không thò ra ngoài đè lên bản đồ nhỏ / biểu tượng) */
:is(#screen-game .dk-x, #screen-game .window.parch-win > .parch > .parch-close, #chat-panel .cp-close, #item-pop.item-pop .ip-x, .item-pop .ip-x, .pm-close, #mk-x){
  top: 5px !important; right: 5px !important;
}
#screen-game .window.dock .dk-title{ margin-right: calc(var(--xs) + 8px) !important; margin-left: calc(var(--xs) + 8px) !important; }

/* Hành trang: 5 × 5 ô to vừa khung, còn lại vuốt / lăn để xem */
#screen-game{ --cbH: 600; --cbWb: 450; --cell: 78px; --cg: 6px; }
@media (max-height: 560px), (max-width: 900px) { #screen-game{ --cbH: 380; --cbWb: 278; --cell: 46px; --cg: 4px; } }
#win-bag .inv-grid{ grid-template-columns: repeat(5, var(--cell)) !important; }
#win-bag .inv-grid > .inv-slot{ touch-action: pan-y !important; }
#win-bag .bag-gridbox{ touch-action: pan-y !important; -webkit-overflow-scrolling: touch; }
/* Chân túi: Ngọc trên, Ngọc khóa dưới (chỉ biểu tượng + số) · Vàng · số ô · Nhân vật / Sắp xếp */
#win-bag .bag-foot{
  display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 4px 10px !important; align-items: center !important;
  padding: 6px 8px; border-radius: 6px; background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1px rgba(184, 137, 74, .35);
}
#win-bag .bag-money, #win-bag .bag-acts{ display: contents !important; }
#win-bag .bag-money span{ display: inline-flex !important; align-items: center; gap: 5px; font-size: 0 !important; white-space: nowrap; }
#win-bag .bag-money span b{ font-size: var(--ufs) !important; }
#win-bag .bag-money .icon-gold{ width: 18px !important; height: 18px !important; flex: 0 0 18px !important; }
#win-bag .bag-money .bm-gem:nth-child(2){ grid-column: 1; grid-row: 1; }
#win-bag .bag-money .bm-gem:first-child{ display: inline-flex !important; grid-column: 1; grid-row: 2; }
#win-bag .bag-money .bm-gold{ grid-column: 2; grid-row: 1; justify-self: end; margin: 0 !important; }
#win-bag .bag-acts > span:first-child{ grid-column: 2; grid-row: 2; justify-self: end; }
#win-bag .bag-acts .pager{ display: none !important; }
#win-bag #bag-char{ grid-column: 3; grid-row: 1; }
#win-bag #inv-sort{ grid-column: 3; grid-row: 2; }
#win-bag .bag-acts .pbtn{ min-width: 92px !important; height: 28px !important; padding: 0 10px !important; }
@media (max-height: 560px), (max-width: 900px) {
  #win-bag .bag-foot{ padding: 4px 6px; gap: 3px 8px !important; }
  #win-bag .bag-money .icon-gold{ width: 14px !important; height: 14px !important; flex-basis: 14px !important; }
  #win-bag .bag-acts .pbtn{ min-width: 72px !important; height: 23px !important; padding: 0 6px !important; }
}

/* Cửa hàng NPC: một danh sách 2 cột (ảnh · tên · giá), chia trang; không chia loại, không thẻ Mua / Bán */
#win-shop .shop-body.buying .shop-list{ grid-template-columns: 1fr 1fr !important; }
/* Bảng chi tiết món đang mở: cửa sổ chứa nó nổi lên trên các cửa sổ khác (vd túi đồ cạnh cửa hàng) */
#screen-game .window.dock:has(> .dk-wrap > #item-pop:not([hidden])){ z-index: 40 !important; }
#screen-game #win-bag .bag-money span{ font-size: 0 !important; }
#screen-game #win-bag .bag-money span b{ font-size: var(--ufs) !important; }
#win-bag .bag-gridbox{ padding: 7px 7px 0 !important; height: calc(var(--cell) * 5 + var(--cg) * 4 + 7px) !important; scroll-padding-top: 7px; }

/* =================== 1.26.14 =================== */
/* Chân Hành trang: Ngọc / Ngọc khóa (cột 1) · Vàng / Vàng khóa (cột 2) · số ô / Sắp xếp (cột 3). Chỉ biểu tượng + số. */
#win-bag .bag-foot{ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto !important; }
#win-bag .bag-money .bm-gem:nth-child(2){ grid-column: 1; grid-row: 1; }
#win-bag .bag-money .bm-gem:first-child{ grid-column: 1; grid-row: 2; }
#win-bag .bag-money .bm-gold{ grid-column: 2; grid-row: 1; justify-self: start !important; }
#win-bag .bag-money .bm-goldb{ grid-column: 2; grid-row: 2; display: inline-flex !important; align-items: center; gap: 5px; font-size: 0 !important; white-space: nowrap; }
#screen-game #win-bag .bag-money .bm-goldb b{ font-size: var(--ufs) !important; color: #ffd36a; font-weight: 800; }
#win-bag .bag-money .bm-goldb .icon-gold{ width: 18px; height: 18px; flex: 0 0 18px; background-size: contain; background-position: center; background-repeat: no-repeat; position: relative; }
#win-bag .bag-acts > span:first-child{ grid-column: 3 !important; grid-row: 1 !important; justify-self: end; }
#win-bag #bag-char{ display: none !important; }
#win-bag #inv-sort{ grid-column: 3 !important; grid-row: 2 !important; }
@media (max-height: 560px), (max-width: 900px) { #win-bag .bag-money .bm-goldb .icon-gold{ width: 14px; height: 14px; flex-basis: 14px; } }
/* Ổ khóa nhỏ trên biểu tượng Ngọc khóa / Vàng khóa khi chưa có ảnh riêng */
#win-bag .bag-money i.lk{ position: relative; }
#win-bag .bag-money i.lk::after{ content: ''; position: absolute; right: -2px; bottom: -1px; width: 8px; height: 6px; border-radius: 1.5px; background: #e8c27a; box-shadow: 0 0 0 1px #5a3410; }
#win-bag .bag-money i.lk::before{ content: ''; position: absolute; right: -.5px; bottom: 4px; width: 5px; height: 5px; border: 1.5px solid #e8c27a; border-bottom: 0; border-radius: 4px 4px 0 0; }
/* Bản đồ nhỏ + dải "Tên bản đồ · Khu" là MỘT khung (dải nằm trong khung bản đồ nên luôn thẳng hàng) */
#hud .minimap, #hud .minimap.small{
  height: calc(56px + 22px) !important; border: 2px solid #c99a56 !important; border-radius: 8px !important; overflow: hidden !important;
  display: flex !important; flex-direction: column; box-shadow: 0 3px 8px rgba(0, 0, 0, .5) !important;
}
#hud .minimap > canvas{ flex: 1 1 auto; min-height: 0; width: 100% !important; height: auto !important; display: block; }
#hud .minimap > .mm-label{
  flex: 0 0 22px; width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 0 6px; overflow: hidden; white-space: nowrap;
  border-top: 1px solid rgba(201, 154, 86, .55); background: rgba(18, 11, 5, .9); color: #fff3d6; font-weight: 800; font-size: 11.5px; text-shadow: 0 1px 2px #000; cursor: pointer;
}
#hud .minimap > .mm-label b{ overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 800; }
#hud .minimap > .mm-label span{ flex: 0 0 auto; color: #ffe08a; }
@media (max-height: 560px), (max-width: 900px) {
  #hud .minimap, #hud .minimap.small{ height: calc(46px + 19px) !important; }
  #hud .minimap > .mm-label{ flex-basis: 19px; font-size: 10px; }
}
/* Chữ dải chat nhỏ hơn */
#hud > #chat-mini .cm-line{ font-size: 10px !important; }
@media (max-height: 560px), (max-width: 900px) { #hud > #chat-mini .cm-line{ font-size: 9px !important; } }
/* Khung chat mở rộng: chữ nhỏ hơn */
#chat-panel .chat-log, #chat-panel .chat-log *{ font-size: 12px !important; }
@media (max-height: 560px), (max-width: 900px) { #chat-panel .chat-log, #chat-panel .chat-log *{ font-size: 10.5px !important; } }

/* ---------- Chợ: bảng xem / bày bán món theo khung gỗ tối mới (giống bảng chi tiết món trong túi) ---------- */
#mk-pop.mk2-pop.item-pop{
  padding: 12px !important; border-radius: 8px !important; gap: 8px; color: #f1e2c4 !important; text-shadow: 0 1px 1px #000;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255, 196, 110, .08), transparent 60%), linear-gradient(180deg, #2c1e14, #120a05) !important;
  border: 2px solid #b8894a !important; box-shadow: 0 0 0 2px #120a05, inset 0 0 0 1px rgba(255, 220, 150, .14), 0 14px 40px rgba(0, 0, 0, .7) !important;
}
#mk-pop .ip-head{ display: grid !important; grid-template-columns: 58px minmax(0, 1fr); gap: 4px 10px; align-items: center; margin: 0 !important; padding: 0 30px 8px 0 !important; border-bottom: 1px solid rgba(240, 200, 120, .25); }
#mk-pop .ip-icon{ width: 58px !important; height: 58px !important; background-color: #160d07 !important; box-shadow: inset 0 0 0 1px #8a6838, inset 0 0 10px rgba(0, 0, 0, .8) !important; border-radius: 4px !important; }
#mk-pop .ip-htext b{ color: #ffe9b8 !important; font-weight: 900 !important; }
#mk-pop .ip-htext small, #mk-pop small{ color: #d8c3a0 !important; }
#mk-pop .ip-body{ padding: 8px 10px !important; border-radius: 6px; background: rgba(0, 0, 0, .34) !important; box-shadow: inset 0 0 0 1px rgba(184, 137, 74, .4); max-height: 32vh; overflow-y: auto !important; }
#mk-pop .ip-body, #mk-pop .ip-body *{ color: #f1e2c4 !important; }
#mk-pop .ii-h{ color: #f3cf86 !important; border-bottom-color: rgba(240, 200, 120, .25) !important; }
#mk-pop .ii-stats .ii-list li{ color: #ffd860 !important; }
#mk-pop .ii-about, #mk-pop #ip-desc{ color: #d8c3a0 !important; }
#mk-pop .mk2-deal{ background: none !important; }
#mk-pop .mk2-row{ color: #d9c49c !important; }
#mk-pop .mk2-row > span{ color: #d9c49c !important; font-weight: 700; }
#mk-pop .mk2-step b{ color: #fff3d6 !important; }
#mk-pop .mk-line{ background: rgba(0, 0, 0, .3) !important; color: #d9c49c !important; box-shadow: inset 0 0 0 1px rgba(184, 137, 74, .3); }
#mk-pop .mk-line b{ color: #fff3d6 !important; }
#mk-pop .mk-line.em b{ color: #9be38a !important; }
#mk-pop .mk-line.bad b{ color: #ff8a70 !important; }
#mk-pop input{ background: #1c120a !important; color: #fff3d6 !important; border: 1px solid #8a6838 !important; }
#mk-pop .ip-actions{ border-top: 1px solid rgba(240, 200, 120, .22); padding-top: 8px !important; }
/* Thẻ Bày bán → Vàng: ô bán Vàng lấy Ngọc dễ đọc */
#screen-game #win-market .mk2-gold{
  background: rgba(0, 0, 0, .32) !important; box-shadow: inset 0 0 0 1px rgba(184, 137, 74, .45) !important; border: 0 !important; border-radius: 8px !important; padding: 10px 12px !important;
  color: #f1e2c4 !important; gap: 8px !important;
}
#screen-game #win-market .mk2-gold > b{ color: #f3cf86 !important; font-weight: 800 !important; }
#screen-game #win-market .mk2-gold small{ color: #d9c49c !important; line-height: 1.5; text-shadow: 0 1px 1px #000; }
#screen-game #win-market .mk2-gold input{ background: #1c120a !important; color: #fff3d6 !important; border: 1px solid #8a6838 !important; }
#screen-game #win-market .mk2-gold input::placeholder{ color: #a08a68 !important; }
/* Thành tựu: mốc nhận được thưởng có khung viền xanh */
#win-quest .tq-list .qw-drow.ready{ box-shadow: inset 0 0 0 2px #6fdc55, 0 0 8px rgba(111, 220, 85, .35) !important; background: linear-gradient(90deg, rgba(111, 220, 85, .16), rgba(0, 0, 0, .3)) !important; }

/* ---------- Bộ lạc → Thông tin ---------- */
#win-guild .gi-hero{ display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 8px; background: linear-gradient(90deg, rgba(240, 170, 80, .16), rgba(0, 0, 0, .3)); box-shadow: inset 0 0 0 1px rgba(184, 137, 74, .5); margin-bottom: 10px; }
#win-guild .gi-badge{ flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #f3cf86, #a0602a 70%); box-shadow: 0 0 0 2px #2a1709, 0 0 0 4px #c99a56, 0 3px 8px rgba(0, 0, 0, .6); }
#win-guild .gi-badge small{ color: #3a1d08; font-weight: 800; text-shadow: none; }
#screen-game #win-guild .gi-badge b{ color: #fff; font-weight: 900; font-size: calc(var(--ufs) * 1.9) !important; text-shadow: 0 1px 2px #3a1d08; }
#win-guild .gi-htext{ flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
#screen-game #win-guild .gi-name{ margin: 0; color: #ffe9b8; font-weight: 900; font-size: calc(var(--ufs) * 1.45) !important; }
#win-guild .gi-myrank{ color: #d9c49c; }
#win-guild .gi-bar{ position: relative; height: 16px; border-radius: 8px; background: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 1px rgba(184, 137, 74, .4); overflow: hidden; }
#win-guild .gi-bar i{ position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #c9852e, #f3cf86); border-radius: 8px; }
#win-guild .gi-bar em{ position: relative; display: block; text-align: center; font-style: normal; font-weight: 800; line-height: 16px; color: #fff; text-shadow: 0 1px 2px #000; }
#win-guild .gi-stats{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
#win-guild .gi-stat{ display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; border-radius: 6px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px rgba(184, 137, 74, .3); }
#win-guild .gi-stat small{ color: #c9a96e; font-weight: 700; }
#win-guild .gi-stat b{ color: #fff3d6; font-weight: 800; }
#win-guild .gi-notice{ display: flex; flex-direction: column; gap: 6px; }
#win-guild .gi-h{ margin: 0; color: #f3cf86; font-weight: 800; }
#win-guild .gl-notice{ min-height: 70px; resize: none; border-radius: 6px; padding: 8px; }
#win-guild .gl-text{ margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(0, 0, 0, .3); color: #eadbbd; }
@media (max-height: 560px), (max-width: 900px) {
  #win-guild .gi-hero{ padding: 7px 10px; gap: 10px; margin-bottom: 6px; }
  #win-guild .gi-badge{ width: 44px; height: 44px; }
  #win-guild .gi-stats{ gap: 5px; margin-bottom: 6px; }
  #win-guild .gi-stat{ padding: 5px 8px; }
  #win-guild .gl-notice{ min-height: 44px; }
}

/* ---------- Bảng bấm vào người chơi khác + lời mời tổ đội: khung gỗ tối như các cửa sổ ---------- */
#ppop.ppop, #pinvite.pinvite{
  color: #f1e2c4 !important; text-shadow: 0 1px 1px #000; border-radius: 9px !important;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255, 196, 110, .08), transparent 60%), linear-gradient(180deg, #2c1e14, #120a05) !important;
  border: 2px solid #b8894a !important; box-shadow: 0 0 0 2px #120a05, inset 0 0 0 1px rgba(255, 220, 150, .14), 0 14px 40px rgba(0, 0, 0, .7) !important;
}
#ppop.pmenu{ padding: 12px !important; gap: 6px !important; width: min(260px, 60vw) !important; }
#ppop.pmenu > b{ color: #ffe9b8 !important; font-weight: 900; padding: 0 36px 0 4px !important; }
#ppop.pmenu > small{ color: #d9c49c !important; border-bottom: 1px solid rgba(240, 200, 120, .25); padding-bottom: 6px !important; margin: 0 0 2px !important; }
#ppop .pm-item{
  color: #f4d8a0 !important; font-weight: 800; border-radius: 6px !important; padding: 8px 12px !important; text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, #7a3418, #4a1c0c) !important; border: 2px solid #9a6a36 !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12) !important;
}
#ppop .pm-item:hover{ filter: brightness(1.15); }
#ppop .pm-close{ top: 6px !important; right: 6px !important; }
#pinvite p{ color: #f1e2c4 !important; }
@media (max-height: 560px), (max-width: 900px) { #mk-pop .ip-body{ max-height: 22vh; } }

/* =================== 1.26.15 =================== */
/* Góc trên phải: [mũi tên][4 biểu tượng] cùng hàng, rồi tới bản đồ nhỏ ở sát góc */
:root{ --mmw: 168px; }
@media (max-height: 560px), (max-width: 900px) { :root{ --mmw: 136px; } }
#hud .minimap, #hud .minimap.small{ top: calc(6px + var(--st, 0px)) !important; right: calc(10px + var(--sr, 0px)) !important; width: var(--mmw) !important; }
#hud .top-right{ right: calc(10px + var(--sr, 0px) + var(--mmw) + 8px) !important; top: calc(10px + var(--st, 0px)) !important; }

/* Nhiệm vụ → Hiện tại / Chưa nhận: hai cột như Danh hiệu (trái danh sách, phải chi tiết) */
#win-quest .qw-mainb:not([hidden]){
  display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) !important; grid-template-rows: minmax(0, 1fr) !important;
  gap: 10px !important; flex: 1 1 auto; min-height: 0;
}
#win-quest .qw-mainb > section{ min-height: 0 !important; max-height: none !important; height: auto !important; overflow-y: auto !important; }

/* Chợ: bỏ dòng hướng dẫn và dòng chú thích cạnh Vàng / Ngọc */
#win-market #mk-guide, #win-market .mk2-guide, #win-market #mk-note, #win-market .cur-note{ display: none !important; }

/* Nhân vật: bỏ tên, phái, lực chiến trong khung trang bị; một dòng EXP hiện có / cần có */
#win-character .cw-eq .cw-top, #win-character .cw-eq .cw-power{ display: none !important; }
#win-character .cw-exp{ grid-template-columns: 1fr !important; }
#win-character .cw-xpone{ justify-content: space-between; }
#win-character .cw-xpone b span{ color: inherit; }

/* Thú cưng: cột phải hẹp lại, khung vuông vắn hơn */
#screen-game:not(:has(#win-bag:not([hidden]))) #win-pet.window.dock{ --Wd: 740 !important; }
@media (max-height: 560px), (max-width: 900px) { #screen-game:not(:has(#win-bag:not([hidden]))) #win-pet.window.dock{ --Wd: 540 !important; } }
#pet-main.pvd, #win-pinfo #pi-pets.pvd{ grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr) !important; }
#screen-game #win-pinfo.window.dock.pet-tab{ --Wd: 740 !important; }
@media (max-height: 560px), (max-width: 900px) { #screen-game #win-pinfo.window.dock.pet-tab{ --Wd: 540 !important; } }

/* Dải chat sát đáy màn hình; nút Tự động đi theo */
#hud > #chat-mini.chat-mini{ bottom: calc(3px + var(--sb, 0px)) !important; }
#touch #btn-auto.auto-btn{ bottom: calc(3px + var(--sb, 0px) + (var(--chh) - 36px) / 2) !important; }
@media (max-height: 560px), (max-width: 900px) { #touch #btn-auto.auto-btn{ bottom: calc(3px + var(--sb, 0px) + (var(--chh) - 32px) / 2) !important; } }
#hud > .auto-label{ bottom: calc(3px + var(--sb, 0px) + var(--chh) + 6px) !important; }

/* Khung nhân vật / thú cưng góc trên trái ngắn lại (thanh tên, máu, mana) */
#hud.hud2 #hud-plate.hud-plate{ width: 212px !important; }
#hud.hud2 #pet-plate.pet-mini{ width: 160px !important; }
@media (max-height: 560px), (max-width: 900px) {
  #hud.hud2 #hud-plate.hud-plate{ width: 176px !important; }
  #hud.hud2 #pet-plate.pet-mini{ width: 138px !important; }
}

/* Khung chat mở rộng: chữ bằng cỡ dải chat */
#chat-panel .chat-log, #chat-panel .chat-log *{ font-size: 10px !important; }
@media (max-height: 560px), (max-width: 900px) { #chat-panel .chat-log, #chat-panel .chat-log *{ font-size: 9px !important; } }

/* Hộp nhập chữ */
#txt-modal .txt-input{ width: 100%; box-sizing: border-box; height: 40px; margin: 4px 0 12px; padding: 0 12px; border-radius: 7px; font: inherit; font-size: 16px !important;
  background: #1c120a !important; color: #fff3d6 !important; border: 1px solid #8a6838 !important; outline: none; text-align: center; }
#txt-modal .txt-input:focus{ border-color: #f3cf86 !important; }

/* =================== 1.26.16 =================== */
/* Khung nhân vật / thú cưng góc trên trái: chữ tên + số máu / mana không in đậm; thanh bám sát ô avatar */
#hud.hud2 .hud-plate .plate-body{ left: calc(var(--av) + 2px) !important; }
#hud.hud2 .hud-plate .pbar{ margin-right: 0 !important; }
#hud.hud2 .hud-plate .pname{ padding-left: 6px !important; padding-right: 6px !important; }
#hud.hud2 .hud-plate .pname, #hud.hud2 .hud-plate .pbar em{ font-weight: 500 !important; }
/* Bản đồ nhỏ: viền mảnh */
#hud .minimap, #hud .minimap.small{ border-width: 1px !important; }
#hud .minimap > .mm-label{ border-top-width: 1px !important; }
/* Nút ☰: không hiện chấm đỏ */
#hud #btn-menu .menu-dot{ display: none !important; }
/* Khung chat mở rộng: chữ nhỏ hơn nữa (mọi dòng, mọi kênh) */
#chat-panel #chat-log, #chat-panel #chat-log *, #chat-panel .chat-log .cl, #chat-panel .chat-log .cl *{ font-size: 9px !important; line-height: 1.35 !important; }
#chat-panel .cp-form input, #chat-panel .cp-form select, #chat-panel .cp-tabs button{ font-size: 10px !important; }
@media (max-height: 560px), (max-width: 900px) {
  #chat-panel #chat-log, #chat-panel #chat-log *, #chat-panel .chat-log .cl, #chat-panel .chat-log .cl *{ font-size: 8.5px !important; }
}

/* ===== 1.26.17: đường kẻ đậm ngăn tư chất và chỉ số pet; dòng tỉ lệ thi triển kỹ năng ===== */
.pvd .pvd-body .pvd-row.sep { border-top: 2px solid rgba(255, 210, 130, .55); margin-top: 3px; padding-top: 6px; }
.pv-tip .tp-rate { font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.pv-tip .tp-rate.ok { color: #4fbf6a; }
.pv-tip .tp-rate.off { color: #d9903a; }

/* ===== 1.26.18: phẩm chất sao của trang bị (cửa sổ chi tiết túi đồ / chợ / cửa hàng) ===== */
.ii-sec.ii-roll .ii-list li.ii-star:not(#_):not(#__) { font-weight: 700; }
.ii-sec.ii-roll .ii-list li.ii-star.s1:not(#_):not(#__) { color: #d8d2c6 !important; }
.ii-sec.ii-roll .ii-list li.ii-star.s2:not(#_):not(#__) { color: #7fd17f !important; }
.ii-sec.ii-roll .ii-list li.ii-star.s3:not(#_):not(#__) { color: #6fb3ff !important; }
.ii-sec.ii-roll .ii-list li.ii-star.s4:not(#_):not(#__) { color: #c78bff !important; }
.ii-sec.ii-roll .ii-list li.ii-star.s5:not(#_):not(#__) { color: #ffb43a !important; }
.ii-sec.ii-roll .ii-list li.ii-line:not(#_):not(#__) { color: #8fe0a0 !important; }
