/* ===== style.css ===== */
:root {
  --nen: rgba(7, 24, 40, 0.84);
  --nen-dam: rgba(4, 14, 26, 0.94);
  --vien: #4fe3ff;
  --vien-mo: rgba(79, 227, 255, 0.35);
  --chu: #e2fbff;
  --chu-mo: #8fb9c8;
  --xanh: #6fffd2;
  --do: #ff6a6a;
  --cam: #ffb454;
  --vang: #ffd84a;
  --phat: 0 0 10px rgba(79, 227, 255, 0.45), inset 0 0 14px rgba(79, 227, 255, 0.12);
  /* vùng an toàn (tai thỏ, thanh home) */
  --tren: env(safe-area-inset-top, 0px);
  --le: env(safe-area-inset-left, 0px);
  --phai: env(safe-area-inset-right, 0px);
  --day: env(safe-area-inset-bottom, 0px);
  /* lề tối thiểu cộng thêm vào vùng an toàn: --mep (trái / phải / dưới), --mt (trên); máy cảm ứng dùng lề rộng hơn (xem "HUD 2") */
  --mep: 8px; --mt: 5px;
  /* chiều cao màn thật sự thấy được: dvh trừ thanh công cụ của Safari (var(--cao) trên iOS dài hơn phần nhìn thấy) */
  --cao: 100vh;
  /* QUY ƯỚC CHUNG (15/11, bàn với Codex): phần nào sửa tới thì dùng dần các biến này thay số rời.
     Bo góc: bảng 16 · thẻ / chip / nút chữ 12 · viên 999. Khoảng cách 4 / 8 / 12. Chữ phụ 12px/1.35, nội dung 14px, tiêu đề hàng 15px.
     Vùng chạm ≥ 44px trên cảm ứng. Viền thường 1px, đang chọn 1.5px; chỉ nút chính / đang chọn mới có quầng sáng rõ.
     Màu: nền biển tối + viền cyan cho trạng thái thường; đỏ = nguy hiểm, vàng = cảnh báo, xanh mint = đủ nguyên liệu. */
  --bo-bang: 16px; --bo-the: 12px; --bo-vien: 999px;
  --cach-nho: 4px; --cach: 8px; --dem: 12px;
  --chu-phu: 12px; --chu-nd: 14px; --cham-toi-thieu: 44px;
  --nen-chip: rgba(4, 14, 26, .82);
  /* --tren-cao, --nut-day, --dh-day, --ban-phim, --vv-cao: giao_dien.ts đo rồi đặt lúc chạy */

  /* ===== BỘ QUY ƯỚC UI (15/11 đợt 2, mục 1 của bản soát). Ba nhóm A/B/C CHỈ DÙNG, không định nghĩa lại; cần nấc mới thì thêm ở đây. =====
     Tên trong bản soát → tên thật (các biến cũ ở trên đã có sẵn nên giữ tên cũ, không tạo trùng):
       --bo-lon = --bo-bang (16, khung bảng) · --bo = --bo-the (12, thẻ / ô / nút) · --bo-nho (8, chip nhỏ, ô vật phẩm) · --bo-tron = --bo-vien (999)
       --k1 = --cach-nho (4) · --k2 = --cach (8) · --k3 = --dem (12) · --k4 = --cach-lon (16)
       --cz-phu = --chu-phu (12) · --cz = --chu-nd (14) · --cz-td = --chu-td (13, tiêu đề bảng chữ hoa) · --cz-vua = --chu-nhan (15)
       --cham = --cham-toi-thieu (44: mọi nút trên máy cảm ứng) · PC: --cham-pc (36) */
  --bo-nho: 8px;
  --cach-lon: 16px;
  --chu-td: 13px; --chu-nhan: 15px;
  --cham-pc: 36px;
  /* nền 3 loại nút (.nut-chinh / .nut-phu / .nut-nguy ở mục "khung bảng thống nhất") */
  --nut-chinh-nen: linear-gradient(#1f6f8c, #134a63);
  --nut-phu-nen: rgba(79, 227, 255, .08);
  --nut-nguy-nen: linear-gradient(#8c2f2f, #5e1c1c);

  /* ===== THANG Z-INDEX CHUNG: mọi lớp nằm THẲNG dưới <body> chỉ được dùng các nấc này (thấp → cao) =====
     Bên trong một khối đã có lớp chồng riêng (#hud, một bảng, một nút) thì dùng số nhỏ 0–9 cục bộ, không cần biến.
     Lưu ý: #hud là MỘT lớp chồng (z --z-hud); mọi thứ bên trong #hud (thanh cầm, nút chính, chip dưới bản đồ nhỏ #dn-ve/#tp-ve/#rg-ve,
     cụm lái…) dù đặt z cục bộ bao nhiêu cũng nằm DƯỚI mọi lớp từ --z-chip trở lên. Muốn nổi trên chip thì phải để ngoài #hud. */
  --z-canh: 5;        /* lớp phủ sát cảnh, dưới HUD: bóng tối hang mỏ, chớp đỏ hải chiến, màn chuyển tầng */
  --z-duoi-hud: 9;    /* thanh nút ngữ cảnh ngoài #hud phải nằm dưới HUD: #dn-thanh, #hc-thanh, #ht-thanh, #dao-thanh (cảm ứng) */
  --z-hud: 10;        /* #hud */
  --z-chip: 12;       /* chip / nút nổi ngoài #hud: #nut-ngam, #cd-chip, #kb-chip, #og-bc, nút tân thủ "Tới…" */
  --z-hud-noi: 14;    /* dải cảnh báo / thanh nổi trên chip: bão, boss, hoa tiêu, thanh xây nhà / sắp xếp, tấm kể chuyện #truyen */
  --z-the-nhac: 20;   /* thẻ nhắc không chặn màn (.the-nhac, lời mời tổ đội / mời bạn): DƯỚI bảng và DƯỚI màn gục */
  --z-chat: 24;       /* khung chat #chat (đã ra ngoài #hud) */
  --z-bang-nen: 25;   /* lớp bắt chạm ngay dưới bảng (#mt-nen của Menu thẻ) */
  --z-bang: 26;       /* bảng lớn .bang.lon và các bảng tự tạo kiểu bảng lớn */
  --z-bang-tren: 28;  /* bảng mở chồng lên bảng khác: hồ sơ, Cài đặt, Thông báo, Người đang chơi, lưới Menu, hàng nút Menu thẻ */
  --z-huong-dan: 36;  /* tân thủ: mũi tên chỉ #hd-mui, mũi tên mép #tt-mep, chữ mừng / tiến độ (không chặn chạm) */
  --z-modal: 40;      /* hộp chặn màn có nền tối: tự lái, thẻ kho báu / boss, mời trao đổi */
  --z-toast: 60;      /* thông báo nổi #thong-bao, thông báo lớn #tb-lon, tin riêng #nr-bao (không chặn chạm) */
  --z-man-che: 70;    /* màn che cả game: .man (đăng nhập, tạo nhân vật, gục, mở rương, thức tỉnh), màn xoay, mất kết nối, chìm tàu */
  --z-man-tren: 74;   /* màn mở từ màn che: mã khôi phục #tk-ma, quên mật khẩu #man-kp */
  --z-xac-nhan: 80;   /* hộp xác nhận / nhập #hop-thoai: trên mọi thứ người chơi đang làm */
  --z-goi-y: 90;      /* chú thích nổi theo con trỏ (#the-vat) */
  --z-man-tai: 100;   /* màn tải, màn "mở bằng trình duyệt ngoài", màn lỗi khởi động */
}
/* cỡ các phần HUD đặt trên body để nhân được với --hud (cài đặt: Nhỏ / Vừa / To → body.hud-nho / body.hud-to) */
body {
  --co: 1; --nen-co: 1; --hud: calc(var(--co) * var(--nen-co)); /* --co: người chơi chọn (Nhỏ / Vừa / To) · --nen-co: nấc theo loại máy (máy bảng to hơn) */
  --nut: max(40px, calc(44px * var(--hud)));        /* nút icon hàng trên */
  --ban-do: calc(108px * var(--hud));               /* bản đồ nhỏ tròn */
  --o-cam: calc(52px * var(--hud)); --o-ke: 5px;    /* ô thanh cầm */
  --nc: calc(104px * var(--hud)); --nc-phai: 22px; --nc-day: 20px;  /* nút hành động chính */
  --vc: max(48px, calc(58px * var(--hud)));         /* nút ngữ cảnh trên vòng cung */
  --vong-dinh: calc(var(--nc-day) + var(--nc) + 8px + var(--vc)); /* đỉnh vòng cung tính từ đáy màn */
  /* vùng cần điều khiển nổi (joystick, dieu_khien.ts tạo #vung-can): góc dưới ~42% rộng × 55% cao.
     Không đặt nút / thanh nào đè lên vùng này. */
  --can-rong: 42vw; --can-cao: 55vh;
  /* cỡ bảng trên máy rộng (≥ 621 × 501): 4 nấc bề rộng + một chiều cao chuẩn, nhân theo --nen-co (màn lớn phóng to bảng cùng HUD).
     Vùng đặt bảng: chừa --bang-tren (hàng HUD) ở trên, --bang-duoi (thanh cầm) ở dưới. Dùng qua lớp .co-nho/.co-vua/.co-lon/.co-rat-lon (khung bảng thống nhất). */
  /* rà UI 17/11 (Gemini): nhân theo --hud — PC 1920 (--nen-co 1,3) hàng nút + thanh cầm to lên mà khoảng chừa thì không, bảng đè thanh cầm */
  --bang-tren: calc(72px * var(--hud)); --bang-duoi: calc(70px * var(--hud));
  --bang-nho: min(calc(480px * var(--nen-co)), calc(100vw - 48px - var(--le) - var(--phai)));
  --bang-vua: min(calc(720px * var(--nen-co)), calc(100vw - 48px - var(--le) - var(--phai)));
  --bang-lon: min(calc(960px * var(--nen-co)), calc(100vw - 48px - var(--le) - var(--phai)));
  --bang-rat-lon: min(calc(1200px * var(--nen-co)), calc(100vw - 48px - var(--le) - var(--phai)));
  --bang-cao: min(calc(720px * var(--nen-co)), calc(var(--cao) - var(--bang-tren) - var(--bang-duoi) - var(--tren) - var(--day)));
}
body.hud-nho { --co: .88; }
body.hud-to { --co: 1.14; }
@supports (height: 1dvh) { :root { --cao: 100dvh; } body { --can-cao: 55dvh; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #0b2a3c; color: var(--chu);
  font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input { -webkit-user-select: text; user-select: text; }
canvas#cv { position: fixed; inset: 0; image-rendering: pixelated; display: block; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
canvas#cv, #dpad, #nut-chinh { touch-action: none; }
[hidden] { display: none !important; }

/* bảng kiểu "giao diện hệ thống" */
.bang { background: var(--nen); border: 1px solid var(--vien-mo); border-radius: 10px; box-shadow: var(--phat);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); position: relative; }
.bang::before, .bang::after { content: ""; position: absolute; width: 10px; height: 10px; border: 2px solid var(--vien); pointer-events: none; }
.bang::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.bang::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.bang.nho { padding: 6px 9px; }
.tieu-de { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1.5px;
  color: var(--vien); font-weight: 700; padding: 8px 10px 6px; text-shadow: 0 0 6px rgba(79, 227, 255, 0.6); }
.nut-x { background: none; border: 0; color: var(--chu-mo); font-size: 18px; line-height: 1; padding: 0 4px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; }
.chip { display: inline-block; font-size: 12px; padding: 2px 7px; border-radius: 99px; background: rgba(79, 227, 255, 0.12);
  border: 1px solid var(--vien-mo); white-space: nowrap; }
.chip.xanh { color: var(--xanh); } .chip.cam { color: var(--cam); border-color: rgba(255, 180, 84, 0.4); background: rgba(255, 180, 84, 0.1); }
.nut-lon { width: 100%; padding: 11px; min-height: 44px; border-radius: 8px; border: 1px solid var(--vien); background: linear-gradient(#1f6f8c, #134a63);
  font-weight: 700; letter-spacing: 1px; box-shadow: var(--phat); }
.nut-lon:active { transform: translateY(1px); }
.nut-lon:disabled { opacity: 0.45; }
.loi { color: var(--do); min-height: 18px; font-size: 13px; margin-top: 6px; text-align: center; }

/* các màn phủ: đăng nhập, gục ngã, mở rương, thức tỉnh — nội dung dài hơn khung thì cuộn, không bị cắt */
.man { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: var(--z-man-che); overflow-x: hidden; overflow-y: auto;
  padding: calc(12px + var(--tren)) calc(12px + var(--phai)) calc(12px + var(--day)) calc(12px + var(--le)); }
.man > * { margin: auto; }
.man.phu { background: rgba(2, 10, 20, 0.6); z-index: var(--z-man-che); }
.khung-dn { width: min(360px, 100%); padding: 22px 20px 16px; text-align: center; }
.logo { font-size: 30px; font-weight: 900; letter-spacing: 4px; color: #bff6ff;
  text-shadow: 0 0 12px rgba(79, 227, 255, 0.9), 0 3px 0 #0e4a63; }
.logo.do { color: #ffd0d0; text-shadow: 0 0 12px rgba(255, 90, 90, 0.9), 0 3px 0 #5a1010; }
.phu-de { color: var(--chu-mo); font-size: 13px; margin: 6px 0 14px; }
/* A08: màn gục — nguyên nhân 1 dòng, phần mất là hàng chip, nơi tỉnh lại, lời nhắc */
#chet-nd p { margin: 0; }
#chet-nd .chet-ly { font-size: 15px; font-weight: 700; color: var(--chu); }
#chet-nd .chet-mat { margin: 10px 0; }
#chet-nd .chet-nhan, #chet-nd .chet-khong { display: block; font-size: 12px; color: var(--chu-mo); margin-bottom: 6px; }
#chet-nd .chet-khong { margin: 10px 0; }
#chet-nd .chet-ds { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
#chet-nd .chet-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 4px; border-radius: var(--bo-vien); background: rgba(255, 90, 90, .1); border: 1px solid rgba(255, 106, 106, .45); color: var(--chu); font-size: 13px; }
#chet-nd .chet-chip img { width: 22px; height: 22px; image-rendering: pixelated; }
#chet-nd .chet-chip b { color: var(--do); }
#chet-nd .chet-noi { font-size: 13px; line-height: 1.4; }
#chet-nd .chet-meo { margin-top: 6px; font-size: 12px; color: var(--vang); }
.tab-dn { display: flex; gap: 6px; margin-bottom: 10px; }
.tab-dn button { flex: 1; padding: 7px; min-height: 40px; border-radius: 7px; background: rgba(79, 227, 255, 0.06); border: 1px solid var(--vien-mo); color: var(--chu-mo); }
.tab-dn button.chon { color: var(--chu); background: rgba(79, 227, 255, 0.2); border-color: var(--vien); }
#form-dn input, #chat-form input { width: 100%; padding: 10px 11px; margin-bottom: 8px; border-radius: 7px; border: 1px solid var(--vien-mo);
  background: rgba(0, 10, 20, 0.6); color: var(--chu); font-size: 16px; outline: none; }
#form-dn input:focus, #chat-form input:focus { border-color: var(--vien); }
.dn-meo { font-size: 13px; font-weight: 600; color: #dff6ff; margin-top: 8px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); letter-spacing: .2px; }

/* ================= HUD (bố cục & nguyên tắc: docs/ui.md) =================
   Trên = thông tin (trái: mình · giữa: ngày giờ · phải: nút + bản đồ nhỏ). Dưới = thao tác (trái: cần điều khiển · phải: cụm nút hành động).
   Giữa màn để trống cho biển. Mọi mép đều cộng vùng an toàn (--tren/--le/--phai/--day). */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: var(--z-hud); }
#hud > * { pointer-events: auto; }
#hud > #hang-tren, #hud > #cot-trai, #hud > #nut-phu, #hud > #cum-lai { pointer-events: none; }
#hang-tren > *, #cot-trai > *, #cum-lai > * { pointer-events: auto; }

#hang-tren { position: absolute; top: calc(var(--mt) + var(--tren)); left: calc(var(--mep) + var(--le)); right: calc(var(--mep) + var(--phai) + var(--ban-do) + 10px);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 6px; }

/* ---- góc trên trái: chân dung + 3 thanh mảnh + điểm ---- */
#chi-so { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 7px; width: calc(176px * var(--hud)); padding: 3px 9px 3px 3px;
  border-radius: 28px 12px 12px 28px; background: linear-gradient(90deg, rgba(4, 14, 26, .82), rgba(4, 14, 26, .5)); border: 1px solid var(--vien-mo); }
#cs-chan { width: calc(46px * var(--hud)); height: calc(46px * var(--hud)); border-radius: 50%; padding: 0; overflow: hidden; border: 2px solid var(--vien);
  background: radial-gradient(circle at 50% 70%, #2a90b0, #0c3d57); box-shadow: 0 0 8px rgba(79, 227, 255, .45); display: block; }
#cs-anh { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; image-rendering: pixelated; display: block; pointer-events: none; }
.cs-vach { display: grid; gap: 2px; min-width: 0; }
.vach { display: grid; grid-template-columns: 11px minmax(0, 1fr) 21px; align-items: center; gap: 4px; height: 11px; }
.vach img, .vach .bieu-tuong { width: 11px; height: 11px; image-rendering: pixelated; }
.bieu-tuong.tim { display: block; background: radial-gradient(circle at 30% 30%, #ff9a9a, #e0283c 60%, #7a0f1e); border-radius: 50% 50% 45% 45%; }
.vach b { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .55); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); overflow: hidden; display: block; }
.vach b span { display: block; height: 100%; width: 50%; border-radius: 3px; transition: width .3s; }
#cs-mau b span { background: linear-gradient(90deg, #d42a40, #ff6d7a); }
#cs-doi b span { background: linear-gradient(90deg, #d07a1e, #ffb454); }
#cs-khat b span { background: linear-gradient(90deg, #2188cc, #5fd0ff); }
.vach em { font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; text-align: right; color: #fff; text-shadow: 0 1px 1px #000; font-variant-numeric: tabular-nums; }
.vach.thap b { animation: nhapNhay .8s infinite; }
.vach.thap em { color: #ff9a9a; }
@keyframes nhapNhay { 50% { box-shadow: 0 0 8px #ff4040, 0 0 0 1px #ff4040; } }
.hang-diem { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
#dst { color: var(--vang); text-shadow: 0 0 6px rgba(255, 216, 74, .5); }
#cap-be { color: var(--xanh); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
#chi-so > #nc-chip { grid-column: 1 / -1; margin: 3px 0 1px 6px; min-height: 24px; }

/* ---- giữa trên: ngày · giờ · thời tiết · bảo hộ trên một dòng mảnh ---- */
#dong-ho { justify-self: center; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; max-width: 100%; min-width: 0; overflow: hidden;
  border-radius: 99px; background: rgba(4, 14, 26, .62); border: 1px solid var(--vien-mo); font-size: 13px; font-weight: 800; white-space: nowrap; }
#dong-ho > * { flex: 0 0 auto; }
#dh-troi { filter: drop-shadow(0 0 4px #ffd84a); margin-right: -3px; }
#dh-gio { font-variant-numeric: tabular-nums; letter-spacing: .5px; }
#dong-ho .chip { font-size: 12px; font-weight: 700; padding: 1px 7px; border-color: transparent; }
#dong-ho #dh-thientai { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#online { color: var(--xanh); }
.dh-gon { display: none; }

/* ---- góc trên phải: hàng nút icon không chữ (bên trái bản đồ nhỏ) ---- */
#nut-tren { justify-self: end; display: flex; gap: 5px; align-items: flex-start; position: relative; z-index: 6; }
#nut-them { display: flex; gap: 5px; }
.nut-vuong { width: var(--nut); height: var(--nut); border-radius: 12px; background: var(--nen); border: 1px solid var(--vien-mo); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; position: relative; padding: 0; flex: 0 0 auto; }
.nut-vuong > * { pointer-events: none; }
.nut-vuong img { width: 62%; height: 62%; object-fit: contain; image-rendering: pixelated; }
.nut-vuong span { display: none; font-size: 12px; line-height: 1.1; color: var(--chu); white-space: nowrap; }
.nut-vuong kbd { position: absolute; left: 4px; bottom: 1px; font: 700 10px/1.2 system-ui, sans-serif; color: var(--chu-mo); }
.nut-vuong .nv-chu { font-size: 20px; font-weight: 400; line-height: 1; color: var(--chu); }
.nut-vuong:hover { border-color: var(--vien); }
.nut-vuong:active { transform: scale(.94); }
.nut-vuong.bat { border-color: var(--vien); background: rgba(31, 111, 140, .9); }
/* chấm đỏ số: nhỏ, không quầng sáng (trước 18px + glow kéo mắt ngang cảnh báo sinh tồn) */
.cham { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; border-radius: var(--bo-vien); background: var(--do);
  font-size: 10px; line-height: 1; font-weight: 800; font-style: normal; display: flex; align-items: center; justify-content: center; padding: 0 4px;
  box-shadow: 0 0 0 1.5px rgba(4, 14, 26, .85); color: #fff; }
body.cam-ung .nut-vuong kbd { display: none; }

/* ---- bản đồ nhỏ tròn: kim Bắc, mũi tên gió, tốc độ; bấm mở bảng bản đồ ---- */
#ban-do-nho { position: absolute; top: calc(var(--mt) + var(--tren)); right: calc(var(--mep) + var(--phai)); width: var(--ban-do); height: var(--ban-do); padding: 0; border-radius: 50%;
  border: 2px solid var(--vien); background: #0a2f48; box-shadow: 0 0 10px rgba(79, 227, 255, .45), 0 3px 8px rgba(0, 0, 0, .45); }
#ban-do-nho:active { transform: scale(.97); }
#bdn-cv { width: 100%; height: 100%; border-radius: 50%; display: block; pointer-events: none; }
#ban-do-nho::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; box-shadow: inset 0 0 12px rgba(2, 10, 20, .7); }
.bdn-kim { position: absolute; inset: -2px; pointer-events: none; transform: rotate(var(--goc, 0rad)); z-index: 1; }
.bdn-kim b { position: absolute; right: -8px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 800 10px/1 system-ui, sans-serif; transform: rotate(calc(-1 * var(--goc, 0rad))); }
#bdn-bac b { background: #e0283c; color: #fff; border: 1px solid #ffd0d0; box-shadow: 0 0 5px rgba(255, 90, 90, .7); }
#bdn-gio b { transform: none; background: var(--nen-dam); color: var(--xanh); border: 1px solid var(--xanh); font-size: 9px; }
#bdn-toc { position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
  white-space: nowrap; background: rgba(4, 14, 26, .7); border: 1px solid var(--vien-mo); color: var(--chu); pointer-events: none; }

/* ---- cột trái: nhiệm vụ một dòng (bấm thì bung) + dòng chat mới ---- */
#cot-trai { position: absolute; left: calc(var(--mep) + var(--le)); top: calc(var(--tren-cao, 60px) + 5px); width: min(290px, 42vw); display: flex; flex-direction: column;
  align-items: flex-start; gap: 5px; }
#nhiem-vu { width: 100%; padding-bottom: 8px; }
#nv-dau { cursor: pointer; }
.nv-nhan { white-space: nowrap; }
.nv-ngan, #nv-tom { display: none; }
#nv-nd { padding: 0 10px; font-size: 13px; }
#nv-thuong { padding: 6px 10px 0; display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--vang); align-items: center; }
#nv-thuong img { width: 20px; height: 20px; image-rendering: pixelated; vertical-align: middle; }
#nhiem-vu.thu-gon { width: auto; max-width: 100%; padding: 0; border-radius: 99px; background: rgba(4, 14, 26, .62); box-shadow: none; backdrop-filter: none; }
#nhiem-vu.thu-gon::before, #nhiem-vu.thu-gon::after { display: none; }
#nhiem-vu.thu-gon .tieu-de { padding: 0 11px 0 9px; min-height: 26px; gap: 6px; font-size: 11px; letter-spacing: .5px; position: relative; }
#nhiem-vu.thu-gon .tieu-de::after { content: ""; position: absolute; inset: -9px -4px; } /* vùng bấm ≥ 44px */
#nhiem-vu.thu-gon .nv-dai, #nhiem-vu.thu-gon .nut-x { display: none; }
#nhiem-vu.thu-gon .nv-ngan { display: inline-block; padding: 1px 6px; border-radius: 99px; background: rgba(79, 227, 255, .18); }
#nhiem-vu.thu-gon #nv-tom { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--chu); text-shadow: none; }
#nhiem-vu.thu-gon #nv-nd, #nhiem-vu.thu-gon #nv-thuong { display: none; }
#nhiem-vu.xong { animation: nvXong .9s; }
@keyframes nvXong { 30% { box-shadow: 0 0 24px var(--xanh); border-color: var(--xanh); } }
#chat-moi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 100%; cursor: pointer; }
#chat-moi:empty { display: none; }
#chat-moi p { margin: 0; max-width: 100%; padding: 2px 9px; border-radius: 9px; background: rgba(4, 14, 26, .55); font-size: 12.5px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; animation: tbVao .25s ease-out; transition: opacity .6s; }
#chat-moi p.ra { opacity: 0; }
#chat-moi p b { color: #9fe8ff; }
#chat-moi p.he { color: var(--vang); } #chat-moi p.khoe, #chat-moi p.rieng { color: #ffc6f0; }

/* ---- khung trò chuyện: chỉ hiện khi bấm nút Chat / dòng chat mới ---- */
/* #chat nằm ngoài #hud (index.html): fixed, toạ độ giữ như cũ (#hud là khung fixed phủ toàn màn); ẩn theo #hud và theo các chế độ ẩn HUD */
#chat { position: fixed; left: calc(var(--mep) + var(--le)); bottom: calc(var(--mep) + var(--day)); width: 320px; height: 250px; display: flex; flex-direction: column; z-index: var(--z-chat); }
#chat.an { display: none; }
#hud[hidden] ~ #chat { display: none !important; }
body.ngam-canh #chat, body.cam-ung:is(.dang-xay, .dang-sx) #chat { visibility: hidden !important; pointer-events: none !important; }#chat > .tieu-de { min-height: 38px; padding: 4px 4px 4px 10px; }
#chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px; font-size: 13px; -webkit-user-select: text; user-select: text; touch-action: pan-y; }
#chat-log p { margin: 0 0 3px; word-wrap: break-word; overflow-wrap: anywhere; }
#chat-log b { color: #9fe8ff; }
#chat-log p.he { color: var(--vang); text-shadow: 0 0 6px rgba(255, 216, 74, .35); }
#chat-log p.he b { color: var(--vien); }
#chat-log p.khoe, #chat-log p.rieng { color: #ffc6f0; }
#chat-log b[data-ten] { cursor: pointer; }
#chat-form { display: flex; gap: 5px; padding: 6px 8px 8px; }
#chat-form input { margin: 0; padding: 7px 9px; font-size: 14px; min-width: 0; }
#chat-form button { border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .15); padding: 0 12px; flex: 0 0 auto; }

/* ---- thanh cầm: một hàng, cuộn ngang, giữa dưới ---- */
#thanh-cam { position: absolute; bottom: calc(8px + var(--day)); left: 50%; transform: translateX(-50%); display: flex; gap: var(--o-ke); padding: 4px;
  max-width: min(620px, calc(100vw - 16px - var(--le) - var(--phai))); border-radius: 14px; background: rgba(4, 14, 26, .42);
  overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
#thanh-cam::-webkit-scrollbar { display: none; }
#thanh-cam:empty { display: none; }
#thanh-cam.tran:not(.het-cuon) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 12px), transparent); }
.o-cam { width: var(--o-cam); height: var(--o-cam); flex: 0 0 auto; border-radius: 10px; background: var(--nen); border: 1px solid var(--vien-mo); position: relative;
  display: flex; align-items: center; justify-content: center; padding: 0; }
.o-cam img { width: 72%; height: 72%; image-rendering: pixelated; pointer-events: none; }
.o-cam.chon { border-color: var(--vien); box-shadow: 0 0 8px rgba(79, 227, 255, .85), inset 0 0 12px rgba(79, 227, 255, .28); }
.o-cam .so { position: absolute; bottom: 1px; right: 4px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.o-cam .phim { position: absolute; top: 1px; left: 4px; font-size: 11px; line-height: 1.1; color: var(--chu-mo); }
#goi-y { position: absolute; bottom: calc(var(--o-cam) + 22px + var(--day)); left: 50%; transform: translateX(-50%); font-size: 12px; color: rgba(226, 251, 255, .78);
  background: rgba(4, 14, 26, .5); padding: 3px 12px; border-radius: 99px; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
#hud > #goi-y { pointer-events: none; }
/* PC (chuột): LUÔN hiện đủ 9 ô ở mọi cỡ cửa sổ (21/11, góp ý "thanh này ko full — số 9": trần 620 px cũ cắt ô 9 ở 1920 px vì --nen-co 1,3,
   cỡ giao diện To cắt cả ô 8). Ô co theo bề ngang còn lại (--o-pc), thanh nằm giữa; khung chat mở ở góc trái dưới thì thanh né sang phải.
   Dòng gợi ý phím xuống dòng thay vì cắt "…", né khung chat như thanh. Đo: tools/chup_thanh_do.mjs */
body:not(.cam-ung) {
  --tc-trai: calc(var(--mep) + var(--le) + 8px); --tc-phai: calc(var(--mep) + var(--phai) + 8px);
  --o-pc: max(32px, min(var(--o-cam), calc((100vw - var(--tc-trai) - var(--tc-phai) - 8px - 8 * var(--o-ke)) / 9)));
  --tc-rong: calc(9 * var(--o-pc) + 8 * var(--o-ke) + 8px);
  --tc-tam: clamp(calc(var(--tc-trai) + var(--tc-rong) / 2), 50vw, calc(100vw - var(--tc-phai) - var(--tc-rong) / 2));
}
@media (min-width: 621px) { body:not(.cam-ung):has(#chat:not(.an)) { --tc-trai: calc(var(--mep) + var(--le) + 330px); } }
body:not(.cam-ung) #thanh-cam { left: var(--tc-tam); max-width: calc(100vw - var(--tc-trai) - var(--tc-phai)); }
body:not(.cam-ung) #thanh-cam .o-cam { width: var(--o-pc); height: var(--o-pc); }
body:not(.cam-ung) #goi-y { left: var(--tc-tam); bottom: calc(var(--o-pc) + 22px + var(--day)); white-space: normal; text-align: center; width: max-content; line-height: 1.35;
  border-radius: 12px; max-width: min(780px, calc(2 * (var(--tc-tam) - var(--tc-trai))), calc(2 * (100vw - var(--tc-phai) - var(--tc-tam)))); }
body:not(.cam-ung) #cum-lai { bottom: calc(var(--o-pc) + 30px + max(22px, var(--gy-cao, 22px)) + var(--day)); }   /* --gy-cao: giao_dien.ts đo #goi-y */

/* ================= điều khiển cảm ứng =================
   Trái dưới: cần điều khiển nổi (#vung-can, dieu_khien.ts). Phải dưới: nút chính + nút ngữ cảnh xếp vòng cung (hud.ts đặt left/top).
   body.tay-trai đổi bên. */
#dpad, #nut-chinh, #nut-phu, #cum-lai:empty { display: none; }
body.cam-ung #nut-chinh { display: block; position: absolute; right: calc(var(--nc-phai) + var(--phai)); bottom: calc(var(--nc-day) + var(--day));
  width: var(--nc); height: var(--nc); touch-action: none; z-index: 3; }
#nut-chinh .vong { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 38%, rgba(48, 150, 184, .95), rgba(9, 40, 62, .9) 72%);
  border: 2px solid var(--vien); box-shadow: var(--phat), 0 4px 10px rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
#nut-chinh.giat .vong { background: radial-gradient(circle, #ff6a3d, #8a1d12); border-color: #ffd0a0; animation: giat .25s infinite alternate; }
@keyframes giat { to { transform: scale(1.08); } }
#nut-chinh.an .vong { transform: scale(.94); }

body.cam-ung #nut-phu { display: block; position: fixed; inset: 0; z-index: 3; }
body.cam-ung #nut-phu button, body.cam-ung .nut-vong, html body.cam-ung #dao-thanh .dao-nut {
  position: absolute; left: -200px; top: -200px; width: var(--vc); height: var(--vc); min-width: 0; min-height: 0; padding: 3px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; text-align: center; overflow: hidden; pointer-events: auto;
  background: var(--nen); border: 1.5px solid var(--vien); box-shadow: 0 0 8px rgba(79, 227, 255, .4), 0 3px 8px rgba(0, 0, 0, .4);
  font-size: 11px; font-weight: 800; line-height: 1.08; color: var(--chu); white-space: normal; transition: left .14s ease-out, top .14s ease-out; }
/* nhấn là thấy (hoc_avatar_ui.md việc 1, nợ ★12): đổi nền + viền sáng, không chỉ co lại. Viền riêng từng nút đã bỏ (một kiểu viền chung) */
body.cam-ung #nut-phu button:active, body.cam-ung .nut-vong:active, html body.cam-ung #dao-thanh .dao-nut:active { transform: scale(.93);
  background: rgba(46, 150, 186, .95); border-color: #e8fbff; box-shadow: 0 0 12px rgba(79, 227, 255, .85), 0 2px 6px rgba(0, 0, 0, .45); }
/* chữ nút vòng cung (chu_vong.ts datChuVong): biểu tượng dòng trên + tên ngắn MỘT dòng dưới, không xuống hàng */
body.cam-ung .nut-vong .nv-i { display: block; font-style: normal; font-size: 17px; line-height: 1.1; }
body.cam-ung .nut-vong .nv-c { display: block; max-width: 100%; font-size: 10.5px; line-height: 1.15; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* thanh đảo / tàu buôn (dao.css) trên cảm ứng: nút nhập vào vòng cung, chip giờ nằm dưới bản đồ nhỏ */
html body.cam-ung #dao-thanh { inset: 0; top: 0; right: 0; bottom: 0; left: 0; max-width: none; display: block; z-index: var(--z-duoi-hud); }
html body.cam-ung #dao-thanh .dao-hang { display: contents; }
html body.cam-ung #dao-thanh .dao-nut img { width: 44%; height: 44%; flex: 0 0 auto; }
html body.cam-ung #dao-thanh .dao-nut span { display: block; max-width: 100%; }
html body.cam-ung #dao-thanh .dao-nut b { display: block; font-size: 10px; line-height: 1.05; letter-spacing: 0; overflow: hidden; max-height: 2.1em; }
html body.cam-ung #dao-thanh .dao-nut small { display: none; }
html body.cam-ung #dao-thanh .dao-nut.chinh { border-color: var(--vang); background: linear-gradient(rgba(120, 82, 22, .94), rgba(70, 44, 10, .95)); }
html body.cam-ung #dao-thanh .dao-nut.nc { border-color: #ff9ad0; }
html body.cam-ung #dao-thanh .dao-nut.nc img { border-radius: 50%; }
html body.cam-ung #dao-thanh .dao-chip { position: absolute; top: calc(var(--tren) + var(--ban-do) + 30px); right: calc(var(--mep) + var(--phai)); max-width: min(240px, 46vw);
  font-size: 12px; padding: 2px 10px 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* chỗ đặt cụm lái / buồm / neo: phía trên vòng cung bên tay phải (máy tính: giữa dưới, trên thanh cầm) */
#cum-lai { position: absolute; left: 50%; bottom: calc(var(--o-cam) + 52px + var(--day)); transform: translateX(-50%); display: flex; gap: 8px; align-items: flex-end; }
body.cam-ung #cum-lai { left: auto; transform: none; right: calc(var(--nc-phai) + var(--phai)); bottom: calc(var(--vong-dinh) + 10px + var(--day));
  flex-wrap: wrap-reverse; justify-content: flex-end; max-width: 46vw; }

body.cam-ung #goi-y { display: none; }
/* thanh cầm trên cảm ứng: nằm giữa vùng cần điều khiển và cụm nút */
body.cam-ung #thanh-cam { --tc-trai: calc(var(--can-rong) + 6px); --tc-phai: calc(var(--nc-phai) + var(--nc) + var(--vc) + 18px + var(--phai));
  left: var(--tc-trai); right: var(--tc-phai); transform: none; margin: 0 auto; width: fit-content; max-width: calc(100% - var(--tc-trai) - var(--tc-phai)); bottom: calc(5px + var(--day)); }
body.cam-ung .o-cam .phim { display: none; }
body.cam-ung #chat-form input { font-size: 16px; }
body.cam-ung #chat-form button { min-height: 44px; }
/* đang gõ chat trên máy cảm ứng: nổi lên ngay trên bàn phím ảo */
body.cam-ung #chat:focus-within { z-index: var(--z-chat); top: auto; bottom: calc(var(--ban-phim, 0px) + 6px); height: min(250px, calc(var(--vv-cao, var(--cao)) - 12px)); }

/* thuận tay trái: cần điều khiển sang phải, cụm nút sang trái */
body.cam-ung.tay-trai #vung-can { left: auto; right: 0; }
body.cam-ung.tay-trai #can-di.nghi { left: calc(100% - var(--can-r, 54px) - 30px) !important; }
body.cam-ung.tay-trai #nut-chinh { right: auto; left: calc(var(--nc-phai) + var(--le)); }
body.cam-ung.tay-trai #thanh-cam { --tc-trai: calc(var(--nc-phai) + var(--nc) + var(--vc) + 18px + var(--le)); --tc-phai: calc(var(--can-rong) + 6px); }
body.cam-ung.tay-trai #cum-lai { right: auto; left: calc(var(--nc-phai) + var(--le)); justify-content: flex-start; }
/* cảm ứng: thanh cuộn ngang bắt theo từng ô; màn ngang thì bề rộng = SỐ Ô NGUYÊN (bội số bước ô) → mép không còn ô bị cắt nửa (< 44 px,
   docs/hoc/gon_nut_man_nho.md). Trình duyệt chưa có round() giữ như cũ (vẫn cuộn bắt ô). */
body.cam-ung #thanh-cam { scroll-snap-type: x mandatory; scroll-padding: 0 4px; }
body.cam-ung #thanh-cam .o-cam { scroll-snap-align: start; }
@supports (width: round(down, 100px, 7px)) {
  @media (orientation: landscape) {
    body.cam-ung #thanh-cam { max-width: calc(round(down, 100% - var(--tc-trai) - var(--tc-phai) - 8px + var(--o-ke), var(--o-cam) + var(--o-ke)) - var(--o-ke) + 8px); }
  }
}

/* ================= thông báo: dưới dòng ngày giờ, không che giữa màn ================= */
#thong-bao { position: fixed; top: calc(var(--dh-day, 34px) + 8px); left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 5px;
  align-items: center; pointer-events: none; width: min(460px, calc(100vw - 420px)); min-width: 250px; }
.tb { background: var(--nen-dam); border: 1px solid var(--vien); border-radius: 8px; padding: 6px 13px; box-shadow: var(--phat); font-size: 13px;
  animation: tbVao .25s ease-out; text-align: center; max-width: 100%; }
/* 15/11 hàng đợi thông báo (thong_bao_hang.ts): MỘT toast, tối đa 2 dòng, không tiền tố "[Hệ thống]" chiếm chỗ; vị trí do JS đo (inline style) */
#thong-bao .tb { padding: 5px 11px; line-height: 1.3; overflow-wrap: anywhere; }
#thong-bao .tb-chu, #dai-khan .tb-chu { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#thong-bao[data-hep] .tb-chu, #dai-khan[data-hep] .tb-chu { -webkit-line-clamp: 3; } #thong-bao[data-hep] .tb, #dai-khan[data-hep] { font-size: 12.5px; }
#thong-bao .tb .tb-n { color: var(--vang); margin-left: 2px; }
.tb::before { content: none; }
.tb.loi { border-color: var(--do); box-shadow: 0 0 10px rgba(255, 90, 90, .5); } .tb.loi::before, .tb.loi .tb-chu::before { color: var(--do); content: "✖ "; } .tb.loi:has(.tb-chu)::before { content: none; }
.tb.tot { border-color: var(--xanh); }
.tb.canh { border-color: var(--cam); box-shadow: 0 0 12px rgba(255, 180, 84, .6); } .tb.canh::before, .tb.canh .tb-chu::before { color: var(--cam); content: "⚠ "; } .tb.canh:has(.tb-chu)::before { content: none; }
.tb.ra { animation: tbRa .3s forwards; }
/* dải KHẨN (thong_bao_hang.ts hienKhan): một dải ở dải trống cao nhất (đo thật, như toast), tin mới thay tin cũ */
#dai-khan { position: fixed; z-index: var(--z-hud-noi); box-sizing: border-box; pointer-events: none; max-width: min(440px, calc(100vw - 24px)); padding: 6px 12px; border-radius: 10px; background: rgba(70, 18, 18, .88); color: #fff;
  border: 2px solid #ff6a4a; font-size: 13.5px; font-weight: 700; line-height: 1.3; text-align: center; box-shadow: 0 3px 12px rgba(0, 0, 0, .45); }
#dai-khan[hidden] { display: none; }
/* dòng nhắc giới hạn công trình khi đang cầm món để đặt (gioi_han_dat.ts): vị trí do JS đo như toast; het = đảo đã đủ số theo cấp */
#nhac-gioi-dat { position: fixed; z-index: var(--z-hud-noi); box-sizing: border-box; pointer-events: none; max-width: min(400px, calc(100vw - 24px)); padding: 5px 11px; border-radius: 9px;
  background: rgba(14, 32, 44, .86); color: #e9f6ff; border: 1px solid rgba(120, 220, 200, .7); font-size: 12.5px; font-weight: 600; line-height: 1.3; text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
#nhac-gioi-dat.het { background: rgba(62, 22, 20, .9); border-color: #ff7a6a; color: #fff; }
#nhac-gioi-dat[hidden] { display: none; }
.dong-che .ten small.gh-dat { font-size: 11px; font-weight: 600; color: #8fe0c8; margin-left: 4px; white-space: nowrap; }
.dong-che .ten small.gh-dat.het { color: #ff8a7a; }
#dai-khan b { color: var(--vang); }
#dai-khan.vao { animation: khanVao .35s ease-out; }
@keyframes khanVao { from { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(255, 106, 74, .55); } }
@media (prefers-reduced-motion: reduce) { #dai-khan.vao, #thong-bao .tb { animation: none; } }
/* thẻ nhắc .the-nhac (thong_bao_hang.ts xepThe): JS đặt vào chỗ trống; nút "–" thu thành chấm tròn, chạm chấm mở lại */
.the-nhac .tn-gon { position: absolute; top: 4px; right: 44px; width: 36px; height: 36px; border: 0; background: none; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.the-nhac > b:first-of-type { padding-right: 76px; }
.the-nhac.gon { width: 44px !important; height: 44px; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer; }
.the-nhac.gon > * { display: none !important; }
.the-nhac.gon::after { content: "💡"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
/* Cài đặt → "Thông báo trên màn": ba nút chọn */
.cd-tb-che .cd-chon { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.cd-tb-che .cd-chon button { min-height: 34px; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--vien); background: rgba(4, 14, 26, .6); color: var(--chu); font-size: 12.5px; cursor: pointer; }
.cd-tb-che .cd-chon button.bat { background: var(--vien); color: #04121f; font-weight: 800; }
@keyframes tbVao { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
@keyframes tbRa { to { opacity: 0; transform: translateY(-6px); } }

/* ================= bảng lớn: túi, chế tạo, hệ thống ================= */
.bang.lon { position: fixed; z-index: var(--z-bang); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 20px - var(--le) - var(--phai)));
  max-height: calc(var(--cao) - 20px - var(--tren) - var(--day)); display: flex; flex-direction: column; background: var(--nen-dam); }
.bang.lon > .tieu-de { flex: 0 0 auto; }
.than-tui { display: flex; gap: 10px; padding: 0 10px 10px; min-height: 0; }
#luoi-tui { display: grid; grid-template-columns: repeat(auto-fill, 54px); gap: 6px; flex: 1; align-content: start; overflow-y: auto; max-height: calc(var(--cao, 100vh) * 0.6);
  overscroll-behavior: contain; padding: 2px; }
.o-tui { width: 54px; height: 54px; border-radius: 8px; background: rgba(79, 227, 255, 0.06); border: 1px solid var(--vien-mo); position: relative; padding: 0;
  display: flex; align-items: center; justify-content: center; }
.o-tui img { width: 38px; height: 38px; image-rendering: pixelated; }
.o-tui .so { position: absolute; bottom: 1px; right: 4px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.o-tui.chon { border-color: var(--vien); box-shadow: 0 0 10px rgba(79, 227, 255, 0.7); }
/* bảng Túi: ô trống còn lại + món không chiếm ô (công cụ) */
i.o-tui.o-trong { display: block; background: rgba(79, 227, 255, 0.02); border-style: dashed; opacity: .55; }
.o-tui.khong-tinh { background: rgba(255, 216, 102, 0.07); }
.o-tui.p3 { border-color: #c684ff; } .o-tui.p4 { border-color: #ffd84a; } .o-tui.p5 { border-color: #ff6a5a; }
#chi-tiet { width: 190px; flex: 0 0 auto; border-left: 1px solid var(--vien-mo); padding-left: 10px; overflow-y: auto; overscroll-behavior: contain; }
#chi-tiet .ten { font-weight: 800; font-size: 15px; margin: 4px 0; }
#chi-tiet img.to { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
#chi-tiet .mo-ta { color: var(--chu-mo); font-size: 12px; margin-bottom: 8px; }
#chi-tiet .hang-nut { display: grid; gap: 6px; }
#chi-tiet button { padding: 8px; min-height: 40px; border-radius: 7px; border: 1px solid var(--vien); background: rgba(79, 227, 255, 0.15); font-weight: 700; }
.trong { color: var(--chu-mo); padding: 20px; text-align: center; }
#luoi-tui .trong { grid-column: 1 / -1; }
#ds-che { overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 10px; display: grid; gap: 6px; max-height: calc(var(--cao, 100vh) * 0.7); align-content: start; }
.dong-che { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: var(--cach) 10px; border-radius: var(--bo-the);
  border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, 0.04); }
.dong-che.du { border-color: var(--xanh); background: rgba(111, 255, 210, 0.06); }
.dong-che > img { width: 42px; height: 42px; image-rendering: pixelated; }
.dong-che .ten { font-weight: 700; }
.dong-che .can { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 2px; }
.dong-che .can span { display: inline-flex; align-items: center; gap: 2px; }
.dong-che .can img { width: 18px; height: 18px; image-rendering: pixelated; }
.dong-che .can .thieu { color: var(--do); }
.dong-che .mo-ta { font-size: var(--chu-phu); line-height: 1.35; color: var(--chu-mo); margin-top: 2px; }
/* dòng đang đóng: mô tả 1 dòng, ghi chú vũ khí chỉ hiện khi mở dòng → các dòng cao gần bằng nhau. Tên, nguyên liệu, nút Chế luôn thấy. */
.dong-che:not(.mo) .mo-ta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dong-che:not(.mo) .che-vk { display: none; }   /* chỉ số vũ khí; điều kiện / giới hạn (.che-dk khác) vẫn luôn hiện */
.dong-che > div { min-width: 0; }
.dong-che button { padding: 8px 14px; min-height: 40px; border-radius: var(--bo-the); border: 1px solid var(--vien); background: rgba(79, 227, 255, 0.2); font-weight: 700; }
.dong-che button:disabled { opacity: 0.35; }

/* ================= mở rương ================= */
.khung-ruong { text-align: center; }
#cv-ruong { width: min(408px, 90vw, calc((var(--cao) - 250px) * 0.944)); min-width: 200px; height: auto; image-rendering: pixelated; display: block; margin: 0 auto -30px; }
.ruong-phai { position: relative; }
#ruong-ten { font-weight: 900; font-size: 20px; letter-spacing: 2px; margin-bottom: 10px; text-shadow: 0 0 10px currentColor; }
#ruong-do { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: 420px; margin: 0 auto 12px; }
.the-do { width: 76px; padding: 6px 4px; border-radius: 9px; background: var(--nen-dam); border: 1px solid var(--vien); box-shadow: var(--phat);
  animation: theVao 0.35s ease-out backwards; font-size: 12px; line-height: 1.2; }
.the-do img { width: 40px; height: 40px; image-rendering: pixelated; display: block; margin: 0 auto 2px; }
.the-do b { display: block; font-size: 13px; color: var(--vang); }
@keyframes theVao { from { opacity: 0; transform: translateY(14px) scale(0.6); } }
#ruong-nhan { width: 200px; }

#mat-ket-noi { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: var(--z-man-che); padding: 12px 18px; border-radius: 10px; /* vị trí thật: xem "HUD 2" cuối tệp */
  background: var(--nen-dam); border: 1px solid var(--cam); color: var(--cam); font-weight: 700; max-width: calc(100vw - 24px); text-align: center; }

/* ---- đợt 2: điểm, hệ thống, thức tỉnh ---- */
.tab-ht { display: flex; gap: 6px; padding: 0 10px 8px; flex: 0 0 auto; }
.tab-ht button { flex: 1; padding: 7px 4px; min-height: 38px; border-radius: 7px; background: rgba(79, 227, 255, .06); border: 1px solid var(--vien-mo); color: var(--chu-mo); font-weight: 700; font-size: 13px; white-space: nowrap; }
.tab-ht button.chon { color: var(--chu); background: rgba(79, 227, 255, .2); border-color: var(--vien); }
#than-ht { overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 12px; max-height: calc(var(--cao, 100vh) * 0.66); }
.thanh { height: 8px; border-radius: 6px; background: rgba(0, 0, 0, .5); overflow: hidden; margin: 8px 0 3px; border: 1px solid rgba(255, 255, 255, .12); }
.thanh span { display: block; height: 100%; background: linear-gradient(90deg, #c48412, #ffe066); }
.thanh.xanh span { background: linear-gradient(90deg, #1e9c78, #6fffd2); }
.nho-mo { font-size: 12px; color: var(--chu-mo); }
.dong-nv { border: 1px solid var(--vien-mo); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.dong-nv.xong { border-color: var(--xanh); opacity: .7; }
.dong-nv .ten { font-weight: 700; }
.dong-nv .nut-nv-doi { font-size: 11px; padding: 1px 7px; margin-left: 6px; border-radius: 6px; vertical-align: middle; font-weight: 400; min-height: 0; }
.dong-nv .thuong { font-size: 12px; color: var(--vang); display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.dong-nv .thuong img { width: 18px; height: 18px; image-rendering: pixelated; }
.dau-ch { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; color: var(--chu-mo); gap: 6px; flex-wrap: wrap; }
.dau-ch b { color: var(--vang); }
.luoi-ch { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.mon-ch { border: 1px solid var(--vien-mo); border-radius: var(--bo-the); padding: 8px; display: flex; flex-direction: column; gap: 6px; background: rgba(79, 227, 255, .04); }
.mon-dau { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: center; }
.mon-chu { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mon-ch .gia-dong, .mon-ch .gia { white-space: nowrap; }
.mon-ch .con { font-size: var(--chu-phu); }
.mon-ch > button { margin-top: auto; }
.mon-ch.dac-biet { border-color: var(--vang); box-shadow: 0 0 10px rgba(255, 216, 74, .25); }
.mon-ch.khoa { opacity: .45; }
.mon-ch img { width: 40px; height: 40px; image-rendering: pixelated; }
.mon-ch .ten { font-weight: 700; font-size: var(--chu-td); line-height: 1.2; }
.mon-ch .gia { color: var(--vang); font-weight: 800; font-size: 13px; }
.mon-ch .gia s { color: var(--chu-mo); font-weight: 400; margin-right: 4px; }
.mon-ch button, .dong-cho button, .dang-cho button { grid-column: span 2; padding: 6px; min-height: var(--cham-pc); border-radius: var(--bo-the); border: 1px solid var(--vien); background: rgba(79, 227, 255, .2); font-weight: 700; }
.mon-ch button:disabled { opacity: .4; }
.dang-cho { display: grid; grid-template-columns: 1fr 64px 76px auto; gap: 5px; margin-bottom: 8px; align-items: center; }
.dang-cho select, .dang-cho input { padding: 7px; min-height: 36px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(0, 10, 20, .6); color: var(--chu); font: inherit; font-size: 14px; min-width: 0; -webkit-user-select: text; user-select: text; }
.dang-cho button { grid-column: auto; padding: 7px 10px; }
.dong-cho { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--vien-mo); border-radius: 8px; margin-bottom: 5px; }
.dong-cho.cua-toi { border-color: var(--xanh); }
.dong-cho img { width: 34px; height: 34px; image-rendering: pixelated; }
.dong-cho .gia { color: var(--vang); font-weight: 800; }
.dong-cho button { grid-column: auto; padding: 6px 12px; }
#chat-log p.rieng { color: #ffc6f0; }
#chat-log b[data-ten] { cursor: pointer; }

/* nút trong bảng trên cảm ứng: đủ to để bấm */
body.cam-ung .tab-ht button, body.cam-ung .tab-dn button { min-height: 44px; }
body.cam-ung #chi-tiet button, body.cam-ung .dong-che button, body.cam-ung .mon-ch button, body.cam-ung .dong-cho button,
body.cam-ung .dang-cho button, body.cam-ung .dang-cho select, body.cam-ung .dang-cho input { min-height: 44px; }
body.cam-ung .dang-cho select, body.cam-ung .dang-cho input { font-size: 16px; }

/* ================= đợt 3: xã hội — bảng Bạn bè (xa_hoi_ui.ts) ================= */
.tab-xh { display: flex; gap: 6px; padding: 0 10px 8px; flex: 0 0 auto; }
.tab-xh button { flex: 1; position: relative; padding: 7px 4px; min-height: 40px; border-radius: 7px; background: rgba(79, 227, 255, .06); border: 1px solid var(--vien-mo);
  color: var(--chu-mo); font-weight: 700; font-size: 13px; white-space: nowrap; }
.tab-xh button.chon { color: var(--chu); background: rgba(79, 227, 255, .2); border-color: var(--vien); }
.tab-xh .cham { top: -6px; right: -4px; }
/* chiều cao cố định: đổi tab / nội dung dài ngắn thì bảng không nhảy chỗ */
#than-xh { overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 12px; flex: 1 1 auto; min-height: 0; }
.xh-tim { display: flex; gap: 6px; margin-bottom: 4px; }
.xh-tim input, .tang-nd, .tang-sl input { min-width: 0; padding: 8px 10px; min-height: 40px; border-radius: 7px; border: 1px solid var(--vien-mo);
  background: rgba(0, 10, 20, .6); color: var(--chu); font: inherit; font-size: 15px; outline: none; -webkit-user-select: text; user-select: text; }
.xh-tim input { flex: 1; }
.xh-tim input:focus, .tang-nd:focus, .tang-sl input:focus { border-color: var(--vien); }
.xh-tim button, .xh-nut button, .hs-nut button, .xh-loai button, .xh-nhan-het, .tang-sl button {
  min-height: 40px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .12); font-weight: 700; white-space: nowrap; }
.xh-tim button, .xh-nut button.chinh, .hs-nut button.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.xh-nut button:disabled, .hs-nut button:disabled { opacity: .4; }
.hs-nut button.da:disabled { opacity: 1; color: var(--xanh); border-color: rgba(111, 255, 210, .5); background: rgba(111, 255, 210, .08); }
.xh-muc { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; letter-spacing: 1px;
  color: var(--vien); font-weight: 700; margin: 12px 0 6px; }
.xh-luot { letter-spacing: 0; color: var(--vang); font-weight: 700; }
.xh-dong { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; min-height: 56px;
  border: 1px solid var(--vien-mo); border-radius: 9px; margin-bottom: 6px; background: rgba(79, 227, 255, .04); cursor: pointer; }
.xh-dong:active { background: rgba(79, 227, 255, .12); }
.xh-dong.dang-on { border-color: rgba(111, 255, 210, .55); }
.xh-dong.moi { border-color: var(--vang); box-shadow: 0 0 10px rgba(255, 216, 74, .2); }
.xh-dong.nho { grid-template-columns: minmax(0, 1fr) auto; min-height: 48px; }
.xh-dong.thu { cursor: default; }
.xh-anh { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 8px; background: rgba(79, 227, 255, .1); object-fit: contain; }
.xh-giua { min-width: 0; }
.xh-giua b { overflow-wrap: anywhere; }
.xh-giua .nho-mo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xh-nut { display: flex; gap: 6px; }
.xh-nut button img { width: 20px; height: 20px; image-rendering: pixelated; vertical-align: middle; margin: -2px 4px 0 -2px; }
.xh-on { color: var(--xanh); }
.xh-off { color: var(--chu-mo); }
.xh-qua { width: 40px; height: 40px; image-rendering: pixelated; }
.xh-loi-nhan { font-size: 13px; color: #ffe9a8; font-style: italic; margin-top: 2px; overflow-wrap: anywhere; }
.xh-giua a { color: #9fe8ff; font-weight: 700; cursor: pointer; text-decoration: underline dotted; }
.xh-nhan-het { border-color: var(--xanh) !important; color: var(--xanh); letter-spacing: 0; }
/* xếp hạng */
.xh-loai { display: flex; gap: 6px; margin: 2px 0 8px; position: sticky; top: 0; z-index: 1; background: var(--nen-dam); padding: 2px 0 6px; }
.xh-loai button { flex: 1; font-size: 13px; padding: 6px 4px; color: var(--chu-mo); }
.xh-loai button.chon { color: var(--chu); border-color: var(--vang); background: rgba(255, 216, 74, .14); }
.xh-dong.hang { grid-template-columns: 34px minmax(0, 1fr) auto; min-height: 48px; padding: 4px 10px 4px 6px; margin-bottom: 4px; }
.xh-so { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px;
  background: rgba(79, 227, 255, .1); border: 1px solid var(--vien-mo); }
.xh-dong.h1 .xh-so { background: linear-gradient(#ffe066, #c48412); color: #3a2500; border-color: #ffe066; box-shadow: 0 0 10px rgba(255, 216, 74, .6); }
.xh-dong.h2 .xh-so { background: linear-gradient(#f2f6ff, #8c9bb0); color: #1d2633; border-color: #e6eefc; }
.xh-dong.h3 .xh-so { background: linear-gradient(#ffc08a, #a35a22); color: #2f1500; border-color: #ffc08a; }
.xh-dong.cua-toi { border-color: var(--xanh); background: rgba(111, 255, 210, .08); }
.xh-diem { font-weight: 800; color: var(--vang); white-space: nowrap; }
#xh-ds { min-height: 100%; display: flex; flex-direction: column; }
.xh-cua-toi { position: sticky; bottom: -12px; margin: auto -10px -12px; margin-top: auto; padding: 10px 12px; background: var(--nen-dam);
  border-top: 1px solid var(--vien); color: var(--chu); font-size: 14px; text-align: center; }
.xh-cua-toi b { color: var(--xanh); font-size: 16px; }
.xh-ghi { text-align: center; margin-top: 6px; }

/* thẻ hồ sơ nổi trên mọi bảng */
#ho-so { position: fixed; z-index: var(--z-bang-tren); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 24px - var(--le) - var(--phai)));
  max-height: calc(var(--cao) - 24px - var(--tren) - var(--day)); display: flex; flex-direction: column; background: var(--nen-dam);
  box-shadow: 0 0 0 100vmax rgba(2, 10, 20, .45), var(--phat); }
#than-ho-so { overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 12px; min-height: 0; }
.hs-dau { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.hs-anh { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 12px; border: 1px solid var(--vien);
  background: radial-gradient(circle, rgba(79, 227, 255, .25), rgba(79, 227, 255, .04)); object-fit: contain; flex: 0 0 auto; box-shadow: var(--phat); }
.hs-ten { font-size: 20px; font-weight: 900; letter-spacing: .5px; overflow-wrap: anywhere; text-shadow: 0 0 8px rgba(79, 227, 255, .5); }
.hs-tp { margin-top: 3px; color: var(--vang); font-weight: 700; font-size: 13px; text-shadow: 0 0 6px rgba(255, 216, 74, .4); }
.hs-tp-cu { margin-top: 2px; color: var(--chu-mo); font-size: 12px; }
.hs-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hs-luoi.nho { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.hs-luoi.nho .hs-o { padding: 6px 4px; text-align: center; }
.hs-luoi.nho .hs-o span { font-size: 11px; line-height: 1.15; }
.hs-o { border: 1px solid var(--vien-mo); border-radius: 8px; padding: 7px 8px; background: rgba(79, 227, 255, .05); display: flex; flex-direction: column; gap: 1px; }
.hs-o b { font-size: 17px; color: var(--chu); }
.hs-o b small { font-size: 12px; color: var(--chu-mo); font-weight: 600; }
.hs-o span { font-size: 12px; color: var(--chu-mo); }
.hs-nut { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.hs-nut.hai { grid-template-columns: 1fr 1fr; }
.hs-nut button { padding: 6px 4px; white-space: normal; line-height: 1.15; }
.hs-huy { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--do); font-size: 13px; min-height: 40px; padding: 4px 12px; text-decoration: underline; }
.hs-ghi { text-align: center; margin-top: 8px; }
/* chọn quà */
.tang-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; max-height: 172px; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px; justify-items: center; }
.tang-luoi .o-tui { width: 50px; height: 50px; }
.tang-luoi .o-tui img { width: 34px; height: 34px; }
.tang-chon { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
.tang-chon img { width: 32px; height: 32px; image-rendering: pixelated; }
.tang-sl { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px auto; gap: 6px; }
.tang-sl input { text-align: center; }
.tang-sl button { padding: 0; font-size: 20px; }
.tang-sl button[data-sl="max"] { font-size: 13px; padding: 0 12px; }
.tang-nd { width: 100%; margin-top: 6px; }

/* cảm ứng: mọi vùng bấm ≥ 44px, ô nhập 16px để iOS khỏi phóng to */
body.cam-ung .tab-xh button, body.cam-ung .xh-tim button, body.cam-ung .xh-nut button, body.cam-ung .hs-nut button, body.cam-ung .xh-loai button,
body.cam-ung .xh-nhan-het, body.cam-ung .tang-sl button, body.cam-ung .hs-huy, body.cam-ung .xh-tim input, body.cam-ung .tang-sl input,
body.cam-ung .tang-nd { min-height: 44px; }
body.cam-ung .xh-tim input, body.cam-ung .tang-sl input, body.cam-ung .tang-nd { font-size: 16px; }

/* bảng bạn bè thành tấm phủ gần toàn màn trên điện thoại (như các bảng lớn khác) */
@media (max-width: 620px), (max-height: 500px) {
  #bang-xh { height: auto; }
  #ho-so .tieu-de { font-size: 13px; padding: 2px 2px 2px 12px; min-height: 48px; }
  #ho-so .tieu-de .nut-x { min-width: 48px; min-height: 48px; margin: 0; font-size: 30px; color: var(--chu); }
}
@media (max-width: 620px) {
  .tab-xh { gap: 4px; padding: 0 8px 8px; }
  #than-xh { padding: 0 8px 10px; }
  .xh-cua-toi { margin: auto -8px -10px; bottom: -10px; }
  .xh-dong { gap: 8px; padding: 6px; }
  .xh-nut button { padding: 6px 10px; }
}
/* chip thời tiết */
#dh-thientai { color: #cfe8ff; border-color: rgba(160, 210, 255, .35); background: rgba(120, 180, 255, .1); cursor: help; }
#dh-thientai.troi-nang_gat { color: #ffb454; border-color: rgba(255, 180, 84, .45); background: rgba(255, 140, 40, .14); }
#dh-thientai.troi-mua { color: #8fd3ff; }
#dh-thientai.troi-gio { color: #bff5e6; }
#dh-thientai.troi-suong { color: #d8dde6; background: rgba(220, 225, 235, .12); }
#dh-thientai.troi-bao { color: #ff8a8a; border-color: rgba(255, 110, 110, .5); background: rgba(255, 80, 80, .14); animation: nhay-bao 1.6s ease-in-out infinite; }
@keyframes nhay-bao { 50% { box-shadow: 0 0 10px rgba(255, 100, 100, .55); } }

/* ================= tạo nhân vật / ngoại hình (tao_nv_ui.ts) — làm lại 15/11 theo buổi bàn 3 AI =================
   Nền màn ĐẶC: không thấy HUD / chip / nhắc tân thủ / tấm truyện phía sau (thứ tự người mới: tạo nhân vật → truyện → tân thủ).
   PC (rộng ≥ 621, cao > 500): hộp 2 cột 720 — trái xem trước to + xoay, phải biểu mẫu cuộn riêng + hàng nút dưới biểu mẫu.
   Ngang (cao ≤ 500):          hộp 2 cột 720 — trái xem trước + xoay + "Lên đảo", phải biểu mẫu cuộn riêng.
   Dọc (rộng ≤ 620):           toàn màn — đầu bảng · vùng cuộn (xem trước → câu dẫn → tên + 🎲 → giới tính → tóc → màu 2 hàng) · nút ghim đáy.
   Dùng bộ quy ước chung: --bo-bang / --bo-the / --cach / --dem / --chu-nd / --cham-toi-thieu, nút .nut-chinh / .nut-phu. */
#man-tao-nv { background: radial-gradient(ellipse at 50% 28%, #0d3a56 0%, #072338 48%, #030d18 100%); }
body.tnv-mo #truyen, body.tnv-mo .the-nhac { visibility: hidden !important; }   /* phòng hờ: màn đã che, khỏi lọt lên trên khi đổi lớp */
.khung-tao { position: relative; width: min(720px, 100%); max-height: 100%; display: grid; grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto; column-gap: var(--dem); padding: 0 var(--dem) var(--dem) 0;
  background: var(--nen-dam); border-radius: var(--bo-bang); overflow: hidden; }
.khung-tao > .tieu-de { grid-column: 1 / -1; grid-row: 1; margin-right: calc(-1 * var(--dem)); }   /* khung chừa lề phải: đầu bảng vẫn kéo sát mép */
.tnv-than { display: contents; }
.tnv-xem { grid-column: 1; grid-row: 2 / 5; display: flex; flex-direction: column; align-items: center; gap: var(--cach); padding-left: var(--dem); }
.tnv-chon { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  padding-right: 2px; }
.khung-tao > .loi { grid-column: 2; grid-row: 3; margin-top: 4px; min-height: 0; text-align: left; }
.khung-tao > .loi:empty { display: none; }
.tnv-nut { grid-column: 2; grid-row: 4; display: grid; grid-template-columns: auto 1fr; gap: var(--cach); padding-top: var(--cach); }
.tnv-nut #tnv-lai[hidden] + #tnv-ok { grid-column: 1 / -1; }
#tnv-ok { min-height: 48px; font-size: 16px; letter-spacing: 1px; }

#tnv-cv { width: 200px; height: 230px; image-rendering: pixelated; border-radius: var(--bo-the); cursor: grab; display: block; touch-action: none;
  background: radial-gradient(ellipse at 50% 78%, rgba(127, 227, 238, .35), rgba(23, 140, 168, .25) 45%, rgba(8, 60, 86, .5) 100%);
  border: 1px solid var(--vien-mo); box-shadow: inset 0 0 24px rgba(0, 20, 40, .6), var(--phat); }
.tnv-xoay { display: flex; align-items: center; gap: var(--cach-nho); width: 200px; }
.tnv-xoay button { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .12);
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.tnv-xoay button:active { background: rgba(79, 227, 255, .3); }
.tnv-xoay span { flex: 1; text-align: center; font-size: var(--chu-phu); color: var(--chu-mo); white-space: nowrap; }

.tnv-ghi { font-size: 13px; line-height: 1.4; color: var(--chu-mo); margin-bottom: 2px; }
.tnv-ghi b { color: var(--chu); }
.tnv-nhan { font-size: var(--chu-phu); letter-spacing: 1.5px; color: var(--vien); font-weight: 700; margin: 10px 0 5px; text-shadow: 0 0 6px rgba(79, 227, 255, .5); }
.tnv-nhan span { letter-spacing: 0; color: var(--chu); text-shadow: none; }
.tnv-ten-hang { display: flex; gap: var(--cach); }
#tnv-ten { flex: 1; min-width: 0; padding: 10px 11px; min-height: 44px; border-radius: var(--bo-nho, 8px); border: 1px solid var(--vien-mo); background: rgba(0, 10, 20, .6);
  color: var(--chu); font: inherit; font-size: 16px; font-weight: 700; outline: none; -webkit-user-select: text; user-select: text; }
#tnv-ten:focus { border-color: var(--vien); box-shadow: 0 0 8px rgba(79, 227, 255, .35); }
#tnv-ten:disabled { opacity: .6; }
#tnv-xx { flex: 0 0 auto; width: 44px; min-height: 44px; padding: 0; font-size: 20px; }
.tnv-tt { font-size: var(--chu-phu); min-height: 17px; margin-top: 4px; color: var(--chu-mo); }
.tnv-tt.loi { color: var(--do); }
.tnv-tt.tot { color: var(--xanh); }
.tnv-tt.canh { color: var(--cam); }
.tnv-gt { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cach); }
.tnv-gt button, .tnv-kieu button { min-height: 44px; border-radius: var(--bo-the); border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06);
  color: var(--chu-mo); font-weight: 700; }
.tnv-gt button.chon, .tnv-kieu button.chon { color: var(--chu); border-color: var(--vien); background: rgba(79, 227, 255, .2);
  box-shadow: 0 0 10px rgba(79, 227, 255, .45), inset 0 0 10px rgba(79, 227, 255, .15); }
.tnv-kieu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cach); }
.tnv-kieu button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; }
.tnv-kieu img { width: 52px; height: 52px; image-rendering: pixelated; border-radius: var(--bo-nho, 8px); background: rgba(79, 227, 255, .08); }
.tnv-kieu span { font-size: var(--chu-phu); line-height: 1.15; }
/* màu tóc: 9 nút 44 px; hộp 720 đủ một hàng (9 × 44 + 8 × 6 = 444), điện thoại dọc thành 2 hàng — không thu nhỏ nút (giữ vùng chạm) */
.tnv-mau { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; }
.tnv-mau button { width: 44px; height: 44px; border-radius: 50%; padding: 0; border: 2px solid rgba(255, 255, 255, .2); position: relative;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 45%), var(--m, #888); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .35); }
.tnv-mau button.goc { background: conic-gradient(#6b3f22, #a8743f, #e9c35a, #6b3f22); }
.tnv-mau button.goc::after { content: "Gốc"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.tnv-mau button.chon { border-color: #fff; box-shadow: 0 0 0 2px var(--vien), 0 0 12px rgba(79, 227, 255, .8), inset 0 -4px 8px rgba(0, 0, 0, .35); }
body.cam-ung .khung-tao .nut-x { margin: 0 0 0 auto; }

/* thẻ "Nhân vật" trong bảng Hệ thống */
.the-nvat { display: flex; gap: 14px; align-items: center; border: 1px solid var(--vien-mo); border-radius: 10px; padding: 12px; background: rgba(79, 227, 255, .05); }
.the-nvat img { width: 88px; height: 88px; image-rendering: pixelated; border-radius: 12px; border: 1px solid var(--vien); flex: 0 0 auto;
  background: radial-gradient(circle, rgba(79, 227, 255, .25), rgba(79, 227, 255, .04)); box-shadow: var(--phat); }
.the-nvat .ten { font-size: 20px; font-weight: 900; overflow-wrap: anywhere; text-shadow: 0 0 8px rgba(79, 227, 255, .5); }
.nut-doi-nh { margin-top: 10px; width: 100%; min-height: 44px; border-radius: 8px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .2); font-weight: 700; }
.hs-sua { display: block; width: 100%; margin-top: 12px; min-height: 44px; border-radius: 8px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .18); font-weight: 700; }

/* thẻ Nhân vật trên điện thoại dọc */
@media (max-width: 620px) {
  .the-nvat img { width: 72px; height: 72px; }
}
/* tạo nhân vật — điện thoại dọc: TOÀN MÀN, nội dung cuộn, nút "Lên đảo" ghim đáy */
@media (max-width: 620px) {
  #man-tao-nv { padding: 0; }
  #man-tao-nv > .khung-tao { width: 100%; height: 100%; max-height: none; margin: 0; display: flex; flex-direction: column;
    padding: var(--tren) var(--phai) 0 var(--le); border: 0; border-radius: 0; }
  .khung-tao::before, .khung-tao::after { display: none; }
  .khung-tao > .tieu-de { border-radius: 0; margin: 0; }
  .tnv-than { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--dem); }
  .tnv-xem { padding: 0; flex-direction: row; justify-content: center; gap: var(--dem); margin-bottom: var(--cach); }
  #tnv-cv { width: 150px; height: 172px; }
  .tnv-xoay { width: auto; flex-direction: column; gap: var(--cach); }
  .tnv-xoay span { display: none; }
  .tnv-chon { overflow: visible; padding: 0; }
  .tnv-nhan { margin: 8px 0 4px; }
  .tnv-mau { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 8px 6px; justify-content: space-between; }
  .khung-tao > .loi { flex: 0 0 auto; padding: 0 var(--dem); }
  .tnv-nut { flex: 0 0 auto; padding: var(--cach) var(--dem) calc(var(--cach) + var(--day)); border-top: 1px solid var(--vien-mo);
    background: var(--nen-dam); box-shadow: 0 -8px 16px rgba(0, 0, 0, .35); }
  /* bàn phím mở (đang gõ tên): thu ô xem trước cho ô tên + dòng báo lỗi còn thấy (ý Codex); độ ưu tiên cao hơn luật phóng to dưới */
  body.cam-ung .khung-tao:has(#tnv-ten:focus) #tnv-cv { width: 84px; height: 97px; }
}
/* điện thoại dọc cao (≥ 760): còn chỗ thì xem trước to hơn, vẫn vừa một màn không cuộn */
@media (max-width: 620px) and (min-height: 760px) { #tnv-cv { width: 180px; height: 207px; } }
/* tạo nhân vật — điện thoại ngang / màn thấp: 2 cột 720, trái xem trước + xoay + "Lên đảo", phải biểu mẫu cuộn */
@media (max-height: 500px) and (min-width: 621px) {
  .khung-tao { height: 100%; grid-template-columns: 184px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); padding-bottom: var(--cach); }
  .khung-tao > .tieu-de { margin-bottom: 6px; }
  .tnv-xem { grid-row: 2; gap: 6px; }
  #tnv-cv { width: 140px; height: 161px; }
  .tnv-xoay { width: 170px; }
  .tnv-chon { grid-column: 2; grid-row: 2 / 5; }
  .tnv-nut { grid-column: 1; grid-row: 3; grid-template-columns: 1fr; padding: 6px 0 0 var(--dem); gap: 6px; }
  .tnv-nut #tnv-lai { order: 2; }
  .khung-tao > .loi { grid-column: 1; grid-row: 4; padding-left: var(--dem); font-size: var(--chu-phu); }
  .tnv-ghi { font-size: var(--chu-phu); }
  .tnv-nhan { margin: 6px 0 3px; }
  .tnv-tt { min-height: 15px; margin-top: 2px; }
  .tnv-kieu img { width: 40px; height: 40px; }
  .tnv-kieu button { flex-direction: row; justify-content: center; gap: 6px; padding: 2px 4px; }
}
.xh-dong.hang { grid-template-columns: 34px 32px minmax(0, 1fr) auto; }
.xh-anh.nho { width: 32px; height: 32px; border-radius: 6px; }

/* màn tải tài nguyên */
#man-tai { position: fixed; inset: 0; z-index: var(--z-man-tai); display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #12506e 0%, #0a2c44 55%, #061a2b 100%); transition: opacity .4s ease; }
#man-tai.an { opacity: 0; pointer-events: none; }
.tai-khung { width: min(86vw, 420px); text-align: center; }
.tai-khung .logo { margin-bottom: 14px; }
.tai-song { display: flex; justify-content: center; gap: 6px; height: 18px; margin-bottom: 12px; }
.tai-song i { width: 26px; height: 6px; border-radius: 3px; background: #7fe6ff; opacity: .8; animation: tai-song 1.2s ease-in-out infinite; }
.tai-song i:nth-child(2) { animation-delay: .15s; } .tai-song i:nth-child(3) { animation-delay: .3s; }
@keyframes tai-song { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(9px); opacity: .45; } }
.tai-thanh { height: 14px; border-radius: 8px; background: rgba(6, 20, 34, .8); border: 1px solid rgba(127, 230, 255, .45); overflow: hidden; }
.tai-thanh span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2fb8e0, #7ff0d0); transition: width .2s ease; box-shadow: 0 0 10px rgba(127, 230, 255, .7); }
.tai-chu { margin-top: 10px; font-size: 14px; font-weight: 700; color: #dff6ff; }
.tai-meo { margin-top: 14px; font-size: 12.5px; color: #a9d4e6; min-height: 34px; line-height: 1.4; }


/* =====================================================================================================
   KHUNG BẢNG THỐNG NHẤT (15/11 đợt 2, mục 1.2 của bản soát) — các khối dựng sẵn cho MỌI bảng. Ba nhóm chỉ việc gắn lớp:
   1. Đầu bảng  .bang.lon > .tieu-de > span(nhãn) [+ ô phụ] + button.nut-x
        · cao 52 px trên cảm ứng (48 px khi màn thấp ≤ 500 px), 44 px trên PC; nhãn chữ hoa 13 px màu --vien, letter-spacing 1.5px.
        · bộ đếm phụ: <small> ngay trong nhãn (12 px --chu-mo, không viết hoa) HOẶC một hàng riêng ngay dưới đầu bảng: <div class="td-phu">…</div>.
        · nút đóng .nut-x: 44 × 44, viền --vien-mo, bo --bo-the, luôn ở góc phải.
        · bảng mở từ Menu thẻ: menu_the.ts tự gắn ◀ tên ▶ vào CHÍNH hàng này (menu_the.css "ĐẦU BẢNG THỐNG NHẤT"); không cần làm gì thêm.
   2. Hàng thẻ  .tab-ht (cũng áp cho .tab-xh, .tab-st): nút thẻ ≥ 44 px trên cảm ứng / 36 px PC, chữ 13 px; thẻ đang chọn = .chon.
        Hàng cuộn ngang; khung_bang.ts tự cuộn thẻ .chon vào tầm nhìn và gắn .con-trai / .con-phai để mờ mép khi còn thẻ khuất.
        Gọi tay khi tự đổi thẻ bằng code: cuonVaoTam(nut) (khung_bang.ts).
   3. Nút        .nut-chinh (lệnh chính) · .nut-phu (lệnh phụ) · .nut-nguy (xoá / bỏ / đánh). Cao 44 cảm ứng / 36 PC, bo --bo-the.
        Tắt: thuộc tính disabled → mờ .45; chữ trên nút phải nói rõ lý do ("Thiếu 20 vải"), không đổi màu viền.
        (Lớp .nut-chinh khác hẳn #nut-chinh — nút Câu tròn của HUD.)
   4. Ô vật phẩm .o-vat > img + b.so (số lượng, góc phải dưới) + span.ten (tên dưới ô, 12 px, 1 dòng). 56 × 56 PC / 48 cảm ứng, bo --bo-nho.
        Thêm .chon (đang chọn), .thieu (không đủ), .nho (40 px, dùng trong danh sách mất đồ / phần thưởng).
   5. Danh sách rỗng  <div class="trong"><i class="trong-bt">🧭</i>Một câu.<button class="nut-phu trong-nut">Việc kế tiếp</button></div>
        (div.trong cũ chỉ có chữ vẫn đẹp như trước; biểu tượng và nút là tuỳ chọn)
   6. Đang tải  <div class="dang-tai">Đang tải…</div>: một dòng ở ĐẦU thân bảng (lề trên 24 px), không căn giữa theo chiều dọc.
   7. Hướng dẫn dài  <details class="huong-dan"><summary>Cách dùng …</summary>…</details> (summary cao 44 px; điện thoại để đóng sẵn).
   8. Cỡ bảng (máy rộng ≥ 621 × 501; điện thoại vẫn phủ gần toàn màn như cũ): gắn MỘT lớp lên .bang.lon
        .co-nho 480 · .co-vua 720 · .co-lon 960 · .co-rat-lon 1200 (px × --nen-co, không quá màn trừ 48 px).
        Thêm .cao-dinh cho bảng nhiều thẻ: cao cố định --bang-cao (đổi thẻ không nhảy); không có thì cao theo nội dung, tối đa --bang-cao.
        Bảng nằm giữa vùng chừa 72 px trên (hàng HUD) và 64 px dưới (thanh cầm). Thân bảng phải tự cuộn (min-height: 0; overflow-y: auto).
        LƯU Ý: luật cỡ riêng theo id (#bang-tui.bang.lon { width… }) MẠNH hơn lớp này → nhóm nào gắn lớp thì xoá luật cỡ riêng của bảng đó.
   ===================================================================================================== */
.bang.lon > .tieu-de, #ho-so > .tieu-de, #bang-caidat > .tieu-de, .khung-tao > .tieu-de {
  flex: 0 0 auto; min-height: 44px; padding: 0 4px 0 14px; margin-bottom: 8px; font-size: var(--chu-td); border-bottom: 1px solid var(--vien-mo);
  background: linear-gradient(rgba(79, 227, 255, .12), rgba(79, 227, 255, .02)); border-radius: 9px 9px 0 0; }
body.cam-ung .bang.lon > .tieu-de, body.cam-ung #ho-so > .tieu-de, body.cam-ung #bang-caidat > .tieu-de { min-height: 52px; }
@media (max-height: 500px) { body.cam-ung .bang.lon > .tieu-de, body.cam-ung #ho-so > .tieu-de, body.cam-ung #bang-caidat > .tieu-de { min-height: 48px; } }
/* nhãn: chữ hoa (tiêu đề nào viết thường trong mã cũng thành hoa); phần đếm phụ / nút trong nhãn giữ chữ thường */
.bang.lon > .tieu-de > span:first-child { min-width: 0; text-transform: uppercase; }
.bang.lon > .tieu-de small, .bang.lon > .tieu-de button:not(.nut-x), .bang.lon > .tieu-de input, .bang.lon > .tieu-de select {
  text-transform: none; letter-spacing: 0; text-shadow: none; }
.bang.lon > .tieu-de small { font-size: var(--chu-phu); font-weight: 700; color: var(--chu-mo); margin-left: 6px; }
.bang.lon > .td-phu { flex: 0 0 auto; margin: -4px 0 8px; padding: 0 14px; font-size: var(--chu-phu); font-weight: 600; color: var(--chu-mo); }
.bang.lon > .tieu-de .nut-x, #ho-so > .tieu-de .nut-x, #bang-caidat > .tieu-de .nut-x, .khung-tao > .tieu-de .nut-x, #chat > .tieu-de .nut-x {
  width: 44px; height: 44px; min-width: 44px; margin: 0 0 0 auto; font-size: 26px; color: var(--chu); border-radius: var(--bo-the);
  border: 1px solid var(--vien-mo); background: var(--nut-phu-nen); }
/* chat: nút đóng 36 px trên PC, 44 × 44 trên cảm ứng (C16) */
#chat > .tieu-de .nut-x { height: var(--cham-pc, 36px); }
body.cam-ung #chat > .tieu-de .nut-x { height: var(--cham-toi-thieu, 44px); }
body.cam-ung #chat > .tieu-de { min-height: 48px; }
.nut-x:hover { color: #fff; background: rgba(79, 227, 255, .12); }
.bang.lon > .tieu-de .nut-x:hover { border-color: var(--vien); }

/* ---- hàng thẻ ---- */
.tab-ht, .tab-xh, .tab-st { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.tab-ht::-webkit-scrollbar, .tab-xh::-webkit-scrollbar, .tab-st::-webkit-scrollbar { display: none; }
.tab-ht button, .tab-xh button { flex: 1 0 auto; min-width: 44px; min-height: var(--cham-pc); padding: 6px 10px; font-size: var(--chu-td); }
body.cam-ung .tab-ht button, body.cam-ung .tab-xh button, body.cam-ung .tab-st button { min-height: var(--cham-toi-thieu); }
/* còn thẻ khuất bên trái / phải: mờ dần mép đó (khung_bang.ts gắn lớp theo vị trí cuộn) */
:is(.tab-ht, .tab-xh, .tab-st).con-phai { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
:is(.tab-ht, .tab-xh, .tab-st).con-trai { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); }
:is(.tab-ht, .tab-xh, .tab-st).con-trai.con-phai { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
#ds-che, #than-ht, #than-xh, #than-nc, #luoi-tui, #chi-tiet, #cc-ds, #cc-ct, .than-cc, .cd-than, .bd-ben { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
/* thanh cuộn chung trong bảng: mảnh, màu viền mờ (thay thanh trắng mặc định của trình duyệt) */
:where(.bang, .bang *) { scrollbar-width: thin; scrollbar-color: var(--vien-mo) transparent; }   /* :where = độ ưu tiên 0: hàng thẻ (scrollbar-width: none) vẫn thắng */

/* ---- nút chính / phụ / nguy hiểm ---- */
.nut-chinh, .nut-phu, .nut-nguy { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--cham-pc); min-width: 44px;
  padding: 6px 14px; border-radius: var(--bo-the); font: inherit; font-size: var(--chu-nd); font-weight: 700; line-height: 1.2; color: var(--chu); cursor: pointer; }
body.cam-ung :is(.nut-chinh, .nut-phu, .nut-nguy) { min-height: var(--cham-toi-thieu); }
.nut-chinh { background: var(--nut-chinh-nen); border: 1px solid var(--vien); box-shadow: 0 0 8px rgba(79, 227, 255, .35); }
.nut-phu { background: var(--nut-phu-nen); border: 1px solid var(--vien-mo); }
.nut-nguy { background: var(--nut-nguy-nen); border: 1px solid rgba(255, 106, 106, .7); color: #ffe3e3; }
:is(.nut-chinh, .nut-phu, .nut-nguy):hover:not(:disabled) { filter: brightness(1.12); }
:is(.nut-chinh, .nut-phu, .nut-nguy):active:not(:disabled) { transform: translateY(1px); }
:is(.nut-chinh, .nut-phu, .nut-nguy):disabled { opacity: .45; cursor: default; box-shadow: none; }

/* ---- ô vật phẩm ---- */
.o-vat { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 56px; flex: 0 0 auto; padding: 0; border: 0; background: none; color: inherit; }
.o-vat > img, .o-vat > .o-vat-hinh { width: 56px; height: 56px; padding: 8px; border-radius: var(--bo-nho); border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06);
  image-rendering: pixelated; object-fit: contain; }
.o-vat > .so { position: absolute; top: 38px; right: 4px; font-size: var(--chu-phu); font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.o-vat > .ten { max-width: 100%; font-size: var(--chu-phu); line-height: 1.25; color: var(--chu-mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-vat.chon > img, .o-vat.chon > .o-vat-hinh { border-color: var(--vien); box-shadow: 0 0 10px rgba(79, 227, 255, .6); }
.o-vat.thieu > .so { color: var(--do); }
body.cam-ung .o-vat { width: 48px; } body.cam-ung .o-vat > img, body.cam-ung .o-vat > .o-vat-hinh { width: 48px; height: 48px; padding: 6px; }
body.cam-ung .o-vat > .so { top: 30px; }
.o-vat.nho { width: 40px; } .o-vat.nho > img, .o-vat.nho > .o-vat-hinh { width: 40px; height: 40px; padding: 4px; } .o-vat.nho > .so { top: 24px; right: 2px; }

/* ---- danh sách rỗng / đang tải / hướng dẫn dài ---- */
:is(div, p).trong { margin: 24px auto 0; max-width: 420px; font-size: var(--chu-nd); line-height: 1.4; }
.trong > .trong-bt { display: block; margin: 0 auto 10px; font-style: normal; font-size: 32px; line-height: 1; }
.trong > .trong-nut { display: flex; margin: 12px auto 0; }
.dang-tai { margin: 24px 0 0; padding: 0 12px; text-align: center; font-size: var(--chu-nd); color: var(--chu-mo); }
details.huong-dan { margin: 8px 0; border: 1px solid var(--vien-mo); border-radius: var(--bo-the); background: rgba(79, 227, 255, .04); }
details.huong-dan > summary { min-height: var(--cham-pc); padding: 8px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: var(--chu-nd); font-weight: 700; color: var(--chu); }
body.cam-ung details.huong-dan > summary { min-height: var(--cham-toi-thieu); }
details.huong-dan > summary::-webkit-details-marker { display: none; }
details.huong-dan > summary::before { content: "▸"; color: var(--vien); transition: transform .15s; }
details.huong-dan[open] > summary::before { transform: rotate(90deg); }
details.huong-dan > :not(summary) { padding: 0 12px; font-size: var(--chu-nd); line-height: 1.45; color: var(--chu-mo); }
details.huong-dan[open] { padding-bottom: 10px; }

/* ---- cỡ bảng theo khổ màn (máy rộng; điện thoại: xem "bảng lớn thành tấm phủ gần toàn màn") ---- */
@media (min-width: 621px) and (min-height: 501px) {
  .bang.lon:is(.co-nho, .co-vua, .co-lon, .co-rat-lon) { left: calc(50% + (var(--le) - var(--phai)) / 2); top: calc(50% + (var(--bang-tren) - var(--bang-duoi) + var(--tren) - var(--day)) / 2);
    transform: translate(-50%, -50%); height: auto; max-height: var(--bang-cao); min-width: 0; }
  .bang.lon.co-nho { width: var(--bang-nho); }
  .bang.lon.co-vua { width: var(--bang-vua); }
  .bang.lon.co-lon { width: var(--bang-lon); }
  .bang.lon.co-rat-lon { width: var(--bang-rat-lon); }
  .bang.lon.cao-dinh { height: var(--bang-cao); }
}

/* gian hàng thương nhân (dao.css): nền đặc cho dễ đọc như các bảng khác */
html body #bang-nguoi-ca { background: var(--nen-dam); }

/* ---- cài đặt ---- */
/* C07 (15/11 đợt 2): Cài đặt là bảng giữa màn như mọi bảng — class "bang lon co-vua cao-dinh" ở index.html lo vị trí / cỡ
   (trước đây: thả xuống 340 px đè bản đồ nhỏ; cao co giãn theo thẻ nên nhảy). Chỉ giữ phần ruột. */
.cd-than { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 12px; min-height: 0; }
.cd-tieu { font-weight: 700; font-size: 13px; color: var(--chu); }
.cd-tieu b { color: var(--xanh); margin-left: 6px; }
.cd-hang { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 44px; }
.cd-hang + .cd-hang { border-top: 1px solid rgba(79, 227, 255, .12); padding-top: 8px; }
.cd-hang input[type=range] { flex: 1; min-width: 0; height: 44px; accent-color: #4fe3ff; touch-action: pan-x; }
.cd-nut { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; font-size: 20px; font-weight: 800; color: var(--chu); background: var(--nen); border: 1px solid var(--vien-mo); }
.cd-chu { height: 44px; padding: 0 10px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--chu); background: var(--nen); border: 1px solid var(--vien-mo); white-space: nowrap; }
.cd-nhan { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--chu); display: flex; flex-direction: column; }
.cd-nhan small { font-size: 12px; font-weight: 400; color: var(--chu-mo); }
.cd-chon { display: flex; border: 1px solid var(--vien-mo); border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.cd-chon button { min-width: 54px; height: 42px; border: 0; background: transparent; color: var(--chu-mo); font-weight: 700; }
.cd-chon button + button { border-left: 1px solid var(--vien-mo); }
.cd-chon button.chon { background: rgba(79, 227, 255, .24); color: var(--chu); box-shadow: inset 0 0 10px rgba(79, 227, 255, .25); }
/* Chi tiết hình (17/11): 4 lựa chọn theo hạng máy → hàng nút xuống dòng riêng, dưới có dòng tên chip + khung hình */
.cd-hang.cd-doc { flex-wrap: wrap; }
.cd-hang.cd-doc .cd-nhan { flex: 1 1 100%; }
.cd-hang.cd-doc .cd-chon { flex: 1 1 100%; }
.cd-hang.cd-doc .cd-chon button { flex: 1 1 0; min-width: 0; padding: 0 4px; font-size: 12.5px; line-height: 1.15; }
.cd-hang.cd-doc .cd-chon button small { display: block; font-size: 10.5px; font-weight: 600; opacity: .8; }
.cd-may { flex: 1 1 100%; font-size: 11.5px; color: var(--chu-mo); overflow-wrap: anywhere; }
.cd-gat { flex: 0 0 auto; width: 54px; height: 44px; padding: 7px 0; border: 0; background: none; position: relative; }
.cd-gat::before { content: ""; display: block; width: 54px; height: 30px; border-radius: 99px; background: rgba(0, 0, 0, .5); border: 1px solid var(--vien-mo); transition: background .15s; }
.cd-gat i { position: absolute; left: 4px; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: var(--chu-mo); transition: transform .15s, background .15s; }
.cd-gat.bat::before { background: rgba(31, 140, 120, .85); border-color: var(--xanh); }
.cd-gat.bat i { transform: translateX(24px); background: #fff; }
@media (max-width: 620px) {
  .cd-hang:is(#cd-hang-mt, #cd-hang-lt, .cd-am, :has(> .cd-chon)) { flex-wrap: wrap; align-items: stretch; row-gap: 2px; }
  .cd-hang:is(#cd-hang-mt, #cd-hang-lt, :has(> .cd-chon)) > .cd-nhan { flex: 1 1 100%; }
  .cd-hang > .cd-chon { flex: 1 1 100%; }
  .cd-hang > .cd-chon button { flex: 1 1 0; min-width: 0; padding: 0 6px; white-space: nowrap; }
  .cd-hang.cd-am > .cd-nhan { flex: 1 1 100%; }
  .cd-hang.cd-am input[type=range] { flex: 1 1 0; min-width: 0; }
}
.cd-meo { margin-top: 10px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--vien-mo); font-size: 12.5px; color: var(--chu-mo); line-height: 1.45; }
.cd-meo b { color: var(--chu); }

/* ---- bảng bản đồ biển ---- */
/* #bang-ban-do: cỡ do lớp co-rat-lon cao-dinh (index.html) */
.than-bd { flex: 1 1 auto; min-height: 0; display: flex; gap: 10px; padding: 0 10px 10px; }
.bd-khung { flex: 1 1 auto; min-width: 0; min-height: 0; position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--vien-mo); background: #0a2f48; }
#bdl-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bd-hoa { position: absolute; right: 10px; top: 10px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--vien); background: rgba(4, 14, 26, .7);
  box-shadow: var(--phat); transform: rotate(-45deg); }
.bd-hoa i { position: absolute; left: 50%; top: 50%; width: 36px; height: 8px; margin: -4px 0 0 -18px;
  background: linear-gradient(90deg, #c9d8e0 50%, #e0283c 50%); clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%); }
.bd-hoa b { position: absolute; right: -9px; top: 50%; margin-top: -8px; width: 16px; height: 16px; border-radius: 50%; background: #e0283c; color: #fff;
  font: 800 10px/16px system-ui, sans-serif; text-align: center; transform: rotate(45deg); }
.bd-ben { flex: 0 0 200px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.bd-so { display: grid; gap: 4px; }
.bd-so div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 9px; border-radius: 7px; background: rgba(0, 0, 0, .22); font-size: 13px; }
.bd-so span { color: var(--chu-mo); white-space: nowrap; }
.bd-so b { color: var(--xanh); text-align: right; }
.bd-muc { font-size: 11px; letter-spacing: 1.5px; color: var(--vien); font-weight: 700; margin: 12px 0 6px; }
.bd-chu-giai { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.bd-chu-giai li { display: flex; align-items: center; gap: 8px; }
.bd-d { width: 14px; height: 14px; flex: 0 0 14px; display: block; }
.bd-d.toi { border-radius: 50%; background: #fff; border: 2px solid #0b3a52; box-shadow: 0 0 0 1px #fff; }
.bd-d.be { background: #d9a35f; transform: rotate(45deg) scale(.8); }
.bd-d.tau { background: #fff; clip-path: polygon(100% 50%, 8% 88%, 28% 50%, 8% 12%); transform: rotate(-135deg); }
.bd-d.khac { background: #8fe3ff; clip-path: polygon(100% 50%, 8% 88%, 28% 50%, 8% 12%); transform: rotate(-45deg) scale(.85); }
.bd-d.nha { background: #9ff0a8; clip-path: polygon(50% 0, 100% 45%, 85% 45%, 85% 95%, 15% 95%, 15% 45%, 0 45%); }
.bd-d.dao { background: #ffd84a; clip-path: polygon(50% 0, 100% 52%, 50% 95%, 0 52%); }
.bd-d.dao.nghi { background: #7d8a92; }
.bd-d.ban { border-radius: 50%; background: #7dff9a; transform: scale(.65); }
.bd-d.ben { border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .8); background: linear-gradient(rgba(255,255,255,.8), rgba(255,255,255,.8)) center / 60% 1.5px no-repeat, linear-gradient(rgba(255,255,255,.8), rgba(255,255,255,.8)) center / 1.5px 60% no-repeat; transform: scale(.85); }
.bd-d.buon { background: #ff9ad0; clip-path: polygon(0 30%, 100% 30%, 78% 90%, 22% 90%); }
.bd-d.map { border-radius: 50%; background: #ff6a6a; transform: scale(.8); }
.bd-d.do { border-radius: 50%; background: rgba(226, 251, 255, .8); transform: scale(.4); }

/* (chú giải DOM luôn hiện: bộ vẽ bản đồ biển không còn tự vẽ chú giải trong hình, màn nhỏ trước đây không có chú giải nào) */

/* ---- màn nhắc xoay ngang (điện thoại đang cầm dọc; "Vẫn chơi dọc" thì thôi nhắc trong phiên này) ---- */
#man-xoay { display: none; position: fixed; inset: 0; z-index: var(--z-man-che); align-items: center; justify-content: center; text-align: center;
  padding: calc(16px + var(--tren)) calc(16px + var(--phai)) calc(16px + var(--day)) calc(16px + var(--le));
  background: radial-gradient(ellipse at 50% 35%, rgba(18, 80, 110, .96), rgba(6, 26, 43, .97)); }
.xoay-khung { width: min(320px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.xoay-hinh { position: relative; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; }
.xoay-may { width: 62px; height: 112px; border-radius: 12px; border: 3px solid #bff6ff; background: linear-gradient(#1b6f8f, #0a2f48); box-shadow: 0 0 16px rgba(79, 227, 255, .6);
  position: relative; animation: xoayMay 2.6s ease-in-out infinite; }
.xoay-may::before { content: ""; position: absolute; top: 5px; left: 50%; width: 18px; height: 4px; margin-left: -9px; border-radius: 2px; background: #bff6ff; opacity: .8; }
.xoay-may i { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; background: #d9a35f; transform: rotate(45deg); border-radius: 3px; box-shadow: 0 0 0 2px #7a5326; }
.xoay-mui { position: absolute; right: 6px; top: 2px; font-size: 34px; color: var(--vang); text-shadow: 0 0 10px rgba(255, 216, 74, .7); animation: xoayMui 2.6s ease-in-out infinite; }
@keyframes xoayMay { 0%, 18% { transform: rotate(0); } 55%, 82% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@keyframes xoayMui { 0%, 18% { opacity: 1; } 55%, 82% { opacity: .15; } 100% { opacity: 1; } }
.xoay-tieu { font-size: 21px; font-weight: 900; letter-spacing: .5px; color: #dff9ff; text-shadow: 0 0 10px rgba(79, 227, 255, .7); }
.xoay-phu { font-size: 13.5px; color: var(--chu-mo); margin-bottom: 6px; }
.xoay-nut { min-height: 46px; padding: 8px 22px; border-radius: 99px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); color: var(--chu); font-weight: 700; }
@media (orientation: portrait) and (max-width: 620px) {
  body.cam-ung:not(.choi-doc) #hud:not([hidden]) ~ #man-xoay { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .xoay-may, .xoay-mui { animation: none; } }

/* ================= khung vừa (máy tính bảng, cửa sổ hẹp) ================= */
@media (max-width: 760px) {
  #chi-tiet { width: 160px; }
}

/* ================= ĐIỆN THOẠI DỌC (khi chọn "Vẫn chơi dọc") / cửa sổ hẹp ================= */
@media (max-width: 620px) {
  body { --ban-do: calc(80px * var(--hud)); --o-cam: max(40px, calc(44px * var(--hud))); --o-ke: 4px;
    --nc: calc(92px * var(--hud)); --nc-phai: 16px; --nc-day: 18px; --vc: max(48px, calc(54px * var(--hud))); }
  /* trái: chỉ số rồi dòng ngày giờ · phải: bản đồ nhỏ, bên dưới là cột nút */
  #hang-tren { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 5px; }
  #dong-ho { justify-self: start; }
  .dh-dai, .dh-ten { display: none; } .dh-gon { display: inline; }
  html body.cam-ung #dao-thanh .dao-chip { top: auto; bottom: calc(var(--vong-dinh) + var(--o-cam) + 34px + var(--day)); right: calc(var(--mep) + var(--phai)); }

  #chat, body.cam-ung #chat { left: calc(var(--mep) + var(--le)); right: calc(var(--mep) + var(--phai)); width: auto; bottom: auto; top: calc(var(--tren-cao, 96px) + 6px); height: min(250px, calc(var(--cao, 100vh) * 0.34)); }
  body.cam-ung #chat { height: max(140px, min(250px, calc(var(--cao) - var(--can-cao) - var(--tren-cao, 96px) - 12px))); }

  #thong-bao { top: calc(var(--tren-cao, 96px) + 92px); left: calc(var(--mep) + var(--le)); transform: none; align-items: flex-start; min-width: 0;
    width: calc(100vw - 2 * var(--mep) - var(--le) - var(--phai)); }
  .tb { padding: 5px 10px; text-align: left; }

  /* thanh cầm: một hàng cuộn ngang ở nửa phải, ngay trên vòng cung nút */
  body.cam-ung #thanh-cam { --tc-trai: calc(var(--can-rong) + 6px); --tc-phai: calc(var(--mep) + var(--phai)); margin: 0 0 0 auto; bottom: calc(var(--vong-dinh) + 12px + var(--day)); }
  body.cam-ung.tay-trai #thanh-cam { --tc-trai: calc(var(--mep) + var(--le)); --tc-phai: calc(var(--can-rong) + 6px); margin: 0 auto 0 0; }
  body.cam-ung #cum-lai { bottom: calc(var(--vong-dinh) + var(--o-cam) + 30px + var(--day)); max-width: 56vw; }
  body.cam-ung #nut-chinh .vong { font-size: 16px; }

  /* bảng túi: lưới trên, chi tiết dưới */
  .than-tui { flex-direction: column; gap: 8px; }
  #luoi-tui { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); justify-items: center; }
  #chi-tiet { width: auto; border-left: 0; border-top: 1px solid var(--vien-mo); padding: 8px 0 0; display: grid; grid-template-columns: 64px minmax(0, 1fr);
    gap: 0 10px; align-content: start; align-items: start; }
  #chi-tiet img.to { grid-row: span 3; }
  #chi-tiet .ten { margin: 0 0 2px; }
  #chi-tiet .mo-ta { margin: 2px 0 8px; }
  #chi-tiet .hang-nut { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .tab-ht { gap: 4px; padding: 0 8px 8px; }
  .tab-ht button { font-size: 13px; padding: 7px 6px; }
  #than-ht { padding: 0 8px 10px; }
  .luoi-ch { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .dang-cho { grid-template-columns: 1fr 1fr auto; }
  .dang-cho select { grid-column: 1 / -1; }
  .dong-che { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; }
  .khung-dn { padding: 18px 16px 14px; }
  /* bản đồ: hình trên, số liệu + chú giải dưới */
  .than-bd { flex-direction: column; }
  .bd-ben { flex: 0 0 auto; max-height: 38%; }
  .bd-so { grid-template-columns: 1fr 1fr; }
  .bd-chu-giai { grid-template-columns: 1fr 1fr 1fr; }
  .bd-muc { margin: 8px 0 5px; }
  .bd-ghi { display: none; }
}

/* ================= ĐIỆN THOẠI NGANG / màn thấp (bố cục chính) ================= */
@media (max-height: 500px) and (min-width: 621px) {
  body { --ban-do: calc(84px * var(--hud)); --o-cam: max(40px, calc(44px * var(--hud))); --o-ke: 4px;
    --nc: calc(88px * var(--hud)); --nc-phai: 18px; --nc-day: 14px; --vc: max(48px, calc(54px * var(--hud))); }
  body.cam-ung { --mep: 10px; --mt: 6px; --lt: 44px; --menu: max(48px, calc(50px * var(--hud))); }
  .dh-dai { display: none; } .dh-gon { display: inline; }
  #dong-ho { height: 26px; font-size: 12.5px; gap: 5px; padding: 0 9px; }
  #cot-trai { width: min(270px, 36vw); }
  #nv-nd { max-height: 4.2em; overflow-y: auto; scrollbar-width: thin; font-size: 12px; }

  /* khung chat mở: cột bên trái, cao hết màn (đóng lại mới điều khiển tiếp) */
  #chat, body.cam-ung #chat { left: calc(var(--mep) + var(--le)); top: calc(6px + var(--tren)); bottom: calc(6px + var(--day)); height: auto; width: min(340px, 44vw); background: var(--nen-dam); }
  body.cam-ung.tay-trai #chat { left: auto; right: calc(var(--mep) + var(--phai)); }

  #thong-bao { width: min(400px, calc(100vw - 568px - var(--le) - var(--phai))); min-width: 240px; top: calc(var(--dh-day, 32px) + 5px); gap: 4px; }
  .tb { padding: 4px 10px; font-size: 12px; }

  /* bảng túi: lưới trái, chi tiết phải (đều cuộn được) */
  #chi-tiet { width: 210px; }
  .tab-ht { padding-bottom: 6px; }
  .bang.lon > .tieu-de, #ho-so > .tieu-de, #bang-caidat > .tieu-de { margin-bottom: 6px; }

  /* điện thoại ngang: Cài đặt / Thông báo là bảng giữa màn rộng vừa phải (không phủ cả 900 px) */
  .bang.lon#bang-caidat { left: 50%; right: auto; width: min(560px, calc(100vw - 16px - var(--le) - var(--phai))); transform: translateX(-50%); }
  .cd-hang { margin-top: 6px; } .cd-hang + .cd-hang { padding-top: 6px; }
  .bd-ben { flex-basis: 176px; }
  .bd-muc { margin: 8px 0 5px; }
  .bd-chu-giai { gap: 4px; }

  .khung-dn { padding: 12px 16px 10px; }
  .logo { font-size: 24px; letter-spacing: 3px; }
  .phu-de { margin: 2px 0 8px; font-size: 12px; }
  #form-dn input { padding: 8px 10px; margin-bottom: 6px; }
  .tab-dn { margin-bottom: 8px; }
  .loi { min-height: 16px; margin-top: 4px; }
  .dn-meo { margin-top: 2px; }

  /* mở rương: hình bên trái, phần thưởng bên phải */
  .khung-ruong { display: flex; align-items: center; gap: 14px; }
  #cv-ruong { width: auto; min-width: 0; height: min(432px, calc(var(--cao) - 24px - var(--tren) - var(--day))); margin: 0; flex: 0 0 auto; }
  .ruong-phai { width: min(360px, 44vw); }
  #ruong-do { max-height: calc(var(--cao) - 140px); overflow-y: auto; }

  #ho-so { max-height: calc(var(--cao) - 12px - var(--tren) - var(--day)); }
}
/* điện thoại ngang hẹp (iPhone SE…): bỏ bớt chữ trên dòng ngày giờ */
@media (max-height: 500px) and (max-width: 740px) {
  .dh-ten, #online { display: none; }
}

/* ================= bảng lớn thành tấm phủ gần toàn màn trên điện thoại ================= */
@media (max-width: 620px), (max-height: 500px) {
  .bang.lon { left: calc(6px + var(--le)); right: calc(6px + var(--phai)); top: calc(6px + var(--tren)); bottom: calc(6px + var(--day));
    width: auto; height: auto; max-height: none; transform: none; }
  .bang.lon#bang-xh, .bang.lon#bang-ban-do, .bang.lon#bang-cc { width: auto; height: auto; }
  .than-tui { flex: 1 1 auto; min-height: 0; }
  #luoi-tui { max-height: none; min-height: 0; }
  #ds-che, #than-ht { flex: 1 1 auto; max-height: none; min-height: 0; }
}
@media (max-width: 620px) {
  #luoi-tui { flex: 1 1 auto; min-height: 112px; }
  #chi-tiet { flex: 0 1 auto; max-height: 46%; }
  .tab-xh { gap: 4px; padding: 0 8px 8px; }
  #than-xh { padding: 0 8px 10px; }
  .xh-cua-toi { margin: auto -8px -10px; bottom: -10px; }
  .xh-dong { gap: 8px; padding: 6px; }
  .xh-nut button { padding: 6px 10px; }
}
/* máy tính có chuột: màn rộng thì thẻ nhiệm vụ để mở sẵn không sao, khung chat vừa phải */
@media (min-width: 1100px) and (min-height: 501px) {
  #cot-trai { width: 260px; }
}

/* màn dọc: dòng nhiệm vụ không chui xuống dưới bản đồ nhỏ + chip đảo nhà */
@media (max-width: 620px) {
  #cot-trai { width: min(300px, calc(100vw - 150px - var(--le) - var(--phai))); }
}

/* ---------- hộp thoại trong game (hop_thoai.ts): thay confirm / prompt của trình duyệt ---------- */
#hop-thoai { position: fixed; inset: 0; z-index: var(--z-xac-nhan); display: flex; align-items: center; justify-content: center; background: rgba(2, 10, 20, .58);
  padding: calc(12px + var(--tren)) calc(12px + var(--phai)) calc(12px + var(--day) + var(--ban-phim, 0px)) calc(12px + var(--le)); animation: ht-hien .14s ease-out; }
#hop-thoai .ht-hop { width: min(420px, 100%); background: var(--nen-dam); padding-bottom: 10px; box-sizing: border-box; }
#hop-thoai .ht-nd { padding: 4px 14px 10px; font-size: 14px; line-height: 1.45; color: var(--chu); max-height: calc(var(--cao, 100vh) * 0.38); overflow-y: auto; }
#hop-thoai .ht-o { display: block; box-sizing: border-box; width: calc(100% - 28px); margin: 0 14px 4px; padding: 10px 11px; min-height: 44px; border-radius: 7px; border: 1px solid var(--vien-mo);
  background: rgba(0, 0, 0, .45); color: var(--chu); font: inherit; font-size: 16px; outline: none; }
#hop-thoai .ht-o:focus { border-color: var(--vien); }
#hop-thoai .ht-dem { text-align: right; padding: 0 16px 4px; font-size: 11px; color: var(--chu-mo); min-height: 14px; }
#hop-thoai .ht-nut { display: flex; gap: 8px; padding: 6px 14px 4px; }
#hop-thoai .ht-nut button { flex: 1; min-height: 44px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-weight: 700; }
#hop-thoai .ht-nut .ht-ok { border-color: var(--vien); background: linear-gradient(#1f6f8c, #134a63); box-shadow: var(--phat); }
#hop-thoai .ht-nut .ht-ok.do { border-color: var(--do); background: linear-gradient(#8c2f2f, #5a1c1c); box-shadow: 0 0 10px rgba(255, 106, 106, .35); }
#hop-thoai .ht-nut button:disabled { opacity: .45; }
@keyframes ht-hien { from { opacity: 0; } to { opacity: 1; } }

/* cài đặt: thanh âm lượng hiệu ứng / nhạc (cai_dat.ts) */
.cd-hang.cd-am input[type=range] { flex: 1 1 90px; min-width: 80px; height: 32px; accent-color: var(--vien); }
.cd-hang.cd-am b { flex: 0 0 30px; text-align: right; font-size: 12px; color: var(--chu-mo); }

/* màn đăng nhập (sảnh) 20/11: public/sanh.css */

/* ---------- bảng Hướng dẫn (cam_nang_ui.ts) ---------- */
#bang-hdn { display: flex; flex-direction: column; }   /* cỡ: lớp co-lon cao-dinh (cam_nang_ui.ts) */
#bang-hdn[hidden] { display: none; }
.hdn-than { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 0 10px 10px; }
#hdn-muc { flex: 0 0 150px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; scrollbar-width: thin; }
#hdn-muc button { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 5px 9px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .05);
  color: var(--chu-mo); text-align: left; font-size: 13px; flex: 0 0 auto; }
#hdn-muc button i { font-style: normal; width: 20px; text-align: center; flex: 0 0 auto; }
#hdn-muc button.chon { color: var(--chu); background: rgba(79, 227, 255, .2); border-color: var(--vien); }
#hdn-nd { flex: 1; min-width: 0; overflow-y: auto; padding: 4px 12px 8px; border-radius: 8px; background: rgba(0, 0, 0, .22); font-size: 14px; line-height: 1.5; -webkit-overflow-scrolling: touch; }
#hdn-nd h3 { margin: 6px 0 8px; font-size: 16px; color: var(--vien); }
#hdn-nd p { margin: 0 0 9px; }
#hdn-nd b { color: #ffe9a6; }
.hdn-bieu { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--vien); color: var(--vien); font-size: 15px; font-weight: 900; }
@media (max-width: 560px), (orientation: portrait) and (max-width: 700px) {
  .hdn-than { flex-direction: column; }
  #hdn-muc { flex: 0 0 auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; }
  #hdn-muc button { white-space: nowrap; }
}

/* ---------- việc nhỏ sau đợt rà (docs/viec_con_lai.md) ---------- */
/* chip tiến độ "⚒ Xuồng gỗ · 0:45" chiếm trọn hàng dưới, không bóp khung máu / no / nước */
#chi-so > #dn-chip { grid-column: 1 / -1; }
/* đang mở bảng lớn: thông báo nổi xuống đáy màn, không đè hàng tiêu đề / tab của bảng */
/* (đợt 2) khung chat đang mở trên màn dọc (chat nằm ở nửa trên): toast cũng xuống đáy, không đè hàng kênh / ô tin */
@media (max-width: 620px) { body.cb-chat #thong-bao#thong-bao { top: auto; bottom: calc(var(--day) + 8px); left: 50%; transform: translateX(-50%); align-items: center; } }
body.cb-lon.cb-lon.cb-lon #thong-bao { top: auto; bottom: calc(var(--day) + 8px); left: 50%; transform: translateX(-50%); align-items: center; z-index: var(--z-toast); }

/* =====================================================================================================
   HUD 2 — bố cục theo LOẠI MÁY, không theo bề rộng (docs/ui.md)
   · Máy cảm ứng (body.cam-ung, kể cả iPad ≥ 1100px): mép trên chỉ còn thông tin; nút Menu + lối tắt ở góc dưới
     cạnh cần điều khiển (thuận tay trái: đổi bên); mọi thứ khác nằm trong bảng lưới #menu-luoi mở từ dưới.
   · Máy có chuột + bàn phím: hàng nút trên gọn (Túi, Chế tạo, Chat, Chuông, Thuyền, Đảo nhà) + nút Menu mở cùng bảng lưới.
   Mọi nút gốc vẫn nằm trong #nut-tren / #nut-them (các mô-đun khác chèn nút vào đó); ở đây chỉ quyết định nút nào hiện.
   ===================================================================================================== */
#nut-menu { display: flex; }
#nut-menu span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .2px; line-height: 1; }
#nut-menu .nv-chu { font-size: 17px; line-height: .9; }
body:not(.cam-ung) #nut-them > .nut-vuong:not(#nut-dn):not(#nut-nc) { display: none; }
@media (max-width: 899px) { body:not(.cam-ung) #nut-them { display: none; } }
/* máy tính: thông báo nằm dưới cả dải giờ lẫn hàng nút (hàng nút cao hơn dải giờ) */
body:not(.cam-ung) #thong-bao { top: calc(max(var(--dh-day, 34px), var(--nut-day, 52px)) + 6px); }

/* ---- máy cảm ứng: hàng trên = chỉ số · dải ngày giờ · (bản đồ nhỏ); không còn nút ---- */
body.cam-ung { --mep: 12px; --mt: 8px;
  --lt: max(44px, calc(46px * var(--hud)));   /* lối tắt tròn */
  --menu: calc(58px * var(--hud));            /* nút Menu */
  --dock: 0px; /* cụm Menu + lối tắt đã dời lên mép trên: cần điều khiển dùng trọn góc dưới, không còn dải mép nào phải chừa */ }
body.cam-ung #hang-tren { grid-template-columns: auto minmax(0, 1fr); }
body.cam-ung #dong-ho { opacity: .78; transition: opacity .5s; }
body.cam-ung #dong-ho.moi { opacity: 1; }

/* cụm Menu + lối tắt: hàng ngang ở MÉP TRÊN, ngay bên trái bản đồ nhỏ (Menu sát bản đồ, lối tắt xếp dần sang trái; hết chỗ thì xuống hàng).
   Không đặt ở góc dưới nữa: đó là chỗ ngón cái cầm cần điều khiển, bấm nhầm Menu / kéo cần hụt liên tục.
   Màn ngang: dưới dải ngày giờ. Màn dọc: cùng hàng với khung chỉ số (dải ngày giờ đã xuống hàng dưới). */
body.cam-ung #nut-tren { position: fixed; z-index: 7; bottom: auto; left: auto; right: calc(var(--mep) + var(--phai) + var(--ban-do) + 10px); top: calc(var(--dh-day, 34px) + 6px);
  display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-content: flex-start; align-items: center; justify-content: flex-start; gap: 6px;
  max-width: calc(100vw - var(--le) - var(--phai) - var(--ban-do) - 2 * var(--mep) - 150px * var(--hud)); }
@media (orientation: portrait) {
  body.cam-ung { --lt: 40px; --menu: 46px; }
  body.cam-ung #nut-tren { top: calc(var(--mt) + var(--tren) + 2px); gap: 5px; }
}
body.cam-ung #nut-them { display: none !important; }
body.cam-ung #nut-tren > .nut-vuong { width: var(--lt); height: var(--lt); border-radius: 50%; background: rgba(4, 14, 26, .62); margin: 0; }
body.cam-ung #nut-tren > .lt-an { display: none; }
body.cam-ung #nut-tren > #nut-menu { order: -1; width: var(--menu); height: var(--menu); margin: 0; border-radius: 32%; border: 1.5px solid var(--vien); background: var(--nen);
  box-shadow: var(--phat), 0 3px 8px rgba(0, 0, 0, .45); gap: 3px; }
body.cam-ung #nut-menu .nv-chu { font-size: calc(21px * var(--hud)); }
body.cam-ung #nut-menu span { font-size: max(10px, calc(10.5px * var(--hud))); }

/* cần điều khiển nổi: lùi vào trong dải Menu + lối tắt; vòng nghỉ nhỏ và mờ hơn */
body.cam-ung #vung-can { left: calc(var(--le) + var(--dock)); width: calc(var(--can-rong) - var(--le) - var(--dock)); }
body.cam-ung.tay-trai #vung-can { left: auto; right: calc(var(--phai) + var(--dock)); width: calc(var(--can-rong) - var(--phai) - var(--dock)); }
body.cam-ung #can-di.nghi { left: calc(var(--can-r, 54px) + 30px) !important; transform: scale(.72); opacity: .42; }
body.cam-ung.tay-trai #can-di.nghi { left: calc(100% - var(--can-r, 54px) - 30px) !important; }
body.cam-ung #chat { left: calc(var(--mep) + var(--le)); z-index: var(--z-chat); }
body.cam-ung.tay-trai #chat { left: calc(var(--mep) + var(--le)); }

/* khung chỉ số thu gọn khi cả ba thanh còn cao (hud.ts bật lớp .gon); chạm vào / vừa thay đổi thì hiện đủ số */
#chi-so { transition: width .2s; }
#chi-so.gon { width: calc(128px * var(--hud)); }
#chi-so.gon #cs-chan { width: calc(40px * var(--hud)); height: calc(40px * var(--hud)); }
#chi-so.gon .vach { grid-template-columns: 11px minmax(0, 1fr); height: 9px; }
#chi-so.gon .vach em { display: none; }
#chi-so.gon .vach b { height: 4px; }
#chi-so.gon .hang-diem { font-size: 11px; }

/* dải ngày giờ tự co chữ (hud.ts thêm dần co1 → co3 khi tràn) */
#dong-ho.co1 .dh-dai { display: none; } #dong-ho.co1 .dh-gon { display: inline; }
#dong-ho.co2 .dh-ten, #dong-ho.co2 #online { display: none; }
#dong-ho.co3 { font-size: 11.5px; gap: 3px; padding: 0 7px; } #dong-ho.co3 #dh-ngay { display: none; }
#dong-ho.co3 .chip { padding: 1px 4px; font-size: 11px; }

/* dưới bản đồ nhỏ: nhãn tốc độ nằm đè mép dưới vòng bản đồ, chip đường về đảo nhà / chip đảo xếp bên dưới, không đè nhau */
#bdn-toc { top: auto; bottom: -8px; z-index: 2; }
html body #dn-ve { top: calc(var(--mt) + var(--tren) + var(--ban-do) + 14px); right: calc(var(--mep) + var(--phai)); }
html body.co-dao-thanh #dn-ve { top: calc(var(--mt) + var(--tren) + var(--ban-do) + 50px); }
html body.cam-ung #dao-thanh .dao-chip { top: calc(var(--mt) + var(--tren) + var(--ban-do) + 14px); right: calc(var(--mep) + var(--phai)); }
/* chip dưới bản đồ nhỏ (về đảo nhà, tới thành phố, bến rừng, tên đảo đang cập): CÙNG MỘT KIỂU — cao 32, bo --bo-the, đệm 6/10, viền 1px,
   nền chip tối (15/11, trước chip viên / chip hộp lẫn lộn). Chỉ đổi hình dạng; chỗ đặt giữ nguyên, xep_chip.ts vẫn tự dời tránh nhau. */
html body.cam-ung #dao-thanh .dao-chip { min-height: 32px; padding: 4px 10px 4px 6px; border-radius: var(--bo-the); background: var(--nen-chip); box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
@media (orientation: landscape) {
  html body.cam-ung.co-dao-thanh #dn-ve { top: calc(var(--dh-day, 34px) + var(--menu, 50px) + 12px); right: calc(var(--ban-do, 88px) + var(--mep) + 14px + var(--phai, 0px)); min-width: 0; }
}
@media (max-width: 620px) {
  html body.cam-ung #dao-thanh .dao-chip { top: auto; }
  html body.co-dao-thanh #dn-ve { top: calc(var(--mt) + var(--tren) + var(--ban-do) + 14px); }
}

/* độ mờ HUD (Cài đặt); đang mở khung chat thì rõ hẳn để đọc */
#hud { opacity: var(--hud-mo, 1); }
body.cb-chat #hud#hud { opacity: 1; }

/* "Mất kết nối": dải nhỏ giữa trên, dưới dải giờ, không chặn thao tác (main.ts ẩn khi nối lại) */
#mat-ket-noi { top: calc(var(--dh-day, 34px) + 6px); transform: translateX(-50%); padding: 4px 13px 4px 10px; border-radius: 99px; font-size: 12.5px; white-space: nowrap; pointer-events: none;
  display: flex; align-items: center; gap: 7px; box-shadow: 0 0 10px rgba(255, 180, 84, .35); max-width: calc(100vw - 24px - var(--le) - var(--phai)); overflow: hidden; text-overflow: ellipsis; }
#mat-ket-noi::before { content: ""; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--cam); border-top-color: transparent; animation: mkn-quay .9s linear infinite; }
@keyframes mkn-quay { to { transform: rotate(360deg); } }
/* nối lại hỏng quá ~20 giây: hiện nút Tải lại (dải vẫn không chặn thao tác, chỉ nút nhận chạm) */
#mkn-tai-lai { pointer-events: auto; flex: 0 0 auto; font: inherit; font-weight: 700; padding: 2px 10px; border-radius: 99px; border: 0; background: var(--cam); color: #201000; cursor: pointer; }
body.cb-mkn #thong-bao#thong-bao, body.cb-mkn #tb-lon#tb-lon { margin-top: 32px; }

/* ---- bảng lưới Menu: tấm mở từ đáy màn (cảm ứng: neo về phía nút Menu; máy tính: giữa màn) ---- */
#menu-luoi { position: fixed; inset: 0; z-index: var(--z-bang-tren); display: flex; align-items: flex-end; justify-content: flex-start; background: rgba(2, 10, 20, .46);
  padding: calc(8px + var(--tren)) calc(var(--mep) + var(--phai)) 0 calc(var(--mep) + var(--le)); animation: ht-hien .14s ease-out; touch-action: none; }
body.tay-trai #menu-luoi { justify-content: flex-end; }
.ml-tam { --ml-o: clamp(64px, calc((100vw - 74px - var(--le) - var(--phai)) / 4), 86px); width: min(100%, 660px); max-height: 100%; display: flex; flex-direction: column;
  background: var(--nen-dam); border: 1px solid var(--vien); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: var(--phat), 0 -6px 24px rgba(0, 0, 0, .5);
  padding-bottom: calc(var(--day) + 10px); animation: ml-len .2s ease-out; }
@keyframes ml-len { from { transform: translateY(36%); opacity: 0; } }
.ml-dau { position: relative; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 6px 2px 0 16px;
  font-size: 13px; letter-spacing: 1.5px; font-weight: 700; color: var(--vien); text-shadow: 0 0 6px rgba(79, 227, 255, .6); touch-action: none; }
.ml-keo { position: absolute; left: 50%; top: 6px; width: 46px; height: 5px; margin-left: -23px; border-radius: 3px; background: rgba(226, 251, 255, .35); }
.ml-dau .nut-x { width: 48px; height: 44px; font-size: 26px; color: var(--chu); border-radius: 10px; }
.ml-than { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: 0 12px 2px;
  display: flex; flex-wrap: wrap; gap: 2px 18px; align-content: flex-start; }
.ml-nhom h3 { margin: 7px 2px 5px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--chu-mo); font-weight: 700; }
.ml-luoi { display: grid; grid-template-columns: repeat(var(--n, 4), var(--ml-o)); gap: 6px; }
.ml-o { position: relative; height: calc(var(--ml-o) * .88); min-height: 60px; border-radius: 14px; background: rgba(79, 227, 255, .07); border: 1px solid var(--vien-mo);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 2px; }
.ml-o > * { pointer-events: none; }
.ml-o img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.ml-o .ml-chu { font-size: 27px; font-weight: 400; line-height: 36px; height: 36px; }
.ml-o span { font-size: 12.5px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.ml-o kbd { position: absolute; left: 6px; top: 4px; font: 700 10px/1.2 system-ui, sans-serif; color: var(--chu-mo); }
.ml-o .cham { top: -4px; right: -4px; }
/* nút Menu chỉ có tin để xem (chuông, chat, Có gì mới): chấm nhỏ không số (hud.ts gopCham) */
#dem-menu.chi { min-width: 10px; width: 10px; height: 10px; padding: 0; font-size: 0; top: -2px; right: -2px; }
/* SỐ → CHẤM (hoc_avatar_ui.md việc 4): con số chỉ còn ở nút Menu; ô Menu, nhóm, ◀ ▶ và nút trên HUD chỉ là chấm.
   Số vẫn nằm trong textContent (hud.ts soCham/demMuc đọc lại để cộng), chỉ ẩn khi vẽ bằng font-size 0. */
html body .cham.chi, html body #nut-tren .cham:not(#dem-menu) { min-width: 10px !important; width: 10px !important; height: 10px !important; padding: 0 !important;
  font-size: 0 !important; line-height: 0 !important; }
.ml-o:hover { border-color: var(--vien); }
.ml-o:active { transform: scale(.95); background: rgba(79, 227, 255, .2); }
body.cam-ung .ml-o kbd { display: none; }
body:not(.cam-ung) #menu-luoi { align-items: center; justify-content: center; padding-bottom: 8px; }
body:not(.cam-ung) .ml-tam { border-bottom: 1px solid var(--vien); border-radius: 16px; padding-bottom: 10px; }
body:not(.cam-ung) .ml-keo { display: none; }
/* điện thoại ngang (màn thấp): tấm rộng hết màn, ô thấp hơn, nhóm nào cũng trên một hàng → không phải cuộn */
@media (max-height: 500px) {
  body.cam-ung #online { display: none; }
  body.cam-ung #cot-trai { width: min(270px, calc(50vw - 136px - var(--le))); } /* không chui xuống dưới cột thông báo ở giữa */
  .ml-tam { --ml-o: 74px; width: 100%; }
  .ml-luoi { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: var(--ml-o); }
  .ml-o { height: 58px; min-height: 0; gap: 1px; }
  .ml-o img { width: 30px; height: 30px; } .ml-o .ml-chu { font-size: 23px; line-height: 30px; height: 30px; }
  .ml-o span { font-size: 12px; }
  /* tên dài ("Quà mỗi ngày", "Tải app Android") trong ô 74 px: 2 dòng, đủ chỗ cho chân chữ g / y (trước nowrap bị cắt "ngàv") */
  .ml-o span { flex: none; max-width: 100%; font-size: 11px; white-space: normal; text-align: center; line-height: 1.22; padding-bottom: 1px; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ml-o { gap: 0; } .ml-o img { width: 26px; height: 26px; } .ml-o .ml-chu { font-size: 21px; line-height: 26px; height: 26px; }   /* hình + 2 dòng vừa ô cao 58 */
  .ml-dau { min-height: 40px; } .ml-dau .nut-x { height: 38px; }
  .ml-nhom h3 { margin: 4px 2px 3px; }
}

/* Cài đặt + Chuông trên máy cảm ứng: không còn nút ở mép trên để "thả xuống" → hộp giữa màn */
body.cam-ung #bang-chuong { top: 50%; bottom: auto; right: auto; left: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 24px - var(--le) - var(--phai))); max-height: calc(var(--cao) - 16px - var(--tren) - var(--day));
  box-shadow: 0 0 0 100vmax rgba(2, 10, 20, .4), var(--phat); }
/* cài đặt: chọn lối tắt + độ mờ HUD */
#cd-lt button { min-width: 0; padding: 0 9px; font-size: 12.5px; }
body:not(.cam-ung) #cd-hang-lt { display: none; }
.cd-hang.cd-am #cd-mo { accent-color: var(--vien); }

/* A11 (15/11 đợt 2): PC màn lớn: HUD + bảng phóng theo màn (trước đây 1920 px nhìn như bản điện thoại thu nhỏ) */
@media (pointer: fine) and (min-width: 1600px) { body:not(.cam-ung) { --nen-co: 1.15; } }
@media (pointer: fine) and (min-width: 1900px) { body:not(.cam-ung) { --nen-co: 1.3; } }

/* ---- máy bảng cảm ứng (iPad ngang / dọc): HUD to hơn một nấc, bảng rộng hơn, nút đóng to ---- */
@media (min-width: 700px) and (min-height: 600px), (min-width: 900px) and (min-height: 540px) {
  body.cam-ung { --nen-co: 1.14; }
  /* :not(.co-lon/.co-rat-lon): luật này (0,2,2) từng thắng lớp cỡ bảng → Túi / Bản đồ khoá 720 px trên máy bảng ngang 1180 (rà UI 17/11, Gemini) */
  body.cam-ung .bang.lon:not(.co-lon):not(.co-rat-lon) { width: min(720px, calc(100vw - 48px - var(--le) - var(--phai))); max-height: min(860px, calc(var(--cao) - 48px - var(--tren) - var(--day))); font-size: 15px; }
  body.cam-ung .bang.lon.co-nho { width: var(--bang-nho); }   /* buổi 10 (việc 4): luật máy bảng ở trên đè lớp co-nho (Cài đặt, Thông báo… rộng 720) → trả về cỡ nhỏ */
  body.cam-ung .bang.lon > .tieu-de, body.cam-ung #ho-so > .tieu-de { min-height: 52px; font-size: 14px; }
  body.cam-ung .bang.lon > .tieu-de .nut-x, body.cam-ung #ho-so > .tieu-de .nut-x, body.cam-ung #bang-chuong > .tieu-de .nut-x {
    width: 52px; height: 52px; min-width: 52px; font-size: 30px; }
  body.cam-ung #thong-bao .tb { font-size: 14px; }
  body.cam-ung .lai-nut { min-width: calc(54px * var(--hud)); min-height: calc(54px * var(--hud)); }
  body.cam-ung #lai-tt { font-size: 13px; }
  body.cam-ung #nhiem-vu.thu-gon .tieu-de { min-height: 30px; }
  body.cam-ung #nhiem-vu.thu-gon #nv-tom { font-size: 13px; }
  body.cam-ung #cot-trai { width: min(330px, 42vw); }
  .ml-tam { --ml-o: 88px; width: min(100%, 700px); }
  .ml-luoi { grid-template-columns: repeat(var(--n6, 4), var(--ml-o)); }
  .ml-o img { width: 42px; height: 42px; } .ml-o .ml-chu { font-size: 31px; line-height: 42px; height: 42px; }
  .ml-o span { font-size: 13.5px; }
}
/* máy bảng cầm dọc: cột thông báo giữa màn chạm vào dòng nhiệm vụ / chat mờ bên trái → cho thông báo xuống dưới hai khối đó */
@media (orientation: portrait) and (min-width: 621px) {
  body.cam-ung #thong-bao { top: calc(max(var(--ct-day, 200px), var(--chip-day, 0px)) + 8px); } /* --ct-day: đáy cột nhiệm vụ + chat mờ, hud.ts đo */
  body.cam-ung.ph-co-thanh #thong-bao { top: calc(max(var(--ct-day, 200px) + 40px, var(--chip-day, 0px)) + 8px); }
}
/* điện thoại cầm dọc: dải ngày giờ xuống dưới khung chỉ số (đủ chỗ cho cả dòng); thông báo + dải "mất kết nối" nằm dưới cột nhiệm vụ / chat mờ */
@media (max-width: 620px) {
  body.cam-ung #hang-tren { grid-template-columns: minmax(0, 1fr); }
  #mat-ket-noi { top: calc(var(--ct-day, 170px) + 6px); left: calc(var(--mep) + var(--le)); transform: none; }
  #thong-bao { top: calc(max(var(--ct-day, 190px), var(--chip-day, 0px)) + 6px); }   /* dưới cả cột chip bên phải: toast không đè chip, chip không nhảy */
  body.cam-ung.dang-lai #can-di.nghi { left: calc(var(--can-r, 54px) * .72 + 10px) !important; }
  body.cam-ung.dang-lai.tay-trai #can-di.nghi { left: calc(100% - var(--can-r, 54px) * .72 - 10px) !important; }
}

/* ---- toạ độ + tự lái (tu_lai_ui.ts) ---- */
#toa-do { cursor: pointer; font-variant-numeric: tabular-nums; color: #dff6ff; background: rgba(79, 227, 255, .14); border: 1px solid rgba(79, 227, 255, .35) !important; min-height: 22px; }
#toa-do.tl-bat { color: #3a2206; background: linear-gradient(#ffcf5a, #f2a52a); border-color: #ffe9a8 !important; }
#toa-do[hidden] { display: none; }
/* hoa tiêu đang lái thay (tu_lai_ui.ts veDai): một dòng nhỏ dưới thanh trên cùng, không che giữa màn hình */
#ht-dai { position: fixed; z-index: var(--z-hud-noi); left: 50%; top: calc(env(safe-area-inset-top, 0px) + 44px); transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  max-width: calc(100vw - 24px); padding: 2px 4px 2px 10px; border-radius: 14px; background: rgba(10, 30, 44, .82); border: 1px solid rgba(79, 227, 255, .35);
  color: #dff6ff; font-size: 12px; line-height: 20px; pointer-events: auto; box-sizing: border-box; }
#ht-dai[hidden] { display: none; }
#ht-nd { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
#ht-dung { flex: 0 0 auto; font-size: 11.5px; padding: 0 9px; min-height: 20px; border-radius: 10px; }
#tl-hop { position: fixed; z-index: var(--z-modal); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 24px)); max-height: calc(var(--cao, 100vh) - 16px); display: flex; flex-direction: column; overflow: visible; }
#tl-hop[hidden] { display: none; }
#tl-hop, #tl-hop * { box-sizing: border-box; }
#tl-hop .tl-than { grid-template-columns: minmax(0, 1fr); flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#tl-hop .tl-than > div { white-space: normal; overflow-wrap: anywhere; }
#tl-hop .tl-hang > *, #tl-hop label, #tl-hop input { min-width: 0; }
#tl-hop .tl-than { display: grid; gap: 8px; padding: 10px 12px 12px; font-size: 13px; }
#tl-hop .tl-hang { display: flex; gap: 8px; }
#tl-hop .tl-hang > * { flex: 1; }
#tl-hop label { display: flex; align-items: center; gap: 6px; font-weight: 800; }
#tl-hop input { flex: 1; min-width: 0; min-height: 40px; padding: 4px 8px; border-radius: 8px; border: 1.5px solid var(--vien); background: rgba(0, 0, 0, .35); color: #fff; font-size: 16px; font-variant-numeric: tabular-nums; }
#tl-hop button:not(.nut-x) { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--vien); background: rgba(79, 227, 255, .12); color: #e8f8ff; font-weight: 700; font-size: 13px; }
#tl-hop button.chinh { background: linear-gradient(#1f8fb0, #13607d); border-color: #6fe3ff; }
#tl-hop #tl-dung { background: rgba(120, 30, 30, .7); border-color: #ff9a8a; }
#tl-hop #tl-dung[hidden] { display: none; }
#tl-day { font-weight: 800; color: #ffe9a8; }
#tl-tt { color: #bfefff; min-height: 2.4em; }
#tl-hop .tl-ghi { font-size: 11.5px; color: #9fc4d2; }

/* ---- thanh nhanh 9 ô tự xếp (giao_dien.ts) ---- */
.o-cam.o-rong { background: rgba(8, 26, 38, .45); border-style: dashed; }
.o-cam.o-het { border-style: dashed; }   /* món đã hết: giữ chỗ, vẽ mờ (giao_dien.ts hopThanh) */
.o-cam.o-het img { opacity: .32; filter: grayscale(.8); }
.o-cam.o-het .so { color: #ff9a8a; }
#tui-thanh { flex: 0 0 100%; order: 3; border-top: 1px solid var(--vien-mo); padding-top: 8px; margin-top: 8px; }
#tui-thanh .tt-nhan { font-size: 12px; color: #bfe4f2; margin-bottom: 6px; letter-spacing: 0; text-transform: none; font-weight: 500; }
#tui-thanh { min-width: 0; max-width: 100%; }
#tui-thanh .tt-nhan b { color: #ffe9a8; }
#tui-thanh .tt-o { display: flex; gap: 5px; flex-wrap: wrap; }
#tui-thanh .o-cam.tt { width: 48px; height: 48px; cursor: grab; }
.than-tui { flex-wrap: wrap; }
.o-tui.boc { outline: 2px solid #ffcf5a; box-shadow: 0 0 10px rgba(255, 207, 90, .7); }
.o-tui[draggable="true"] { cursor: grab; }

/* màn thấp (điện thoại nằm ngang): hàng thanh nhanh lên đầu bảng Túi cho khỏi phải cuộn mới thấy */
@media (max-height: 520px) {
  #tui-thanh { order: -1; border-top: 0; border-bottom: 1px solid var(--vien-mo); margin: 0 0 8px; padding: 0 0 8px; }
  #tui-thanh .o-cam.tt { width: 44px; height: 44px; }
}

/* ---- bảng Người đang chơi (dang_choi_ui.ts) ---- */
#online { cursor: pointer; }
#bang-dc { position: fixed; z-index: var(--z-bang-tren); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 20px)); max-height: calc(var(--cao, 100vh) - 16px); display: flex; flex-direction: column; }
#bang-dc[hidden] { display: none; }
#bang-dc, #bang-dc * { box-sizing: border-box; }
#bang-dc .dc-so { font-style: normal; font-weight: 600; color: #9fdcf0; letter-spacing: 0; margin-left: 6px; }
#bang-dc .dc-than { overflow-y: auto; padding: 8px 10px 10px; display: grid; gap: 6px; touch-action: pan-y; }
#bang-dc .dc-dong { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: rgba(79, 227, 255, .07); border: 1px solid var(--vien-mo); }
#bang-dc .dc-dong.minh { opacity: .75; }
#bang-dc .dc-giua { flex: 1; min-width: 0; display: grid; gap: 2px; }
#bang-dc .dc-giua b { font-size: 14px; color: #ffe9a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bang-dc .dc-giua span { font-size: 12px; color: #bfe4f2; overflow-wrap: anywhere; }
#bang-dc .dc-nut { display: flex; gap: 5px; flex: 0 0 auto; }
#bang-dc .dc-nut button { min-height: 40px; min-width: 52px; padding: 2px 8px; border-radius: 9px; border: 1.5px solid var(--vien); background: rgba(79, 227, 255, .12); color: #e8f8ff; font-weight: 700; font-size: 12px; }
#bang-dc .dc-nut button.chinh { background: linear-gradient(#1f8fb0, #13607d); border-color: #6fe3ff; }
@media (max-width: 520px) { #bang-dc .dc-dong { flex-wrap: wrap; } #bang-dc .dc-nut { width: 100%; } #bang-dc .dc-nut button { flex: 1; } }

/* ---- màn dọc / hẹp: bảng Túi xếp chồng lại như cũ (dòng flex-wrap ở trên làm vỡ bố cục cột), thanh nhanh đủ 9 ô ---- */
@media (max-width: 560px), (orientation: portrait) and (max-width: 700px) {
  .than-tui { flex-wrap: nowrap; }
  #tui-thanh { order: -1; flex: 0 0 auto; border-top: 0; border-bottom: 1px solid var(--vien-mo); margin: 0; padding: 0 0 8px; }
  #tui-thanh .tt-o { flex-wrap: nowrap; gap: 4px; }
  #tui-thanh .o-cam.tt { flex: 1 1 0; width: auto; min-width: 0; height: auto; aspect-ratio: 1; max-width: 48px; }
  /* thanh nhanh ngoài màn chơi: trải hết bề ngang, hiện đủ 9 ô, không còn bị cắt nửa chừng */
  body.cam-ung #thanh-cam, body.cam-ung.tay-trai #thanh-cam { left: calc(6px + var(--le)); right: calc(6px + var(--phai)); width: auto; max-width: none; margin: 0; gap: 3px; padding: 3px; overflow: hidden; }
  body.cam-ung #thanh-cam .o-cam { flex: 1 1 0; width: auto; min-width: 0; height: auto; aspect-ratio: 1; max-width: 52px; }
  body.cam-ung #thanh-cam .o-cam .so { font-size: 11px; right: 2px; }
}

/* nút đưa góc nhìn về gốc (hud.ts): bám mép dưới-phải bản đồ nhỏ, chỉ hiện khi đã xoay camera (Cài đặt cho xoay góc nhìn) */
#nut-goc { position: absolute; z-index: 8; top: calc(var(--mt) + var(--tren) + var(--ban-do) - 28px); right: calc(var(--mep) + var(--phai) - 5px);
  width: 30px; height: 30px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%; font-size: 17px; line-height: 1; font-weight: 800; color: #ffe9a8;
  background: var(--nen-dam, rgba(4, 14, 26, .9)); border: 1.5px solid var(--vang, #ffcf5a); box-shadow: 0 0 8px rgba(255, 207, 90, .5); pointer-events: auto; }
#nut-goc::before { content: ""; position: absolute; inset: -7px; }
#nut-goc[hidden], #nut-khoa-goc[hidden] { display: none; }

/* ---- tấm kể chuyện (truyen_ui.ts): trang nhật ký ở giữa dưới màn, chạm để sang trang / đóng ---- */
#truyen { position: fixed; z-index: var(--z-hud-noi); left: 50%; transform: translateX(-50%); bottom: calc(var(--day, 0px) + var(--o-cam, 48px) + 150px);
  width: min(520px, calc(100vw - 28px)); padding: 12px 16px 9px 16px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(#f6e7c4, #e9d3a2); color: #3a2a14; border: 2px solid #8a6a36; box-shadow: 0 6px 22px rgba(0, 0, 0, .55), inset 0 0 22px rgba(140, 100, 40, .25);
  font-size: 15px; line-height: 1.5; animation: truyen-vao .35s ease-out; }
#truyen[hidden] { display: none; }
#truyen .tr-dau { position: absolute; left: -10px; top: -14px; font-size: 24px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
#truyen .tr-chu { font-style: italic; }
#truyen .tr-tiep { margin-top: 6px; text-align: right; font-size: 12px; font-weight: 700; color: #8a5a1e; }
/* hàng đáy: nút "Bỏ qua" (đóng hết các trang) bên trái · "Chạm để đọc tiếp" bên phải */
#truyen .tr-chan { display: flex; align-items: center; justify-content: space-between; gap: var(--cach); margin-top: 4px; }
#truyen .tr-bo { flex: 0 0 auto; min-height: 34px; padding: 4px 14px; border-radius: var(--bo-vien); border: 1px solid #8a6a36; background: rgba(138, 90, 30, .14);
  color: #5a3a12; font: inherit; font-size: 12.5px; font-weight: 800; font-style: normal; cursor: pointer; }
#truyen .tr-bo:active { background: rgba(138, 90, 30, .3); }
body.cam-ung #truyen .tr-bo { min-height: var(--cham-toi-thieu); }
/* tấm kể đang mở (người mới vừa vào: điểm danh, tới bến… nổ cùng lúc): thông báo nổi xếp NGAY DƯỚI tấm, khỏi che chữ kể + nút Bỏ qua.
   --truyen-day do truyen_ui.ts đo; có bảng lớn / chat mở thì theo luật cũ (thông báo xuống đáy) */
html body.co-truyen.co-truyen.co-truyen:not(.cb-lon):not(.cb-chat) #thong-bao#thong-bao { top: calc(max(var(--truyen-day, 0px), var(--chip-day, 0px)) + 8px); bottom: auto; }
@keyframes truyen-vao { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (orientation: landscape) and (max-height: 520px) {
  #truyen { bottom: auto; top: calc(var(--dh-day, 34px) + 62px); font-size: 14px; width: min(460px, calc(100vw - 300px)); }
}
#tl-hai-luu { flex: 1; }

/* nút nhóm Zalo cạnh nút Menu (hud.ts): tròn xanh, chữ trắng */
#nut-zalo { background: #1877f2 !important; border-color: #9cc6ff !important; }
#nut-zalo b { font: 900 26px/1 Arial, Helvetica, sans-serif; color: #fff; }
#nut-nhom-zalo { background: #0068ff !important; border-color: #9cc6ff !important; }
#nut-nhom-zalo b { font: 900 24px/1 Arial, Helvetica, sans-serif; color: #fff; }
body.cam-ung #nut-nhom-zalo, body.toi-gian #nut-nhom-zalo { display: none !important; }   /* máy cảm ứng: nằm trong Menu cho đỡ chật */
body.cam-ung #nut-tren > #nut-zalo { order: -1; }   /* sát nút Menu, phía trong */
html body.cam-ung #nut-tren > #nut-menu { order: -2; }
@media (orientation: portrait) {
  /* màn dọc: lối tắt 44 px (rà UI 17/11: Túi từng 36×36); nút Facebook / Zalo đã vào Menu nên còn chỗ. Máy bảng dọc / màn gập: loai_man.css */
  body.cam-ung { --lt: 44px; --menu: 44px; }
  body.cam-ung #nut-tren { gap: 4px; }
  #nut-zalo b { font-size: 22px; }
  /* khung chỉ số lúc hiện đủ số: hẹp lại một chút để không chui xuống dưới hàng nút */
  body.cam-ung #chi-so:not(.gon) { width: 150px; }
}

/* ---- bơi nhặt đồ (boi_ui.ts): nút xuống bơi / lên thuyền; sắp đuối thì nút nháy đỏ ---- */
/* viền riêng Xuống bơi / Lên thuyền đã bỏ (một kiểu viền chung .nut-vong, hoc_avatar_ui.md việc 1); chỉ còn nhắc nguy hiểm khi sắp đuối */
#boi-nut-len.boi-gap { border-color: #ff6a5a !important; color: #ffd0c8 !important; animation: boi-nhay .6s infinite alternate; }
@keyframes boi-nhay { to { box-shadow: 0 0 14px rgba(255, 90, 70, .9); } }

/* ---- thanh "đang thăm đảo" (dao_nha.css #tham-thanh) trên màn dọc / hẹp: trước đây nằm đè lên khung chỉ số + nút Menu và bị cắt mất nút "Về thuyền" ở mép phải.
   Giờ nằm dưới dòng nhiệm vụ, trải hết bề ngang, tên đảo một hàng, ba nút một hàng. ---- */
@media (max-width: 620px), (orientation: portrait) and (max-width: 760px) {
  html body #tham-thanh { left: calc(8px + var(--le, 0px)); right: calc(8px + var(--phai, 0px)); transform: none; top: calc(var(--ct-day, 140px) + 6px);
    flex-wrap: wrap; justify-content: center; row-gap: 5px; max-width: none; border-radius: 14px; padding: 6px 8px; }
  html body #tham-thanh #tham-ten { flex: 1 1 100%; max-width: none; width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html body #tham-thanh button { flex: 1 1 0; min-width: 0; padding: 0 8px; }
}
/* màn ngang cảm ứng: hàng Menu + lối tắt nằm ngay dưới dải ngày giờ, nên thanh thăm đảo lùi xuống dưới hàng đó (trước đây che mất nút Menu) */
@media (orientation: landscape) and (min-width: 621px) {
  html body.cam-ung #tham-thanh { top: calc(var(--dh-day, 34px) + var(--menu, 50px) + 14px); left: 50%; }
}

/* ---- thanh máu boss (boss_bien.css #bb-thanh) trên máy cảm ứng: trước đây nằm đè lên hàng Menu + lối tắt ở mép trên.
   Màn ngang: lùi sang trái, ngay dưới dòng nhiệm vụ, hẹp lại. Màn dọc: dưới dòng nhiệm vụ, trải hết bề ngang. ---- */
@media (orientation: landscape) {
  html body.cam-ung #bb-thanh { top: calc(var(--dh-day, 34px) + 6px); left: calc(50% - 40px); width: min(280px, calc(100vw - 460px)); }
}
@media (orientation: portrait) {
  html body.cam-ung #bb-thanh { top: calc(var(--ct-day, 140px) + 6px); width: calc(100vw - 20px); }
}

/* thanh boss THU GỌN thành nút tròn (boss_bien.ts, chạm để mở / thu): góc trái, ngay dưới cụm chỉ số + nút Cướp đảo */
html body.cam-ung #bb-thanh.thu, #bb-thanh.thu { top: calc(var(--ct-day, 140px) + 64px); left: calc(10px + env(safe-area-inset-left, 0px)); width: 52px; transform: none; }
@media (orientation: landscape) { html body.cam-ung #bb-thanh.thu { top: calc(var(--dh-day, 34px) + 150px); } }

/* ---- A04: cột cảnh báo giữa-trên #cot-canh (bao_ui.ts cotCanh): dải bão #bao-canh + nút chằng đảo #bd-chang xếp dọc, tự đẩy nhau ---- */
#cot-canh { position: fixed; z-index: var(--z-hud-noi); left: 50%; top: calc(env(safe-area-inset-top, 0px) + 62px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
body.cam-ung #cot-canh { top: calc(env(safe-area-inset-top, 0px) + 54px); }
/* trên máy cảm ứng: không đè hàng Menu + lối tắt */
@media (orientation: landscape) {
  html body.cam-ung #cot-canh { top: calc(var(--dh-day, 34px) + var(--menu, 50px) + 22px); max-width: min(360px, calc(100vw - 380px)); }
}
@media (orientation: portrait) {
  html body.cam-ung #cot-canh { top: calc(var(--ct-day, 140px) + 6px); max-width: calc(100vw - 20px); }
}
@media (orientation: portrait) {
  /* A3: cụm tầng ▲2/3▼ (mép phải, dưới chat mờ) cao ngang dải bão → dải co lại + dịch sang trái, chừa cột phải 66px */
  html body.cam-ung.cb-tang #cot-canh#cot-canh { max-width: calc(100vw - 86px); left: calc(10px + (100vw - 86px) / 2); }
}
@media (orientation: portrait) {
  /* đang đánh boss giữa bão: cảnh báo sóng nằm dưới thanh máu boss chứ không chồng lên */
  html body.cam-ung.cb-bbmo.cb-bbmo #cot-canh#cot-canh { top: calc(var(--ct-day, 140px) + 84px); }
}

/* ---- cụm đổi tầng (tang.ts) nằm trong #cum-lai cạnh nút Cầm lái: [▼ Xuống] [tên khu · n/N] [▲ Lên].
   Bấm ở đâu trên thuyền cũng được (máy chủ đưa tới đầu kia cầu thang gần nhất). Nút ≥ 52px; hết tầng thì nút đó mờ, không biến mất. ---- */
#tang-cum { display: flex; align-items: stretch; gap: 4px; padding: 3px; border-radius: 15px; pointer-events: auto;
  background: rgba(4, 14, 26, .55); border: 1px solid rgba(79, 227, 255, .35); box-shadow: 0 3px 8px rgba(0, 0, 0, .35); }
#tang-cum[hidden], body.dang-lai #tang-cum { display: none !important; }
#tang-cum .tang-nut { min-width: 52px; min-height: 52px; padding: 4px 6px; }
#tang-cum .tang-nut b { font-size: 22px; }
#tang-cum .tang-nut:disabled { opacity: .28; }
#tang-chi { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 70px; max-width: 104px; padding: 0 3px;
  text-align: center; line-height: 1.15; pointer-events: none; }
#tang-ten { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #e8fdff; }
#tang-so { font-size: 16px; font-weight: 800; color: #ffe9a8; letter-spacing: .5px; }
/* màn ngang thấp: gọn lại để nằm chung một hàng với nút Cầm lái, không chồng lên bản đồ nhỏ */
@media (max-height: 500px) {
  #tang-cum .tang-nut, body.cam-ung #tang-cum .tang-nut { min-width: 50px; min-height: 50px; }
  #tang-chi { min-width: 62px; max-width: 88px; }
  #tang-cum .tang-nut small { display: none; }
}

/* thẻ hồ sơ: Báo cáo / Chặn + chọn lý do báo cáo (xa_hoi_ui.ts, may_chu/bao_cao.go) */
.hs-nut.hs-an-toan { margin-top: 8px; }
.hs-nut.hs-an-toan button { font-size: 12.5px; }
.hs-nut button.do { border-color: rgba(255, 106, 106, .6); background: rgba(255, 106, 106, .18); color: #ffd0d0; }
.hs-ly { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.hs-ly button { min-height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .25); color: inherit; font: inherit; font-size: 13px; }
.hs-ly button.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
#than-ho-so textarea.tang-nd { width: 100%; box-sizing: border-box; resize: vertical; }
/* điện thoại dọc: dải hoa tiêu nằm dưới cụm chỉ số (trước đè lên túi / chỉ số ở mép trên) */
@media (orientation: portrait) { html body.cam-ung #ht-dai { top: calc(var(--ct-day, 140px) + 52px); max-width: calc(100vw - 24px); } }
#ht-dung { flex: 0 0 auto; min-height: 26px; padding: 0 10px; border-radius: 11px; border: 1px solid rgba(255, 140, 120, .7); background: rgba(120, 30, 20, .55); color: #ffd9cf; font: 700 12px system-ui, sans-serif; }
body.cam-ung #ht-dung { min-height: 34px; }

/* Đang xây / sắp xếp trên điện thoại dọc: cột cảnh báo bão tụt xuống dưới thanh công cụ xây (không đè nút). */
@media (orientation: portrait) {
  html body.cam-ung:is(.dang-xay, .dang-sx) #cot-canh { top: calc(env(safe-area-inset-top, 0px) + 236px); }
}

/* tạo nhân vật — điện thoại ngang rất thấp (≤ 420 px, ví dụ 667 × 375): cột trái (xem trước + xoay + Lên đảo + Quay lại) cao hơn khung nên "Quay lại" bị cắt → thu ô xem trước, bỏ chữ "Nhìn phải" */
@media (max-height: 420px) and (min-width: 621px) {
  #tnv-cv { width: 112px; height: 129px; }
  .tnv-xoay { width: 112px; justify-content: space-between; }
  .tnv-xoay span { display: none; }
  .khung-tao > .tieu-de { min-height: 40px; margin-bottom: 2px; }
  .tnv-nut { padding-top: 4px; gap: 4px; }
  #tnv-ok { min-height: 44px; }
}
/* Cài đặt: các nút chọn (Nhỏ / Vừa / To, Lưới / Thẻ, Tự động…) cao 42 px trên cảm ứng → 44 px */
body.cam-ung .cd-chon button { height: var(--cham-toi-thieu, 44px); }
/* ===== KHUÔN HÀNG VẬT PHẨM CHUNG .hang-vat (buổi 9, 15/11 đợt 3) =====
   <div class="hang-vat"><img class="hv-anh"><span class="hv-nd">tên + phụ</span><b class="hv-gia">giá</b><span class="hv-nut">nút…</span></div>
   Một nút (hoặc chỉ dòng chữ) → nút nằm cùng hàng (4 cột 40px · 1fr · auto · auto). Từ 2 nút trở lên → nút xuống hàng 2, canh phải, dưới tên + giá.
   Không dùng cho .tv-dong (là <button>, không được chứa nút con). */
.hang-vat { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; grid-template-areas: "a t g n"; align-items: center; gap: 4px 8px; min-width: 0; }
.hang-vat > .hv-anh { grid-area: a; width: 36px; height: 36px; image-rendering: pixelated; }
.hang-vat > .hv-nd { grid-area: t; min-width: 0; }
.hang-vat > .hv-gia { grid-area: g; white-space: nowrap; }
.hang-vat > .hv-nut { grid-area: n; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.hang-vat:has(> .hv-nut > button:nth-child(2)) { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "a t g" "a n n"; }

/* ===== MÁY BẢNG + SIÊU RỘNG (buổi 9) ===== */
/* máy bảng cảm ứng (≥ 700 × 600): HUD to thêm một nấc (1.14 → 1.28) — trên 768 × 1024 / 1024 × 768 trước đây HUD bé như điện thoại thu nhỏ */
@media (min-width: 700px) and (min-height: 600px), (min-width: 900px) and (min-height: 540px) { body.cam-ung { --nen-co: 1.28; } }
/* siêu rộng (tỉ lệ ≥ 2:1, ≥ 1800 px, chuột): HUD gom vào khung 16:9 ở giữa thay vì dạt hai mép màn (2560 × 1080 trước đây bản đồ nhỏ cách bảng giữa ~900 px).
   --le / --phai là vùng an toàn mà mọi mép HUD đã cộng sẵn, nên chỉ cần nới hai biến này. */
@media (min-aspect-ratio: 2/1) and (min-width: 1800px) {
  :root { --le: calc(env(safe-area-inset-left, 0px) + (100vw - 177.78vh) / 2); --phai: calc(env(safe-area-inset-right, 0px) + (100vw - 177.78vh) / 2); }
}

/* ---- "Như app" (15/11/2026, đối chiếu mẫu web-mobile của Cocos Creator): Cocos chỉ có MỘT canvas và nuốt mọi sự kiện chạm nên trình duyệt
   không có gì để phóng to / chọn / kéo. Game mình có HUD bằng DOM nên phải chặn từng đường một:
   - iOS tự PHÓNG TO trang khi chạm vào ô nhập có chữ nhỏ hơn 16px (chat 14px, ô tìm 14px, toạ độ bản đồ…) → mọi ô nhập trên máy cảm ứng ≥ 16px;
   - ảnh / biểu tượng không bị kéo ra thành "bóng ma", không hiện bảng lưu ảnh khi nhấn giữ;
   (trang vốn đã overflow hidden + overscroll-behavior none + chặn chụm hai ngón nên không cần ghim cứng thêm). ---- */
body.cam-ung input, body.cam-ung textarea, body.cam-ung select { font-size: 16px !important; }
@supports (-webkit-touch-callout: none) { input, textarea, select { font-size: 16px !important; } }
img, svg, canvas, a { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }

/* ---------- màn đầu bớt tĩnh (15/11, số đo: một nửa người thấy màn đăng nhập không bấm gì): nút "Chơi ngay" thở nhẹ, hải âu bay ngang, nút loa ---------- */
#dang-nhap .dn-chim { position: fixed; left: 0; right: 0; top: calc(var(--tren, 0px) + 6%); height: 14%; pointer-events: none; overflow: hidden; z-index: 0; }
#dang-nhap .dn-chim i { position: absolute; left: -40px; width: 30px; height: 14px; opacity: .85;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 14'%3E%3Cpath d='M1 10 Q8 0 15 8 Q22 0 29 10' fill='none' stroke='%23f4fbff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: dn-chim 24s linear infinite, dn-chim-vo .9s ease-in-out infinite alternate; }
#dang-nhap .dn-chim i:nth-child(2) { top: 45%; width: 22px; height: 10px; animation-duration: 31s, .75s; animation-delay: -11s, 0s; opacity: .7; }
#dang-nhap .dn-chim i:nth-child(3) { top: 75%; width: 26px; height: 12px; animation-duration: 38s, 1s; animation-delay: -22s, 0s; opacity: .6; }
@keyframes dn-chim { from { transform: translateX(0) translateY(0); } 50% { transform: translateX(55vw) translateY(10px); } to { transform: translateX(calc(100vw + 80px)) translateY(-6px); } }
@keyframes dn-chim-vo { from { scale: 1 1; } to { scale: 1 .72; } }
@media (prefers-reduced-motion: reduce) { #dang-nhap .dn-chim i { animation: none; } }
html.giam-cd #dang-nhap .dn-chim { animation: none; display: none; }

/* Cài đặt → Hướng màn hình (app Android): 4 nút chọn */
.cd-huong-nut { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cd-huong-nut button { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid rgba(120, 220, 255, .35); background: rgba(10, 40, 58, .8); color: #dff6ff; font: inherit; font-size: 14px; }
.cd-huong-nut button.bat { background: #ffc94a; color: #1a2a33; border-color: #ffc94a; font-weight: 700; }
/* thông báo open beta + mã quà (thong_bao_beta.ts) */
#hop-thoai .bt-qua { margin-top: 10px; font-weight: 700; }
#hop-thoai .bt-ma { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--vien); border-radius: 9px; background: rgba(79, 227, 255, .08); }
#hop-thoai .bt-ma b { font-size: 20px; letter-spacing: 2px; color: #ffd27a; -webkit-user-select: all; user-select: all; }
#hop-thoai .bt-chep { min-height: 44px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .2); color: var(--chu); font-weight: 700; }
/* ===== hud_gon.css ===== */
/* GIAO DIỆN GỌN cho điện thoại (hud_gon.ts): người chơi than giao diện che gần nửa màn hình dọc, không ngắm được cảnh.
   1) Thanh cầm đồ tự co lại còn MỘT ô (món đang cầm) nằm ở mép dưới giữa cần điều khiển và nút chính; chạm vào thì bung cả thanh vài giây.
   2) Dòng nhiệm vụ thu gọn chỉ còn một dòng.
   3) Nút con mắt = chế độ ngắm cảnh: ẩn hết, chỉ giữ cần điều khiển + cụm lái; chạm con mắt lần nữa để hiện lại. */

/* ---------- 1) thanh cầm đồ co lại (chỉ màn dọc, máy cảm ứng) ---------- */
@media (orientation: portrait) {
  html body.cam-ung.tc-gon #thanh-cam { z-index: 7; left: calc(50% - 40px); right: auto; bottom: calc(12px + var(--day, 0px)); top: auto; width: auto; max-width: none;
    margin: 0; padding: 0; transform: none; background: none; border: 0; box-shadow: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  html body.cam-ung.tc-gon #thanh-cam .o-cam { display: none; }
  html body.cam-ung.tc-gon #thanh-cam .o-cam.chon,
  html body.cam-ung.tc-gon #thanh-cam:not(:has(.o-cam.chon)) .o-cam:first-child { display: block; flex: 0 0 48px; width: 48px; height: 48px; max-width: none; opacity: .92; }
  html body.cam-ung.tc-gon #thanh-cam::after { content: '⋯'; position: absolute; right: -24px; top: 14px; width: 20px; height: 20px; border-radius: 50%;
    background: rgba(8, 30, 44, .9); border: 1px solid rgba(120, 220, 255, .7); color: #cfefff; font: 700 13px/18px system-ui, sans-serif; text-align: center; pointer-events: none; }

  /* ---------- 2) dòng nhiệm vụ thu gọn: một dòng ---------- */
  html body.cam-ung #nhiem-vu.thu-gon #nv-tom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; height: auto; line-height: 26px; }
  html body.cam-ung #nhiem-vu.thu-gon #nv-dau { min-height: 0; height: 28px; align-items: center; }
  html body.cam-ung #nhiem-vu.thu-gon { min-height: 0; }
}

/* ---------- 3) chế độ ngắm cảnh ---------- */
#nut-ngam { display: none; }
body.cam-ung #nut-ngam { display: flex; position: fixed; z-index: var(--z-chip); left: calc(12px + env(safe-area-inset-left, 0px)); top: calc(var(--ct-day, 150px) + 8px);
  width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0; border-radius: 50%; font-size: 17px; line-height: 1;
  background: rgba(8, 30, 44, .62); border: 1px solid rgba(120, 220, 255, .45); color: #e8f8ff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); -webkit-tap-highlight-color: transparent; }
body.cam-ung #nut-ngam:active { transform: scale(.92); }
body.cam-ung #nut-ngam[hidden] { display: none; }
body.ngam-canh #nut-ngam { top: calc(10px + env(safe-area-inset-top, 0px)); background: rgba(120, 82, 22, .8); border-color: #ffd36a; opacity: .75; }
body.ngam-canh #hud > *:not(#vung-can):not(#dpad):not(#cum-lai),
body.ngam-canh #thong-bao, body.ngam-canh #nhan-tang, body.ngam-canh #hd-mui,
body.ngam-canh #dao-thanh, body.ngam-canh #dn-thanh, body.ngam-canh #sx-thanh { visibility: hidden !important; pointer-events: none !important; }

/* A10: vùng chạm ≥ 44 px cho nút con mắt (nhìn nhỏ 34 vẫn giữ hình, nới bằng ::after) */
/* A10 + đợt "UI nhỏ" 5: mọi chip nhỏ trên cảm ứng (🏝 🌲 🏙 cao 32, 🏴 26, 👁 34) có vùng chạm ẩn ĐÚNG 44 px (không to hơn, khỏi đè chip kề); xep_chip.ts đo cả vùng chạm
   khi xếp nên hai chip kề nhau không bao giờ chung vùng chạm. ::before cũ (inset -8) của #dn-ve / #tp-ve bỏ trên cảm ứng. */
body.cam-ung :is(#nut-ngam, #dn-ve, #tp-ve, #rg-ve, #cd-chip, #ghim-chip)::before { content: none; }
body.cam-ung :is(#nut-ngam, #dn-ve, #tp-ve, #rg-ve, #cd-chip, #ghim-chip)::after { content: ""; position: absolute; top: min(0px, calc((100% - 44px) / 2)); bottom: min(0px, calc((100% - 44px) / 2));
  left: min(0px, calc((100% - 44px) / 2)); right: min(0px, calc((100% - 44px) / 2)); }
/* GHIM "đang gom cho món X" (ghim_che.ts): chip một dòng dưới cột trái; cảm ứng dời sang phải nút con mắt. Đủ nguyên liệu → viền + chữ xanh. */
#ghim-chip { position: fixed; z-index: var(--z-chip); left: calc(8px + var(--le, 0px)); top: calc(var(--ct-day, 150px) + 8px); max-width: min(62vw, 340px); display: flex; align-items: center; gap: 4px;
  padding: 4px 4px 4px 10px; min-height: 28px; border-radius: 14px; font: 600 12px/1.2 system-ui, sans-serif; color: #fff1c4; cursor: pointer; text-align: left;
  background: rgba(7, 24, 40, .88); border: 1px solid #ffd36a; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); -webkit-tap-highlight-color: transparent; }
#ghim-chip[hidden] { display: none; }
body.cam-ung #ghim-chip { left: calc(54px + var(--le, 0px) + env(safe-area-inset-left, 0px)); }
#ghim-chip .gc-chu { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ghim-chip .gc-chu b { color: #ffd36a; font-weight: 800; }
#ghim-chip .gc-x { flex: 0 0 auto; min-width: 24px; text-align: center; font-size: 16px; line-height: 20px; opacity: .7; }
#ghim-chip.du { border-color: #7dffb0; color: #d8ffe6; background: rgba(12, 60, 36, .92); animation: ghimDu 1.6s ease-in-out infinite; }
#ghim-chip.du .gc-chu b { color: #7dffb0; }
@keyframes ghimDu { 50% { box-shadow: 0 0 10px rgba(125, 255, 176, .7); } }
html body.tt-an:not(.tt-m7) #ghim-chip, html body.tan-thu-som #ghim-chip { display: none !important; }
body.menu-the.mt-an-hud #ghim-chip { visibility: hidden; pointer-events: none; }
.dong-che .che-ghim { padding: 8px 9px; min-width: 40px; background: transparent; border-color: var(--vien-mo); opacity: .75; }
.dong-che .che-ghim.bat { opacity: 1; background: rgba(255, 211, 106, .2); border-color: #ffd36a; }
body.cam-ung .dong-che .che-ghim { min-width: 44px; }
/* A17: trên phố cảng nút chính không còn là "Câu" → mờ đi khi chẳng có việc gần */
body #nut-chinh.pho-mo .vong { opacity: .5; }
/* A14: đang xây nhà / sắp xếp đảo / trong hang mỏ: chip chỉ đường và chip phụ chiếm chỗ, giấu đi */
body:is(.dang-xay, .dang-sx, .trong-hang) :is(#cd-chip, #kb-chip, #dn-ve, #rg-ve, #tp-ve, #ghim-chip) { display: none !important; }

/* ---------- 4) cụm lên / xuống tầng ở màn dọc: cột mảnh sát mép phải (▲ · 2/3 · ▼) thay vì chắn ngang giữa màn ---------- */
@media (orientation: portrait) {
  html body.cam-ung #tang-cum { position: fixed; z-index: 6; right: calc(8px + env(safe-area-inset-right, 0px)); top: calc(var(--ct-day, 150px) + 46px);
    flex-direction: column-reverse; gap: 2px; padding: 2px; border-radius: 13px; }
  html body.cam-ung #tang-cum .tang-nut { min-width: 44px; min-height: 44px; width: 44px; height: 44px; padding: 0; }
  html body.cam-ung #tang-cum .tang-nut small { display: none; }
  html body.cam-ung #tang-cum #tang-chi { min-width: 0; max-width: 44px; padding: 2px 0; }
  html body.cam-ung #tang-cum #tang-ten { display: none; }
  html body.cam-ung #tang-cum #tang-so { font-size: 13px; }
}

/* ---------- 5) vặt: tên nguyên liệu còn thiếu trong bảng Chế tạo (điện thoại không rê chuột xem tên được) + nút nấu nhiều suất ---------- */
.dong-che .can .thieu-ten { font-style: normal; font-size: 11px; margin-left: 3px; color: #ffb4a8; white-space: nowrap; }
.na-mon .na-nhieu { margin-left: 4px; min-width: 44px; min-height: 40px; padding: 0 8px; border-radius: 10px; font-weight: 800; }

/* ---------- 6) Menu: hàng "Khác" (thông báo, hướng dẫn, cài đặt…) là các nút dẹt nhỏ ở cuối, không tranh chỗ với ô chính ---------- */
.ml-nhom.ml-nho { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--vien-mo); }
.ml-nhom.ml-nho h3 { display: none; }
.ml-nhom.ml-nho .ml-luoi { display: flex; flex-wrap: wrap; gap: 6px; grid-template-columns: none; }
.ml-nhom.ml-nho .ml-o { flex: 1 1 0; min-width: 0; height: 46px; min-height: 46px; flex-direction: column; gap: 1px; padding: 2px; border-radius: 12px; }
.ml-nhom.ml-nho .ml-o .ml-chu { font-size: 16px; line-height: 1.1; height: auto; }
.ml-nhom.ml-nho .ml-o img { width: 22px; height: 22px; }
.ml-nhom.ml-nho .ml-o span { font-size: 11px; }

/* ---------- 7) Cài đặt chia thẻ (cai_dat_nhom.ts): mỗi lúc chỉ hiện một nhóm ---------- */
/* C07: hàng thẻ Cài đặt = hàng thẻ chuẩn .tab-ht (style.css): thẻ KHÔNG bị bóp / cắt chữ, hàng cuộn ngang khi hẹp; dính ở đầu thân bảng */
#cd-the { position: sticky; top: 0; z-index: 2; margin: 0 -12px 4px; padding: 8px 12px; gap: 6px; background: var(--nen-dam, #0b2230); border-bottom: 1px solid var(--vien-mo); }
#cd-the button { flex: 0 0 auto; white-space: nowrap; }
#bang-caidat .cd-than > [data-nhom-an] { display: none !important; }

/* ---------- 8) chip chỉ hướng kho báu (#kb-chip) trên máy cảm ứng: nằm dưới dòng nhiệm vụ / hàng Menu, không đè hàng chỉ số ---------- */
@media (orientation: portrait) {
  html body.cam-ung #kb-chip { top: calc(var(--ct-day, 150px) + 8px); left: calc(50% + 22px); }
}
@media (orientation: landscape) {
  html body.cam-ung #kb-chip { top: calc(var(--dh-day, 34px) + var(--menu, 50px) + 22px); }
}
/* đang mở một bảng lớn (bản đồ, túi…): chip kho báu, cảnh báo bão và thanh máu boss không nổi đè lên bảng */
body.cb-bang.cb-bang #kb-chip#kb-chip#kb-chip { display: none !important; }

/* ---------- 9) thẻ Cốt truyện: nút "Đọc lại lời kể" / "Nhiệm vụ đang làm" bị nền trắng chữ nhạt (không đọc được) ---------- */
.ctr-nut-nho button, #bang-ctr .ctr-nut button:not(.chinh) { background: rgba(79, 227, 255, .1); color: var(--chu, #e8f8ff); border: 1px solid var(--vien-mo, rgba(120, 220, 255, .35)); font-weight: 700; }
.ctr-nut-nho { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- 10) bảng Tài khoản: khối "Lưu tài khoản khách" ---------- */
.tk-luu-khach { border: 1px solid #ffd36a; background: rgba(120, 82, 22, .22); margin-top: 0; margin-bottom: 10px; display: flex; flex-direction: column; gap: 7px; }
.tk-luu-khach .vh-o { width: 100%; box-sizing: border-box; }

/* ---------- 11) bảng Chế tạo: nút chế nhiều lượt (×N) cạnh nút Chế ---------- */
.dong-che .che-nut { display: flex; gap: 4px; align-items: center; flex: 0 0 auto; }
.dong-che .che-nhieu { padding: 8px 9px; min-width: 44px; background: rgba(255, 211, 106, .16); border-color: #ffd36a; color: #ffe9a8; }

/* ---------- 12) điện thoại cầm ngang: bớt chip ở hàng đồng hồ (toạ độ đã có trong Bản đồ, giờ bảo hộ có trong bảng Đảo nhà) ---------- */
@media (orientation: landscape) and (max-height: 480px) {
  html body.cam-ung #toa-do, html body.cam-ung #dh-baoho { display: none !important; }
}

/* ---------- 13) GIAO DIỆN TỐI GIẢN trên điện thoại (hud_gon.ts, body.toi-gian; tắt trong Cài đặt → Hiển thị) ---------- */
/* 13/11: chủ game đổi nút Túi lấy nút Chat ở màn chính điện thoại. 14/11: hai người chơi xin "hiện lại túi ra màn hình chính" → hiện lại Túi, vẫn giữ Chat */
html body.toi-gian #nut-zalo,
html body.toi-gian #dh-ngay, html body.toi-gian #dh-baoho, html body.toi-gian #toa-do, html body.toi-gian #dh-thientai.troi-nang { display: none !important; }
/* 14/11 (người chơi: "trên điện thoại không có trôi theo hải lưu à"): chip 🏙 — chạm để theo hải lưu về Bến Vạn Buồm — trước bị ẩn hẳn
   ở giao diện tối giản. Giờ hiện gọn ngay dưới bản đồ nhỏ (dưới chip đảo nhà nếu có), không đè nút Chat / Menu */
html body.toi-gian.cam-ung #tp-ve { top: calc(var(--dh-day, 34px) + 48px); right: calc(var(--mep, 8px) + var(--phai, 0px)); min-width: 0; }
html body.toi-gian.cam-ung.co-dao-thanh #tp-ve { top: calc(var(--dh-day, 34px) + 48px); }
/* chỉ số: ảnh nhỏ + ba vạch, bỏ hàng xu / cấp (xem trong Menu) */
html body.toi-gian #chi-so .hang-diem { display: none !important; }
html body.toi-gian #chi-so { padding: 4px 10px 4px 4px; min-height: 0; height: auto; align-items: center; gap: 7px; width: max-content; max-width: none; }
html body.toi-gian #chi-so #cs-chan { width: 42px; height: 42px; min-width: 0; min-height: 0; flex: 0 0 auto; }
html body.toi-gian #chi-so #cs-anh { width: 38px; height: 38px; }
/* ba vạch RÕ: biểu tượng 15 px + vạch dày 9 px + con số đậm (bản đầu để vạch co về 0 nên không thấy gì) */
html body.toi-gian #chi-so .cs-vach { display: flex; flex-direction: column; gap: 4px; width: auto; min-width: 0; }
html body.toi-gian #chi-so .vach { display: grid; grid-template-columns: 15px 86px 26px; align-items: center; gap: 5px; width: auto; height: 15px; }
html body.toi-gian #chi-so .vach[hidden] { display: none !important; }
html body.toi-gian #chi-so .vach > i, html body.toi-gian #chi-so .vach > img { width: 15px; height: 15px; font-size: 13px; line-height: 15px; }
html body.toi-gian #chi-so .vach > b { display: block; width: 86px; height: 9px; border-radius: 5px; overflow: hidden; }
html body.toi-gian #chi-so .vach > b > span { display: block; height: 100%; }
html body.toi-gian #chi-so .vach > em { display: block; font-size: 12.5px; font-weight: 800; line-height: 15px; text-align: left; font-style: normal; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
html body.toi-gian #dong-ho { background: none; border-color: transparent; box-shadow: none; opacity: .9; }
/* dòng nhiệm vụ thu thành viên "NV" (chạm để hiện lại) */
html body.toi-gian.nv-an #nhiem-vu.thu-gon { width: auto !important; min-width: 0 !important; max-width: none; opacity: .8; }
html body.toi-gian.nv-an #nhiem-vu.thu-gon #nv-tom, html body.toi-gian.nv-an #nhiem-vu.thu-gon #nv-thu { display: none !important; }
@media (orientation: portrait) {   /* màn dọc: khung chỉ số hẹp hơn, rút vạch cho con số nằm trong khung */
  html body.toi-gian #chi-so .vach { grid-template-columns: 15px 68px 26px; }
  html body.toi-gian #chi-so .vach > b { width: 68px; }
}
@media (orientation: portrait) {
  html body.toi-gian #chi-so { grid-template-columns: 42px max-content; }
  html body.toi-gian #chi-so .cs-vach { width: max-content; }
}
@media (orientation: portrait) { html body.toi-gian #chi-so { min-width: 184px !important; width: 184px !important; box-sizing: border-box; } }

/* ---------- 14) tên game: FARSEA + dòng phụ tiếng Việt ---------- */
.logo .logo-phu { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px; opacity: .85; text-shadow: none; text-transform: none; }

/* ---------- 15) TÂN THỦ (tan_thu_dan.ts, bản chốt 22/11/2026 docs/thiet_ke_tan_thu_moi_2211.md: game KHÔNG làm hộ) ----------
   body.tan-thu-som (bước 0..2) · body.tt-dich (vòng sáng 3D đang chỉ đích → mũi tên vàng cũ nhường chỗ) · body.tt-ket (kẹt > 60 giây: mũi tên to)
   body.hd-mo (đang làm sáng một nút → làm mờ nút khác, vẫn bấm được) · #tt-mep mũi tên mép màn + khoảng cách · #tt-tien tiến độ 1/3
   #tt-mung mừng xong bước / màn kết (.cuoi) · #tt-goi gợi ý thứ hai khi kẹt · #tt-nhip nhịp giật lần câu đầu · #ttb-nut chỉ còn nút "Gọi đò" */
body.tt-dich #hd-mui { display: none !important; }

/* a) MỞ DẦN HUD theo bước (CẢ PC lẫn điện thoại). tan_thu_dan.ts datGiaiDoan gắn lên <body>:
      tt-an = đang hướng dẫn (còn bước, chưa bỏ qua) · tan-thu-som = bước 0..2 · tt-m1..tt-m10 = đã tới bước đó (cộng dồn).
      Lúc đầu: cần điều khiển + dòng mục tiêu + nút ngữ cảnh của bước (Nhặt…) + Menu (có "Bỏ qua hướng dẫn") + Chat.
      m1 Đóng xuồng · b2 + b7 (chỉ hai bước đó) Ra khơi · m3 nút Câu + thanh cầm đồ · m4 Lái / Cầm chèo + Cập bến · m5 Túi · m6 Chế · m7 Cập cảng + bản đồ · m8 "…" · m10 Mồi.
      Xong / bỏ qua tân thủ: không class nào → HUD đầy đủ như cũ. */
html body.tt-an :is(#nut-zalo, #nut-nhom-zalo, #nut-chuong, #nut-goc, #nut-ngam, #kb-chip, #bb-chip, #tn-chip, #nc-chip, #cd-chip, #tp-ve, #rg-ve, #nut-toanman,
  #nut-nc, #nut-xh, #nut-ht, #nut-caidat, #dn-nut-xay, #dn-nut-sx, #nut-vong-xay, #nut-dn, #dn-ve,
  #dn-nut-vao, #boi-nut-xuong) { display: none !important; }   /* 🏝 Vào đảo ở mốc trùng nghĩa với Cập bến; Xuống bơi chưa cần */
html body.tan-thu-som :is(#boi-nut, #goi-y) { display: none !important; }
html body.tt-an:not(.tt-m1) #dn-nut-xuong { display: none !important; }
html body.tt-an:not(.tt-b2):not(.tt-b7) #dn-nut-ra { display: none !important; }   /* Ra khơi: chỉ ở bước 2 (ra khơi) và 7 (tới cảng) */
html body.tt-an:not(.tt-m3) #thanh-cam { display: none !important; }
html body.tt-an:not(.tt-m4):not(.tt-cam-lai) #cum-lai { display: none !important; }
html body.tt-an:not(.tt-m4) #dn-nut-cap { display: none !important; }
html body.tt-an:not(.tt-m5) #nut-tui { display: none !important; }
html body.tt-an:not(.tt-m6) #nut-che { display: none !important; }
html body.tt-an:not(.tt-m7) :is(#tp-nut-cap, #nut-bando, #ban-do-nho) { display: none !important; }
html body.tt-an:not(.tt-m8) #nut-vong-them { display: none !important; }
html body.tt-an:not(.tt-m10) #nut-moi { display: none !important; }
/* hàng đồng hồ: giữ chỗ (các phần khác đo đáy của nó để xếp chỗ) nhưng không vẽ, không nhận chạm */
html body.tt-an #dong-ho { visibility: hidden !important; pointer-events: none !important; }
/* nút Câu chưa cần ở bước 0–2: ẩn nhưng GIỮ chỗ (hud.ts xepVong lấy nó làm tâm vòng cung nút ngữ cảnh; display:none làm lệch) */
html body.tt-an:not(.tt-m3) #nut-chinh { visibility: hidden !important; pointer-events: none !important; }
/* bản đồ nhỏ đã ẩn: nút Menu dồn sát góc phải, dòng nhiệm vụ rộng ra */
html body.cam-ung.tt-an:not(.tt-m7) #nut-tren { right: calc(var(--mep, 8px) + var(--phai, 0px)); }
@media (orientation: portrait) {   /* (màn ngang: giữ bề rộng cũ, khỏi đè cột thông báo giữa màn) */
  html body.cam-ung.tan-thu-som #cot-trai { width: min(400px, calc(100vw - var(--menu, 50px) - 2 * var(--mep, 8px) - 26px - var(--le, 0px) - var(--phai, 0px))); }
}
/* nút ngữ cảnh duy nhất của bước 0–2 (Nhặt / Đóng xuồng / Ra khơi…) to bằng nút Câu, nằm đúng ô nút lớn (hud.ts xepVong đặt tâm vào đó) */
html body.cam-ung.tan-thu-som :is(#nut-phu button, .nut-vong, #dao-thanh .dao-nut, #dn-thanh .dn-nut) { width: var(--nc); height: var(--nc); font-size: 15px; border-width: 2px; }
/* PC: nhãn phím cạnh nút (Nhặt [E], Dùng [E]) */
body:not(.cam-ung) :is(#dn-nut-nhat, #dn-nut-dung)::after { content: " [E]"; opacity: .8; font-weight: 700; }
/* nút vừa mở lần đầu (sang bước mới): sáng lên MỘT lần */
.tt-moi-mo { animation: ttMoiMo 2.4s ease-out 1 !important; }
@keyframes ttMoiMo { 0% { box-shadow: 0 0 0 0 rgba(255, 216, 74, .95); filter: brightness(1.7); } 35% { box-shadow: 0 0 0 12px rgba(255, 216, 74, 0), 0 0 26px 10px rgba(255, 216, 74, .85); filter: brightness(1.35); }
  100% { box-shadow: 0 0 0 0 rgba(255, 216, 74, 0); filter: none; } }
/* đang làm sáng đúng một nút (huong_dan.ts .hd-sang) → các nút khác mờ đi, vẫn bấm được */
html body.tt-an.hd-mo :is(#nut-phu button, #dn-thanh .dn-nut, .nut-vong, #nut-tui, #nut-che, #nut-menu, #nut-chat, #nut-bando, #thanh-cam .o-cam, #cum-lai button, #nut-chinh, #nut-vong-them):not(.hd-sang):not(:has(.hd-sang)) {
  opacity: .4; filter: saturate(.5); transition: opacity .25s; }
html body.hd-mo #ds-che:has(.hd-sang) .dong-che:not(:has(.hd-sang)) { opacity: .45; }
/* kẹt quá 60 giây: mũi tên chỉ dẫn + mũi tên mép to hơn */
body.tt-ket #hd-mui svg { scale: 1.75; transform-origin: 50% 100%; }
body.tt-ket #tt-mep i { scale: 1.6; }
/* gợi ý thứ hai (kẹt) ngay dưới dòng mục tiêu */
#tt-goi { margin-top: 5px; padding: 6px 10px; border-radius: 12px; background: rgba(6, 20, 34, .9); border: 1.5px solid #ffd84a; color: #fff1b8;
  font: 800 13.5px/1.3 system-ui, sans-serif; box-shadow: 0 0 12px rgba(255, 216, 74, .35); pointer-events: none; animation: ttGoi 1.6s ease-in-out infinite alternate; }
#tt-goi[hidden] { display: none; }
@keyframes ttGoi { from { box-shadow: 0 0 6px rgba(255, 216, 74, .25); } to { box-shadow: 0 0 16px rgba(255, 216, 74, .6); } }
/* câu cá lần đầu: MỘT dòng nhịp giật to giữa màn (không chặn chạm) */
#tt-nhip { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: var(--z-huong-dan); pointer-events: none; max-width: calc(100vw - 32px);
  padding: 8px 18px; border-radius: 22px; background: rgba(6, 20, 34, .86); border: 2px solid rgba(255, 255, 255, .5); color: #e8f6ff; text-align: center;
  font: 900 19px/1.25 system-ui, sans-serif; box-shadow: 0 4px 16px rgba(0, 0, 0, .45); }
#tt-nhip[hidden] { display: none; }
#tt-nhip.gap { border-color: #ffd84a; color: #ffe066; font-size: 22px; animation: ttNhipGiat .5s ease-in-out infinite alternate; }
@keyframes ttNhipGiat { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.07); } }
/* lời chào "Chào mừng trở lại! Việc đang dở…": bỏ (dòng mục tiêu đã nói việc đang dở) */
html body.tt-an :is(.tt-chao, .tn-chao) { display: none !important; }

/* b) dòng mục tiêu (cả chuỗi tân thủ, body.tt-an): ngay dưới chỉ số trái-trên (#cot-trai), to rõ; PC / màn ngang 1 dòng, màn dọc tối đa 2 dòng; không thu thành viên "NV" */
html body.tt-an #nhiem-vu.thu-gon { border: 1.5px solid rgba(255, 216, 74, .75); border-radius: 14px; background: rgba(6, 20, 34, .86); box-shadow: 0 0 12px rgba(255, 216, 74, .25); }
html body.tt-an #nhiem-vu.thu-gon #nv-dau { height: auto; min-height: 36px; }
html body.tt-an #nhiem-vu.thu-gon .nv-nhan { display: none; }
html body.tt-an #nhiem-vu.thu-gon #nv-tom,
html body.toi-gian.nv-an.tt-an #nhiem-vu.thu-gon #nv-tom { display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; white-space: normal;
  font-size: 15px; font-weight: 800; line-height: 1.3; height: auto; padding: 6px 2px; color: #fff1b8; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
html body.toi-gian.nv-an.tt-an #nhiem-vu.thu-gon { width: auto !important; opacity: 1; }
html body.tt-an #cot-trai { width: min(560px, 46vw); }
@media (orientation: portrait) {
  html body.tt-an #nhiem-vu.thu-gon #nv-tom,
  html body.toi-gian.nv-an.tt-an #nhiem-vu.thu-gon #nv-tom { -webkit-line-clamp: 2; font-size: 14.5px; }
}

/* c) (đã bỏ 22/11: nút "👉 Tới món đồ gần nhất" #tt-toi và nút vàng làm hộ #ttb-nut — xem tan_thu_dan.ts / tan_thu_nut.ts) */

/* d) mũi tên mép màn khi đích ra ngoài màn (JS đặt translate tới điểm mép) */
#tt-mep { position: fixed; left: 0; top: 0; z-index: var(--z-huong-dan); width: 0; height: 0; pointer-events: none; will-change: transform; }
#tt-mep[hidden] { display: none; }
#tt-mep i { position: absolute; left: -16px; top: -14px; width: 32px; height: 28px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); animation: ttMep .8s ease-in-out infinite alternate; }
#tt-mep b { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); padding: 1px 7px; border-radius: 9px; background: rgba(6, 20, 34, .85); border: 1px solid #ffd84a;
  color: #ffe9a6; font: 800 12px/16px system-ui, sans-serif; white-space: nowrap; }
@keyframes ttMep { from { opacity: .75; } to { opacity: 1; } }

/* e) tiến độ 1/3 · 2/3 · 3/3 ✓ to giữa phía trên, không chặn chạm */
#tt-tien { position: fixed; left: 50%; top: 27%; z-index: var(--z-huong-dan); transform: translate(-50%, -50%); pointer-events: none; font: 900 54px/1 system-ui, sans-serif; color: #ffe066;
  -webkit-text-stroke: 2px #3a2500; text-shadow: 0 3px 0 #3a2500, 0 0 18px rgba(255, 216, 74, .7); }
#tt-tien[hidden] { display: none; }
#tt-tien.du { color: #8dffb4; text-shadow: 0 3px 0 #0d3a1c, 0 0 20px rgba(120, 255, 170, .8); -webkit-text-stroke-color: #0d3a1c; }
#tt-tien.hien { animation: ttTien 1.15s ease-out forwards; }
@keyframes ttTien { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
  32% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1); } }

/* f) mừng xong bước: chữ to + hoa giấy bung ra, ~3 giây, không chặn chạm */
#tt-mung { position: fixed; left: 50%; top: 36%; z-index: var(--z-huong-dan); transform: translate(-50%, -50%); width: min(340px, calc(100vw - 32px)); pointer-events: none; text-align: center;
  padding: 12px 14px 12px; border-radius: 16px; background: rgba(6, 26, 40, .88); border: 2px solid #ffd84a; box-shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 0 22px rgba(255, 216, 74, .35); color: #fff; }
#tt-mung[hidden] { display: none; }
/* rà UI 17/11: thẻ mừng đè dải "Mục tiêu đầu" ở màn dọc bước 1–2 → lúc thẻ mừng hiện thì tạm giấu dải (thẻ đã nói việc kế tiếp) */
#tt-mung.hien { animation: ttMung 3.2s ease-out forwards; }
#tt-mung .tm-sao { font-size: 34px; line-height: 1; }
#tt-mung .tm-dau { margin-top: 4px; font: 900 22px/1.2 system-ui, sans-serif; color: #ffe066; }
#tt-mung .tm-tiep { margin-top: 6px; font-size: 14px; font-weight: 700; line-height: 1.35; color: #d8f4ff; }
#tt-mung .tm-tiep:empty { display: none; }
#tt-mung .tm-hoa { position: absolute; left: 50%; top: 30px; width: 0; height: 0; }
#tt-mung .tm-hoa i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 2px; opacity: 0; }
#tt-mung.hien .tm-hoa i { animation: ttHoa 1.1s ease-out forwards; }
@keyframes ttMung { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 10% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 16% { transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ttHoa { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(260deg); } }

/* g) ngắm cảnh / sắp xếp đảo: ẩn hết phần tân thủ */
body.ngam-canh :is(#tt-mep, #tt-tien, #tt-mung:not(.cuoi), #tt-goi, #tt-nhip, #ttb-nut),
body.dang-sx :is(#tt-mep, #tt-tien, #tt-mung:not(.cuoi), #tt-goi, #tt-nhip, #ttb-nut) { display: none !important; }
/* màn kết tân thủ: trên MỌI lớp (toast, hộp OPEN BETA, truyện kết chờ nó đóng — body.tt-cho-ket) */
#tt-mung.cuoi { z-index: 79;   /* trên toast (60) và hộp kín; DƯỚI hộp xác nhận #hop-thoai (80) */
  pointer-events: auto; animation: none; opacity: 1; max-height: calc(var(--cao, 100vh) - 24px); overflow-y: auto; top: 46%; }
#tt-mung.cuoi .tm-tiep { font-weight: 600; }
#tt-mung .tm-qua { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-weight: 800; }
#tt-mung .tm-qua span { display: inline-flex; align-items: center; gap: 3px; }
#tt-mung .tm-qua img { width: 18px; height: 18px; image-rendering: pixelated; }
#tt-mung .tm-muc { margin-top: 8px; text-align: left; }
#tt-mung .tm-muc ul { margin: 3px 0 0; padding: 0; list-style: none; font-weight: 700; }
#tt-mung .tm-nut { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
#tt-mung .tm-nut button { min-height: 44px; padding: 0 16px; border-radius: 22px; font: 900 15px/1 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
#tt-mung .tm-xem { background: linear-gradient(#ffe27a, #f2b52e); color: #2a1a00; border: 2px solid #fff4c2; }
#tt-mung .tm-sau { background: rgba(6, 20, 34, .88); color: #ffe9a6; border: 2px solid #ffd84a; }

/* mấy bước đầu: chưa cần nút Sắp xếp đảo */
html body.tan-thu-som #dn-nut-sx { display: none !important; }

/* ---------- iPhone mở từ màn hình chính: chữa dải hở ở đáy (khoi_dong.ts gắn class ios-ud) ---------- */
html.ios-ud { min-height: calc(100% + env(safe-area-inset-top, 0px)); }

/* ---------- trình duyệt trong ứng dụng (Facebook / Zalo…; khoi_dong.ts gắn class html.iab) ----------
   Chừa lề đáy tối thiểu 8px: thanh công cụ của ứng dụng có lúc trượt xuống / thu lại làm cạnh đáy trang đổi, nút sát mép bị che nửa. */
html.iab { --day: max(env(safe-area-inset-bottom, 0px), 8px); }

/* (15/11 đợt 2: bỏ dòng hạ #thong-bao xuống z 20 khi mở bảng — toast bị bảng che mất nửa. Toast luôn ở --z-toast;
   khi có bảng mở thì style.css đã dời toast xuống đáy màn nên không đè chữ trong bảng.) */

/* khung chat đang mở: ô cốt truyện (z 30) tạm ẩn — trước đây nó đè lên hàng thẻ + nút × của chat, người chơi không tắt được chat */
html body.cb-chat #truyen#truyen { visibility: hidden !important; pointer-events: none !important; }

/* A2 (15/11 đợt 2b): cảm ứng đang xây nhà / sắp xếp đảo: dải công cụ ở mép trên → toast (tin hệ thống, báo lỗi) hạ xuống đáy, bên phải cần điều khiển,
   không nổi đè lên dải công cụ. */
html body.cam-ung:is(.dang-xay, .dang-sx) #thong-bao { top: auto; bottom: calc(var(--day) + 16px); left: calc(var(--le) + 150px); right: calc(var(--phai) + 8px);
  transform: none; width: auto; max-width: none; align-items: flex-end; }
html body.cam-ung:is(.dang-xay, .dang-sx) #thong-bao .tb { max-width: 100%; }

/* 15/11 màn NGANG: dòng nhiệm vụ đọc vài giây thì thu thành nhãn "NV" kể cả lúc tân thủ (hud_gon.ts nv-ngang), chạm để xem lại */
html body.toi-gian.nv-an.nv-ngang #nhiem-vu.thu-gon { width: auto !important; min-width: 0 !important; max-width: none; opacity: .85; }
html body.toi-gian.nv-an.nv-ngang #nhiem-vu.thu-gon #nv-tom, html body.toi-gian.nv-an.nv-ngang.tan-thu-som #nhiem-vu.thu-gon #nv-tom,
html body.toi-gian.nv-an.nv-ngang #nhiem-vu.thu-gon #nv-thu { display: none !important; }
html body.toi-gian.nv-an.nv-ngang.tan-thu-som #nhiem-vu.thu-gon .nv-nhan { display: inline-flex !important; }
html body.toi-gian.nv-an.nv-ngang.tan-thu-som #nhiem-vu.thu-gon #nv-dau { min-height: 30px; }
/* 15/11 chip "🎁 Nhận quà" (qua_ngay.ts): thay cho bảng tự bật mỗi ngày; xep_chip.ts dời khi chạm vật khác */
#qn-chip { position: fixed; z-index: var(--z-chip); left: calc(var(--mep, 8px) + var(--le, 0px)); top: calc(var(--ct-day, 150px) + 8px);
  min-height: 32px; padding: 4px 11px; border-radius: 16px; border: 1.5px solid #ffd84a; background: rgba(40, 26, 4, .82); color: #ffe9a8;
  font: 800 13px/1.1 system-ui, sans-serif; white-space: nowrap; cursor: pointer; pointer-events: auto; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
#qn-chip[hidden] { display: none; }
body:is(.dang-xay, .dang-sx, .trong-hang, .ngam-canh, .tt-an) #qn-chip { display: none !important; }   /* tân thủ: chưa cần, chấm đỏ Menu đủ */
/* 15/11 vòng cung tối đa 4 ô (hud.ts xepVong): nút thừa giấu sau nút "…", chạm "…" xổ thành cột */
html body .nut-vong.vong-an, html body .vong-thua.vong-an { display: none !important; }   /* nút trong THU_TU_VONG không mang lớp nut-vong (vd. #nut-thu-moc) cũng phải ẩn khi vào cột "…" */
html body.cam-ung #nut-vong-them { position: fixed; z-index: var(--z-duoi-hud); }
html body:is(.trong-hang, .ngam-canh, .dang-xay, .dang-sx) #nut-vong-them, html body.menu-the.mt-an-hud #nut-vong-them { display: none !important; }
html body.cam-ung .nut-vong-them b { font-size: 24px; line-height: 1; letter-spacing: 1px; }
html body.cam-ung.vong-mo .nut-vong-them { border-color: var(--vang); box-shadow: 0 0 10px rgba(255, 216, 74, .55); }
html body.cam-ung.vong-mo .nut-vong.vong-thua { z-index: 4; box-shadow: 0 0 0 2px rgba(255, 216, 74, .5), 0 3px 8px rgba(0, 0, 0, .45); }
html body:not(.cam-ung) .nut-vong-them { display: none !important; }
/* nút gộp "🔨 Xây" (hud.ts vongXay, hoc_avatar_ui.md việc 2): cùng lớp với nút "…"; cột xổ hai dòng Xây nhà · Sắp xếp nổi trên nút */
html body.cam-ung #nut-vong-xay { position: fixed; z-index: var(--z-duoi-hud); }
html body:is(.trong-hang, .ngam-canh, .dang-xay, .dang-sx) #nut-vong-xay, html body.menu-the.mt-an-hud #nut-vong-xay { display: none !important; }
html body.cam-ung.xay-mo #nut-vong-xay { border-color: var(--vang); box-shadow: 0 0 10px rgba(255, 216, 74, .55); }
html body.cam-ung.xay-mo .nut-vong.vong-gop:not(.vong-an) { z-index: 4; box-shadow: 0 0 0 2px rgba(255, 216, 74, .5), 0 3px 8px rgba(0, 0, 0, .45); }
html body:not(.cam-ung) #nut-vong-xay { display: none !important; }

/* ---------- KHUNG CHỈ SỐ GỌN (hud.ts gonChiSo, hoc_avatar_ui.md việc 3) ----------
   Cả ba chỉ số > 50 và không vừa đổi mạnh: chỉ còn chân dung + 3 vạch mảnh không số (không biểu tượng, không xu / cấp).
   Trước: luật body.toi-gian ở trên (bật mặc định trên điện thoại) đè mất #chi-so.gon của style.css → ảnh nào cũng "100 / 96 / 93".
   Chip thú nuôi / buff (#ds-hud) nằm ngay cạnh chân dung (vẫn trong #chi-so: xep_chip.ts coi cả khung là vật cản cố định).
   Chip tiến độ (#dn-chip, #nc-chip), thân thuyền (#cs-than), treo máy (#cs-nghi) đang hiện thì KHÔNG gọn (hud.ts).
   Chân dung vẫn mở thẻ Nhân vật; chạm vùng vạch (cao ≥ 44 px) thì hiện đủ số 5 giây. */
html body #chi-so.gon { display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 0 8px; width: max-content !important; min-width: 0 !important;
  max-width: none; padding: 3px 9px 3px 3px; min-height: 0; height: auto; }
html body #chi-so.gon #cs-chan { grid-column: 1; grid-row: 1; width: 44px; height: 44px; }
html body #chi-so.gon .cs-vach { grid-column: 2; grid-row: 1; position: relative; display: flex; flex-direction: column; gap: 5px; width: 58px; min-width: 0; cursor: pointer; }
html body #chi-so.gon .cs-vach::after { content: ""; position: absolute; left: -4px; right: -6px; top: -12px; bottom: -12px; }
html body #chi-so.gon .vach { display: block; width: 58px; height: 4px; }
html body #chi-so.gon .vach[hidden] { display: none !important; }
html body #chi-so.gon .vach > i, html body #chi-so.gon .vach > img, html body #chi-so.gon .vach > em, html body #chi-so.gon .hang-diem { display: none !important; }
html body #chi-so.gon .vach > b { display: block; width: 58px; height: 4px; border-radius: 2px; }
html body #chi-so.gon > #ds-hud { grid-column: 3; grid-row: 1; margin: 0; flex-wrap: nowrap; }

/* LÀN TIN THƯỜNG MỘT DÒNG (thong_bao_hang.ts #lan-tb, hoc_avatar_ui.md mục 4 việc 8): dải mảnh, không xuống dòng, không chặn chạm.
   Vị trí do JS đo (inline style, dải trống trên cùng). Lỗi / cảnh báo vẫn là toast #thong-bao nhiều dòng. */
#lan-tb { position: fixed; z-index: var(--z-toast); display: flex; justify-content: center; pointer-events: none; }
#lan-tb[hidden] { display: none; }
#lan-tb .tb.lan { min-width: 0; max-width: 100%; padding: 3px 11px; border-radius: 99px; font-size: 12.5px; line-height: 18px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; background: rgba(4, 18, 30, .82); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
#lan-tb .lan-chu { white-space: nowrap; }
#lan-tb .tb-n { color: var(--vang); margin-left: 1px; }
#lan-tb .tb.lan.ra { opacity: 0; transition: opacity .3s; }
body.ngam-canh #lan-tb { display: none !important; }
/* ===== tui_do.css ===== */
/* ================= BẢNG TÚI ĐỒ gọn (giao_dien.ts: veTui / veLocTui) =================
   Bố cục bằng lưới có tên vùng: loc (thẻ lọc) · luoi (lưới món, cuộn riêng) · tt (dải thanh nhanh) · ct (chi tiết món đang chọn).
   - máy tính / máy bảng / điện thoại NGANG: hai cột — trái: thẻ lọc + lưới + thanh nhanh; phải: chi tiết cao hết bảng
   - điện thoại DỌC (≤ 620 px): một cột — thẻ lọc, lưới (cuộn), dải thanh nhanh, chi tiết ghim ở đáy
   Chỉ ghi đè style.css bằng bộ chọn mạnh hơn (#bang-tui …), không đổi id / class cũ. */

/* 15/11 đợt 2 (B02): cỡ bảng do lớp .co-lon .cao-dinh ở index.html quyết (khung chung style.css) — bỏ khoá cỡ riêng 720×640 cũ */

#bang-tui .than-tui { display: grid; flex: 1 1 auto; min-height: 0; flex-wrap: nowrap; gap: 8px 10px; padding: 0 10px 10px;
  grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "loc ct" "luoi ct" "tt ct"; }
#bang-tui #tui-loc { grid-area: loc; }
#bang-tui #luoi-tui { grid-area: luoi; }
#bang-tui #tui-thanh { grid-area: tt; }
#bang-tui #chi-tiet { grid-area: ct; }

/* ---- thẻ lọc theo nhóm: một hàng, tràn thì vuốt ngang ---- */
#bang-tui .tui-loc { display: flex; gap: 6px; min-width: 0; padding: 1px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  touch-action: pan-x; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
#bang-tui .tui-loc::-webkit-scrollbar { display: none; }
/* còn thẻ khuất bên phải / trái: mờ dần mép (giao_dien.ts veLocTui gắn .con-phai / .con-trai) */
#bang-tui .tui-loc.con-phai { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
#bang-tui .tui-loc.con-trai { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); }
#bang-tui .tui-loc.con-trai.con-phai { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
#bang-tui .tui-loc button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06); color: var(--chu-mo); font-size: 13px; font-weight: 700; white-space: nowrap; }
body.cam-ung #bang-tui .tui-loc button { min-height: var(--cham-toi-thieu); }
#bang-tui .tui-loc button i { font-style: normal; font-size: 14px; line-height: 1; }
#bang-tui .tui-loc button em { font-style: normal; font-size: 11px; font-weight: 800; min-width: 18px; padding: 0 5px; line-height: 17px; border-radius: 99px;
  background: rgba(79, 227, 255, .14); color: var(--chu); text-align: center; }
#bang-tui .tui-loc button.bat { background: rgba(79, 227, 255, .22); border-color: var(--vien); color: #fff; box-shadow: 0 0 8px rgba(79, 227, 255, .35); }
#bang-tui .tui-loc button.bat em { background: var(--vien); color: #04202e; }

/* ---- lưới món: ô có tên ngắn dưới biểu tượng, số lượng ở góc trên phải ---- */
#bang-tui #luoi-tui { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); grid-auto-rows: auto; gap: 6px; align-content: start;
  justify-items: stretch; flex: none; max-height: none; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
#bang-tui #luoi-tui .o-tui { width: auto; height: 68px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 4px 4px; border-radius: 9px; }
#bang-tui #luoi-tui .o-tui img { width: 36px; height: 36px; flex: 0 0 auto; pointer-events: none; }
#bang-tui #luoi-tui .o-tui .so { top: 3px; right: 3px; bottom: auto; min-width: 16px; padding: 0 4px; border-radius: 6px; font-size: 11.5px; line-height: 15px;
  text-align: center; background: rgba(4, 20, 32, .72); pointer-events: none; }
#bang-tui #luoi-tui .o-ten { display: block; max-width: 100%; font-size: 11px; line-height: 13px; font-weight: 600; color: #d6f1fb;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
#bang-tui #luoi-tui .o-tui.chon { border-color: #bff6ff; background: rgba(79, 227, 255, .18); box-shadow: 0 0 0 1px var(--vien), 0 0 12px rgba(79, 227, 255, .6); }
#bang-tui #luoi-tui .o-tui.chon .o-ten { color: #fff; }
#bang-tui #luoi-tui i.o-tui.o-trong { height: 44px; }
/* hàng cần câu (can_cau_ui.ts veCanTrongTui): ô cùng cỡ ô món */
#bang-tui #luoi-tui .cc-o { width: auto; height: 68px; min-width: 0; }
#bang-tui #luoi-tui .cc-o img { width: 40px; height: 40px; }
#bang-tui #luoi-tui .cc-tui-nhom { padding-top: 2px; }

/* ---- dải thanh nhanh: 9 ô nhỏ; dòng hướng dẫn chỉ hiện khi đang cầm món để đặt (.dang-boc) ---- */
#bang-tui #tui-thanh { order: 0; flex: none; min-width: 0; max-width: 100%; margin: 0; padding: 6px 0 0; border-top: 1px solid var(--vien-mo); border-bottom: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
#bang-tui #tui-thanh .tt-ten { display: none; flex: 1 1 100%; font-size: 11px; line-height: 14px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--chu-mo); }
#bang-tui #tui-thanh .tt-o { flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 40px)); gap: 4px; flex-wrap: nowrap; }
#bang-tui #tui-thanh .o-cam.tt { width: auto; height: 40px; min-width: 0; max-width: none; aspect-ratio: auto; flex: none; border-radius: 8px; }
body.cam-ung #bang-tui #tui-thanh .o-cam.tt { height: var(--cham-toi-thieu); }
#bang-tui #tui-thanh .o-cam.tt .so { font-size: 10.5px; right: 2px; bottom: 0; }
#bang-tui #tui-thanh .o-cam.tt .phim { font-size: 10px; left: 3px; top: 0; }
#bang-tui #tui-thanh .tt-nhan { order: -1; flex: 1 1 100%; min-width: 0; margin: 0; font-size: 12px; line-height: 1.3; font-weight: 600; color: #ffe9a8;
  letter-spacing: 0; text-transform: none; }
#bang-tui #tui-thanh .tt-nhan b { color: #fff; }
#bang-tui #tui-thanh.dang-boc .o-cam.tt { border-color: rgba(255, 207, 90, .75); box-shadow: inset 0 0 8px rgba(255, 207, 90, .25); }
@media (min-width: 621px) and (min-height: 501px) {
  #bang-tui #tui-thanh .tt-ten { display: block; }
  #bang-tui #tui-thanh.dang-boc .tt-ten { display: none; }
}

/* ---- chi tiết món đang chọn ---- */
#bang-tui #chi-tiet { width: auto; max-height: none; min-height: 0; margin: 0; padding: 10px; border: 1px solid var(--vien-mo); border-radius: 10px;
  background: rgba(79, 227, 255, .05); display: flex; flex-direction: column; gap: 7px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  grid-template-columns: none; }
#bang-tui #chi-tiet:empty { display: none; }
#bang-tui #chi-tiet .ct-dau { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 0 auto; }
#bang-tui #chi-tiet img.to { width: 48px; height: 48px; flex: 0 0 48px; padding: 3px; border-radius: 8px; image-rendering: pixelated;
  background: rgba(79, 227, 255, .08); border: 1px solid var(--vien-mo); grid-row: auto; }
#bang-tui #chi-tiet .ct-chu { min-width: 0; flex: 1 1 auto; }
#bang-tui #chi-tiet .ten { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.25; color: #fff; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#bang-tui #chi-tiet .ct-phu { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--chu-mo); }
#bang-tui #chi-tiet .ct-phu b { color: #ffe9a8; }
#bang-tui #chi-tiet .mo-ta { flex: 0 0 auto; margin: 0; font-size: 12.5px; line-height: 1.4; color: #cfe9f3; max-height: calc(1.4em * 3);
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
#bang-tui #chi-tiet .ct-goi { flex: 0 0 auto; padding: 5px 8px; border-radius: 8px; font-size: 12.5px; line-height: 1.35; color: #ffe9a8;
  background: rgba(255, 216, 102, .08); border: 1px solid rgba(255, 216, 102, .25); }
#bang-tui #chi-tiet .hang-nut { flex: 0 0 auto; margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; grid-template-columns: none; grid-column: auto; }
#bang-tui #chi-tiet .hang-nut button { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 4px 8px; border-radius: 9px; border: 1px solid var(--vien-mo);
  background: rgba(79, 227, 255, .08); color: var(--chu); font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bang-tui #chi-tiet .hang-nut button.chinh, #bang-tui #chi-tiet .hang-nut button[data-kb-mo] { flex: 1 1 100%; min-height: 44px; font-size: 14px; white-space: normal;
  color: #fff; border-color: #6fe3ff; background: linear-gradient(#1f8fb0, #13607d); box-shadow: 0 0 10px rgba(79, 227, 255, .3); }
#bang-tui #chi-tiet .hang-nut button:active { transform: translateY(1px); }
/* khối "Cách kiếm" (nguon_vat.ts htmlNguon): dưới mô tả / gợi ý, trên hàng nút; dài thì cuộn riêng trong khối, không đẩy nút đi mất */
#bang-tui #chi-tiet .ct-nguon { flex: 0 1 auto; min-height: 4.4em; max-height: 13em; margin: 0; padding: 5px 8px 6px; border-radius: 8px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  background: rgba(4, 20, 32, .35); border: 1px solid var(--vien-mo); font-size: 12px; line-height: 1.35; }
#bang-tui #chi-tiet .ct-nguon[hidden] { display: none; }
#bang-tui #chi-tiet .ct-nguon-dau { margin: 0 0 2px; font-size: 10.5px; line-height: 14px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--chu-mo); }
#bang-tui #chi-tiet .ct-nguon ul { margin: 0; padding: 0 0 0 14px; list-style: disc; }
#bang-tui #chi-tiet .ct-nguon li { margin: 1px 0; color: #d6f1fb; overflow-wrap: anywhere; }
#bang-tui #chi-tiet .ct-nguon li::marker { color: #6fe3ff; }
#bang-tui #chi-tiet .ct-nguon-trong { color: var(--chu-mo); font-style: italic; }
/* chưa chọn món: thu lại thành một dòng nhắc */
#bang-tui #chi-tiet.ct-trong { justify-content: center; align-self: start; padding: 10px; background: transparent; border-style: dashed; }
/* B02: chưa chọn món thì cột phải hẹp lại (chỉ còn dòng nhắc), lưới món nhận phần còn lại; hộp nhắc không kéo dài hết bảng */
@media (min-width: 621px) { #bang-tui .than-tui:has(#chi-tiet.ct-trong) { grid-template-columns: minmax(0, 1fr) 200px; } }
#bang-tui #chi-tiet .ct-nhac { font-size: 13px; line-height: 1.35; color: var(--chu-mo); text-align: center; }
@media (min-width: 621px) {
  /* cột phải cao hết bảng: mô tả dài được giãn thêm, hết chỗ thì cuộn trong ô */
  #bang-tui #chi-tiet .mo-ta { flex: 0 1 auto; max-height: none; min-height: calc(1.4em * 2); }
  #bang-tui #chi-tiet img.to { width: 56px; height: 56px; flex-basis: 56px; }
}

/* ================= điện thoại NGANG / màn thấp: vẫn hai cột, thu nhỏ khoảng cách ================= */
@media (max-height: 500px) and (min-width: 621px) {
  #bang-tui .than-tui { gap: 6px 8px; padding: 0 8px 6px; grid-template-columns: minmax(0, 1fr) 240px; }
  #bang-tui #luoi-tui { gap: 5px; }
  #bang-tui #luoi-tui .o-tui, #bang-tui #luoi-tui .cc-o { height: 62px; }
  #bang-tui #luoi-tui .o-tui img { width: 32px; height: 32px; }
  #bang-tui #tui-thanh { padding-top: 4px; }
  #bang-tui #chi-tiet { padding: 8px; gap: 5px; }
  #bang-tui #chi-tiet img.to { width: 44px; height: 44px; flex-basis: 44px; }
  #bang-tui #chi-tiet .ten { font-size: 14px; }
  #bang-tui #chi-tiet .hang-nut button.chinh, #bang-tui #chi-tiet .hang-nut button[data-kb-mo] { min-height: 40px; font-size: 13px; }
  #bang-tui #chi-tiet .ct-nguon { min-height: 3.9em; max-height: 6.6em; padding: 4px 7px 5px; font-size: 11.5px; line-height: 1.3; }
}

/* ================= điện thoại DỌC / cửa sổ hẹp: một cột, chi tiết ghim ở đáy ================= */
@media (max-width: 620px) {
  #bang-tui .than-tui { gap: 6px; padding: 0 8px 8px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "loc" "luoi" "tt" "ct"; }
  #bang-tui #luoi-tui { min-height: 140px; }
  #bang-tui .tui-loc button { padding: 0 11px; font-size: 12.5px; }
  #bang-tui #tui-thanh .tt-o { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
  #bang-tui #tui-thanh .o-cam.tt { height: 44px; }
  #bang-tui #chi-tiet { padding: 8px 10px; gap: 6px; }
  #bang-tui #chi-tiet .ct-nguon { min-height: 3.9em; max-height: 6em; padding: 4px 8px 5px; font-size: 11.5px; line-height: 1.3; }
}

/* Độ bền dụng cụ: vạch sát đáy ô và chi tiết gọn trên điện thoại. */
.o-tui, .o-cam { position: relative; }
.cu-ben-vach { position: absolute; bottom: 2px; left: 5px; right: 5px; height: 3px; border-radius: 2px; background: #273a3f; overflow: hidden; pointer-events: none; }
.cu-ben-vach > i, .cu-ben-thanh > i { display: block; height: 100%; background: #69c89b; }
.cu-ben-vach.mon, .cu-ben-ct.mon .cu-ben-thanh { background: #d75a55; }
.cu-ben-ct { margin: 5px 0; font-size: 12px; }
.cu-ben-thanh { height: 5px; margin-top: 3px; overflow: hidden; border-radius: 3px; background: #273a3f; }
/* 13/11: thêm nút 🗑 Bỏ nên hàng nút phụ có ba nút: cho rộng theo chữ và tự xuống dòng thay vì cắt chữ thành "+ Và…" */
#bang-tui #chi-tiet .hang-nut button.phu { flex: 1 1 auto; padding: 4px 10px; }

/* ================= BẢNG CHẾ TẠO: chạm một dòng → nguyên liệu là gì, lấy ở đâu (giao_dien.ts veChe, cheMo) ================= */
#ds-che .dong-che { cursor: pointer; }
/* "lấy ở đâu?": dòng trợ giúp riêng dưới nguyên liệu (trước chen cuối hàng nguyên liệu nên xuống dòng thất thường) */
#ds-che .che-nl-goi { display: block; margin-top: var(--cach-nho, 4px); font-style: normal; font-size: 11px; line-height: 1.2; white-space: nowrap; color: #7fe3ff; opacity: .85; }
#ds-che .dong-che.mo { border-color: var(--vien); }
#ds-che .che-nl { margin-top: 6px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .05); display: grid; gap: 6px; }
#ds-che .che-nl-mon { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 12.5px; line-height: 1.35; }
#ds-che .che-nl-mon > img { width: 28px; height: 28px; image-rendering: pixelated; }
#ds-che .che-nl-mon b { color: #fff; }
#ds-che .che-nl-mon.thieu b { color: #ffb4a8; }
#ds-che .che-nl-so { color: var(--chu-mo); font-size: 11.5px; }
#ds-che .che-nl-mon ul { margin: 2px 0 0; padding: 0 0 0 14px; list-style: disc; }
#ds-che .che-nl-mon li { margin: 1px 0; color: #d6f1fb; overflow-wrap: anywhere; }
#ds-che .che-nl-mon li::marker { color: #6fe3ff; }
#ds-che .che-nl-cho { color: var(--chu-mo); font-style: italic; }

/* ================= THẺ VẬT PHẨM dùng chung (nguon_vat.ts moTheVat): chạm hình một món ở bảng nào cũng mở ================= */
#the-vat { position: fixed; inset: 0; z-index: var(--z-goi-y); display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(2, 10, 20, .5); }
#the-vat .tv-hop { position: relative; width: min(380px, 100%); max-height: min(calc(var(--cao, 100vh) * 0.78), 460px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  padding: 12px 14px 14px; border-radius: 12px; border: 1.5px solid var(--vien); background: var(--nen-dam); box-shadow: var(--phat), 0 10px 30px rgba(0, 0, 0, .6); color: var(--chu); }
#the-vat .tv-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; padding: 0; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); color: #fff; font-size: 22px; line-height: 1; }
#the-vat .tv-dau { display: flex; align-items: center; gap: 10px; padding-right: 44px; }
#the-vat .tv-dau img { width: 52px; height: 52px; flex: 0 0 52px; padding: 3px; border-radius: 8px; image-rendering: pixelated; background: rgba(79, 227, 255, .08); border: 1px solid var(--vien-mo); }
#the-vat .tv-dau b { display: block; font-size: 16px; line-height: 1.25; color: #fff; }
#the-vat .tv-dau span { font-size: 12.5px; color: var(--chu-mo); }
#the-vat .tv-mo-ta { margin: 9px 0 0; font-size: 13px; line-height: 1.45; color: #cfe9f3; }
#the-vat .tv-nguon { margin-top: 10px; padding: 7px 10px 8px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .05); font-size: 13px; line-height: 1.4; }
#the-vat .tv-nguon-dau { margin-bottom: 3px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--chu-mo); }
#the-vat .tv-nguon ul { margin: 0; padding: 0 0 0 16px; list-style: disc; }
#the-vat .tv-nguon li { margin: 2px 0; color: #d6f1fb; overflow-wrap: anywhere; }
#the-vat .tv-nguon li::marker { color: #6fe3ff; }
#the-vat .tv-cho { color: var(--chu-mo); font-style: italic; }
/* hình vật phẩm ngoài nút bấm + phần tử gắn data-xem-vat: bấm được (mở thẻ) */
.bang img[src^="/anh/icon_"], [data-xem-vat] { cursor: pointer; }
.ln-hoi { font-style: normal; font-size: 12px; color: #7fe3ff; opacity: .85; margin-left: 2px; }

/* ================= PC (bảng .co-lon 960): cột chi tiết 300 px, ô món lớn hơn, tên 12 px ================= */
@media (min-width: 900px) and (min-height: 501px) and (pointer: fine) {
  #bang-tui .than-tui { grid-template-columns: minmax(0, 1fr) 300px; }
  #bang-tui .than-tui:has(#chi-tiet.ct-trong) { grid-template-columns: minmax(0, 1fr) 220px; }
  #bang-tui #luoi-tui { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
  #bang-tui #luoi-tui .o-tui, #bang-tui #luoi-tui .cc-o { height: 80px; }
  #bang-tui #luoi-tui .o-tui img { width: 44px; height: 44px; }
  #bang-tui #luoi-tui .o-ten { font-size: var(--chu-phu); line-height: 14px; }
  #bang-tui #tui-thanh .tt-o { grid-template-columns: repeat(9, minmax(0, 48px)); }
  #bang-tui #tui-thanh .o-cam.tt { height: 48px; }
}

/* buổi 9: Chế tạo từ 621 px: lưới công thức 2 cột (ô ≥ 280 px); bảng có chiều cao cố định (.cao-dinh) nên danh sách tự cuộn trong khung */
/* ================= BẢNG CHẾ TẠO: CỘT DANH MỤC BÊN TRÁI (20/11, góp ý người chơi; giao_dien.ts veTheChe) =================
   Ô tìm ở trên; dưới là #che-than = cột danh mục #che-tab + danh sách #ds-che, MỖI BÊN CUỘN RIÊNG (lăn chuột / kéo thanh cuộn trên PC).
   "Tất cả" dính ở đầu cột. Cột: PC 156 px · điện thoại ngang 116 px · điện thoại dọc 68 px (icon + nhãn ngắn, nút ≥ 44 px). */
#che-than { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 156px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 8px; padding: 0 10px 10px; }
#che-than.chi { grid-template-columns: minmax(0, 1fr); }
#bang-che #ds-che { min-height: 0; max-height: none; padding: 0 4px 10px 0; }
#che-tab { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  -webkit-overflow-scrolling: touch; padding: 0 2px 10px 0; scrollbar-width: thin; scrollbar-color: rgba(79, 227, 255, .35) transparent; }
#che-tab[hidden] { display: none; }
#che-tab button { position: relative; flex: 0 0 auto; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 42px;
  padding: 6px 8px; border-radius: 10px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06); color: var(--chu-mo);
  font-weight: 700; font-size: 13px; line-height: 1.2; text-align: left; cursor: pointer; }
#che-tab button[hidden] { display: none; }
#che-tab button:hover { border-color: var(--vien); color: var(--chu); }
#che-tab .nh-icon { font-size: 16px; line-height: 1; text-align: center; }
#che-tab .nh-ten, #che-tab .nh-ngan { min-width: 0; overflow-wrap: anywhere; }
#che-tab .nh-ngan { display: none; }
#che-tab button i { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 18px; padding: 1px 5px; border-radius: 999px; text-align: center; background: rgba(0, 0, 0, .3); opacity: .8; }
#che-tab button.chon { color: #fff; background: rgba(79, 227, 255, .26); border-color: var(--vien); box-shadow: inset 3px 0 0 var(--vien), 0 0 8px rgba(79, 227, 255, .25); }
#che-tab button.chon i { background: var(--vien); color: #04202c; opacity: 1; }
/* "Tất cả" dính đầu cột: nền đặc để mục cuộn bên dưới không lộ qua */
#che-tab button[data-nhom="tat"] { position: sticky; top: 0; z-index: 1; background: linear-gradient(rgba(79, 227, 255, .1), rgba(79, 227, 255, .1)), var(--nen-dam); box-shadow: 0 -4px 0 var(--nen-dam), 0 4px 6px rgba(0, 0, 0, .35); }
#che-tab button[data-nhom="tat"].chon { background: linear-gradient(rgba(79, 227, 255, .3), rgba(79, 227, 255, .3)), var(--nen-dam); box-shadow: inset 3px 0 0 var(--vien), 0 -4px 0 var(--nen-dam), 0 4px 6px rgba(0, 0, 0, .35); }
#che-tab.dang-tim button { opacity: .72; }
.che-tim-bao { padding: 6px 10px; border-radius: 8px; border: 1px dashed var(--vien-mo); font-size: 12px; color: var(--chu-mo); }
.che-trong { padding: 18px 8px; text-align: center; color: var(--chu-mo); font-size: 13px; }
body.cam-ung #che-tab button { min-height: 46px; }
@media (min-width: 621px) {
  #ds-che { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
  #ds-che > :not(.dong-che) { grid-column: 1 / -1; }
}
/* điện thoại ngang / màn thấp: cột 116 px */
@media (max-height: 500px) and (min-width: 621px) {
  #che-than { grid-template-columns: 116px minmax(0, 1fr); gap: 6px; padding: 0 8px 6px; }
  #che-tab button { grid-template-columns: 18px minmax(0, 1fr); gap: 4px; padding: 5px 6px; font-size: 12px; min-height: 44px; }
  #che-tab .nh-icon { font-size: 14px; }
  #che-tab button i { position: absolute; top: 2px; right: 3px; min-width: 0; padding: 0 4px; font-size: 10px; }
  #che-tab .nh-ten { padding-right: 14px; }
}
/* điện thoại dọc: cột 68 px (icon trên, nhãn ngắn dưới, số ở góc); nút Ghim / Chế dồn xuống dưới dòng món để chữ không bị bóp */
@media (max-width: 620px) {
  #che-than { grid-template-columns: 68px minmax(0, 1fr); gap: 6px; padding: 0 6px 6px; }
  #che-tab { gap: 4px; padding: 0 0 8px; }
  #che-tab button { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 2px; min-height: 54px; padding: 6px 2px 5px; font-size: 10.5px; line-height: 1.15; text-align: center; }
  #che-tab .nh-icon { font-size: 18px; }
  #che-tab .nh-ten.co-ngan { display: none; }
  #che-tab .nh-ngan { display: block; }
  #che-tab button i { position: absolute; top: 2px; right: 2px; min-width: 0; padding: 0 4px; font-size: 9.5px; line-height: 14px; }
  #che-tab button.chon { box-shadow: inset 0 3px 0 var(--vien), 0 0 8px rgba(79, 227, 255, .25); }
  #bang-che #ds-che { padding: 0 0 8px; }
  #ds-che .dong-che { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 8px; }
  #ds-che .dong-che > img { width: 32px; height: 32px; }
  #ds-che .dong-che > .che-nut { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Thẻ công thức đang mở "lấy ở đâu?" (người chơi báo 15/11: trong lưới nhiều cột khối chỉ dẫn bị bóp còn ~80px, chữ rớt từng từ):
   thẻ mở chiếm trọn hàng, ảnh + nút canh lên đầu, khối nguyên liệu xếp thành nhiều cột khi đủ rộng. */
#ds-che .dong-che.mo { grid-column: 1 / -1; align-items: start; }
#ds-che .dong-che.mo .che-nl { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
/* màn hẹp (điện thoại dọc): thẻ đang mở dồn nút xuống một hàng riêng ở cuối, phần chữ + khối nguyên liệu dùng hết bề ngang thẻ */
@media (max-width: 620px) {
  #ds-che .dong-che.mo { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
  #ds-che .dong-che.mo > img { width: 32px; height: 32px; }
  #ds-che .dong-che.mo > .che-nut { grid-column: 1 / -1; justify-content: flex-end; }
  #ds-che .dong-che.mo .che-nl { margin-left: -42px; }
}
#ds-che .dong-che.mo .mo-ta { white-space: normal; }
#ds-che .che-nl-mon li { overflow-wrap: break-word; }

/* GIỮ LẠI TRONG TÚI (giu_tui.go): huy hiệu ổ khoá ở góc ô + ô tích trong chi tiết món */
.o-khoa { position: absolute; top: 2px; left: 3px; font-style: normal; font-size: 12px; line-height: 14px; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)); }
.ct-giu { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; margin: 4px 0; font-size: 13px; font-weight: 700; color: var(--chu); cursor: pointer; }
.ct-giu input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--xanh, #6fffd2); }
/* 17/11: hàng nút hành động chính nằm ngay dưới mô tả (không bị khối Xem tỉ lệ / Cách kiếm đẩy khỏi tầm nhìn ở màn thấp) */
#bang-tui #chi-tiet .hang-nut.ct-chinh { margin-top: 0; }

/* ================= TÚI BỚT CHỮ TRÊN CẢM ỨNG (hoc_avatar_ui.md mục 4 việc 6; họp hop_hud_gon_2_1811) =================
   Ô chỉ còn hình + số góc; tên + cách dùng ở ô chi tiết khi chạm (giao_dien.ts veTui). Tên vẫn ở title / aria-label.
   Tân thủ sớm (body.tan-thu-som) giữ tên dưới ô cho người mới. Ô cá theo loài: cân "1,2 kg" dời xuống giữa đáy, trên vạch tươi
   (trước nằm góc trên trái, trùng chỗ ổ khoá 🔒). Thanh nhanh trong Túi bỏ số phím 1–9 (không có phím trên điện thoại). */
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui .o-ten { display: none; }
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui :is(.o-tui, .cc-o) { height: 58px; }
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui img { width: 38px; height: 38px; }
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui i.o-tui.o-trong { height: 40px; }
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui .ca-kg { top: auto; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 10px; line-height: 11px; }
html body.cam-ung #bang-tui #tui-thanh .o-cam.tt .phim { display: none; }
/* điện thoại dọc: 5 cột (~66 px/ô ở 390, ≥ 44 px chạm) thay 4 — thấy 15+ ô một màn */
@media (max-width: 620px) {
  html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
}
/* ===== nha.css ===== */
/* XÂY NHÀ TỪNG MẢNH (trinh_khach/src/nha_ui.ts): dải công cụ #nha-thanh ở mép trên, nút #dn-nut-xay / #dn-nut-ngu trong #dn-thanh,
   chip #nha-goi-y khi cầm đồ nội thất. body.dang-xay = đang ở chế độ xây (ẩn giao diện khác như body.dang-sx, giữ cần điều khiển). */

#nha-thanh { position: fixed; z-index: var(--z-hud-noi); left: 50%; top: calc(8px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  padding: 6px 8px; font-size: 13px; box-sizing: border-box; }
#nha-thanh[hidden], #nha-goi-y[hidden] { display: none; }
#nha-thanh .nh-hang { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
#nha-thanh .nh-duoi { margin-top: 6px; min-height: 44px; }
#nha-thanh .nh-tt { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#nha-thanh .nh-tt::-webkit-scrollbar { display: none; }
#nha-thanh .nh-cus { display: flex; gap: 4px; flex: 0 1 auto; min-width: 0; }
#nha-thanh button { font-weight: 800; color: #e2fbff; background: rgba(79, 227, 255, .12); border: 1.5px solid var(--vien-mo, #2b6f86); border-radius: 10px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#nha-thanh button:active { transform: scale(.96); }
#nha-thanh button.chinh { background: linear-gradient(#1f6f8c, #134a63); border-color: var(--vien, #4fe3ff); }
#nha-thanh .nh-cu { width: 46px; min-height: 46px; padding: 2px 0 1px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; flex: 0 0 auto; }
#nha-thanh .nh-cu small { font-size: 9.5px; line-height: 1.05; font-weight: 700; opacity: .85; max-width: 44px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#nha-thanh .nh-cu.chon { border-color: #ffd36a; background: rgba(255, 211, 106, .22); box-shadow: 0 0 0 1px #ffd36a inset; }
#nha-thanh .nh-tangs { display: flex; gap: 4px; justify-content: center; }
#nha-thanh .nh-tangs[hidden] { display: none; }
#nha-thanh .nh-tang { min-height: 36px; padding: 2px 10px; font-size: 12px; font-weight: 700; flex: 0 1 auto; }
#nha-thanh .nh-tang.chon { border-color: #ffd36a; background: rgba(255, 211, 106, .22); box-shadow: 0 0 0 1px #ffd36a inset; }
#nha-thanh .nh-tang:disabled { opacity: .5; }
#nha-thanh .nh-dem { flex: 0 0 auto; font-weight: 800; font-size: 13px; padding: 4px 7px; border-radius: 8px; background: rgba(0, 0, 0, .25); white-space: nowrap; }
#nha-thanh .nh-dem.day { color: #ff9a8a; }
#nha-thanh .nh-xong { flex: 0 0 auto; min-height: 44px; min-width: 64px; padding: 2px 10px; font-size: 14px; margin-left: auto; }
#nha-thanh .nh-gias { display: flex; gap: 4px; flex: 0 0 auto; }
#nha-thanh .nh-gia { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px 2px 2px; border-radius: 7px; background: rgba(0, 0, 0, .28); font-weight: 800; white-space: nowrap; }
#nha-thanh .nh-gia img { width: 20px; height: 20px; image-rendering: pixelated; }
#nha-thanh .nh-gia.thieu { color: #ff8a7a; background: rgba(120, 20, 10, .45); box-shadow: 0 0 0 1px #ff8a7a inset; }
#nha-thanh .nh-ghi { opacity: .85; line-height: 1.25; font-size: 12.5px; flex: 1 1 auto; min-width: 120px; }
#nha-thanh .nh-ly { color: #ffb4a8; font-weight: 800; line-height: 1.2; flex: 1 1 auto; min-width: 110px; }
#nha-thanh .nh-dat { min-height: 46px; min-width: 104px; padding: 2px 14px; font-size: 15.5px; flex: 0 0 auto; margin-left: auto; border-color: #7dffb0 !important; color: #d8ffe6; }
#nha-thanh .nh-the { display: flex; flex-direction: column; flex: 0 1 auto; min-width: 0; line-height: 1.2; }
#nha-thanh .nh-the b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nha-thanh .nh-the small { opacity: .85; white-space: nowrap; }
#nha-thanh .nh-the i { font-style: normal; } #nha-thanh .nh-the i.do { color: #ff8a7a; } #nha-thanh .nh-the i.vang { color: #ffd36a; }
#nha-thanh .nh-nut { min-height: 44px; min-width: 52px; padding: 2px 9px; font-size: 13.5px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#nha-thanh .nh-nut .nh-gia { padding: 1px 4px 1px 1px; } #nha-thanh .nh-nut .nh-gia img { width: 17px; height: 17px; }
#nha-thanh .nh-nut.nguy { border-color: #ff8a7a; color: #ffc2b8; }
#nha-thanh .nh-nut.nho { min-width: 42px; padding: 0; margin-left: auto; }
#nha-thanh svg { display: block; }

/* điện thoại NGANG: một hàng, chữ dưới biểu tượng ẩn bớt */
@media (orientation: landscape) {
  body.cam-ung #nha-thanh:not([hidden]) { display: flex; align-items: center; gap: 8px; padding: 4px 6px; top: calc(4px + env(safe-area-inset-top, 0px)); }
  body.cam-ung #nha-thanh .nh-dau { flex: 0 0 auto; }
  body.cam-ung #nha-thanh .nh-duoi { margin-top: 0; flex: 1 1 auto; min-height: 0; max-width: 50vw; }
  body.cam-ung #nha-thanh .nh-cu { width: 44px; min-height: 44px; }
  body.cam-ung #nha-thanh .nh-cu small { display: none; }
  body.cam-ung #nha-thanh .nh-xong { margin-left: 0; min-height: 44px; }
  body.cam-ung #nha-thanh .nh-ghi { min-width: 90px; font-size: 12px; }
}
/* ĐIỆN THOẠI DỌC (B01): công cụ thành một lưới 7 cột chiếm cả hàng (không bị nút Xong đè mất "Cầu thang"); nút Xong ở hàng riêng bên phải;
   nút tầng 44 px; nhãn công cụ 11 px, tên dài xuống 2 dòng thay vì cắt "Cầu tha…" */
@media (max-width: 620px) and (orientation: portrait) {
  #nha-thanh { padding: 6px; }
  #nha-thanh .nh-dau { flex-wrap: wrap; row-gap: 6px; }
  #nha-thanh .nh-cus { flex: 0 0 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  #nha-thanh .nh-cu { width: auto; min-width: 44px; min-height: 56px; padding: 3px 1px 2px; }
  #nha-thanh .nh-cu small { font-size: 11px; line-height: 1.05; max-width: none; white-space: normal; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  #nha-thanh .nh-xong { margin-left: auto; min-height: 44px; min-width: 96px; }
  #nha-thanh .nh-tang { min-height: 44px; min-width: 76px; }
  #nha-thanh .nh-dem { padding: 4px 6px; font-size: 12px; }
}
body.cam-ung #nha-thanh .nh-tang { min-height: 44px; }

/* ĐIỆN THOẠI: đang xây thì ẩn hết giao diện (chỉ giữ cần điều khiển), cả đảo trống cho ngón tay (như body.dang-sx) */
body.cam-ung.dang-xay #hud > *:not(#vung-can):not(#dpad), body.cam-ung.dang-xay #nut-ngam, body.cam-ung.dang-xay #nhan-tang, body.cam-ung.dang-xay #hd-mui,
body.cam-ung.dang-xay #dao-thanh, body.cam-ung.dang-xay #dn-thanh, body.cam-ung.dang-xay #kb-chip, body.cam-ung.dang-xay #sx-thanh { visibility: hidden !important; pointer-events: none !important; }
/* chip ngoài #hud (Cướp đảo, chỉ đường) nằm ngay dưới dải công cụ cao hơn trước (B01): ẩn khi đang xây trên điện thoại (nhóm A có thể thay bằng lớp riêng) */
body.cam-ung.dang-xay :is(#cd-chip, #kb-chip) { visibility: hidden !important; pointer-events: none !important; }
body.dang-xay #og-bc, body.dang-xay #og-bc-vong { visibility: hidden !important; pointer-events: none !important; }
body.dang-xay #tt-toi, body.dang-xay #tt-mep, body.dang-xay #tt-tien, body.dang-xay #tt-mung { display: none !important; }
body.ngam-canh #nha-thanh, body.ngam-canh #nha-goi-y { visibility: hidden !important; pointer-events: none !important; }

/* nút trong hàng nút đảo nhà */
/* một kiểu viền chung (.nut-vong); chỉ trạng thái ĐANG BẬT chế độ (Xây nhà, Sắp xếp) có một màu nhấn chung, kèm chữ "✓ Xong" (nha_ui.ts, sap_xep_ui.ts).
   Không !important nữa để kiểu nhấn (style.css .nut-vong:active) thắng được. */
body.dang-xay #dn-nut-xay, body.dang-sx #dn-nut-sx { border-color: #7dffb0; color: #b8ffd0; box-shadow: 0 0 10px rgba(125, 255, 176, .55), 0 3px 8px rgba(0, 0, 0, .4); }
html body.tan-thu-som #dn-nut-xay { display: none !important; }

/* chip nhắc khi cầm đồ nội thất */
#nha-goi-y { position: fixed; z-index: var(--z-hud-noi); left: 50%; transform: translateX(-50%); top: calc(var(--ct-day, 120px) + 10px); max-width: calc(100vw - 24px);
  padding: 7px 12px; border-radius: 12px; font-size: 13px; font-weight: 800; color: #d8ffe6; background: rgba(8, 30, 44, .86);
  border: 1.5px solid #7dffb0; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); pointer-events: none; text-align: center; }
#nha-goi-y.do { color: #ffd0c8; border-color: #ff8a7a; }
body:not(.cam-ung) #nha-goi-y { top: 70px; }

/* thẻ "🏠 Nhà" trong bảng Đảo nhà */
.nh-bang .nh-hd { margin: 4px 0 8px; padding-left: 20px; line-height: 1.4; font-size: 13px; }
.nh-bang .nh-hd li { margin: 2px 0; }

/* buổi 9: màn ngang thấp (667 × 375…) dải công cụ xây quá dài cho một hàng: nút Xong chồng lên nút Tầng → cho xuống hàng */
@media (max-height: 500px) { #nha-thanh .nh-hang { flex-wrap: wrap; row-gap: 4px; } }

/* buổi 10 (việc 6): màn ngang thấp (667×375…) — dải xây đã đầy chiều ngang, dòng ghi chú cuối dải bị cắt chữ → ẩn ghi chú (lý do không đặt được .nh-ly vẫn hiện) */
@media (orientation: landscape) and (max-height: 420px) { #nha-thanh .nh-ghi { display: none; } }
/* ===== nhan_rieng.css ===== */
/* ================= nhắn riêng (nhan_rieng_ui.ts): tab Thế giới | Riêng trong khung chat ================= */
#nr-tab { display: flex; gap: 4px; min-width: 0; }
#nr-tab button { position: relative; padding: 4px 10px; min-height: 28px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06);
  color: var(--chu-mo); font-size: 12px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; text-shadow: none; }
#nr-tab button.chon { color: var(--chu); background: rgba(79, 227, 255, .22); border-color: var(--vien); text-shadow: 0 0 6px rgba(79, 227, 255, .6); }
#nr-tab .cham { top: -7px; right: -8px; letter-spacing: 0; }
.nut-vuong .cham.nr-cham { right: auto; left: -5px; background: #ff5aa8; box-shadow: 0 0 6px #ff5aa8; }

/* tab Riêng: ẩn kênh thế giới, khung to hơn */
#chat.nr-mo #chat-log, #chat.nr-mo #chat-form { display: none; }
#chat.nr-mo { width: 340px; height: min(430px, calc(var(--cao, 100vh) - var(--nut-day, 62px) - 120px)); }
#nr { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* danh sách hội thoại */
.nr-tim { display: flex; gap: 5px; padding: 0 8px 6px; flex: 0 0 auto; }
.nr-tim input, .nr-form input { flex: 1; min-width: 0; padding: 7px 9px; font: inherit; font-size: 14px; border-radius: 7px; border: 1px solid var(--vien-mo);
  background: rgba(0, 10, 20, .6); color: var(--chu); outline: none; -webkit-user-select: text; user-select: text; }
.nr-tim input:focus, .nr-form input:focus { border-color: var(--vien); }
.nr-tim button, .nr-form button { flex: 0 0 auto; padding: 0 12px; min-height: 34px; border-radius: 7px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .2); font-weight: 700; }
.nr-form button:disabled, .nr-form input:disabled { opacity: .45; }
.nr-goi-y { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 8px 6px; flex: 0 0 auto; }
.nr-goi { padding: 4px 10px; min-height: 30px; border-radius: 99px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .1); font-size: 13px; }
.nr-ds { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 0 8px 8px; }
.nr-dong { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; text-align: left; padding: 6px 8px; min-height: 50px;
  margin-bottom: 5px; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .04); }
.nr-dong:active { background: rgba(79, 227, 255, .14); }
.nr-dong.moi { border-color: #ff8ac4; background: rgba(255, 90, 168, .08); }
.nr-dong.moi .nr-cuoi { color: var(--chu); font-weight: 600; }
.nr-dong.bi-chan { opacity: .6; }
.nr-anh { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px;
  background: rgba(79, 227, 255, .12); border: 1px solid var(--vien-mo); position: relative; }
.nr-anh.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--xanh);
  border: 2px solid #071828; box-shadow: 0 0 4px var(--xanh); }
.nr-giua { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nr-hang1, .nr-hang2 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nr-hang1 b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9fe8ff; }
.nr-hang1 small { color: var(--chu-mo); font-size: 11px; flex: 0 0 auto; }
.nr-cuoi { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chu-mo); font-size: 13px; }
.nr-so { flex: 0 0 auto; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: #ff5aa8; color: #fff; font-style: normal; font-weight: 700;
  font-size: 11px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 6px #ff5aa8; }
.nr-trong { color: var(--chu-mo); text-align: center; padding: 18px 10px; font-size: 13px; line-height: 1.5; }
.nr-trong b { color: var(--chu); }
.nr-chan-ds { margin-top: 6px; border-top: 1px dashed var(--vien-mo); padding-top: 4px; }
.nr-mo-chan { background: none; border: 0; color: var(--chu-mo); font-size: 12px; padding: 6px 2px; min-height: 30px; }
.nr-chan-dong { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 2px; font-size: 13px; }
.nr-chan-dong button { padding: 3px 10px; min-height: 30px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .1); font-size: 12px; }

/* khung hội thoại */
.nr-dau { display: flex; align-items: center; gap: 6px; padding: 0 8px 6px; flex: 0 0 auto; border-bottom: 1px solid var(--vien-mo); }
.nr-lui { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-size: 22px; line-height: 1; padding: 0 0 3px; }
.nr-ai { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.nr-ai b { color: #9fe8ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-size: 15px; }
.nr-ai span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-on { color: var(--xanh); } .nr-off { color: var(--chu-mo); }
.nr-nut-chan { flex: 0 0 auto; padding: 4px 10px; min-height: 32px; border-radius: 7px; border: 1px solid rgba(255, 106, 106, .5); background: rgba(255, 106, 106, .08);
  color: #ffb0b0; font-size: 12px; font-weight: 700; }
.nr-nut-chan.xac-nhan { background: rgba(255, 106, 106, .3); color: #fff; border-color: var(--do); }
.nr-tin { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 4px; }
.nr-bong { max-width: 80%; padding: 5px 10px 4px; border-radius: 14px; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; word-break: break-word;
  -webkit-user-select: text; user-select: text; }
.nr-bong time { display: block; font-size: 10px; color: var(--chu-mo); margin-top: 1px; text-align: right; }
.nr-bong.minh { align-self: flex-end; background: linear-gradient(rgba(79, 227, 255, .34), rgba(79, 227, 255, .2)); border: 1px solid var(--vien); border-bottom-right-radius: 4px; }
.nr-bong.ho { align-self: flex-start; background: rgba(226, 251, 255, .07); border: 1px solid var(--vien-mo); border-bottom-left-radius: 4px; }
.nr-bong.ho time { text-align: left; }
.nr-ngay { text-align: center; margin: 6px 0 2px; font-size: 11px; color: var(--chu-mo); }
.nr-ngay span { padding: 1px 10px; border-radius: 99px; background: rgba(79, 227, 255, .08); border: 1px solid var(--vien-mo); }
.nr-bi-chan { flex: 0 0 auto; margin: 0 8px; padding: 5px 8px; border-radius: 7px; font-size: 12px; color: #ffb0b0; background: rgba(255, 106, 106, .08); border: 1px dashed rgba(255, 106, 106, .5); text-align: center; }
.nr-form { display: flex; gap: 5px; padding: 6px 8px 8px; flex: 0 0 auto; }

/* thông báo nhỏ khi có tin riêng mới */
#nr-bao { position: fixed; z-index: var(--z-toast); top: calc(var(--tren-cao, 96px) + 8px); left: 50%; transform: translateX(-50%); width: min(340px, calc(100vw - 24px - var(--le) - var(--phai)));
  display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.nr-the-bao { pointer-events: auto; display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 7px 10px; min-height: 48px; border-radius: 10px;
  background: var(--nen-dam); border: 1px solid #ff8ac4; box-shadow: 0 0 12px rgba(255, 90, 168, .45); animation: nr-vao .25s ease-out; transition: opacity .4s, transform .4s; }
.nr-the-bao.ra { opacity: 0; transform: translateY(-8px); }
.nr-bao-icon { font-size: 20px; color: #ff8ac4; flex: 0 0 auto; }
.nr-bao-giua { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nr-bao-giua b { color: #ffc6f0; font-size: 13px; }
.nr-bao-giua span { color: var(--chu); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-bao-mo { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--vien); border: 1px solid var(--vien-mo); border-radius: 7px; padding: 4px 8px; }
@keyframes nr-vao { from { opacity: 0; transform: translateY(-10px); } }

/* cảm ứng: vùng bấm ≥ 44px, ô nhập 16px để iOS khỏi phóng to */
body.cam-ung #nr-tab button { min-height: var(--cham-toi-thieu, 44px); padding: 4px 12px; }
body.cam-ung .nr-tim input, body.cam-ung .nr-form input { font-size: 16px; }
body.cam-ung .nr-tim button, body.cam-ung .nr-form button, body.cam-ung .nr-lui, body.cam-ung .nr-nut-chan, body.cam-ung .nr-goi,
body.cam-ung .nr-chan-dong button, body.cam-ung .nr-mo-chan { min-height: 44px; }
body.cam-ung .nr-lui { width: 44px; }
body.cam-ung .nr-tim input, body.cam-ung .nr-form input { min-height: 44px; }
/* đang gõ trên máy cảm ứng màn rộng: nổi lên trên bàn phím ảo nhưng cao hơn kênh thế giới */
html body.cam-ung #chat.nr-mo:focus-within { top: auto; bottom: calc(var(--ban-phim, 0px) + 6px); height: min(430px, calc(var(--vv-cao, var(--cao, 100vh)) - 12px)); }

/* điện thoại (dọc lẫn ngang): tab Riêng thành tấm phủ gần toàn màn như các bảng lớn — đọc và gõ cho thoải mái;
   bấm "Thế giới" hoặc × là trả lại màn chơi (khung chat nhỏ không đè vùng cần điều khiển) */
@media (max-width: 620px), (max-height: 500px) {
  html body #chat.nr-mo { position: fixed; z-index: var(--z-chat); left: calc(6px + var(--le)); right: calc(6px + var(--phai)); top: calc(6px + var(--tren));
    bottom: calc(6px + var(--day)); width: auto; height: auto; background: var(--nen-dam); }
  html body.cam-ung #chat.nr-mo:focus-within { top: auto; bottom: calc(var(--ban-phim, 0px) + 6px); height: calc(var(--vv-cao, var(--cao, 100vh)) - 12px - var(--tren)); }
  #chat.nr-mo .tieu-de { min-height: 48px; }
  .nr-bong { max-width: 85%; font-size: 15px; }
  #nr-bao { top: calc(var(--tren-cao, 150px) + 6px); }
}
/* điện thoại ngang: tấm phủ rộng quá thì giới hạn bề ngang cho dễ đọc */
@media (max-height: 500px) and (min-width: 621px) {
  html body #chat.nr-mo { left: 50%; right: auto; width: min(560px, calc(100vw - 12px - var(--le) - var(--phai))); transform: translateX(-50%); }
  #nr-bao { top: calc(var(--dh-day, 60px) + 6px); }
}

/* ---------- khung chat: 4 tab kênh (Thế giới · Gần đây · Hải đội · Riêng) dùng chung nhật ký, lọc theo kênh ---------- */
#chat.kenh-gan #chat-log p:not(.gan), #chat.kenh-doi #chat-log p:not(.doi) { display: none; }
#chat-log p.doi { color: #ffe9b0; }
#chat-log .doi-nhan { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: rgba(190, 140, 40, .55); color: #fff6dc; }
#chat-trong { padding: 14px 12px; font-size: 13px; line-height: 1.4; color: var(--chu-mo); text-align: center; }
/* C16: kênh Thế giới vừa có tin đầu tiên thì lời chào rỗng tự ẩn (JS chỉ xét lúc đổi thẻ kênh) */
#chat-log:has(> p) + #chat-trong[data-k="tg"] { display: none; }
#chat-log:not(:has(> p)) { flex: 0 0 0; min-height: 0; }
#chat-log:not(:has(> p)) + #chat-trong[data-k="tg"]:not([hidden]) { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
#chat-trong[hidden] { display: none; }
#chat.nr-mo #chat-trong { display: none; }
#nr-tab { flex: 1 1 auto; flex-wrap: nowrap; gap: 3px; }
#nr-tab button { flex: 1 1 0; min-width: 0; white-space: nowrap; padding-left: 3px !important; padding-right: 3px !important; font-size: 12px; letter-spacing: 0; }
@media (max-width: 420px) { #nr-tab button { padding: 4px 7px; font-size: 12px; } }
/* ===== dao.css ===== */
/* Đảo trôi + người cá (trinh_khach/src/dao_ui.ts, nguoi_ca_ui.ts) */

/* ---------- thanh hành động ---------- */
#dao-thanh { position: fixed; z-index: var(--z-hud-noi); right: calc(16px + var(--phai)); bottom: calc(16px + var(--day));
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; max-width: calc(50vw - 16px); }
#dao-thanh > * { pointer-events: auto; }
.dao-hang { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dao-chip { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; border-radius: 99px; font-size: 13px;
  background: var(--nen); border: 1px solid rgba(255, 216, 74, 0.5); box-shadow: 0 0 10px rgba(255, 216, 74, 0.25); white-space: nowrap; }
.dao-chip img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.dao-chip b { color: var(--vang); font-weight: 700; }
.dao-chip .gio { font-variant-numeric: tabular-nums; }
.dao-chip.gap { border-color: var(--do); box-shadow: 0 0 12px rgba(255, 106, 106, 0.55); animation: dao-nhay 0.8s infinite alternate; }
.dao-chip.gap b.gio { color: var(--do); }
@keyframes dao-nhay { to { transform: scale(1.05); } }

.dao-nut { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 5px 14px 5px 8px;
  border-radius: 12px; background: var(--nen); border: 1px solid var(--vien); box-shadow: var(--phat); text-align: left; }
.dao-nut img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; flex: 0 0 auto; }
.dao-nut span { display: flex; flex-direction: column; line-height: 1.15; }
.dao-nut b { font-size: 15px; letter-spacing: 0.3px; }
.dao-nut small { font-size: 11px; color: var(--chu-mo); }
.dao-nut:active { transform: translateY(1px); }
.dao-nut.chinh { border-color: var(--vang); background: linear-gradient(rgba(120, 82, 22, 0.92), rgba(70, 44, 10, 0.94));
  box-shadow: 0 0 12px rgba(255, 216, 74, 0.5), inset 0 0 12px rgba(255, 216, 74, 0.18); }
.dao-nut.chinh small { color: #f5deb0; }
.dao-nut.chinh:not(.mo):not(.dang) { animation: dao-moi 1.6s ease-in-out infinite; }
@keyframes dao-moi { 50% { box-shadow: 0 0 20px rgba(255, 216, 74, 0.85), inset 0 0 14px rgba(255, 216, 74, 0.3); } }
.dao-nut.mo { opacity: 0.62; animation: none; }
.dao-nut.nc { border-color: #ff9ad0; box-shadow: 0 0 12px rgba(255, 154, 208, 0.45), inset 0 0 12px rgba(255, 154, 208, 0.15); }
.dao-nut.nc img { object-position: top; object-fit: cover; border-radius: 8px; background: rgba(255, 154, 208, 0.15); }
#dao-lam-tien { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--vang); box-shadow: 0 0 6px var(--vang); }

/* điện thoại: cột nút bên phải, phía trên nút Câu (không đè vùng cần điều khiển bên trái) */
body.cam-ung #dao-thanh { right: calc(10px + var(--phai));
  bottom: calc(var(--nc-dinh) + 116px + var(--day)); max-width: calc(58vw - 10px); }
body.cam-ung .dao-hang { flex-direction: column; align-items: flex-end; }
body.cam-ung .dao-chip { font-size: 12px; white-space: normal; }
@media (max-height: 500px) {
  body.cam-ung #dao-thanh { bottom: auto; top: calc(var(--dh-day, 60px) + 8px); right: calc(var(--nc) + var(--nc-phai) + 16px + var(--phai)); max-width: 42vw; }
  body.cam-ung .dao-hang { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
}

/* ---------- gian hàng người cá ---------- */
#bang-nguoi-ca { position: fixed; z-index: var(--z-bang); right: calc(16px + var(--phai)); top: 50%; transform: translateY(-50%); width: 380px;
  max-height: calc(var(--cao, 100vh) - 140px); display: flex; flex-direction: column; border-color: rgba(255, 154, 208, 0.55);
  box-shadow: 0 0 14px rgba(255, 154, 208, 0.35), inset 0 0 14px rgba(79, 227, 255, 0.1); }
#bang-nguoi-ca::before, #bang-nguoi-ca::after { border-color: #ff9ad0; }
.nca-dau { display: flex; align-items: center; gap: 10px; padding: 10px 10px 4px; }
.nca-chan { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255, 154, 208, 0.6);
  background: radial-gradient(circle at 50% 80%, #3fb8c8, #0c4a66); }
.nca-chan img { width: 100%; height: 100%; object-fit: cover; object-position: top; image-rendering: pixelated; }
.nca-ten { flex: 1; display: flex; flex-direction: column; }
.nca-ten > b { font-size: 17px; color: #ffc2e2; text-shadow: 0 0 6px rgba(255, 154, 208, 0.6); }
.nca-ten > span { font-size: 12px; color: var(--chu-mo); }
.nca-ten #nca-gio { color: var(--chu); font-variant-numeric: tabular-nums; }
#bang-nguoi-ca .nut-x { min-width: 44px; min-height: 44px; font-size: 26px; color: var(--chu); }
.nca-loi { margin: 2px 12px 6px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 240, 248, 0.94); color: #5a2140; font-size: 13px;
  position: relative; min-height: 20px; }
.nca-loi::before { content: ""; position: absolute; top: -6px; left: 30px; border: 6px solid transparent; border-top: 0; border-bottom-color: rgba(255, 240, 248, 0.94); }
.nca-loi:empty { display: none; }
.nca-xa { margin: 0 12px 6px; font-size: 12px; color: var(--cam); }
.nca-than { overflow-y: auto; padding: 0 10px 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.nca-muc { font-size: 11px; letter-spacing: 1.4px; color: var(--vien); font-weight: 700; margin: 8px 2px 5px; }
.nca-muc small { letter-spacing: 0; font-weight: 400; color: var(--chu-mo); margin-left: 4px; }
.nca-mon { position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin-bottom: 6px; border-radius: 10px;
  background: rgba(79, 227, 255, 0.07); border: 1px solid var(--vien-mo); }
.nca-mon.hiem { border-color: rgba(255, 216, 74, 0.75); background: linear-gradient(90deg, rgba(255, 216, 74, 0.14), rgba(255, 154, 208, 0.08));
  box-shadow: inset 0 0 10px rgba(255, 216, 74, 0.15); padding-top: 14px; }
.nca-nhan-hiem { position: absolute; top: -7px; left: 10px; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: #3a2400;
  background: var(--vang); border-radius: 99px; padding: 1px 7px; }
.nca-mon.het { opacity: 0.5; }
.nca-hai { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.nca-cho, .nca-duoc { display: flex; flex-wrap: wrap; gap: 4px; }
.nca-mui { color: var(--vang); font-size: 15px; flex: 0 0 auto; }
.nca-vat { position: relative; display: inline-flex; flex-direction: column; align-items: center; width: 50px; padding: 2px 0 1px;
  border-radius: 8px; background: rgba(4, 14, 26, 0.6); border: 1px solid rgba(79, 227, 255, 0.2); }
.nca-vat img { width: 30px; height: 30px; image-rendering: pixelated; object-fit: contain; }
.nca-vat b { font-size: 11px; line-height: 1.1; }
.nca-vat small { font-size: 10px; color: var(--xanh); line-height: 1.1; }
.nca-vat.thieu { border-color: rgba(255, 106, 106, 0.6); }
.nca-vat.thieu small { color: var(--do); }
.nca-vat em { display: none; }
.nca-duoc .nca-vat { border-color: rgba(255, 216, 74, 0.45); }
/* B10 (bảng Tàu buôn): thưởng xu luôn là chip viên thuốc, không bị kéo cao thành ô vuông trống; dòng chữ Cần / Nhận; nút theo kiểu .nut-chinh */
.nca-duoc { align-items: center; }
.nca-vat.nca-xu { flex-direction: row; width: auto; padding: 4px 10px; border-radius: 99px; }
.nca-vat.nca-xu b { font-size: 13px; }
.nca-vat b { font-size: 12px; } .nca-vat small { font-size: 11px; }
.nca-cau { flex: 1 1 100%; order: 3; font-size: 12px; line-height: 1.4; color: var(--chu-mo); }
.nca-mon { flex-wrap: wrap; }
#bang-tau-buon .nca-phai { margin-left: auto; align-items: stretch; }
#bang-tau-buon .nca-doi { min-height: 44px; min-width: 120px; border-radius: var(--bo-the); border: 1px solid var(--vien); background: var(--nut-chinh-nen); box-shadow: 0 0 8px rgba(79, 227, 255, .35); font-size: 13px; line-height: 1.2; }
#bang-tau-buon .nca-doi:disabled { opacity: .45; box-shadow: none; filter: none; }
.nca-phai { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.nca-luot { font-size: 11px; color: var(--chu-mo); white-space: nowrap; }
.nca-doi, .nca-giao { min-width: 64px; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid #ff9ad0; font-weight: 700;
  background: linear-gradient(#b43f7d, #7a2253); box-shadow: 0 0 8px rgba(255, 154, 208, 0.45); }
.nca-doi:disabled, .nca-giao:disabled { opacity: 0.4; box-shadow: none; filter: grayscale(0.5); cursor: default; }
.nca-viec { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; background: rgba(111, 255, 210, 0.07);
  border: 1px dashed rgba(111, 255, 210, 0.5); }
.nca-viec.xong { border-style: solid; opacity: 0.75; }
.nca-viec-anh { width: 36px; height: 36px; image-rendering: pixelated; flex: 0 0 auto; }
.nca-viec-nd { flex: 1; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.nca-viec-nd b { color: var(--xanh); }
.nca-viec-nd small { font-size: 11px; color: var(--chu-mo); }

/* điện thoại dọc: tấm trượt dưới đáy */
@media (max-width: 620px) {
  #bang-nguoi-ca { left: calc(8px + var(--le)); right: calc(8px + var(--phai)); top: auto; bottom: calc(8px + var(--day)); transform: none;
    width: auto; max-height: 66vh; }
  @supports (height: 1dvh) { #bang-nguoi-ca { max-height: 66dvh; } }
  .nca-vat { width: 46px; }
}
/* điện thoại ngang: cột bên phải, cao hết màn */
@media (max-height: 500px) and (min-width: 621px) {
  #bang-nguoi-ca { top: calc(8px + var(--tren)); bottom: calc(8px + var(--day)); transform: none; width: min(400px, 54vw); max-height: none; }
  .nca-dau { padding-top: 6px; }
  .nca-chan { width: 44px; height: 44px; }
}
/* ===== lai.css ===== */
/* Lái tàu: nút "Cầm lái" + cụm bẻ lái / buồm / neo (trinh_khach/src/lai.ts dựng vào #cum-lai).
   Kiểu mặc định; HUD muốn dời chỗ / đổi dáng thì ghi đè theo id. Mọi nút ≥ 48px. */
#cum-lai { z-index: 4; }
.lai-nut { min-width: 52px; min-height: 52px; padding: 4px 8px; border-radius: 12px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--nen, rgba(7, 24, 40, .9)); border: 1px solid var(--vien, rgba(79, 227, 255, .45)); box-shadow: var(--phat, 0 0 10px rgba(79, 227, 255, .2));
  color: #e8fdff; font: inherit; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.lai-nut b { font-size: 20px; line-height: 1; }
.lai-nut small { font-size: 10px; opacity: .85; white-space: nowrap; }
.lai-nut:active, .lai-nut.an { transform: scale(.94); background: rgba(31, 111, 140, .95); }
.lai-nut:disabled { opacity: .62; cursor: default; border-style: dashed; border-color: var(--vien-mo); } /* A13: nút tắt vẫn đọc được nhãn (trước .38 chỉ còn bóng mờ) */
.lai-nut:disabled small { opacity: 1; color: var(--chu); font-size: 11px; }
#lai-nut-cam { flex-direction: row; gap: 8px; padding: 8px 16px; min-height: 48px; border-color: #ffd84a; box-shadow: 0 0 14px rgba(255, 216, 74, .45); animation: laiNhay 1.2s ease-in-out infinite; }
#lai-nut-cam span { font-weight: 700; font-size: 15px; }
#lai-nut-cam .lai-phim { padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .14); font-size: 11px; }
body.cam-ung #lai-nut-cam .lai-phim { display: none; }
#lai-nut-cam[hidden], #lai-bang[hidden] { display: none !important; }
@keyframes laiNhay { 50% { transform: translateY(-3px); } }

#lai-bang { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#lai-tt { display: flex; gap: 10px; align-items: center; padding: 4px 12px; border-radius: 99px; background: rgba(7, 24, 40, .88); border: 1px solid rgba(79, 227, 255, .35);
  font-size: 12px; color: #d8eef5; white-space: nowrap; }
#lai-tt b { color: #ffe9a8; }
#lai-tt-toc { font-weight: 700; color: #9ff7ff; }
#lai-tt-gio.tot { color: #8dffb0; }
#lai-tt-gio.xau { color: #ff9a8a; }
#lai-hang { display: flex; gap: 6px; align-items: stretch; }
/* A13: thước mức buồm rộng 14px, cao bằng nút, nền đậm, vạch sáng màu --vien (trước chỉ là vài vạch 3px khó thấy) */
#lai-buom-muc { width: 14px; box-sizing: content-box; padding: 3px; display: flex; flex-direction: column-reverse; gap: 3px; justify-content: stretch; align-self: stretch;
  background: var(--nen-dam); border: 1px solid var(--vien-mo); border-radius: 8px; }
#lai-buom-muc i { display: block; flex: 1 1 0; min-height: 10px; border-radius: 3px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(79, 227, 255, .25); }
#lai-buom-muc[data-muc="1"] i:first-child, #lai-buom-muc[data-muc="2"] i { background: var(--vien); border-color: #bff6ff; box-shadow: 0 0 6px rgba(79, 227, 255, .75); }
#lai-neo.bat { border-color: #ffb04a; background: rgba(120, 60, 10, .92); box-shadow: 0 0 12px rgba(255, 160, 60, .5); }
#lai-roi { border-color: rgba(255, 140, 140, .6); }

/* đang cầm lái: thanh cầm + gợi ý câu nhường chỗ cho cụm lái (không câu, không đặt đồ lúc lái) */
body.dang-lai #thanh-cam, body.dang-lai #goi-y, body.dang-lai #nut-chinh, body.dang-lai #nut-phu { display: none !important; }

/* điện thoại: cụm lái xếp 2 hàng gọn bên tay phải, cần điều khiển bên trái vẫn bẻ lái được nên ẩn ◀ ▶ */
body.cam-ung #lai-trai, body.cam-ung #lai-phai { display: none; }
body.cam-ung.dang-lai #cum-lai { bottom: calc(14px + var(--day, 0px)); }
body.cam-ung #lai-bang { align-items: flex-end; }
body.cam-ung .lai-nut { min-width: 56px; min-height: 56px; }
@media (max-width: 620px) {
  body.cam-ung #lai-hang { flex-wrap: wrap; justify-content: flex-end; max-width: 200px; }
  #lai-tt { font-size: 11px; gap: 7px; padding: 3px 9px; }
}

/* ---- biển vô hạn: nút kéo / phóng bản đồ lớn + dòng toạ độ (ban_do.ts) ---- */
#bd-dk { position: absolute; left: 8px; bottom: 34px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
#bd-dk button { width: 44px; height: 44px; border-radius: 10px; background: rgba(7, 24, 40, .9); border: 1px solid rgba(79, 227, 255, .45); color: #e8fdff;
  font: 700 20px/1 system-ui, sans-serif; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; touch-action: manipulation; }
#bd-dk button small { font-size: 8.5px; font-weight: 600; opacity: .9; white-space: nowrap; }
#bd-dk button:active { transform: scale(.94); background: rgba(31, 111, 140, .95); }
#bd-ve.bat { border-color: #ffd84a; box-shadow: 0 0 12px rgba(255, 216, 74, .5); color: #fff6cf; }
#bd-toado { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 10px; background: rgba(4, 14, 26, .78); color: #d8eef5; font-size: 11.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; pointer-events: none; z-index: 2; font-variant-numeric: tabular-nums; }
/* ---- kênh chat "Gần đây" + biểu cảm nhanh (nguoi_khac.ts) ---- */
#chat-kenh { flex: 0 0 auto; padding: 0 9px; margin-right: 4px; border-radius: 8px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(79, 227, 255, .35); color: #d8eef5;
  font: 600 12px/1 system-ui, sans-serif; white-space: nowrap; cursor: pointer; min-height: 32px; }
#chat-kenh.gan { border-color: #8dffb0; color: #c8ffd8; background: rgba(20, 80, 50, .55); }
#chat-bc { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px 0; }
#chat-bc[hidden] { display: none; }
#chat-bc button { flex: 1 1 0; min-width: 34px; min-height: 36px; border-radius: 8px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .16); font-size: 18px; cursor: pointer; }
#chat-bc button:active { transform: scale(.92); }
#chat-log p.gan { color: #c8ffd8; }
#chat-log .gan-nhan { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: rgba(60, 170, 110, .5); color: #eafff0; }

/* nút máy hơi nước (may_tau) trong cụm lái */
#lai-may[hidden] { display: none; }
#lai-may.bat { border-color: #ffb04a; background: rgba(120, 60, 10, .92); box-shadow: 0 0 12px rgba(255, 160, 60, .5); }
#lai-may.bat b { animation: may-quay 1.2s linear infinite; display: inline-block; }
@keyframes may-quay { to { transform: rotate(360deg); } }
/* giữ ngón trên bản đồ nhỏ để xem xa (cam_xem.ts, docs/hoc/cam_moba.md): kéo không cuộn trang; đang xem thì viền sáng */
#ban-do-nho { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
body.xem-ban-do #ban-do-nho { outline: 2px solid #ffd76a; outline-offset: 2px; }
/* ===== nang_cap.css ===== */
/* Bảng nâng cấp bè → thuyền buồm (trinh_khach/src/nang_cap_ui.ts) */
#than-nc { overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 12px; flex: 1 1 auto; min-height: 0; display: grid; grid-auto-rows: max-content; gap: 8px; align-content: start; }

/* thang 4 bậc */
.nc-thang { display: flex; align-items: center; gap: 0; padding: 14px 0 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }   /* B06: chừa chỗ cho huy hiệu "Đang dùng" (không bị cắt mép trên); 6 bậc cuộn ngang khi hẹp */
.nc-thang::-webkit-scrollbar { display: none; }
.nc-thang.con-phai { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.nc-thang.con-trai { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); }
.nc-thang.con-trai.con-phai { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.nc-bac { flex: 1 0 76px; min-width: 76px; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 2px; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .05); position: relative; }
.nc-bac img { width: 42px; height: 42px; image-rendering: pixelated; }
.nc-bac span { font-size: var(--chu-phu, 12px); line-height: 1.15; color: var(--chu-mo); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.nc-bac em { position: absolute; top: -10px; font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: var(--nen-dam); border: 1px solid var(--vien); color: var(--xanh); white-space: nowrap; }
.nc-bac.khoa img { filter: grayscale(.85) brightness(.7); }
.nc-bac.qua { border-color: rgba(111, 255, 210, .45); }
.nc-bac.nay { border-color: var(--xanh); background: rgba(111, 255, 210, .1); box-shadow: 0 0 10px rgba(111, 255, 210, .35); }
.nc-bac.nay span { color: var(--chu); font-weight: 700; }
.nc-bac.dong { border-color: var(--vang); animation: ncNhay 1.4s infinite; }
.nc-bac.dong em { color: var(--vang); border-color: var(--vang); }
.nc-bac.xem { outline: 2px solid var(--vien); outline-offset: 1px; }
.nc-noi { flex: 0 0 6px; height: 2px; background: var(--vien-mo); }
.nc-noi.qua { background: var(--xanh); }
@keyframes ncNhay { 50% { box-shadow: 0 0 12px rgba(255, 216, 74, .6); } }

/* thẻ */
.nc-the { border: 1px solid var(--vien-mo); border-radius: 10px; padding: 10px; background: rgba(79, 227, 255, .04); }
.nc-the.nay { border-color: rgba(111, 255, 210, .5); }
.nc-the.dong { border-color: var(--vang); background: linear-gradient(rgba(255, 216, 74, .08), transparent); }
.nc-dau { display: flex; gap: 10px; align-items: center; }
.nc-dau > img { width: 64px; height: 64px; image-rendering: pixelated; flex: 0 0 auto; }
.nc-nhan { font-size: 11px; letter-spacing: 1.5px; color: var(--vien); font-weight: 700; }
.nc-ten { font-size: 17px; font-weight: 900; color: var(--chu); letter-spacing: .5px; }
.nc-the.dong .nc-ten { color: var(--vang); }
.nc-gio { margin-top: 4px; font-size: 12px; color: var(--xanh); font-weight: 700; }
.nc-muc { font-size: 11px; letter-spacing: 1.5px; color: var(--chu-mo); font-weight: 700; margin: 10px 0 4px; }
.nc-loi { display: grid; gap: 3px; }
.nc-li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, .18); }
.nc-li span { color: var(--chu-mo); }
.nc-li b { color: var(--xanh); text-align: right; }
.nc-li b s { color: var(--chu-mo); font-weight: 400; }
.nc-li.mo b { color: var(--vang); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; }
.nc-li.mo img { width: 22px; height: 22px; image-rendering: pixelated; }
.nc-dk { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--chu-mo); margin-bottom: 6px; }
.nc-dk .du { color: var(--xanh); } .nc-dk .thieu { color: var(--do); }
.nc-can { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.nc-can span { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--vien-mo); font-size: 12px; min-width: 0; }
.nc-can span.du { border-color: rgba(111, 255, 210, .45); }
.nc-can span.thieu { border-color: rgba(255, 106, 106, .5); }
.nc-can img { width: 24px; height: 24px; image-rendering: pixelated; flex: 0 0 auto; }
.nc-can i { font-style: normal; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chu-mo); }
.nc-can .thieu b { color: var(--do); } .nc-can .du b { color: var(--xanh); }
.nc-dong { margin-top: 10px; }
.nc-ghi { margin-top: 6px; }
.nc-thanh { position: relative; height: 18px; border-radius: 9px; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .15); overflow: hidden; margin: 10px 0 8px; }
.nc-thanh span { display: block; height: 100%; background: linear-gradient(90deg, #c48412, #ffe066); transition: width .4s; }
.nc-thanh em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.nc-nut { display: flex; gap: 6px; }
.nc-nut button { flex: 1; min-height: 48px; border-radius: 8px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .15); font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.nc-nut button.chinh { background: linear-gradient(#c48412, #8a5a0c); border-color: var(--vang); }
.nc-nut button small { font-size: 12px; color: var(--vang); font-weight: 700; }
.nc-nut button.chinh small { color: #fff6c4; }
.nc-nut button:disabled { opacity: .4; }

/* chip tiến độ dưới khung chỉ số */
#nc-chip { display: grid; gap: 2px; margin-top: 2px; padding: 3px 0 0; min-height: 30px; background: none; border: 0; border-top: 1px solid var(--vien-mo); text-align: left; }
#nc-chip span { font-size: 11px; font-weight: 800; color: var(--vang); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nc-chip b { height: 6px; border-radius: 4px; background: rgba(0, 0, 0, .5); overflow: hidden; display: block; }
#nc-chip i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c48412, #ffe066); }

/* hồ sơ: phương tiện */
.hs-pt { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--xanh); }
.hs-pt img { width: 24px; height: 24px; image-rendering: pixelated; }

@media (max-width: 620px), (max-height: 500px) {
  .nc-bac { min-height: 70px; }
  .nc-bac img { width: 36px; height: 36px; }
  .nc-dau > img { width: 52px; height: 52px; }
  .nc-ten { font-size: 15px; }
}
@media (max-width: 400px) {
  .nc-can { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 621px) {
  #than-nc { grid-template-columns: 1fr 1fr; align-items: start; }
  #than-nc > .nc-thang { grid-column: 1 / -1; }
}
.nc-bao { margin-top: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--cam); background: rgba(255, 180, 84, .08); font-size: 13px; display: grid; gap: 4px; }
.nc-bao .nc-muc { margin: 0; color: var(--cam); }
.nc-bao b { color: var(--vang); }
.nc-bao img { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: middle; }

/* danh sách điều kiện đóng thuyền (nang_cap_ui.ts dieuKien): ✓ đạt / ✗ chưa, kèm một câu chỉ cách đạt */
.nc-ds { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 5px; }
.nc-ds li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--vien-mo); font-size: 13px; }
.nc-ds li > b { flex: 0 0 auto; width: 18px; text-align: center; }
.nc-ds li > span { flex: 1; min-width: 0; }
.nc-ds li small { display: block; margin-top: 2px; font-size: 12px; color: var(--chu-mo); }
.nc-ds li.du { border-color: rgba(111, 255, 210, .4); } .nc-ds li.du > b { color: var(--xanh); }
.nc-ds li.thieu { border-color: rgba(255, 106, 106, .55); background: rgba(255, 106, 106, .07); } .nc-ds li.thieu > b { color: var(--do); }
.nc-can em { font-style: normal; font-weight: 800; flex: 0 0 auto; }
.nc-can .du em { color: var(--xanh); } .nc-can .thieu em { color: var(--do); }
.nc-dong.mo { opacity: 1; background: #163347; border-color: #4c748d; color: #d8eef8; cursor: help; }
.che-dk { margin-top: 3px; font-size: 12px; color: var(--cam); }
/* ===== can_cau.css ===== */
/* Kho cần câu (trinh_khach/src/can_cau_ui.ts) + khung phẩm của cần trên thanh cầm / túi đồ / cửa hàng */
/* 15/11 đợt 2 (B14 + CH-4): cỡ bảng do .co-vua .cao-dinh (can_cau_ui.ts), bỏ khoá rộng 640 riêng */
#bang-cc .tieu-de small { color: var(--chu-mo); font-weight: 600; letter-spacing: 0; margin-left: 6px; text-shadow: none; }
.than-cc { display: flex; gap: 10px; padding: 0 10px 10px; min-height: 0; flex: 1 1 auto; }
#cc-ds { flex: 1 1 auto; min-width: 0; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.cc-nhom { font-size: 11px; letter-spacing: 1.2px; color: var(--chu-mo); font-weight: 700; margin: 2px 0 6px; }
.cc-nhom + .cc-luoi { margin-bottom: 10px; }
.cc-luoi { display: grid; grid-template-columns: repeat(auto-fill, 58px); gap: 6px; }
.cc-o { width: 58px; height: 58px; padding: 0; border-radius: 9px; position: relative; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--mau-pham) 22%, transparent), rgba(79, 227, 255, .04) 70%);
  border: 1.5px solid color-mix(in srgb, var(--mau-pham) 70%, transparent); }
.cc-o img { width: 44px; height: 44px; image-rendering: pixelated; }
.cc-o.chon { box-shadow: 0 0 0 2px var(--vien), 0 0 12px rgba(79, 227, 255, .6); }
.cc-o.chua img { filter: grayscale(.9) brightness(.55); }
.cc-o.chua { border-style: dashed; }
.cc-o.vip { animation: ccVip 2.4s ease-in-out infinite; }
.cc-o .cc-dang { position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); font-size: 8.5px; font-weight: 800; letter-spacing: .3px;
  background: var(--xanh); color: #04202a; border-radius: 4px; padding: 0 3px; white-space: nowrap; }
.cc-o .cc-dong { position: absolute; top: 1px; right: 4px; font-size: 11px; color: var(--vang); text-shadow: 0 0 4px rgba(255, 216, 74, .8); }
.cc-o .cc-khoa { position: absolute; top: 2px; right: 5px; font-size: 11px; color: var(--chu-mo); font-weight: 800; }
@keyframes ccVip { 50% { box-shadow: 0 0 12px color-mix(in srgb, var(--mau-pham) 80%, transparent), inset 0 0 10px color-mix(in srgb, var(--mau-pham) 40%, transparent); } }

#cc-ct { width: 250px; flex: 0 0 auto; border-left: 1px solid var(--vien-mo); padding-left: 10px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.cc-dau { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.cc-anh { width: 68px; height: 68px; flex: 0 0 auto; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--mau-pham); background: radial-gradient(circle, color-mix(in srgb, var(--mau-pham) 30%, transparent), transparent 72%); }
.cc-anh img { width: 60px; height: 60px; image-rendering: pixelated; }
.cc-anh.vip { animation: ccVip 2.4s ease-in-out infinite; }
.cc-ten { font-weight: 900; font-size: 15px; line-height: 1.2; }
.cc-vip { font-size: 10px; font-weight: 900; color: #3a1a00; background: linear-gradient(90deg, #ffd84a, #ff9a6a); border-radius: 4px; padding: 0 4px; vertical-align: 2px; }
.cc-pham { font-size: 11.5px; color: var(--chu-mo); }
.cc-dongdb { font-size: 12px; color: var(--vang); font-weight: 700; margin-top: 2px; }
.cc-ss { font-size: 11px; color: var(--chu-mo); margin: 4px 0 2px; }
.cc-bang { display: grid; gap: 5px; margin: 4px 0 8px; }
.cc-cs { display: grid; grid-template-columns: 84px 1fr; gap: 1px 6px; font-size: 12px; align-items: center; }
.cc-cs span { color: var(--chu-mo); }
.cc-cs b { text-align: right; font-weight: 700; white-space: nowrap; }
.cc-cs b em { font-style: normal; font-size: 11px; margin-left: 5px; }
.cc-cs b em.hon { color: var(--xanh); } .cc-cs b em.kem { color: var(--do); }
.cc-cs i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(79, 227, 255, .12); overflow: hidden; display: block; }
.cc-cs i s { display: block; height: 100%; background: linear-gradient(90deg, var(--vien), var(--xanh)); text-decoration: none; }
.cc-cs.phu { display: block; color: var(--vang); font-size: 11.5px; }
.cc-mota { color: var(--chu-mo); font-size: 12px; margin-bottom: 6px; }
.cc-nguon { font-size: 11.5px; margin-bottom: 6px; color: var(--chu); }
.cc-nguon b { color: var(--vien); }
.cc-nut { display: grid; gap: 6px; }
.cc-nut button { padding: 8px; min-height: 40px; border-radius: 7px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .15); font-weight: 700; }
.cc-nut button.chinh { background: linear-gradient(#1f8c78, #136350); border-color: var(--xanh); }
.cc-nut button:disabled { opacity: .45; }
/* B14: "Đang dùng" là nhãn trạng thái (viên thuốc xanh), không phải nút to bị tắt */
.cc-chip-dung { justify-self: start; display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(111, 255, 210, .55);
  background: rgba(111, 255, 210, .12); color: var(--xanh); font-weight: 800; font-size: var(--chu-nd, 14px); }

/* túi đồ: hàng cần câu */
#luoi-tui .cc-tui-nhom { grid-column: 1 / -1; font-size: 11px; letter-spacing: 1.2px; color: var(--chu-mo); font-weight: 700; }
#luoi-tui .cc-tui-nhom span { letter-spacing: 0; font-weight: 400; margin-left: 4px; opacity: .8; }
#luoi-tui .cc-o { width: 54px; height: 54px; }
#luoi-tui .cc-o img { width: 40px; height: 40px; }

/* thanh cầm: ô cần có khung màu phẩm */
.o-cam.cc-cam.p1 { border-color: #6fe27f; } .o-cam.cc-cam.p2 { border-color: #5cb6ff; } .o-cam.cc-cam.p3 { border-color: #c684ff; }
.o-cam.cc-cam.p4 { border-color: #ffd84a; } .o-cam.cc-cam.p5 { border-color: #ff6a5a; }
.o-cam.cc-cam.p4, .o-cam.cc-cam.p5 { background: radial-gradient(circle at 50% 60%, rgba(255, 200, 90, .22), var(--nen) 70%); }

/* cửa hàng: dòng chỉ số cần */
.mon-ch .cc-ch { grid-column: span 2; font-size: 11px; color: var(--chu-mo); line-height: 1.3; }
.mon-ch .cc-ch b { color: var(--vang); }

@media (max-width: 620px), (max-height: 500px) {
  .than-cc { flex-direction: column; gap: 8px; overflow-y: auto; }
  #cc-ds, #cc-ct { max-height: none; overflow: visible; }
  #cc-ct { width: auto; border-left: 0; border-top: 1px solid var(--vien-mo); padding: 8px 0 0; }
  .cc-luoi { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); justify-items: center; }
  .cc-nut { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .cc-nut button { min-height: 44px; }
}
/* ===== kho_chua.css ===== */
/* Rương chứa đồ + hầm tàu (trinh_khach/src/kho_chua_ui.ts): bảng hai cột TÚI ↔ KHO theo khung bảng thống nhất (.bang.lon) */
#bang-kho { width: min(820px, calc(100vw - 20px)); }
#bang-kho > .tieu-de > span { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 auto; }
#bang-kho > .tieu-de small { color: var(--chu-mo); font-weight: 600; letter-spacing: 0; text-shadow: none; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-chu { min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 180, 84, .5); background: rgba(255, 180, 84, .1); color: var(--cam);
  font-weight: 700; font-size: 12.5px; letter-spacing: 0; flex: 0 0 auto; margin-right: 2px; }
.kc-chu:disabled { opacity: 1; background: #142f42; border-color: #466c84; color: #b7d5e4; }

.than-kho { display: flex; gap: 8px; padding: 0 10px 10px; min-height: 0; flex: 1 1 auto; }
.kc-cot { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--vien-mo); border-radius: 9px; background: rgba(79, 227, 255, .03); }
.kc-cot[data-ben="kho"] { border-color: rgba(255, 216, 74, .4); background: rgba(255, 216, 74, .03); }
.kc-dau { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; min-height: 54px; border-bottom: 1px solid var(--vien-mo); }
.kc-nhan { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: var(--vien); white-space: nowrap; }
.kc-cot[data-ben="kho"] .kc-nhan { color: var(--vang); }
.kc-nhan b { margin-left: 4px; padding: 2px 7px; border-radius: 99px; background: rgba(79, 227, 255, .14); color: var(--chu); letter-spacing: 0; font-size: 12px; }
.kc-nhan b.day { background: rgba(255, 106, 106, .22); color: #ffb0b0; }
.kc-dau button { flex: 0 0 auto; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .15); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.kc-dau button:disabled { opacity: 1; background: #142f42; border-color: #466c84; color: #b7d5e4; }
.kc-dau button:active:not(:disabled), #kc-che-do button:active { transform: translateY(1px); }

.kc-luoi { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 5px; align-content: start; justify-items: center; padding: 7px; max-height: calc(var(--cao, 100vh) * 0.52); }
.kc-o { width: 50px; height: 50px; }
/* B07: dòng trạng thái "tên món ×số" (chỉ cảm ứng; PC có chú thích khi rê chuột) */
#kc-trang-thai { display: none; }
body.cam-ung #kc-trang-thai { display: block; flex: 1 1 100%; min-width: 0; min-height: 20px; font-size: var(--chu-phu, 12px); font-weight: 700; line-height: 20px; color: var(--vang); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.cam-ung #kc-trang-thai:empty::before { content: attr(data-md); color: var(--chu-mo); font-weight: 600; }
.kc-o img { width: 36px; height: 36px; }
i.kc-o.trong { display: block; border-radius: 8px; border: 1px dashed rgba(79, 227, 255, .18); background: rgba(79, 227, 255, .025); }
.kc-o.qua { border-color: var(--do); background: rgba(255, 106, 106, .12); }
.kc-o[data-v]:active { transform: scale(.94); }

/* dải giữa: chọn cách chuyển */
#kc-che-do { flex: 0 0 84px; display: flex; flex-direction: column; gap: 5px; align-items: stretch; justify-content: flex-start; }
.kc-cd-nhan { font-size: 10.5px; color: var(--chu-mo); text-align: center; letter-spacing: .3px; line-height: 1.1; }
#kc-che-do button { min-height: 44px; padding: 2px 4px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .07); font-weight: 700; font-size: 12px; line-height: 1.15; }
#kc-che-do button.chon { border-color: var(--xanh); background: rgba(111, 255, 210, .18); color: var(--xanh); box-shadow: 0 0 8px rgba(111, 255, 210, .35); }
#kc-che-do button.kc-phu { color: var(--chu-mo); margin-top: auto; }
#kc-so { width: 100%; min-height: 44px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(4, 14, 26, .8); color: var(--chu); text-align: center; font: 700 16px system-ui, sans-serif; padding: 0 2px;
  -moz-appearance: textfield; appearance: textfield; }
#kc-so::-webkit-outer-spin-button, #kc-so::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* nút Túi trên HUD: báo đầy */
#nut-tui.kc-day { border-color: var(--do); box-shadow: 0 0 10px rgba(255, 106, 106, .6); }
/* nhãn ĐẦY / QUÁ TẢI nằm gọn trong nút (trước tràn ngang ra ngoài, đè nút bên cạnh) */
.kc-nhan-day { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); max-width: calc(100% - 4px); overflow: hidden; text-overflow: clip;
  font-size: 8px; line-height: 11px; font-weight: 900; letter-spacing: 0; padding: 0 3px; border-radius: var(--bo-vien, 999px);
  background: var(--do); color: #2a0606; white-space: nowrap; pointer-events: none; }
#nut-tui.kc-nhay { animation: kcNhay .55s ease-out; }
@keyframes kcNhay { 0%, 40%, 80% { transform: translateX(-4px) scale(1.12); } 20%, 60% { transform: translateX(4px) scale(1.12); } 100% { transform: none; } }
.tieu-de small.kc-dem { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: rgba(79, 227, 255, .14); color: var(--chu); font-weight: 700; letter-spacing: 0; text-shadow: none; font-size: 12px; }
.tieu-de small.kc-dem.day { background: rgba(255, 106, 106, .22); color: #ffb0b0; }
#kc-goi-tui { margin: 0 10px 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 106, 106, .5); background: rgba(255, 106, 106, .1); color: #ffc9c9; font-size: 12.5px; flex: 0 0 auto; }

/* bảng Chế tạo / Thuyền: số có tính cả rương */
/* chữ nhỏ "kho" cạnh số = có tính cả đồ trong rương / hầm (trước là ký hiệu ▣ khó hiểu) */
.kc-r { font-style: normal; font-size: 9.5px; font-weight: 700; line-height: 1; color: var(--vang); margin-left: 3px; padding: 1px 3px; border-radius: 4px;
  border: 1px solid rgba(255, 216, 74, .45); vertical-align: 1px; }
.kc-ghi-che { font-size: 12px; color: var(--chu-mo); padding: 0 2px 2px; }
.kc-ghi-che b { color: var(--vang); }

/* thẻ Hầm tàu trong bảng Thuyền */
.kc-the-ham { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 8px; padding: 8px; border-radius: 9px;
  border: 1px solid rgba(255, 216, 74, .45); background: rgba(255, 216, 74, .06); }
.kc-the-ham img { width: 44px; height: 44px; image-rendering: pixelated; }
.kc-the-ham b { display: block; font-size: 14px; }
.kc-the-ham span { font-size: 12px; color: var(--chu-mo); }
.kc-the-ham button { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--vang); background: rgba(255, 216, 74, .16); color: var(--vang); font-weight: 800; white-space: nowrap; }

/* ---------- điện thoại ngang / màn thấp: phủ gần hết màn, hai cột cuộn riêng ---------- */
@media (max-width: 620px), (max-height: 500px) {
  .bang.lon#bang-kho { width: auto; height: auto; }
  .kc-luoi { max-height: none; }
}
@media (max-height: 500px) and (min-width: 621px) {
  .than-kho { padding: 0 8px 8px; gap: 6px; }
  .kc-dau { min-height: 50px; padding: 3px 5px 3px 9px; }
  #kc-che-do { flex-basis: 78px; gap: 4px; }
  body.cam-ung #kc-trang-thai { white-space: normal; line-height: 14px; min-height: 28px; text-align: center; }
  .kc-cd-nhan { display: none; }
  #bang-kho > .tieu-de small { font-size: 11.5px; }
}
/* ---------- điện thoại dọc: túi trên, dải chọn nằm ngang, kho dưới ---------- */
@media (max-width: 620px) {
  /* B07: chỉ MỘT vùng cuộn (thân bảng); hai lưới ô không cuộn riêng nữa (không còn cuộn lồng nhau) */
  .than-kho { flex-direction: column; gap: 6px; padding: 0 8px 8px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
  .kc-cot { flex: 0 0 auto; }
  .kc-luoi { overflow: visible; flex: 0 0 auto; }
  /* hàng chọn cách chuyển: cho xuống dòng (nút "Xếp: loại" không bị bóp) */
  #kc-che-do { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 5px; }
  #kc-che-do button { flex: 1 1 auto; min-width: 72px; }
  #kc-che-do button.kc-phu { margin-top: 0; }
  .kc-cd-nhan { display: none; }
  #kc-so { flex: 0 0 64px; width: 64px; }
  #bang-kho > .tieu-de small { display: none; }
  .kc-dau button { padding: 0 8px; font-size: 12px; }
}
/* ---------- máy tính / màn cao: bảng nằm nửa dưới để còn thấy rương bật nắp phía trên ---------- */
@media (min-width: 621px) and (min-height: 641px) {
  .bang.lon#bang-kho { top: auto; bottom: calc(92px + var(--day)); transform: translateX(-50%); }
  .kc-luoi { max-height: calc(var(--cao, 100vh) * 0.3); }
}

/* GIỮ LẠI TRONG TÚI: nút bật chế độ tích, ô tích / ổ khoá ở góc ô, dòng ghi chú */
#kc-giu-hang { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--vien-mo); }
#kc-giu-hang .kc-giu { flex: 0 0 auto; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 216, 74, .55); background: rgba(255, 216, 74, .1); color: var(--vang); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
#kc-giu-hang .kc-giu.chon { background: linear-gradient(#2d8a5e, #1b5e40); border-color: var(--xanh); color: #fff; }
#kc-giu-ghi { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.25; color: var(--vang); }
#kc-giu-ghi:empty { display: none; }
.kc-o { position: relative; }
.kc-khoa { position: absolute; top: 1px; left: 2px; font-style: normal; font-size: 12px; line-height: 14px; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)); }
.kc-tich { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; box-sizing: border-box; border-radius: 5px; border: 2px solid var(--chu-mo); background: rgba(4, 14, 26, .85);
  font-style: normal; font-size: 13px; line-height: 14px; font-weight: 900; text-align: center; color: #06251a; pointer-events: none; }
.kc-tich.co { border-color: var(--xanh); background: var(--xanh); }
.che-do-giu .kc-cot[data-ben="tui"] .kc-o[data-v] { cursor: pointer; }
.che-do-giu .kc-cot[data-ben="tui"] .kc-o.giu { border-color: var(--xanh); box-shadow: 0 0 0 1px var(--xanh); }
.che-do-giu .kc-cot[data-ben="kho"] .kc-luoi, .che-do-giu #kc-che-do { opacity: .45; pointer-events: none; }
/* ===== dao_nha.css ===== */
/* Đảo nhà: bảng, nút ngữ cảnh, chip chỉ đường về nhà (trinh_khach/src/dao_nha_ui.ts) */

/* ---- nút ngữ cảnh: máy tính = hàng nút giữa dưới; cảm ứng = hud.ts xếp lên vòng cung (class nut-vong) ---- */
#dn-thanh { position: fixed; left: 50%; bottom: calc(158px + var(--day, 0px)); transform: translateX(-50%); display: flex; gap: 8px; z-index: var(--z-duoi-hud); pointer-events: none; }
#dn-thanh .dn-nut { pointer-events: auto; min-width: 96px; min-height: 44px; padding: 8px 14px; border-radius: 10px; background: var(--nen); border: 1.5px solid var(--vien);
  color: var(--chu); font-weight: 800; font-size: 14px; box-shadow: 0 0 10px rgba(79, 227, 255, .35), 0 3px 8px rgba(0, 0, 0, .4); cursor: pointer; }
#dn-thanh .dn-nut[hidden] { display: none; }
#dn-thanh .dn-nut:hover { background: rgba(31, 111, 140, .92); }
/* máy tính (hàng nút giữa dưới) giữ màu riêng Ra khơi / Cập bến; cảm ứng = một kiểu viền chung của vòng cung (hoc_avatar_ui.md việc 1) */
body:not(.cam-ung) :is(#dn-nut-ra, #dn-nut-cap) { border-color: #ffd866; color: #ffe9a6; }
body:not(.cam-ung) #dn-nut-xuong { border-color: #9dffb0; }
html body.cam-ung #dn-thanh { inset: 0; left: 0; bottom: 0; transform: none; display: block; z-index: var(--z-duoi-hud); }
html body.cam-ung #dn-thanh .dn-nut { min-width: 0; min-height: 0; width: var(--vc); height: var(--vc); padding: 3px; font-size: 11px; border-radius: 50%; }

/* ---- chip chỉ đường về đảo nhà: dưới bản đồ nhỏ ---- */
#dn-ve { position: absolute; top: calc(11px + var(--tren, 0px) + var(--ban-do, 88px)); right: calc(8px + var(--phai, 0px)); min-width: var(--ban-do, 88px); min-height: 32px; padding: 6px 10px;
  display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: var(--bo-the, 12px); background: var(--nen-chip, rgba(4, 14, 26, .82)); border: 1px solid var(--vien-mo);
  color: var(--chu); font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: auto; cursor: pointer; z-index: 2; }
#dn-ve::before { content: ""; position: absolute; inset: -8px -4px; }
#dn-ve[hidden] { display: none; }
#dn-ve i { display: inline-block; font-style: normal; color: #ffd866; font-size: 14px; line-height: 1; transition: transform .2s linear; }
#dn-ve i[hidden] { display: none; }
#dn-ve.xa { border-color: rgba(255, 216, 102, .6); }
body.dn-bi-danh #dn-ve { border-color: #ff6a6a; animation: dn-nhay .5s infinite alternate; }
@keyframes dn-nhay { to { box-shadow: 0 0 12px #ff6a6a; } }
body.co-dao-thanh #dn-ve { top: calc(47px + var(--tren, 0px) + var(--ban-do, 88px)); }

#dn-chip { display: grid; gap: 2px; margin-top: 2px; padding: 3px 0 0; min-height: 30px; background: none; border: 0; border-top: 1px solid var(--vien-mo); text-align: left; width: 100%; cursor: pointer; }
#dn-chip[hidden] { display: none; }
#dn-chip span { font-size: 11px; font-weight: 800; color: #9dffb0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dn-chip b { height: 6px; border-radius: 4px; background: rgba(0, 0, 0, .5); overflow: hidden; display: block; }
#dn-chip i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1f9a58, #9dffb0); }

/* ---- bảng Đảo nhà ---- */
/* 15/11 đợt 2 (B05): cỡ bảng do lớp .co-lon .cao-dinh (dao_nha_ui.ts) — bỏ khoá rộng 720 riêng; đổi thẻ bảng không nhảy */
#bang-dn[hidden] { display: none; }
#than-dn { overflow-y: auto; padding: 8px 10px 12px; display: grid; gap: 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.dn-the { padding: 9px 11px; border-radius: 9px; background: rgba(79, 227, 255, .06); border: 1px solid var(--vien-mo); }
.dn-the.noi { border-color: #9dffb0; background: rgba(60, 200, 120, .1); }
.dn-the h3 { margin: 0 0 2px; font-size: 17px; color: #ffe9a6; }
.dn-the h3 small { font-size: 12px; color: var(--chu-mo); font-weight: 600; }
.dn-the h4 { margin: 0 0 4px; font-size: 14px; color: var(--vien); }
.dn-the p { margin: 0 0 6px; font-size: 13px; line-height: 1.4; color: var(--chu); }
.dn-dau { display: flex; gap: 11px; align-items: center; }
.dn-hinh { position: relative; flex: 0 0 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 50% 62%, #f0dfa8 0 38%, #57d8d0 39% 52%, #1b6f8f 53%); border: 2px solid var(--vien);
  box-shadow: inset 0 0 10px rgba(2, 10, 20, .6); }
.dn-hinh i { position: absolute; left: 50%; top: 22%; width: 6px; height: 26px; margin-left: -3px; background: #8a5a34; border-radius: 3px; box-shadow: -9px -3px 0 3px #4fae5a, 9px -3px 0 3px #4fae5a, 0 -8px 0 4px #63c06c; }
.dn-hinh b { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; background: #ffd866; color: #3a2a06; font-size: 14px; display: flex; align-items: center; justify-content: center; border: 2px solid #7a5b10; }
.dn-so { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--chu-mo); }
.dn-so b { color: var(--chu); }
/* B13: ô nguyên liệu đều nhau (lưới), số 13 px + tên 11 px dưới số */
.dn-cans { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 4px 0 6px; }
.dn-can { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 6px; align-items: center; min-width: 0; padding: 3px 8px 3px 4px; border-radius: var(--bo-nho); background: rgba(255, 106, 106, .12); border: 1px solid rgba(255, 106, 106, .5); font-size: 12px; }
.dn-can img { grid-row: 1 / 3; }
.dn-can b, .dn-can small { grid-column: 2; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-can.du { background: rgba(60, 200, 120, .12); border-color: rgba(120, 230, 160, .55); }
.dn-can img { width: 24px; height: 24px; image-rendering: pixelated; }
.dn-can b { font-size: 13px; }
.dn-can small { color: var(--chu-mo); font-size: 11px; line-height: 1.2; }
.dn-dk { font-size: 12.5px !important; color: #9dffb0 !important; }
.dn-dk.thieu { color: #ff9a9a !important; }
.dn-hang { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.dn-gio { margin-right: auto; font-size: 13px; color: var(--chu-mo); }
.dn-hang button { min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .1); color: var(--chu); font-weight: 800; font-size: 13.5px; cursor: pointer; }
.dn-hang button.chinh { border-color: var(--vien); background: linear-gradient(#1f6f8c, #134a63); }
.dn-hang button:disabled { opacity: .45; cursor: default; }
/* chỉ dẫn thỏi sắt / lam tinh (dao_nha_ui.ts chiDanThoi): hàng nút công thức dồn trái, hai nút ngang nhau */
.dn-hang.dn-chi { align-items: stretch; justify-content: flex-start; margin: 6px 0 2px; }
.dn-hang.dn-chi button { flex: 1 1 140px; }
.dn-thanh { position: relative; height: 22px; border-radius: 11px; background: rgba(0, 0, 0, .5); overflow: hidden; margin: 4px 0 8px; }
.dn-thanh i { display: block; height: 100%; background: linear-gradient(90deg, #1f9a58, #9dffb0); }
.dn-thanh b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12.5px; text-shadow: 0 1px 2px #000; }
.dn-cts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; margin-bottom: 6px; }
.dn-ct { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 8px; background: rgba(4, 14, 26, .45); }
.dn-ct img { width: 40px; height: 40px; image-rendering: pixelated; flex: 0 0 auto; }
.dn-ct b { font-size: 13px; }
.dn-ct small { color: #9dffb0; }
.dn-ct p { font-size: 12px; color: var(--chu-mo); margin: 2px 0 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
/* B04: mỗi công trình 1 dòng mô tả, chạm để xem hết */
.dn-ct { cursor: pointer; min-width: 0; }
.dn-ct > div { min-width: 0; flex: 1 1 auto; }
.dn-ct.mo p { display: block; -webkit-line-clamp: unset; overflow: visible; }
.dn-ct small { font-size: 12px; }
.dn-ct.khoa { opacity: .6; }
.dn-ct.khoa small { color: #ffb0a0; }
.dn-ghi { font-size: 12px !important; color: var(--chu-mo) !important; margin: 0 !important; line-height: 1.4; }

@media (max-width: 900px), (max-height: 500px) {
  .dn-hinh { flex-basis: 56px; height: 56px; }
  .dn-the { padding: 7px 9px; }
  .dn-cts { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

/* ---------- ghé thăm đảo (dao_nha_ui.ts) ---------- */
#tham-thanh { position: fixed; left: calc(50% + 46px); transform: translateX(-50%); top: calc(var(--tren) + 46px * var(--hud)); z-index: 30; display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px; border-radius: 99px; background: rgba(4, 14, 26, .82); border: 1px solid var(--vang); box-shadow: 0 0 10px rgba(255, 216, 74, .3); max-width: calc(100vw - 16px); }
#tham-thanh[hidden] { display: none; }
#tham-ten { font-size: 13px; font-weight: 800; color: #ffe9a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
#tham-thanh button { min-height: 40px; min-width: 44px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .1); font-weight: 700; font-size: 13px; white-space: nowrap; }
#tham-thanh button.chinh { border-color: var(--vien); background: linear-gradient(#1f6f8c, #134a63); }
#tham-thanh button:disabled { opacity: .5; }
#dn-nut-tham.mo { opacity: .7; }
body.dang-tham #nut-chinh, body.dang-tham #thanh-cam { opacity: .35; pointer-events: none; }
.th-cua { display: flex; gap: 6px; margin: 6px 0; }
.th-cua button { flex: 1; min-height: 40px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06); color: var(--chu-mo); }
.th-cua button.chon { color: var(--chu); background: rgba(79, 227, 255, .2); border-color: var(--vien); }
.th-but { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.th-dong { display: flex; align-items: baseline; gap: 6px; padding: 6px 8px; border-radius: 7px; background: rgba(0, 0, 0, .25); font-size: 13px; }
.th-dong b { color: #ffe9a6; flex: 0 0 auto; }
.th-dong span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.th-dong small { color: var(--chu-mo); flex: 0 0 auto; }
.th-dong button { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 6px; border: 1px solid rgba(255, 106, 106, .4); background: rgba(255, 106, 106, .1); color: var(--do); }
.th-moi { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--do); color: #fff; vertical-align: middle; }
.th-dong b.th-ten { cursor: pointer; text-decoration: underline dotted rgba(255, 233, 166, .5); }

/* buổi 9: Đảo nhà từ 621 px: thẻ đầu (cấp đảo) trải hết bề ngang, các thẻ còn lại chia 2 cột (thuyền + công trình bên trái, nâng cấp / giữ đảo bên phải) */
@media (min-width: 621px) {
  #bang-dn #than-dn { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }   /* #bang-dn: thắng luật 1 cột ở phong_thu.css */
  #bang-dn #than-dn > :first-child { grid-column: 1 / -1; }
}

/* ---- Tiệc đảo chia món (trinh_khach/src/tiec_dao_ui.ts) ---- */
.tiec-mons { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.tiec-mon { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 3px; border-radius: 12px; background: rgba(255, 233, 166, .1); font-weight: 700; font-size: 13px; }
.tiec-mon img { width: 22px; height: 22px; }
#tiec-chon .tiec-ds { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
#tiec-chon .tiec-dong { display: flex; align-items: center; gap: 6px; }
#tiec-chon .tiec-dong img { width: 32px; height: 32px; flex: none; }
#tiec-chon .tiec-ten { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
#tiec-chon .tiec-ten b, #tiec-chon .tiec-ten small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tiec-chon .tiec-ten small { color: var(--chu-mo); font-size: 11px; }
#tiec-chon .tiec-dong button { width: 44px; height: 44px; flex: none; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-size: 20px; font-weight: 700; }
#tiec-chon .tiec-so { width: 24px; text-align: center; }
#tiec-moi { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 64px); left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); box-sizing: border-box; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--nen-dam, rgba(8, 24, 36, .94)); border: 1px solid var(--vien, #4fe3ff);
  color: var(--chu, #e8f6ff); font-size: 13px; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
#tiec-moi span { flex: 1; min-width: 0; }
#tiec-moi button { min-height: 44px; min-width: 44px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-weight: 700; }
#tiec-moi button.chinh { padding: 0 14px; border-color: var(--vien); background: linear-gradient(#1f6f8c, #134a63); }

/* ---- Bể cá khoe (be_ca.ts): danh sách cá trong bể + nút thả theo loài trong thẻ món trang trí / thẻ khách ---- */
#ds-menu .be-ca { margin-top: 6px; }
#ds-menu .be-dong { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--vien-mo); }
#ds-menu .be-dong img { width: 26px; height: 26px; image-rendering: pixelated; flex: none; }
#ds-menu .be-ten { flex: 1; min-width: 0; line-height: 1.2; }
#ds-menu .be-ten small { display: block; opacity: .75; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ds-menu .be-dong button, #ds-menu .be-tha button { min-height: 36px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); padding: 0 10px; }
#ds-menu .be-tha { display: flex; flex-wrap: wrap; gap: 5px; }
#ds-menu .be-tha button { display: inline-flex; align-items: center; gap: 4px; }
#ds-menu .be-tha img { width: 22px; height: 22px; image-rendering: pixelated; }

/* ---- Pháo hiệu (be_ca.ts): một dòng nổi trên cùng màn hình của mọi người, 8 giây ---- */
#dai-phao { position: fixed; left: 50%; top: calc(6px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -140%); z-index: var(--z-hud-noi, 14); pointer-events: none;
  max-width: min(92vw, 620px); display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; opacity: 0;
  background: linear-gradient(90deg, rgba(120, 22, 18, .92), rgba(176, 52, 26, .92)); border: 1px solid #ffcf6a; color: #fff6dc;
  box-shadow: 0 0 18px rgba(255, 140, 60, .55); font-size: 14px; line-height: 1.25; transition: transform .35s ease, opacity .35s ease; }
#dai-phao.hien { transform: translate(-50%, 0); opacity: 1; }
#dai-phao b { color: #ffd84a; white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; flex: none; }
#dai-phao .dp-nd { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dai-phao .dp-sao { flex: none; }
@media (prefers-reduced-motion: reduce) { #dai-phao { transition: opacity .2s; } }
/* ===== phong_thu.css ===== */
/* Phòng thủ đảo nhà: tab trong bảng Đảo nhà, thanh đợt tấn công, báo cáo trận, chọn chốt gác (phong_thu_ui.ts). Theo khung bảng chung. */

/* ---- tab + thân bảng ---- */
#bang-dn .ph-tab { padding: 0 10px 6px; }
#bang-dn .ph-tab button { position: relative; }
#bang-dn .ph-tab .cham { position: absolute; top: 3px; right: 6px; }
#than-ph { overflow-y: auto; padding: 8px 10px 12px; display: grid; gap: 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; min-height: 0; }
#than-ph[hidden], #than-dn[hidden] { display: none; }
/* cột lưới khoá theo bề ngang bảng: lưới auto-fill các loại công trình (.ph-loai) nằm trong cột 'auto' thì Safari điện thoại nở cột theo cả hàng → tràn phải, phải vuốt ngang (người chơi báo 14/11) */
#than-ph, #than-dn { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
#than-ph > *, #than-dn > *, .ph-loai > *, .ph-ds > * { min-width: 0; max-width: 100%; }
#than-ph .dn-so { margin-top: 4px; }
#than-ph .dn-hang { margin-top: 4px; }
.ph-tinh h4 { color: #ffe9a6; }

/* ---- danh sách công trình / lính ---- */
.ph-ds { display: grid; gap: 5px; margin: 4px 0 8px; }
.ph-ct { border-radius: 8px; background: rgba(4, 14, 26, .5); border: 1px solid transparent; }
.ph-ct.mo { border-color: var(--vien-mo); background: rgba(4, 14, 26, .72); }
.ph-ct.sap .ph-dau img, .ph-ct.sap .ph-hinh { filter: grayscale(1) brightness(.7); }
.ph-dau { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 4px 8px; background: none; border: 0; color: var(--chu); text-align: left; cursor: pointer; font: inherit; }
.ph-dau img { width: 36px; height: 36px; image-rendering: pixelated; flex: 0 0 auto; }
.ph-dau > span:nth-child(2) { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.ph-dau small { display: block; font-size: 11.5px; color: var(--chu-mo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-hinh { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; font-size: 22px; border-radius: 8px; background: rgba(79, 227, 255, .1); }
.ph-bac { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 6px; font-style: normal; font-size: 11px; font-weight: 800; text-align: center; background: rgba(160, 170, 180, .25); color: #d8e2ea; }
.ph-bac.b2 { background: rgba(79, 168, 224, .35); color: #bfe4ff; }
.ph-bac.b3 { background: rgba(255, 216, 74, .3); color: #ffe9a6; }
.ph-mau { position: relative; flex: 0 0 86px; height: 16px; border-radius: 8px; background: rgba(0, 0, 0, .55); overflow: hidden; }
.ph-mau i { display: block; height: 100%; background: linear-gradient(90deg, #1f9a58, #7ee29a); }
.ph-mau.hong i { background: linear-gradient(90deg, #b8442a, #ff9a6a); }
.ph-mau em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.ph-chi-tiet { padding: 2px 8px 8px; }
/* lính: ô vũ khí bên phải dòng (biểu tượng + tên), bấm mở danh sách vũ khí trong túi */
.ph-ct.ph-linh { display: flex; flex-wrap: wrap; align-items: center; }
.ph-linh > .ph-dau { flex: 1 1 0; width: auto; min-width: 0; }
.ph-linh > .ph-chi-tiet, .ph-linh > .ph-vk-chon { flex: 1 0 100%; }
.ph-vk { flex: 0 0 auto; display: grid; justify-items: center; gap: 1px; width: 64px; min-height: 48px; margin: 3px 6px 3px 0; padding: 3px 2px; border-radius: 7px;
  border: 1px dashed rgba(170, 210, 240, .35); background: rgba(255, 255, 255, .04); color: var(--chu); font: inherit; cursor: pointer; }
.ph-vk.giao { border-style: solid; border-color: #e2b84a; background: rgba(226, 184, 74, .1); }
.ph-vk img { width: 26px; height: 26px; image-rendering: pixelated; }
.ph-vk span { max-width: 60px; font-size: 10.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-vk small { font-size: 9.5px; color: var(--chu-mo); line-height: 1; }
.ph-vk-chon { padding: 2px 8px 8px; }
.ph-vk-ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 5px; margin: 4px 0; }
.ph-vk-ds button { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; min-height: 44px; padding: 4px 6px;
  border-radius: 7px; border: 1px solid rgba(170, 210, 240, .3); background: rgba(255, 255, 255, .05); color: var(--chu); font: inherit; text-align: left; cursor: pointer; }
.ph-vk-ds button:disabled { opacity: .45; cursor: default; }
.ph-vk-ds img { grid-row: 1 / 3; width: 28px; height: 28px; image-rendering: pixelated; }
.ph-vk-ds b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-vk-ds small { font-size: 10.5px; color: var(--chu-mo); }
.ph-sua-het { padding: 6px 8px; border-radius: 8px; background: rgba(255, 150, 90, .12); border: 1px solid rgba(255, 150, 90, .45); margin-bottom: 6px; }

/* loại đặt được */
.ph-loai { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(104px, 100%), 1fr)); gap: 5px; margin: 6px 0; }
.ph-o { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 4px 5px; border-radius: 8px; background: rgba(4, 14, 26, .45); text-align: center; }
.ph-o img { width: 36px; height: 36px; image-rendering: pixelated; }
.ph-o b { font-size: 12px; line-height: 1.15; }
.ph-o small { font-size: 11.5px; color: #9dffb0; }
.ph-o em { font-style: normal; font-size: 11px; color: #ffe9a6; }
.ph-o.khoa { opacity: .55; }
.ph-o.khoa small { color: #ffb0a0; }

/* kho đạn, trại lính */
.ph-thanh-dan i { background: linear-gradient(90deg, #5a6470, #b8c2cc) !important; }
.ph-thue { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px; margin: 6px 0; }
.ph-the-linh { padding: 7px 9px; border-radius: 8px; background: rgba(4, 14, 26, .5); }
.ph-the-linh b { font-size: 13.5px; }
.ph-the-linh p { font-size: 12px; color: var(--chu-mo); margin: 2px 0 4px; }
.ph-luong { justify-content: flex-start; }
.ph-luong .dn-gio { flex: 1 1 100%; font-size: 12px; }
.ph-luong button { display: inline-flex; align-items: center; gap: 4px; }
.ph-luong button img { width: 22px; height: 22px; image-rendering: pixelated; }
.ph-luong button small { color: var(--chu-mo); font-weight: 600; }
.ph-doi { font-style: normal; color: #ff9a9a; font-weight: 800; }

/* lịch sử + báo cáo */
.ph-ls { display: grid; gap: 5px; }
.ph-bc { padding: 6px 9px; border-radius: 8px; background: rgba(4, 14, 26, .5); border-left: 3px solid var(--vien-mo); }
.ph-bc.thang { border-left-color: #9dffb0; } .ph-bc.mat { border-left-color: #ff6a6a; } .ph-bc.giu { border-left-color: var(--vang); }
.ph-bc-dau { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13.5px; }
.ph-bc-dau small { color: var(--chu-mo); font-size: 11.5px; margin-left: auto; }
.ph-kq { font-style: normal; font-size: 11.5px; font-weight: 800; padding: 0 7px; border-radius: 7px; background: rgba(160, 170, 180, .25); }
.ph-kq.thang { background: rgba(60, 200, 120, .25); color: #9dffb0; } .ph-kq.mat { background: rgba(255, 106, 106, .22); color: #ffb0a0; } .ph-kq.giu { background: rgba(255, 216, 74, .2); color: #ffe9a6; }
.ph-bc-than { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12.5px; color: var(--chu-mo); margin-top: 2px; }
.ph-bc-than b { color: var(--chu); }
.ph-bc-do { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12.5px; }
.ph-bc-do em { font-style: normal; font-weight: 800; font-size: 11.5px; color: #9dffb0; }
.ph-bc-do.mat em { color: #ff9a9a; } .ph-bc-do.hong em { color: #ffb07a; }
.ph-vat { display: inline-flex; align-items: center; gap: 3px; }
.ph-vat img { width: 22px; height: 22px; image-rendering: pixelated; }

#ph-bao-cao { position: fixed; z-index: var(--z-bang); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px - var(--le) - var(--phai)));
  max-height: calc(var(--cao, 100vh) - 20px - var(--tren) - var(--day)); display: flex; flex-direction: column; background: var(--nen-dam); }
#ph-bao-cao[hidden] { display: none; }
#ph-bao-cao .tieu-de { min-height: 44px; padding: 2px 4px 2px 12px; font-size: 13px; }
#ph-bao-cao .tieu-de .nut-x { min-width: 44px; min-height: 44px; font-size: 24px; }
#ph-bao-cao.ph-kq-thang { border-color: #9dffb0; } #ph-bao-cao.ph-kq-thang .ph-bc-tieu { color: #9dffb0; }
#ph-bao-cao.ph-kq-mat { border-color: #ff6a6a; } #ph-bao-cao.ph-kq-mat .ph-bc-tieu { color: #ff9a9a; }
#ph-bao-cao.ph-kq-giu .ph-bc-tieu { color: #ffe9a6; }
#ph-bc-nd { overflow-y: auto; padding: 4px 12px 12px; display: grid; gap: 8px; }
.ph-bc-loi { margin: 0; font-size: 13px; line-height: 1.4; }

/* ---- thanh đợt tấn công: ngay dưới dòng ngày giờ, giữa màn (vùng thông tin, xa ngón cái) ---- */
#ph-thanh { position: fixed; z-index: 8; top: calc(var(--dh-day, 34px) + 5px); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: stretch; max-width: calc(100vw - 2 * var(--ban-do, 88px) - 40px); }
#ph-thanh[hidden] { display: none; }
#ph-thanh-nd { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 12px; border-radius: 16px; background: rgba(60, 12, 12, .88); border: 1.5px solid #ff6a6a; color: #ffe1d6; font: inherit; font-size: 12.5px; cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 90, 90, .45); position: relative; white-space: nowrap; min-width: 0; }
#ph-thanh-nd::after { content: ""; position: absolute; inset: -8px -4px; } /* vùng bấm ≥ 44px */
#ph-thanh-ten { overflow: hidden; text-overflow: ellipsis; }
#ph-thanh .ph-vach { flex: 0 0 74px; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .55); overflow: hidden; }
#ph-thanh .ph-vach i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9a3c, #ffe14a); transition: width .3s; }
#ph-thanh-so { font-style: normal; font-weight: 800; color: #fff; }
#ph-thanh.canh-bao #ph-thanh-nd { background: rgba(70, 44, 6, .9); border-color: var(--cam); box-shadow: 0 0 12px rgba(255, 180, 84, .5); animation: ph-nhay 1s infinite alternate; }
#ph-thanh.canh-bao .ph-vach { display: none; }
#ph-thanh-bo { min-height: 44px; margin: -7px 0; padding: 4px 10px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .35); background: rgba(20, 24, 30, .82); color: #e8eef4; font-weight: 700; font-size: 12px; white-space: nowrap; }
#ph-thanh-ve { min-height: 44px; margin: -7px 0; padding: 4px 12px; border-radius: 12px; border: 1.5px solid var(--vien); background: linear-gradient(#1f6f8c, #134a63); color: var(--chu); font: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
#ph-thanh-ve[hidden] { display: none; }
@keyframes ph-nhay { from { filter: brightness(1); } to { filter: brightness(1.35); } }
body.ph-co-thanh #thong-bao { top: calc(var(--dh-day, 34px) + 46px); }
body.ph-dang-danh::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: var(--z-canh); box-shadow: inset 0 0 46px rgba(255, 70, 50, .28); animation: ph-nhay 1.2s infinite alternate; }

#ph-chot { position: fixed; z-index: 9; left: 50%; top: calc(var(--dh-day, 34px) + 44px); transform: translateX(-50%); min-height: 44px; padding: 6px 16px; border-radius: 12px; border: 1.5px solid var(--vien);
  background: var(--nen-dam); color: var(--chu); font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; box-shadow: var(--phat); }
#ph-chot[hidden] { display: none; }

@media (max-width: 900px), (max-height: 500px) {
  .ph-loai { grid-template-columns: repeat(auto-fill, minmax(min(92px, 100%), 1fr)); }
  .ph-mau { flex-basis: 72px; }
  #ph-thanh-nd { font-size: 12px; padding: 3px 10px; gap: 6px; }
  #ph-thanh .ph-vach { flex-basis: 54px; }
}
@media (max-width: 620px) {
  #ph-thanh { max-width: calc(100vw - 16px); top: calc(var(--tren-cao, 60px) + 4px); }
  .ph-dau small { white-space: normal; }
}

/* buổi 9: điện thoại ngang: dải "Toán cướp biển còn…" nằm giữa hàng trên, đè Menu / Chat / thanh chỉ số → xuống dưới hàng trên như điện thoại dọc */
@media (max-height: 500px) { #ph-thanh { top: calc(var(--tren-cao, 56px) + 4px); max-width: calc(100vw - 2 * var(--mep, 8px) - var(--le) - var(--phai)); } }

/* buổi 10 (việc 7): điện thoại ngang — toast cảnh báo không đè dải trận / nút Bỏ trận ở mép trên: hạ xuống phía trên thanh cầm, hẹp lại tránh cụm nút phải + cần trái */
@media (orientation: landscape) and (max-height: 500px) {
  html body.cam-ung.ph-co-thanh #thong-bao { top: auto; bottom: calc(var(--day, 0px) + 78px); left: 50%; transform: translateX(-50%); width: min(380px, calc(100vw - 320px)); min-width: 0; align-items: center; }
}
/* ===== so_tay.css ===== */
/* Sổ tay đi biển (trinh_khach/src/so_ca_ui.ts, thanh_tuu_ui.ts, chai_thu_ui.ts): sổ cá · thành tựu + danh hiệu · chai thư.
   Theo khung bảng thống nhất (.bang.lon): tiêu đề + nút đóng 44px + tab + thân cuộn; vùng bấm ≥ 44px trên cảm ứng. */
/* (cỡ bảng: lớp co-lon cao-dinh gắn ở so_ca_ui.ts — khung bảng thống nhất) */
.tab-st { display: flex; gap: 6px; padding: 0 10px 8px; flex: 0 0 auto; }
.tab-st button { flex: 1 0 auto; position: relative; min-width: 44px; min-height: var(--cham-pc, 36px); padding: 6px 12px; border-radius: 7px; background: rgba(79, 227, 255, .06); border: 1px solid var(--vien-mo);
  color: var(--chu-mo); font-weight: 700; font-size: var(--chu-td, 13px); white-space: nowrap; }
.tab-st button.chon { color: var(--chu); background: rgba(79, 227, 255, .2); border-color: var(--vien); }
.tab-st .cham { top: -6px; right: -4px; }
/* 13/11: overflow hidden → cuộn dọc. Thẻ Thú cưng / Công thức / Kho báu vẽ thẳng vào đây, dài hơn khung thì trước đây KHÔNG cuộn được
   (góp ý "thú nuôi không lướt xuống cho ăn được"). Thẻ có vùng cuộn riêng bên trong (Sổ cá, Thành tựu, Chai thư) co vừa khung nên không đổi. */
#than-st { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: 0 10px 10px; }
#than-st > :is(.tn-the, .tn-nhan, .tn-chua-ds, .xh-muc, p, .na-dau, .na-mon) { flex-shrink: 0; }
#than-st > .trong { margin: auto; }
#than-st button { font: inherit; color: inherit; }
#than-st button.chinh, .st-nut button { min-height: 40px; padding: 6px 14px; border-radius: 7px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .26); font-weight: 700; white-space: nowrap; }
#than-st button:disabled { opacity: .45; }
#than-st button:active:not(:disabled) { transform: translateY(1px); }

/* danh hiệu: thẻ nhỏ cạnh tên (dùng cả ở bảng Bạn bè, xếp hạng, hồ sơ) */
.dh-the { display: inline-block; vertical-align: middle; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--mau-dh, var(--vien)); color: var(--mau-dh, var(--chu));
  background: rgba(0, 0, 0, .28); font-size: 11px; font-weight: 700; letter-spacing: 0; line-height: 1.45; white-space: nowrap; text-shadow: none; }
.dh-the.p4, .dh-the.p5 { box-shadow: 0 0 6px var(--mau-dh); }
.hs-dh { margin: 2px 0 1px; }
.hs-dh .dh-the { font-size: 12px; margin-left: -1px; }

/* phần thưởng (mốc sổ cá, thành tựu) */
.st-thuong { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; margin-top: 3px; }
.st-diem { color: var(--vang); font-weight: 800; }
.st-vat { display: inline-flex; align-items: center; gap: 2px; color: var(--chu); }
.st-vat img { width: 20px; height: 20px; image-rendering: pixelated; }
.st-nut { margin-top: 10px; display: grid; }

/* ================= sổ cá ================= */
.sc { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-dau { flex: 0 0 auto; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.sc-tien { flex: 1 1 150px; min-width: 130px; font-size: 13px; color: var(--chu-mo); }
.sc-tien b { color: var(--xanh); font-size: 16px; }
.sc-tien .thanh { margin: 3px 0 0; }
.sc-moc-ds { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sc-moc { min-width: 44px; min-height: 36px; padding: 2px 9px; border-radius: 18px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06); font-weight: 800; font-size: 13px; color: var(--chu-mo); }
.sc-moc.da { color: var(--xanh); border-color: rgba(111, 255, 210, .5); }
.sc-moc.duoc { color: #3a2500; border-color: #ffe066; background: linear-gradient(#ffe066, #e0a020); box-shadow: 0 0 10px rgba(255, 216, 74, .6); animation: scNhay 1.2s ease-in-out infinite; }
.sc-moc.chon { outline: 2px solid var(--vien); outline-offset: 1px; }
/* hai bộ sưu tập (buổi 16): Biển quen 29 loài · Khơi lạ 20 loài, mốc riêng */
.sc-bo-ds { flex: 0 0 auto; display: flex; gap: 6px; }
.sc-bo { flex: 1 1 0; min-height: 36px; padding: 2px 10px; border-radius: 18px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06); font-weight: 800; font-size: 13px; color: var(--chu-mo); white-space: nowrap; }
.sc-bo small { font-weight: 600; opacity: .8; }
.sc-bo.chon { color: var(--chu); border-color: var(--vien); background: rgba(79, 227, 255, .18); }
body.cam-ung .sc-bo { min-height: 44px; }
.sc-than { flex: 1 1 auto; min-height: 0; display: flex; gap: 10px; }
.sc-luoi { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; align-content: start; justify-items: center; padding: 3px; }
.sc-chu { grid-column: 1 / -1; justify-self: stretch; padding: 4px 2px 2px; }
.sc-o { width: 56px; height: 56px; padding: 0; position: relative; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .05);
  display: flex; align-items: center; justify-content: center; }
.sc-o img { width: 48px; height: 48px; image-rendering: pixelated; pointer-events: none; }
.sc-o.co { border-color: var(--mau-pham); background: linear-gradient(rgba(255, 255, 255, .04), rgba(0, 0, 0, .18)); }
.sc-o.chua img { filter: brightness(0) invert(1); opacity: .2; }
.sc-o.chua { border-style: dashed; }
.sc-o.dang { box-shadow: 0 0 0 1px var(--xanh), 0 0 9px rgba(111, 255, 210, .7); animation: scNhay 1.6s ease-in-out infinite; }
.sc-o.chon { outline: 2px solid var(--vien); outline-offset: 1px; background: rgba(79, 227, 255, .2); }
.sc-so { position: absolute; right: 3px; bottom: 0; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.sc-hoi { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; color: var(--mau-pham); text-shadow: 0 0 4px #000, 0 0 2px #000; }
@keyframes scNhay { 50% { filter: brightness(1.25); } }
.sc-ct { flex: 0 0 258px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; border-left: 1px solid var(--vien-mo); padding: 2px 2px 4px 10px; font-size: 13px; }
.sc-ct-dau { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.sc-anh { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 12px; border: 1px solid var(--mau-pham, var(--vien-mo)); background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .12), rgba(0, 0, 0, .25));
  display: flex; align-items: center; justify-content: center; }
.sc-anh img { width: 64px; height: 64px; image-rendering: pixelated; }
.sc-anh.chua img { filter: brightness(0) invert(1); opacity: .22; }
.sc-anh.chua { border-style: dashed; }
.sc-moc-so { font-size: 28px; color: var(--vang); text-shadow: 0 0 10px rgba(255, 216, 74, .6); }
.sc-ten { font-size: 17px; font-weight: 900; line-height: 1.15; text-shadow: 0 0 8px rgba(0, 0, 0, .5); }
.sc-so-lieu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.sc-so-lieu > div { border: 1px solid var(--vien-mo); border-radius: 8px; padding: 4px 7px; background: rgba(79, 227, 255, .04); min-width: 0; }
.sc-so-lieu span { display: block; font-size: 11px; color: var(--chu-mo); }
.sc-so-lieu b { font-size: 15px; color: var(--vang); }
.sc-so-lieu small { display: block; font-size: 11px; color: var(--chu-mo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-dang-co { color: var(--xanh); font-weight: 700; font-size: 12px; margin: 2px 0 5px; }
.sc-mota { color: var(--chu-mo); font-size: 12.5px; margin-bottom: 4px; font-style: italic; }
.sc-muc { font-size: 11px; letter-spacing: 1px; color: var(--vien); font-weight: 700; margin: 7px 0 3px; }
.sc-gy { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr); gap: 6px 10px; font-size: 13px; padding: 2px 0; }
.sc-gy span { color: var(--chu-mo); white-space: nowrap; }   /* C10: "Gần nhà" không còn rớt 2 dòng */
.sc-gy b { font-weight: 600; }
.sc-vat { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: -4px; }
.sc-ghi { margin-top: 8px; }

/* ================= thành tựu ================= */
.ttu, .ct { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.ttu-dh { border: 1px solid rgba(255, 216, 74, .4); border-radius: 9px; padding: 5px 8px; background: rgba(255, 216, 74, .05); }
.ttu-dh-dau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 34px; }
.ttu-dh-dau .ttu-doi { min-height: 36px; padding: 4px 12px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .12); font-weight: 700; }
.ttu-phai { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--chu-mo); }
.ttu-dat b { color: var(--xanh); font-size: 16px; }
.ttu-dh-dau > .dh-the { font-size: 13px; padding: 2px 10px; }
.ttu-dh-ds { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ttu-dh-o { min-height: 40px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .05); font-size: 12px; color: var(--chu-mo); }
.ttu-dh-o.chon { border-color: var(--xanh); background: rgba(111, 255, 210, .14); }
.ttu-dh-o .dh-the { font-size: 12px; pointer-events: none; }
.ttu-loc, .ct-loc { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 1; background: var(--nen-dam); padding: 8px 0 6px; margin-top: -4px; }
.ttu-loc::-webkit-scrollbar, .ct-loc::-webkit-scrollbar { display: none; }
.ttu-loc button, .ct-loc button { flex: 0 0 auto; position: relative; min-height: 36px; padding: 4px 11px; border-radius: 18px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06);
  color: var(--chu-mo); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.ttu-loc button.chon, .ct-loc button.chon { color: var(--chu); border-color: var(--vang); background: rgba(255, 216, 74, .14); }
.ttu-loc .cham, .ct-loc .cham { top: -5px; right: -3px; }
.ttu-ds { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.ttu-dong { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--vien-mo); border-radius: 9px; padding: 7px 9px; background: rgba(79, 227, 255, .03); }
.ttu-dong.dat { border-color: var(--vang); background: rgba(255, 216, 74, .07); box-shadow: 0 0 10px rgba(255, 216, 74, .18); }
.ttu-dong.da { border-color: rgba(111, 255, 210, .4); opacity: .72; }
.ttu-ten { font-weight: 800; font-size: 14px; }
.ttu-dong .thanh { margin: 4px 0 2px; height: 6px; }
.ttu-nut { min-width: 62px; text-align: center; }
.ttu-tien { font-weight: 800; font-size: 13px; color: var(--chu-mo); }
.ttu-da { font-size: 12px; font-weight: 700; color: var(--xanh); white-space: nowrap; }

/* ================= chai thư ================= */
.ct-loc button { flex: 1 0 auto; }
.ct-ds { display: grid; gap: 7px; }
.ct-the { border: 1px solid var(--vien-mo); border-radius: 10px; padding: 8px 10px; background: rgba(79, 227, 255, .035); }
.ct-the.moi { border-color: var(--vang); box-shadow: 0 0 10px rgba(255, 216, 74, .2); }
.ct-the.he { border-color: rgba(111, 255, 210, .45); background: rgba(111, 255, 210, .05); }
.ct-dau { display: flex; align-items: center; gap: 8px; }
.ct-anh { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 8px; image-rendering: pixelated; background: rgba(79, 227, 255, .1); object-fit: contain; }
.ct-anh.chai { background: none; }
.ct-ai { min-width: 0; }
.ct-ten { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(226, 251, 255, .35); text-underline-offset: 3px; }
.ct-dau em { color: var(--vang); font-style: normal; font-weight: 800; }
.ct-nd { margin: 7px 0; padding: 8px 11px; border-radius: 8px; background: rgba(250, 240, 210, .09); border-left: 3px solid rgba(255, 216, 74, .55); font-size: 14.5px; line-height: 1.4;
  overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.ct-the.he .ct-nd { border-left-color: rgba(111, 255, 210, .6); }
.ct-nut { display: flex; gap: 6px; flex-wrap: wrap; }
.ct-nut button { min-height: 40px; padding: 5px 12px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .1); font-weight: 700; font-size: 13px; white-space: nowrap; }
.ct-nut button.tim { border-color: #ff8fb0; color: #ffc0d2; background: rgba(255, 110, 150, .14); }
.ct-nut button.da-tim:disabled { opacity: 1; color: #ff8fb0; border-color: rgba(255, 143, 176, .45); }
.ct-nut button.bao { margin-left: auto; color: var(--chu-mo); }
.ct-tim-so { color: #ff8fb0; font-weight: 800; }
.ct-tong { padding: 2px 2px 4px; }
.ct-viet { display: grid; gap: 7px; }
#ct-nd { width: 100%; box-sizing: border-box; min-height: 74px; resize: none; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(0, 10, 20, .6); color: var(--chu);
  font: inherit; font-size: 16px; line-height: 1.35; outline: none; -webkit-user-select: text; user-select: text; }
#ct-nd:focus { border-color: var(--vien); }
.ct-hang { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ct-con { flex: 1 1 auto; min-width: 0; }
.ct-the.cua .ct-nd { margin-top: 0; }

/* bảng xếp hạng "Cá kỷ lục" (xa_hoi_ui.ts) */
.kl-ca { width: 34px; height: 34px; image-rendering: pixelated; }

/* cảm ứng: mọi vùng bấm ≥ 44px */
body.cam-ung .tab-st button, body.cam-ung .sc-moc, body.cam-ung .ttu-loc button, body.cam-ung .ct-loc button, body.cam-ung .ct-nut button,
body.cam-ung .ttu-dh-dau .ttu-doi, body.cam-ung .ttu-dh-o, body.cam-ung #than-st button.chinh, body.cam-ung .st-nut button { min-height: 44px; }
body.cam-ung .ttu-nut button { min-width: 62px; }

@media (max-width: 620px), (max-height: 500px) {
  #bang-st { width: auto; height: auto; }
  #than-st { padding: 0 8px 8px; }
  .tab-st { padding: 0 8px 6px; }
}
/* màn ngang thấp (điện thoại 844×390): gọn hàng đầu, cột chi tiết hẹp lại chút */
@media (max-height: 500px) and (min-width: 621px) {
  .sc { gap: 4px; }
  .sc-ct { flex-basis: 250px; }
  .sc-anh { width: 60px; height: 60px; }
  .sc-anh img { width: 52px; height: 52px; }
}
/* màn dọc / hẹp: chi tiết nằm dưới lưới.
   C10: CHỈ MỘT vùng cuộn — thân bảng #than-st. Lưới cá và cột chi tiết không còn cuộn riêng (trước đây 3 vùng lồng nhau). */
@media (max-width: 620px) {
  .sc, .sc-than { flex: 0 0 auto; min-height: auto; }
  .sc-than { flex-direction: column; gap: 6px; }
  .sc-luoi { flex: 0 0 auto; overflow: visible; }
  .sc-ct { flex: 0 0 auto; overflow: visible; border-left: 0; border-top: 1px solid var(--vien-mo); padding: 8px 2px 2px; }
  /* hàng mốc thưởng: nhãn một dòng riêng, 6 mốc chia đều một hàng (mốc "29" không còn rớt xuống hàng 2) */
  .sc-moc-ds { flex: 1 1 100%; gap: 6px; }
  .sc-moc-ds > .nho-mo { flex: 0 0 100%; }
  .sc-moc-ds > .sc-moc { flex: 1 1 44px; min-width: 44px; padding: 2px 4px; }
  .ttu-ds { grid-template-columns: 1fr; }
  .ct-nut button.bao { margin-left: 0; }
}
/* ===== the_ca.css ===== */
/* THẺ CÁ (the_ca_ui.ts, may_chu/the_ca.go): thẻ nhỏ ở mép trên giữa màn khi câu được con đáng nhớ. Không phủ màn, không chạm nút Câu /
   cần điều khiển (hai góc dưới), tự đóng 5 giây (vạch .tc-thoi chạy ngược), chạm vào thẻ = giữ mở. */
#the-ca {
  position: fixed; z-index: 64; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  width: min(300px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 9px 10px 8px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(14, 34, 52, .96), rgba(8, 20, 34, .96));
  border: 2px solid var(--mau-pham, #8fd3ff);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45), 0 0 14px color-mix(in srgb, var(--mau-pham, #8fd3ff) 40%, transparent);
  color: #eaf6ff; font-size: 13px; pointer-events: auto; overflow: hidden;
  animation: tc-vao .28s ease-out;
}
#the-ca[hidden] { display: none; }
@keyframes tc-vao { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
#the-ca .tc-x { position: absolute; top: 4px; right: 6px; width: 28px; height: 28px; border: 0; background: none; color: #bcd; font-size: 20px; line-height: 1; cursor: pointer; }
#the-ca .tc-dau { display: flex; gap: 10px; align-items: center; padding-right: 22px; }
#the-ca .tc-anh {
  flex: 0 0 auto; width: 70px; height: 70px; border-radius: 12px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--mau-pham) 32%, #10283c), #0a1826 72%);
  border: 2px solid var(--mau-pham);
}
#the-ca .tc-anh img { width: 62px; height: 62px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); animation: tc-boi 2.4s ease-in-out infinite; }
@keyframes tc-boi { 50% { transform: translateY(-2px) rotate(-3deg); } }
#the-ca .tc-ten { min-width: 0; }
#the-ca .tc-ten b { display: block; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#the-ca .tc-ten small { color: #9fb6c8; font-size: 11.5px; }
#the-ca .tc-nhans { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
#the-ca .tc-nhan { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: rgba(255, 255, 255, .1); }
#the-ca .tc-nhan.moi { background: #2f9e62; color: #fff; }
#the-ca .tc-nhan.kl { background: #d99a1e; color: #1b1203; }
#the-ca .tc-nhan.klMc { background: linear-gradient(90deg, #ffcf3f, #ff8a3d); color: #2a1300; }
#the-ca .tc-nhan.hiem { background: color-mix(in srgb, var(--mau-pham) 70%, #000); color: #fff; }
#the-ca .tc-so { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 6px; }
#the-ca .tc-so > div { background: rgba(79, 227, 255, .06); border: 1px solid rgba(143, 211, 255, .22); border-radius: 8px; padding: 3px 8px; min-width: 0; }
#the-ca .tc-so span { display: block; font-size: 11px; color: #9fb6c8; }
#the-ca .tc-so b { font-size: 16px; color: #ffd76a; white-space: nowrap; }
#the-ca .tc-ghi { font-size: 12px; color: #9fe7b8; margin: 2px 0 5px; }
#the-ca .tc-ghi.xong { color: #ffd76a; font-weight: 700; }
#the-ca .tc-hoi { font-size: 12px; color: #dfeaf2; margin: 2px 0 5px; }
#the-ca .tc-can { white-space: nowrap; font-weight: 700; }
#the-ca .tc-can img { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
#the-ca .tc-nut { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
#the-ca .tc-nut button {
  min-height: 34px; padding: 4px 2px; border-radius: 9px; border: 1px solid rgba(143, 211, 255, .35);
  background: rgba(20, 52, 78, .9); color: #eaf6ff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
#the-ca .tc-nut button.chinh { background: var(--mau-pham, #2f8fd0); color: #0a1420; border-color: transparent; }
#the-ca .tc-nut button:active { transform: scale(.96); }
#the-ca .tc-thoi { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--mau-pham); transform-origin: left; animation: tc-thoi 5s linear forwards; }
@keyframes tc-thoi { to { transform: scaleX(0); } }
/* điện thoại dọc: chừa hai cột nút HUD hai bên (quà ngày, khoảng cách tới mốc) */
@media (max-width: 480px) { #the-ca { width: min(272px, calc(100vw - 112px)); } #the-ca .tc-nut button { font-size: 11.5px; } }
/* màn ngang thấp (điện thoại xoay ngang): thẻ gọn hơn, sát mép trên */
@media (max-height: 480px) {
  #the-ca { top: calc(env(safe-area-inset-top, 0px) + 6px); width: min(330px, 46vw); padding: 6px 8px; }
  #the-ca .tc-anh { width: 52px; height: 52px; } #the-ca .tc-anh img { width: 46px; height: 46px; }
  #the-ca .tc-so { margin: 5px 0 4px; } #the-ca .tc-nut button { min-height: 30px; }
}
/* sổ tay: nút mở lại thẻ con kỷ lục */
.sc-so-lieu .sc-the { display: block; margin-top: 3px; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--vien-mo, #3a5a74); background: rgba(79, 227, 255, .08); color: inherit; font-size: 11.5px; cursor: pointer; }
/* thẻ cá nhỏ trong dòng chat (khoe từ thẻ) */
.chat-ca { display: inline-flex; flex-wrap: wrap; max-width: 100%; align-items: center; gap: 2px 5px; margin-left: 4px; white-space: nowrap; padding: 1px 7px 1px 2px; border-radius: 9px; border: 1px solid var(--mau-pham, #8fd3ff); background: rgba(8, 20, 34, .7); color: #eaf6ff; font-size: 12px; vertical-align: middle; }
.chat-ca img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.chat-ca b { color: var(--mau-pham, #fff); }
.chat-ca .cc-nhan { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 7px; background: #d99a1e; color: #1b1203; }
@media (prefers-reduced-motion: reduce) { #the-ca, #the-ca .tc-anh img { animation: none; } }
/* ===== khoang_san.css ===== */
/* KHOÁNG SẢN: lò nung (trinh_khach/src/lo_nung.ts) + mỏ khai thác (mo_khai_thac.ts). Ở khu riêng (rừng) body có class trong-hang:
   các nút của đảo / biển ẩn đi (hang mỏ cũ đã bỏ 17/11/2026, rừng nguyên sinh vẫn dùng lớp này). */

/* trong hang: giấu nút của đảo / biển */
body.trong-hang #nut-chinh, body.trong-hang #nut-phu, body.trong-hang #dn-thanh, body.trong-hang #dao-thanh, body.trong-hang #ban-do-nho,
body.trong-hang #dn-ve, body.trong-hang #tham-thanh, body.trong-hang #sx-thanh, body.trong-hang #nha-thanh, body.trong-hang #hc-thanh,
body.trong-hang #kb-chip, body.trong-hang #cum-lai, body.trong-hang #bang-ln { visibility: hidden !important; pointer-events: none !important; }

/* ---- bảng Lò nung ---- */
#bang-ln { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(400px, calc(100vw - 20px)); max-height: calc(var(--cao) - 24px);
  display: flex; flex-direction: column; overflow: visible; z-index: var(--z-bang); padding: 8px 12px 12px; }
#bang-ln[hidden] { display: none; }
#ln-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #2a5066 transparent; }
.ln-khoi { display: flex; flex-direction: column; gap: 9px; }
.ln-dong > b { display: flex; justify-content: space-between; font-size: 12.5px; color: #ffe9a6; margin-bottom: 4px; }
.ln-dong > b small { color: var(--chu-mo); font-weight: 600; }
.ln-me { display: flex; align-items: center; gap: 6px; }
.ln-me img, .ln-o img, .ln-vat img { width: 30px; height: 30px; image-rendering: pixelated; }
.ln-mui { color: #ffb454; font-weight: 800; }
.ln-thanh { position: relative; flex: 1; height: 18px; border-radius: 9px; background: rgba(0, 0, 0, .5); overflow: hidden; }
.ln-thanh i { display: block; height: 100%; background: linear-gradient(90deg, #c8541a, #ffd27a); }
.ln-thanh em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 11.5px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.ln-hang { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
.ln-o { position: relative; display: inline-flex; padding: 2px; border-radius: 8px; background: rgba(0, 0, 0, .35); border: 1px solid var(--vien-mo); }
.ln-o i { position: absolute; right: 1px; bottom: -1px; font-style: normal; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.ln-ra { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.ln-ra > b { grid-column: 1 / -1; }
.ln-bo { display: flex; flex-direction: column; gap: 5px; }
.ln-vat { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 6px; align-items: center; font-size: 12.5px; }
.ln-vat.mo { opacity: .5; }
.ln-vat button, .ln-ra button { min-width: 44px; min-height: 34px; border-radius: 8px; background: var(--nen-dam); border: 1px solid var(--vien); color: var(--chu); font-weight: 800; cursor: pointer; }
.ln-vat button:disabled, .ln-ra button:disabled { opacity: .4; cursor: default; }
.ln-ghi { font-size: 11.5px; color: var(--chu-mo); margin: 2px 0 0; }

/* ---- bảng Mỏ khai thác (#bang-mk, .bang.lon: khung, tiêu đề, nút đóng theo docs/ui.md) ---- */
body.trong-hang #bang-mk, body.trong-hang #bang-gd, body.trong-hang #mk-nut-cuop { visibility: hidden !important; pointer-events: none !important; }
.mk-than { overflow-y: auto; scrollbar-width: thin; padding: 8px 12px 14px; }
.mk-khoi { display: flex; flex-direction: column; gap: 12px; }
.mk-dong { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .22); border: 1px solid var(--vien-mo); }
.mk-dong > b { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #ffe9a6; }
.mk-dong > b small { color: var(--chu-mo); font-weight: 600; text-align: right; }
.mk-thanh { position: relative; height: 20px; border-radius: 10px; background: rgba(0, 0, 0, .5); overflow: hidden; }
.mk-thanh i { display: block; height: 100%; background: linear-gradient(90deg, #6b5a46, #d9b46a); transition: width .4s; }
.mk-thanh.day i { background: linear-gradient(90deg, #a8541a, #ffb454); }
.mk-thanh em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.mk-hang { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 34px; }
.mk-o { position: relative; display: inline-flex; padding: 2px; border-radius: 8px; background: rgba(0, 0, 0, .35); border: 1px solid var(--vien-mo); }
.mk-o img { width: 30px; height: 30px; image-rendering: pixelated; }
.mk-o i { position: absolute; right: 1px; bottom: -1px; font-style: normal; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.mk-ghi { font-size: 12px; color: var(--chu-mo); margin: 0; line-height: 1.4; }
.mk-ghi.canh { color: #ffb08a; }
.mk-tho { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid transparent; }
.mk-tho.lam { border-color: rgba(217, 180, 106, .45); }
.mk-tho-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mk-tho-ten { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 180px; font-size: 13px; }
.mk-tho-ten small { color: var(--chu-mo); font-size: 11.5px; }
.mk-tinh { font-style: normal; font-size: 11px; color: #9fd8ff; margin-left: 4px; }
.mk-cu-anh { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin-right: 2px; }
.mk-tho-nut { display: flex; gap: 6px; }
.mk-than button { min-width: 44px; min-height: 40px; padding: 0 10px; border-radius: 9px; background: var(--nen-dam); border: 1px solid var(--vien); color: var(--chu); font-weight: 800; cursor: pointer; }
.mk-than button.chinh { background: #2f6a46; border-color: #5fbf86; }
.mk-than button.nguy { color: #ffb0a0; }
.mk-than button:disabled { opacity: .4; cursor: default; }
.mk-than button.nut-lon { min-height: 46px; font-size: 14.5px; }
.mk-cuoc { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-cuoc button { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.mk-cuoc img { width: 22px; height: 22px; image-rendering: pixelated; }
.mk-luong { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.mk-luong span { flex: 1 1 160px; }
.mk-tl { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px; }
.mk-tl-o { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 7px; background: rgba(0, 0, 0, .3); font-size: 12px; }
.mk-tl-o img { width: 24px; height: 24px; image-rendering: pixelated; }
.mk-tl-o b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-tl-o i { font-style: normal; font-weight: 800; color: #ffe9a6; }
.mk-tl-o.moi { outline: 1px solid #7fe8ff; background: rgba(60, 140, 170, .3); }
.mk-gia { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-can { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 7px; background: rgba(0, 0, 0, .3); font-size: 12px; }
.mk-can img { width: 20px; height: 20px; image-rendering: pixelated; }
/* ---- bảng Điện của đảo (#bang-dien, trinh_khach/src/dien_dao.ts; dùng chung lớp mk-*) ---- */
body.trong-hang #bang-dien { visibility: hidden !important; pointer-events: none !important; }
.dien-so { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dien-so span { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border-radius: 8px; background: rgba(0, 0, 0, .3); font-size: 11.5px; color: var(--chu-mo); }
.dien-so b { font-size: 15px; color: #ffe9a6; }
.dien-tt { font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; margin-left: 4px; white-space: nowrap; }
.dien-tt.chay { background: rgba(80, 190, 120, .25); color: #9ff0b8; }
.dien-tt.thieu { background: rgba(230, 120, 60, .3); color: #ffc29a; }
.dien-tt.nghi { background: rgba(255, 255, 255, .08); color: var(--chu-mo); }
.dien-tt.tat { background: rgba(0, 0, 0, .35); color: #9a948a; }
/* quán rượu: hai nút thuê cạnh nhau (thuyền viên · thợ mỏ) */
.tv-uv-nut { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.tv-uv-nut button { min-height: 38px; }
@media (max-width: 520px) {
  .mk-than { padding: 6px 8px 12px; }
  .mk-tl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-tho-nut { width: 100%; }
  .mk-tho-nut button { flex: 1; }
}
/* nút trong cột nút ứng viên quán rượu (không phải con trực tiếp của .tv-dong nên trước đây hiện nút trắng mặc định, chữ khó đọc) */
.tv-uv-nut button { padding: 4px 12px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); color: var(--chu); font-weight: 700; }
.tv-uv-nut button.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.tv-uv-nut button[data-l="thue_mo"] { border-color: rgba(242, 194, 51, .6); background: rgba(242, 194, 51, .16); color: #ffe7a0; }
.tv-uv-nut button:disabled { opacity: .42; }
.mk-ghi.mk-thue { color: #ffe7a0; font-weight: 600; }
.mk-ghi.mk-nhan { color: var(--chu); font-weight: 700; margin-top: 6px; } .mk-ghi.mk-sau { border-top: 1px dashed var(--vien-mo); padding-top: 6px; }
/* ===== moi_ban.css ===== */
/* Mời bạn nhận quà (#bang-moi + thẻ #moi-the: trinh_khach/src/moi_ban.ts). Nền bảng: .bang.lon (style.css). Gọn trên điện thoại dọc, không cuộn ngang. */

#bang-moi { overflow: visible; }   /* 02/12: KHÔNG cuộn khung ngoài — Safari iOS bỏ vẽ viền ảnh bang.png (border-image) của khung tự cuộn → bảng trong suốt; ruột tự cuộn */   /* cỡ: lớp co-vua (moi_ban.ts) */
.mb-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 10px 12px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.mb-than * { box-sizing: border-box; min-width: 0; }

.mb-link { display: grid; gap: 6px; padding: 8px; border-radius: 8px; background: rgba(255, 216, 74, .08); border: 1px solid rgba(255, 216, 74, .3); }
#mb-url { display: block; width: 100%; max-width: 100%; padding: 8px 10px; min-height: 40px; border-radius: 7px; border: 1px solid var(--vien-mo);
  background: rgba(0, 0, 0, .35); color: var(--chu); font: 600 13px/1.2 system-ui, sans-serif; text-overflow: ellipsis; user-select: all; -webkit-user-select: all; }
.mb-nuts { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-nut { flex: 1 1 90px; min-height: 40px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08);
  color: var(--chu); font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-nut.chinh { border-color: var(--vien); background: linear-gradient(#1f6f8c, #134a63); }
.mb-nut.fb { background: #1f4f9a; border-color: #4a7fd6; }
.mb-nut:active, .mb-nhan:active, .mb-moc.cho:active, .mb-kb:active { transform: translateY(1px); }

.mb-boi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(79, 227, 255, .08);
  border: 1px solid var(--vien-mo); font-size: 13px; overflow-wrap: anywhere; }

.mb-tongs { display: grid; gap: 4px; }
.mb-tong { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 5px 8px; border-radius: 8px; background: rgba(79, 227, 255, .04);
  border: 1px solid transparent; }
.mb-tong > b { flex: 0 0 auto; font-size: 12px; min-width: 52px; }
.mb-tong.cho { border-color: rgba(255, 216, 74, .6); background: rgba(255, 216, 74, .1); }
.mb-tong.xong { opacity: .65; }
.mb-quas { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 120px; }
.mb-qua { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .25); font-size: 12px; max-width: 100%; }
.mb-qua i { font-style: normal; overflow-wrap: anywhere; }
.mb-qua img { flex: 0 0 auto; }
.mb-qua img { width: 20px; height: 20px; image-rendering: pixelated; }
.mb-qua.mb-dh { color: var(--vang); white-space: normal; }
.mb-nhan { flex: 0 0 auto; min-height: 34px; padding: 4px 14px; border-radius: 8px; border: 1px solid var(--vang); background: rgba(255, 216, 74, .22);
  color: var(--vang); font-weight: 800; font-size: 13px; }
.mb-xong { flex: 0 0 auto; color: var(--xanh); font-size: 12px; font-weight: 700; }
.mb-tien { flex: 0 0 auto; color: var(--chu-mo); font-size: 12px; font-weight: 700; }

.mb-ds { display: grid; gap: 5px; }
.mb-dong { padding: 6px 8px; border-radius: 8px; background: rgba(79, 227, 255, .05); border: 1px solid var(--vien-mo); display: grid; gap: 4px; }
.mb-dong.khong { opacity: .8; border-style: dashed; }
.mb-dong-dau { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.mb-ten { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mb-on { color: var(--xanh); font-style: normal; font-size: 10px; }
.mb-kb { flex: 0 0 auto; min-height: 30px; padding: 3px 10px; border-radius: 7px; border: 1px solid var(--vien); background: rgba(79, 227, 255, .14);
  color: var(--chu); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mb-kb:disabled { opacity: .5; }
.mb-ban-roi { flex: 0 0 auto; font-size: 11px; color: var(--chu-mo); white-space: nowrap; }
.mb-mocs { display: flex; flex-wrap: wrap; gap: 4px; }
.mb-moc { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; min-height: 26px; border-radius: 13px; font-size: 12px; white-space: nowrap;
  color: var(--chu-mo); background: rgba(0, 0, 0, .22); border: 1px solid transparent; }
.mb-moc.dat { color: var(--chu); }
.mb-moc.xong { color: var(--xanh); border-color: rgba(79, 227, 255, .35); }
button.mb-moc.cho { color: #1b1300; background: var(--vang); border-color: var(--vang); font-weight: 800; min-height: 30px; animation: mb-nhay 1.4s ease-in-out infinite; }
button.mb-moc:disabled { opacity: .55; animation: none; }
@keyframes mb-nhay { 50% { box-shadow: 0 0 0 3px rgba(255, 216, 74, .35); } }
.mb-ly { font-size: 11px; color: #ffb3a1; overflow-wrap: anywhere; }

.mb-luat { margin: 0; padding: 0 0 0 18px; display: grid; gap: 3px; font-size: 12px; color: var(--chu-mo); overflow-wrap: anywhere; }

/* thẻ "Bạn được … mời" sau lần vào đầu: mép trên, không chặn chạm vào màn chơi ngoài thẻ */
#moi-the { position: fixed; z-index: var(--z-the-nhac); left: 50%; top: calc(var(--dh-day, 34px) + 56px); transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px)); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 30px 8px 12px; border-radius: 10px;
  background: var(--nen-dam, rgba(8, 28, 40, .94)); border: 1px solid var(--vang); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); font-size: 13px;
  color: var(--chu); transition: opacity .35s, transform .35s; overflow: hidden; }
#moi-the .mt-chu { flex: 1 1 100%; overflow-wrap: anywhere; }
#moi-the b { color: var(--vang); }
#moi-the .nut-x { position: absolute; right: 6px; top: 4px; }
#moi-the.tat { opacity: 0; transform: translate(-50%, -8px); }
/* ===== qua_ngay.css ===== */
/* Quà mỗi ngày (#bang-qua-ngay: trinh_khach/src/qua_ngay.ts). Nền bảng: .bang.lon (style.css); dòng mốc dùng lại .mb-tong / .mb-qua của moi_ban.css.
   Gọn trên điện thoại dọc 375 px: lưới 3 cột, ô ngày 7 chiếm cả hàng, không cuộn ngang, nút Nhận cao 48 px. */

#bang-qua-ngay { overflow: visible; }   /* 02/12: KHÔNG cuộn khung ngoài (overflow-x: hidden làm trục y thành auto) — Safari iOS bỏ vẽ viền ảnh bang.png của khung tự cuộn → bảng trong suốt trên iPad; .qn-than tự cuộn */   /* cỡ: lớp co-vua (qua_ngay.ts) */
.qn-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 10px 12px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.qn-than * { box-sizing: border-box; min-width: 0; }

.qn-dong { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 12px; color: var(--chu-mo); }
.qn-con b { color: var(--chu); font-variant-numeric: tabular-nums; }

.qn-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.qn-o { display: grid; gap: 4px; align-content: start; padding: 6px; border-radius: 9px; background: rgba(79, 227, 255, .05); border: 1px solid var(--vien-mo); }
.qn-o.lon { grid-column: 1 / -1; background: rgba(198, 132, 255, .08); border-color: rgba(198, 132, 255, .45); }
.qn-o-dau { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 6px; font-size: 11px; color: var(--chu-mo); }
.qn-o-dau b { font-size: 13px; color: var(--chu); white-space: nowrap; }
.qn-o-qua { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
/* C20: tên vật phẩm 12 px, MỘT dòng (cắt "…" chỉ là phương án cuối) */
.qn-o .mb-qua { padding: 1px 4px; font-size: var(--chu-phu, 12px); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qn-o.lon .mb-qua { font-size: 13px; padding: 2px 7px; }
.qn-o.xong { opacity: .5; }
.qn-o.xong .qn-o-dau span { color: var(--xanh); font-weight: 700; }
.qn-o.nay { border-color: var(--vang); background: rgba(255, 216, 74, .14); box-shadow: 0 0 0 2px rgba(255, 216, 74, .25); }
.qn-o.nay .qn-o-dau span { color: var(--vang); font-weight: 800; }
.qn-o.vua { opacity: 1; animation: qn-vua 1.2s ease-out 1; }
@keyframes qn-vua { 0% { box-shadow: 0 0 0 6px rgba(255, 216, 74, .6); } 100% { box-shadow: 0 0 0 0 rgba(255, 216, 74, 0); } }
.qn-xu { color: var(--vang); }

.qn-nhan { width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--vang); background: linear-gradient(#ffe066, #f0b424);
  color: #1b1300; font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.qn-nhan:active { transform: translateY(1px); }
.qn-nhan:disabled { opacity: .6; }
.qn-da { min-height: 40px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px 10px; border-radius: 10px;
  background: rgba(79, 227, 255, .06); border: 1px dashed var(--vien-mo); color: var(--xanh); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.qn-luat { overflow-wrap: anywhere; }

/* ---- thẻ "Có gì mới" (#bang-cgm: trinh_khach/src/co_gi_moi.ts) ---- */
#bang-cgm { overflow: visible; }   /* 02/12: như #bang-qua-ngay; .cgm-than tự cuộn */   /* cỡ: lớp co-nho */
.cgm-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 12px 12px; display: grid; gap: 10px; align-content: start; }
.cgm-muc { padding: 8px 10px 6px; border-radius: var(--bo-the, 10px); border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .04); }
.cgm-muc.moi { border-color: var(--vien); background: rgba(79, 227, 255, .1); }
.cgm-muc h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; color: var(--chu); }
.cgm-ngay { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 6px; background: rgba(0, 0, 0, .3); font-size: 11px; font-weight: 700; color: var(--chu-mo); font-variant-numeric: tabular-nums; }
.cgm-muc.moi .cgm-ngay { background: #ffd36a; color: #3a2a00; }
.cgm-muc ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; color: var(--chu-mo); }
.cgm-muc li + li { margin-top: 2px; }
/* ===== phieu_tuan.css ===== */
/* Phiếu Tuần (trinh_khach/src/phieu_tuan.ts, đầu thẻ Nhiệm vụ của bảng Hệ thống) + chip / thẻ Gió Tuần (trinh_khach/src/gio_tuan.ts).
   Điện thoại dọc 375 px: ba nấc chia đều một hàng, không cuộn ngang; nút Nhận cao ≥ 44 px; chữ ≥ 11 px, chữ đọc kỹ 12–13 px. */

.pt-khung { border: 1px solid rgba(255, 216, 74, .4); background: rgba(255, 216, 74, .06); border-radius: 10px; padding: 8px 10px 9px; margin-bottom: 10px; min-width: 0; }
.pt-khung * { box-sizing: border-box; min-width: 0; }
.pt-dau { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pt-dau > b { font-size: 14px; color: var(--vang, #ffd84a); }
.pt-con { font-size: 12px; color: var(--chu-mo, #9ec0d4); white-space: nowrap; }
.pt-con b { color: var(--chu, #e8f8ff); font-variant-numeric: tabular-nums; }

/* thanh dấu 0 → 36, ba vạch mốc */
.pt-thanh { position: relative; height: 12px; border-radius: 8px; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .14); margin: 10px 4px 22px; }
.pt-thanh > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, #c48412, #ffe066); transition: width .4s; }
.pt-vach { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .45); font-style: normal; }
.pt-vach.dat { background: var(--vang, #ffd84a); }
.pt-vach b { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; font-size: 11px; font-weight: 800; color: var(--chu-mo, #9ec0d4); font-variant-numeric: tabular-nums; }
.pt-vach.dat b { color: var(--vang, #ffd84a); }

.pt-nacs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pt-nac { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px; border-radius: 9px; border: 1px solid var(--vien-mo, rgba(120, 220, 255, .35)); background: rgba(79, 227, 255, .05); }
.pt-nac.dat { border-color: var(--vang, #ffd84a); background: rgba(255, 216, 74, .14); box-shadow: 0 0 0 2px rgba(255, 216, 74, .22); }
.pt-nac.da { opacity: .55; }
.pt-moc { font-size: 15px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.pt-moc::after { content: ' ✦'; color: var(--vang, #ffd84a); font-size: 11px; }
.pt-quas { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.pt-qua { display: flex; align-items: center; gap: 3px; font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; }
.pt-qua img { width: 18px; height: 18px; flex: 0 0 auto; image-rendering: pixelated; }
.pt-qua em { font-style: normal; font-size: 11px; color: var(--chu-mo, #9ec0d4); overflow: hidden; text-overflow: ellipsis; }
.pt-nhan { min-height: 44px; border-radius: 9px; border: 1px solid var(--vang, #ffd84a); background: linear-gradient(#ffe066, #f0b424); color: #1b1300; font-weight: 800; font-size: 14px; }
.pt-xong, .pt-khoa { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 12px; text-align: center; color: var(--chu-mo, #9ec0d4); }
.pt-xong { color: var(--xanh, #6fffd2); font-weight: 700; }

.pt-cu { margin-top: 8px; padding-top: 6px; border-top: 1px dashed rgba(255, 255, 255, .25); }
.pt-cu-dau { font-size: 12px; color: var(--vang, #ffd84a); margin-bottom: 5px; }

.pt-chan { margin-top: 7px; font-size: 12px; color: var(--chu-mo, #9ec0d4); }
.pt-hom { font-weight: 700; color: var(--chu, #e8f8ff); }
.pt-nguon { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 11.5px; }
.pt-nguon span { white-space: nowrap; }

@media (max-width: 420px) {
  .pt-qua em { display: none; }
  .pt-nacs { gap: 4px; }
}
/* điện thoại ngang (thấp): nấc xếp một hàng, chữ tên món hiện lại */
@media (orientation: landscape) and (max-height: 480px) {
  .pt-khung { padding: 6px 8px; margin-bottom: 6px; }
  .pt-thanh { margin: 6px 4px 18px; }
}

/* ---- Gió Tuần: chip trong #dong-ho + thẻ mô tả ---- */
#dh-gio-tuan { cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: #9ef5d0; border: 1px solid rgba(110, 255, 200, .35); background: rgba(60, 200, 150, .12); border-radius: 99px; padding: 1px 7px; min-height: 22px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#dh-gio-tuan[hidden] { display: none; }
/* chip Gió Tuần nhường chỗ trước: vừa hết chỗ (co1) chỉ còn biểu tượng, các chip cũ (thời tiết, bảo hộ) giữ chữ lâu hơn */
#dong-ho.co1 #dh-gio-tuan .dh-ten { display: none; }
#dong-ho.co3 #dh-gio-tuan { padding: 1px 4px; font-size: 11px; }
#gio-tuan-the { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(var(--tren, 0px) + var(--mt, 8px) + 40px); width: min(320px, calc(100vw - 24px)); padding: 10px 12px; border-radius: 12px;
  background: rgba(6, 22, 38, .96); border: 1px solid rgba(110, 255, 200, .5); box-shadow: 0 6px 22px rgba(0, 0, 0, .5); color: var(--chu, #e8f8ff); display: grid; gap: 3px; cursor: pointer; }
#gio-tuan-the[hidden] { display: none; }
#gio-tuan-the b { font-size: 15px; color: #9ef5d0; }
#gio-tuan-the span { font-size: 12px; color: var(--chu-mo, #9ec0d4); }
#gio-tuan-the p { margin: 2px 0; font-size: 13.5px; line-height: 1.4; }
#gio-tuan-the small { font-size: 11.5px; color: var(--chu-mo, #9ec0d4); }
.gt-muc h3 { color: #9ef5d0; }
.gt-muc { border-color: rgba(110, 255, 200, .55); }
/* ===== bon_mua.css ===== */
/* 4 MÙA + CỤM KHÍ HẬU (trinh_khach/src/bon_mua.ts + nhip_bien.ts):
   gộp Mùa (#dh-mua) + Trăng (#dh-trang) + Thời tiết (#dh-thientai) thành một nút #dh-khihau cạnh đồng hồ. Nền đặc, chữ trắng, chạm >= 44 px. */
html body #dong-ho #dh-khihau {
  cursor: pointer; font: inherit; background: transparent !important; border: 0 !important; box-shadow: none !important;
  padding: 0 !important; margin: 0 !important; display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; min-width: 44px; opacity: 1 !important; color: #ffffff !important;
}
html body.cam-ung #dong-ho #dh-khihau { min-height: 44px; min-width: 44px; }
html body #dong-ho #dh-khihau .dh-kh-vien {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 5px; min-height: 26px;
  border-radius: 99px; background: #072236 !important; border: 1.5px solid rgba(154, 197, 223, 0.72) !important;
  color: #ffffff !important; white-space: nowrap; box-shadow: 0 2px 6px rgba(4, 24, 40, 0.35);
}
html body #dong-ho #dh-khihau[data-mua="xuan"] .dh-kh-vien { border-color: #6fdc8a !important; }
html body #dong-ho #dh-khihau[data-mua="ha"] .dh-kh-vien { border-color: #ffd84a !important; }
html body #dong-ho #dh-khihau[data-mua="thu"] .dh-kh-vien { border-color: #ffa94a !important; }
html body #dong-ho #dh-khihau[data-mua="dong"] .dh-kh-vien { border-color: #a8e2ff !important; }
html body #dong-ho #dh-khihau[data-troi="bao"] .dh-kh-vien { border-color: #ff7676 !important; animation: nhay-bao 1.6s ease-in-out infinite; }

html body #dong-ho #dh-khihau .dh-kh-muc {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; line-height: 1.1;
  color: #ffffff !important; background: transparent !important; border: 0 !important; padding: 0 !important; opacity: 1 !important;
  white-space: nowrap;
}
html body #dong-ho #dh-khihau .dh-kh-muc + .dh-kh-muc {
  padding-left: 5px !important;
  border-left: 1px solid rgba(154, 197, 223, 0.35) !important;
}
#dh-mua .mua-svg { width: 17px; height: 17px; flex: 0 0 auto; display: block; }
#dh-mua .dh-gon { display: none; }
/* co1: thu chữ dài trăng trước; co2/co3: gọn còn 3 biểu tượng [mùa · trăng · trời] */
#dong-ho.co1 #dh-mua .dh-dai { display: none; }
#dong-ho.co1 #dh-mua .dh-gon { display: inline; }
#dong-ho.co2 #dh-mua .dh-dai, #dong-ho.co2 #dh-mua .dh-gon,
#dong-ho.co3 #dh-mua .dh-dai, #dong-ho.co3 #dh-mua .dh-gon { display: none; }
#dong-ho.co2 #dh-khihau .dh-kh-vien, #dong-ho.co3 #dh-khihau .dh-kh-vien { gap: 4px; padding: 2px 6px; }
#dong-ho.co2 #dh-khihau .dh-kh-muc + .dh-kh-muc, #dong-ho.co3 #dh-khihau .dh-kh-muc + .dh-kh-muc { padding-left: 4px !important; }

/* Thẻ mô tả mùa dự phòng: skin Tròn mềm sáng */
#mua-the { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(var(--tren, 0px) + var(--mt, 8px) + 46px); width: min(336px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 18px; background: linear-gradient(180deg, #fffdf6 0%, #f1f9ff 100%); border: 3px solid #04253a; box-shadow: 0 12px 28px rgba(3, 18, 34, .4);
  color: #0b2f47; display: grid; gap: 4px; cursor: pointer; max-height: calc(100vh - 80px); overflow: auto; }
#mua-the[hidden] { display: none; }
#mua-the b { font-size: 16px; display: flex; align-items: center; gap: 6px; color: #0b2f47; font-weight: 900; }
#mua-the b .mua-svg { width: 24px; height: 24px; }
#mua-the > span { font-size: 12.5px; color: #245a7a; font-weight: 700; }
#mua-the p { margin: 2px 0; font-size: 13.5px; line-height: 1.4; color: #0b2f47; }
#mua-the ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; color: #0b2f47; }
#mua-the ul b { display: inline; font-size: 13px; color: #0d6d3e; }
#mua-the small { font-size: 11.5px; color: #245a7a; }
/* ===== so_truong.css ===== */
/* SỞ TRƯỜNG: thẻ đầu của bảng Hệ thống (trinh_khach/src/so_truong.ts; luật: may_chu/so_truong.go).
   4 nhánh × 2 nút × 3 bậc. Điện thoại dọc 390 px: một cột, không cuộn ngang, nút +1 và Đổi lại cao ≥ 44 px; điện thoại ngang / máy tính:
   lưới tự chia 2 cột theo bề rộng bảng. Chữ đọc kỹ ≥ 12 px. */

.str { min-width: 0; }
.str * { box-sizing: border-box; min-width: 0; }

/* đầu thẻ: điểm còn lại + nút Đổi lại */
.str-dau { display: flex; align-items: stretch; gap: 8px; }
.str-diem { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--vien-mo, rgba(79, 227, 255, .35)); background: rgba(79, 227, 255, .06); }
.str-diem > b { font-size: 26px; line-height: 1; font-weight: 900; color: var(--chu-mo, #8fb9c8); font-variant-numeric: tabular-nums; min-width: 22px; text-align: center; }
.str-diem > span { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; line-height: 1.25; }
.str-diem small { font-size: 12px; font-weight: 500; color: var(--chu-mo, #8fb9c8); }
.str-diem.con { border-color: var(--vang, #ffd84a); background: rgba(255, 216, 74, .1); }
.str-diem.con > b { color: var(--vang, #ffd84a); text-shadow: 0 0 10px rgba(255, 216, 74, .6); }
.str-doi { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; max-width: 46%; padding: 4px 10px; border-radius: 10px;
  border: 1px solid var(--vien-mo, rgba(79, 227, 255, .35)); background: rgba(79, 227, 255, .08); color: var(--chu, #e2fbff); font-weight: 800; font-size: 13px; line-height: 1.2; text-align: center; }
.str-doi small { font-size: 11px; font-weight: 500; color: var(--chu-mo, #8fb9c8); }
.str-doi.xn { border-color: var(--do, #ff6a6a); background: rgba(255, 106, 106, .18); }
.str-doi:disabled { opacity: .5; }

/* mốc nhận điểm + một dòng giới thiệu */
.str-moc { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 8px 2px 0; font-size: 12px; color: var(--chu-mo, #8fb9c8); }
.str-moc span { white-space: nowrap; }
.str-moc span.co { color: var(--xanh, #6fffd2); }
.str-gt { margin: 4px 2px 8px; font-size: 12px; line-height: 1.4; color: var(--chu-mo, #8fb9c8); }

/* lưới nhánh */
.str-luoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 8px; }
.str-nhanh { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--vien-mo, rgba(79, 227, 255, .35)); background: rgba(4, 14, 26, .45); }
.str-nhanh h4 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--vien, #4fe3ff); }
.str-nhanh h4 span { font-size: 16px; }

/* nút */
.str-nut { padding: 7px 8px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(79, 227, 255, .05); }
.str-nut.co { border-color: rgba(255, 216, 74, .55); background: rgba(255, 216, 74, .07); }
.str-nut-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.str-ten { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; font-weight: 800; color: var(--chu, #e2fbff); }
.str-cham { display: inline-flex; gap: 3px; }
.str-cham i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--chu-mo, #8fb9c8); }
.str-cham i.co { background: var(--vang, #ffd84a); border-color: var(--vang, #ffd84a); box-shadow: 0 0 6px rgba(255, 216, 74, .7); }
.str-cong { flex: 0 0 auto; min-width: 52px; min-height: 36px; border-radius: 9px; border: 1px solid var(--vang, #ffd84a); background: linear-gradient(#ffe066, #f0b424); color: #1b1300; font-weight: 900; font-size: 15px; }
body.cam-ung .str-cong { min-height: 44px; min-width: 56px; }
.str-cong:disabled { border-color: var(--vien-mo, rgba(79, 227, 255, .35)); background: rgba(79, 227, 255, .06); color: var(--chu-mo, #8fb9c8); }
.str-day { flex: 0 0 auto; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--vang, #ffd84a); border: 1px solid rgba(255, 216, 74, .5); white-space: nowrap; }
.str-mota { margin: 3px 0 5px; font-size: 12px; line-height: 1.35; color: var(--chu-mo, #8fb9c8); }
.str-bac { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.str-bac li { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; line-height: 1.35; color: var(--chu-mo, #8fb9c8); }
.str-bac li b { flex: 0 0 20px; text-align: center; font-size: 11px; font-weight: 800; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .18); }
.str-bac li.co { color: var(--chu, #e2fbff); }
.str-bac li.co b { color: #1b1300; background: var(--vang, #ffd84a); border-color: var(--vang, #ffd84a); }
.str-bac li.ke b { border-color: var(--vien, #4fe3ff); color: var(--vien, #4fe3ff); }

/* thiên phú cũ: kỷ niệm */
.str-cu { margin-top: 8px; padding: 6px 10px; border-radius: 9px; border: 1px dashed rgba(255, 255, 255, .22); font-size: 12px; line-height: 1.4; color: var(--chu-mo, #8fb9c8); }
.str-cu b { color: var(--chu, #e2fbff); }

/* chấm số trên thẻ "Sở trường" của hàng thẻ */
.tab-ht button { position: relative; }
.tab-ht .cham { top: 2px; right: 2px; }

/* điện thoại ngang (màn thấp): bớt phần đầu để thấy nút sớm hơn */
@media (max-height: 480px) {
  .str-gt { display: none; }
  .str-moc { margin: 5px 2px 6px; }
  .str-diem > b { font-size: 22px; }
}
/* ===== day_than.css ===== */
/* DÂY THÂN (trinh_khach/src/day_than.ts, may_chu/day_than.go): mục trong hồ sơ bạn + chip mốc ở danh sách bạn */
.dth-chip { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 9px; font-size: 11px; font-weight: 700; vertical-align: 1px; white-space: nowrap;
  color: #ffe9a8; background: rgba(255, 216, 74, .12); border: 1px solid rgba(255, 216, 74, .4); }
.dth-chip.m4 { color: #c9f3ff; background: rgba(120, 200, 255, .16); border-color: rgba(160, 225, 255, .6); }
.dth-the { border: 1px solid rgba(255, 216, 74, .35); border-radius: 10px; padding: 8px 10px; background: rgba(255, 216, 74, .05); }
.dth-the.m4 { border-color: rgba(160, 225, 255, .6); background: rgba(120, 200, 255, .07); }
.dth-dau { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dth-dau b { font-size: 16px; color: #ffe9a8; }
.dth-dau span { color: var(--chu-mo); font-size: 13px; font-weight: 700; }
.dth-thanh { height: 10px; border-radius: 6px; margin: 6px 0 4px; background: rgba(0, 10, 20, .6); border: 1px solid var(--vien-mo); overflow: hidden; }
.dth-thanh i { display: block; height: 100%; background: linear-gradient(90deg, #ffb74a, #ffe066); border-radius: 6px; }
.dth-the.m4 .dth-thanh i { background: linear-gradient(90deg, #6fd3ff, #c9f3ff); }
.dth-nguon { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; }
.dth-ng { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 4px; align-items: center; font-size: 12px; padding: 4px 6px; border-radius: 7px;
  border: 1px solid var(--vien-mo); color: var(--chu-mo); background: rgba(0, 10, 20, .3); }
.dth-ng b { color: var(--chu-mo); font-size: 11px; }
.dth-ng.xong { color: var(--xanh); border-color: rgba(111, 255, 210, .45); background: rgba(111, 255, 210, .07); }
.dth-ng.xong b { color: var(--xanh); }
.dth-ich { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.dth-ich span { font-size: 12px; padding: 2px 7px; border-radius: 8px; background: rgba(79, 227, 255, .1); border: 1px solid var(--vien-mo); }
.dth-ghi { margin-top: 6px; }
.dth-ngung { margin-top: 6px; font-size: 12px; color: var(--vang); }
.dth-ghe { display: block; width: 100%; margin-top: 8px; min-height: 40px; border-radius: 7px; border: 1px solid var(--vang); background: rgba(255, 216, 74, .16);
  color: #ffe9a8; font-weight: 800; }
.dth-ghe:disabled { opacity: .5; }
.dth-cc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dth-cc-o { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 9px; border: 1px solid rgba(160, 225, 255, .5);
  background: rgba(120, 200, 255, .07); min-height: 44px; }
.dth-cc-o img { width: 48px; height: 48px; image-rendering: pixelated; object-fit: contain; }
.dth-cc-o b { font-size: 12px; overflow-wrap: anywhere; text-align: center; }
body.cam-ung .dth-ghe { min-height: 44px; }
/* Hẹn Tuần (may_chu/hen_tuan.go) */
.dth-chip.hen { color: #d6ffe9; background: rgba(111, 255, 210, .1); border-color: rgba(111, 255, 210, .45); }
.dth-hen { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--vien-mo); }
.dth-hv { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 2px 6px; align-items: center; margin-top: 5px; padding: 5px 7px; border-radius: 7px;
  font-size: 12px; border: 1px solid var(--vien-mo); color: var(--chu-mo); background: rgba(0, 10, 20, .3); }
.dth-hv > div { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.dth-hv.xong { color: var(--xanh); border-color: rgba(111, 255, 210, .45); background: rgba(111, 255, 210, .07); }
.dth-gop { font-style: normal; font-size: 11px; color: var(--chu-mo); overflow-wrap: anywhere; }
.dth-gop.xong { color: var(--xanh); }
.dth-dx { margin-left: 6px; color: #ffe9a8; font-weight: 700; }
.dth-ht { margin-top: 7px; padding: 6px 8px; border-radius: 8px; font-size: 12px; border: 1px solid rgba(255, 214, 120, .45); background: rgba(255, 200, 90, .08); }
.dth-ht.da { opacity: .75; }
.dth-ht-dau { color: #ffe9a8; font-weight: 700; }
.dth-ht-ds, .dth-mq-ds { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 5px; }
.dth-ht-ds span, .dth-mq { padding: 2px 7px; border-radius: 10px; background: rgba(0, 10, 20, .35); border: 1px solid var(--vien-mo); overflow-wrap: anywhere; }
.dth-ht-moc { color: #ffe9a8; border-color: rgba(255, 214, 120, .6) !important; }
.dth-mq { font-size: 11px; color: var(--chu-mo); }
.dth-mq.co { color: var(--xanh); border-color: rgba(111, 255, 210, .45); }
/* ===== ket_hon.css ===== */
/* KẾT HÔN (trinh_khach/src/ket_hon_ui.ts, ket_hon_le_ui.ts) */
.tn-kh { margin-top: 3px; font-size: 12px; font-weight: 700; color: #ffd9e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-nut.kh i { filter: drop-shadow(0 0 4px rgba(255, 180, 210, .8)); }
.kh-ho-so { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 8px 10px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 150, 190, .16), rgba(255, 220, 160, .08)); border: 1px solid rgba(255, 190, 215, .45); }
.kh-ho-so b { display: block; color: #ffe1ec; font-size: 14px; }
.kh-ho-so small { color: #f3d7e2; opacity: .85; }
.kh-anh { width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .25); border: 2px solid rgba(255, 200, 220, .7); flex: none; object-fit: cover; }
.kh-li { margin-top: 2px; font-size: 12px; color: #ffb3b3; }
/* Lễ Đường Hải Đăng (ket_hon_le_ui.ts) */
.kh-le-dang { margin: 8px 0; padding: 8px 10px; border-radius: 12px; background: rgba(255, 150, 190, .14); border: 1px solid rgba(255, 190, 215, .45); color: #ffe1ec; font-weight: 700; }
.kh-le-dang small { display: block; font-weight: 400; opacity: .85; }
.kh-le-nut { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.kh-le-nut button { flex: 1 1 40%; min-height: 44px; }
.kh-le-hang { display: flex; justify-content: space-between; padding: 4px 2px; color: #f3d7e2; }
#kh-le-thanh { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 6px;
  max-width: calc(100vw - 24px); padding: 6px 8px; border-radius: 16px; background: rgba(40, 12, 28, .82); border: 1px solid rgba(255, 180, 210, .55); color: #ffe1ec; font-size: 13px; }
#kh-le-thanh[hidden] { display: none; }
#kh-le-thanh span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; font-weight: 700; }
#kh-le-thanh button { min-height: 40px; padding: 0 10px; border-radius: 12px; white-space: nowrap; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 200, 220, .5); font-weight: 700; }
#kh-le-thanh button.chinh { background: linear-gradient(#ff8fb1, #e0567f); border-color: #ffd1dc; }
#kh-le-moi { position: fixed; left: 50%; top: calc(112px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 41; display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 24px); padding: 8px 10px; border-radius: 14px; background: rgba(40, 12, 28, .9); border: 1px solid rgba(255, 180, 210, .6); color: #ffe1ec; font-size: 13px; }
#kh-le-moi button { min-height: 40px; padding: 0 12px; border-radius: 12px; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 200, 220, .5); }
#kh-le-moi button.chinh { background: linear-gradient(#ff8fb1, #e0567f); font-weight: 700; }
/* ===== tu_do.css ===== */
/* BẢNG TỦ ĐỒ (trinh_khach/src/tu_do_ui.ts): xem trước nhân vật 3D + ô mặc + lưới món + thẻ món.
   PC / ngang: hai cột. Điện thoại dọc (≤ 620 px): xem trước ở trên, thấp lại; lưới cuộn bên dưới. Cỡ bảng: lớp co-vua cao-dinh. */
#bang-tdo .td-than { display: flex; gap: 10px; padding: 0 10px 10px; min-height: 0; flex: 1 1 auto; }
#bang-tdo .td-xem { flex: 0 0 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: var(--bo-the);
  border: 1px solid var(--vien-mo); background: radial-gradient(ellipse at 50% 70%, rgba(79, 227, 255, .14), rgba(0, 20, 40, .25) 70%); padding: 4px 0 6px; }
#bang-tdo .td-xem canvas { width: 240px; height: 295px; image-rendering: pixelated; touch-action: none; cursor: grab; }
#bang-tdo .td-xoay { display: flex; align-items: center; gap: 8px; font-size: var(--chu-phu); color: var(--chu-mo); }
#bang-tdo .td-xoay .nut-phu { min-width: 40px; padding: 4px 8px; font-size: 18px; }
#bang-tdo .td-phai { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y; }
#bang-tdo .td-o { display: flex; gap: 4px; flex: 0 0 auto; }
#bang-tdo .td-o button { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 6px; line-height: 1.1; }
#bang-tdo .td-o button i { font-style: normal; font-size: 18px; }
#bang-tdo .td-o button span { font-size: var(--chu-phu); }
#bang-tdo .td-o button.chon { border-color: var(--vien); background: rgba(79, 227, 255, .16); }
#bang-tdo .td-cham { position: absolute; top: 2px; right: 4px; font-size: 9px; color: #6be38a; }
#bang-tdo .td-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; flex: 0 0 auto; }
#bang-tdo .td-mon { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 84px; padding: 6px 4px; border-radius: var(--bo-the);
  border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .05); color: inherit; font: inherit; cursor: pointer; }
#bang-tdo .td-mon > span { font-size: var(--chu-phu); font-weight: 700; line-height: 1.2; text-align: center; }
#bang-tdo .td-mon > small { font-size: 11px; color: var(--chu-mo); }
#bang-tdo .td-mau { width: 34px; height: 34px; border-radius: 50%; background: var(--m, #888); display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 17px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 0 0 2px rgba(255, 255, 255, .15); }
#bang-tdo .td-mon:not(.co) .td-mau { filter: saturate(.55) brightness(.8); }
#bang-tdo .td-mon.chon { border-color: var(--vien); box-shadow: 0 0 10px rgba(79, 227, 255, .55); }
#bang-tdo .td-mon.mac { border-color: #6be38a; }
#bang-tdo .td-mon .td-mac { color: #6be38a; font-weight: 700; }
#bang-tdo .td-ct { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--vien-mo); border-radius: var(--bo-the); background: rgba(79, 227, 255, .05); font-size: var(--chu-nd); }
#bang-tdo .td-ct.trong-nhe { color: var(--chu-mo); font-size: var(--chu-phu); }
#bang-tdo .td-ct-dau { display: flex; align-items: baseline; gap: 8px; }
#bang-tdo .td-ct-dau small { color: #6be38a; font-weight: 700; font-size: var(--chu-phu); }
#bang-tdo .td-ct p { margin: 4px 0 6px; line-height: 1.4; color: var(--chu-mo); }
#bang-tdo .td-lay { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
#bang-tdo .td-nl { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-size: var(--chu-phu); font-weight: 700; }
#bang-tdo .td-nl img { width: 18px; height: 18px; image-rendering: pixelated; }
#bang-tdo .td-nl.thieu { color: var(--do, #ff6a6a); }
#bang-tdo .td-nut { display: flex; gap: 8px; flex-wrap: wrap; }

/* điện thoại dọc: xem trước ở trên (thấp), phần chọn bên dưới */
@media (max-width: 620px) {
  #bang-tdo .td-than { flex-direction: column; }
  #bang-tdo .td-xem { flex: 0 0 auto; flex-direction: row; justify-content: center; padding: 2px 6px; }
  #bang-tdo .td-xem canvas { width: 140px; height: 172px; }
  #bang-tdo .td-xoay { flex-direction: column; }
  #bang-tdo .td-luoi { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}
/* điện thoại ngang (thấp): hai cột, xem trước nhỏ lại */
@media (min-width: 621px) and (max-height: 500px) {
  #bang-tdo .td-xem { flex-basis: 150px; }
  #bang-tdo .td-xem canvas { width: 140px; height: 172px; }
}

/* 18/11: 6 ô (thêm Giày / dép): nút ô co đều, không tràn trên điện thoại */
#bang-tdo .td-o button { flex: 1 1 0; min-width: 0; padding: 4px 2px; }
#bang-tdo .td-o button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* MÓN HIẾM (lay.hiem): viền tím ánh vàng + nhãn ★ Hiếm */
#bang-tdo .td-mon.hiem { border-color: #b77cff; background: linear-gradient(160deg, rgba(183, 124, 255, .16), rgba(255, 200, 80, .08)); box-shadow: inset 0 0 0 1px rgba(255, 210, 110, .25); }
#bang-tdo .td-mon.hiem .td-mau { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 0 0 2px #e8b838, 0 0 8px rgba(232, 184, 56, .6); }
#bang-tdo .td-mon.hiem.chon { box-shadow: 0 0 12px rgba(183, 124, 255, .75); }
#bang-tdo .td-bh { display: block; flex: 0 0 auto; font-size: 11px; color: #ffd56a; opacity: 1; margin: 2px 2px 0; }
#bang-tdo .td-hiem-nhan { color: #ffd56a; font-weight: 700; font-style: normal; font-size: 11px; }
#bang-tdo .td-ct.hiem { border-color: #b77cff; background: rgba(183, 124, 255, .1); }
#bang-tdo .td-nl-hiem { color: #ffd56a; background: rgba(120, 60, 180, .35); }
/* dải chúc mừng khi vừa nhận món hiếm */
#td-hiem-bao { position: fixed; left: 50%; top: 18%; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(92vw, 360px);
  padding: 10px 16px; border-radius: 14px; border: 2px solid #e8b838; color: #fff; font: inherit; text-align: left; cursor: pointer;
  background: linear-gradient(135deg, rgba(70, 30, 120, .95), rgba(30, 20, 60, .95)); box-shadow: 0 0 24px rgba(232, 184, 56, .55);
  animation: td-hiem-vao .5s ease-out, td-hiem-sang 1.6s ease-in-out .5s 3; }
#td-hiem-bao .td-mau { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: var(--m, #888); display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 20px; box-shadow: 0 0 0 2px #e8b838; }
#td-hiem-bao span { display: flex; flex-direction: column; gap: 1px; }
#td-hiem-bao b { font-size: 16px; color: #ffe08a; }
#td-hiem-bao small { font-size: 12px; color: #e6dcff; }
@keyframes td-hiem-vao { from { opacity: 0; transform: translate(-50%, -12px) scale(.85); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes td-hiem-sang { 50% { box-shadow: 0 0 36px rgba(255, 220, 120, .9); } }
/* Tiệm may: ô màu món thay cho ảnh vật phẩm */
.tp-td-mau { width: 34px; height: 34px; border-radius: 50%; background: var(--m, #888); display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 17px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 0 0 2px rgba(255, 255, 255, .15); }
.tp-td-co { color: #6be38a; }
/* 18/11 độ hiếm kiểu game mobile (Thường / Hiếm / Sử thi / Huyền thoại: tu_do_dl.ts phamTD) + thẻ 🎽 Bộ (hiệu ứng bộ) */
#bang-tdo .td-mon.pham1, #bang-tdo .td-mon.pham2, #bang-tdo .td-mon.pham3 { border-color: var(--pham); box-shadow: inset 0 0 0 1px var(--pham); }
#bang-tdo .td-mon.pham3 { background: linear-gradient(160deg, rgba(255, 180, 58, .22), rgba(180, 108, 255, .14)); }
#bang-tdo .td-mon.pham2 { background: linear-gradient(160deg, rgba(180, 108, 255, .16), transparent); }
#bang-tdo .td-ct { border-color: var(--pham, var(--vien-mo)); }
#bang-tdo .td-pham { font-style: normal; font-size: var(--chu-phu); font-weight: 700; color: #10202c; background: var(--pham); border-radius: 6px; padding: 0 6px; }
#bang-tdo .td-thuoc-bo { margin: 4px 0 0; color: var(--m); font-weight: 700; font-size: var(--chu-phu); }
#bang-tdo .td-bo-tong { font-size: var(--chu-phu); color: var(--chu-mo); margin: 2px 0 6px; }
#bang-tdo .td-bo-luoi { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; }
#bang-tdo .td-bo { border: 1px solid var(--vien-mo); border-left: 4px solid var(--m); border-radius: var(--bo-the); padding: 6px 8px; background: rgba(79, 227, 255, .04); }
#bang-tdo .td-bo.hai { background: color-mix(in srgb, var(--m) 10%, transparent); }
#bang-tdo .td-bo.du { background: color-mix(in srgb, var(--m) 20%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--m) 45%, transparent); }
#bang-tdo .td-bo-dau { display: flex; justify-content: space-between; align-items: baseline; }
#bang-tdo .td-bo-dau b { color: var(--m); }
#bang-tdo .td-bo-thanh { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .12); margin: 4px 0; overflow: hidden; }
#bang-tdo .td-bo-thanh i { display: block; height: 100%; background: var(--m); border-radius: 3px; }
#bang-tdo .td-bo-cs { font-size: var(--chu-phu); color: var(--chu-mo); opacity: .75; }
#bang-tdo .td-bo-cs.sang { color: var(--m); opacity: 1; font-weight: 700; }
#bang-tdo .td-bo-ds { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
#bang-tdo .td-bo-mon { font-size: var(--chu-phu); padding: 2px 6px; border-radius: 6px; border: 1px dashed var(--vien-mo); background: transparent; color: var(--chu-mo); }
#bang-tdo .td-bo-mon.co { border-style: solid; color: inherit; }
#bang-tdo .td-bo-mon.mac { border-color: var(--m); color: var(--m); font-weight: 700; }

/* nhuộm đồ (tu_do_ui.ts veNhuom) */
.td-nhuom { margin: 0 0 8px; padding: 6px 8px; border-radius: 10px; background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .1); }
.td-nh-dau { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.td-nh-dau small { font-weight: 400; opacity: .8; margin-left: 4px; }
.td-nh-luoi { display: flex; flex-wrap: wrap; gap: 6px; }
.td-nh-o { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--m); border: 2px solid rgba(255, 255, 255, .35); cursor: pointer; padding: 0; }
.td-nh-o b { position: absolute; right: -4px; bottom: -4px; min-width: 15px; height: 15px; border-radius: 8px; background: #0b2233; color: #e8fdff; font-size: 10px; line-height: 15px; }
.td-nh-o b:empty { display: none; }
.td-nh-o.het { opacity: .45; }
.td-nh-o.dang { box-shadow: 0 0 0 2px #0b2233, 0 0 0 4px #9ff3ff; }
.td-nh-o.chon { transform: scale(1.12); border-color: #fff; }
.td-nh-o.hiem { background: linear-gradient(135deg, #fff1b0, var(--m) 45%, #9a6a10); }
.td-nh-o.goc b { position: static; display: block; background: none; font-size: 15px; color: #fff; text-shadow: 0 1px 2px #000; }
.td-nh-nut { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.td-nh-nut small { opacity: .75; font-size: 11px; }

/* ===== xa_hoi.css ===== */
/* XÃ HỘI GỌN (18/11): thẻ người (the_nguoi_ui.ts), danh sách bạn kiểu mới + trung tâm 3 thẻ (xa_hoi_ui.ts). Màu / viền theo biến của style.css. */

/* ---------- thẻ người: nổi cạnh người vừa chạm, không phủ màn ---------- */
/* 18/11: mọi luật .tn-* ở đây đều có tiền tố #the-nguoi — thẻ thú nuôi (doi_song.css .tn-the / .tn-nut / .tn-dau / .tn-doi) dùng chung tên lớp,
   trước bị dính hàng nút xếp dọc + khung đầu 44 px. */
#the-nguoi { position: fixed; z-index: var(--z-bang-tren); width: min(292px, calc(100vw - 16px)); padding: 10px; background: var(--nen-dam); }
#the-nguoi .tn-dau { display: grid; grid-template-columns: 44px minmax(0, 1fr) 32px; gap: 10px; align-items: center; }
#the-nguoi .tn-anh { width: 44px; height: 44px; border-radius: 50%; image-rendering: pixelated; object-fit: contain; background: rgba(79, 227, 255, .1);
  border: 2px solid var(--vien-mo); }
#the-nguoi .tn-anh.on { border-color: var(--xanh); }
#the-nguoi .tn-anh.rong { display: block; }
#the-nguoi .tn-ten { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#the-nguoi .tn-ten b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#the-nguoi .tn-on { color: var(--xanh); font-style: normal; font-size: 11px; margin-left: 5px; vertical-align: middle; }
#the-nguoi .tn-ten small { color: var(--chu-mo); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
#the-nguoi .tn-ten small img { width: 16px; height: 16px; image-rendering: pixelated; flex: 0 0 auto; }
#the-nguoi .tn-moc { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #ffe9a8; }
#the-nguoi .tn-x { width: 32px; height: 32px; border: 0; background: none; color: var(--chu-mo); font-size: 20px; align-self: start; }
#the-nguoi .tn-hang { display: flex; gap: 6px; margin-top: 10px; }
#the-nguoi .tn-nut { flex: 1 1 0; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 4px 2px; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); color: var(--chu); }
#the-nguoi .tn-nut i { font-style: normal; font-size: 20px; line-height: 1; }
#the-nguoi .tn-nut span { font-size: 12px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#the-nguoi .tn-nut.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .24); }
#the-nguoi .tn-nut:active { background: rgba(79, 227, 255, .3); }
#the-nguoi .tn-ba { flex: 0 0 44px; }
#the-nguoi .tn-ba.chon { border-color: var(--vien); background: rgba(79, 227, 255, .2); }
#the-nguoi .tn-ghe { display: block; width: 100%; margin-top: 8px; min-height: 44px; border-radius: 9px; border: 1px solid rgba(255, 216, 74, .6); background: rgba(255, 216, 74, .12);
  color: #ffe9a8; font-weight: 700; }
:is(#the-nguoi, #ho-so) .tn-cot { display: flex; flex-direction: column; margin-top: 8px; border-top: 1px solid var(--vien-mo); padding-top: 4px; }
:is(#the-nguoi, #ho-so) .tn-cot button { min-height: 44px; text-align: left; padding: 0 10px; border: 0; background: none; color: var(--chu); font-size: 14px; border-radius: 7px; }
:is(#the-nguoi, #ho-so) .tn-cot button:active { background: rgba(79, 227, 255, .14); }
:is(#the-nguoi, #ho-so) .tn-cot button.do { color: var(--do); font-weight: 700; }

/* chấm mốc Dây Thân ●●●○○ */
.dth-cham { color: #ffd84a; letter-spacing: 1px; font-size: 10px; white-space: nowrap; }
.dth-cham i { font-style: normal; color: rgba(255, 216, 74, .35); }

/* ---------- danh sách bạn kiểu mới: dòng 64 px, một dòng nơi chốn, một nút ---------- */
.xh-ban { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; min-height: 64px;
  border: 1px solid var(--vien-mo); border-radius: 10px; margin-bottom: 6px; background: rgba(79, 227, 255, .04); cursor: pointer; }
.xh-ban:active { background: rgba(79, 227, 255, .12); }
.xh-anh.to { width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(143, 185, 200, .35); filter: grayscale(.5) brightness(.85); }
.xh-ban.dang-on .xh-anh.to { border-color: var(--xanh); filter: none; box-shadow: 0 0 8px rgba(111, 255, 210, .35); }
.xh-ten { display: flex; align-items: center; gap: 6px; min-width: 0; }
.xh-ten b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xh-mot { min-width: 76px; min-height: 44px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08);
  color: var(--chu); font-weight: 700; white-space: nowrap; }
.xh-mot.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.xh-moi-dong { display: grid; grid-template-columns: 32px minmax(0, 1fr) 44px 44px; gap: 8px; align-items: center; padding: 4px 6px; margin-bottom: 6px;
  border: 1px solid var(--vang); border-radius: 10px; background: rgba(255, 216, 74, .06); }
.xh-moi-dong b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xh-anh.nho { width: 32px; height: 32px; }
.xh-tron { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); color: var(--chu); font-size: 18px; }
.xh-tron.chinh { border-color: var(--xanh); color: var(--xanh); background: rgba(111, 255, 210, .12); }
.xh-them-ten { display: block; width: 100%; margin-top: 10px; min-height: 44px; border-radius: 9px; border: 1px dashed var(--vien-mo); background: none; color: var(--chu-mo); }
.xh-tim { margin-top: 10px; }

/* ---------- thẻ Tin nhắn: hội thoại nhắn riêng (dưới quà chờ nhận) ---------- */
.xh-hoi { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 56px; padding: 6px 8px;
  margin-bottom: 6px; border: 1px solid var(--vien-mo); border-radius: 10px; background: rgba(79, 227, 255, .04); color: var(--chu); text-align: left; }
.xh-hoi.moi { border-color: #ff5aa8; }
.xh-hoi .xh-giua { display: flex; flex-direction: column; gap: 2px; }
.xh-hoi .nho-mo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xh-hoi .nr-anh { position: relative; }

/* ---------- hồ sơ đầy đủ gọn: 3 ô số, tối đa 3 nút chính + "…" ---------- */
.hs-luoi.ba { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hs-luoi.ba .hs-o { text-align: center; padding: 7px 4px; }
.hs-nut.hs-nut-gon { display: flex; }
.hs-nut-gon button { flex: 1 1 0; min-width: 0; min-height: 44px; }
.hs-nut-gon .hs-ba { flex: 0 0 48px; font-size: 18px; font-weight: 900; }
.hs-nut-gon .hs-ba.chon { border-color: var(--vien); background: rgba(79, 227, 255, .2); }
#ho-so .hs-cot { margin-top: 6px; }

/* ---------- tặng gọn: dòng "Thêm lời nhắn / số lượng" đóng sẵn ---------- */
.tang-them { margin: 4px 0 2px; }
.tang-them summary { min-height: 40px; display: flex; align-items: center; color: var(--chu-mo); font-size: 13px; cursor: pointer; list-style: none; }
.tang-them summary::before { content: "▸"; margin-right: 6px; }
.tang-them[open] summary::before { content: "▾"; }
.tang-them summary::-webkit-details-marker { display: none; }

/* hàng "Đôi" trong thẻ người + dải lời mời động tác đôi (dong_tac.ts) */
#the-nguoi .tn-doi { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
#the-nguoi .tn-doi small { font-size: 11px; opacity: .75; width: 28px; flex: none; }
#the-nguoi .tn-doi button { flex: 1 1 0; min-width: 0; min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .22); color: inherit; cursor: pointer; padding: 2px; }
#the-nguoi .tn-doi button i { font-style: normal; font-size: 16px; line-height: 1; }
#the-nguoi .tn-doi button span { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#the-nguoi .tn-doi button:active { transform: scale(.94); }
#dtac-moi { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; max-width: min(92vw, 420px); overflow: hidden;
  background: rgba(6, 26, 40, .92); border: 1px solid rgba(79, 227, 255, .55); border-radius: 14px; color: #e8fdff; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
#dtac-moi[hidden] { display: none; }
#dtac-moi .dtm-i { font-size: 22px; }
#dtac-moi .dtm-chu { font-size: 13px; font-weight: 700; flex: 1 1 auto; min-width: 0; }
#dtac-moi button { min-height: 40px; border-radius: 10px; cursor: pointer; font-weight: 700; color: inherit; }
#dtac-moi .dtm-dy { padding: 0 16px; background: rgba(79, 227, 255, .3); border: 1px solid rgba(79, 227, 255, .8); }
#dtac-moi .dtm-x { width: 40px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .2); }
#dtac-moi .dtm-thanh { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #4fe3ff; transform-origin: left; animation: dtm-het linear forwards; }
@keyframes dtm-het { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* lời mời thăm đảo (moi_tham_ui.ts): hai nút nhỏ dưới dòng nơi chốn của bạn đang online */
.xh-ban .xh-mt { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.xh-ban .xh-mt button { min-height: 32px; padding: 0 10px; font-size: 12.5px; font-weight: 700; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07); color: inherit; white-space: nowrap; }
@media (max-width: 380px) { .xh-ban .xh-mt button { padding: 0 7px; font-size: 12px; } }
/* ===== ban_tin.css ===== */
/* BẢN TIN VẮNG MẶT (ban_tin_vang.ts) + VIỆC KẾ (viec_ke.ts), 17/11/2026.
   Thẻ #ban-tin tự đặt chỗ (không dùng .the-nhac: thẻ cao 5-6 dòng không lọt dải trống của thong_bao_hang.ts xepThe): giữa màn, dưới dải HUD trên, trên vùng ngón cái.
   Màn dọc: rộng gần hết màn. Màn ngang cảm ứng / thấp: hẹp (~34% bề rộng) nằm giữa cần điều khiển (trái) và cụm nút hành động (phải), cao tối đa bằng phần màn
   còn trống, vượt thì cuộn trong thẻ. Dòng cao >= 48 px (44 px ở màn thấp), nút "Tới" >= 44 px, chữ >= 13 px. */
/* rà UI 17/11: thẻ từng nằm GIỮA màn đè nhân vật (dọc 390×844 che 22,5%) → thẻ ở MÉP DƯỚI, ngay trên vòng cung nút / thanh cầm, thấp hơn
   nhân vật (cao tối đa tới ~49% màn từ dưới lên, dài thì cuộn trong thẻ). Máy tính: góc dưới phải. Màn thấp: luật @media bên dưới. */
#ban-tin { position: fixed; z-index: var(--z-the-nhac, 20); left: 50%; top: auto; bottom: calc(var(--day, 0px) + var(--vong-dinh, 180px) + 10px); transform: translateX(-50%);
  width: min(400px, calc(100vw - 2 * (var(--mep, 10px) + 8px))); box-sizing: border-box; padding: 10px 12px 8px; border-radius: 12px;
  max-height: max(96px, calc(var(--cao, 100vh) * .49 - var(--vong-dinh, 180px) - 40px)); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--vien, #4fe3ff); background: var(--nen, rgba(7, 24, 40, .94)); color: var(--chu, #e2fbff);
  box-shadow: var(--phat, 0 0 14px rgba(79, 227, 255, .25)), 0 8px 24px rgba(0, 0, 0, .5); font-size: 14px; line-height: 1.4; animation: bt-hien .25s ease-out; }
body:not(.cam-ung) #ban-tin { left: auto; right: calc(var(--mep, 10px) + var(--phai, 0px) + 8px); bottom: calc(var(--day, 0px) + 110px * var(--hud, 1)); transform: none; max-height: min(320px, calc(var(--cao, 100vh) * .42)); }
#ban-tin .bt-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin: -4px -4px 0 0; }
#ban-tin .bt-tieu { min-width: 0; }
#ban-tin .bt-tieu b { display: block; font-size: 15px; }
#ban-tin small { display: block; color: var(--chu-mo, #9fc6d0); font-size: 13px; }
#ban-tin .bt-x { flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: inherit; font-size: 22px; opacity: .75; cursor: pointer; }
.bt-ds { list-style: none; margin: 6px 0 0; padding: 0; }
.bt-ds li { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 2px 0; border-top: 1px solid rgba(79, 227, 255, .16); }
.bt-ds li:first-child { border-top: 0; }
.bt-ds i { flex: none; width: 28px; text-align: center; font-style: normal; font-size: 20px; line-height: 1; }
.bt-ds span { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
#ban-tin .bt-toi { flex: none; min-width: 60px; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--vien, #4fe3ff);
  background: linear-gradient(#1f6f8c, #134a63); color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
@keyframes bt-vao { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } to { opacity: 1; transform: translate(-50%, -50%); } }
body:is(.ngam-canh, .dang-sx, .dang-xay) #ban-tin { display: none; }
/* màn ngang / thấp (điện thoại ngang): nằm giữa cần điều khiển (trái) và cụm nút phải, trên thanh cầm (đáy); tiêu đề một dòng cho đỡ cao */
@keyframes bt-hien { from { opacity: 0; } to { opacity: 1; } }
@media (max-height: 500px) {
  #ban-tin { top: auto; bottom: calc(var(--day, 0px) + 66px); transform: translateX(-50%); animation-name: bt-hien;
    width: clamp(270px, 34vw, 340px); padding: 6px 10px 4px; max-height: calc(var(--cao, 100vh) - var(--day, 0px) - 66px - 46px); }
  #ban-tin .bt-tieu b { display: inline; font-size: 14px; }
  #ban-tin small { display: inline; margin-left: 6px; font-size: 12.5px; }
  .bt-ds { margin-top: 2px; }
  .bt-ds li { min-height: 44px; padding: 0; } .bt-ds i { font-size: 18px; width: 24px; } .bt-ds span { font-size: 13px; }
  #ban-tin .bt-toi { min-width: 52px; padding: 0 8px; }
}
@media (max-height: 500px) and (min-width: 1000px) { #ban-tin { width: min(400px, 34vw); } }

/* chip Việc kế: cùng cột chip với #qn-chip, xep_chip.ts dời khi chạm vật khác */
#vk-chip { position: fixed; z-index: var(--z-chip); left: calc(var(--mep, 8px) + var(--le, 0px)); top: calc(var(--ct-day, 150px) + 8px);
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; max-width: min(70vw, 300px); padding: 4px 11px 4px 8px; border-radius: 16px;
  border: 1.5px solid #5fd0e8; background: rgba(6, 30, 44, .84); color: #d6f6ff;
  font: 800 13px/1.1 system-ui, sans-serif; white-space: nowrap; cursor: pointer; pointer-events: auto; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
#vk-chip[hidden] { display: none; }
#vk-chip i { font-style: normal; font-size: 15px; line-height: 1; }
#vk-chip span { overflow: hidden; text-overflow: ellipsis; }
#vk-chip.di { border-color: #ffd84a; color: #ffe9a8; }
/* vùng chạm ẩn 44 px cho chip nhỏ trên cảm ứng (như các chip khác, xep_chip.ts đo cả vùng này) */
body.cam-ung #vk-chip::after { content: ""; position: absolute; inset: -6px -3px; }
body:is(.dang-xay, .dang-sx, .trong-hang, .ngam-canh, .tt-an) #vk-chip { display: none !important; }
/* ===== hud_ngang.css ===== */
/* CHỖ RIÊNG CHO TỪNG CỤM HUD — điện thoại ngang thấp (iPhone ngang, cao ≤ 500 px) + vài chỗ màn dọc (16/11, ảnh người chơi:
   "icon xếp chồng lên nhau hoặc bị che màn hình, cài kiểu gì cũng bị"). Nạp SAU mọi tệp CSS khác (index.html).
   Bố cục màn ngang thấp, trái → phải:
     hàng 1  [chỉ số]      [giờ]            [Chat · Túi · Menu] (bản đồ nhỏ)
     hàng 2  (👁)           [thanh trận cướp biển · Về đảo · Bỏ trận]   [dải cập đảo / chip chỉ đường]
     giữa    (🎁 🏴)                                                  [▼ n/N ▲  ⎈ Cầm lái]
     đáy     (cần điều khiển)   [thanh cầm]      (vòng cung nút ngữ cảnh quanh NÚT CHÍNH, nút ít dùng gom vào "…")
   Cụm nào vẫn đụng nhau (chữ dài, nhiều chip cùng lúc) thì xep_chip.ts dời theo thứ tự ưu tiên. Kiểm: tools/kiem_chong_ui.mjs. */

@media (orientation: landscape) and (max-height: 500px) {
  /* hàng Chat · Túi · Menu lên CÙNG hàng với khung chỉ số (trước: hàng 2, đè "Về đảo / Bỏ trận" của thanh trận).
     Dải giờ co lại trong khoảng giữa khung chỉ số và hàng nút (--dock-rong do hud.ts đo bề rộng hàng nút). */
  html body.cam-ung #nut-tren { top: calc(var(--mt) + var(--tren)); flex-wrap: nowrap; }
  html body.cam-ung #hang-tren { right: calc(var(--mep) + var(--phai) + var(--ban-do) + 18px + var(--dock-rong, 170px)); }

  /* cụm đổi boong gọn: ▼ 3/5 ▲ (bỏ tên khu — tên đã hiện nổi trên đầu nhân vật khi đổi tầng) → nằm MỘT hàng với nút Cầm lái */
  html body.cam-ung #tang-cum #tang-ten { display: none; }
  html body.cam-ung #tang-cum #tang-chi { min-width: 38px; max-width: 56px; padding: 0 2px; }
  html body.cam-ung #tang-cum .tang-nut { min-width: 46px; min-height: 46px; width: 46px; height: 46px; padding: 0; }
  html body.cam-ung #cum-lai { flex-wrap: nowrap; max-width: none; }
  html body.cam-ung #lai-nut-cam { min-height: 46px; padding: 6px 12px; }

  /* thanh trận cướp biển: hàng 2 giữa màn; chữ dài tự cắt "…" để cả thanh + hai nút vừa khoảng giữa hai cột chip */
  html body.cam-ung #ph-thanh { top: calc(var(--mt) + var(--tren) + 64px); max-width: calc(100vw - 2 * (var(--mep) + var(--ban-do)) - var(--le) - var(--phai) - 150px); }
  html body.cam-ung #ph-thanh-nd { min-width: 0; }
  html body.cam-ung #ph-thanh-ten { min-width: 0; white-space: nowrap; }
  html body.cam-ung #ph-thanh .ph-vach { flex-basis: 44px; }
  html body.cam-ung :is(#ph-thanh-ve, #ph-thanh-bo) { padding: 4px 9px; }

  /* dải cập đảo (tên đảo tài nguyên): một dòng ngắn dưới bản đồ nhỏ, chữ dài cắt "…" */
  html body.cam-ung #dao-thanh .dao-chip { max-width: min(220px, 34vw); }
}

/* Cài đặt trên điện thoại (ngang thấp / hẹp): tấm phủ như mọi bảng lớn khác — không còn hộp 560 px giữa màn để HUD lòi nửa chữ hai bên
   ("Nhận q…", nửa nút Cầm lái); thân bảng cuộn bên trong, không bị cắt đáy. */
@media (max-width: 620px), (max-height: 500px) {
  html body.cam-ung .bang.lon#bang-caidat { left: calc(6px + var(--le)); right: calc(6px + var(--phai)); top: calc(6px + var(--tren)); bottom: calc(6px + var(--day));
    width: auto; height: auto; max-height: none; transform: none; }
  html body.cam-ung #bang-caidat .cd-than { min-height: 0; overflow-y: auto; }
}


/* dải cập đảo trên cảm ứng: chữ dài ("Đảo Dừa ở gần · lái lại sát để cập") cắt "…" trong chip thay vì tràn ra ngoài chip, lòi khỏi mép màn */
html body.cam-ung #dao-thanh .dao-chip { min-width: 0; }
html body.cam-ung #dao-chip-nd { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ===== loai_man.css ===== */
/* LOẠI MÀN HÌNH (trinh_khach/src/loai_man.ts gắn lớp lên <body>; rà UI 17/11 mục 3.8 + biên bản Gemini loai_man_hinh.md).
   Lớp: dt-doc-nho · dt-doc · dt-ngang · dt-ngang-thap · bang-doc (máy bảng dọc + màn gập mở) · bang-ngang · pc-hep · pc · pc-rong, cờ cao-hut.
   Tệp nạp SAU style.css / hud_gon.css; mọi luật mở đầu bằng `html body` để thắng các luật @media cũ (orientation / max-width) mà không phải sửa chúng.
   Đích kiểm (docs/ra_ui_17_11.md mục "Sau khi sửa"): điện thoại dọc ≤ 15 thứ chạm được, che ≤ 25 %, không nút cảm ứng < 44 px. */

/* ---------- 0) mọi khổ ---------- */
/* chủ game 17/11 "Cất vào menu đi": nút Facebook (#nut-zalo) + nhóm Zalo chỉ còn trong Menu → nhóm Cộng đồng (hud.ts NHOM) */
html body #nut-zalo, html body #nut-nhom-zalo { display: none !important; }
/* đang ở đảo nhà (thuyền đậu bến nhà): ba chip chỉ đường (🏝 tên đảo nhà, 🏙 thành phố, 🌲 rừng) vô dụng → ẩn; rời bến là hiện lại.
   Nhiệm vụ cốt truyện tới cảng lúc đang ở nhà chỉ "Ra khơi" trước (cot_truyen.ts c.pho → raKhoi), ra khơi rồi mới cần chip 🏙 */
html body.dn-o-nha :is(#dn-ve, #tp-ve, #rg-ve) { display: none !important; }

/* ---------- 1) cảm ứng: vùng chạm ≥ 44 px ---------- */
/* nút 👁 ngắm cảnh: vào Menu → Khác (hud.ts); đang ngắm thì nút ✕ ở mép trên vẫn hiện để thoát */
html body.cam-ung:not(.ngam-canh) #nut-ngam { display: none !important; }
html body.cam-ung #ghim-chip { left: calc(8px + var(--le, 0px) + env(safe-area-inset-left, 0px)); }
/* chân dung, khoá góc 🔓 (Cài đặt cho xoay), chip 👥 (mở danh sách người đang chơi): đủ 44 */
html body.cam-ung.toi-gian #chi-so #cs-chan { width: 44px; height: 44px; }
html body.cam-ung #nut-khoa-goc::before { inset: -8px; }
/* dải giờ (cảm ứng): giữ chiều cao 44 px để nút bên trong chạm đủ 44×44 px, bỏ margin âm tránh tràn mép trên */
html body.cam-ung.toi-gian #dong-ho { height: 44px; min-height: 44px; margin-top: 0; margin-bottom: 0; }
html body.cam-ung:is(.bang-doc, .bang-ngang) #dong-ho { height: 44px; min-height: 44px; }
html body.cam-ung #dong-ho :is(#online, #toa-do, #dh-gio-tuan) { position: relative; }
html body.cam-ung #dong-ho :is(#online, #toa-do, #dh-gio-tuan)::after { content: ""; position: absolute; left: -2px; right: -2px; top: min(0px, calc((100% - 44px) / 2)); bottom: min(0px, calc((100% - 44px) / 2)); }
/* chip Việc kế (đã gộp chip Nhận quà): vùng chạm cao đúng 44; nháy vàng khi quà ngày đầu tiên đang chờ (qua_ngay.ts tuMoQuaNgay) */
html body.cam-ung #vk-chip::after { inset: auto -3px; top: min(-6px, calc((100% - 44px) / 2)); bottom: min(-6px, calc((100% - 44px) / 2)); }
#vk-chip.nhay { border-color: #ffd84a; color: #ffe9a8; animation: vk-nhay 1s ease-in-out infinite alternate; }
@keyframes vk-nhay { to { box-shadow: 0 0 14px rgba(255, 216, 74, .85); } }
html.giam-cd #vk-chip.nhay { animation: none; }

/* ---------- 2) máy bảng dọc + màn gập mở (cạnh ngắn ≥ 600, dọc) ----------
   Trước: dính luật điện thoại dọc (`orientation: portrait`) → --lt 36, #chi-so 150 px, nút chính 133–152 px (--nen-co 1,28), Menu đè dải giờ
   ở 673×841 (khe 621–699 px), thanh cầm co còn 3 ô. Giờ: nấc HUD 1,14, lối tắt + Menu nhân theo --hud, dải giờ xuống dưới khung chỉ số như điện thoại dọc. */
html body.cam-ung.bang-doc { --nen-co: 1.14; --lt: max(44px, calc(44px * var(--hud))); --menu: max(48px, calc(50px * var(--hud))); --can-rong: min(28vw, 210px); }
html body.cam-ung.bang-doc #chat { bottom: calc(var(--o-cam) + 28px + var(--day)); }
html body.cam-ung.bang-ngang { --nen-co: 1.2; --lt: max(44px, calc(44px * var(--hud))); --menu: max(48px, calc(52px * var(--hud))); --can-rong: min(42vw, 300px); }
@media (max-height: 640px) {
  html body.cam-ung.bang-ngang { --nen-co: 1.1; --bang-tren: calc(64px * var(--hud)); --bang-duoi: calc(58px * var(--hud)); }
}
html body.cam-ung.bang-ngang #nut-tren { top: calc(var(--mt) + var(--tren)); flex-wrap: nowrap; }
html body.cam-ung.bang-ngang #hang-tren { right: calc(var(--mep) + var(--phai) + var(--ban-do) + 18px + var(--dock-rong, 150px)); }
html body.cam-ung:is(.bang-doc, .bang-ngang) #toa-do { min-height: 44px; display: inline-flex; align-items: center; }
html body.cam-ung.bang-doc #hang-tren { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 5px; }
html body.cam-ung.bang-doc #dong-ho { justify-self: start; }
html body.cam-ung.bang-doc #chi-so:not(.gon) { width: calc(176px * var(--hud)); }
html body.cam-ung.bang-doc #nut-tren { gap: 6px; }
/* chip cột trái / phải lớn theo máy (trước giữ 12–13 px cứng) */
html body.cam-ung:is(.bang-doc, .bang-ngang) :is(#vk-chip, #cd-chip, #dn-ve, #tp-ve, #rg-ve, #ghim-chip, #xt-chip) { font-size: calc(13px * var(--hud)); min-height: calc(32px * var(--hud)); }

/* ---------- 3) điện thoại ---------- */
/* màn cao hụt (trình duyệt trong Facebook / Zalo, dọc < 680): chat không bị ép còn 2 dòng, ô chi tiết Túi không chiếm chỗ lưới */
html body.cam-ung.cao-hut #chat { height: min(250px, calc(var(--cao, 100vh) * .38)); }
html body.cao-hut #bang-tui #chi-tiet { max-height: 34%; }

/* ---------- 4) máy tính ---------- */
/* cửa sổ hẹp (< 1100): dòng gợi ý phím bị cụt đuôi → bỏ (phím tắt vẫn có trong Hướng dẫn) */
html body.pc-hep #goi-y { display: none !important; }
/* PC rộng: cột chip trái / phải nhân theo --hud như hàng nút + thanh cầm (trước Cướp đảo vẫn 93×26 chữ 12 px ở 1920) */
html body.pc-rong :is(#vk-chip, #cd-chip, #dn-ve, #tp-ve, #rg-ve, #ghim-chip, #xt-chip) { font-size: calc(12.5px * var(--hud)); min-height: calc(30px * var(--hud)); }

/* ---------- 5) Menu dạng thẻ: cấp 2 thành LƯỚI trên màn dọc (trước một hàng cuộn ngang, 6–7 mục khuất, chữ 10 px bị cắt) ----------
   điện thoại dọc 5 cột; màn gập / máy bảng dọc 6 cột (luật cuối mục) */
@media (orientation: portrait) {
  html body.menu-the #mt-hang { flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; max-height: calc(var(--cao, 100vh) * .5);
    -webkit-mask-image: none !important; mask-image: none !important; scroll-snap-type: none; }
  html body.menu-the #mt-hang .mt-n, html body.menu-the #mt-hang .mt-n[data-lui] { flex: 0 0 calc((100% - 24px) / 5); max-width: none; height: 62px; padding-left: 2px; padding-right: 2px; }
  html body.menu-the #mt-hang .mt-n span { font-size: 11px; letter-spacing: 0; white-space: normal; text-overflow: clip; line-height: 1.1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; }
  html body.menu-the #mt-hang .mt-n img, html body.menu-the #mt-hang .mt-n .mt-bt { width: 24px; height: 24px; line-height: 24px; font-size: 20px; }
}
/* mọi khổ: tên mục dài ("Sàn giao dịch", "Tải app Android") xuống 2 dòng thay vì bị cắt "…" */
html body.menu-the #mt-hang .mt-n span { white-space: normal; text-overflow: clip; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; }
/* chân chữ g / y dòng hai bị cắt ở màn ngang ("Quà mỗi ngàv", hoc_avatar_ui.md việc 5): dòng cao hơn + đệm dưới, khoảng hình–chữ hẹp lại.
   Gốc lỗi: span có overflow hidden nên flex cột co nó lại khi hình + 2 dòng cao hơn nút 64 px → không cho co (flex: none), bớt đệm trên / dưới. */
html body.menu-the #mt-hang .mt-n { gap: 2px; padding-top: 2px; padding-bottom: 2px; }
html body.menu-the #mt-hang .mt-n span { flex: none; line-height: 1.2; padding-bottom: 1px; }
@media (orientation: portrait) and (min-width: 621px) { html body.menu-the #mt-hang .mt-n, html body.menu-the #mt-hang .mt-n[data-lui] { flex-basis: calc((100% - 30px) / 6); height: 66px; } }

/* ---------- 6) điện thoại dọc: Túi · Menu · Chat MỘT hàng sát mép trên (hoc_avatar_ui.md mục 4 việc 7; họp hop_hud_gon_2_1811) ----------
   Trước: max-width (style.css) chỉ còn ~136 px < 3 nút 44 + 2 khe 4 = 140 → Chat rớt xuống hàng hai, cụm hai tầng lơ lửng giữa-trên.
   Giờ: một hàng không xuống dòng, ba nút cùng 44 px, chỉ biểu tượng (chữ "Menu" vào aria-label), neo cùng đỉnh với khung chỉ số, sát trái bản đồ nhỏ.
   Khung chỉ số bung số (150–184 px) / HUD to / màn 360 thì xep_chip.ts vẫn dời cả hàng xuống ngay dưới chỉ số (vẫn một hàng).
   Nút Túi là lối tắt bật sẵn (hud.ts CD.lt), một chạm mở Túi (góp ý người chơi #13 / #16). */
html body.cam-ung:is(.dt-doc, .dt-doc-nho) #nut-tren { flex-wrap: nowrap; max-width: none; gap: 4px; align-items: center;
  right: calc(var(--mep) + var(--phai) + var(--ban-do) + 6px); }
html body.cam-ung:is(.dt-doc, .dt-doc-nho) #nut-tren > :is(.nut-vuong:not(.lt-an), #nut-menu) { width: 44px; height: 44px; flex: 0 0 44px; min-width: 44px; margin: 0; border-radius: 50%; }
html body.cam-ung:is(.dt-doc, .dt-doc-nho) #nut-menu > span { display: none; }
html body.cam-ung:is(.dt-doc, .dt-doc-nho) #nut-menu .nv-chu { font-size: 21px; line-height: 1; }
/* ===== nut_dong.css ===== */
/* NÚT ĐÓNG LUÔN THẤY (18/11, góp ý người chơi: màn ngang 844×390 nhiều bảng phải cuộn xuống / đi ra xa mới tắt được).
   Quy tắc chung cho MỌI bảng / thẻ / hộp nổi (phần JS: trinh_khach/src/bang_quan_ly.ts — Esc đóng lớp trên cùng, chạm ngoài thẻ nhẹ):
   1. Nút đóng ở ĐẦU: hàng .tieu-de (nút .nut-x trong đó) hoặc nút × là con ĐẦU TIÊN của thẻ.
   2. Dính khi cuộn: bảng nào tự cuộn cả khung (overflow-y trên chính bảng) thì hàng đầu / nút × dính mép trên (sticky), không trôi theo nội dung.
      Bảng .bang.lon chuẩn (khung flex cột, chỉ thân cuộn) vốn đã đúng — luật ở đây chỉ đỡ các bảng tự cuộn cả khung.
   3. Vùng chạm ≥ 44 px trên cảm ứng (36 px trên máy tính).
   4. Màn kết quả chỉ có MỘT nút tắt ở cuối (Đã rõ / Nhận): nút đó dính mép dưới khi màn phải cuộn.
   Bảng mới: dùng .bang.lon > .tieu-de > … + button.nut-x là đủ (docs/ui.md "KHUNG BẢNG THỐNG NHẤT"); thẻ nhỏ tự vẽ thì gắn lớp .x-dinh cho nút ×. */

/* ---- 1 + 2. hàng đầu bảng dính mép trên của khung cuộn ----
   :where() giữ độ ưu tiên THẤP (0,2,0): luật riêng của từng bảng (#ho-so .tieu-de .nut-x 48 px…) vẫn thắng. */
:where(.bang:not(#nhiem-vu, #chat)) > .tieu-de { position: sticky; top: 0; z-index: 3; }
/* nền đặc để chữ cuộn bên dưới không lộ qua hàng đầu (bảng .lon đã có dải màu, đặt màu nền dưới dải đó) */
:where(.bang:not(.lon, #nhiem-vu, #chat)) > .tieu-de { background-color: var(--nen-dam, #06141f); }
.bang.lon > .tieu-de { background-color: var(--nen-dam, #06141f); }

/* ---- 3. nút × trong hàng đầu của bảng nhỏ (.bang không .lon: tự lái, lò nung, người đang chơi, khoá rương…) ---- */
:where(.bang:not(.lon, #nhiem-vu, #chat)) > .tieu-de .nut-x { min-width: var(--cham-pc, 36px); min-height: var(--cham-pc, 36px); font-size: 22px; color: var(--chu); border-radius: var(--bo-the, 8px); margin: -4px -6px -4px auto; }
body.cam-ung :where(.bang:not(.lon, #nhiem-vu, #chat)) > .tieu-de .nut-x { min-width: 44px; min-height: 44px; font-size: 26px; }

/* ---- nút × đứng đầu thẻ tự vẽ (không có .tieu-de): dính góc trên phải, 44 px ----
   float + sticky: nút là con đầu của khung cuộn, trôi phải, dính khi cuộn; margin âm để không đẩy dòng chữ đầu xuống. */
.x-dinh { position: sticky !important; top: 0; float: right; z-index: 3; width: 44px !important; height: 44px !important; margin: -8px -10px -36px 6px !important;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: 24px !important; line-height: 1; color: var(--chu, #e8f8ff) !important;
  border-radius: 10px; border: 1px solid var(--vien-mo, rgba(79, 227, 255, .35)) !important; background: var(--nen-dam, #06141f) !important; }
body:not(.cam-ung) .x-dinh { width: 36px !important; height: 36px !important; margin-bottom: -28px !important; font-size: 20px !important; }

/* thẻ vật (Cách kiếm): khung .tv-hop tự cuộn */
#the-vat .tv-dau { padding-right: 0; }
/* thẻ boss / kho báu: trước không có trần cao → màn ngang 390 px nội dung dài lòi khỏi đáy */
/* (boss_bien.css / kho_bau.css nạp sau tệp này nên luật ở đây phải mạnh hơn: html body #…) — thẻ đặt ở top 22% → cao tối đa 78% trừ lề đáy */
html body #bb-the, html body #kb-the { max-height: calc(78% - 12px - var(--day, 0px)); overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 500px) { html body #bb-the, html body #kb-the { top: calc(8px + var(--tren, 0px)); max-height: calc(100% - 16px - var(--tren, 0px) - var(--day, 0px)); } }
#bb-the h3, #kb-the h3 { margin-left: 44px; margin-right: 44px; }
/* thẻ người: nút × 44 px; trần cao + cuộn (nhiều nút, màn ngang thấp) */
#the-nguoi { max-height: calc(var(--cao, 100vh) - 16px - var(--tren, 0px) - var(--day, 0px)); overflow-y: auto; overscroll-behavior: contain; }
#the-nguoi .tn-dau { grid-template-columns: 44px minmax(0, 1fr) 44px; }
/* hàng đầu (ảnh · tên · ×) dính mép trên khi thẻ cuộn; top âm = bù lề trong 10 px của thẻ */
#the-nguoi > .tn-dau { position: sticky; top: -10px; z-index: 2; margin: -10px -10px 0; padding: 10px 10px 4px; background: var(--nen-dam, #06141f); }
body.cam-ung .tn-x, body.cam-ung #the-nguoi .tn-x { width: 44px; height: 44px; font-size: 24px; color: var(--chu); }
/* hộp chọn mồi câu: thêm × (moi_cau_ui.ts) */
#hop-moi .hm-x { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; margin: -4px -4px 0 4px; padding: 0; font-size: 22px; line-height: 1;
  border-radius: 10px; border: 1px solid var(--vien-mo, rgba(79, 227, 255, .35)); background: var(--nen-dam, #06141f); color: var(--chu, #e8f8ff); }
body:not(.cam-ung) #hop-moi .hm-x { width: 36px; height: 36px; }
#hop-moi { max-height: calc(var(--cao, 100vh) - 16px); overflow-y: auto; overscroll-behavior: contain; }

/* ---- 4. màn kết quả: nút tắt duy nhất ở cuối dính mép dưới khi màn phải cuộn ---- */
#ruong-nhan, #hc-chim-ok, #mg-kq-ok { position: sticky; bottom: 0; z-index: 3; }
/* ===== sanh.css ===== */
/* SẢNH ĐĂNG NHẬP + MÀN TẢI + TẠO NHÂN VẬT kiểu game mobile (20/11/2026; mã: trinh_khach/src/sanh.ts, tai.ts, tao_nv_ui.ts; khung: public/index.html).
   Ba khổ: điện thoại dọc (390 × 844), điện thoại ngang (844 × 390, max-height 500), PC (1366 × 768). Nút ≥ 48 px.
   MƯỢT: không backdrop-filter trên lớp phủ toàn màn (cảnh 3D đang chạy phía sau), hoạt ảnh chỉ dùng transform / opacity. */

/* ================= MÀN TẢI ================= */
#man-tai { display: block; overflow: hidden; }
#man-tai .tai-nen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 46% 50%; opacity: 0; transform: scale(1.06);
  transition: opacity .6s ease, transform 6s ease-out; pointer-events: none; }
#man-tai .tai-nen.co { opacity: 1; transform: scale(1); }
#man-tai::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 16, 30, .5) 0%, rgba(4, 16, 30, .04) 30%, rgba(4, 16, 30, 0) 55%, rgba(4, 16, 30, .78) 100%); }
#man-tai .tai-logo { position: absolute; z-index: 1; left: 0; right: 0; top: calc(var(--tren) + 9%); text-align: center; pointer-events: none; }
#man-tai .tai-logo .logo, #dang-nhap .logo { font-size: clamp(46px, 13.5vw, 76px); line-height: 1; letter-spacing: .1em; font-weight: 900; color: #fff4cf;
  text-shadow: 0 3px 0 #b8741e, 0 6px 0 #5a3410, 0 10px 18px rgba(0, 0, 0, .55), 0 0 26px rgba(255, 210, 122, .45); }
#man-tai .tai-logo .logo-phu, #dang-nhap .logo .logo-phu { display: block; margin-top: 10px; font-size: clamp(13px, 3.6vw, 17px); letter-spacing: .22em; color: #e2fbff;
  text-transform: uppercase; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); opacity: 1; }
#man-tai .tai-khung { position: absolute; z-index: 1; left: 50%; bottom: calc(var(--day) + 6%); transform: translateX(-50%); width: min(calc(100vw - 40px), 560px); text-align: left; }
#man-tai .tai-hang { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
#man-tai .tai-chu { margin: 0; font-size: 14px; font-weight: 700; color: #e2fbff; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#man-tai .tai-pt { flex: 0 0 auto; font-size: 20px; font-weight: 900; color: #ffd27a; font-variant-numeric: tabular-nums; text-shadow: 0 2px 4px rgba(0, 0, 0, .8); }
#man-tai .tai-thanh { height: 18px; padding: 3px; border-radius: 999px; background: rgba(4, 14, 26, .82); border: 1px solid rgba(255, 220, 150, .5); box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
#man-tai .tai-thanh span { position: relative; overflow: hidden; border-radius: 999px; background: linear-gradient(180deg, #ffe08a, #f29a1f); box-shadow: 0 0 10px rgba(255, 190, 80, .7); transition: width .35s ease; }
#man-tai .tai-thanh span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
  transform: translateX(-100%); animation: tai-loe 1.6s ease-in-out infinite; }
@keyframes tai-loe { to { transform: translateX(100%); } }
#man-tai .tai-meo { margin-top: 12px; min-height: 0; padding: 8px 12px; border-radius: 12px; background: rgba(4, 14, 26, .66); color: #cfeaf5; font-size: 13px; line-height: 1.4; text-align: center; }
#man-tai .tai-meo:empty { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  #man-tai .tai-logo { top: calc(var(--tren) + 7%); }
  #man-tai .tai-logo .logo { font-size: 50px; }
  #man-tai .tai-logo .logo-phu { margin-top: 6px; }
  #man-tai .tai-khung { bottom: calc(var(--day) + 5%); width: min(calc(100vw - 48px - var(--le) - var(--phai)), 560px); }
  #man-tai .tai-meo { margin-top: 8px; padding: 6px 10px; font-size: 12px; }
}
@media (min-width: 900px) and (min-height: 600px) { #man-tai .tai-logo { top: 12%; } #man-tai .tai-logo .logo { font-size: 84px; } }
@media (prefers-reduced-motion: reduce) { #man-tai .tai-thanh span::after { animation: none; } #man-tai .tai-nen { transition: opacity .3s; transform: none; } }

/* ================= SẢNH ================= */
#dang-nhap.sanh { display: block; padding: 0; overflow: hidden;
  background: linear-gradient(180deg, rgba(3, 14, 26, .62) 0%, rgba(3, 14, 26, 0) 26%, rgba(3, 14, 26, 0) 50%, rgba(3, 14, 26, .78) 100%); }
#dang-nhap.sanh > * { margin: 0; }
#dang-nhap .sanh-tren, #dang-nhap .sanh-giua, #dang-nhap .sanh-duoi, #dang-nhap .sanh-chan { position: absolute; z-index: 2; }
#dang-nhap .sanh-tren { top: calc(8px + var(--tren)); left: calc(10px + var(--le)); right: calc(10px + var(--phai)); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
body:has(#man-mo-ngoai:not([hidden])) #dang-nhap .sanh-tren { top: calc(72px + var(--tren)); }   /* dải "Mở bằng Chrome" trong trình duyệt ứng dụng nằm mép trên */
.sanh-trai { display: flex; gap: 8px; }
.sanh-goc { display: flex; gap: 6px; }
.sanh-nut, .sanh-tron { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px;
  min-width: 58px; min-height: 58px; border-radius: 16px; border: 1px solid rgba(127, 230, 255, .4); background: rgba(5, 22, 38, .74); color: #e2fbff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35); touch-action: manipulation; transition: transform .1s; }
.sanh-nut i { font-style: normal; font-size: 22px; line-height: 1; }
.sanh-nut span { font-size: 11px; font-weight: 800; line-height: 1.1; letter-spacing: .2px; white-space: nowrap; text-align: center; padding: 0 3px; }
.sanh-nut:active, .sanh-tron:active { transform: scale(.94); }
.sanh-tron { min-width: 52px; width: 52px; height: 52px; min-height: 52px; border-radius: 50%; font-size: 22px; line-height: 1; padding: 0; }
.sanh-cham { position: absolute; top: 5px; right: 7px; width: 11px; height: 11px; border-radius: 50%; background: #ff4d4d; border: 2px solid #0a2236; }
#dang-nhap[class*="mo-"] .sanh-nut[data-mo] { opacity: .9; }

#dang-nhap .sanh-giua { left: 0; right: 0; top: calc(var(--tren) + 15%); display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none;
  animation: sanh-vao .6s ease-out both; }
#dang-nhap .dn-huy { width: 72px; height: 72px; margin-bottom: 10px; filter: drop-shadow(0 0 10px rgba(79, 227, 255, .55)); animation: dn-lac 5s ease-in-out infinite; }
#dang-nhap .phu-de { margin: 10px 0 0; color: #dff6ff; font-size: clamp(12px, 3.4vw, 15px); text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
@keyframes dn-lac { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-2px); } }
@keyframes sanh-vao { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

#dang-nhap .sanh-duoi { left: 50%; transform: translateX(-50%); bottom: calc(var(--day) + 44px); width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
#dang-nhap .sanh-duoi > * { animation: sanh-vao .5s ease-out .1s both; }
.sanh-may { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: rgba(4, 14, 26, .72); border: 1px solid rgba(127, 230, 255, .3);
  font-size: 13px; font-weight: 700; color: #e2fbff; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sanh-may small { font-size: 12.5px; font-weight: 600; color: #bfe6d6; }
.sanh-den { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #3ee08f; box-shadow: 0 0 8px #3ee08f; animation: sanh-den 2s ease-in-out infinite; }
@keyframes sanh-den { 50% { opacity: .45; } }
#dn-khach { position: relative; overflow: hidden; width: 100%; min-height: 64px; margin: 0; padding: 10px 16px; border-radius: 18px; border: 2px solid #ffe9a8;
  background: linear-gradient(180deg, #ffd96a 0%, #f6a52a 60%, #ec8e16 100%); color: #3a2206; font-size: 25px; font-weight: 900; letter-spacing: .14em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55); box-shadow: 0 5px 0 #a8620f, 0 10px 22px rgba(0, 0, 0, .45), 0 0 22px rgba(255, 190, 80, .35); transition: transform .08s, box-shadow .08s; }
#dn-khach::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: translateX(-120%) skewX(-18deg); animation: sanh-loe 3.6s ease-in-out 1s infinite; pointer-events: none; }
@keyframes sanh-loe { 0%, 55% { transform: translateX(-120%) skewX(-18deg); } 85%, 100% { transform: translateX(320%) skewX(-18deg); } }
#dn-khach:active { transform: translateY(4px); box-shadow: 0 1px 0 #a8620f, 0 4px 12px rgba(0, 0, 0, .45); }
#dn-khach:disabled { opacity: .7; }
.dn-khach-ghi { font-size: 12.5px; color: #dff6ff; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, .85); }
#dn-mo-tk { width: 100%; min-height: 50px; padding: 8px 12px; border-radius: 14px; border: 1px solid rgba(127, 230, 255, .45); background: rgba(4, 14, 26, .7);
  color: #e2fbff; font-size: 15px; font-weight: 800; }
#dang-nhap .loi { margin: 0; min-height: 0; width: 100%; }
#dang-nhap .loi:not(:empty) { padding: 7px 12px; border-radius: 12px; background: rgba(70, 14, 14, .86); border: 1px solid rgba(255, 106, 106, .5); color: #ffd6d6; font-size: 13.5px; line-height: 1.35; }
#dang-nhap .loi:empty { display: none; }

#dang-nhap .sanh-chan { left: calc(12px + var(--le)); right: calc(12px + var(--phai)); bottom: calc(4px + var(--day)); display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 11px; color: rgba(226, 251, 255, .72); text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.sanh-pb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#dang-nhap .dn-phap-ly { text-align: right; margin: 0; white-space: nowrap; flex: 0 0 auto; }
#dang-nhap .dn-phap-ly a { color: inherit; display: inline-block; padding: 10px 2px; }

/* ---------- tấm (Thông báo / Cài đặt / Hỗ trợ / Tài khoản): một tấm một lúc ---------- */
.sanh-lop { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(2, 10, 20, .62);
  padding: calc(12px + var(--tren)) calc(12px + var(--phai)) calc(12px + var(--day)) calc(12px + var(--le)); animation: sanh-mo .16s ease-out; }
@keyframes sanh-mo { from { opacity: 0; } }
#dang-nhap .sanh-the { width: min(460px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #061829; border-radius: 20px; backdrop-filter: none;
  animation: sanh-len .2s ease-out; overflow: visible; }
@keyframes sanh-len { from { transform: translateY(18px); opacity: .4; } }
.sanh-the > .tieu-de { flex: 0 0 auto; font-size: 14px; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--vien-mo); }
.sanh-the .sanh-x { width: 48px; height: 48px; font-size: 28px; color: #e2fbff; }
.sanh-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 12px 16px 16px; font-size: 14px; line-height: 1.45;
  -webkit-user-select: text; user-select: text; }
.sanh-than h3 { margin: 0 0 6px; font-size: 15px; color: #ffd27a; letter-spacing: .5px; }
.sanh-than p { margin: 0 0 8px; }
.sanh-beta { padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(255, 210, 122, .5); background: linear-gradient(180deg, rgba(255, 210, 122, .14), rgba(255, 210, 122, .04)); }
.sanh-beta small { display: block; margin-top: 8px; color: var(--chu-mo); font-size: 12.5px; }
.sanh-qua { font-weight: 800; margin-top: 4px; }
.sanh-ma { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; border: 2px dashed #ffd27a; background: rgba(4, 14, 26, .6); }
.sanh-ma b { font-size: 24px; letter-spacing: 3px; color: #ffd27a; -webkit-user-select: all; user-select: all; }
.sanh-chep { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 0; background: linear-gradient(#ffd96a, #f29a1f); color: #3a2206; font-weight: 900; white-space: nowrap; }
.sanh-than h3.sanh-muc { margin: 16px 0 8px; color: var(--vien); }
.sanh-moi { padding: 10px 12px; border-radius: 14px; background: rgba(79, 227, 255, .06); border: 1px solid rgba(79, 227, 255, .2); }
.sanh-moi + .sanh-moi { margin-top: 8px; }
.sanh-moi h4 { margin: 0 0 4px; font-size: 14px; }
.sanh-moi h4 span { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(79, 227, 255, .16); color: var(--vien); font-size: 11.5px; }
.sanh-moi ul { margin: 0; padding-left: 18px; color: #cfeaf5; font-size: 13px; }
.sanh-hang { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 0; border-bottom: 1px solid rgba(79, 227, 255, .14); }
.sanh-hang > span { font-weight: 800; font-size: 15px; }
.sanh-hang > span small { display: block; font-weight: 500; font-size: 12px; color: var(--chu-mo); }
.sanh-hang-nn:has(#sanh-nn:empty) { display: none; }
#sanh-nn .nn-dn { position: static; display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(4, 14, 26, .8); backdrop-filter: none; border: 1px solid rgba(127, 230, 255, .3); }
#sanh-nn .nn-dn button { min-width: 48px; min-height: 44px; }
.sanh-bat { min-width: 120px; min-height: 48px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(127, 230, 255, .4); background: rgba(4, 14, 26, .8); color: var(--chu-mo); font-weight: 800; }
.sanh-bat.bat { background: linear-gradient(#2a9cbe, #17647e); color: #fff; border-color: var(--vien); }
.sanh-ghi { margin-top: 10px !important; font-size: 12.5px; color: var(--chu-mo); }
.sanh-luoi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sanh-o { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 8px; border-radius: 16px;
  border: 1px solid rgba(127, 230, 255, .35); background: rgba(79, 227, 255, .07); color: var(--chu); font-weight: 800; font-size: 13.5px; text-decoration: none; text-align: center; }
.sanh-o i { font-style: normal; font-size: 24px; line-height: 1; }
.sanh-o:active { background: rgba(79, 227, 255, .2); }
.sanh-pl { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; margin-top: 12px; }
.sanh-pl a { color: var(--vien); padding: 12px 2px; font-size: 13px; }
.sanh-bq { font-size: 11px; color: var(--chu-mo); text-align: center; opacity: .8; margin-top: 4px !important; }

/* tấm Tài khoản = khối form .dn-tk cũ */
#dang-nhap .dn-tk { display: none; padding: 12px 16px 14px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
#dang-nhap.mo-tk .dn-tk { display: block; }
#dang-nhap .dn-tk .loi:not(:empty) { margin-bottom: 10px; }
#dang-nhap .tab-dn { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 999px; background: rgba(4, 14, 26, .8); border: 1px solid rgba(127, 230, 255, .25); }
#dang-nhap .tab-dn button { min-height: 44px; border-radius: 999px; border: 0; background: none; font-weight: 800; font-size: 14px; }
#dang-nhap .tab-dn button.chon { background: linear-gradient(#2a9cbe, #17647e); color: #fff; }
#dang-nhap #form-dn input { min-height: 50px; margin-bottom: 10px; border-radius: 12px; font-size: 16px; padding: 10px 14px; }
#dang-nhap #dn-nut { min-height: 54px; border-radius: 14px; border: 2px solid #ffe9a8; background: linear-gradient(180deg, #ffd96a, #ec8e16); color: #3a2206; font-size: 18px; font-weight: 900; box-shadow: 0 4px 0 #a8620f; }
#dang-nhap #dn-quen { display: none; }   /* nút cũ của tai_khoan_ui.ts: thay bằng #dn-ma-kp (đóng tấm rồi mở hộp mã khôi phục, không chồng) */
.sanh-phu { display: block; width: 100%; min-height: 48px; margin-top: 8px; padding: 8px 12px; border-radius: 14px; border: 1px solid rgba(127, 230, 255, .3); background: rgba(79, 227, 255, .06);
  color: var(--chu); font-weight: 700; font-size: 14px; }
#dn-dong-tk { border-color: transparent; background: none; color: var(--chu-mo); }

/* ---------- ĐIỆN THOẠI DỌC: tấm trồi từ đáy ---------- */
@media (max-width: 620px) and (orientation: portrait) {
  .sanh-lop { align-items: flex-end; padding: calc(40px + var(--tren)) 0 0; }
  #dang-nhap .sanh-the { width: 100%; border-radius: 22px 22px 0 0; padding-bottom: var(--day); }
  .sanh-goc { gap: 5px; }
  .sanh-nut { min-width: 54px; }
}
@media (max-width: 360px) { .sanh-nut span { display: none; } .sanh-nut { min-width: 48px; min-height: 48px; } .sanh-tron { width: 48px; height: 48px; min-width: 48px; min-height: 48px; } }
@media (max-height: 700px) and (orientation: portrait) { #dang-nhap .sanh-giua { top: calc(var(--tren) + 12%); } #dang-nhap .dn-huy { width: 56px; height: 56px; } #dang-nhap .dn-khach-ghi { display: none; } }
@media (max-height: 600px) and (orientation: portrait) { #dang-nhap .dn-huy, #dang-nhap .phu-de { display: none; } #dang-nhap .sanh-giua { top: calc(var(--tren) + 76px); } }

/* ---------- ĐIỆN THOẠI NGANG / màn thấp ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  #dang-nhap .sanh-tren { top: calc(6px + var(--tren)); }
  .sanh-nut { min-width: 54px; min-height: 54px; border-radius: 14px; }
  .sanh-nut i { font-size: 20px; }
  .sanh-tron { width: 50px; height: 50px; min-width: 50px; min-height: 50px; }
  #dang-nhap .sanh-giua { top: calc(var(--tren) + 16px); flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 12px; left: 25%; right: 25%; }
  #dang-nhap .dn-huy { width: 54px; height: 54px; margin: 0; }
  #dang-nhap .logo { font-size: 46px; text-align: left; }
  #dang-nhap .logo .logo-phu { margin-top: 6px; font-size: 13px; }
  #dang-nhap .phu-de { display: none; }
  #dang-nhap .sanh-duoi { bottom: calc(var(--day) + 30px); width: min(360px, 46vw); gap: 7px; }
  #dn-khach { min-height: 58px; font-size: 23px; }
  #dang-nhap .dn-khach-ghi { display: none; }
  #dn-mo-tk { min-height: 48px; }
  .sanh-lop { padding: calc(8px + var(--tren)) calc(8px + var(--phai)) calc(8px + var(--day)) calc(8px + var(--le)); }
  #dang-nhap .sanh-the { width: min(520px, 100%); }
  .sanh-luoi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sanh-o { min-height: 64px; }
  /* tấm Tài khoản ngang: hai ô nhập cạnh nhau cho đỡ phải cuộn */
  #dang-nhap #form-dn { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
  #dang-nhap #form-dn #dn-nut { grid-column: 1 / -1; }
  #dang-nhap .tab-dn { margin-bottom: 8px; }
  #dn-dong-tk { display: none !important; }
}
@media (orientation: landscape) and (max-height: 360px) { #dang-nhap .dn-huy { display: none; } #dang-nhap .logo { font-size: 38px; } }

/* ---------- PC / máy bảng ---------- */
@media (min-width: 900px) and (min-height: 600px) {
  #dang-nhap .sanh-tren { top: calc(14px + var(--tren)); left: 18px; right: 18px; }
  .sanh-nut { min-width: 68px; min-height: 64px; }
  .sanh-nut span { font-size: 12px; }
  #dang-nhap .sanh-giua { top: 13%; }
  #dang-nhap .dn-huy { width: 88px; height: 88px; }
  #dang-nhap .logo { font-size: 88px; }
  #dang-nhap .sanh-duoi { width: 380px; bottom: 64px; gap: 10px; }
  #dn-khach { min-height: 70px; font-size: 28px; }
  .sanh-nut:hover, .sanh-tron:hover, #dn-mo-tk:hover { border-color: var(--vien); background: rgba(10, 40, 62, .85); }
  #dn-khach:hover { filter: brightness(1.06); }
  #dang-nhap .sanh-chan { font-size: 12px; left: 18px; right: 18px; }
}
@media (prefers-reduced-motion: reduce) { #dn-khach::after, .sanh-den, #dang-nhap .dn-huy, #dang-nhap .sanh-giua, #dang-nhap .sanh-duoi > *, .sanh-lop, .sanh-the { animation: none; } }
html.giam-cd #dn-khach::after, html.giam-cd .sanh-den { animation: none; }

/* ================= TẠO NHÂN VẬT (tao_nv_ui.ts) ================= */
#man-tao-nv { background: radial-gradient(ellipse at 30% 30%, #12506e 0%, #0a2c44 45%, #041422 100%); }
.khung-tao { width: min(860px, 100%); grid-template-columns: 300px minmax(0, 1fr); background: rgba(5, 18, 32, .92); border-radius: 20px; }
.khung-tao::before, .khung-tao::after { display: none; }
/* ô xem trước: khung tròn sáng dưới chân + hàng ⟲ 🎲 ⟳ (span "Nhìn phải" ẩn) */
.tnv-xem { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; align-items: center; justify-items: center; align-content: start; width: 100%; max-width: 290px; padding: 0 var(--dem); }
#tnv-cv { grid-column: 1 / -1; width: 260px; height: 299px; border-radius: 22px; border: 1px solid rgba(127, 230, 255, .3);
  background: radial-gradient(ellipse at 50% 82%, rgba(255, 210, 122, .32) 0%, rgba(79, 227, 255, .12) 38%, rgba(4, 14, 26, .35) 75%); box-shadow: inset 0 0 30px rgba(0, 0, 0, .45); }
.tnv-xoay { display: contents; }
.tnv-xoay span#tnv-huong { display: none; }
#tnv-xoay-trai { grid-column: 1; grid-row: 2; }
#tnv-xoay-phai { grid-column: 3; grid-row: 2; }
.tnv-xoay button { width: 48px; height: 48px; font-size: 20px; }
.tnv-ngau { grid-column: 2; grid-row: 2; width: 100%; min-height: 48px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255, 210, 122, .65);
  background: rgba(255, 210, 122, .14); color: #ffe6a8; font-weight: 900; font-size: 15px; white-space: nowrap; }
.tnv-ngau:active { background: rgba(255, 210, 122, .3); transform: scale(.97); }
/* lựa chọn: viên giới tính, thẻ tóc tròn, ô màu tròn */
.tnv-gt button { min-height: 52px; border-radius: 999px; font-size: 16px; font-weight: 800; }
.tnv-kieu button { min-height: 96px; border-radius: 18px; padding: 8px 4px; gap: 4px; }
.tnv-kieu img { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(79, 227, 255, .25), rgba(4, 14, 26, .6)); border: 2px solid rgba(127, 230, 255, .3); }
.tnv-kieu button.chon img { border-color: #ffd27a; box-shadow: 0 0 12px rgba(255, 210, 122, .6); }
.tnv-gt button.chon, .tnv-kieu button.chon { border-color: #ffd27a; background: rgba(255, 210, 122, .16); box-shadow: 0 0 0 1px #ffd27a inset; }
.tnv-mau button { width: 46px; height: 46px; }
.tnv-mau button.chon { box-shadow: 0 0 0 3px #ffd27a, 0 0 14px rgba(255, 210, 122, .8), inset 0 -4px 8px rgba(0, 0, 0, .35); }
#tnv-ten { min-height: 50px; border-radius: 14px; font-size: 17px; font-weight: 700; }
#tnv-xx { width: 50px; min-height: 50px; border-radius: 14px; }
/* nút lớn "⛵ Ra khơi" */
#tnv-ok { min-height: 58px; border-radius: 16px; border: 2px solid #ffe9a8; background: linear-gradient(180deg, #ffd96a 0%, #f6a52a 60%, #ec8e16 100%); color: #3a2206;
  font-size: 20px; font-weight: 900; letter-spacing: .06em; box-shadow: 0 4px 0 #a8620f, 0 8px 18px rgba(0, 0, 0, .4); text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
#tnv-ok:active { transform: translateY(3px); box-shadow: 0 1px 0 #a8620f; }
#tnv-ok:disabled { filter: grayscale(.6); opacity: .6; }
#tnv-lai { min-height: 48px; border-radius: 14px; }
.khung-tao .nut-x { width: 48px; height: 48px; font-size: 26px; }

/* điện thoại dọc: xem trước to ở giữa, biểu mẫu cuộn bên dưới, "Ra khơi" ghim đáy */
@media (max-width: 620px) {
  .khung-tao { border-radius: 0; background: transparent; }
  .tnv-xem { margin: 0 auto var(--cach); max-width: 260px; padding: 0; }
  #tnv-cv { width: 190px; height: 218px; }
  .tnv-kieu button { min-height: 88px; }
  .tnv-kieu img { width: 52px; height: 52px; }
  .tnv-mau { grid-template-columns: repeat(auto-fill, 46px); }
  .tnv-nut { background: rgba(4, 14, 26, .96); }
}
@media (max-width: 620px) and (min-height: 760px) { #tnv-cv { width: 216px; height: 248px; } }
/* điện thoại ngang: cột trái xem trước + 🎲 + Ra khơi (Quay lại = nút × trên đầu), phải biểu mẫu cuộn */
@media (max-height: 500px) and (min-width: 621px) {
  .khung-tao { grid-template-columns: 228px minmax(0, 1fr); border-radius: 0; }
  .tnv-xem { padding: 0 0 0 var(--dem); grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; }
  #tnv-cv { width: 168px; height: 193px; }
  .tnv-xoay button { width: 44px; height: 44px; }
  .tnv-ngau { min-height: 44px; font-size: 13.5px; padding: 0 6px; }
  .tnv-nut #tnv-lai { display: none; }
  #tnv-ok { min-height: 52px; font-size: 18px; }
  .tnv-kieu button { min-height: 52px; }
  .tnv-kieu img { width: 40px; height: 40px; }
}
@media (max-height: 420px) and (min-width: 621px) { .tnv-xoay { width: auto; } }
@media (max-height: 360px) and (min-width: 621px) { #tnv-cv { width: 130px; height: 150px; } }
/* ===== gon_nut.css ===== */
/* GỌN NÚT MÀN NHỎ (21/11/2026; trinh_khach/src/gon_nut.ts, docs/hoc/gon_nut_man_nho.md). Nạp SAU loai_man.css / hud_ngang.css (index.html).
   Lớp: body.man-nho (loai_man.ts: cảm ứng + cạnh ngắn ≤ 400 px, hoặc Cài đặt → Màn nhỏ = Bật). Mọi luật chỉ có hiệu lực trên cảm ứng:
   máy tính giữ nguyên bố cục. */

/* ---------- Cài đặt: dòng "Màn nhỏ" chỉ có nghĩa trên máy cảm ứng ---------- */
html body:not(.cam-ung) #cd-hang-mn { display: none; }

/* ---------- 1) nút Menu báo túi đầy (nút Túi đã vào trong Menu) ---------- */
html body.cam-ung #nut-menu.tui-day { border-color: var(--do, #ff6a6a); box-shadow: 0 0 10px rgba(255, 106, 106, .6); }
#nut-menu .nm-day { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); max-width: calc(100% - 2px); overflow: hidden;
  font-size: 9px; line-height: 12px; font-weight: 900; padding: 0 4px; border-radius: 999px; background: var(--do, #ff6a6a); color: #2a0606;
  white-space: nowrap; pointer-events: none; font-style: normal; }
#nut-menu .nm-day[hidden] { display: none; }
#nut-menu.nm-nhay { animation: kcNhay .55s ease-out; }
html.giam-cd #nut-menu.nm-nhay { animation: none; }
/* ô Túi trong Menu (lưới / thẻ): nhãn ĐẦY góc trên */
:is(.ml-o, .mt-n)[data-ma="tui"][data-day] { position: relative; }
:is(.ml-o, .mt-n)[data-ma="tui"][data-day]::after { content: attr(data-day); position: absolute; top: 2px; right: 2px; padding: 0 4px; border-radius: 999px;
  background: var(--do, #ff6a6a); color: #2a0606; font-size: 9px; line-height: 13px; font-weight: 900; pointer-events: none; }

/* ---------- 2) cụm đổi tầng tàu: một nút tròn "⇅ 3/5", chạm bung ▲ / ▼ ---------- */
html body.cam-ung #tang-cum.tang-gon:not(.tang-mo) { padding: 0; gap: 0; background: none; border: 0; box-shadow: none; border-radius: 50%; }
html body.cam-ung #tang-cum.tang-gon:not(.tang-mo) .tang-nut { display: none; }
html body.cam-ung #tang-cum.tang-gon #tang-chi { pointer-events: auto; cursor: pointer; box-sizing: border-box; width: 46px; height: 46px; min-width: 46px; max-width: 46px;
  padding: 0; border-radius: 50%; background: rgba(4, 14, 26, .72); border: 1.5px solid rgba(79, 227, 255, .6); box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
html body.cam-ung #tang-cum.tang-gon #tang-chi::before { content: "⇅"; font-size: 13px; line-height: 1; color: #8cecff; font-weight: 800; }
html body.cam-ung #tang-cum.tang-gon #tang-ten { display: none; }
html body.cam-ung #tang-cum.tang-gon #tang-so { font-size: 13px; line-height: 1.1; }
html body.cam-ung #tang-cum.tang-gon.tang-mo #tang-chi { border-color: #ffe9a8; background: rgba(40, 30, 6, .8); }
html body.cam-ung #tang-cum.tang-gon.tang-mo { gap: 4px; }
/* màn ngang: bung thành hàng ▼ ⇅ ▲ cạnh nút Cầm lái (như cũ); màn dọc: cột ▲ ⇅ ▼ sát mép phải (hud_gon.css) */
@media (orientation: portrait) {
  html body.cam-ung #tang-cum.tang-gon #tang-chi { max-width: 46px; }
  html body.cam-ung #tang-cum.tang-gon.tang-mo { padding: 2px; }
}

/* ---------- 3) thẻ tụ hội "Bến Vạn Buồm đang vắng / Ra phố" ---------- */
#th-the .th-gon { display: none; }
/* cảm ứng, thẻ đang mở: vùng chạm × và Ra phố đủ 44 px */
html body.cam-ung #th-the .th-x { width: 44px; height: 44px; margin: -6px -4px -6px 0; }
html body.cam-ung #th-the .th-di { min-height: 44px; }
/* đã thu thành chip (sau 5 giây): "🏙 👥 N", chạm để bung lại */
html body.cam-ung #th-the.th-thu { width: auto; min-height: 44px; padding: 0 14px; gap: 0; align-items: center; border-radius: 22px; cursor: pointer;
  border-color: rgba(255, 216, 102, .55); animation: none; }
html body.cam-ung #th-the.th-thu > :not(.th-gon) { display: none; }
html body.cam-ung #th-the.th-thu .th-gon { display: inline; font-size: 14px; font-weight: 800; color: #ffe9a6; white-space: nowrap; }
/* màn dọc: chip nằm cột trái (dưới chip Việc kế), không lơ lửng giữa biển; xep_chip.ts dời nếu đụng */
@media (orientation: portrait) {
  html body.cam-ung #th-the.th-thu { left: calc(var(--mep, 8px) + var(--le, 0px)); transform: none; top: calc(var(--ct-day, 150px) + 58px); }
}

/* lời rủ tại bến (ben_vui.ts #bv-ru): nút ✕ đủ 44 px trên cảm ứng (gon_nut.ts tắt thẻ sau 5 giây ở màn nhỏ) */
html body.cam-ung #bv-ru button { min-width: 44px; min-height: 44px; }

/* ---------- 4) màn nhỏ ---------- */
/* chip Việc kế ("🎁 Nhận quà ngày", "🧺 Thu lưới"…): sau 5 giây thu còn biểu tượng tròn 44 px (chạm vẫn làm việc ngay) */
html body.cam-ung.man-nho #vk-chip.vk-gon { width: 44px; height: 44px; min-width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
html body.cam-ung.man-nho #vk-chip.vk-gon span { display: none; }
html body.cam-ung.man-nho #vk-chip.vk-gon i { font-size: 20px; }
html body.cam-ung.man-nho #vk-chip.vk-gon::after { inset: 0; }
/* phố cảng: chip Giải câu (trừ lúc đang thi: giữ đồng hồ) + chip Bến Vui vào Menu → Bến Vui */
html body.cam-ung.man-nho #gca-chip:not(.dang), html body.cam-ung.man-nho #bv-chip { display: none !important; }
/* ===== tron_mem.css ===== */
/* ==========================================================================
   FARSEA v1 — Áp kiểu "Tròn mềm" nền đặc sáng (từ v2 sang v1 theo phiếu sửa UI)
   - Không làm mờ nút HUD (nền đặc 100%, viền đậm #04253a, nút >= 44px trên cảm ứng)
   - Chỉ áp lên các màn được chọn: HUD, Túi đồ, Chế tạo, Bếp nấu, Đảo nhà,
     Chợ/Sàn & Tàu buôn, Cài đặt, Toast, Xác nhận, Mở rương, Gục ngã, Thẻ vật phẩm.
   ========================================================================== */

:root {
  --tm-vien: #04253a;
  --tm-vien-nhat: #9ac5df;
  --tm-vien-xanh: #0d7fb4;
  --tm-nen: #fffdf6;
  --tm-nen-2: #f1f9ff;
  --tm-nen-o: linear-gradient(180deg, #ffffff 0%, #e7f4ff 100%);
  --tm-chu: #0b2f47;
  --tm-chu-phu: #245a7a;
  --tm-dau-xanh: linear-gradient(180deg, #15669c 0%, #0e4c78 100%);
  --tm-dau-cam: linear-gradient(180deg, #c24a02 0%, #963200 100%);
  --tm-nut-cam: linear-gradient(180deg, #c24a02 0%, #9e3500 100%);
  --tm-nut-xanh: linear-gradient(180deg, #13854f 0%, #0b6a3c 100%);
  --tm-nut-bien: linear-gradient(180deg, #106ca8 0%, #095182 100%);
  --tm-nut-do: linear-gradient(180deg, #c81e2b 0%, #9e1520 100%);
  --tm-nut-khoa: linear-gradient(180deg, #eef4f8 0%, #d4e1ea 100%);
  --tm-bong: 0 14px 32px rgba(3, 18, 34, 0.45), inset 0 2px 0 #ffffff;
  --tm-bong-nhe: 0 3px 10px rgba(4, 24, 40, 0.25);
}

html body .cham {
  background: #c81e2b !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

/* ==================== 1. HUD CHÍNH (nền đặc sáng, không mờ) ==================== */
html body #chi-so {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien) !important;
  border-radius: 28px 16px 16px 28px !important;
  box-shadow: var(--tm-bong-nhe), inset 0 1px 0 #ffffff !important;
  color: var(--tm-chu);
  opacity: 1 !important;
}
@media (orientation: portrait) and (max-width: 440px) {
  html body #chi-so {
    width: 162px !important;
    padding: 3px 6px 3px 3px !important;
    gap: 0 5px !important;
  }
  html body.toi-gian #chi-so {
    min-width: 0 !important;
    width: 160px !important;
    max-width: 160px !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    padding: 3px 6px 3px 3px !important;
    gap: 5px !important;
  }
  html body #cs-chan,
  html body.toi-gian #chi-so #cs-chan {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
  html body #chi-so .vach {
    grid-template-columns: 11px minmax(0, 1fr) 19px !important;
    gap: 3px !important;
  }
  html body.toi-gian #chi-so .vach {
    grid-template-columns: 14px 54px 24px !important;
    gap: 4px !important;
  }
  html body.toi-gian #chi-so .vach > b {
    width: 54px !important;
  }
  html body.cam-ung #nut-tren {
    gap: 4px !important;
  }
}
html body #nut-chinh,
html body #lai-nut-cam {
  opacity: 1 !important;
}
html body #nut-chinh.pho-mo {
  opacity: 1 !important;
}
html body #nut-chinh.pho-mo .vong {
  opacity: 1 !important;
  filter: saturate(0.25) brightness(0.9) !important;
}
html body #cs-chan {
  border: 2px solid var(--tm-vien) !important;
  background: #d8effc !important;
  box-shadow: none !important;
}
html body #chi-so .vach b {
  background: #d7e8f3 !important;
  box-shadow: inset 0 1px 2px rgba(4, 24, 40, 0.16) !important;
}
html body #chi-so .vach em {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
  font-weight: 800;
}
html body #chi-so .vach.thap em {
  color: #c41d29 !important;
}
html body #dst {
  color: #9e4b00 !important;
  text-shadow: none !important;
}
html body #cap-be {
  color: #0e6f3f !important;
}

/* Đồng hồ & cụm nút trên phải: nền đặc 100%, dễ bấm, không bị mờ trên biển sáng */
html body #dong-ho {
  background: #0c314c !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  opacity: 1 !important;
  box-shadow: var(--tm-bong-nhe);
}
html body #nut-tren > .nut-vuong,
html body.cam-ung #nut-tren > .nut-vuong {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  box-shadow: 0 3px 0 rgba(4, 37, 58, 0.28), 0 4px 10px rgba(4, 24, 40, 0.24) !important;
  opacity: 1 !important;
}
html body.cam-ung #nut-tren > .nut-vuong {
  min-width: 44px;
  min-height: 44px;
}
html body #nut-tren > #nut-menu,
html body.cam-ung #nut-tren > #nut-menu {
  background: linear-gradient(180deg, #fff9e6 0%, #ffe094 100%) !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  box-shadow: 0 3px 0 rgba(4, 37, 58, 0.3), 0 4px 10px rgba(4, 24, 40, 0.25) !important;
  opacity: 1 !important;
}
html body #nut-tren .nv-chu,
html body #nut-tren span {
  color: var(--tm-chu) !important;
}
html body #nut-tren kbd {
  color: var(--tm-chu-phu) !important;
}
html body #ban-do-nho {
  border: 2.5px solid var(--tm-vien) !important;
  box-shadow: 0 4px 12px rgba(4, 24, 40, 0.34) !important;
  opacity: 1 !important;
}

/* Chip nhiệm vụ (dọc + ngang đều rõ, đặc, không mờ) */
html body #nhiem-vu,
html body #nhiem-vu.thu-gon,
html body.toi-gian.nv-an #nhiem-vu.thu-gon {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  box-shadow: var(--tm-bong-nhe) !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
}
html body.toi-gian.nv-an:not(.tt-an) #nhiem-vu.thu-gon .nv-nhan {
  display: inline-flex !important;
}
html body #nhiem-vu::before,
html body #nhiem-vu::after {
  display: none !important;
}
html body #nhiem-vu .tieu-de {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
}
html body #nhiem-vu .nv-ngan {
  background: #ffe08a !important;
  color: #4a2a00 !important;
  font-weight: 900 !important;
  border: 1px solid #d4961a;
}
html body #nhiem-vu.thu-gon #nv-tom,
html body #nhiem-vu #nv-nd {
  color: var(--tm-chu) !important;
  font-weight: 700 !important;
}
html body #nhiem-vu #nv-thuong {
  color: #8c4b00 !important;
  font-weight: 700;
}
html body #nhiem-vu .nut-x {
  color: var(--tm-chu) !important;
}
html body #nhiem-vu #nv-nd .ctr-ten,
html body #nhiem-vu.ctr-xong.thu-gon #nv-tom {
  color: #8c3b00 !important;
}
html body #nhiem-vu #nv-nd .ctr-td {
  color: #0a5b94 !important;
}
html body #nhiem-vu #nv-nd .ctr-dat {
  color: #0d6d3e !important;
}
html body #nhiem-vu #ctr-hang button {
  background: #eef7fd !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  font-weight: 800;
}
html body #nhiem-vu #ctr-hang button.chinh {
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
}
html body.cam-ung #nhiem-vu #ctr-hang button {
  min-height: 44px !important;
}

/* Thanh cầm đồ: khay tối đặc + ô đặc sáng viền đậm */
html body #thanh-cam {
  background: #0c314c !important;
  border: 2px solid #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 14px rgba(4, 24, 40, 0.38) !important;
  opacity: 1 !important;
}
html body #thanh-cam .o-cam {
  background: var(--tm-nen-o) !important;
  border: 2px solid var(--tm-vien) !important;
  border-radius: 11px !important;
  color: var(--tm-chu) !important;
  opacity: 1 !important;
}
html body #thanh-cam .o-cam.o-rong {
  background: #174668 !important;
  border-color: #2f6c96 !important;
}
html body #thanh-cam .o-cam.chon {
  border: 2.5px solid #ff9f1c !important;
  background: linear-gradient(180deg, #fffdf0 0%, #ffeab5 100%) !important;
  box-shadow: 0 0 0 2px #ffffff, 0 4px 10px rgba(255, 159, 28, 0.45) !important;
}
html body #thanh-cam .o-cam .so {
  background: #0c314c;
  color: #ffffff !important;
  padding: 0 4px;
  border-radius: 6px;
  text-shadow: none !important;
}
html body #thanh-cam .o-cam .phim {
  color: var(--tm-chu-phu) !important;
  font-weight: 800;
}
html body.cam-ung.tc-gon #thanh-cam {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body.cam-ung.tc-gon #thanh-cam .o-cam.chon {
  opacity: 1 !important;
}

/* Nút neo có icon v2 */
.lai-neo-ic {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ==================== 2. KHUNG BẢNG "TRÒN MỀM" DÙNG CHUNG ==================== */
html body :is(#bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat) {
  background: linear-gradient(180deg, var(--tm-nen) 0%, var(--tm-nen-2) 100%) !important;
  border: 3px solid var(--tm-vien) !important;
  border-radius: 20px !important;
  box-shadow: var(--tm-bong) !important;
  color: var(--tm-chu) !important;
  backdrop-filter: none !important;
}
html body :is(#bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat)::before,
html body :is(#bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat)::after {
  display: none !important;
}
html body :is(#bang-tui, #bang-che, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat) > .tieu-de {
  background: var(--tm-dau-xanh) !important;
  border-bottom: 2.5px solid var(--tm-vien) !important;
  border-radius: 16px 16px 0 0 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
  padding: 6px 8px 6px 14px !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: 0.4px !important;
}
html body #bang-na > .tieu-de {
  background: var(--tm-dau-cam) !important;
  border-bottom: 2.5px solid var(--tm-vien) !important;
  border-radius: 16px 16px 0 0 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
  padding: 6px 8px 6px 14px !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}
html body :is(#bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat) > .tieu-de small {
  background: #0c314c;
  color: #ffe87a !important;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  font-size: 12px;
  font-weight: 800;
}
html body :is(#bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat) > .tieu-de .nut-x {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 12px !important;
  border: 2px solid var(--tm-vien) !important;
  background: var(--tm-nut-do) !important;
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 0 #701018;
}
html body :is(#bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat) .nho-mo,
html body :is(#bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat) .trong {
  color: var(--tm-chu-phu) !important;
}

/* Hàng tab trong bảng Đảo nhà / Sàn / Cài đặt / Hệ thống */
html body :is(#bang-dn, #bang-san, #bang-caidat, #bang-ht) .tab-ht {
  gap: 5px;
}
html body :is(#bang-dn, #bang-san, #bang-caidat, #bang-ht) .tab-ht button {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  border-radius: 11px !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
  min-height: 40px;
}
html body.cam-ung :is(#bang-dn, #bang-san, #bang-caidat, #bang-ht) .tab-ht button {
  min-height: 44px;
}
html body :is(#bang-dn, #bang-san, #bang-caidat, #bang-ht) .tab-ht button.chon {
  background: var(--tm-nut-cam) !important;
  border-color: #7a2600 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #6b2200;
}

/* ==================== 3. TÚI ĐỒ (#bang-tui) — TRỘN ==================== */
html body #bang-tui .tui-loc button {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
  min-height: 40px;
}
html body.cam-ung #bang-tui .tui-loc button {
  min-height: 44px;
}
html body #bang-tui .tui-loc button em {
  background: #e3f2fc !important;
  color: var(--tm-chu) !important;
}
html body #bang-tui .tui-loc button.bat {
  background: var(--tm-nut-cam) !important;
  border-color: #7a2600 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #6b2200 !important;
}
html body #bang-tui .tui-loc button.bat em {
  background: #ffffff !important;
  color: #8c2d00 !important;
}

/* Ô lưới đồ: nền sáng + viền phẩm chất v2 + tên dưới ô rõ nét */
html body #bang-tui #luoi-tui .o-tui,
html body #bang-tui #luoi-tui .cc-o {
  background: var(--tm-nen-o) !important;
  border: 2px solid #b5d5e8 !important;
  border-radius: 12px !important;
  color: var(--tm-chu) !important;
}
html body #bang-tui #luoi-tui .o-tui.p1 { border-color: #22b45a !important; }
html body #bang-tui #luoi-tui .o-tui.p2 { border-color: #1d8be0 !important; }
html body #bang-tui #luoi-tui .o-tui.p3 { border-color: #9b4de0 !important; }
html body #bang-tui #luoi-tui .o-tui.p4 { border-color: #e8a317 !important; background: linear-gradient(180deg, #fffdf4 0%, #fff0c4 100%) !important; }
html body #bang-tui #luoi-tui .o-tui.p5 { border-color: #e03340 !important; background: linear-gradient(180deg, #fff5f5 0%, #ffdce0 100%) !important; }
html body #bang-tui #luoi-tui .o-tui.chon {
  border: 2.5px solid #c24a02 !important;
  background: linear-gradient(180deg, #fffdf4 0%, #ffeab5 100%) !important;
  box-shadow: 0 0 0 2px #ffbf47 !important;
}
html body #bang-tui #luoi-tui .o-tui .so {
  background: #0c314c !important;
  color: #ffffff !important;
  font-weight: 800;
}
html body #bang-tui #luoi-tui .o-tui .o-ten {
  color: var(--tm-chu) !important;
  font-weight: 700 !important;
}
html body #bang-tui #luoi-tui i.o-tui.o-trong {
  background: #dcebf5 !important;
  border: 2px dashed #9dc0d6 !important;
}
/* Hiển thị tên ngắn bên dưới ô khi đủ chiều cao 68px (kể cả cảm ứng trừ khi đang là ô nhỏ) */
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui {
  height: 66px !important;
  padding: 3px 4px 7px !important;
  gap: 1px !important;
}
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui img {
  width: 32px !important;
  height: 32px !important;
}
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui .o-ten {
  display: block !important;
}
@media (max-width: 620px) {
  html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
}

/* Dải thanh nhanh trong bảng Túi */
html body #bang-tui #tui-thanh {
  border-top: 2px solid #cde2ef !important;
}
html body #bang-tui #tui-thanh .tt-ten {
  color: var(--tm-chu-phu) !important;
}
html body #bang-tui #tui-thanh .tt-nhan {
  color: #9e3500 !important;
}
html body #bang-tui #tui-thanh .tt-nhan b {
  color: var(--tm-chu) !important;
}
html body #bang-tui #tui-thanh .o-cam.tt {
  background: var(--tm-nen-o) !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
}
html body.cam-ung #bang-tui #tui-thanh .o-cam.tt {
  min-width: 44px !important;
  min-height: 44px !important;
}
html body #bang-tui #kc-goi-tui {
  background: #ffe8ea !important;
  border: 2px solid #c42b37 !important;
  color: #9e1522 !important;
  font-weight: 700 !important;
}
html body #bang-tui #chi-tiet .vk-the {
  background: #eef8ff !important;
  border: 2px solid #9fd3ee !important;
  color: var(--tm-chu) !important;
  border-radius: 10px !important;
  padding: 6px 8px !important;
}
html body #bang-tui #tui-thanh .o-cam.tt.o-rong {
  background: #e1eef6 !important;
  border-color: #9dc0d6 !important;
}
html body #bang-tui #tui-thanh .o-cam.tt .so {
  background: #0c314c;
  color: #ffffff;
  border-radius: 5px;
  padding: 0 3px;
  text-shadow: none !important;
}

/* Chi tiết món Túi đồ */
html body #bang-tui #chi-tiet {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  border-radius: 14px !important;
  color: var(--tm-chu) !important;
}
html body #bang-tui #chi-tiet img.to {
  background: #e3f4ff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  border-radius: 10px !important;
}
html body #bang-tui #chi-tiet .ten {
  color: var(--tm-chu) !important;
  font-weight: 900;
}
html body #bang-tui #chi-tiet .ct-phu {
  color: var(--tm-chu-phu) !important;
}
html body #bang-tui #chi-tiet .ct-phu b {
  color: #9e3500 !important;
}
html body #bang-tui #chi-tiet .mo-ta {
  color: #2c4e66 !important;
}
html body #bang-tui #chi-tiet .ct-goi {
  background: #fff7dc !important;
  border: 1.5px solid #e6be53 !important;
  color: #6b4300 !important;
  font-weight: 700;
}
html body #bang-tui #chi-tiet .ct-nguon {
  background: #eef8ff !important;
  border: 2px solid #9fd3ee !important;
  color: var(--tm-chu) !important;
}
html body #bang-tui #chi-tiet .ct-nguon-dau {
  color: var(--tm-chu-phu) !important;
}
html body #bang-tui #chi-tiet .ct-nguon li {
  color: var(--tm-chu) !important;
  font-weight: 600;
}
html body #bang-tui #chi-tiet .ct-nguon li::marker {
  color: #0d89bf !important;
}
html body #bang-tui #chi-tiet .ct-giu {
  color: var(--tm-chu) !important;
}
html body #bang-tui #chi-tiet .hang-nut button {
  background: #eef7fd !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  min-height: 44px !important;
  font-weight: 800;
}
html body #bang-tui #chi-tiet .hang-nut button.chinh,
html body #bang-tui #chi-tiet .hang-nut button[data-kb-mo] {
  background: var(--tm-nut-cam) !important;
  border-color: var(--tm-vien) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 0 #6e2400 !important;
}
html body #bang-tui #chi-tiet .hang-nut button[data-l="bo"] {
  background: #ffe8ea !important;
  border-color: #c42b37 !important;
  color: #a31824 !important;
}
html body #bang-tui #chi-tiet .ct-tl {
  background: #f4fbff !important;
  border-color: var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
}
html body #bang-tui #chi-tiet .ct-tl > summary {
  color: #9e4b00 !important;
}
html body #bang-tui #chi-tiet .ct-tl li b {
  color: #0e6f3f !important;
}
html body #bang-tui #chi-tiet .ct-nhac {
  color: var(--tm-chu-phu) !important;
}
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-tui #chi-tiet {
    padding: 7px 9px !important;
    gap: 4px !important;
  }
  html body #bang-tui #chi-tiet .ct-nguon {
    min-height: 3.1em !important;
    max-height: 4.4em !important;
  }
  html body #bang-tui #chi-tiet .hang-nut button {
    min-height: 40px !important;
    padding: 3px 6px !important;
  }
  html body.cam-ung #bang-tui #chi-tiet .hang-nut button {
    min-height: 44px !important;
  }
}

/* ==================== 4. CHẾ TẠO (#bang-che) — TRỘN ==================== */
html body #che-tim {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
  min-height: 42px !important;
}
html body #che-tim::placeholder {
  color: #6b889c;
}
html body #che-tim:focus {
  border-color: var(--tm-vien-xanh) !important;
}
html body #che-tim-xoa {
  color: var(--tm-chu-phu) !important;
}
html body #che-tab button {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
  border-radius: 12px !important;
}
html body #che-tab button i {
  background: #e2eff8 !important;
  color: var(--tm-chu) !important;
}
html body #che-tab button.chon {
  background: var(--tm-nut-bien) !important;
  border-color: var(--tm-vien) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #07395c !important;
}
html body #che-tab button.chon i {
  background: #ffffff !important;
  color: #094973 !important;
}
html body #che-tab button[data-nhom="tat"] {
  background: #eef7fd !important;
  box-shadow: 0 3px 6px rgba(4, 24, 40, 0.14) !important;
}
html body #che-tab button[data-nhom="tat"].chon {
  background: var(--tm-nut-bien) !important;
}
html body #ds-che .dong-che {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  border-radius: 14px !important;
  color: var(--tm-chu) !important;
  box-shadow: 0 2px 6px rgba(4, 24, 40, 0.08);
}
html body #ds-che .dong-che.du {
  background: #f2fdf7 !important;
  border-color: #22b45a !important;
}
html body #ds-che .dong-che.goi-y {
  border-color: #e8a317 !important;
  background: #fffcf0 !important;
}
html body #ds-che .dong-che .ten {
  color: var(--tm-chu) !important;
  font-weight: 800;
}
html body #ds-che .dong-che .ten .vc-o {
  color: #245a7a !important;
  font-weight: 700;
}
html body #ds-che .dong-che .ten[data-nv-nhan]::after {
  color: #9e3500 !important;
  font-weight: 800;
}
html body #ds-che .dong-che .ten small.gh-dat {
  color: #0e6f3f !important;
}
html body #ds-che .dong-che .ten small.gh-dat.het {
  color: #c41d29 !important;
}
html body #ds-che .dong-che .can {
  gap: 5px !important;
  margin-top: 4px !important;
}
html body #ds-che .dong-che .can > span {
  padding: 2px 7px 2px 3px;
  border-radius: 9px;
  background: #dcf7ea;
  border: 1.5px solid #8fd8b5;
  color: #0e6a43;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
html body #ds-che .dong-che .can > span.thieu {
  background: #ffe5e0 !important;
  border-color: #f0a08f !important;
  color: #a12a12 !important;
}
html body #ds-che .dong-che .can .thieu-ten {
  color: #a12a12 !important;
  font-weight: 700;
}
html body #ds-che .dong-che .can .kc-r {
  color: #0b517a;
  font-weight: 700;
  margin-left: 2px;
}
html body #ds-che .dong-che .che-nl-goi {
  color: #096594 !important;
  font-weight: 700;
  opacity: 1 !important;
}
html body #che-tab button i,
html body #che-tab.dang-tim button {
  opacity: 1 !important;
}
html body #ds-che .dong-che .mo-ta,
html body #ds-che .dong-che .che-dk {
  color: var(--tm-chu-phu) !important;
}
html body #ds-che .dong-che .che-nl {
  background: #eef8ff !important;
  border: 2px solid #9fd3ee !important;
}
html body #ds-che .dong-che .che-nl-mon b {
  color: var(--tm-chu) !important;
}
html body #ds-che .dong-che .che-nl-mon.thieu b {
  color: #b81d29 !important;
}
html body #ds-che .dong-che .che-nl-mon li {
  color: var(--tm-chu) !important;
}
html body #ds-che .dong-che .che-nut button {
  min-height: 44px !important;
  border-radius: 12px !important;
  border: 2px solid var(--tm-vien) !important;
  font-weight: 800 !important;
}
html body #ds-che .dong-che .che-nut button[data-i] {
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #6e2400;
}
html body #ds-che .dong-che .che-nut button[data-i]:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  box-shadow: none;
  opacity: 1 !important;
}
html body #ds-che .dong-che .che-nut button.che-nhieu {
  background: var(--tm-nut-bien) !important;
  color: #ffffff !important;
  border-color: var(--tm-vien) !important;
}
html body #ds-che .dong-che .che-nut button.che-ghim {
  background: #ffffff !important;
  border-color: var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
  opacity: 1 !important;
}
html body #ds-che .dong-che .che-nut button.che-ghim.bat {
  background: #ffe9a8 !important;
  border-color: #d4961a !important;
}

/* ==================== 5. BẾP NẤU (#bang-na) — LẤY V2 ==================== */
html body #bang-na #than-na {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px !important;
}
html body #bang-na .na-tab {
  margin-bottom: 0 !important;
  gap: 6px;
}
html body #bang-na .na-tab button {
  min-height: 44px !important;
  border-radius: 12px !important;
  border: 2px solid #e7b573 !important;
  background: #fff4df !important;
  color: #6e3400 !important;
  font-weight: 900 !important;
}
html body #bang-na .na-tab button.chon {
  background: var(--tm-dau-cam) !important;
  border-color: #6b2200 !important;
  color: #ffffff !important;
}
html body #bang-na .na-luoi {
  display: grid;
  gap: 6px;
}
@media (min-width: 621px) {
  html body #bang-na .na-luoi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
html body #bang-na .na-mon {
  grid-template-columns: 46px minmax(0, 1fr) auto !important;
  gap: 8px !important;
  padding: 8px 9px !important;
  margin-bottom: 0 !important;
  border-radius: 14px !important;
  border: 2px solid #e7b573 !important;
  background: #ffffff !important;
  color: #3b2208 !important;
}
html body #bang-na .na-giua > b {
  color: #4a2300 !important;
  font-weight: 900;
}
html body #bang-na .na-buff {
  background: #fff1b8 !important;
  color: #6b4600 !important;
  border: 1.5px solid #e0b42b !important;
  font-weight: 800;
}
html body #bang-na .na-can {
  background: #ffe2dc !important;
  color: #a12a12 !important;
  border: 1.5px solid #f0a08f !important;
  border-radius: 9px !important;
  padding: 2px 7px 2px 3px !important;
  font-weight: 800;
  cursor: pointer;
}
html body #bang-na .na-can.du {
  background: #dcf7ea !important;
  color: #0e6a43 !important;
  border-color: #8fd8b5 !important;
}
html body #bang-na .na-nut-hop {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
}
html body #bang-na .na-nut-hop button {
  min-width: 66px;
  min-height: 44px;
  padding: 4px 12px;
  border-radius: 12px;
  border: 2px solid var(--tm-vien);
  font-weight: 900;
}
html body #bang-na .na-nut-hop button.chinh {
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #6e2400;
}
html body #bang-na .na-nut-hop button.chinh:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  box-shadow: none;
  opacity: 1 !important;
}
html body #bang-na .na-nut-hop button.na-nhieu {
  min-height: 36px;
  margin: 0 !important;
  background: var(--tm-nut-bien) !important;
  color: #ffffff !important;
}
html body.cam-ung #bang-na .na-nut-hop button.na-nhieu {
  min-height: 44px !important;
}
html body #bang-na .na-noi {
  background: #fff8e1 !important;
  border: 2px dashed #e0b42b !important;
}
html body #bang-na .na-noi button,
html body #bang-na .na-kho button {
  background: #ffffff !important;
  border: 2px solid #e7b573 !important;
  color: #3b2208 !important;
}
html body #bang-na .na-hang button {
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid var(--tm-vien);
  background: #ffffff;
  color: var(--tm-chu);
  font-weight: 800;
}
html body #bang-na .na-hang button.chinh {
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
}
html body #bang-na .xh-muc {
  color: #8c2d00 !important;
}

/* ==================== 6. BẢNG ĐẢO NHÀ (#bang-dn) — TRỘN ==================== */
html body #bang-dn .tab-ht {
  padding: 6px 10px 4px;
}
@media (max-width: 620px) {
  html body #bang-dn .tab-ht {
    gap: 4px !important;
    padding: 6px 8px 4px !important;
  }
  html body #bang-dn .tab-ht button {
    padding: 4px 7px !important;
    font-size: 11.5px !important;
    flex: 0 0 auto !important;
  }
}
html body #bang-dn .dn-the {
  background: #ffffff !important;
  border: 2px solid #d4bc88 !important;
  border-radius: 14px !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .dn-the.noi {
  background: #f2fdf7 !important;
  border-color: #22b45a !important;
}
html body #bang-dn .dn-the h3 {
  color: var(--tm-chu) !important;
  font-weight: 900;
}
html body #bang-dn .dn-the h3 small,
html body #bang-dn .dn-so,
html body #bang-dn .dn-ghi,
html body #bang-dn .dn-gio {
  color: var(--tm-chu-phu) !important;
}
html body #bang-dn .dn-the h4 {
  color: #0b5c8e !important;
  font-weight: 900;
}
html body #bang-dn .dn-the p,
html body #bang-dn .dn-so b {
  color: var(--tm-chu) !important;
}
html body #bang-dn .dn-hinh {
  border: 2px solid var(--tm-vien) !important;
  box-shadow: none !important;
}

/* Khối so sánh Trước -> Sau kiểu v2 trong bảng Đảo nhà */
.dn-ss {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 6px 0 8px;
}
.dn-ss-o {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 2px solid #cfe2ef;
  background: #f7fbff;
  min-width: 0;
}
.dn-ss-o.sau {
  border-color: #2bc96c;
  background: #f1fcf5;
}
.dn-ss-o b {
  font-size: 11.5px;
  color: #2b5a78;
}
.dn-ss-o.sau b {
  color: #0e6f3f;
}
.dn-ss-o span {
  font-size: 13.5px;
  font-weight: 900;
  color: #0b2f47;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dn-ss-o small {
  font-size: 11.5px;
  color: #486c82;
  font-weight: 700;
}
.dn-ss-mui {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--tm-vien);
  background: #ffe07d;
  color: var(--tm-vien);
  font-weight: 900;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.dn-ss-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.dn-ss-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: #17805a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
}

html body #bang-dn .dn-can {
  background: #ffe5e0 !important;
  border: 1.5px solid #f0a08f !important;
  color: #a12a12 !important;
  border-radius: 10px !important;
  cursor: pointer;
}
html body #bang-dn .dn-can.du {
  background: #dcf7ea !important;
  border-color: #8fd8b5 !important;
  color: #0e6a43 !important;
}
html body #bang-dn .dn-can small {
  color: inherit !important;
  opacity: 1 !important;
}
html body #bang-dn .dn-hang button {
  min-height: 44px !important;
  border-radius: 12px !important;
  border: 2px solid var(--tm-vien) !important;
  background: #eef7fd !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
}
html body #bang-dn .dn-hang button.chinh {
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
}
html body #bang-dn .dn-hang button:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
html body #bang-dn .dn-ct {
  background: #f5fbff !important;
  border: 1.5px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .dn-ct small {
  color: #0e6f3f !important;
}
html body #bang-dn .dn-ct.khoa small {
  color: #b81d29 !important;
}
html body #bang-dn .dn-ct p {
  color: var(--tm-chu-phu) !important;
}
html body #bang-dn .huong-dan {
  border-color: #c6dfee !important;
  background: #f4fbff !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .huong-dan summary {
  color: #0b5c8e !important;
}
html body #bang-dn .huong-dan p,
html body #bang-dn .huong-dan li {
  color: var(--tm-chu-phu) !important;
}

/* ==================== 7. CHỢ / SÀN GIAO DỊCH & TÀU BUÔN — TRỘN ==================== */
html body #bang-san .tieu-de .gt-dst {
  background: #0c314c !important;
  color: #ffe87a !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  border: 1.5px solid #ffffff !important;
}
html body #bang-san .gt-tab {
  padding: 6px 10px 4px;
}
html body #bang-san .gt-loc input,
html body #bang-san .gt-loc select,
html body #bang-san .gt-form input,
html body #bang-san .gt-form select {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
  min-height: 44px !important;
  border-radius: 10px !important;
}
html body #bang-san .gt-nut {
  min-height: 44px !important;
  border-radius: 11px !important;
  border: 2px solid var(--tm-vien) !important;
  background: #ffffff !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
}
html body #bang-san .gt-nut.chinh {
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
  border-color: var(--tm-vien) !important;
}
html body #bang-san .gt-nut.do {
  background: var(--tm-nut-do) !important;
  color: #ffffff !important;
}
html body #bang-san .gt-nut:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
.gt-tb-nut {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
html body #bang-san .gt-tb-nut .gt-an-hep {
  display: inline !important;
}
.gt-dot-xanh {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #18b865;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px #0d6d3e;
  flex: 0 0 auto;
}
html body #bang-san .gt-ghi,
html body #bang-san .gt-ghi b {
  color: var(--tm-chu-phu) !important;
}
html body #bang-san .gt-dong {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  border-radius: 14px !important;
  color: var(--tm-chu) !important;
}
html body #bang-san .gt-dong.toi {
  background: #fffcf0 !important;
  border-color: #e8a317 !important;
}
html body #bang-san .gt-giua > b,
html body #bang-san .gt-doi {
  color: var(--tm-chu) !important;
}
html body #bang-san .gt-giua small,
html body #bang-san .gt-phu,
html body #bang-san .gt-gia small {
  color: var(--tm-chu-phu) !important;
}
html body #bang-san .gt-gia {
  color: #9e4b00 !important;
}
.gt-trong-the {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px dashed var(--tm-vien-nhat);
  text-align: center;
}
.gt-trong-the p {
  margin: 0;
  color: var(--tm-chu-phu);
  font-weight: 700;
  font-size: 14px;
}
.gt-trong-nut {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
html body #bang-tau-buon .tp-cho-chu,
html body #bang-tau-buon .nca-cau {
  color: var(--tm-chu-phu) !important;
}
html body #bang-tau-buon .nca-mon {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  border-radius: 14px !important;
  color: var(--tm-chu) !important;
}
html body #bang-tau-buon .nca-doi {
  background: var(--tm-nut-xanh) !important;
  color: #ffffff !important;
  border: 2px solid var(--tm-vien) !important;
  border-radius: 12px !important;
  min-height: 44px;
}
html body #bang-tau-buon .nca-doi:disabled {
  background: var(--tm-nut-khoa) !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}

/* ==================== 8. CÀI ĐẶT (#bang-caidat) — TRỘN ==================== */
html body #bang-caidat .cd-than {
  padding: 0 12px 12px !important;
}
html body #cd-the {
  background: #e9f5fd !important;
  border-bottom: 2px solid var(--tm-vien-nhat) !important;
  margin: 0 -12px 8px !important;
  padding: 8px 12px !important;
}
html body #bang-caidat .cd-tieu {
  color: var(--tm-chu) !important;
  font-weight: 800;
  margin-top: 8px;
}
html body #bang-caidat #cd-so,
html body #bang-caidat #cd-mo-so {
  color: #0b5c8e !important;
  font-weight: 900;
}
html body #bang-caidat .cd-hang {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  border-radius: 14px !important;
  padding: 10px 12px !important;
  margin-top: 8px !important;
  color: var(--tm-chu) !important;
}
html body #bang-caidat .cd-hang + .cd-hang {
  border-top: 2px solid #c6dfee !important;
}
html body #bang-caidat .cd-nhan {
  color: var(--tm-chu) !important;
  font-weight: 800;
}
html body #bang-caidat .cd-nhan small,
html body #bang-caidat .cd-may,
html body #bang-caidat .cd-hang.cd-doc .cd-chon button small {
  color: var(--tm-chu-phu) !important;
  font-weight: 600;
  opacity: 1 !important;
}
html body #bang-caidat .cd-hang.cd-doc .cd-chon button.chon small {
  color: #ffffff !important;
  opacity: 1 !important;
}
html body #bang-caidat input[type="range"] {
  height: 44px !important;
  accent-color: #1682c4 !important;
}
html body #bang-caidat .cd-chon {
  border: 0 !important;
  gap: 6px;
  overflow: visible !important;
}
html body #bang-caidat .cd-chon button {
  min-width: 44px !important;
  min-height: 44px !important;
  height: auto !important;
  border-radius: 12px !important;
  border: 2px solid #9ac5df !important;
  background: #ffffff !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
  padding: 6px 10px !important;
}
html body #bang-caidat .cd-chon button.chon {
  background: var(--tm-nut-cam) !important;
  border-color: var(--tm-vien) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
html body #bang-caidat .cd-nut,
html body #bang-caidat .cd-chu {
  min-height: 44px !important;
  border-radius: 12px !important;
  border: 2px solid var(--tm-vien) !important;
  background: #f1f9ff !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
}
html body #bang-caidat .cd-gat::before {
  background: #b9cedc !important;
  border: 2px solid var(--tm-vien) !important;
}
html body #bang-caidat .cd-gat.bat::before {
  background: #179658 !important;
  border-color: var(--tm-vien) !important;
}
html body #bang-caidat .cd-gat i {
  background: #ffffff !important;
  border: 1.5px solid var(--tm-vien);
}
html body #bang-caidat .cd-meo {
  background: #fff7dc !important;
  border: 1.5px solid #e6be53 !important;
  color: #6b4300 !important;
  border-radius: 12px;
  padding: 8px 10px;
}

/* ==================== 9. TOAST (#thong-bao, #lan-tb) — LẤY V2 ==================== */
html body #thong-bao {
  max-width: min(350px, calc(100vw - 24px));
}
html body #thong-bao:empty,
html body #lan-tb:empty,
html body #lan-tb[hidden],
html body #dai-khan:empty,
html body #dai-khan[hidden] {
  display: none !important;
}
html body #thong-bao .tb,
html body #lan-tb .tb.lan {
  padding: 7px 15px !important;
  border-radius: 999px !important;
  border: 2.5px solid #ffffff !important;
  background: #072236 !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  box-shadow: 0 5px 16px rgba(4, 24, 40, 0.42) !important;
  text-shadow: none !important;
}
html body #thong-bao .tb-chu {
  -webkit-line-clamp: 3 !important;
}
html body #thong-bao .tb.tot,
html body #lan-tb .tb.lan.tot {
  background: #118049 !important;
}
html body #thong-bao .tb.canh,
html body #lan-tb .tb.lan.canh {
  background: #a85200 !important;
}
html body #thong-bao .tb.loi,
html body #lan-tb .tb.lan.loi {
  background: #b81d29 !important;
}
html body #thong-bao .tb.loi .tb-chu::before,
html body #thong-bao .tb.canh .tb-chu::before {
  color: #ffffff !important;
}

/* ==================== 10. POPUP XÁC NHẬN (#hop-thoai) — LẤY V2 ==================== */
html body #hop-thoai .ht-hop {
  width: min(400px, calc(100vw - 24px)) !important;
  border-radius: 22px !important;
  border: 3px solid var(--tm-vien) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px #0d7fb4, 0 18px 42px rgba(2, 14, 28, 0.58) !important;
  color: var(--tm-chu) !important;
  padding: 16px 16px 14px !important;
}
html body #hop-thoai .ht-hop::before,
html body #hop-thoai .ht-hop::after {
  display: none !important;
}
html body #hop-thoai .tieu-de {
  background: transparent !important;
  border: 0 !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 19px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  color: var(--tm-chu) !important;
  text-shadow: none !important;
  padding: 2px 8px 6px !important;
}
html body #hop-thoai .ht-nd {
  text-align: center;
  color: var(--tm-chu-phu) !important;
  font-size: 14px !important;
  font-weight: 600;
  padding: 2px 6px 14px !important;
}
html body #hop-thoai .ht-o {
  background: #f4fbff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
  border-radius: 12px !important;
}
html body #hop-thoai .ht-dem {
  color: var(--tm-chu-phu) !important;
}
html body #hop-thoai .ht-nut {
  gap: 10px !important;
  padding: 2px 0 0 !important;
}
html body #hop-thoai .ht-nut button {
  min-height: 46px !important;
  border-radius: 999px !important;
  border: 2.5px solid var(--tm-vien) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
}
html body #hop-thoai .ht-nut .ht-huy {
  background: var(--tm-nut-bien) !important;
  box-shadow: 0 3px 0 #07395c !important;
}
html body #hop-thoai .ht-nut .ht-ok {
  background: var(--tm-nut-xanh) !important;
  box-shadow: 0 3px 0 #064427 !important;
}
html body #hop-thoai .ht-nut .ht-ok.do {
  background: var(--tm-nut-do) !important;
  box-shadow: 0 3px 0 #701018 !important;
}
html body #hop-thoai .ht-nut button:disabled {
  background: var(--tm-nut-khoa) !important;
  color: #3c5566 !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

/* ==================== 11. PHẦN THƯỞNG / MỞ RƯƠNG (#man-ruong) — TRỘN ==================== */
html body #man-ruong .khung-ruong {
  width: min(440px, 100%);
  padding: 14px 16px 16px;
  border-radius: 24px;
  border: 3px solid var(--tm-vien);
  background: linear-gradient(180deg, #fffdf6 0%, #eaf6ff 100%);
  box-shadow: 0 0 0 3px #0d7fb4, 0 20px 44px rgba(2, 14, 28, 0.58);
  color: var(--tm-chu);
}
html body #man-ruong #cv-ruong {
  margin: 0 auto 6px !important;
  width: min(220px, 54vw) !important;
  min-width: 150px !important;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 60%, #ffe89a 0%, #fff6d1 48%, #e4f4ff 100%);
  border: 2px solid #f0be4d;
}
html body #man-ruong #ruong-ten {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe782 0%, #ffba2e 100%);
  border: 2px solid var(--tm-vien);
  color: #3a2200 !important;
  text-shadow: none !important;
  font-size: 16px !important;
  letter-spacing: 0.4px !important;
  margin-bottom: 10px !important;
}
html body #man-ruong .the-do {
  width: 92px !important;
  padding: 8px 6px !important;
  border-radius: 14px !important;
  border: 2px solid #9ac5df !important;
  background: #ffffff !important;
  color: var(--tm-chu) !important;
  box-shadow: 0 2px 6px rgba(4, 24, 40, 0.12) !important;
  font-weight: 700;
}
html body #man-ruong .the-do b {
  color: #0e6f3f !important;
  font-size: 13px !important;
}
html body #man-ruong #ruong-nhan {
  width: min(280px, 100%) !important;
  min-height: 48px !important;
  border-radius: 999px !important;
  border: 2.5px solid var(--tm-vien) !important;
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 #6e2400 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}
@media (max-height: 460px) and (min-width: 560px) {
  html body #man-ruong .khung-ruong {
    width: min(640px, 100%);
    max-height: calc(100dvh - 18px) !important;
    display: grid !important;
    grid-template-columns: 185px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 10px 16px;
  }
  html body #man-ruong #cv-ruong {
    width: 180px !important;
    height: auto !important;
    max-height: calc(100dvh - 54px) !important;
    aspect-ratio: 408 / 432;
    margin: 0 !important;
  }
  html body #man-ruong .ruong-phai {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: calc(100dvh - 50px);
    overflow-y: auto;
    padding-bottom: 6px;
  }
  html body #man-ruong #ruong-do {
    margin-bottom: 10px !important;
  }
}

/* ==================== 12. POPUP GỤC NGÃ (#man-chet) — TRỘN ==================== */
html body #man-chet .khung-dn {
  width: min(410px, calc(100vw - 24px)) !important;
  padding: 18px 18px 16px !important;
  border-radius: 22px !important;
  border: 3px solid var(--tm-vien) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px #0d7fb4, 0 20px 44px rgba(2, 14, 28, 0.58) !important;
  color: var(--tm-chu) !important;
  backdrop-filter: none !important;
}
html body #man-chet .khung-dn::before,
html body #man-chet .khung-dn::after {
  display: none !important;
}
html body #man-chet .logo.do {
  color: #b81d29 !important;
  text-shadow: none !important;
  font-size: 24px !important;
  letter-spacing: 1px !important;
}
html body #man-chet #chet-nd {
  color: var(--tm-chu) !important;
  margin: 8px 0 14px !important;
}
html body #man-chet #chet-nd .chet-ly {
  color: var(--tm-chu) !important;
  font-size: 16px !important;
}
html body #man-chet #chet-nd .chet-mat {
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff1f2;
  border: 2px solid #f08a94;
}
html body #man-chet #chet-nd .chet-khong {
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff1f2;
  border: 2px solid #f08a94;
  color: #a31824 !important;
  font-weight: 800;
}
html body #man-chet #chet-nd .chet-nhan {
  color: #a31824 !important;
  font-weight: 800;
}
html body #man-chet #chet-nd .chet-chip {
  background: #ffffff !important;
  border: 1.5px solid #e06570 !important;
  color: var(--tm-chu) !important;
  font-weight: 700;
}
html body #man-chet #chet-nd .chet-chip b {
  color: #b81d29 !important;
}
html body #man-chet #chet-nd .chet-noi {
  color: var(--tm-chu-phu) !important;
  font-weight: 600;
}
html body #man-chet #chet-nd .chet-meo {
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff7dc;
  border: 1.5px solid #e6be53;
  color: #6b4300 !important;
  font-weight: 700;
}
html body #man-chet #chet-day {
  min-height: 48px !important;
  border-radius: 999px !important;
  border: 2.5px solid var(--tm-vien) !important;
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 #6e2400 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}
@media (max-height: 460px) {
  html body #man-chet .khung-dn {
    width: min(520px, calc(100vw - 24px)) !important;
    padding: 12px 16px !important;
  }
  html body #man-chet .logo.do {
    font-size: 20px !important;
  }
  html body #man-chet #chet-nd {
    margin: 6px 0 10px !important;
  }
  html body #man-chet #chet-nd .chet-mat {
    margin: 6px 0 !important;
    padding: 6px 8px;
  }
}

/* ==================== 13. THẺ VẬT PHẨM / CÁCH KIẾM (#the-vat) — LẤY V2 ==================== */
html body #the-vat {
  background: rgba(4, 22, 36, 0.56) !important;
}
html body #the-vat .tv-hop {
  border-radius: 20px !important;
  border: 3px solid var(--tm-vien) !important;
  background: linear-gradient(180deg, #fffdf4 0%, #f5fbff 100%) !important;
  box-shadow: var(--tm-bong) !important;
  color: var(--tm-chu) !important;
  padding: 14px 16px 16px !important;
}
html body #the-vat .tv-x {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  float: none !important;
  margin: 0 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  border: 2.5px solid var(--tm-vien) !important;
  background: #ffffff !important;
  color: var(--tm-chu) !important;
  font-size: 24px !important;
  font-weight: 900 !important;
}
html body #the-vat .tv-dau {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 2px 50px 2px 0 !important;
}
html body #the-vat .tv-dau > div {
  min-width: 0;
  text-align: left;
}
html body #the-vat .tv-dau img {
  background: #e3f4ff !important;
  border: 2px solid #9fd3ee !important;
  border-radius: 10px !important;
  object-fit: contain;
}
html body #the-vat .tv-dau b {
  color: var(--tm-chu) !important;
  font-size: 17px !important;
  font-weight: 900 !important;
}
html body #the-vat .tv-dau span {
  color: var(--tm-chu-phu) !important;
  font-weight: 700;
}
html body #the-vat .tv-mo-ta {
  color: #2f5169 !important;
  font-weight: 600;
}
html body #the-vat .tv-nguon {
  background: #eef8ff !important;
  border: 2px solid #9fd3ee !important;
  border-radius: 12px !important;
}
html body #the-vat .tv-nguon-dau {
  color: var(--tm-chu-phu) !important;
  font-weight: 900;
}
html body #the-vat .tv-nguon li {
  color: var(--tm-chu) !important;
  font-weight: 700;
}
html body #the-vat .tv-nguon li::marker {
  color: #0d89bf !important;
}
html body #the-vat .tv-cho {
  color: var(--tm-chu-phu) !important;
}

/* ==================== 14. CHAU CHUỐT UI, CHUYỂN ĐỘNG & ĐỒNG BỘ HUD ==================== */

/* Sửa khe hở #chi-so và #dong-ho trên màn dọc 390×844 (không chạm viền) */
@media (orientation: portrait) and (max-width: 620px) {
  html body.cam-ung #hang-tren {
    row-gap: 7px !important;
  }
  html body.cam-ung #dong-ho {
    margin-top: 2px !important;
  }
}

/* Mép cuộn gợi ý cho thanh lọc Túi đồ khi còn tab khuất */
html body #bang-tui .tui-loc.con-phai {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
}

/* Chuyển động mở bảng & popup (gọn 180 ms, tắt khi giảm chuyển động) */
/* 02/12 (chủ game: bảng Quà mỗi ngày lệch xuống góc phải trên iPad): hiệu ứng mở / đóng bảng dùng thuộc tính RIÊNG translate + scale — cộng dồn
   với transform của bảng thay vì ghi đè. Trước đây keyframe đặt `transform`, xoá mất translate(-50%, -50%) canh giữa của bảng .bang.lon.co-vua…
   trên máy cảm ứng màn to (≥ 621×501: iPad, điện thoại gập) → góc trên trái bảng nằm ở tâm màn, nửa bảng tràn ra ngoài. */
@keyframes tm-bang-mo {
  0% { opacity: 0; translate: 0 10px; scale: 0.96; }
  100% { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes tm-bang-giua-mo {
  0% { opacity: 0; translate: 0 10px; scale: 0.96; }
  100% { opacity: 1; translate: 0 0; scale: 1; }
}
@keyframes tm-toast-vao {
  0% { opacity: 0; transform: translateY(-6px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tm-the-vao {
  0% { opacity: 0; transform: translateY(8px) scale(0.88); }
  65% { opacity: 1; transform: translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tm-vua-xong {
  0% { box-shadow: 0 0 0 0 rgba(23, 150, 88, 0.75); background-color: #d6fbe5; }
  100% { box-shadow: 0 0 0 8px rgba(23, 150, 88, 0); }
}

html body:not(.giam-cd) .bang.lon:not([hidden]),
html body:not(.giam-cd) #hop-thoai:not([hidden]) .ht-hop,
html body:not(.giam-cd) #man-ruong:not([hidden]) .khung-ruong,
html body:not(.giam-cd) #man-chet:not([hidden]) .khung-dn,
html body:not(.giam-cd) #the-vat:not([hidden]) .tv-hop {
  animation: tm-bang-mo 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html body:not(.giam-cd):not(.cam-ung) .bang.lon:not([hidden]),
html body:not(.giam-cd) #bang-chuong:not([hidden]) {
  animation: tm-bang-giua-mo 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html body:not(.giam-cd) #thong-bao .tb,
html body:not(.giam-cd) #lan-tb .tb.lan {
  animation: tm-toast-vao 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html body:not(.giam-cd) #man-ruong .the-do {
  animation: tm-the-vao 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html body:not(.giam-cd) .tm-vua-xong {
  animation: tm-vua-xong 0.45s ease-out !important;
}

/* Phản hồi bấm nút mượt & rõ */
html body button,
html body .o-cam,
html body .o-tui {
  transition: transform 90ms ease-out, box-shadow 90ms ease-out, filter 110ms ease-out;
}
html body button:active:not(:disabled),
html body .o-cam:active,
html body .o-tui:active {
  transform: translateY(1.5px) scale(0.96);
}
@media (prefers-reduced-motion: reduce) {
  html body * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
html body.giam-cd * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

/* Nút chính (#nut-chinh), nút vòng cung (.nut-vong), chip Việc kế (#vk-chip): nền đặc Tròn mềm, tương phản cao ngày/đêm */
html body #nut-chinh .vong {
  background: linear-gradient(180deg, #27a7dc 0%, #0d6299 100%) !important;
  border: 3px solid var(--tm-vien) !important;
  box-shadow: 0 4px 0 #04253a, 0 6px 14px rgba(4, 24, 40, 0.42), inset 0 2px 0 rgba(255, 255, 255, 0.42) !important;
  color: #ffffff !important;
  text-shadow: 0 1.5px 0 #04253a !important;
  opacity: 1 !important;
}
html body #nut-chinh.giat .vong {
  background: linear-gradient(180deg, #ff7836 0%, #c9251b 100%) !important;
  border-color: #fff2b2 !important;
  box-shadow: 0 4px 0 #6e120a, 0 0 18px rgba(255, 118, 54, 0.72) !important;
}
html body #nut-chinh.an .vong {
  transform: translateY(2px) scale(0.94) !important;
  box-shadow: 0 2px 0 #04253a, 0 3px 8px rgba(4, 24, 40, 0.35) !important;
}

html body.cam-ung #nut-phu button,
html body.cam-ung .nut-vong,
html body.cam-ung #dao-thanh .dao-nut {
  background: linear-gradient(180deg, #ffffff 0%, #e4f3fc 100%) !important;
  border: 2px solid var(--tm-vien) !important;
  box-shadow: 0 3px 0 rgba(4, 37, 58, 0.34), 0 4px 10px rgba(4, 24, 40, 0.25) !important;
  color: var(--tm-chu) !important;
  opacity: 1 !important;
}
html body.cam-ung #nut-phu button:active,
html body.cam-ung .nut-vong:active,
html body.cam-ung #dao-thanh .dao-nut:active {
  background: linear-gradient(180deg, #fff4d2 0%, #ffe094 100%) !important;
  border-color: var(--tm-vien) !important;
  transform: scale(0.93) !important;
}
html body.cam-ung .nut-vong .nv-c,
html body.cam-ung #dao-thanh .dao-nut b {
  color: var(--tm-chu) !important;
  font-weight: 900 !important;
}
html body.cam-ung #dao-thanh .dao-nut.chinh {
  background: var(--tm-nut-cam) !important;
  border-color: var(--tm-vien) !important;
  color: #ffffff !important;
}
html body.cam-ung #dao-thanh .dao-nut.chinh b {
  color: #ffffff !important;
}
html body #lai-nut-cam {
  background: linear-gradient(180deg, #1b6b9e 0%, #0d4469 100%) !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 3px 0 rgba(4, 37, 58, 0.45), 0 4px 12px rgba(4, 24, 40, 0.35) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}
html body #vk-chip {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  box-shadow: var(--tm-bong-nhe) !important;
  opacity: 1 !important;
}

/* Menu thẻ (body.menu-the) & Menu lưới (#menu-luoi): đồng bộ vỏ Tròn mềm nền đặc sáng */
html body.menu-the #mt-hang {
  background: linear-gradient(180deg, #fffdf6 0%, #eef7ff 100%) !important;
  border: 2.5px solid var(--tm-vien) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 28px rgba(3, 18, 34, 0.45), inset 0 2px 0 #ffffff !important;
}
html body.menu-the .mt-n {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  border-radius: 12px !important;
  color: var(--tm-chu) !important;
  box-shadow: 0 2px 0 #c6dff0 !important;
}
html body.menu-the .mt-n span {
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
}
html body.menu-the .mt-n[data-lui] {
  background: #e6f4fd !important;
  border-color: var(--tm-vien-xanh) !important;
  color: var(--tm-vien-xanh) !important;
}
html body.menu-the .mt-n:active {
  background: #ffe8b5 !important;
  border-color: #c24a02 !important;
}
html body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau {
  background: var(--tm-dau-xanh) !important;
  border-bottom: 2.5px solid var(--tm-vien) !important;
  border-radius: 16px 16px 0 0 !important;
}
html body.menu-the #bang-na.bang.lon[data-mt] > .tieu-de.co-mt-dau {
  background: var(--tm-dau-cam) !important;
}
html body.menu-the .mt-mui {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 0 rgba(4, 37, 58, 0.25) !important;
}
html body.menu-the #mt-ten,
html body.menu-the #mt-ten .mt-ten-chu,
html body.menu-the #mt-ten .mt-ten-bt .mt-bt {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}
html body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > .td-goc > * {
  background: #0c314c !important;
  color: #ffe87a !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  border: 1.5px solid #ffffff !important;
  margin: 0 6px 2px 0 !important;
}
html body.menu-the #mt-chan {
  background: #0c314c !important;
  color: #ffe9a8 !important;
  padding: 2px 9px !important;
  border-radius: 999px !important;
  border: 1.5px solid #ffffff !important;
  margin: 0 0 2px !important;
}

/* Menu lưới (#menu-luoi) & các bảng phổ biến khác (Sổ tay, Hệ thống, Quà ngày, Bản đồ, Chuông) */
html body #menu-luoi .ml-tam,
html body :is(#bang-st, #bang-ht, #bang-qua-ngay, #bang-ban-do, #bang-chuong) {
  background: linear-gradient(180deg, var(--tm-nen) 0%, var(--tm-nen-2) 100%) !important;
  border: 3px solid var(--tm-vien) !important;
  border-radius: 20px !important;
  box-shadow: var(--tm-bong) !important;
  color: var(--tm-chu) !important;
}
html body #menu-luoi .ml-dau,
html body :is(#bang-st, #bang-ht, #bang-qua-ngay, #bang-ban-do, #bang-chuong) > .tieu-de {
  background: var(--tm-dau-xanh) !important;
  border-bottom: 2.5px solid var(--tm-vien) !important;
  border-radius: 16px 16px 0 0 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
  padding: 6px 8px 6px 14px !important;
}
html body #menu-luoi .ml-dau .nut-x,
html body :is(#bang-st, #bang-ht, #bang-qua-ngay, #bang-ban-do, #bang-chuong) > .tieu-de .nut-x {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  border: 2px solid var(--tm-vien) !important;
  background: var(--tm-nut-do) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #701018 !important;
}
html body #menu-luoi .ml-nhom h3 {
  color: var(--tm-chu-phu) !important;
  font-weight: 800 !important;
}
html body #menu-luoi .ml-o {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
  box-shadow: 0 2px 0 #c6dff0 !important;
}
html body #menu-luoi .ml-o span {
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
}
html body #menu-luoi .ml-o:active {
  background: #ffe8b5 !important;
  border-color: #c24a02 !important;
}

/* 1/12 chủ game: "Làm ô vuông đi cho đẹp" — mọi ô đồ (túi, kho cần, thanh nhanh, thanh cầm) là Ô VUÔNG; tên nằm trong ô, cắt 1 dòng */
html body #bang-tui #luoi-tui {
  grid-template-columns: repeat(auto-fill, 74px) !important;
  grid-auto-rows: 74px !important;
  justify-content: start !important;
  gap: 6px !important;
}
html body #bang-tui #luoi-tui .o-tui,
html body #bang-tui #luoi-tui .cc-o,
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui {
  width: 74px !important; height: 74px !important; aspect-ratio: auto !important; min-height: 0 !important;
  padding: 4px 4px 7px !important; justify-content: center !important; gap: 2px !important;
}
html body #bang-tui #luoi-tui .o-tui img { width: 34px !important; height: 34px !important; aspect-ratio: 1 / 1; }
html body #bang-tui #luoi-tui .o-tui .o-ten { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px !important; line-height: 13px !important; }
html body #bang-tui #luoi-tui i.o-tui.o-trong { width: 74px !important; height: 74px !important; aspect-ratio: auto !important; }
@media (max-width: 620px) {
  html body #bang-tui #luoi-tui { grid-template-columns: repeat(auto-fill, 66px) !important; grid-auto-rows: 66px !important; gap: 5px !important; }
  html body #bang-tui #luoi-tui .o-tui,
  html body #bang-tui #luoi-tui .cc-o,
  html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui,
  html body #bang-tui #luoi-tui i.o-tui.o-trong { width: 66px !important; height: 66px !important; }
  html body #bang-tui #luoi-tui .o-tui img { width: 30px !important; height: 30px !important; }
}
html body #bang-tui #tui-thanh .o-cam.tt,
html body.cam-ung #bang-tui #tui-thanh .o-cam.tt { height: auto !important; aspect-ratio: 1 / 1 !important; }
html body #thanh-cam .o-cam { aspect-ratio: 1 / 1 !important; }


/* ==================== 15. TƯƠNG PHẢN NỀN SÁNG CHO TOÀN BỘ BẢNG & POPUP CÒN LẠI (01/12) ==================== */

/* Dùng chung cho các bảng nền sáng (#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong) */
html body :is(#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong) :is(.nho-mo, .trong) {
  color: var(--tm-chu-phu) !important;
}
html body :is(#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #bang-dn) .thanh {
  background: #d7e8f3 !important;
  border: 1.5px solid #9ac5df !important;
}
html body :is(#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #bang-dn) .thanh > span {
  background: linear-gradient(90deg, #d87a00, #f5a425) !important;
}
html body :is(#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #bang-dn) .thanh.xanh > span {
  background: linear-gradient(90deg, #13854f, #22b45a) !important;
}

/* Tab của #bang-st (Sổ tay) đồng bộ với #bang-ht */
html body #bang-st .tab-st {
  gap: 5px;
  padding: 4px 10px 6px !important;
}
html body #bang-st .tab-st button {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  border-radius: 11px !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
  min-height: 40px;
}
html body.cam-ung #bang-st .tab-st button {
  min-height: 44px !important;
}
html body #bang-st .tab-st button.chon {
  background: var(--tm-nut-cam) !important;
  border-color: #7a2600 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 0 #6b2200;
}

/* ---- 15a. Bảng Hệ thống (#bang-ht): Nhiệm vụ & Phiếu Tuần ---- */
html body #bang-ht .pt-khung {
  background: #fffdf4 !important;
  border: 2px solid #e0b42b !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .pt-dau > b {
  color: #8c3b00 !important;
}
html body #bang-ht .pt-con {
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .pt-con b {
  color: var(--tm-chu) !important;
}
html body #bang-ht .pt-thanh {
  background: #d7e8f3 !important;
  border: 1.5px solid #9ac5df !important;
}
html body #bang-ht .pt-thanh > span {
  background: linear-gradient(90deg, #d87a00, #f5a425) !important;
}
html body #bang-ht .pt-vach {
  background: #5e8299 !important;
}
html body #bang-ht .pt-vach.dat {
  background: #c24a02 !important;
}
html body #bang-ht .pt-vach b {
  color: var(--tm-chu-phu) !important;
  background: #fffdf4 !important;
  padding: 0 3px;
  border-radius: 4px;
}
html body #bang-ht .pt-vach.dat b {
  color: #8c3b00 !important;
  background: #fffdf4 !important;
}
html body #bang-ht .pt-nac {
  background: #ffffff !important;
  border: 2px solid #b5d5e8 !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .pt-nac.dat {
  background: #fff9e0 !important;
  border-color: #d4961a !important;
  box-shadow: 0 0 0 2px rgba(212, 150, 26, 0.22) !important;
}
html body #bang-ht .pt-nac.da {
  background: #edf5fa !important;
  border-color: #b8ccd9 !important;
  opacity: 1 !important;
}
html body #bang-ht .pt-moc {
  color: var(--tm-chu) !important;
}
html body #bang-ht .pt-moc::after {
  color: #b86b00 !important;
}
html body #bang-ht .pt-qua {
  color: var(--tm-chu) !important;
  font-weight: 700;
}
html body #bang-ht .pt-qua em {
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .pt-nhan {
  min-height: 44px !important;
  border: 2px solid var(--tm-vien) !important;
  background: linear-gradient(180deg, #ffe066 0%, #f0b424 100%) !important;
  color: #1b1300 !important;
  font-weight: 900 !important;
}
html body #bang-ht .pt-xong {
  color: #0d6d3e !important;
  font-weight: 800;
}
html body #bang-ht .pt-khoa {
  color: var(--tm-chu-phu) !important;
  font-weight: 700;
}
html body #bang-ht .pt-cu {
  border-top-color: #c6dfee !important;
}
html body #bang-ht .pt-cu-dau {
  color: #8c3b00 !important;
  font-weight: 800;
}
html body #bang-ht .pt-chan,
html body #bang-ht .pt-nguon,
html body #bang-ht .pt-nguon span {
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .pt-hom {
  color: var(--tm-chu) !important;
  font-weight: 800;
}
html body #bang-ht .dong-nv {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .dong-nv.xong {
  background: #edf7f2 !important;
  border-color: #22b45a !important;
  opacity: 1 !important;
}
html body #bang-ht .dong-nv .ten {
  color: var(--tm-chu) !important;
  font-weight: 800;
}
html body #bang-ht .dong-nv .thuong {
  color: #8c3b00 !important;
  font-weight: 700;
}
html body #bang-ht .dong-nv .nut-nv-doi {
  background: #eef7fd !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 9px !important;
}
html body.cam-ung #bang-ht .dong-nv .nut-nv-doi {
  min-height: 44px !important;
  min-width: 56px !important;
  font-size: 12.5px !important;
}

/* ---- 15b. Bảng Hệ thống (#bang-ht): Sở trường (.str-*) ---- */
html body #bang-ht .str-diem {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .str-diem.con {
  background: #fff8df !important;
  border-color: #d4961a !important;
}
html body #bang-ht .str-diem > b {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
}
html body #bang-ht .str-diem.con > b {
  color: #9e3500 !important;
  text-shadow: none !important;
}
html body #bang-ht .str-diem small,
html body #bang-ht .str-moc,
html body #bang-ht .str-gt {
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .str-moc span.co {
  color: #0d6d3e !important;
  font-weight: 800;
}
html body #bang-ht .str-doi {
  background: #eef7fd !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  min-height: 44px !important;
  opacity: 1 !important;
}
html body #bang-ht .str-doi small {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #bang-ht .str-doi.xn {
  background: #ffe8ea !important;
  border-color: #c42b37 !important;
  color: #a31824 !important;
}
html body #bang-ht .str-doi:disabled,
html body #bang-ht .str-doi:disabled small {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
html body #bang-ht .str-nhanh {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .str-nhanh h4 {
  color: #0a5b94 !important;
  font-weight: 900;
}
html body #bang-ht .str-nut {
  background: #f4fbff !important;
  border: 1.5px solid #c6dfee !important;
}
html body #bang-ht .str-nut.co {
  background: #fff9e3 !important;
  border-color: #d4961a !important;
}
html body #bang-ht .str-ten {
  color: var(--tm-chu) !important;
}
html body #bang-ht .str-cham i {
  border-color: #5a7e94 !important;
}
html body #bang-ht .str-cham i.co {
  background: #d87a00 !important;
  border-color: #9e3500 !important;
  box-shadow: none !important;
}
html body #bang-ht .str-cong {
  background: linear-gradient(180deg, #ffe066 0%, #f0b424 100%) !important;
  border: 2px solid var(--tm-vien) !important;
  color: #1b1300 !important;
}
html body #bang-ht .str-cong:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
html body #bang-ht .str-day {
  background: #fff3c4 !important;
  border: 1.5px solid #c98800 !important;
  color: #7a3b00 !important;
}
html body #bang-ht .str-mota,
html body #bang-ht .str-bac li {
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .str-bac li b {
  background: #e3f1fa !important;
  border-color: #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .str-bac li.co {
  color: var(--tm-chu) !important;
  font-weight: 700;
}
html body #bang-ht .str-bac li.co b {
  background: #ffe066 !important;
  border-color: #b87a00 !important;
  color: #1b1300 !important;
}
html body #bang-ht .str-bac li.ke b {
  background: #0a5b94 !important;
  border-color: #0a5b94 !important;
  color: #ffffff !important;
}
html body #bang-ht .str-cu {
  background: #f4fbff !important;
  border-color: #9ac5df !important;
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .str-cu b {
  color: var(--tm-chu) !important;
}

/* ---- 15c. Bảng Hệ thống (#bang-ht): Cốt truyện (.ctr-*) ---- */
html body #bang-ht .ctr-chuong {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .ctr-chuong.dang {
  background: #fffaf0 !important;
  border-color: #d4961a !important;
}
html body #bang-ht .ctr-chuong.khoa {
  background: #edf4f8 !important;
  border-color: #b8ccd9 !important;
  opacity: 1 !important;
}
html body #bang-ht .ctr-ds-nv li {
  color: var(--tm-chu) !important;
}
html body #bang-ht .ctr-ds-nv li.xong {
  color: #0d6d3e !important;
  font-weight: 700;
}
html body #bang-ht .ctr-ds-nv li.dang {
  color: #8c3b00 !important;
  font-weight: 800;
}
html body #bang-ht .ctr-nut-nho button {
  background: var(--tm-nut-bien) !important;
  border: 2px solid var(--tm-vien) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}
html body.cam-ung #bang-ht .ctr-nut-nho button {
  min-height: 44px !important;
}
html body #bang-ht .ctr-khoa li {
  color: var(--tm-chu-phu) !important;
  border-bottom-color: #c6dfee !important;
}
html body #bang-ht .ctr-khoa li.mo {
  color: #0d6d3e !important;
  font-weight: 700;
}

/* ---- 15d. Bảng Hệ thống (#bang-ht): Cửa hàng & Nhân vật ---- */
html body #bang-ht .dau-ch {
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .dau-ch b {
  color: #8c3b00 !important;
}
html body #bang-ht .mon-ch {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .mon-ch.dac-biet {
  background: #fffcf0 !important;
  border-color: #d4961a !important;
}
html body #bang-ht .mon-ch.khoa {
  background: #edf4f8 !important;
  border-color: #b8ccd9 !important;
  opacity: 1 !important;
}
html body #bang-ht .mon-ch .ten {
  color: var(--tm-chu) !important;
}
html body #bang-ht .mon-ch .gia {
  color: #8c3b00 !important;
}
html body #bang-ht .mon-ch .gia s {
  color: #4d6d82 !important;
}
html body #bang-ht .mon-ch .con,
html body #bang-ht .mon-ch .cc-ch {
  color: var(--tm-chu-phu) !important;
}
html body #bang-ht .mon-ch .cc-ch b {
  color: #8c3b00 !important;
}
html body #bang-ht .mon-ch > button {
  background: var(--tm-nut-cam) !important;
  border: 2px solid var(--tm-vien) !important;
  color: #ffffff !important;
}
html body #bang-ht .mon-ch > button:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
html body #bang-ht .the-nvat {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-ht .the-nvat img {
  background: #e3f4ff !important;
  border: 2px solid #9ac5df !important;
  box-shadow: none !important;
}
html body #bang-ht .the-nvat .ten {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
}
html body #bang-ht .the-nvat b {
  color: var(--tm-chu) !important;
}
html body #bang-ht .nut-doi-nh {
  background: #eef7fd !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  font-weight: 800 !important;
}

/* ---- 15e. Tab Phòng thủ trong Đảo nhà (#bang-dn .ph-*) ---- */
html body #bang-dn .ph-tinh h4 {
  color: #8c3b00 !important;
}
html body #bang-dn .ph-ct {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-ct.mo {
  background: #f1f9ff !important;
  border-color: #1376b8 !important;
}
html body #bang-dn .ph-dau {
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-dau small {
  color: var(--tm-chu-phu) !important;
}
html body #bang-dn .ph-hinh {
  background: #e3f4ff !important;
  border: 1.5px solid #9ac5df !important;
}
html body #bang-dn .ph-bac {
  background: #0c314c !important;
  color: #ffffff !important;
}
html body #bang-dn .ph-bac.b2 {
  background: #0a5b94 !important;
  color: #ffffff !important;
}
html body #bang-dn .ph-bac.b3 {
  background: #8c3b00 !important;
  color: #ffffff !important;
}
html body #bang-dn .ph-mau {
  background: #0c314c !important;
}
html body #bang-dn .ph-mau em {
  color: #ffffff !important;
  text-shadow: none !important;
}
html body #bang-dn .dn-thanh {
  background: #0c314c !important;
  border: 1.5px solid var(--tm-vien) !important;
}
html body #bang-dn .dn-thanh b {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}
html body #bang-dn .ph-vk,
html body #bang-dn .ph-vk-ds button {
  background: #ffffff !important;
  border: 1.5px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-vk.giao {
  background: #fff9e3 !important;
  border-color: #d4961a !important;
}
html body #bang-dn .ph-vk small,
html body #bang-dn .ph-vk-ds small {
  color: var(--tm-chu-phu) !important;
}
html body #bang-dn .ph-vk-ds button:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
html body #bang-dn .ph-sua-het {
  background: #fff3e0 !important;
  border: 2px solid #d87a00 !important;
  color: #7a3300 !important;
}
html body #bang-dn .ph-o {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-o b {
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-o small {
  color: #0d6d3e !important;
  font-weight: 700;
}
html body #bang-dn .ph-o em {
  color: #8c3b00 !important;
  font-weight: 700;
}
html body #bang-dn .ph-o.khoa {
  background: #edf4f8 !important;
  border-color: #b8ccd9 !important;
  opacity: 1 !important;
}
html body #bang-dn .ph-o.khoa small {
  color: #a31824 !important;
}
html body #bang-dn .ph-the-linh {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-the-linh p,
html body #bang-dn .ph-luong button small {
  color: var(--tm-chu-phu) !important;
}
html body #bang-dn .ph-doi {
  color: #b81d29 !important;
}
html body #bang-dn .ph-bc {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-bc-dau small,
html body #bang-dn .ph-bc-than {
  color: var(--tm-chu-phu) !important;
}
html body #bang-dn .ph-bc-than b {
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-kq {
  background: #e3f1fa !important;
  color: var(--tm-chu) !important;
}
html body #bang-dn .ph-kq.thang {
  background: #dcf7ea !important;
  color: #0d6d3e !important;
}
html body #bang-dn .ph-kq.mat {
  background: #ffe8ea !important;
  color: #a31824 !important;
}
html body #bang-dn .ph-kq.giu {
  background: #fff3c4 !important;
  color: #7a3b00 !important;
}
html body #bang-dn .ph-bc-do em {
  color: #0d6d3e !important;
}
html body #bang-dn .ph-bc-do.mat em {
  color: #a31824 !important;
}
html body #bang-dn .ph-bc-do.hong em {
  color: #8c3b00 !important;
}

/* ---- 15f. Bảng Sổ tay (#bang-st): Sổ cá · Thành tựu · Chai thư · Kho báu ---- */
html body #bang-st #than-st button.chinh,
html body #bang-st .st-nut button {
  background: var(--tm-nut-cam) !important;
  border: 2px solid var(--tm-vien) !important;
  color: #ffffff !important;
}
html body #bang-st #than-st button:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
html body #bang-st .st-diem {
  color: #8c3b00 !important;
}
html body #bang-st .st-vat {
  color: var(--tm-chu) !important;
  font-weight: 700;
}
html body #bang-st .dh-the {
  background: #071e2d !important;
  border-color: var(--mau-dh, #4fe3ff) !important;
  color: var(--mau-dh, #ffffff) !important;
}
html body #bang-st .sc-tien {
  color: var(--tm-chu-phu) !important;
}
html body #bang-st .sc-tien b {
  color: #0d6d3e !important;
}
html body #bang-st .sc-moc {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .sc-moc.da {
  background: #dcf7ea !important;
  border-color: #22b45a !important;
  color: #0d6d3e !important;
}
html body #bang-st .sc-moc.duoc {
  background: linear-gradient(180deg, #ffe066 0%, #f0b424 100%) !important;
  border-color: var(--tm-vien) !important;
  color: #1b1300 !important;
  box-shadow: none !important;
}
html body #bang-st .sc-bo {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .sc-bo small {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #bang-st .sc-bo.chon {
  background: var(--tm-nut-bien) !important;
  border-color: var(--tm-vien) !important;
  color: #ffffff !important;
}
html body #bang-st .sc-bo.chon small {
  color: #ffffff !important;
  opacity: 1 !important;
}
html body #bang-st .sc-o {
  background: #eef7fd !important;
  border: 2px solid #9ac5df !important;
}
html body #bang-st .sc-o.co {
  background: #ffffff !important;
  border-color: var(--mau-pham, #22b45a) !important;
}
html body #bang-st .sc-o.chua,
html body #bang-st .sc-anh.chua {
  background: #0b2438 !important;
  border: 2px dashed #4a7896 !important;
}
html body #bang-st .sc-o.chon {
  outline: 2.5px solid #c24a02 !important;
  background: #fff8df !important;
}
html body #bang-st .sc-o.chua.chon {
  background: #123654 !important;
  outline: 2.5px solid #c24a02 !important;
}
html body #bang-st .sc-so {
  background: #0c314c !important;
  color: #ffffff !important;
  padding: 0 4px !important;
  border-radius: 5px !important;
  text-shadow: none !important;
}
html body #bang-st .sc-ct {
  border-color: #c6dfee !important;
}
html body #bang-st .sc-anh {
  background: #eef7fd !important;
  border: 2px solid var(--mau-pham, #9ac5df) !important;
}
html body #bang-st .sc-ten {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
}
html body #bang-st .sc-moc-so {
  color: #8c3b00 !important;
  text-shadow: none !important;
}
html body #bang-st .sc-so-lieu > div {
  background: #ffffff !important;
  border: 1.5px solid #c6dfee !important;
}
html body #bang-st .sc-so-lieu span,
html body #bang-st .sc-so-lieu small,
html body #bang-st .sc-mota,
html body #bang-st .sc-gy span {
  color: var(--tm-chu-phu) !important;
}
html body #bang-st .sc-so-lieu b {
  color: #8c3b00 !important;
}
html body #bang-st .sc-dang-co {
  color: #0d6d3e !important;
}
html body #bang-st .sc-muc {
  color: #0a5b94 !important;
}
html body #bang-st .ttu-dh {
  background: #fffdf4 !important;
  border: 2px solid #e0b42b !important;
}
html body #bang-st .ttu-dh-dau .ttu-doi {
  background: #eef7fd !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .ttu-phai {
  color: var(--tm-chu-phu) !important;
}
html body #bang-st .ttu-dat b {
  color: #0d6d3e !important;
}
html body #bang-st .ttu-dh-o {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .ttu-dh-o.chon {
  background: #dcf7ea !important;
  border-color: #13854f !important;
}
html body #bang-st .ttu-loc,
html body #bang-st .ct-loc {
  background: var(--tm-nen-2) !important;
}
html body #bang-st .ttu-loc button,
html body #bang-st .ct-loc button {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .ttu-loc button.chon,
html body #bang-st .ct-loc button.chon {
  background: var(--tm-nut-cam) !important;
  border-color: #7a2600 !important;
  color: #ffffff !important;
}
html body #bang-st .ttu-dong {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .ttu-dong.dat {
  background: #fff9e0 !important;
  border-color: #d4961a !important;
  box-shadow: none !important;
}
html body #bang-st .ttu-dong.da {
  background: #edf7f2 !important;
  border-color: #8fd8b5 !important;
  opacity: 1 !important;
}
html body #bang-st .ttu-ten {
  color: var(--tm-chu) !important;
}
html body #bang-st .ttu-tien {
  color: var(--tm-chu-phu) !important;
}
html body #bang-st .ttu-da {
  color: #0d6d3e !important;
}
html body #bang-st .ct-the {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .ct-the.moi {
  background: #fffaf0 !important;
  border-color: #d4961a !important;
  box-shadow: none !important;
}
html body #bang-st .ct-the.he {
  background: #f0fbf5 !important;
  border-color: #22b45a !important;
}
html body #bang-st .ct-ten {
  color: var(--tm-chu) !important;
  text-decoration-color: var(--tm-chu-phu) !important;
}
html body #bang-st .ct-dau em {
  color: #8c3b00 !important;
}
html body #bang-st .ct-nd {
  background: #fffaf0 !important;
  border-left-color: #d4961a !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .ct-nut button {
  background: #eef7fd !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .ct-nut button.tim,
html body #bang-st .ct-nut button.da-tim {
  background: #fff0f4 !important;
  border-color: #c42b57 !important;
  color: #a31840 !important;
  opacity: 1 !important;
}
html body #bang-st .ct-nut button.bao {
  color: var(--tm-chu-phu) !important;
}
html body #bang-st .ct-tim-so {
  color: #a31840 !important;
}
html body #bang-st #ct-nd {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .kb-dang {
  background: #fff9e3 !important;
  border: 2px solid #d4961a !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .kb-dong {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-st .kb-khoa {
  color: #a12a12 !important;
  font-weight: 700;
}
html body #bang-st .kb-nut button {
  background: #eef7fd !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-chu) !important;
  font-weight: 800;
}
html body #bang-st .kb-nut button.chinh {
  background: var(--tm-nut-cam) !important;
  color: #ffffff !important;
}
html body #bang-st .kb-nut button:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}

/* ---- 15g. Bảng Quà ngày (#bang-qua-ngay) ---- */
html body #bang-qua-ngay .qn-dong,
html body #bang-qua-ngay .qn-luat {
  color: var(--tm-chu-phu) !important;
}
html body #bang-qua-ngay .qn-con b {
  color: var(--tm-chu) !important;
}
html body #bang-qua-ngay .qn-o {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-qua-ngay .qn-o.lon {
  background: #f7f0ff !important;
  border-color: #9b4de0 !important;
}
html body #bang-qua-ngay .qn-o.nay {
  background: #fff8db !important;
  border-color: #d4961a !important;
  box-shadow: 0 0 0 2px rgba(212, 150, 26, 0.25) !important;
}
html body #bang-qua-ngay .qn-o.xong {
  background: #edf7f2 !important;
  border-color: #8fd8b5 !important;
  opacity: 1 !important;
}
html body #bang-qua-ngay .qn-o-dau {
  color: var(--tm-chu-phu) !important;
}
html body #bang-qua-ngay .qn-o-dau b {
  color: var(--tm-chu) !important;
}
html body #bang-qua-ngay .qn-o.xong .qn-o-dau span {
  color: #0d6d3e !important;
  font-weight: 800;
}
html body #bang-qua-ngay .qn-o.nay .qn-o-dau span {
  color: #8c3b00 !important;
  font-weight: 800;
}
html body #bang-qua-ngay .mb-qua {
  background: #eef7fd !important;
  border: 1px solid #b5d5e8 !important;
  color: var(--tm-chu) !important;
}
html body #bang-qua-ngay .qn-xu,
html body #bang-qua-ngay .mb-qua.mb-dh {
  color: #8c3b00 !important;
  font-weight: 800;
}
html body #bang-qua-ngay .qn-nhan {
  background: linear-gradient(180deg, #ffe066 0%, #f0b424 100%) !important;
  border: 2px solid var(--tm-vien) !important;
  color: #1b1300 !important;
}
html body #bang-qua-ngay .qn-nhan:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #3c5566 !important;
  opacity: 1 !important;
}
html body #bang-qua-ngay .qn-da {
  background: #dcf7ea !important;
  border: 2px dashed #22b45a !important;
  color: #0d6d3e !important;
}
html body #bang-qua-ngay .xh-muc {
  color: #0a5b94 !important;
}
html body #bang-qua-ngay .mb-tong {
  background: #ffffff !important;
  border: 1.5px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-qua-ngay .mb-tong.xong {
  background: #edf7f2 !important;
  opacity: 1 !important;
}
html body #bang-qua-ngay .mb-tien {
  color: var(--tm-chu-phu) !important;
}
html body #bang-qua-ngay .mb-xong {
  color: #0d6d3e !important;
}
html body #bang-qua-ngay .mb-nhan {
  background: var(--tm-nut-cam) !important;
  border: 2px solid var(--tm-vien) !important;
  color: #ffffff !important;
}
html body.cam-ung #bang-qua-ngay .mb-nhan {
  min-height: 44px !important;
}

/* ---- 15h. Bảng Chuông thông báo (#bang-chuong) ---- */
html body #bang-chuong #chuong-doc {
  background: #0c314c !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  opacity: 1 !important;
}
html body #bang-chuong #chuong-doc:disabled {
  background: #234963 !important;
  border-color: #9ac5df !important;
  color: #dcebf5 !important;
  opacity: 1 !important;
}
html body #bang-chuong .chuong-nhom {
  color: var(--tm-chu-phu) !important;
  font-weight: 800;
}
html body #bang-chuong .chuong-muc {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-chuong .chuong-muc.moi {
  background: #eaf6ff !important;
  border-color: #1376b8 !important;
}
html body #bang-chuong .chuong-muc.cho {
  background: #fff9e3 !important;
  border-color: #d4961a !important;
}
html body #bang-chuong .chuong-muc small {
  color: var(--tm-chu-phu) !important;
}
html body #bang-chuong .chuong-muc > em {
  color: #0a5b94 !important;
  font-weight: 900;
}

/* ---- 15i. Bảng Bản đồ (#bang-ban-do) ---- */
html body #bang-ban-do #bd-thanh > button small,
html body #bang-ban-do #bd-dk button small {
  opacity: 1 !important;
}
html body #bang-ban-do #bd-loc button {
  opacity: 1 !important;
  color: #cfe7f2 !important;
}
html body #bang-ban-do #bd-loc button.bat {
  color: #ffffff !important;
}
html body #bang-ban-do #bd-toado {
  background: #061826 !important;
  color: #e2fbff !important;
  font-weight: 700;
}

/* ==================== 16. BỘ ẢNH SKIN "TRÒN MỀM" 9 MẢNH & NỀN ẢNH V2 ==================== */

/* 16a. Khung bảng lớn (bang.png: 98x152, viền 9 mảnh T=97 R=47 B=50 L=47) */
html body :is(
  #bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat,
  #bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #menu-luoi .ml-tam,
  #bang-kho, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tdo, #chat,
  #dang-nhap .sanh-the, #tnv-form, #bang-tv, #bang-tvq, #bang-cc, #bang-bv, #bang-moi,
  #bang-dt, #bang-cgm, #bang-gy, #bang-hdn, #bang-tk, #bang-cd, #cd-khoa, #cd-bc,
  #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong,
  #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-kp-dan, #bang-kh-le, #bang-pk-ln,
  #bang-pk-moi, #bang-pk-viec, #bang-pk-do, #bang-td, #bang-td-gan, #bang-ln, #bang-mk,
  #bang-dien, #bang-gd, #bang-rd, #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/bang.png') !important;
  border-image-slice: 97 47 50 47 fill !important;
  border-image-width: 49px 20px 22px 20px !important;
  border-image-repeat: stretch !important;
  padding: 2px 12px 14px 12px !important;
  color: var(--tm-chu) !important;
}
html body :is(
  #bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat,
  #bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #menu-luoi .ml-tam,
  #bang-kho, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tdo, #chat,
  #dang-nhap .sanh-the, #tnv-form, #bang-tv, #bang-tvq, #bang-cc, #bang-bv, #bang-moi,
  #bang-dt, #bang-cgm, #bang-gy, #bang-hdn, #bang-tk, #bang-cd, #cd-khoa, #cd-bc,
  #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong,
  #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-kp-dan, #bang-kh-le, #bang-pk-ln,
  #bang-pk-moi, #bang-pk-viec, #bang-pk-do, #bang-td, #bang-td-gan, #bang-ln, #bang-mk,
  #bang-dien, #bang-gd, #bang-rd, #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt
)::before,
html body :is(
  #bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat,
  #bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #menu-luoi .ml-tam,
  #bang-kho, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tdo, #chat,
  #dang-nhap .sanh-the, #tnv-form, #bang-tv, #bang-tvq, #bang-cc, #bang-bv, #bang-moi,
  #bang-dt, #bang-cgm, #bang-gy, #bang-hdn, #bang-tk, #bang-cd, #cd-khoa, #cd-bc,
  #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong,
  #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-kp-dan, #bang-kh-le, #bang-pk-ln,
  #bang-pk-moi, #bang-pk-viec, #bang-pk-do, #bang-td, #bang-td-gan, #bang-ln, #bang-mk,
  #bang-dien, #bang-gd, #bang-rd, #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt
)::after {
  display: none !important;
}
/* Đồng bộ nền sáng dịu cho nhật ký chat (#chat-log, #hd-chat-log) theo Tròn mềm */
html body :is(#chat-log, #hd-chat-log) {
  background: #f2f9fd !important;
  border: 1.5px solid #9ac5df !important;
  border-radius: 12px !important;
  margin-top: 2px;
  padding: 6px 9px !important;
  color: #0b2f47 !important;
}
html body :is(
  #bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat,
  #bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong,
  #bang-kho, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tdo, #chat,
  #dang-nhap .sanh-the, #tnv-form, #bang-tv, #bang-tvq, #bang-cc, #bang-bv, #bang-moi,
  #bang-dt, #bang-cgm, #bang-gy, #bang-hdn, #bang-tk, #bang-cd, #cd-khoa, #cd-bc,
  #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong,
  #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-kp-dan, #bang-kh-le, #bang-pk-ln,
  #bang-pk-moi, #bang-pk-viec, #bang-pk-do, #bang-td, #bang-td-gan, #bang-ln, #bang-mk,
  #bang-dien, #bang-gd, #bang-rd, #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt
) > .tieu-de,
html body #menu-luoi .ml-dau,
html body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau,
html body.menu-the #bang-na.bang.lon[data-mt] > .tieu-de.co-mt-dau {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 48px !important;
  margin: 0 0 4px 0 !important;
  padding: 2px 2px 4px 8px !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(4, 37, 58, 0.55) !important;
}
html body :is(
  #bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat,
  #bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong,
  #bang-kho, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tdo, #chat,
  #dang-nhap .sanh-the, #tnv-form, #bang-tv, #bang-tvq, #bang-cc, #bang-bv, #bang-moi,
  #bang-dt, #bang-cgm, #bang-gy, #bang-hdn, #bang-tk, #bang-cd, #cd-khoa, #cd-bc,
  #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong,
  #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-kp-dan, #bang-kh-le, #bang-pk-ln,
  #bang-pk-moi, #bang-pk-viec, #bang-pk-do, #bang-td, #bang-td-gan, #bang-ln, #bang-mk,
  #bang-dien, #bang-gd, #bang-rd, #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt
) > .tieu-de small,
html body #bang-dc > .tieu-de .dc-so,
html body .gt-bang > .tieu-de .gt-dst {
  background: #0c314c !important;
  color: #ffe87a !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  border: 1.5px solid #ffffff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

/* 16b. Popup / hộp thoại (hop.png: 131x118, viền T=55 R=63 B=58 L=63) */
html body :is(
  #hop-thoai .ht-hop, #man-ruong .khung-ruong, #man-chet .khung-dn, #the-vat .tv-hop, #mt-hang,
  #tk-ma .tk-ma-hop, #man-kp .kp-hop, #hc-man-chim .hc-chim-khung, #mg-man-kq .mg-kq-khung,
  #man-xoay .xoay-khung, #kr-the, #bb-the, #kb-the, #ptt-the, #mua-the, #trang-the, #the-nguoi, #the-ca, #ban-tin, #gio-tuan-the,
  #bd-the, #bd-cg, #hop-moi, #truyen, #moi-the, #td-moi-hop, .the-nhac, .caro-moi-the, #dtac-moi,
  .bv-ru, #kh-le-moi
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/hop.png') !important;
  border-image-slice: 55 63 58 63 fill !important;
  border-image-width: 22px 24px 24px 24px !important;
  border-image-repeat: stretch !important;
  padding: 18px 20px 20px !important;
  color: var(--tm-chu) !important;
}
html body :is(#kr-the, #bb-the, #kb-the, #ptt-the, #mua-the, #trang-the, #the-nguoi, #the-ca, #ban-tin, #gio-tuan-the, #bd-the, #bd-cg, #hop-moi, #truyen, #moi-the, #td-moi-hop, .the-nhac, .caro-moi-the, #dtac-moi, .bv-ru, #kh-le-moi) {
  padding: 14px 16px 16px !important;
}
@media (max-height: 460px) and (min-width: 560px) {
  html body #man-ruong .khung-ruong {
    padding: 14px 18px 16px !important;
  }
}
html body #tb-ban-moi {
  background: rgba(2, 14, 28, 0.88) !important;
}
html body #tb-ban-moi .tbm-hop {
  background: linear-gradient(180deg, #fffef8 0%, #e7f6ff 100%) !important;
  border: 3px solid var(--tm-vien) !important;
  border-radius: 24px !important;
  box-shadow: 0 0 0 3px #0d7fb4, 0 22px 50px rgba(0, 0, 0, 0.62) !important;
  border-image-source: none !important;
  color: var(--tm-chu) !important;
  padding: 0 !important;
}
html body #tb-ban-moi .tbm-anh {
  border-radius: 20px 20px 0 0 !important;
}
@media (orientation: landscape) and (max-height: 460px) {
  html body #tb-ban-moi .tbm-anh {
    border-radius: 18px 0 0 18px !important;
  }
}

/* 16c. Thẻ HUD & thẻ lớn trong bảng (the_hud.png: 77x82, viền T=37 R=36 B=41 L=36) */
html body #chi-so {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/the_hud.png') !important;
  border-image-slice: 37 36 41 36 fill !important;
  border-image-width: 13px 13px 15px 13px !important;
  border-image-repeat: stretch !important;
  padding: 7px 11px 9px 7px !important;
}
@media (orientation: portrait) and (max-width: 440px) {
  html body #chi-so,
  html body.toi-gian #chi-so {
    width: 170px !important;
    max-width: 170px !important;
    padding: 7px 10px 9px 7px !important;
  }
}
html body :is(
  #nhiem-vu:not(.thu-gon), #bang-tui #chi-tiet, #bang-ht .pt-khung, #bang-dn .dn-the, #bang-st .ttu-dh,
  #bang-nc .nc-the, #bang-hc .hc-khoi, #bang-xh .xh-ban, #bang-xh .xh-hoi,
  #bang-tv .tv-khoi, #bang-tv .tv-the, #bang-tvq .tv-the, #bang-bv .bv-the,
  #bang-caro .caro-the, #bang-dtt .dtt-the, #bang-gca .dtt-the, #bang-vcg .vcg-the,
  #bang-kho .kc-cot, #bang-tdo .td-ct, #bang-tdo .td-bo, #bang-tdo .td-xem,
  #bang-xt .xt-khoi, #bang-xt .xt-the-dau, #bang-mk .mk-dong, #bang-dien .mk-dong, #bang-gd .mk-dong,
  #bang-cd .cd-the, #bang-moi .mb-link, #bang-moi .mb-dong, #bang-cgm .cgm-muc,
  #dang-nhap .sanh-beta, #dang-nhap .sanh-moi, #bang-tk .tk-khoi, #bang-hdn #hdn-nd,
  #bang-ln .ln-khoi, #bang-rd .rd-ct, #bang-td .td-ben, #bang-td .td-tom > div,
  #bang-qt .qt-khoi, #bang-kp-dan .kp-loi, #bang-kh-le .kh-le-dang, #ho-so .kh-ho-so,
  #bang-cc #cc-ct, #bang-dt .dt-dau
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/the_hud.png') !important;
  border-image-slice: 37 36 41 36 fill !important;
  border-image-width: 12px 12px 14px 12px !important;
  border-image-repeat: stretch !important;
  padding: 10px 12px 12px !important;
  color: var(--tm-chu) !important;
}
html body #nhiem-vu:not(.thu-gon) > .tieu-de {
  background: transparent !important;
  border: 0 !important;
  color: var(--tm-chu) !important;
}

/* 16d. Chip & thẻ dòng (chip.png: T=25 R=32 B=26 L=34, chip_mong.png: T=16 R=24 B=16 L=24) */
html body :is(
  #nhiem-vu.thu-gon, #vk-chip, #ds-che .dong-che:not(.du):not(.goi-y), #bang-na .na-mon,
  #bang-san .gt-dong:not(.toi), #bang-tau-buon .nca-mon, #bang-caidat .cd-hang,
  #bang-ht .dong-nv:not(.xong), #bang-ht .pt-nac:not(.dat):not(.da),
  #bang-ht .mon-ch:not(.dac-biet):not(.khoa), #bang-ht .str-nhanh,
  #bang-ht .ctr-chuong:not(.dang):not(.khoa), #bang-qua-ngay .qn-o:not(.lon):not(.nay):not(.xong),
  #bang-chuong .chuong-muc:not(.moi):not(.cho), #man-ruong .the-do, #menu-luoi .ml-o,
  body.menu-the .mt-n, #bang-caidat .cd-chon button:not(.chon),
  #bang-caidat .cd-nut, #bang-caidat .cd-chu,
  #kr-chip, #bb-chip, #kb-chip, #cd-chip, .caro-chip, .vcg-chip, .dtt-chip, .gca-chip, .bv-chip,
  #bang-dt .dt-dong, #bang-dt .dt-toi, #bang-dt .dt-thuong,
  #bang-tp-cho .tp-dong, #bang-tp-tiem .tp-dong, #bang-tp-sap .nca-mon, #bang-tp-chi-dan .tp-cd,
  #bang-nguoi-ca .nca-mon, #bang-dc .dc-dong, #ho-so .hs-o,
  #bang-nc .nc-bac, #bang-hc .mg-the, #bang-hc .mg-dong, #bang-san .gt-tk-hop,
  #bang-tdo .td-mon, #bang-rd .rd-o, #bang-cc .cc-moi-o,
  #bang-xh .xh-moi-dong, #bang-cd .cd-dong, #bang-vcg .bv-dong, #bang-bv .bv-dong,
  #bang-dtt .dtt-ds > div, #bang-gca .gca-dong, #bang-gca .gca-qua,
  #bang-mk .mk-tho, #bang-mk .mk-tl-o, #dang-nhap .sanh-hang, #dang-nhap .sanh-o, #dang-nhap .sanh-may,
  #bang-ban-do .bd-so div, #bang-ban-do .bdt-vung, #bang-ban-do .bdt-pho button
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/chip.png') !important;
  border-image-slice: 25 32 26 34 fill !important;
  border-image-width: 9px 12px 9px 12px !important;
  border-image-repeat: stretch !important;
  color: var(--tm-chu) !important;
}
html body #nhiem-vu.thu-gon {
  padding: 4px 10px 5px !important;
}
html body #vk-chip {
  padding: 5px 12px 6px !important;
}
html body :is(
  #bang-qua-ngay .mb-qua, #bang-dn .dn-ct, #bang-ht .str-nut:not(.co), #bang-ht .str-diem:not(.con),
  #bang-dt .dt-qua, #bang-moi .mb-qua, #bang-moi .mb-moc:not(.cho),
  #bang-nc .nc-li, #bang-nc .nc-can span, #bang-nc .nc-ds li,
  #bang-xt .xt-c, #bang-xt .xt-li3, #bang-tv .tv-chip span, #bang-cd .cd-vat,
  #bang-tdo .td-nl, #bang-tdo .td-bo-mon, #bang-mk .mk-can, #bang-dien .dien-so span,
  #bang-ban-do #bd-loc button
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/chip_mong.png') !important;
  border-image-slice: 16 24 16 24 fill !important;
  border-image-width: 6px 10px 6px 10px !important;
  border-image-repeat: stretch !important;
  color: var(--tm-chu) !important;
}

/* Chấm đỏ thông báo dùng huy_hieu.png */
html body .cham {
  background: url('/anh/skin/tron_mem/huy_hieu.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

/* 16e. Nút 9 mảnh (nut_chinh, nut_phu, nut_vang, nut_nguy) & nút đóng (nut_dong) */
html body :is(
  #bang-tui #chi-tiet .hang-nut button.chinh,
  #bang-tui #chi-tiet .hang-nut button[data-kb-mo],
  #ds-che .dong-che .che-nut button[data-i],
  #bang-na .na-nut-hop button.chinh,
  #bang-na .na-hang button.chinh,
  #bang-dn .dn-hang button.chinh,
  #bang-san .gt-nut.chinh,
  #bang-ht .mon-ch > button,
  #bang-st #than-st button.chinh,
  #bang-st .st-nut button,
  #bang-st .kb-nut button.chinh,
  #bang-qua-ngay .mb-nhan,
  #nhiem-vu #ctr-hang button.chinh,
  #hop-thoai .ht-nut .ht-ok:not(.do),
  #man-ruong #ruong-nhan,
  #man-chet #chet-day,
  #bang-caidat .cd-chon button.chon,
  body.cam-ung #dao-thanh .dao-nut.chinh,
  #chat #chat-form button,
  #chat .nr-tim button,
  #chat .nr-form button,
  #dn-nut, #tnv-ok, .sanh-chep, #gy-gui, #kp-ok,
  .vh-nut.chinh, .hc-nut.chinh,
  #bang-tv button.chinh, #bang-tvq button.chinh, #bang-tv button.trong-nut,
  #bang-cc .cc-nut button.chinh,
  #bang-tp-cho .tp-nut button.chinh, #bang-tp-tiem .tp-nut button.chinh,
  #bang-tp-xuong .tp-xuong-nut button.chinh, #bang-tp-xuong .tp-xuong-nut button.nut-chinh,
  #bang-tp-sap .nca-doi, #bang-nguoi-ca .nca-doi,
  #bang-moi .mb-nut.chinh, #bang-moi .mb-nhan,
  #bang-xh .xh-mot.chinh, #bang-xh .xh-nut button.chinh, #bang-xh .xh-nhan-het, #bang-xh .xh-tim button,
  #bang-hc .xh-tim button,
  #the-nguoi .tn-nut.chinh, #ho-so .hs-nut button.chinh,
  #bang-mk button.chinh, #bang-dien button.chinh, #bang-gd button.chinh,
  #bang-xt .xt-nut:not(.phu), #bang-nc .nc-nut button.chinh, #bang-nc .nc-dong:not(.mo),
  #ban-tin .bt-toi, #bang-ban-do .bdt-nut button.bdt-chinh, #bang-ban-do #bd-tim button,
  .the-nhac button.chinh, #tl-hop button.chinh, #bang-dc .dc-nut button.chinh,
  #hc-chim-ok, #mg-kq-ok, #bang-rd .rd-nut, #bang-ctr button.chinh,
  #bang-cd button.chinh, #bang-tdo .td-nut button.chinh, #bang-tdo .nut-chinh,
  #bang-bv .bv-toi, #bang-bv .nut-chinh, #bang-vcg button.chinh,
  #bang-caro button.chinh, #bang-dtt .dtt-nut button,
  .bv-ru button.chinh, #dtac-moi .dtm-dy, #kh-le-moi button.chinh,
  #the-ca .tc-nut button.chinh, #xoay-toanman, #ck-day
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_chinh.png') !important;
  border-image-slice: 44 66 41 66 fill !important;
  border-image-width: 17px 22px 17px 22px !important;
  border-image-repeat: stretch !important;
  color: #1b1300 !important;
  text-shadow: none !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 16px !important;
}
html body #bang-caidat .cd-hang.cd-doc .cd-chon button.chon small,
html body.cam-ung #dao-thanh .dao-nut.chinh b,
html body :is(#bang-nc .nc-nut button.chinh, #bang-dtt .dtt-nut button) small {
  color: #1b1300 !important;
  opacity: 1 !important;
}

html body :is(
  #hop-thoai .ht-nut .ht-huy,
  #ds-che .dong-che .che-nut button.che-nhieu,
  #bang-na .na-nut-hop button.na-nhieu,
  #bang-na .na-hang button:not(.chinh),
  #bang-tui #chi-tiet .hang-nut button:not(.chinh):not([data-l="bo"]):not([data-kb-mo]),
  #bang-dn .dn-hang button:not(.chinh),
  #bang-san .gt-nut:not(.chinh):not(.do),
  #bang-tau-buon .nca-doi,
  #bang-ht .dong-nv .nut-nv-doi,
  #bang-ht .str-doi:not(.xn),
  #bang-ht .ctr-nut-nho button,
  #bang-ht .nut-doi-nh,
  #bang-st .kb-nut button:not(.chinh),
  #nhiem-vu #ctr-hang button:not(.chinh),
  #lai-nut-cam,
  .vh-nut:not(.chinh):not(.do),
  .hc-nut:not(.chinh):not(.do),
  #bang-tv button:not(.chinh):not(.nguy):not(.nut-x):not(.trong-nut):not(.tv-dong),
  #bang-tvq .tv-uv-nut button:not(.chinh):not([data-l="thue_mo"]),
  #bang-cc .cc-nut button:not(.chinh),
  #bang-tp-cho .tp-nut button:not(.chinh), #bang-tp-tiem .tp-nut button:not(.chinh),
  #bang-tp-xuong .tp-xuong-nut button:not(.chinh):not(.nut-chinh),
  #bang-tp-chi-dan .tp-cd-bo,
  #bang-moi .mb-nut:not(.chinh), #bang-moi .mb-kb,
  #bang-xh .xh-mot:not(.chinh), #bang-xh .xh-them-ten, #bang-xh .xh-ban .xh-mt button,
  #bang-xh .xh-nut button:not(.chinh), #bang-xh .xh-tron,
  #ho-so .hs-nut button:not(.chinh), #the-nguoi .tn-nut:not(.chinh),
  #bang-xt .xt-nut.phu, #bang-nc .nc-nut button:not(.chinh), #bang-nc .nc-xt, #bang-nc .nc-the button:not(.chinh),
  #bang-kho .kc-dau button, #bang-kho .kc-chu, #bang-kho .kc-the-ham button, #bang-kho #kc-giu:not(.chon),
  .sanh-phu, .sanh-bat, #dn-mo-tk, #tnv-lai, #tnv-xx, .tnv-xoay button,
  #bang-ban-do .bdt-nut button:not(.bdt-chinh), #bang-ban-do #bd-thanh > button, #bang-ban-do #bd-dk button,
  .the-nhac button:not(.chinh):not(.tn-x), #tl-hop button:not(.chinh):not(.nut-x):not(#tl-dung),
  #bang-dc .dc-nut button:not(.chinh), #bang-cd button:not(.chinh):not(.nut-x):not([data-tab]),
  #bang-ln button:not(.nut-x), #bang-mk button:not(.chinh):not(.nguy):not(.nut-x),
  #bang-dien button:not(.chinh):not(.nguy):not(.nut-x), #bang-gd button:not(.chinh):not(.nguy):not(.nut-x),
  #bang-rd .rd-so button, #bang-tdo .td-nut button:not(.chinh), #bang-tdo .td-xoay .nut-phu, #bang-tdo .nut-phu,
  #bang-caro button:not(.chinh):not(.nguy):not(.nut-x),
  #bang-dtt button:not(.chinh):not(.nguy):not(.nut-x),
  #bang-gca button:not(.chinh):not(.nut-x),
  #bang-bv button:not(.bv-toi):not(.nut-chinh):not(.nut-x),
  #bang-vcg button:not(.chinh):not(.nguy):not(.nut-x),
  #bang-ctr .ctr-nut button:not(.chinh),
  #the-ca .tc-nut button:not(.chinh), #xoay-doc,
  .bv-ru button:not(.chinh), #dtac-moi .dtm-x, #kh-le-moi button:not(.chinh),
  #bang-chuong #chuong-doc:not(:disabled),
  #chat .nr-goi, #chat .nr-lui, #chat .nr-chan-dong button,
  #truyen .tr-bo
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 16px 22px 16px 22px !important;
  border-image-repeat: stretch !important;
  color: #031d2e !important;
  text-shadow: none !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 14px !important;
}
html body :is(#bang-ht .str-doi:not(.xn), #bang-nc .nc-nut button:not(.chinh), #bang-xt .xt-nut.phu, #bang-dtt button:not(.chinh)) small {
  color: #062b42 !important;
  opacity: 1 !important;
}

html body :is(
  #bang-ht .pt-nhan,
  #bang-ht .str-cong,
  #bang-qua-ngay .qn-nhan,
  #bang-st .sc-moc.duoc,
  #ds-che .dong-che .che-nut button.che-ghim.bat,
  #man-ruong #ruong-ten,
  #nut-tren > #nut-menu,
  body.cam-ung #nut-tren > #nut-menu,
  #dn-khach, .tnv-ngau, #bang-tvq .tv-uv-nut button[data-l="thue_mo"],
  #bang-kho #kc-giu.chon, #the-nguoi .tn-ghe, #bang-moi .mb-moc.cho
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_vang.png') !important;
  border-image-slice: 40 66 44 66 fill !important;
  border-image-width: 15px 20px 16px 20px !important;
  border-image-repeat: stretch !important;
  color: #1b1300 !important;
  text-shadow: none !important;
  font-weight: 900 !important;
}

html body :is(
  #hop-thoai .ht-nut .ht-ok.do,
  #bang-san .gt-nut.do,
  #bang-tui #chi-tiet .hang-nut button[data-l="bo"],
  #bang-ht .str-doi.xn,
  .hc-nut.do, .vh-nut.do, #bang-tv button.nguy, #bang-mk button.nguy,
  #bang-caro .caro-nut .nguy, #bang-dtt .dtt-hang .nguy, #bang-vcg .vcg-hang .nguy,
  #tl-dung, :is(#the-nguoi, #ho-so) .tn-cot button.do, #chat .nr-nut-chan
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_nguy.png') !important;
  border-image-slice: 43 66 42 66 fill !important;
  border-image-width: 17px 22px 17px 22px !important;
  border-image-repeat: stretch !important;
  color: #ffffff !important;
  text-shadow: none !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 14px !important;
}

/* Nút khoá (:disabled) phải bỏ border-image để không hiện ảnh active */
html body button:disabled,
html body [aria-disabled="true"],
html body #bang-ht .str-doi:disabled,
html body #bang-ht .str-cong:disabled,
html body #bang-ht .mon-ch > button:disabled,
html body #bang-qua-ngay .qn-nhan:disabled,
html body #ds-che .dong-che .che-nut button[data-i]:disabled,
html body #bang-na .na-nut-hop button.chinh:disabled,
html body #bang-dn .dn-hang button:disabled,
html body #bang-san .gt-nut:disabled,
html body #bang-tau-buon .nca-doi:disabled,
html body #bang-st #than-st button:disabled,
html body #bang-st .kb-nut button:disabled,
html body #hop-thoai .ht-nut button:disabled {
  border-image: none !important;
  background: var(--tm-nut-khoa) !important;
  border: 2px solid #9fb4c4 !important;
  border-radius: 12px !important;
  color: #3c5566 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
html body #bang-chuong #chuong-doc:disabled {
  border-image: none !important;
  background: #234963 !important;
  border: 2px solid #9ac5df !important;
  color: #dcebf5 !important;
  opacity: 1 !important;
}

/* Nút đóng bảng dùng nut_dong.png */
html body :is(
  .bang > .tieu-de .nut-x:not(#nv-thu), #menu-luoi .ml-dau .nut-x, #the-vat .tv-x,
  .sanh-the .sanh-x, #kr-the .kr-the-x, #bb-the .bb-the-x, #kb-the .kb-the-x,
  .the-nhac .tn-x, #the-ca .tc-x, #ban-tin .bt-x, #hop-moi .hm-x,
  #bd-the .nut-x, #ho-so .nut-x, #moi-the .nut-x, #the-nguoi .tn-x
) {
  background: url('/anh/skin/tron_mem/nut_dong.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  font-size: 0 !important;
  color: transparent !important;
  line-height: 0 !important;
  opacity: 1 !important;
}

/* 16f. Tab thường (tab_thuong.png) & Tab đang chọn (tab_chon.png) */
html body :is(
  #bang-dn .tab-ht button:not(.chon),
  #bang-san .tab-ht button:not(.chon),
  #bang-caidat .tab-ht button:not(.chon),
  #bang-ht .tab-ht button:not(.chon),
  #bang-tui .tui-loc button:not(.bat),
  #che-tab button:not(.chon),
  #bang-na .na-tab button:not(.chon),
  #bang-st .tab-st button:not(.chon),
  #bang-st .ttu-loc button:not(.chon),
  #bang-st .ct-loc button:not(.chon),
  #bang-st .sc-bo:not(.chon),
  #chat #nr-tab button:not(.chon),
  #bang-xh .tab-xh button:not(.chon),
  #bang-xh .xh-loai button:not(.chon),
  #bang-hc #tab-hc button:not(.chon),
  #bang-hc .xh-loai button:not(.chon),
  #bang-hc .hd-phu button:not(.chon),
  #bang-dt .dt-tab button:not(.chon),
  #bang-dt .dt-nhom button:not(.chon),
  #bang-gy .gy-loai button:not(.chon),
  #bang-tk #tk-tab button:not(.chon),
  #bang-qt #qt-tab button:not(.chon),
  #dang-nhap .tab-dn button:not(.chon),
  #bang-tdo .td-o button:not(.chon),
  #bang-hdn #hdn-muc button:not(.chon),
  #bang-xt .tab-ht button:not(.chon),
  #bang-cd .tab-ht button:not(.chon),
  #bang-tp-cho .tp-tab button:not(.chon),
  #bang-tp-tiem .tp-tab button:not(.chon),
  #bang-san .gt-loai button:not(.chon),
  #bang-kho #kc-che-do button:not(.chon),
  #tnv-gt button:not(.chon),
  #sanh-nn .nn-dn button:not(.chon)
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/tab_thuong.png') !important;
  border-image-slice: 23 38 24 38 fill !important;
  border-image-width: 11px 16px 12px 16px !important;
  border-image-repeat: stretch !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  min-height: 44px !important;
  padding: 6px 12px !important;
}
html body #bang-tui .tui-loc button:not(.bat) em,
html body #che-tab button:not(.chon) i {
  background: #04253a !important;
  color: #ffffff !important;
}
html body #bang-st .sc-bo:not(.chon) small {
  color: #e6f7ff !important;
}

html body :is(
  #bang-dn .tab-ht button.chon,
  #bang-san .tab-ht button.chon,
  #bang-caidat .tab-ht button.chon,
  #bang-ht .tab-ht button.chon,
  #bang-tui .tui-loc button.bat,
  #che-tab button.chon,
  #bang-na .na-tab button.chon,
  #bang-st .tab-st button.chon,
  #bang-st .ttu-loc button.chon,
  #bang-st .ct-loc button.chon,
  #bang-st .sc-bo.chon,
  #chat #nr-tab button.chon,
  #bang-xh .tab-xh button.chon,
  #bang-xh .xh-loai button.chon,
  #bang-hc #tab-hc button.chon,
  #bang-hc .xh-loai button.chon,
  #bang-hc .hd-phu button.chon,
  #bang-dt .dt-tab button.chon,
  #bang-dt .dt-nhom button.chon,
  #bang-gy .gy-loai button.chon,
  #bang-tk #tk-tab button.chon,
  #bang-qt #qt-tab button.chon,
  #dang-nhap .tab-dn button.chon,
  #bang-tdo .td-o button.chon,
  #bang-hdn #hdn-muc button.chon,
  #bang-xt .tab-ht button.chon,
  #bang-cd .tab-ht button.chon,
  #bang-tp-cho .tp-tab button.chon,
  #bang-tp-tiem .tp-tab button.chon,
  #bang-san .gt-loai button.chon,
  #bang-kho #kc-che-do button.chon,
  #tnv-gt button.chon,
  #sanh-nn .nn-dn button.chon
) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/tab_chon.png') !important;
  border-image-slice: 26 38 26 38 fill !important;
  border-image-width: 12px 16px 12px 16px !important;
  border-image-repeat: stretch !important;
  color: var(--tm-chu) !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 12px !important;
}
html body #bang-tui .tui-loc button.bat em,
html body #che-tab button.chon i {
  background: #0b5c8e !important;
  color: #ffffff !important;
}
html body #bang-st .sc-bo.chon small {
  color: var(--tm-chu-phu) !important;
}

/* 16g. Ô đồ vuông (o_p1..o_p5, o_trong) & khay thanh cầm (nen_thanh_cam.png) */
html body #bang-tui #luoi-tui .o-tui,
html body #bang-tui #luoi-tui .cc-o,
html body #thanh-cam .o-cam,
html body #bang-tui #tui-thanh .o-cam.tt,
html body #bang-kho .kc-o,
html body #bang-cc .cc-o,
html body #bang-san .gt-luoi .o-tui,
html body #bang-td .gt-luoi .o-tui,
html body #bang-rd .rd-nl,
html body #bang-ln .ln-o,
html body #bang-mk .mk-o {
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: url('/anh/skin/tron_mem/o_p1.png') !important;
  background-position: center !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  box-shadow: none !important;
}
html body #bang-tui #luoi-tui .o-tui,
html body #bang-tui #luoi-tui .cc-o,
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui {
  padding: 7px 6px 8px !important;
}
html body #bang-tui #luoi-tui .o-tui.p1,
html body #bang-tui #luoi-tui .cc-o.p1,
html body #thanh-cam .o-cam.p1,
html body #bang-tui #tui-thanh .o-cam.tt.p1,
html body #bang-cc .cc-o.p1 { background-image: url('/anh/skin/tron_mem/o_p2.png') !important; }
html body #bang-tui #luoi-tui .o-tui.p2,
html body #bang-tui #luoi-tui .cc-o.p2,
html body #thanh-cam .o-cam.p2,
html body #bang-tui #tui-thanh .o-cam.tt.p2,
html body #bang-cc .cc-o.p2 { background-image: url('/anh/skin/tron_mem/o_p3.png') !important; }
html body #bang-tui #luoi-tui .o-tui.p3,
html body #bang-tui #luoi-tui .cc-o.p3,
html body #thanh-cam .o-cam.p3,
html body #bang-tui #tui-thanh .o-cam.tt.p3,
html body #bang-cc .cc-o.p3 { background-image: url('/anh/skin/tron_mem/o_p4.png') !important; }
html body #bang-tui #luoi-tui .o-tui.p4,
html body #bang-tui #luoi-tui .cc-o.p4,
html body #thanh-cam .o-cam.p4,
html body #bang-tui #tui-thanh .o-cam.tt.p4,
html body #bang-cc .cc-o.p4 { background-image: url('/anh/skin/tron_mem/o_p5.png') !important; }
html body #bang-tui #luoi-tui .o-tui.p5,
html body #bang-tui #luoi-tui .cc-o.p5,
html body #thanh-cam .o-cam.p5,
html body #bang-tui #tui-thanh .o-cam.tt.p5,
html body #bang-cc .cc-o.p5 {
  background-image: url('/anh/skin/tron_mem/o_p5.png') !important;
  filter: drop-shadow(0 0 2px #c81e2b);
}
html body #bang-tui #luoi-tui i.o-tui.o-trong,
html body #thanh-cam .o-cam.o-rong,
html body #bang-tui #tui-thanh .o-cam.tt.o-rong,
html body #bang-kho i.kc-o.trong,
html body #bang-cc .cc-o.chua {
  border: 0 !important;
  background-color: transparent !important;
  background-image: url('/anh/skin/tron_mem/o_trong.png') !important;
  /* quy tắc cũ `background: #174668` (độ ưu tiên cao hơn khối 16g chung) đặt lại cỡ = auto + lặp → khung nét đứt to quá, bị cắt */
  background-position: center !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
}
html body #bang-tui #luoi-tui .o-tui.chon,
html body #thanh-cam .o-cam.chon,
html body #bang-tui #tui-thanh .o-cam.tt.chon {
  border-radius: 12px !important;
  box-shadow: 0 0 0 2.5px #ff9f1c, 0 0 10px rgba(255, 159, 28, 0.55) !important;
}
html body:not(.tc-gon) #thanh-cam {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nen_thanh_cam.png') !important;
  border-image-slice: 46 39 46 40 fill !important;
  border-image-width: 14px 14px 16px 14px !important;
  border-image-repeat: stretch !important;
  padding: 6px 8px 8px !important;
}
/* Giữ ô thanh cầm >= 44×44 px trên điện thoại dọc (cuộn ngang thay vì ép nhỏ < 44 px) */
@media (orientation: portrait) and (max-width: 620px) {
  html body.cam-ung:not(.tc-gon) #thanh-cam,
  html body.cam-ung.tay-trai:not(.tc-gon) #thanh-cam {
    overflow-x: auto !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    padding: 5px 7px 6px !important;
    scroll-snap-type: x mandatory;
  }
  html body.cam-ung #thanh-cam .o-cam {
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
  }
}

/* Sửa thanh nhanh trong bảng Túi (#tui-thanh) & bố cục màn dọc không bị chồng lớp */
html body #bang-tui #tui-thanh .tt-o {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 5px !important;
  padding: 2px 1px !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
html body #bang-tui #tui-thanh .tt-o::-webkit-scrollbar {
  display: none;
}
html body #bang-tui #tui-thanh .o-cam.tt,
html body.cam-ung #bang-tui #tui-thanh .o-cam.tt {
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  aspect-ratio: 1 / 1 !important;
}
html body #bang-tui #tui-thanh .tt-nhan {
  order: 2 !important;
  margin-top: 2px !important;
}
@media (max-width: 620px) {
  html body #bang-tui #luoi-tui {
    min-height: 92px !important;
    overflow-y: auto !important;
  }
  html body #bang-tui #chi-tiet {
    max-height: 39dvh !important;
    overflow-y: auto !important;
  }
}

/* 16h. Thanh chỉ số, đồng hồ, bản đồ nhỏ, nút tròn HUD, cần điều khiển */
html body #chi-so .vach b {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 9px !important;
  padding: 2px 3px !important;
  border-image-source: url('/anh/skin/tron_mem/vach_ranh.png') !important;
  border-image-slice: 19 26 16 24 fill !important;
  border-image-width: 4px 6px 4px 6px !important;
  border-image-repeat: stretch !important;
}
html body #cs-mau b span {
  background: transparent !important;
  border-radius: 0 !important;
  border-image-source: url('/anh/skin/tron_mem/day_mau.png') !important;
  border-image-slice: 0 11 0 11 fill !important;
  border-image-width: 0 5px 0 5px !important;
  border-image-repeat: stretch !important;
}
html body #cs-doi b span {
  background: transparent !important;
  border-radius: 0 !important;
  border-image-source: url('/anh/skin/bo_sung/day_doi.png') !important;
  border-image-slice: 0 11 0 11 fill !important;
  border-image-width: 0 5px 0 5px !important;
  border-image-repeat: stretch !important;
}
html body #cs-khat b span {
  background: transparent !important;
  border-radius: 0 !important;
  border-image-source: url('/anh/skin/tron_mem/day_nuoc.png') !important;
  border-image-slice: 0 11 0 11 fill !important;
  border-image-width: 0 5px 0 5px !important;
  border-image-repeat: stretch !important;
}
html body :is(#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #bang-dn) .thanh,
html body #bang-ht .pt-thanh {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-image-source: url('/anh/skin/tron_mem/vach_mong.png') !important;
  border-image-slice: 12 23 10 23 fill !important;
  border-image-width: 3px 6px 3px 6px !important;
  border-image-repeat: stretch !important;
  min-height: 11px !important;
  padding: 2px 3px !important;
}
html body :is(#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #bang-dn) .thanh > span,
html body #bang-ht .pt-thanh > span {
  background: transparent !important;
  border-image-source: url('/anh/skin/bo_sung/day_doi.png') !important;
  border-image-slice: 0 11 0 11 fill !important;
  border-image-width: 0 4px 0 4px !important;
  border-image-repeat: stretch !important;
}
html body :is(#bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #bang-dn) .thanh.xanh > span {
  border-image-source: url('/anh/skin/tron_mem/day_nuoc.png') !important;
}

html body #dong-ho {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/vach_ranh.png') !important;
  border-image-slice: 19 26 16 24 fill !important;
  border-image-width: 10px 14px 10px 14px !important;
  border-image-repeat: stretch !important;
  color: #ffffff !important;
  min-height: 30px !important;
  padding: 2px 12px !important;
}
html body #dong-ho #dh-thientai,
html body #dong-ho #online,
html body #dong-ho #dh-baoho {
  color: #e8fbff !important;
  background: rgba(4, 37, 58, 0.55) !important;
}

html body #ban-do-nho {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html body #bdn-cv {
  position: absolute !important;
  left: 9% !important;
  top: 9% !important;
  width: 82% !important;
  height: 82% !important;
  border-radius: 50% !important;
}
html body #ban-do-nho::after {
  background: url('/anh/skin/tron_mem/khung_ban_do.png') center / 100% 100% no-repeat !important;
  box-shadow: none !important;
  z-index: 2;
}
html body #ban-do-nho .bdn-kim {
  z-index: 3 !important;
}
html body #ban-do-nho #bdn-toc {
  background: #0c314c !important;
  border: 1.5px solid #ffffff !important;
  color: #ffffff !important;
}

html body #nut-chinh .vong {
  background: url('/anh/skin/tron_mem/nut_tron_lon.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #04253a !important;
  text-shadow: none !important;
  font-weight: 900 !important;
}
html body #nut-chinh.giat .vong {
  color: #b81d29 !important;
  filter: drop-shadow(0 0 10px rgba(255, 110, 40, 0.85));
}
html body #nut-tren > .nut-vuong:not(#nut-menu),
html body.cam-ung #nut-tren > .nut-vuong:not(#nut-menu),
html body.cam-ung #nut-phu button,
html body.cam-ung .nut-vong,
html body.cam-ung #dao-thanh .dao-nut:not(.chinh) {
  background: url('/anh/skin/tron_mem/nut_tron_trong.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #04253a !important;
}
html body #nut-tren > #nut-menu,
html body.cam-ung #nut-tren > #nut-menu {
  border-image-width: 11px 14px 12px 14px !important;
  padding: 3px 8px 5px !important;
  min-width: 46px !important;
  min-height: 46px !important;
}
html body #nut-tren > #nut-menu span,
html body #nut-tren > #nut-menu .nv-chu {
  color: #1b1300 !important;
}

html body #can-di {
  background: url('/anh/skin/tron_mem/can_de.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body #can-num {
  background: url('/anh/skin/tron_mem/can_num.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Thẻ Bến Tụ Hội (#th-the) đồng bộ Tròn mềm */
html body #th-the:not(.th-thu) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/the_hud.png') !important;
  border-image-slice: 37 36 41 36 fill !important;
  border-image-width: 12px 12px 14px 12px !important;
  border-image-repeat: stretch !important;
  padding: 10px 10px 12px 14px !important;
  color: var(--tm-chu) !important;
}
html body #th-the.th-thu {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/chip.png') !important;
  border-image-slice: 25 32 26 34 fill !important;
  border-image-width: 8px 11px 8px 11px !important;
  border-image-repeat: stretch !important;
  color: var(--tm-chu) !important;
}
html body #th-the .th-dau {
  color: var(--tm-chu) !important;
  font-weight: 800;
}
html body #th-the .th-dau b {
  color: #9e3500 !important;
}
html body #th-the .th-phu,
html body #th-the .th-ly {
  color: var(--tm-chu-phu) !important;
  font-weight: 600;
}
html body #th-the .th-di {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_chinh.png') !important;
  border-image-slice: 44 66 41 66 fill !important;
  border-image-width: 14px 18px 14px 18px !important;
  border-image-repeat: stretch !important;
  color: #1b1300 !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 16px !important;
}
html body #th-the .th-x {
  background: url('/anh/skin/tron_mem/nut_dong.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  width: 36px !important;
  height: 36px !important;
  font-size: 0 !important;
  color: transparent !important;
}
html body.cam-ung #th-the .th-x {
  width: 44px !important;
  height: 44px !important;
}

/* Hộp thoại Open Beta (#hop-thoai .bt-beta) trên nền sáng */
html body #hop-thoai .bt-qua {
  color: var(--tm-chu) !important;
}
html body #hop-thoai .bt-ma {
  background: #eef8ff !important;
  border: 2px dashed #0d7fb4 !important;
  border-radius: 12px !important;
}
html body #hop-thoai .bt-ma b {
  color: #9e3500 !important;
}
html body #hop-thoai .bt-chep {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 14px 18px 14px 18px !important;
  border-image-repeat: stretch !important;
  color: #031d2e !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 14px !important;
}



/* 16h. Bảng chat (2/12 chủ game "khó nhìn"): tab + nút Gửi / Nhắn dùng skin như các bảng khác (thêm vào 16f, nút chính);
   ô nhập nền trắng chữ đậm, chữ gợi ý đủ tương phản trên nền sáng của bảng */
html body #chat #nr-tab button:is(.chon, :not(.chon)) { font-size: 13px !important; padding: 4px 4px !important; letter-spacing: 0 !important; }
html body #chat :is(#chat-form, .nr-tim, .nr-form) input {
  background: #ffffff !important;
  border: 2px solid #2f6c96 !important;
  border-radius: 10px !important;
  color: #0c2d45 !important;
}
html body #chat :is(#chat-form, .nr-tim, .nr-form) input::placeholder { color: #4d6b7e !important; opacity: 1 !important; }
html body #chat :is(#chat-form, .nr-tim, .nr-form) input:focus { border-color: #ff9f1c !important; outline: none !important; }
html body #chat :is(#chat-form, .nr-tim, .nr-form) button:disabled { filter: saturate(.4) brightness(.92); opacity: 1 !important; }
html body #chat :is(.nr-rong, .nr-trong, #chat-trong) { color: var(--tm-chu-phu) !important; opacity: 1 !important; }
html body #chat .nr-hang1 b, html body #chat .nr-ai b { color: #0a5b94 !important; }
html body #chat .nr-hang1 small, html body #chat .nr-cuoi, html body #chat .nr-mo-chan { color: var(--tm-chu-phu) !important; }
html body #chat .nr-bong.ho { background: #ffffff !important; border: 1.5px solid var(--tm-vien-nhat) !important; color: var(--tm-chu) !important; }
html body #chat .nr-bong.minh { background: #d6effc !important; border: 1.5px solid #0d7fb4 !important; color: var(--tm-chu) !important; }
html body #chat .nr-bong time { color: var(--tm-chu-phu) !important; }

/* 16i. Ô nhập sáng chuẩn hoá, nút Menu thẻ ◀ ▶, & đảm bảo nút cảm ứng >= 44 px trên mọi khổ */
html body :is(
  #dang-nhap #form-dn input, #tnv-ten, #gy-nd, #mb-url, .vh-o,
  #than-hc input, #bang-xh input, #bang-kho #kc-so, #tl-hop input,
  #bang-ban-do #bd-tim input,
  #bang-san .gt-loc :is(input, select), #bang-san .gt-form :is(input, select), #bang-san .gt-chon input,
  #bang-td .td-sl input, #bang-td .td-dst input,
  #bang-cd input, #bang-st :is(input, textarea),
  #bang-qt input, #bang-qt select
) {
  background: #ffffff !important;
  border: 2px solid #2f6c96 !important;
  border-radius: 10px !important;
  color: #0c2d45 !important;
  min-height: 44px !important;
}
html body :is(
  #dang-nhap #form-dn input, #tnv-ten, #gy-nd, #mb-url, .vh-o,
  #than-hc input, #bang-xh input, #bang-ban-do #bd-tim input,
  #bang-san input, #bang-td input, #bang-cd input, #bang-st :is(input, textarea)
)::placeholder {
  color: #4d6b7e !important;
  opacity: 1 !important;
}
html body :is(
  #dang-nhap #form-dn input, #tnv-ten, #gy-nd, #mb-url, .vh-o,
  #than-hc input, #bang-xh input, #bang-kho #kc-so, #tl-hop input,
  #bang-ban-do #bd-tim input, #bang-san :is(input, select), #bang-td input
):focus {
  border-color: #ff9f1c !important;
  outline: none !important;
}
html body.menu-the .mt-mui {
  background: url('/anh/skin/tron_mem/nut_tron_trong.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #04253a !important;
  min-width: 44px !important;
  min-height: 44px !important;
}
html body.cam-ung #bang-ban-do #bd-thanh > button,
html body.cam-ung #bang-ban-do #bd-tim input,
html body.cam-ung #bang-ban-do #bd-tim button {
  min-height: 44px !important;
  height: 44px !important;
}
@media (max-height: 500px) {
  html body.cam-ung #bang-ban-do #bd-loc,
  html body.cam-ung #bang-ban-do #bd-cg { top: 54px !important; }
  html body.cam-ung #bang-ban-do #bd-loc:not([hidden]) ~ #bd-cg { top: 94px !important; }
}
html body.cam-ung :is(
  #bang-hdn #hdn-muc button, #bang-gy .gy-loai button, #bang-moi .mb-nut, #bang-moi .mb-kb,
  #bang-dt .dt-tab button, #bang-dt .dt-nhom button, #bang-caro .caro-hang button,
  #bang-dtt .dtt-hang button, #bang-bv button, #bang-vcg button, #bang-cd button,
  #bang-ban-do .bdt-nut button, #bang-ban-do #bd-loc button, #bang-ban-do #bd-dk button,
  #bang-tdo button:not(.td-nh-o), #bang-rd button, #bang-ln button, #bang-mk button,
  #bang-dien button, #bang-gd button, #bang-ctr button, #the-ca .tc-nut button,
  #bang-tp-cho button, #bang-tp-tiem button, #bang-tp-sap button, #bang-tp-xuong button,
  #bang-tp-chi-dan button, #bang-xt button, #bang-nc .nc-nut button, #bang-nc .nc-xt,
  #bang-kho button:not(.kc-o), #bang-cc button:not(.cc-o), #bang-tv button, #bang-tvq button,
  #bang-tk button, #man-kp button, #tk-ma button, #dang-nhap .sanh-the button
) {
  min-height: 44px !important;
}

/* 16j. Tương phản chữ sáng Tròn mềm & thanh tiến độ cho toàn bộ bảng / popup còn lại */
html body :is(
  #dang-nhap .sanh-the, #tnv-form, #man-kp .kp-hop, #tk-ma .tk-ma-hop,
  #bang-tv, #bang-tvq, #bang-cc, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so,
  #bang-tdo, #bang-kho, #bang-bv, #bang-moi, #bang-dt, #bang-cgm, #bang-gy, #bang-hdn,
  #bang-tk, #bang-cd, #cd-khoa, #cd-bc, #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca,
  #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong, #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg,
  #bang-kp-dan, #bang-kh-le, #bang-pk-ln, #bang-pk-moi, #bang-pk-viec, #bang-pk-do,
  #bang-td, #bang-td-gan, #bang-ln, #bang-mk, #bang-dien, #bang-gd, #bang-rd,
  #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt,
  #kr-the, #bb-the, #kb-the, #the-nguoi, #the-ca, #ban-tin, #gio-tuan-the,
  #bd-the, #bd-cg, #hc-man-chim .hc-chim-khung, #mg-man-kq .mg-kq-khung,
  #man-xoay .xoay-khung, .the-nhac
) :is(.nho-mo, .trong, .hc-ghi, .tv-ghi, .vh-ghi, .tp-cho-chu, .dt-ten small, .bv-chu, .mb-luat, .vcg-chu, .caro-chu, .caro-luat, .caro-phu, .dtt-chu, .dtt-luat, .mk-ghi, .ln-ghi, .rd-ghi, .dn-ghi, .cc-mota, .cc-nhom, .cc-pham, .cc-ss, .cc-cs span, .sanh-ghi, .sanh-hang > span small, .sanh-beta small, .sanh-bq, .nc-muc, .nc-dk, .nc-li span, .nc-can i, .nc-ds li small, .tv-dau, .tv-giua small, .tv-tt small, .tv-nk summary, .tv-nk ul, .xt-ghi, .xt-muc, .kc-cd-nhan, .kc-ghi-che, .kc-the-ham span, .gt-ghi, .tk-dong span, .dt-mo, .bdt-ten small, .bdt-ghi, .bdt-luoi > span, .bdt-mo, .bdc-ghi, .bt-tieu small, .mb-tien, .mb-ban-roi, .mb-moc, .cgm-muc small, .hd-chon, .mg-the span, .mg-the span .mg-chua, .mg-truoc span, .td-xoay, .td-bo-tong, .td-bo-cs, .td-ct p, .td-mon > small, .cd-dong small, .dc-giua span, .tl-ghi) {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}

/* Không để opacity < 1 làm mờ chữ / thẻ / nút ở các bảng sáng */
html body :is(
  #dang-nhap .sanh-nut, #dang-nhap .sanh-tron,
  #bang-hc .mg-chua, #bang-hc .ht-the.khoa, #bang-hc .hc-nut:disabled,
  #bang-dtt .dtt-nut button small, #bang-dtt .dtt-nut button[disabled],
  #bang-dc .dc-dong.minh, #bang-moi .mb-tong.xong, #bang-moi .mb-dong.khong,
  #bang-tv .tv-the.da, #bang-tp-cho .tp-dong.mo, #bang-tp-tiem .tp-dong.mo,
  #bang-tp-sap .nca-mon.het, #bang-tau-buon .nca-mon.het,
  #bang-cd .cd-dong small, #cd-khoa .ck-ong.cho, #the-nguoi .tn-doi small,
  #bang-tdo .td-bo-cs, #bang-tdo .td-nh-o.het, #bang-tdo .td-nh-nut small,
  #bang-ban-do #bd-loc button, #bang-ban-do #bd-thanh > button small,
  #bang-ln .ln-vat.mo, #ban-tin .bt-x, .the-nhac .tn-x, .sanh-bq
) {
  opacity: 1 !important;
}

/* Chữ nhấn màu vàng/cam/xanh/đỏ chuyển sang tông đậm tương phản cao trên nền sáng */
html body :is(
  #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tv, #bang-tvq, #bang-cc,
  #bang-kho, #bang-tdo, #bang-bv, #bang-moi, #bang-dt, #bang-cgm, #bang-gy, #bang-hdn,
  #bang-tk, #bang-cd, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap,
  #bang-tp-xuong, #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-dc, #bang-rd, #bang-ln, #bang-mk, #bang-dien,
  #dang-nhap .sanh-the, #bang-ban-do, #ban-tin, #the-ca, #kr-the, #bb-the, #kb-the, #the-nguoi, #man-xoay
) :is(b, h2, h3, h4, .nc-ten, .nc-nhan, .xt-ten, .xt-nhan, .xt-xong, .cc-ten, .cc-dongdb, .cc-nguon b, .tv-muc, .tv-tinh, .tp-cho-dau b, .tp-gia, .tp-loi b, .tp-doi b, .tp-cd-xa, .dt-dau b, .dt-diem, .dt-hang, .dt-qua.dt-dh, .bv-dau b, .bv-dang, .vcg-dau b, .vcg-chuoi b, .caro-the > b, .caro-trang.toi b, .dtt-dong-dau b, .dtt-ds b, .gca-dong > em, .gca-minh, .hc-tk, .hc-dan b, .hd-dau-giua > b, .hd-nv-dau span, .hd-th, .mg-dau-hang > b, .mg-diem, .mg-the em, .mg-thuong b, .sanh-than h3, .sanh-ma b, .sanh-moi h4 span, .cgm-muc h3, .cgm-ngay, .cgm-than h3, .hdn-nd h3, .hdn-nd b, .tk-ma-hop h3, .kc-nhan, .kc-the-ham b, .kc-giu-ghi, .kc-r, .bdt-td, .bdt-pho-dau, .bdt-pho-chu b, .bdc-muc, .dc-giua b, .tl-than b, .mk-dong > b, .ln-dong > b, .dien-so b, .rd-chon b, .td-bh, .td-hiem-nhan, .td-thuoc-bo, .td-bo-dau b, .tc-so b, .xoay-tieu) {
  color: var(--tm-chu) !important;
}
html body :is(#kr-the, #bb-the, #kb-the) h3 {
  color: var(--tm-chu) !important;
}
html body :is(
  #bang-nc .nc-the.dong .nc-ten, #bang-nc .nc-nhan, #bang-hc .mg-dau-hang > b,
  #bang-hc .mg-diem, #bang-hc .hc-tk, #bang-hc .hd-nv-dau span, #bang-hc .mg-the em.top,
  #bang-tp-cho .tp-gia, #bang-tp-cho .tp-cho-dau b, #bang-dt .dt-dau b, #bang-dt .dt-diem,
  #bang-bv .bv-dau b, #bang-vcg .vcg-dau b, #bang-kho .kc-nhan, #bang-kho .kc-r,
  #dang-nhap .sanh-than h3, #dang-nhap .sanh-ma b, #bang-cgm .cgm-muc h3,
  #bang-hdn #hdn-nd h3, #bang-hdn #hdn-nd b, #bang-cc .cc-dongdb, #bang-cc .cc-nguon b,
  #bang-tv .tv-muc, #bang-tv .tv-tinh, #bang-dc .dc-giua b, #bang-mk .mk-dong > b,
  #bang-ln .ln-dong > b, #bang-dien .dien-so b, #bang-rd .rd-chon b,
  #bang-ban-do .bdt-td, #bang-ban-do .bdt-pho-dau, #bang-ban-do .bdc-muc, #the-ca .tc-so b
) {
  color: #8c3b00 !important;
}

/* Trạng thái Đủ / Online / Tốt / Đạt */
html body :is(
  #bang-nc .nc-li b, #bang-nc .nc-dk .du, #bang-nc .nc-can .du b, #bang-nc .nc-can .du em, #bang-nc .nc-ds li.du > b, #bang-nc .nc-gio,
  #bang-xt .xt-xong, #bang-xt .xt-c.du, #bang-tv .tv-tt, #bang-cc .cc-cs b em.hon, #bang-cc .cc-chip-dung,
  #bang-xh .xh-on, #ho-so .hs-on, #bang-dt .dt-toi b, #bang-dt .dt-on, #bang-moi .mb-xong, #bang-moi .mb-on, #bang-moi .mb-moc.xong,
  #bang-tp-cho .tp-len, #bang-tp-tiem .tp-doi b, #bang-tp-xuong .tp-xuong-ok .chip,
  #bang-vcg .vcg-thuong, #bang-dtt .dtt-the.kq b, #bang-gca .gca-qua span,
  #bang-hc .hc-man em.tot, #bang-hc .hd-nv.xong, #bang-tdo .td-mon .td-mac, #bang-tdo .td-ct-dau small,
  #bang-ban-do .bdt-ly.tot, #bang-dien .dien-tt.chay, #bang-kho .kc-nhan b,
  #bang-dn .dn-thanh-ok, #bang-ctr .ctr-mo, #bang-ctr .ctr-ds-nv li.xong
) {
  color: #0d6d3e !important;
}
html body #bang-cc .cc-chip-dung {
  background: #dcf7ea !important;
  border-color: #22b45a !important;
}
html body #bang-kho .kc-nhan b {
  background: #dff3fc !important;
  border: 1px solid #9ac5df !important;
}
html body #bang-kho .kc-nhan b.day {
  background: #ffe8ea !important;
  border-color: #c42b37 !important;
  color: #a31824 !important;
}

/* Trạng thái Thiếu / Cảnh báo / Nguy */
html body :is(
  #bang-nc .nc-dk .thieu, #bang-nc .nc-can .thieu b, #bang-nc .nc-can .thieu em, #bang-nc .nc-ds li.thieu > b,
  #bang-xt .xt-c.thieu, #bang-tv .tv-tt.day, #bang-tv .tv-tt.doi, #bang-tv .tv-tt.doi_an, #bang-tv .tv-tt.khat_nuoc,
  #bang-tv .tv-tt.mat, #bang-tv .tv-tt.het_dan, #bang-tv .tv-tt.het_van, #bang-tv .tv-tt.thieu_bep, #bang-tv .tv-tt.thieu_ham,
  #bang-cc .cc-cs b em.kem, #bang-hc .hc-man em, #bang-hc .hc-do, #bang-hc .hc-cam, #bang-hc .ht-thieu,
  #bang-tp-cho .tp-xuong, #bang-tp-cho .tp-ly, #bang-tp-cho .tp-ten small.tp-chung.het,
  #bang-tdo .td-nl.thieu, #bang-moi .mb-ly, #bang-gy .gy-loi, .vh-loi,
  #bang-caro .caro-canh, #bang-caro .caro-ng .caro-x, #bang-ban-do .bdt-ly:not(.tot),
  #bang-mk .mk-ghi.canh, #bang-dien .dien-tt.thieu, #bang-rd .rd-loi
) {
  color: #a31824 !important;
}
html body #bang-tv .tv-bang-do {
  background: #ffe8ea !important;
  border: 2px solid #c42b37 !important;
  color: #7a1019 !important;
}
html body #bang-tv .tv-bang-do > b {
  color: #7a1019 !important;
}

/* Sửa chi tiết từng bảng đặc thù trên nền sáng */
html body #dang-nhap .sanh-the :is(.sanh-moi, .sanh-ma, .sanh-hang, .sanh-o, .sanh-pl a, .dn-tk, .sanh-than, .sanh-than p, .sanh-moi li) {
  color: var(--tm-chu) !important;
}
html body #dang-nhap .sanh-ma {
  background: #fff7dc !important;
  border: 2px dashed #d4961a !important;
}
html body #dang-nhap .sanh-moi h4 span {
  background: #dff2fc !important;
  color: #095182 !important;
}
html body #dang-nhap .sanh-pl a,
html body #bang-tk a,
html body #bang-qt a {
  color: #095182 !important;
  font-weight: 700;
}
html body #tnv-form :is(.tnv-nhan, .tnv-tt, .tnv-ghi, label) {
  color: var(--tm-chu) !important;
}
html body #bang-hdn #hdn-nd,
html body #bang-hdn #hdn-nd :is(p, li) {
  color: var(--tm-chu) !important;
}
html body #bang-cc #cc-ct {
  border-left: 0 !important;
}
html body #bang-cc .cc-anh {
  background: #e3f4ff !important;
}
html body #bang-cc .cc-cs i {
  background: #d7e8f3 !important;
  border: 1px solid #9ac5df !important;
}
html body #bang-cc .cc-moi-o {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #bang-cc .cc-moi-o.chon {
  background: #fff8df !important;
  border-color: #c24a02 !important;
}
html body #bang-cc .cc-moi-o small {
  color: #8c3b00 !important;
  font-weight: 800;
}
html body #bang-cc .cc-o .cc-khoa {
  color: #ffffff !important;
  background: #0c314c;
  padding: 0 3px;
  border-radius: 4px;
}

/* Thanh máu/tiến độ giữ rãnh đậm cho chữ trắng bên trong đạt tương phản cao */
html body :is(.hc-mau, .nc-thanh, .ln-thanh, .mk-thanh, .tp-xuong-mau b, .hd-thanh) {
  background: #0c263b !important;
  border: 1.5px solid #04253a !important;
}
html body :is(.hc-mau span, .nc-thanh em, .ln-thanh em, .mk-thanh em, #kr-hud .kr-mau span, #bb-thanh .bb-mau span) {
  color: #ffffff !important;
}

/* Bảng Bản đồ (#bang-ban-do): thanh công cụ, hàng lọc, chú giải, thẻ chi tiết sáng */
html body #bang-ban-do #bd-loc {
  background: rgba(241, 250, 254, 0.94) !important;
  border: 1.5px solid #9ac5df;
}
html body #bang-ban-do #bd-loc button:not(.bat) {
  color: #3c5566 !important;
  text-decoration: line-through;
}
html body #bang-ban-do #bd-loc button.bat {
  color: #0b2f47 !important;
  font-weight: 800 !important;
}
html body #bang-ban-do #bd-thanh > button small {
  color: #031d2e !important;
  opacity: 1 !important;
}
html body #bang-ban-do #bd-thanh > button.bat,
html body #bang-ban-do #bd-dk button {
  color: #031d2e !important;
}
html body #bang-ban-do :is(#bd-cg, #bd-the) :is(li, span, b, small, .bdt-mota, .bdt-vung, .bdt-them) {
  color: var(--tm-chu) !important;
}
html body #bang-ban-do #bd-cg .bdc-e {
  color: #ffffff !important;
}
html body #bang-ban-do #bd-the .bdt-khoa {
  background: #f2ebff !important;
  border-color: #8d68d6 !important;
  color: #3b1c7a !important;
}
html body #bang-ban-do #bd-toado {
  background: #0c314c !important;
  color: #ffffff !important;
  border-radius: 8px;
}

/* Bảng Thuyền (#bang-nc): các bậc trong thang và thẻ chi tiết */
html body #bang-nc .nc-bac span {
  color: var(--tm-chu) !important;
}
html body #bang-nc .nc-bac.nay {
  box-shadow: 0 0 0 2.5px #0d89bf !important;
}
html body #bang-nc .nc-bac.xem {
  outline: 2.5px solid #c24a02 !important;
}
html body #bang-nc .nc-bac em {
  background: #0c314c !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}
html body #bang-nc .nc-li b s {
  color: var(--tm-chu-phu) !important;
}

/* Bảng Hải chiến & Mùa giải (#bang-hc) */
html body #bang-hc .mg-the b,
html body #bang-hc .mg-the em,
html body #bang-hc .mg-dong span,
html body #bang-hc .mg-thuong span,
html body #bang-hc .hd-buff,
html body #bang-hc .hd-nk,
html body #bang-hc .hc-luat,
html body #bang-hc .hc-luat b,
html body #bang-hc .hc-man span,
html body #bang-hc .hc-dan-hang,
html body #bang-hc .hc-co-tt {
  color: var(--tm-chu) !important;
}
html body #bang-hc .mg-the.chon {
  box-shadow: 0 0 0 2.5px #c24a02 !important;
}
html body #bang-hc .hd-tb {
  background: #fff8df !important;
  border-color: #d4961a !important;
  color: #6b4300 !important;
}
html body #bang-hc .hd-tb a,
html body #bang-hc .hd-nk a {
  color: #095182 !important;
}
html body #bang-hc .mg-dh {
  color: #6f239c !important;
}
html body #bang-hc #hd-chat-log p { color: #e2fbff !important; }
html body #bang-hc #hd-chat-log p b { color: #9fe8ff !important; }
html body #bang-hc #hd-chat-log p.toi b { color: #ffe9a8 !important; }

/* Bảng Đảo nhà / Tủ đồ / Xưởng tàu / Cướp đảo / Phòng thủ */
html body #bang-tdo :is(.td-mon > span, .td-ct-dau b, .td-nh-dau, .td-bo-mon) {
  color: var(--tm-chu) !important;
}
html body #bang-tdo .td-pham {
  color: #0b2f47 !important;
}
html body #bang-tdo .td-xem {
  padding: 8px !important;
}
html body #bang-xt .xt-c,
html body #bang-xt .xt-li3 {
  color: var(--tm-chu) !important;
}
html body #bang-xt .xt-c i {
  color: var(--tm-chu-phu) !important;
}
html body #bang-xt .xt-c b {
  color: var(--tm-chu) !important;
}
html body #bang-xt .xt-c.thieu b {
  color: #a31824 !important;
}
html body #bang-xt .xt-c.du b {
  color: #0d6d3e !important;
}

/* Bảng Thuyền viên & Quán rượu (#bang-tv, #bang-tvq) */
html body #bang-tv .tv-hq,
html body #bang-tv .tv-giua b,
html body #bang-tvq .tv-giua b,
html body #bang-tv .tv-dau b,
html body #bang-tvq .tv-dau b {
  color: var(--tm-chu) !important;
}
html body #bang-tv .tv-tinh,
html body #bang-tvq .tv-tinh {
  background: #fff3c4 !important;
  border-color: #d4961a !important;
  color: #6b4300 !important;
}
html body #bang-tv .tv-hang button.chon,
html body #bang-tv .tv-nghe button.chon {
  background: #d8effc !important;
  border: 2px solid #0d7fb4 !important;
  color: var(--tm-chu) !important;
}
html body #bang-tv .tva-thanh {
  background: #d7e8f3 !important;
  border: 1px solid #9ac5df;
}
html body #bang-tv .tva-canh,
html body #bang-tv .tva-ngon,
html body #bang-tv .tv-canh {
  color: #8c3b00 !important;
}

/* Bảng Quản trị (#bang-qt) trên nền sáng */
html body #bang-qt .qt-bang th {
  background: #d8effc !important;
  color: var(--tm-chu) !important;
}
html body #bang-qt .qt-bang td {
  color: var(--tm-chu) !important;
}
html body #bang-qt .qt-loi {
  color: #a31824 !important;
}

/* Thẻ cá (#the-ca) & Cài đặt / Hồ sơ / Thẻ người */
html body #the-ca :is(.tc-ten b, .tc-ten small, .tc-so span, .tc-hoi, .tc-ghi) {
  color: var(--tm-chu) !important;
}
html body #the-ca .tc-so > div {
  background: #eef8ff !important;
  border: 1.5px solid #9ac5df !important;
}
html body #the-ca .tc-ghi.xong {
  color: #0d6d3e !important;
}
html body #the-ca .tc-nhan {
  background: #d8effc !important;
  color: var(--tm-chu) !important;
}
html body :is(#the-nguoi, #ho-so) :is(.tn-ten b, .tn-ten small, .tn-cot button:not(.do), .hs-ten, .hs-phu, .hs-o b, .hs-o span, .hs-dong) {
  color: var(--tm-chu) !important;
}
html body #the-nguoi .tn-moc {
  color: #8c3b00 !important;
}
html body #ho-so .kh-ho-so :is(b, small) {
  color: var(--tm-chu) !important;
}
html body #ho-so .kh-li {
  color: #a31824 !important;
}
html body #man-xoay .xoay-phu {
  color: var(--tm-chu-phu) !important;
}

/* Sửa bổ sung sau đợt kiểm DOM: sơ đồ tầng (#bang-nc), tiêu đề mục & details.huong-dan, xưởng tàu, kho cần, có gì mới, giải câu, xếp hạng, tiêu đề bảng */
html body #bang-nc .nc-tang {
  background: #ffffff !important;
  border: 2px solid #9ac5df !important;
  border-radius: 12px !important;
  color: var(--tm-chu) !important;
}
html body #bang-nc .nc-tang > div {
  color: var(--tm-chu) !important;
}
html body #bang-nc .nc-tang > div:first-child,
html body #bang-nc .nc-tang > div:last-child {
  color: var(--tm-chu-phu) !important;
}
html body :is(.bang, #bang-dn, #bang-tv, #bang-hc, #bang-st) details.huong-dan {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  border-radius: 12px !important;
  padding: 6px 10px !important;
  color: var(--tm-chu) !important;
}
html body :is(.bang, #bang-dn, #bang-tv, #bang-hc, #bang-st) details.huong-dan :is(summary, p, li, b, small) {
  color: var(--tm-chu) !important;
}
html body :is(.hc-muc, .xh-muc, .mb-muc, .dt-muc, .gca-muc, .st-muc, .tv-muc, .xt-muc, .bv-muc) {
  color: #095182 !important;
  font-weight: 900 !important;
}
html body :is(#bang-hc, #bang-xh) .xh-loai {
  background: transparent !important;
}
html body :is(#bang-hc, #bang-xh) .xh-luot,
html body :is(#bang-hc, #bang-xh) .xh-diem {
  color: #8c3b00 !important;
  font-weight: 800 !important;
}
html body :is(#bang-hc, #bang-xh) .xh-on {
  color: #0d6d3e !important;
}
html body :is(#bang-hc, #bang-xh) .xh-dong {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body :is(#bang-hc, #bang-xh) .xh-hang {
  background: #eef7fd !important;
  color: var(--tm-chu) !important;
}
html body :is(#bang-hc, #bang-xh) .xh-hang.h1 {
  background: #fff3c4 !important;
  color: #8c3b00 !important;
}
html body :is(#bang-hc, #bang-xh) .xh-loi-nhan {
  color: var(--tm-chu) !important;
}
html body #bang-cc .cc-moi-o em {
  color: #a31824 !important;
  font-weight: 800 !important;
}
html body #bang-cc .cc-nguon {
  color: var(--tm-chu) !important;
}
html body #bang-cgm .cgm-muc :is(ul, li, p, small, span) {
  color: var(--tm-chu) !important;
}
html body :is(#bang-dtt, #bang-bv) small {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #bang-gca .gca-ly {
  color: #8c3b00 !important;
  font-weight: 800 !important;
}
html body #bang-xt .xt-li span,
html body #bang-xt .xt-loi span,
html body #bang-xt .xt-dk li,
html body #bang-xt .xt-ct {
  color: var(--tm-chu) !important;
}
html body #bang-xt .xt-dk li.du {
  color: #0d6d3e !important;
  font-weight: 700 !important;
}
html body #bang-xt .xt-dk li.thieu {
  color: #a31824 !important;
  font-weight: 700 !important;
}
html body #bang-xt .xt-bac {
  background: #ffffff !important;
  border: 2px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-xt .xt-bac.nay {
  background: #dcf7ea !important;
  border-color: #22b45a !important;
}
html body #bang-xt .xt-bac.khoa {
  background: #edf4f8 !important;
  border-color: #b8ccd9 !important;
}
html body #bang-xt .xt-bac small {
  color: var(--tm-chu-phu) !important;
}
html body #bang-xt .xt-bac em {
  color: #0d6d3e !important;
  font-weight: 900 !important;
}
html body #bang-ban-do .than-bd .bd-khung .bd-hoa > b {
  color: #ffffff !important;
  background: #0c314c !important;
  border-radius: 50%;
  padding: 0 3px;
}
html body #bang-hc .mg-the em small {
  color: var(--tm-chu-phu) !important;
}
html body :is(#bang-hc, #bang-xh) .xh-cua-toi {
  background: #e6f4fd !important;
  border-top: 2px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body :is(#bang-hc, #bang-xh) .xh-cua-toi b {
  color: #0d6d3e !important;
}
@media (max-width: 620px) {
  html body #bang-tdo .td-o button {
    padding: 4px 2px !important;
    font-size: 11px !important;
    min-height: 44px !important;
  }
}
/* Giữ chữ trong hàng tiêu đề bảng luôn trắng trên nền xanh bang.png (trừ #nhiem-vu thu gọn dùng chip sáng) */
html body #bang-kho > .tieu-de b#kc-ten,
html body #bang-hdn > .tieu-de #mt-ten b.mt-bt,
html body .bang.lon > .tieu-de #mt-ten b.mt-bt,
html body :is(.bang:not(#nhiem-vu):not(.ht-hop), #bang-kho, #bang-hdn, #ho-so) > .tieu-de :is(span, b, .mt-bt) {
  color: #ffffff !important;
}

/* ==================== 16k. SOÁT HUD & HIỆU ỨNG GIAO DIỆN (02/12) ==================== */

/* 1. Nhiệm vụ thu gọn (#nhiem-vu.thu-gon): luôn nền chip sáng, chữ đậm rõ (cả khi tân thủ body.tt-an) */
html body #nhiem-vu.thu-gon,
html body.tt-an #nhiem-vu.thu-gon,
html body.toi-gian.nv-an #nhiem-vu.thu-gon,
html body.toi-gian.nv-an.tt-an #nhiem-vu.thu-gon {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/chip.png') !important;
  border-image-slice: 25 32 26 34 fill !important;
  border-image-width: 9px 12px 9px 12px !important;
  border-image-repeat: stretch !important;
  padding: 5px 12px 6px !important;
  opacity: 1 !important;
}
html body #nhiem-vu.thu-gon #nv-tom,
html body.tt-an #nhiem-vu.thu-gon #nv-tom,
html body.toi-gian.nv-an #nhiem-vu.thu-gon #nv-tom,
html body.toi-gian.nv-an.tt-an #nhiem-vu.thu-gon #nv-tom {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
  font-weight: 800 !important;
}

/* 2. Thẻ chỉ số (#chi-so) chế độ tối giản: ôm khít nội dung, bỏ khoảng trắng thừa bên phải */
html body.toi-gian #chi-so,
html body.toi-gian #chi-so:not(.gon) {
  width: max-content !important;
  min-width: 0 !important;
  max-width: calc(100vw - 146px) !important;
  grid-template-columns: 44px max-content !important;
  padding: 6px 11px 8px 6px !important;
  gap: 6px !important;
}
html body.toi-gian #chi-so .cs-vach {
  width: max-content !important;
}

/* 3. Đồng hồ & chip trên thanh giờ: nền đặc tối, chữ trắng rõ 100% (trừ các mục đã nằm trong #dh-khihau) */
html body #dong-ho > #dh-thientai,
html body #dong-ho #online,
html body #dong-ho #dh-baoho,
html body #dong-ho #dh-gio-tuan {
  background: #072236 !important;
  color: #ffffff !important;
  border: 1px solid rgba(154, 197, 223, 0.55) !important;
  opacity: 1 !important;
}

/* 4. Bản đồ nhỏ: tốc độ #bdn-toc nổi hẳn trên vành khung_ban_do.png; nút khoá góc #nut-khoa-goc ≥ 44px, Tròn mềm, không mờ, không đè bản đồ */
html body #ban-do-nho #bdn-toc {
  z-index: 4 !important;
  bottom: -10px !important;
  top: auto !important;
  padding: 2px 8px !important;
  background: #072236 !important;
  border: 1.5px solid #ffffff !important;
  color: #ffffff !important;
  line-height: 1.15 !important;
}
html body #nut-khoa-goc {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: url('/anh/skin/tron_mem/nut_tron_trong.png') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  color: #04253a !important;
  top: calc(var(--mt) + var(--tren) + var(--ban-do) - 34px) !important;
  right: calc(var(--mep) + var(--phai) + var(--ban-do) - 18px) !important;
}
@media (orientation: landscape) and (max-height: 500px) {
  html body #nut-khoa-goc {
    top: calc(var(--mt) + var(--tren) + var(--ban-do) - 24px) !important;
  }
}
html body #nut-khoa-goc.bat {
  filter: drop-shadow(0 0 8px rgba(255, 216, 74, 0.9)) !important;
}
html body #nut-khoa-goc::before {
  inset: 0 !important;
}

/* 5. Nút vòng cung (#tp-nut-cap, #dn-nut-cap…): chữ đậm #04253a rõ trên nền nut_tron_trong.png */
html body.cam-ung #tp-nut-cap.nut-vong,
html body.cam-ung #tp-nut-roi.nut-vong,
html body.cam-ung #dn-nut-cap.nut-vong,
html body.cam-ung #dn-nut-ra.nut-vong,
html body.cam-ung .nut-vong {
  color: #04253a !important;
  opacity: 1 !important;
}
html body.cam-ung #tp-nut-cap.nut-vong .nv-c,
html body.cam-ung #tp-nut-roi.nut-vong .nv-c,
html body.cam-ung #dn-nut-cap.nut-vong .nv-c,
html body.cam-ung #dn-nut-ra.nut-vong .nv-c {
  color: #04253a !important;
}

/* 6. Cụm lái / chèo (#lai-bang, #lai-tt, .lai-nut): skin Tròn mềm nền đặc 100%, không mờ, không cắt chữ */
html body #lai-tt {
  background: #072236 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(4, 24, 40, 0.38) !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  max-width: calc(100vw - 24px) !important;
  overflow: visible !important;
  opacity: 1 !important;
}
html body #lai-tt b {
  color: #ffe97a !important;
}
html body #lai-tt-toc {
  color: #9ff7ff !important;
}
html body #lai-tt-gio.tot {
  color: #8dffb0 !important;
}
html body #lai-tt-gio.xau {
  color: #ffb2a6 !important;
}
html body #lai-bang .lai-nut,
html body.cam-ung #lai-bang .lai-nut {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 14px 18px 14px 18px !important;
  border-image-repeat: stretch !important;
  color: #04253a !important;
  min-width: 66px !important;
  min-height: 52px !important;
  padding: 5px 11px !important;
  opacity: 1 !important;
  filter: none !important;
}
html body #lai-bang .lai-nut b,
html body #lai-bang .lai-nut small {
  color: #04253a !important;
  opacity: 1 !important;
  font-weight: 900 !important;
}
html body #lai-bang .lai-nut small {
  font-size: 11px !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}
html body #lai-bang .lai-nut:disabled,
html body.cam-ung #lai-bang .lai-nut:disabled {
  border-image-source: none !important;
  background: var(--tm-nut-khoa) !important;
  border: 2px solid #7aa4bf !important;
  border-radius: 14px !important;
  color: #163d57 !important;
  opacity: 1 !important;
}
html body #lai-bang .lai-nut:disabled b,
html body #lai-bang .lai-nut:disabled small {
  color: #163d57 !important;
  opacity: 1 !important;
}
html body #lai-bang #lai-neo.bat,
html body #lai-bang #lai-may.bat {
  border-image-source: url('/anh/skin/tron_mem/nut_vang.png') !important;
  color: #1b1300 !important;
}
html body #lai-bang #lai-neo.bat b,
html body #lai-bang #lai-neo.bat small,
html body #lai-bang #lai-may.bat b,
html body #lai-bang #lai-may.bat small {
  color: #1b1300 !important;
}
html body #lai-bang #lai-roi {
  border-image-source: url('/anh/skin/tron_mem/nut_nguy.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 14px 18px 14px 18px !important;
  color: #ffffff !important;
}
html body #lai-bang #lai-roi b,
html body #lai-bang #lai-roi small {
  color: #ffffff !important;
  opacity: 1 !important;
}
html body #lai-buom-muc {
  background: #072236 !important;
  border: 2px solid #ffffff !important;
  border-radius: 10px !important;
  padding: 4px !important;
  width: 14px !important;
}
@media (max-width: 620px) {
  html body.cam-ung #lai-hang {
    max-width: min(296px, calc(100vw - 108px)) !important;
    justify-content: flex-end !important;
    gap: 5px !important;
  }
}

/* 7. Không hạ opacity làm mờ nút khi hướng dẫn tân thủ (giữ mục tiêu sáng, nút khác vẫn rõ 100%) */
html body.tt-an.hd-mo :is(#nut-phu button, #dn-thanh .dn-nut, .nut-vong, #nut-tui, #nut-che, #nut-menu, #nut-chat, #nut-bando, #thanh-cam .o-cam, #cum-lai button, #nut-chinh, #nut-vong-them):not(.hd-sang):not(:has(.hd-sang)) {
  opacity: 1 !important;
  filter: none !important;
}

/* 8. Toast thông báo nhiều dòng: không bị cắt dòng cuối */
html body #thong-bao .tb {
  border-radius: 18px !important;
  padding: 8px 16px !important;
}
html body #thong-bao .tb-chu {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
}

/* 9. Dải kể chuyện #truyen: chừa chỗ icon sách bên trái không đè chữ đầu dòng */
html body #truyen {
  padding: 14px 16px 16px 38px !important;
}

/* 10. Hiệu ứng giao diện Tròn mềm (mở/đóng ≤ 180ms, nhặt đồ bay, nảy nút đích, lên cấp) */
@keyframes tm-bang-dong {
  0% { opacity: 1; translate: 0 0; scale: 1; }
  100% { opacity: 0; translate: 0 8px; scale: 0.96; }
}
@keyframes tm-bang-giua-dong {
  0% { opacity: 1; translate: 0 0; scale: 1; }
  100% { opacity: 0; translate: 0 8px; scale: 0.96; }
}
@keyframes tm-tui-nay {
  0% { transform: scale(1); }
  36% { transform: scale(1.22) translateY(-2px); }
  68% { transform: scale(0.94); }
  100% { transform: scale(1); }
}
@keyframes tm-len-cap-vao {
  0% { opacity: 0; transform: translate(-50%, -10px) scale(0.88); }
  65% { opacity: 1; transform: translate(-50%, 2px) scale(1.03); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

html body:not(.giam-cd) :is(#menu-luoi, #bang-caidat, #chat, #sanh-lop .sanh-the):not([hidden]):not(.an) {
  animation: tm-bang-mo 0.17s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html body:not(.giam-cd) .tm-dang-dong {
  animation: tm-bang-dong 0.14s ease-in forwards !important;
  pointer-events: none !important;
}
html body:not(.giam-cd):not(.cam-ung) .bang.lon.tm-dang-dong {
  animation: tm-bang-giua-dong 0.14s ease-in forwards !important;
}
html body:not(.giam-cd) .tm-tui-nay {
  animation: tm-tui-nay 0.24s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.tm-vat-bay {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 46;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 5px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid var(--tm-vien);
  box-shadow: 0 4px 12px rgba(4, 24, 40, 0.34);
  color: #0b2f47;
  font: 900 13px/1.1 system-ui, sans-serif;
  will-change: transform, opacity;
}
.tm-vat-bay img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}
.tm-vat-bay .tm-xu-ic {
  font-size: 16px;
  line-height: 1;
}
.tm-vat-bay.co-cham {
  border-color: var(--mau-pham, #7fe8ff);
  box-shadow: 0 0 12px var(--mau-pham, #7fe8ff), 0 4px 10px rgba(4, 24, 40, 0.35);
}
.tm-vat-bay .tm-cham-sang {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 15%, var(--mau-pham, #7fe8ff) 75%);
  box-shadow: 0 0 8px var(--mau-pham, #7fe8ff);
  flex-shrink: 0;
}

#tm-len-cap.tm-len-cap {
  position: fixed;
  left: 50%;
  top: calc(var(--tren-cao, 56px) + 12px);
  transform: translateX(-50%);
  z-index: 42;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff9d6 0%, #ffd55a 100%);
  border: 2.5px solid var(--tm-vien);
  box-shadow: 0 5px 18px rgba(4, 24, 40, 0.4), inset 0 2px 0 #ffffff;
  color: #2b1600;
}
#tm-len-cap[hidden] {
  display: none !important;
}
html body:not(.giam-cd) #tm-len-cap.tm-len-cap.hien {
  animation: tm-len-cap-vao 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#tm-len-cap .tm-lc-sao {
  font-size: 20px;
  line-height: 1;
}
#tm-len-cap .tm-lc-nd {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
#tm-len-cap .tm-lc-nd b {
  font-size: 14px;
  font-weight: 900;
  color: #2b1600;
}
#tm-len-cap .tm-lc-nd small {
  font-size: 11.5px;
  font-weight: 700;
  color: #5c3200;
}

/* Phản hồi bấm nút Tròn mềm lún rõ, mượt */
html body button:active:not(:disabled),
html body .lai-nut:active:not(:disabled),
html body #nut-tren > .nut-vuong:active:not(:disabled) {
  transform: translateY(2px) scale(0.95) !important;
  filter: brightness(0.96);
}

/* ==================== 16l. MÀN TẢI, SẢNH, TẠO NHÂN VẬT & 10 BƯỚC TÂN THỦ (02/12) ==================== */

/* 1. Màn tải (#man-tai): nền đặc ngay lập tức kiểu khoi_dong.css v2 */
html body #man-tai {
  background: radial-gradient(ellipse at 50% 34%, #125272 0%, #082d46 54%, #041524 100%) !important;
}
html body #man-tai .tai-logo .logo-phu {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(5, 36, 58, 0.88);
  border: 2px solid rgba(94, 240, 255, 0.52);
  box-shadow: 0 4px 12px rgba(4, 24, 40, 0.42);
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(12.5px, 3.3vw, 16px);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: none;
  text-shadow: none;
}
html body #man-tai .tai-thanh {
  height: 20px !important;
  padding: 2px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #052c47 0%, #08486e 100%) !important;
  border: 2px solid #04253a !important;
  box-shadow: 0 0 0 2px rgba(13, 137, 191, 0.8), 0 6px 14px rgba(4, 24, 40, 0.45) !important;
}
html body #man-tai .tai-thanh span {
  background: linear-gradient(180deg, #ffe57f 0%, #ffa726 55%, #e67300 100%) !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 0 10px rgba(255, 174, 48, 0.55) !important;
}
html body #man-tai .tai-meo {
  background: rgba(5, 36, 58, 0.9) !important;
  border: 1.5px solid rgba(94, 240, 255, 0.44) !important;
  color: #eef9ff !important;
  font-weight: 600 !important;
}
@media (orientation: landscape) and (max-height: 500px) {
  html body #man-tai .tai-logo {
    top: calc(var(--tren) + 5%) !important;
  }
  html body #man-tai .tai-logo .logo {
    font-size: 44px !important;
  }
  html body #man-tai .tai-logo .logo-phu {
    margin-top: 6px;
    padding: 4px 14px;
    font-size: 13px;
  }
  html body #man-tai .tai-khung {
    bottom: calc(var(--day) + 4%) !important;
  }
}

/* 2. Sảnh (#dang-nhap.sanh): không mờ nút, chip máy chủ rõ chữ, màn ngang không chồng chéo */
html body #dang-nhap[class*="mo-"] .sanh-nut[data-mo],
html body #dang-nhap .sanh-nut,
html body #dang-nhap .sanh-tron,
html body #dang-nhap .dn-khach-ghi {
  opacity: 1 !important;
}
html body #dang-nhap .dn-khach-ghi {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.65) !important;
}
html body #dang-nhap .sanh-may small {
  color: #0b5e36 !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
html body #dang-nhap .tab-dn {
  background: #dff2fc !important;
  border: 2px solid #9ac5df !important;
}
html body #dang-nhap .sanh-the > .tieu-de,
html body #dang-nhap .sanh-the > .tieu-de span#sanh-tieu {
  color: #ffffff !important;
}
@media (orientation: landscape) and (max-height: 500px) {
  html body #dang-nhap .sanh-giua {
    top: calc(var(--tren) + 64px) !important;
    left: 16px !important;
    right: 16px !important;
  }
  html body #dang-nhap .dn-huy {
    width: 46px !important;
    height: 46px !important;
  }
  html body #dang-nhap .logo {
    font-size: 40px !important;
  }
  html body #dang-nhap .sanh-duoi {
    bottom: calc(var(--day) + 38px) !important;
    gap: 6px !important;
  }
  html body #dang-nhap #dn-khach {
    min-height: 52px !important;
    font-size: 21px !important;
  }
  html body #dang-nhap #dn-mo-tk {
    min-height: 44px !important;
  }
  html body #dang-nhap .sanh-chan {
    bottom: calc(2px + var(--day)) !important;
  }
  html body #dang-nhap .dn-phap-ly a {
    padding: 5px 2px !important;
  }
}

/* 3. Tạo nhân vật (#man-tao-nv / #tnv-form): nền sáng Tròn mềm kiểu tao_nhan_vat.css v2 */
html body #tnv-form > .tieu-de #tnv-tieu {
  color: #ffffff !important;
}
html body #tnv-cv {
  background: radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.95) 0%, rgba(212, 244, 255, 0.88) 44%, rgba(114, 206, 240, 0.86) 78%, rgba(44, 144, 198, 0.94) 100%) !important;
  border: 2.5px solid #0b6394 !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.85), inset 0 -10px 24px rgba(8, 66, 108, 0.22) !important;
}
html body #tnv-form .tnv-ghi b,
html body #tnv-form .tnv-nhan span,
html body #tnv-form #tnv-mau-ten {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
}
html body #tnv-form .tnv-nhan {
  text-shadow: none !important;
  font-weight: 800 !important;
}
html body #tnv-form .tnv-tt {
  color: var(--tm-chu-phu) !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
html body #tnv-form .tnv-tt.tot {
  color: #0d6d3e !important;
}
html body #tnv-form .tnv-tt.loi {
  color: #a61b22 !important;
}
html body #tnv-form .tnv-tt.canh {
  color: #8c3b00 !important;
}
html body #tnv-form .tnv-kieu button {
  background: linear-gradient(180deg, #ffffff 0%, #ebf7ff 100%) !important;
  border: 2.5px solid #0e7bb0 !important;
  color: #0b2f47 !important;
  box-shadow: inset 0 1.5px 0 #ffffff, 0 2px 5px rgba(4, 37, 58, 0.14) !important;
  opacity: 1 !important;
}
html body #tnv-form .tnv-kieu button.chon {
  border-color: #04253a !important;
  background: linear-gradient(180deg, #fffdf2 0%, #ffeec2 100%) !important;
  box-shadow: 0 0 0 2.5px #ff9a1f, inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 3px 8px rgba(255, 154, 31, 0.28) !important;
  color: #7c3b00 !important;
}
html body #tnv-form .tnv-kieu button span {
  color: inherit !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
html body #tnv-form .tnv-kieu img {
  background: radial-gradient(circle at 50% 35%, #ffffff 0%, #d4f1ff 100%) !important;
  border: 1.5px solid rgba(13, 137, 191, 0.38) !important;
}
html body #tnv-form .tnv-kieu button.chon img {
  background: radial-gradient(circle at 50% 35%, #ffffff 0%, #ffe6a0 100%) !important;
  border-color: #e69d2c !important;
  box-shadow: none !important;
}
@media (max-width: 620px) {
  html body #man-tao-nv .tnv-than {
    padding: 8px 12px 10px !important;
  }
  html body #man-tao-nv .tnv-xem {
    margin-bottom: 6px !important;
    gap: 6px !important;
  }
  html body #man-tao-nv #tnv-cv,
  html body #man-tao-nv.man-cao #tnv-cv {
    width: 162px !important;
    height: 186px !important;
  }
  html body #man-tao-nv .tnv-kieu button {
    min-height: 76px !important;
    padding: 5px 4px !important;
  }
  html body #man-tao-nv .tnv-kieu img {
    width: 44px !important;
    height: 44px !important;
  }
  html body #man-tao-nv .tnv-gt button {
    min-height: 46px !important;
  }
  html body #man-tao-nv .tnv-nut {
    background: #eaf6ff !important;
    border-top: 2px solid #9ac5df !important;
    box-shadow: 0 -4px 12px rgba(4, 37, 58, 0.12) !important;
    padding: 8px 12px calc(8px + var(--day)) !important;
  }
}
@media (max-width: 620px) and (min-height: 760px) {
  html body #man-tao-nv #tnv-cv {
    width: 168px !important;
    height: 192px !important;
  }
}
@media (max-height: 500px) and (min-width: 621px) {
  html body #tnv-form {
    grid-template-columns: 204px minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    padding: 2px 10px 8px 10px !important;
  }
  html body #tnv-form > .tieu-de {
    min-height: 44px !important;
    margin-bottom: 0 !important;
  }
  html body #tnv-form .tnv-xem {
    grid-column: 1;
    grid-row: 2;
    padding: 0 !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    gap: 5px !important;
    align-content: start !important;
  }
  html body #tnv-form #tnv-cv {
    width: 146px !important;
    height: 166px !important;
  }
  html body #tnv-form .tnv-nut {
    grid-column: 1 !important;
    grid-row: 3 !important;
    padding: 6px 0 0 0 !important;
  }
  html body #tnv-form #tnv-ok {
    min-height: 46px !important;
    font-size: 16px !important;
  }
  html body #tnv-form .tnv-chon {
    grid-column: 2 !important;
    grid-row: 2 / 4 !important;
    padding-left: 10px !important;
    gap: 1px !important;
  }
  html body #tnv-form .tnv-ghi {
    font-size: 11.5px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
  html body #tnv-form .tnv-nhan {
    margin: 3px 0 1px !important;
    font-size: 11px !important;
  }
  html body #tnv-form .tnv-tt {
    margin-top: 1px !important;
    min-height: 14px !important;
    font-size: 11px !important;
  }
  html body #tnv-form #tnv-ten,
  html body #tnv-form #tnv-xx,
  html body #tnv-form .tnv-gt button {
    min-height: 44px !important;
  }
  html body #tnv-form .tnv-kieu button {
    min-height: 44px !important;
    padding: 2px 4px !important;
  }
  html body #tnv-form .tnv-kieu img {
    width: 32px !important;
    height: 32px !important;
  }
  html body #tnv-form .tnv-mau button {
    width: 44px !important;
    height: 44px !important;
  }
}

/* 4. 10 bước tân thủ đầu: dải #truyen không đè #nhiem-vu, nút thẻ NV >= 44px, tương phản >= 4.5:1 */
@media (orientation: landscape) and (max-height: 520px) {
  html body.cam-ung #truyen {
    left: auto !important;
    right: calc(10px + var(--phai)) !important;
    transform: none !important;
    width: min(420px, calc(100vw - 404px - var(--le) - var(--phai))) !important;
    padding: 12px 14px 12px 40px !important;
    animation: none !important;
  }
  html body.cam-ung.tt-m7 #truyen,
  html body.cam-ung:not(.tt-an) #truyen {
    right: calc(var(--mep, 8px) + var(--phai) + var(--ban-do, 84px) + 12px) !important;
    width: min(360px, calc(100vw - 380px - var(--ban-do, 84px) - var(--le) - var(--phai))) !important;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  html body #nhiem-vu:not(.thu-gon) {
    padding: 6px 10px 8px !important;
  }
  html body #nhiem-vu:not(.thu-gon) > .tieu-de {
    min-height: 44px !important;
    margin-bottom: 0 !important;
    padding: 0 2px !important;
  }
  html body #nhiem-vu:not(.thu-gon) #nv-nd {
    padding: 0 6px !important;
    line-height: 1.3 !important;
  }
  html body #nhiem-vu:not(.thu-gon) #nv-thuong {
    padding: 2px 6px 0 !important;
  }
  html body #nhiem-vu:not(.thu-gon) #hd-tat {
    margin: 4px 6px 0 !important;
  }
}
html body.cam-ung #nhiem-vu.thu-gon #nv-dau {
  min-height: 44px !important;
}
html body #nhiem-vu:not(.thu-gon) > .tieu-de #nv-thu {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 11px !important;
  background: #e3f2fc !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-vien) !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}
html body #hd-tat {
  min-height: 44px !important;
  padding: 6px 12px !important;
  border-radius: 12px !important;
  background: #e8f5fd !important;
  border: 2px solid #0d7fb4 !important;
  color: #0b2f47 !important;
  font-weight: 800 !important;
  font-size: 12.5px !important;
  opacity: 1 !important;
}
html body #hd-loi {
  background: #fff7dc !important;
  border: 1.5px solid #d4961a !important;
  color: #6b3b00 !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
html body #tt-goi {
  background: #fff8df !important;
  border: 2px solid var(--tm-vien) !important;
  box-shadow: 0 0 0 2px #ff9f1c, 0 4px 12px rgba(4, 24, 40, 0.28) !important;
  color: #6b3400 !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
html body #tt-nhip {
  background: #072236 !important;
  border: 2.5px solid #ffffff !important;
  color: #ffffff !important;
  opacity: 1 !important;
}
html body #tt-mung {
  background: linear-gradient(180deg, #fffef8 0%, #e7f6ff 100%) !important;
  border: 3px solid var(--tm-vien) !important;
  box-shadow: 0 0 0 3px #ff9f1c, 0 14px 32px rgba(3, 18, 34, 0.45) !important;
  color: var(--tm-chu) !important;
}
html body #tt-mung .tm-dau {
  color: #8c3b00 !important;
}
html body #tt-mung .tm-tiep {
  color: var(--tm-chu) !important;
}
html body #tt-mung .tm-xem {
  background: linear-gradient(180deg, #ffe26b 0%, #ffa726 100%) !important;
  border: 2px solid var(--tm-vien) !important;
  color: #2b1600 !important;
  min-height: 44px !important;
}
html body #tt-mung .tm-sau {
  background: #ffffff !important;
  border: 2px solid var(--tm-vien) !important;
  color: var(--tm-vien) !important;
  min-height: 44px !important;
}
html body #ttb-nut .tn-chinh {
  min-height: 46px !important;
  border: 2px solid var(--tm-vien) !important;
  color: #2b1600 !important;
}
html body #ttb-nut .tn-phu {
  color: #4a2300 !important;
  opacity: 1 !important;
}

/* ==================== 16m. LỐI CHƠI GIỮA GAME — CÂU CÁ, LÁI THUYỀN, HẢI CHIẾN, XÂY DỰNG, NÔNG TRẠI, PHỐ CẢNG (02/12) ==================== */

/* 0. Hộp thoại (#hop-thoai.bt-beta): giữ tiêu đề đậm rõ trên nền sáng hop.png */
html body #hop-thoai > .ht-hop > .tieu-de,
html body #hop-thoai > .ht-hop > .tieu-de span {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
}

/* 1. Câu cá: thanh căng dây mini-game #cau-giang (theo v2 #can-giang-co) & Thẻ cá #the-ca */
html body #cau-giang {
  position: fixed !important;
  right: calc(12px + var(--phai, 0px));
  bottom: calc(var(--nc-day, 14px) + var(--nc, 88px) + var(--nut-vong, 52px) + 26px + var(--day, 0px));
  z-index: var(--z-hud-noi, 14);
  width: 158px;
  padding: 4px;
  border-radius: 15px;
  border: 2.5px solid #04253a;
  background: linear-gradient(180deg, #5ce4ff 0%, #19a6dc 26%, #0d89bf 70%, #065a8a 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.64), inset 0 -2px 0 rgba(4, 37, 58, 0.36), 0 6px 16px rgba(4, 24, 40, 0.4);
  pointer-events: none;
}
html body.tay-trai #cau-giang {
  right: auto;
  left: calc(12px + var(--le, 0px));
}
@media (orientation: landscape) and (max-height: 480px) {
  html body #cau-giang {
    right: calc(92px + var(--phai, 0px)) !important;
    bottom: calc(var(--day, 0px) + 154px) !important;
    width: 152px !important;
  }
  html body.tay-trai #cau-giang {
    right: auto !important;
    left: calc(92px + var(--le, 0px)) !important;
  }
}
html body #cau-giang[hidden] {
  display: none !important;
}
html body #cau-giang.cang-vang {
  background: linear-gradient(180deg, #ffe27a 0%, #f59f1f 48%, #bd5904 100%);
}
html body #cau-giang.cang-do,
html body #cau-giang.ca-vung {
  background: linear-gradient(180deg, #ff969a 0%, #e8323a 48%, #9c0d16 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.68), 0 0 0 2.5px rgba(255, 140, 144, 0.88), 0 6px 16px rgba(4, 24, 40, 0.44);
}
html body #cau-giang .cg-ruot {
  padding: 5px 8px 6px;
  border-radius: 10px;
  border: 1.5px solid #0b6394;
  background: linear-gradient(180deg, #ffffff 0%, #f1faff 70%, #e3f4fd 100%);
  color: var(--tm-chu);
}
html body #cau-giang.cang-vang .cg-ruot {
  border-color: #b85804;
  background: linear-gradient(180deg, #fffef6 0%, #fff2d6 100%);
}
html body #cau-giang.cang-do .cg-ruot,
html body #cau-giang.ca-vung .cg-ruot {
  border-color: #a6141c;
  background: linear-gradient(180deg, #fff6f6 0%, #ffdce0 100%);
}
html body #cau-giang .cg-dau {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
html body #cau-giang .cg-nhan {
  font-weight: 900;
  font-size: 11px;
  line-height: 1.15;
  color: #09456b;
  white-space: nowrap;
}
html body #cau-giang.cang-vang .cg-nhan,
html body #cau-giang.ca-vung .cg-nhan {
  color: #a64300;
}
html body #cau-giang.cang-do .cg-nhan {
  color: #b80f18;
}
html body #cau-giang .cg-phan {
  font-weight: 900;
  font-size: 11px;
  line-height: 1.15;
  color: #076391;
  font-variant-numeric: tabular-nums;
}
html body #cau-giang.cang-do .cg-phan,
html body #cau-giang.ca-vung .cg-phan {
  color: #9e1018;
}
html body #cau-giang .cg-ranh {
  position: relative;
  display: block;
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: #082e47;
  border: 2px solid #04253a;
  overflow: hidden;
}
html body #cau-giang .cg-day {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #21c870 0%, #57f09b 100%);
  transition: width 55ms linear;
}
html body #cau-giang.cang-vang .cg-day {
  background: linear-gradient(90deg, #f5b922 0%, #ff981a 100%);
}
html body #cau-giang.cang-do .cg-day,
html body #cau-giang.ca-vung .cg-day {
  background: linear-gradient(90deg, #ff3840 0%, #ff8286 100%);
}
html body #cau-giang .cg-moc {
  position: absolute;
  left: 85%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff2f2;
  pointer-events: none;
}
html body #nut-chinh.cang-vang .vong {
  filter: drop-shadow(0 0 10px rgba(255, 176, 36, 0.9));
}
html body #nut-chinh.giat .vong,
html body #nut-chinh.cang-do .vong,
html body #nut-chinh.ca-vung .vong {
  background: linear-gradient(180deg, #c8221e 0%, #7d110e 100%) !important;
  border: 3px solid #fff2b2 !important;
  color: #ffffff !important;
  text-shadow: 0 1.5px 0 #450605 !important;
  filter: drop-shadow(0 0 12px rgba(238, 52, 59, 0.95));
}
html body #nut-chinh.giat #nut-chinh-chu,
html body #nut-chinh.cang-do #nut-chinh-chu,
html body #nut-chinh.ca-vung #nut-chinh-chu {
  color: #ffffff !important;
}

/* Thẻ cá (#the-ca): nút đóng 44px, lưới nút 2 cột đủ 44px không cắt chữ, nhãn rõ tương phản, không đè thanh cầm / HUD */
html body #the-ca {
  top: calc(env(safe-area-inset-top, 0px) + 52px) !important;
  width: min(320px, calc(100vw - 24px)) !important;
}
@media (max-width: 620px) and (min-height: 500px) {
  html body #the-ca {
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(278px, calc(100vw - 112px)) !important;
    max-height: calc(100dvh - 240px) !important;
    overflow-y: auto !important;
  }
}
@media (max-height: 480px) {
  html body #the-ca {
    top: calc(env(safe-area-inset-top, 0px) + 42px) !important;
    width: min(300px, calc(100vw - 440px), 42vw) !important;
    min-width: 260px !important;
    max-height: calc(100dvh - 116px) !important;
    overflow-y: auto !important;
    padding: 8px 10px !important;
  }
  html body #the-ca .tc-anh {
    width: 52px !important;
    height: 52px !important;
  }
  html body #the-ca .tc-anh img {
    width: 44px !important;
    height: 44px !important;
  }
  html body #the-ca .tc-so {
    margin: 4px 0 3px !important;
  }
  html body #the-ca .tc-so > div {
    padding: 2px 6px !important;
  }
  html body #the-ca .tc-ghi,
  html body #the-ca .tc-hoi {
    margin: 1px 0 3px !important;
  }
}
@media (max-width: 620px), (max-height: 500px) {
  html body #bang-cc #cc-ds,
  html body #bang-cc #cc-ct {
    flex: 0 0 auto !important;
  }
}
html body #the-ca .tc-x {
  top: 4px !important;
  right: 4px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  background: url('/anh/skin/tron_mem/nut_dong.png') center / 100% 100% no-repeat !important;
  font-size: 0 !important;
  color: transparent !important;
  border: 0 !important;
}
html body #the-ca .tc-dau {
  padding-right: 46px !important;
}
html body #the-ca .tc-anh {
  background: #e3f4ff !important;
  border: 2px solid #0d7fb4 !important;
}
html body #the-ca .tc-nhan.moi {
  background: #0d6d3e !important;
  color: #ffffff !important;
}
html body #the-ca .tc-nhan.kl {
  background: #fff3c4 !important;
  color: #7c3b00 !important;
  border: 1px solid #d4961a !important;
}
html body #the-ca .tc-nhan.klMc {
  background: #8c3b00 !important;
  color: #fff8df !important;
}
html body #the-ca .tc-nhan.hiem {
  background: #5b259c !important;
  color: #ffffff !important;
}
html body #the-ca .tc-nut {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  gap: 6px !important;
}
html body #the-ca .tc-nut button {
  min-height: 44px !important;
  padding: 6px 8px !important;
  font-size: 12.5px !important;
  white-space: nowrap !important;
}

/* 2. Lái thuyền: không ép max-width: 56vw ở màn dọc, chữ #lai-tt xuống dòng gọn, icon neo rõ nét */
html body.cam-ung.dang-lai #cum-lai {
  max-width: calc(100vw - 16px) !important;
}
html body #lai-tt {
  flex-wrap: wrap !important;
  justify-content: center !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.25 !important;
}
html body #lai-bang #lai-neo:not(.bat) .lai-neo-ic {
  filter: brightness(0.18) contrast(1.5) !important;
}
html body #ban-do-nho #bdn-bac b {
  background: #c41b2b !important;
  color: #ffffff !important;
}
html body #ban-do-nho #bdn-gio b {
  background: #072236 !important;
  color: #8dffb0 !important;
  border-color: #8dffb0 !important;
}

/* 3. Hải chiến, Boss biển, Kraken, Hải thú: hết đè HUD / cần, vòng nạp đạn rõ, tương phản ≥ 4.5:1 */
html body #hc-thanh .hc-nv,
html body.cam-ung #hc-thanh .hc-nv {
  overflow: hidden !important;
  color: #04253a !important;
  opacity: 1 !important;
}
html body #hc-thanh .hc-nv b {
  color: #04253a !important;
  font-weight: 900 !important;
}
html body #hc-thanh .hc-nv em {
  color: #8c3b00 !important;
  font-weight: 900 !important;
  opacity: 1 !important;
}
html body #hc-thanh .hc-nv.het {
  filter: none !important;
  box-shadow: 0 0 0 2.5px #c42b37 !important;
}
html body #hc-thanh .hc-nv.het em {
  color: #a31824 !important;
}
html body.cam-ung #hc-thanh .hc-nv > * {
  position: relative;
  z-index: 2;
}
html body.cam-ung #hc-thanh .hc-nv:is(.ban, .no, .cv)::before {
  z-index: 1 !important;
  opacity: 0.42 !important;
  border-radius: 50% !important;
}
html body.cam-ung #hc-thanh .hc-nv.tu-ve {
  box-shadow: 0 0 0 3px #c42b37 !important;
}
html body #hc-chip-co {
  background: #072236 !important;
  color: #ffffff !important;
  border: 1.5px solid #9ac5df !important;
  opacity: 1 !important;
}
html body #hc-chip-co.nguy {
  background: #a31824 !important;
  color: #ffffff !important;
  border-color: #ffd54a !important;
}
html body #bb-chip,
html body #kr-chip {
  min-height: 44px !important;
  background: #072236 !important;
  color: #ffffff !important;
  border: 2px solid #ffd54a !important;
  opacity: 1 !important;
}

/* Vị trí #bb-thanh & #kr-hud: tránh đè #chi-so, #nut-chat, #dong-ho, #ban-do-nho, #dn-ve, #tp-ve, #can-di */
html body #bb-thanh.thu {
  left: calc(10px + env(safe-area-inset-left, 0px)) !important;
  top: calc(env(safe-area-inset-top, 0px) + 114px) !important;
}
@media (max-width: 620px) {
  html body #bb-thanh.thu {
    top: auto !important;
    bottom: calc(var(--day, 0px) + 196px) !important;
    left: calc(10px + env(safe-area-inset-left, 0px)) !important;
  }
  html body #kr-hud {
    top: calc(env(safe-area-inset-top, 0px) + 232px) !important;
    width: min(366px, calc(100vw - 24px)) !important;
  }
  html body #kr-hud.duoi-bb {
    top: calc(env(safe-area-inset-top, 0px) + 314px) !important;
  }
  html body #bb-thanh:not(.thu) {
    top: calc(env(safe-area-inset-top, 0px) + 232px) !important;
    width: min(366px, calc(100vw - 24px)) !important;
  }
}
html body #kr-hud .kr-xt {
  margin: 2px 0;
  line-height: 1.3;
}
@media (min-width: 621px) {
  html body #kr-hud {
    top: calc(env(safe-area-inset-top, 0px) + 46px) !important;
    width: min(348px, calc(100vw - 460px)) !important;
    min-width: 240px !important;
  }
  html body #kr-hud.duoi-bb {
    top: calc(env(safe-area-inset-top, 0px) + 128px) !important;
  }
  html body #bb-thanh:not(.thu) {
    top: calc(env(safe-area-inset-top, 0px) + 46px) !important;
    width: min(348px, calc(100vw - 460px)) !important;
    min-width: 240px !important;
  }
}
html body #bb-the,
html body #kr-the,
html body #ptt-the {
  color: var(--tm-chu) !important;
}
html body #bb-the .bb-the-x,
html body #kr-the .kr-the-x,
html body #ptt-the .kr-the-x {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  background: url('/anh/skin/tron_mem/nut_dong.png') center / 100% 100% no-repeat !important;
  font-size: 0 !important;
  color: transparent !important;
  border: 0 !important;
}
html body #bb-the .bb-the-phan,
html body #bb-the .bb-the-con,
html body #kr-the .kr-the-dong,
html body #kr-the .kr-the-ds {
  color: var(--tm-chu) !important;
}
html body #bb-the .bb-the-dau {
  color: #8c3b00 !important;
}
html body #bb-the .bb-the-ly {
  color: #a31824 !important;
}

/* 4. Xây dựng / Đảo nhà / Nông trại / Hải âu: Tròn mềm đầy đủ, nút >= 44px, opacity 1, hết đè đồng hồ */
html body #dk-thanh,
html body #sx-thanh,
html body #nha-thanh,
html body #ds-menu {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/the_hud.png') !important;
  border-image-slice: 37 36 41 36 fill !important;
  border-image-width: 12px 12px 14px 12px !important;
  border-image-repeat: stretch !important;
  padding: 12px 14px 14px !important;
  color: var(--tm-chu) !important;
}
html body #ds-menu {
  padding: 12px 46px 14px 14px !important;
}
html body #ds-menu .ds-x {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  background: url('/anh/skin/tron_mem/nut_dong.png') center / 100% 100% no-repeat !important;
  font-size: 0 !important;
  color: transparent !important;
  border: 0 !important;
}
html body #ds-menu .ds-td,
html body #ds-menu .ds-td b {
  color: var(--tm-chu) !important;
}
html body #ds-menu .nho-mo {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #ds-menu .ds-tot {
  color: #0d6d3e !important;
}
html body #ds-menu .ds-canh {
  color: #a31824 !important;
}
html body #ds-menu .thanh {
  background: #0c263b !important;
  border: 1.5px solid #04253a !important;
}
@media (orientation: landscape) {
  html body.cam-ung #dk-thanh {
    top: calc(env(safe-area-inset-top, 0px) + 46px) !important;
    bottom: auto !important;
  }
}
@media (orientation: portrait) {
  html body.cam-ung #dk-thanh {
    top: auto !important;
    bottom: calc(var(--day, 0px) + 188px) !important;
  }
}
html body :is(#dk-thanh, #sx-thanh) :is(.sx-td, .sx-ghi, .sx-nho) {
  color: var(--tm-chu) !important;
  opacity: 1 !important;
}
html body :is(#dk-thanh, #sx-thanh) .sx-nho {
  color: var(--tm-chu-phu) !important;
}
html body :is(#dk-thanh, #sx-thanh) :is(.sx-xanh, .dk-xanh) {
  color: #0d6d3e !important;
}
html body :is(#dk-thanh, #sx-thanh) :is(.sx-do, .dk-do) {
  color: #a31824 !important;
}
html body :is(#dk-thanh, #sx-thanh, #ds-menu) :is(.sx-hang button, .ds-hang button) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 12px 16px 12px 16px !important;
  border-image-repeat: stretch !important;
  color: #031d2e !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 5px 12px !important;
  opacity: 1 !important;
}
html body :is(#dk-thanh, #sx-thanh, #ds-menu) :is(.sx-hang button.chinh, .ds-hang button.chinh) {
  border-image-source: url('/anh/skin/tron_mem/nut_chinh.png') !important;
  border-image-slice: 44 66 41 66 fill !important;
  color: #1b1300 !important;
}
html body :is(#dk-thanh, #sx-thanh, #ds-menu) :is(.sx-hang button.sx-nguy, .ds-hang button.nguy) {
  border-image-source: url('/anh/skin/tron_mem/nut_nguy.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  color: #ffffff !important;
}
html body :is(#dk-thanh, #sx-thanh, #ds-menu) :is(.sx-hang button:disabled, .ds-hang button:disabled) {
  border-image-source: none !important;
  background: var(--tm-nut-khoa) !important;
  border: 2px solid #9fb4c4 !important;
  border-radius: 12px !important;
  color: #354e5e !important;
  opacity: 1 !important;
}
html body #ds-menu .ds-hang button small {
  color: #163d57 !important;
  opacity: 1 !important;
}

/* Xây nhà (#nha-thanh) + góc nhìn (.goc-xay): nền sáng, chữ rõ, mọi nút ≥ 44×44 px */
html body #nha-thanh .nh-cu {
  background: linear-gradient(180deg, #ffffff 0%, #ebf7ff 100%) !important;
  border: 2px solid #0e7bb0 !important;
  color: #0b2f47 !important;
  min-width: 44px !important;
  min-height: 46px !important;
}
html body #nha-thanh .nh-cu.chon {
  background: linear-gradient(180deg, #fffdf2 0%, #ffeec2 100%) !important;
  border-color: #04253a !important;
  box-shadow: 0 0 0 2px #ff9a1f !important;
  color: #7c3b00 !important;
}
html body #nha-thanh .nh-cu small {
  color: inherit !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}
html body #nha-thanh .nh-tang {
  background: #ffffff !important;
  border: 2px solid #0e7bb0 !important;
  color: #0b2f47 !important;
  min-height: 44px !important;
}
html body #nha-thanh .nh-tang.chon {
  background: #fff3c4 !important;
  border-color: #c24a02 !important;
  color: #7c3b00 !important;
}
html body #nha-thanh .nh-tang:disabled {
  background: var(--tm-nut-khoa) !important;
  border-color: #9fb4c4 !important;
  color: #354e5e !important;
  opacity: 1 !important;
}
html body #nha-thanh .nh-dem {
  background: #dff2fc !important;
  border: 1.5px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #nha-thanh .nh-dem.day {
  background: #ffe8ea !important;
  border-color: #c42b37 !important;
  color: #a31824 !important;
}
html body #nha-thanh .nh-gia {
  background: #ffffff !important;
  border: 1.5px solid #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #nha-thanh .nh-gia.thieu {
  background: #ffe8ea !important;
  border-color: #c42b37 !important;
  color: #a31824 !important;
}
html body #nha-thanh .nh-ghi,
html body #nha-thanh .nh-the small {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #nha-thanh .nh-the b {
  color: var(--tm-chu) !important;
}
html body #nha-thanh .nh-ly {
  color: #a31824 !important;
}
html body #nha-thanh :is(.nh-xong, .nh-dat, .nh-nut) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 12px 16px 12px 16px !important;
  border-image-repeat: stretch !important;
  color: #031d2e !important;
  min-height: 44px !important;
  padding: 4px 12px !important;
}
html body #nha-thanh :is(.nh-xong, .nh-dat, .nh-nut).chinh {
  border-image-source: url('/anh/skin/tron_mem/nut_chinh.png') !important;
  border-image-slice: 44 66 41 66 fill !important;
  color: #1b1300 !important;
}
html body #nha-thanh .nh-nut.nguy {
  border-image-source: url('/anh/skin/tron_mem/nut_nguy.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  color: #ffffff !important;
}
html body #nha-goi-y {
  background: #fff8df !important;
  border: 2px solid #0d7fb4 !important;
  color: var(--tm-chu) !important;
}
html body #nha-goi-y.do {
  background: #ffe8ea !important;
  border-color: #c42b37 !important;
  color: #a31824 !important;
}
html body .goc-xay button,
html body.cam-ung .goc-xay button,
html body.cam-ung #nha-thanh .goc-xay button {
  min-width: 44px !important;
  min-height: 44px !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  background: #e3f2fc !important;
  border: 2px solid var(--tm-vien) !important;
  border-radius: 10px !important;
  color: var(--tm-chu) !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  opacity: 1 !important;
}
@media (orientation: landscape) {
  html body.cam-ung #nha-thanh .goc-xay {
    grid-template-columns: repeat(3, 44px) !important;
    gap: 4px !important;
  }
}

/* Hải âu phá rau (#ha-nut): kiểu Tròn mềm v2 nổi bật, tương phản >= 4.5:1, không đè dk-thanh / sx-thanh / nha-thanh / ds-menu */
html body #ha-nut {
  min-height: 46px !important;
  padding: 8px 18px !important;
  border-radius: 999px !important;
  border: 2.5px solid #04253a !important;
  background: linear-gradient(180deg, #ffe57f 0%, #ffa726 100%) !important;
  color: #2b1600 !important;
  font-weight: 900 !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.72), 0 4px 12px rgba(4, 24, 40, 0.42) !important;
  left: calc(12px + env(safe-area-inset-left, 0px)) !important;
  transform: none !important;
  top: calc(env(safe-area-inset-top, 0px) + 134px) !important;
  bottom: auto !important;
}
html body #ha-nut:active {
  transform: scale(0.95) !important;
}
html body #ha-nut.gan {
  background: linear-gradient(180deg, #c91d2b 0%, #8f111b 100%) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}
@media (max-width: 620px) and (orientation: portrait) {
  html body #ha-nut {
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: calc(env(safe-area-inset-top, 0px) + 296px) !important;
  }
  html body #ha-nut:active {
    transform: translateX(-50%) scale(0.95) !important;
  }
  html body #nha-goi-y {
    top: calc(env(safe-area-inset-top, 0px) + 292px) !important;
  }
}

/* 5. Phố cảng mới (94×80): nút Vào, Chợ cảng, Việc cảng, Sạp Cô Mười Gió, Bến Vui, Đua thuyền, chip phố */
html body.cam-ung #tp-nut-cua.nut-vong,
html body.cam-ung #vcg-nut.nut-vong,
html body.cam-ung #dn-thanh #tp-nut-cua:not([hidden]) {
  color: #04253a !important;
  opacity: 1 !important;
  transform: none !important;
  border: 0 !important;
}
html body #bang-tp-cho .tp-ten,
html body #bang-tp-tiem .tp-ten {
  color: var(--tm-chu) !important;
}
html body #bang-tp-cho .tp-ten small,
html body #bang-tp-tiem .tp-ten small,
html body #bang-tp-cho .tp-ten small.tp-chung,
html body #bang-tp-tiem .tp-ten small.tp-chung {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #bang-tp-cho .tp-ten small.tp-chung.sap,
html body #bang-tp-tiem .tp-ten small.tp-chung.sap {
  color: #8c3b00 !important;
}
html body #bang-tp-cho .tp-ten small.tp-chung.het,
html body #bang-tp-tiem .tp-ten small.tp-chung.het {
  color: #a31824 !important;
}
html body .tp-nhom,
html body #bang-tp-cho .tp-nhom,
html body #bang-tp-tiem .tp-nhom {
  color: var(--tm-chu-phu) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
html body #bang-tp-sap .nca-luot,
html body #bang-nguoi-ca .nca-luot,
html body #bang-tau-buon .nca-luot {
  color: var(--tm-chu-phu) !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
html body #bang-tp-tiem .tp-loi {
  color: var(--tm-chu) !important;
}
html body #bang-vcg .vcg-dong-dau small,
html body #bang-vcg .vcg-than > small,
html body #bang-vcg .vcg-luat {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #bang-vcg .vcg-het {
  background: #dcf7ea !important;
  border-color: #22b45a !important;
  color: #0d6d3e !important;
}
html body #bang-vcg .vcg-chuoi.da {
  opacity: 1 !important;
}
html body .vcg-bo,
html body .dtt-x {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
}
html body :is(.vcg-chip, .dtt-chip, .gca-chip, .bv-chip) {
  min-height: 44px !important;
  background: #072236 !important;
  color: #ffffff !important;
  border-width: 2px !important;
  opacity: 1 !important;
}
html body #kpho-ten {
  background: #072236 !important;
  border: 2px solid #ffd54a !important;
  color: #ffe97a !important;
}
html body #kpho-ten b {
  white-space: normal !important;
  color: #ffe97a !important;
}
html body #kpho-ten small {
  color: #e2f5ff !important;
}
html body :is(#bang-tp-sap, #bang-nguoi-ca, #bang-tau-buon) .nca-vat {
  background: #ffffff !important;
  border: 1.5px solid #9ac5df !important;
  width: auto !important;
  min-width: 70px !important;
  max-width: 108px !important;
  padding: 4px 6px !important;
}
html body :is(#bang-tp-sap, #bang-nguoi-ca, #bang-tau-buon) .nca-vat b {
  color: var(--tm-chu) !important;
}
html body :is(#bang-tp-sap, #bang-nguoi-ca, #bang-tau-buon) .nca-vat small {
  color: #0d6d3e !important;
  font-weight: 800 !important;
}
html body :is(#bang-tp-sap, #bang-nguoi-ca, #bang-tau-buon) .nca-vat.thieu small {
  color: #a31824 !important;
}
html body :is(#bang-tp-sap, #bang-nguoi-ca, #bang-tau-buon) .nca-vat em {
  color: var(--tm-chu-phu) !important;
  white-space: normal !important;
  text-align: center !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.15 !important;
}
html body :is(#bang-tp-sap, #bang-nguoi-ca, #bang-tau-buon) .nca-mui {
  color: #0b2f47 !important;
  font-weight: 900 !important;
}
html body #bang-bv .bv-dong button {
  min-height: 44px !important;
}
html body #bang-bv .bv-dang-cho {
  color: #0d6d3e !important;
}
html body #bang-bv .bv-nhan {
  color: #095182 !important;
}
html body #bang-dtt .dtt-ds > div,
html body #bang-gca .gca-dong,
html body #bang-gca .gca-qua {
  background: #ffffff !important;
  border: 1.5px solid #c6dfee !important;
  color: var(--tm-chu) !important;
}
html body #bang-dtt .dtt-ds b {
  color: #095182 !important;
}
@media (max-width: 620px) {
  html body #bv-ru {
    top: calc(env(safe-area-inset-top, 0px) + 184px) !important;
  }
}

/* ==== ĐỒNG BỘ ICON MỊN & BỎ PIXELATED TRÊN ICON 96–128PX (02/12) ==== */
html body #nut-tren img,
html body #menu-luoi .ml-o img,
html body.menu-the .mt-n img,
html body.menu-the #mt-ten .mt-ten-bt img,
html body #thanh-cam img,
html body #bang-tui img,
html body #bang-che img,
html body #bang-ht img,
html body #bang-nc img,
html body #bang-st img,
html body #bang-san img,
html body #bang-td img,
html body #bang-kho img,
html body #bang-dn img,
html body #bang-cc img,
html body #bang-tv img,
html body #bang-tvq img,
html body #bang-hc img,
html body #bang-xh img,
html body #bang-tp-cho img,
html body #bang-tp-tiem img,
html body #bang-tp-sap img,
html body #bang-nguoi-ca img,
html body #bang-tau-buon img,
html body #man-ruong img,
html body #the-ca img,
html body .chat-ca img,
html body #nhiem-vu img {
  image-rendering: auto !important;
}
html body #nut-tren .nut-vuong img,
html body #menu-luoi .ml-o img,
html body.menu-the .mt-n img,
html body.menu-the #mt-ten .mt-ten-bt img {
  object-fit: contain;
}
html body .tui-loc button .loc-ic {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}
html body #che-tab button .nh-icon {
  display: grid;
  place-items: center;
}
html body #che-tab button .nh-icon .nh-ic {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

/* ==================== 17. SỬA LỆCH UI ĐỐI CHIẾU V2 (02/12) ==================== */

/* 17a. Chip tụ hội (.th-thu) chữ đậm rõ trên nền sáng + thẻ #th-the banner gọn & ẩn khi Chat/Menu mở */
html body #th-the.th-thu .th-gon,
html body.cam-ung #th-the.th-thu .th-gon {
  color: var(--tm-chu) !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}
html body:has(#chat:not(.an)) #th-the,
html body.menu-the.mt-an-hud #th-the,
html body.dang-lai #th-the:not(.th-thu) {
  display: none !important;
}
@media (orientation: landscape) and (max-height: 480px) {
  html body #th-the:not(.th-thu) {
    top: calc(var(--mt, 8px) + var(--tren, 0px) + 40px) !important;
    width: min(370px, calc(100vw - 260px)) !important;
    padding: 6px 8px 7px 12px !important;
    align-items: center !important;
    gap: 6px !important;
  }
  html body #th-the:not(.th-thu) .th-nd {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 1px 8px !important;
  }
  html body #th-the:not(.th-thu) .th-dau {
    grid-column: 1;
    grid-row: 1;
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html body #th-the:not(.th-thu) :is(.th-phu, .th-ly) {
    grid-column: 1;
    grid-row: 2;
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html body #th-the:not(.th-thu) .th-di {
    grid-column: 2;
    grid-row: 1 / 3;
    margin-top: 0 !important;
    min-height: 44px !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
  html body.cam-ung #th-the:not(.th-thu) .th-x {
    margin: 0 !important;
  }
  html body.cam-ung #th-the.th-thu {
    top: calc(var(--mt, 8px) + var(--tren, 0px) + 42px) !important;
    min-height: 44px !important;
    padding: 0 14px !important;
  }
}

/* 17b. Thanh căng dây câu cá (#cau-giang) không đè cụm nút phải */
html body.cam-ung.dang-giang-ca :is(#lai-nut-cam, #tang-cum, #nut-vong-them, #nut-vong-xay, #dn-thanh .nut-vong:not(#nut-thu-moc)) {
  display: none !important;
}
@media (orientation: landscape) and (max-height: 480px) {
  html body #cau-giang {
    right: calc(12px + var(--phai, 0px)) !important;
    bottom: calc(var(--day, 0px) + 118px) !important;
    width: 152px !important;
  }
  html body.tay-trai #cau-giang {
    right: auto !important;
    left: calc(12px + var(--le, 0px)) !important;
  }
}
@media (orientation: portrait) {
  html body #cau-giang {
    bottom: calc(var(--nc-day, 14px) + var(--nc, 88px) + 22px + var(--day, 0px)) !important;
  }
}

/* 17c. Thông báo (#lan-tb, #thong-bao, #dai-khan): đủ dòng không cắt cụt "..." */
html body #thong-bao .tb-chu {
  white-space: normal !important;
}
html body #lan-tb .tb.lan {
  white-space: normal !important;
  overflow: visible !important;
  border-radius: 18px !important;
  padding: 6px 14px !important;
  line-height: 1.3 !important;
}
html body #lan-tb .lan-chu {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  white-space: normal !important;
  text-align: center;
}
html body #dai-khan {
  background: #7a1118 !important;
  border: 2px solid #ffd54a !important;
  border-radius: 14px !important;
  color: #ffffff !important;
  padding: 5px 12px !important;
  font-size: 12.5px !important;
  line-height: 1.25 !important;
  box-shadow: 0 4px 14px rgba(4, 24, 40, 0.45) !important;
}
html body #dai-khan .tb-chu {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  white-space: normal !important;
}

/* 17d. Phố cảng: bỏ nút vòng cung "Vào" trùng với #nut-chinh và ẩn "Mồi" khi đi bộ trong phố */
html body.cam-ung.tp-nut-chinh-vao #dn-thanh #tp-nut-cua {
  display: none !important;
}
html body.cam-ung.tp-trong-pho #nut-moi {
  display: none !important;
}
html body.cam-ung.tp-che-nhan:not(.kp-anh) canvas#cv {
  -webkit-mask-image: radial-gradient(
    ellipse 225px 160px at calc(100% - var(--phai, 0px) - 34px) calc(100% - var(--day, 0px) - 24px),
    transparent 0%,
    transparent 75%,
    #000 96%
  );
  mask-image: radial-gradient(
    ellipse 225px 160px at calc(100% - var(--phai, 0px) - 34px) calc(100% - var(--day, 0px) - 24px),
    transparent 0%,
    transparent 75%,
    #000 96%
  );
}
@media (orientation: portrait) {
  html body.cam-ung.tp-che-nhan:not(.kp-anh) canvas#cv {
    -webkit-mask-image: radial-gradient(
      ellipse 195px 155px at calc(100% - var(--phai, 0px) - 30px) calc(100% - var(--day, 0px) - 24px),
      transparent 0%,
      transparent 75%,
      #000 96%
    );
    mask-image: radial-gradient(
      ellipse 195px 155px at calc(100% - var(--phai, 0px) - 30px) calc(100% - var(--day, 0px) - 24px),
      transparent 0%,
      transparent 75%,
      #000 96%
    );
  }
}

/* 17e. HUD Boss biển (#bb-thanh), Kraken (.kr-thanh) & Hải thú (.kr-hb): nền sẫm viền vàng kiểu v2, gọn trên 844x390 */
html body :is(#kr-hud .kr-thanh, #kr-hud .kr-hb, #kr-hud .kr-bao, #bb-thanh:not(.thu)) {
  border-image-source: none !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(4, 16, 30, 0.5) !important;
}
html body #bb-thanh:not(.thu) {
  background: linear-gradient(180deg, #4f111b 0%, #2d070e 100%) !important;
  border: 2px solid #ffd54a !important;
  padding: 5px 10px !important;
  color: #ffffff !important;
}
html body #bb-thanh:not(.thu) .bb-ten {
  color: #ffffff !important;
}
html body #bb-thanh:not(.thu) .bb-pha {
  color: #ffe066 !important;
}
html body #bb-thanh:not(.thu) .bb-goi {
  color: #ffdfcf !important;
}
html body #bb-thanh.yeu:not(.thu) .bb-goi {
  color: #ffe66d !important;
  font-weight: 900 !important;
}
html body #kr-hud .kr-thanh {
  background: linear-gradient(180deg, #351552 0%, #1c0a2e 100%) !important;
  border: 2px solid #d59bff !important;
  padding: 5px 10px !important;
  color: #ffffff !important;
}
html body #kr-hud .kr-thanh.bam {
  border-color: #ffb84d !important;
}
html body #kr-hud .kr-hb {
  background: linear-gradient(180deg, #4e1c0c 0%, #2b0e05 100%) !important;
  border: 2px solid #ff9c4a !important;
  padding: 4px 10px 5px !important;
  color: #ffffff !important;
}
html body #kr-hud .kr-bao {
  background: #2f124d !important;
  border: 2px solid #ffd54a !important;
  padding: 5px 10px !important;
  color: #ffffff !important;
}
html body #kr-hud :is(.kr-thanh, .kr-hb, .kr-bao) .kr-dau b,
html body #kr-hud :is(.kr-thanh, .kr-hb, .kr-bao) b {
  color: #ffffff !important;
}
html body #kr-hud :is(.kr-thanh, .kr-hb) :is(.kr-n, .kr-gio, .kr-dot) {
  color: #ffe89e !important;
}
html body #kr-hud .kr-thanh .kr-goi {
  color: #f1e4ff !important;
}
html body #kr-hud .kr-thanh.bam .kr-goi {
  color: #ffd46b !important;
  font-weight: 900 !important;
}
/* Thanh máu HUD Boss & Kraken vẽ bằng mã: vát chéo 2 đầu, vạch chia 5 đoạn, thanh đuổi màu hổ phách, mép đầu sáng */
html body :is(#bb-thanh:not(.thu) .bb-mau, #kr-hud .kr-mau) {
  position: relative;
  height: 14px;
  border: 0 !important;
  border-radius: 2px !important;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: linear-gradient(180deg, #0b1929 0%, #152b42 100%) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 213, 74, 0.38);
  overflow: hidden;
}
html body :is(#bb-thanh:not(.thu) .bb-mau, #kr-hud .kr-mau)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), rgba(6, 14, 24, 0.55) calc(20% - 1px) 20%);
}
html body :is(#bb-thanh:not(.thu) .bb-mau .mau-tre, #kr-hud .kr-mau .mau-tre) {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: linear-gradient(180deg, #ffe29a, #f59e0b);
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.14s;
}
html body :is(#bb-thanh:not(.thu) .bb-mau i, #kr-hud .kr-mau i) {
  position: relative;
  z-index: 2;
  transition: width 0.14s ease-out;
}
html body :is(#bb-thanh:not(.thu) .bb-mau i, #kr-hud .kr-mau i)::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}
html body #bb-thanh:not(.thu) .bb-mau i {
  background: linear-gradient(180deg, #ff9384 0%, #e03131 52%, #9b1622 100%) !important;
}
html body #bb-thanh.che:not(.thu) .bb-mau i {
  background: linear-gradient(180deg, #b8f5ff 0%, #38bdf8 52%, #1d6fa5 100%) !important;
}
html body #kr-hud .kr-mau i {
  background: linear-gradient(180deg, #e0b3ff 0%, #9333ea 52%, #581c87 100%) !important;
}
html body #kr-hud .kr-mau.kr-mat i {
  background: linear-gradient(180deg, #ffd08a 0%, #ea580c 52%, #9a2410 100%) !important;
}
html body :is(#bb-thanh:not(.thu) .bb-mau span, #kr-hud .kr-mau span) {
  z-index: 4;
  font-variant-numeric: tabular-nums;
}
body.giam-cd :is(#bb-thanh .bb-mau .mau-tre, #kr-hud .kr-mau .mau-tre) {
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html body :is(#bb-thanh .bb-mau .mau-tre, #kr-hud .kr-mau .mau-tre) {
    transition: none !important;
  }
}
@media (min-width: 621px) and (max-height: 500px) {
  html body #kr-hud {
    top: calc(env(safe-area-inset-top, 0px) + 42px) !important;
    width: min(316px, calc(100vw - 472px)) !important;
    min-width: 240px !important;
    gap: 3px !important;
  }
  html body #kr-hud.duoi-bb {
    top: calc(env(safe-area-inset-top, 0px) + 96px) !important;
  }
  html body #bb-thanh:not(.thu) {
    top: calc(env(safe-area-inset-top, 0px) + 42px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(316px, calc(100vw - 472px)) !important;
    min-width: 240px !important;
    padding: 4px 8px !important;
  }
  html body #kr-hud .kr-thanh,
  html body #kr-hud .kr-hb {
    padding: 3px 8px 4px !important;
  }
  html body :is(#kr-hud .kr-dau, #bb-thanh:not(.thu) .bb-dau) {
    font-size: 11.5px !important;
    gap: 4px !important;
    line-height: 1.15 !important;
  }
  html body :is(#kr-hud .kr-mau, #bb-thanh:not(.thu) .bb-mau) {
    height: 11px !important;
    margin: 2px 0 !important;
  }
  html body :is(#kr-hud .kr-mau span, #bb-thanh:not(.thu) .bb-mau span) {
    font-size: 9.5px !important;
  }
  html body #kr-hud .kr-xt {
    font-size: 10.5px !important;
    min-height: 0 !important;
    margin: 1px 0 !important;
    line-height: 1.05 !important;
  }
  html body :is(#kr-hud .kr-goi, #bb-thanh:not(.thu) .bb-goi) {
    font-size: 10px !important;
    line-height: 1.15 !important;
    min-height: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* 17f. Bảng Túi đồ (#bang-tui) trên 844x390: lộ >= 2 hàng món + tab lọc thứ 5 sắc nét */
@media (max-height: 500px) and (min-width: 621px) {
  html body.menu-the #bang-tui.bang.lon[data-mt] > .tieu-de.co-mt-dau {
    min-height: 44px !important;
    margin-bottom: 2px !important;
    padding: 0 2px 2px 6px !important;
  }
  html body #bang-tui #kc-goi-tui {
    margin: 0 10px 4px !important;
    padding: 3px 10px !important;
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  html body #bang-tui .than-tui {
    gap: 4px 8px !important;
    padding: 0 8px 4px !important;
  }
  html body #bang-tui .tui-loc {
    gap: 4px !important;
  }
  html body #bang-tui .tui-loc button {
    padding: 0 8px !important;
    font-size: 12px !important;
    gap: 4px !important;
    min-height: 44px !important;
  }
  html body #bang-tui .tui-loc.con-phai {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 12px), transparent) !important;
    mask-image: linear-gradient(90deg, #000 calc(100% - 12px), transparent) !important;
  }
  html body #bang-tui #luoi-tui {
    grid-template-columns: repeat(auto-fill, 62px) !important;
    grid-auto-rows: 62px !important;
    gap: 5px !important;
  }
  html body #bang-tui #luoi-tui .o-tui,
  html body #bang-tui #luoi-tui .cc-o,
  html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui,
  html body #bang-tui #luoi-tui i.o-tui.o-trong {
    width: 62px !important;
    height: 62px !important;
    padding: 3px 3px 5px !important;
    gap: 1px !important;
  }
  html body #bang-tui #luoi-tui .o-tui img {
    width: 28px !important;
    height: 28px !important;
  }
  html body #bang-tui #luoi-tui .o-tui .o-ten {
    font-size: 10.5px !important;
    line-height: 12px !important;
  }
  html body #bang-tui #tui-thanh {
    padding-top: 3px !important;
  }
  html body #bang-tui #tui-thanh .tt-o {
    grid-template-columns: repeat(9, minmax(0, 44px)) !important;
    gap: 3px !important;
  }
}

/* 17g. Menu thẻ: icon đậm nét + pill NẶNG tách khỏi chữ Menu */
html body.menu-the .mt-n img {
  width: 30px !important;
  height: 30px !important;
  filter: drop-shadow(0 1px 1px rgba(4, 37, 58, 0.35));
}
html body.menu-the .mt-n img[src*="cai_dat.png"] {
  filter: brightness(0.75) contrast(1.35) drop-shadow(0 1px 1px rgba(4, 37, 58, 0.35));
}
html body #nut-menu {
  overflow: visible !important;
}
html body #nut-menu .nm-day {
  top: -7px !important;
  left: -6px !important;
  bottom: auto !important;
  transform: none !important;
  max-width: none !important;
  padding: 1px 5px !important;
  border-radius: 999px !important;
  background: #b81d29 !important;
  color: #ffffff !important;
  border: 1.5px solid #ffffff !important;
  font-size: 9px !important;
  line-height: 12px !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 5px rgba(4, 24, 40, 0.45) !important;
  z-index: 4 !important;
}

/* 17h. Khung Chat & Hải đội nhật ký trên nền sáng: màu chữ tương phản >= 4.5:1 */
html body #chat-log p,
html body #bang-hc #hd-chat-log p {
  color: #0b2f47 !important;
}
html body #chat-log b,
html body #bang-hc #hd-chat-log p b {
  color: #08558c !important;
}
html body #bang-hc #hd-chat-log p.toi b {
  color: #8f3e00 !important;
}
html body #chat-log p.he {
  color: #8f3e00 !important;
  text-shadow: none !important;
  font-weight: 700 !important;
}
html body #chat-log p.he b {
  color: #0a588a !important;
}
html body #chat-log p.khoe,
html body #chat-log p.rieng {
  color: #7c1f6e !important;
  font-weight: 700 !important;
}
html body :is(#chat-log, #hd-chat-log) .chat-ca {
  background: #ffffff !important;
  border: 1.5px solid #0d7fb4 !important;
  color: #0b2f47 !important;
}
html body :is(#chat-log, #hd-chat-log) .chat-ca b {
  color: #08558c !important;
}

/* 17i. Thẻ cá (#the-ca): không vệt cuộn & cách thoáng #thanh-cam */
@media (max-height: 480px) {
  html body #the-ca {
    top: calc(env(safe-area-inset-top, 0px) + 42px) !important;
    max-height: calc(100dvh - 122px) !important;
    padding: 9px 12px 10px !important;
    scrollbar-width: none !important;
  }
  html body #the-ca::-webkit-scrollbar {
    display: none;
  }
  html body #the-ca .tc-anh {
    width: 46px !important;
    height: 46px !important;
  }
  html body #the-ca .tc-anh img {
    width: 38px !important;
    height: 38px !important;
  }
  html body #the-ca .tc-ten b {
    font-size: 14.5px !important;
  }
  html body #the-ca .tc-nhans {
    margin-top: 2px !important;
    gap: 3px !important;
  }
  html body #the-ca .tc-nhan {
    font-size: 10.5px !important;
  }
  html body #the-ca .tc-so {
    margin: 4px 0 3px !important;
    gap: 5px !important;
  }
  html body #the-ca .tc-so b {
    font-size: 14.5px !important;
  }
  html body #the-ca .tc-ghi,
  html body #the-ca .tc-hoi {
    margin: 1px 0 3px !important;
    font-size: 11.5px !important;
  }
  html body #the-ca .tc-nut {
    gap: 4px !important;
  }
  html body #the-ca .tc-nut button {
    min-height: 44px !important;
    height: 44px !important;
    padding: 4px 6px !important;
  }
}

/* 17j. Cụm lái + 2 chip khoảng cách (#dn-ve, #tp-ve) đồng bộ Tròn mềm */
html body #hc-thanh .hc-nv em {
  color: #9e1018 !important;
  font-weight: 900 !important;
}
html body #lai-bang #lai-neo .lai-neo-ic {
  filter: brightness(0.16) contrast(1.6) !important;
}
html body #dn-ve,
html body #tp-ve {
  background: #0c314c !important;
  border: 2px solid #ffffff !important;
  border-radius: 14px !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(4, 24, 40, 0.34) !important;
  opacity: 1 !important;
}
html body #dn-ve.xa,
html body #tp-ve.xa {
  border-color: #ffe07a !important;
  color: #ffffff !important;
}
html body #dn-ve i,
html body #tp-ve i {
  color: #ffd84a !important;
}
html body.dn-bi-danh #dn-ve {
  background: #9e1520 !important;
  border-color: #ffe07a !important;
}

/* ==================== 18. SỬA LỆCH UI ĐỐI CHIẾU V2 LẦN 2 (02/12) ==================== */

/* 18a. Tiêu đề hộp thoại (#hop-thoai / .ht-hop): luôn chữ đậm rõ trên nền sáng hop.png */
html body #hop-thoai .bang.ht-hop > .tieu-de,
html body #hop-thoai .bang.ht-hop > .tieu-de :is(span, b, small) {
  color: var(--tm-chu) !important;
  text-shadow: none !important;
}
html body #hop-thoai #tiec-chon .tiec-ten b {
  color: var(--tm-chu) !important;
}
html body #hop-thoai #tiec-chon .tiec-ten small,
html body #hop-thoai #tiec-chon .tiec-so {
  color: var(--tm-chu-phu) !important;
}
html body #hop-thoai #tiec-chon .tiec-dong button {
  min-width: 44px !important;
  min-height: 44px !important;
  background: #ffffff !important;
  border: 2px solid var(--tm-vien-nhat) !important;
  color: var(--tm-chu) !important;
}

/* 18b. Bảng Túi đồ (#bang-tui): tách riêng tên loài & cân nặng cá + không cắt lấp ló hàng 3 / quá tải */
html body #bang-tui #luoi-tui .o-tui:has(.ca-kg),
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui:has(.ca-kg) {
  justify-content: flex-start !important;
  padding: 3px 3px 6px !important;
  gap: 1px !important;
}
html body #bang-tui #luoi-tui .o-tui:has(.ca-kg) img,
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui:has(.ca-kg) img {
  width: 24px !important;
  height: 24px !important;
}
html body #bang-tui #luoi-tui .o-tui .o-ten {
  flex: 0 0 auto;
}
html body #bang-tui #luoi-tui .o-tui .ca-kg,
html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui .ca-kg {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  display: block !important;
  flex: 0 0 auto;
  max-width: 100% !important;
  font-size: 9.5px !important;
  line-height: 11px !important;
  font-weight: 800 !important;
  color: #783000 !important;
  text-shadow: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-tui #kc-goi-tui {
    padding: 3px 8px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  html body #bang-tui #luoi-tui {
    grid-template-columns: repeat(auto-fill, 64px) !important;
    grid-auto-rows: 66px !important;
    gap: 5px !important;
    padding: 2px !important;
    max-height: 141px !important;
    align-self: start !important;
  }
  html body #bang-tui #luoi-tui .o-tui,
  html body #bang-tui #luoi-tui .cc-o,
  html body.cam-ung:not(.tan-thu-som) #bang-tui #luoi-tui .o-tui,
  html body #bang-tui #luoi-tui i.o-tui.o-trong {
    width: 64px !important;
    height: 66px !important;
  }
  html body #bang-tui #tui-thanh {
    align-self: end !important;
  }
}

/* 18c. Dải khẩn (#dai-khan) đủ dòng không cắt "..." & nút Chằng chống đảo >= 44px */
html body #dai-khan {
  padding: 5px 10px !important;
  font-size: 11.5px !important;
  line-height: 1.28 !important;
}
html body #dai-khan .tb-chu {
  display: block !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  overflow: visible !important;
  white-space: normal !important;
}
html body.cam-ung #cot-canh #bd-chang {
  min-height: 44px !important;
  padding: 6px 14px !important;
  opacity: 1 !important;
}
html body #cot-canh #bd-chang:disabled {
  opacity: 1 !important;
  background: #4e3b24 !important;
  color: #f3e4cb !important;
  border-color: #c28e44 !important;
}

/* 18d. Phố cảng: thêm mặt nạ che góc cần điều khiển trái-dưới khỏi lộ nhãn cắt mép trái */
html body.cam-ung.tp-che-nhan:not(.kp-anh) canvas#cv {
  -webkit-mask-image:
    radial-gradient(
      ellipse 225px 160px at calc(100% - var(--phai, 0px) - 34px) calc(100% - var(--day, 0px) - 24px),
      transparent 0%,
      transparent 75%,
      #000 96%
    ),
    radial-gradient(
      ellipse 155px 135px at calc(var(--le, 0px) + 56px) calc(100% - var(--day, 0px) - 52px),
      transparent 0%,
      transparent 76%,
      #000 97%
    );
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(
      ellipse 225px 160px at calc(100% - var(--phai, 0px) - 34px) calc(100% - var(--day, 0px) - 24px),
      transparent 0%,
      transparent 75%,
      #000 96%
    ),
    radial-gradient(
      ellipse 155px 135px at calc(var(--le, 0px) + 56px) calc(100% - var(--day, 0px) - 52px),
      transparent 0%,
      transparent 76%,
      #000 97%
    );
  mask-composite: intersect;
}
@media (orientation: portrait) {
  html body.cam-ung.tp-che-nhan:not(.kp-anh) canvas#cv {
    -webkit-mask-image:
      radial-gradient(
        ellipse 195px 155px at calc(100% - var(--phai, 0px) - 30px) calc(100% - var(--day, 0px) - 24px),
        transparent 0%,
        transparent 75%,
        #000 96%
      ),
      radial-gradient(
        ellipse 140px 130px at calc(var(--le, 0px) + 52px) calc(100% - var(--day, 0px) - 56px),
        transparent 0%,
        transparent 76%,
        #000 97%
      );
    -webkit-mask-composite: source-in;
    mask-image:
      radial-gradient(
        ellipse 195px 155px at calc(100% - var(--phai, 0px) - 30px) calc(100% - var(--day, 0px) - 24px),
        transparent 0%,
        transparent 75%,
        #000 96%
      ),
      radial-gradient(
        ellipse 140px 130px at calc(var(--le, 0px) + 52px) calc(100% - var(--day, 0px) - 56px),
        transparent 0%,
        transparent 76%,
        #000 97%
      );
    mask-composite: intersect;
  }
}

/* 18e. Nút tròn Boss (#bb-thanh.thu) tách khỏi dải icon Tàu buôn mép trái */
html body #bb-thanh.thu {
  left: calc(84px + var(--le, env(safe-area-inset-left, 0px))) !important;
  top: calc(env(safe-area-inset-top, 0px) + 156px) !important;
  width: 52px !important;
  height: 52px !important;
}
@media (max-width: 620px) {
  html body #bb-thanh.thu {
    top: auto !important;
    bottom: calc(var(--day, 0px) + 196px) !important;
    left: calc(84px + var(--le, env(safe-area-inset-left, 0px))) !important;
  }
}

/* ==================== 18f. SỬA LỖI CHƠI THỬ TÂN THỦ NGANG / DỌC (02/12) ==================== */

/* 1. Hộp nhiệm vụ (#nhiem-vu) không bị biến thành ô trắng trống khi body có cả tt-an + toi-gian + nv-an + nv-ngang */
html body.tt-an.toi-gian.nv-an.nv-ngang #nhiem-vu.thu-gon #nv-tom {
  display: -webkit-box !important;
}

/* 2. Menu lưới (#menu-luoi): màn dọc 390px vừa khít 4 cột không cắt cột 4 / không cuộn ngang; màn ngang đủ chỗ 2 dòng */
@media (max-width: 480px) {
  html body #menu-luoi .ml-tam {
    width: 100% !important;
  }
  html body #menu-luoi .ml-than {
    padding: 0 8px 4px !important;
    gap: 2px 0 !important;
    overflow-x: hidden !important;
  }
  html body #menu-luoi .ml-nhom {
    width: 100% !important;
  }
  html body #menu-luoi .ml-luoi {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }
  html body #menu-luoi .ml-o {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 68px !important;
    padding: 5px 3px !important;
    gap: 2px !important;
  }
  html body #menu-luoi .ml-o img {
    width: 28px !important;
    height: 28px !important;
  }
  html body #menu-luoi .ml-o .ml-chu {
    font-size: 22px !important;
    line-height: 28px !important;
    height: 28px !important;
  }
  html body #menu-luoi .ml-o span {
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.18 !important;
    word-break: break-word !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
}
@media (max-height: 500px) {
  html body #menu-luoi .ml-o {
    height: auto !important;
    min-height: 62px !important;
    padding: 4px 3px !important;
  }
}

/* 3. Nút vòng cung (.nut-vong): cho chữ xuống 2 dòng gọn trong nút tròn, hết cắt "Đóng x..." */
html body.cam-ung .nut-vong .nv-i {
  font-size: 15px !important;
  line-height: 1.05 !important;
}
html body.cam-ung .nut-vong .nv-c {
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: 10px !important;
  line-height: 1.08 !important;
  text-align: center !important;
  word-break: break-word !important;
}

/* 4. Dải nhịp câu cá (#tt-nhip) không đè lên tấm cốt truyện (#truyen) ở màn ngang */
html body.co-truyen #tt-nhip {
  top: auto !important;
  bottom: calc(var(--day, 0px) + var(--o-cam, 54px) + 28px) !important;
  font-size: 16px !important;
  padding: 6px 14px !important;
}
html body.co-truyen #tt-nhip.gap {
  font-size: 18px !important;
}

/* 5. Tấm cốt truyện (#truyen) ở điện thoại ngang: xem quy tắc gộp ở mục 19 bên dưới */

/* 6. Bản đồ thế giới (#bang-ban-do): giữ 5 nút công cụ >= 44px trên mọi màn cảm ứng & nút Về tàu thoáng đáy */
@media (max-height: 500px), (max-width: 480px) {
  html body.cam-ung #bang-ban-do #bd-thanh > button {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }
  html body.cam-ung #bang-ban-do #bd-tim input,
  html body.cam-ung #bang-ban-do #bd-tim button {
    height: 44px !important;
    min-height: 44px !important;
  }
  html body.cam-ung #bang-ban-do #bd-loc,
  html body.cam-ung #bang-ban-do #bd-cg {
    top: 54px !important;
  }
  html body.cam-ung #bang-ban-do #bd-loc:not([hidden]) ~ #bd-cg {
    top: 94px !important;
  }
}
html body #bang-ban-do #bd-ve {
  padding: 4px 4px 7px !important;
  line-height: 1.05 !important;
  gap: 1px !important;
}

/* 7. Tạo nhân vật (#man-tao-nv): nút "Ngẫu nhiên" rộng thoáng trên màn ngang */
@media (max-height: 500px) and (min-width: 621px) {
  html body #man-tao-nv .khung-tao {
    grid-template-columns: 248px minmax(0, 1fr) !important;
  }
  html body #man-tao-nv .tnv-ngau {
    font-size: 12.5px !important;
    padding: 0 8px !important;
  }
}

/* 8. Túi đồ (#bang-tui) & Chế tạo (#ds-che): tránh cắt nút cuối ở #chi-tiet và tách chữ khỏi vạch phẩm */
html body #bang-tui #luoi-tui .o-tui[class*="p"] {
  padding-left: 6px !important;
  padding-right: 6px !important;
}
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-tui #chi-tiet {
    padding: 6px 8px !important;
    gap: 3px !important;
  }
  html body #bang-tui #chi-tiet .mo-ta {
    max-height: calc(1.3em * 2) !important;
    line-height: 1.3 !important;
  }
}
@media (min-width: 621px) and (max-height: 640px) {
  html body #bang-tui #chi-tiet {
    padding: 8px 10px !important;
    gap: 5px !important;
  }
  html body #bang-tui #chi-tiet .ct-nguon {
    min-height: 5.2em !important;
    flex: 0 0 auto !important;
  }
  html body #bang-tui #chi-tiet .mo-ta {
    flex: 0 1 auto !important;
  }
}
@media (max-width: 620px) {
  html body #bang-tui #chi-tiet {
    max-height: calc(var(--cao, 100vh) * 0.44) !important;
    padding-bottom: 12px !important;
  }
  html body #bang-tui #chi-tiet .ct-nguon {
    max-height: 4.5em !important;
  }
}
html body #ds-che .dong-che .ten[data-nv-nhan]::after {
  white-space: nowrap !important;
}

/* 9. Thẻ tụ hội (#th-the): ẩn khi đang hiện tấm cốt truyện / Kraken / Boss / lời mời thăm đảo & tách .th-ly xuống hàng 3 không đè .th-phu */
html body.co-truyen #th-the:not(.th-thu),
html body:has(#kr-hud .kr-thanh:not([hidden]), #kr-hud .kr-hb:not([hidden]), #bb-thanh:not([hidden]):not(.thu), #mt-hop:not([hidden])) #th-the:not(.th-thu) {
  display: none !important;
}
@media (orientation: landscape) and (max-height: 480px) {
  html body #th-the:not(.th-thu) .th-ly {
    grid-row: 3 !important;
  }
  html body #th-the:not(.th-thu) .th-di {
    grid-row: 1 / 4 !important;
  }
}

/* ==================== 18g. SỬA LỖI CHƠI THỬ GIỮA GAME (02/12) ==================== */

/* 1. Bảng Kho cần câu (#bang-cc) trên 844x390: bố cục 2 cột ngang để dòng "Tốc độ cuộn" và mọi chỉ số không bị cắt ở đáy */
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-cc .than-cc {
    flex-direction: row !important;
    overflow: hidden !important;
    gap: 10px !important;
    padding: 0 10px 8px !important;
  }
  html body #bang-cc #cc-ds {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  html body #bang-cc #cc-ct {
    width: 312px !important;
    flex: 0 0 312px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    border-top: 0 !important;
    border-left: 1px solid var(--tm-vien-nhat) !important;
    padding: 8px 10px !important;
  }
  html body #bang-cc .cc-dau {
    gap: 8px !important;
    margin-bottom: 4px !important;
  }
  html body #bang-cc .cc-anh {
    width: 48px !important;
    height: 48px !important;
  }
  html body #bang-cc .cc-anh img {
    width: 40px !important;
    height: 40px !important;
  }
  html body #bang-cc .cc-ten {
    font-size: 14px !important;
  }
  html body #bang-cc .cc-ss {
    margin: 2px 0 !important;
  }
  html body #bang-cc .cc-bang {
    gap: 3px !important;
    margin: 3px 0 6px !important;
  }
  html body #bang-cc .cc-cs {
    font-size: 11.5px !important;
    line-height: 1.2 !important;
    gap: 1px 6px !important;
  }
  html body #bang-cc .cc-cs i {
    height: 5px !important;
  }
  html body #bang-cc .cc-mota,
  html body #bang-cc .cc-nguon {
    font-size: 11.5px !important;
    margin-bottom: 4px !important;
  }
}

/* 2. Thanh lọc Túi đồ (#tui-loc) dọc 390x844: ló mép tab thứ 4 và hiện mũi tên › / ‹ rõ ràng khi còn tab khuất */
@media (max-width: 620px) {
  html body #bang-tui .tui-loc {
    position: relative !important;
    gap: 4px !important;
    padding-right: 2px !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  html body #bang-tui .tui-loc button {
    padding: 0 9px !important;
    font-size: 12px !important;
    gap: 4px !important;
    min-height: 44px !important;
  }
  html body #bang-tui .tui-loc.con-phai::after {
    content: '›';
    position: sticky;
    right: 0;
    flex: 0 0 26px;
    height: 44px;
    margin-left: -26px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 4px;
    background: linear-gradient(90deg, rgba(243, 251, 255, 0) 0%, #f3fbff 48%, #f3fbff 100%);
    color: #08558c;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
  }
  html body #bang-tui .tui-loc.con-trai::before {
    content: '‹';
    position: sticky;
    left: 0;
    flex: 0 0 26px;
    height: 44px;
    margin-right: -26px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 4px;
    background: linear-gradient(270deg, rgba(243, 251, 255, 0) 0%, #f3fbff 48%, #f3fbff 100%);
    color: #08558c;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
  }
}

/* 3. Hộp thoại THUYỀN ĐÃ CHÌM (#hc-man-chim): tương phản chữ đậm trên nền sáng & thuyền chìm rõ trên sóng */
html body #hc-man-chim .hc-chim-khung h2 {
  color: #a31824 !important;
  text-shadow: none !important;
}
html body #hc-man-chim .hc-chim-mat,
html body #hc-man-chim .hc-chim-mat span {
  color: #8c1c13 !important;
}
html body #hc-man-chim .hc-chim-hinh {
  height: 48px !important;
  margin-bottom: 4px !important;
}
@keyframes tmHcChim {
  0% { transform: translate(-50%, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, 4px) rotate(-22deg); opacity: 0.96; }
}
html body #hc-man-chim .hc-chim-hinh i {
  font-size: 28px !important;
  z-index: 2 !important;
  animation: tmHcChim 1.8s ease-out forwards !important;
}

/* 4. Hai chip dẫn đường trên HUD (#dn-ve, #tp-ve) & chip Việc kế (#vk-chip): đạt chuẩn chạm >= 44px trên màn cảm ứng (giữ nguyên display gốc để không đè rule ẩn theo trạng thái) */
html body.cam-ung #dn-ve:not([hidden]),
html body.cam-ung #tp-ve:not([hidden]),
html body.cam-ung #vk-chip:not([hidden]) {
  min-height: 44px !important;
  padding: 6px 12px !important;
  align-items: center !important;
  gap: 5px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

/* 5. (#th-the khi có #kr-hud / #bb-thanh đã gộp vào mục 18f.9) */

/* 6. Bảng Quà mỗi ngày (#bang-qua-ngay): số lượng "×n" không đè lên tên vật phẩm, 3 cột thoáng trên ngang & dọc */
html body #bang-qua-ngay .qn-luoi {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
html body #bang-qua-ngay .qn-o .mb-qua {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
html body #bang-qua-ngay .qn-o .mb-qua img {
  flex: 0 0 auto !important;
}
html body #bang-qua-ngay .qn-o .mb-qua i {
  font-style: normal !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* 7. Đảo nhà (#bang-dn), Thuyền (#bang-nc) & Mùa giải (#bang-hc) trên 844x390: không cắt nửa nút/tiêu đề ở đáy khung */
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-dn .dn-the {
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
  }
  html body #bang-dn .dn-the h4 {
    margin-bottom: 4px !important;
  }
  html body #bang-dn .dn-the p {
    margin: 3px 0 6px !important;
  }
  html body #bang-dn .dn-hang {
    gap: 6px !important;
  }
  html body #bang-hc .mg-dau-hang {
    margin-bottom: 4px !important;
  }
  html body #bang-hc .mg-luoi {
    gap: 5px !important;
    margin-bottom: 6px !important;
  }
  html body #bang-hc .mg-the {
    padding: 5px 8px !important;
    min-height: 46px !important;
  }
  html body #bang-hc .hc-khoi {
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
  }
}

/* 8. Thẻ tụ hội (#th-the) trên màn dọc <= 620px: chừa khoảng bên phải cho chip dẫn đường (#tp-ve / #dn-ve), không bị đè nút đóng X */
@media (max-width: 620px) {
  html body #th-the:not(.th-thu) {
    left: calc(10px + var(--le, env(safe-area-inset-left, 0px))) !important;
    transform: none !important;
    width: calc(100vw - 88px - var(--le, 0px) - var(--phai, 0px)) !important;
  }
}

/* ==================== 19. SỬA LỖI ĐA NGÔN NGỮ EN / ZH TRÊN ĐIỆN THOẠI (02/12) ==================== */

/* 1. Tạo nhân vật: dịch nhãn nút màu tóc gốc (ghi đè content: "Gốc" ở style.css) */
html[lang="en"] body .tnv-mau button.goc::after {
  content: "Base" !important;
}
html[lang="zh-CN"] body .tnv-mau button.goc::after {
  content: "原色" !important;
}

/* 2. Liên kết pháp lý ở Sảnh & Cài đặt → Tài khoản: đạt chuẩn vùng chạm >= 44px trên cảm ứng */
html body.cam-ung #dang-nhap .sanh-chan a,
html body.cam-ung #dang-nhap .sanh-pl a,
html body.cam-ung #bang-caidat #cd-chinh-sach small a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}
html body #sanh-lop .tieu-de {
  overflow: hidden !important;
}
html body #sanh-lop .tieu-de #sanh-tieu {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 3. HUD tân thủ: tách #truyen khỏi #nhiem-vu trên 844x390, tăng tương phản .tr-tiep & không cắt dòng #nv-tom */
html body #truyen .tr-tiep {
  color: #4f2c04 !important;
  padding-bottom: 4px !important;
}
html body #truyen.tr-dem::after {
  bottom: 2px !important;
  background: rgba(138, 90, 30, 0.32) !important;
}
html body.tt-an #nhiem-vu.thu-gon #nv-dau,
html body.cam-ung #nhiem-vu.thu-gon #nv-dau {
  height: auto !important;
  min-height: 44px !important;
  padding: 6px 12px !important;
  overflow: visible !important;
}
html body.tt-an #nhiem-vu.thu-gon #nv-tom {
  -webkit-line-clamp: 2 !important;
  line-height: 1.3 !important;
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
}
@media (orientation: landscape) and (max-height: 520px) {
  html body.cam-ung.co-truyen #cot-trai {
    width: min(320px, 38vw) !important;
  }
  html body.cam-ung #truyen,
  html body.cam-ung.tt-m7 #truyen,
  html body.cam-ung:not(.tt-an) #truyen {
    left: auto !important;
    right: calc(var(--mep, 8px) + var(--phai, 0px) + 144px) !important;
    width: min(350px, calc(100vw - 486px - var(--le, 0px) - var(--phai, 0px))) !important;
    min-width: 240px !important;
    max-height: 152px !important;
    padding: 8px 18px 10px 34px !important;
  }
}

/* 4. Nút #nut-menu trên ngôn ngữ ngoài vi: co chữ gọn vừa khung không tràn */
html:not([lang="vi"]) body #nut-menu span {
  font-size: 10.5px !important;
  line-height: 1.05 !important;
}

/* 5. Túi đồ (#bang-tui): tương phản nhãn phẩm thường (Common/白), tên 2 dòng gọn trên EN, giữ khung HOW TO GET */
html body #bang-tui #chi-tiet .ct-pham.p0 {
  color: #3a5a70 !important;
  font-weight: 800 !important;
}
html[lang="en"] body #bang-tui #luoi-tui .o-tui .o-ten {
  font-size: 9.5px !important;
  line-height: 1.1 !important;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  word-break: break-word !important;
  text-align: center !important;
  max-height: 22px !important;
}
html[lang="en"] body.cam-ung #bang-tui #luoi-tui .o-tui {
  height: 68px !important;
}
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-tui #chi-tiet img.to {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px !important;
  }
  html body #bang-tui #chi-tiet .ct-goi {
    padding: 3px 6px !important;
    font-size: 11.5px !important;
  }
  html body #bang-tui #chi-tiet .ct-nguon {
    min-height: 2.8em !important;
    max-height: 4.5em !important;
  }
}

/* ==================== 20. SỬA LỖI TÍNH NĂNG ÍT DÙNG (02/12) ==================== */

/* 1. Hộp lời mời thăm đảo (#mt-hop): chuyển sang skin sáng hop.png, nút >= 44px ở mọi khổ, tương phản >= 4.5:1, tránh đè #th-the */
html body #mt-hop {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/hop.png') !important;
  border-image-slice: 55 63 58 63 fill !important;
  border-image-width: 20px 22px 22px 22px !important;
  border-image-repeat: stretch !important;
  padding: 14px 18px 16px !important;
  color: var(--tm-chu) !important;
}
html body #mt-hop .nd {
  color: var(--tm-chu) !important;
}
html body #mt-hop .phu,
html body #mt-hop .them {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body #mt-hop .thanh {
  background: #cfe5f3 !important;
}
html body #mt-hop .thanh i {
  background: #d97706 !important;
}
html body #mt-hop .nut button,
html body.cam-ung #mt-hop .nut button {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 14px 18px 14px 18px !important;
  border-image-repeat: stretch !important;
  color: #031d2e !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 14px !important;
}
html body #mt-hop .nut button.chinh,
html body.cam-ung #mt-hop .nut button.chinh {
  border-image-source: url('/anh/skin/tron_mem/nut_chinh.png') !important;
  border-image-slice: 44 66 41 66 fill !important;
  border-image-width: 15px 20px 15px 20px !important;
  border-image-repeat: stretch !important;
  color: #1b1300 !important;
}
@media (orientation: landscape) and (max-height: 500px) {
  html body #mt-hop {
    top: calc(var(--tren, 0px) + 4px) !important;
    padding: 10px 16px 12px !important;
  }
  html body #mt-hop .nut button {
    min-height: 44px !important;
  }
}
/* (#th-the khi có #mt-hop đã gộp vào mục 18f.9) */

/* 2. Bảng tập mở khoá rương (#cd-khoa): căn giữa không vượt mép trên màn ngang, tiêu đề tương phản rõ */
html body #cd-khoa {
  top: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  max-height: calc(100dvh - 16px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
html body #cd-khoa > .tieu-de {
  min-height: 46px !important;
  padding: 0 4px 2px 8px !important;
  align-items: center !important;
  color: #ffffff !important;
}
html body #cd-khoa #ck-tt {
  color: var(--tm-chu) !important;
  margin-top: 4px !important;
}
html body #cd-khoa #ck-bao.tot { color: #0d6d3e !important; }
html body #cd-khoa #ck-bao.loi { color: #a31824 !important; }
html body #cd-khoa #ck-bao.he { color: #8c3b00 !important; }
@media (max-height: 500px) {
  html body #cd-khoa #ck-ongs {
    padding: 6px 10px 4px !important;
  }
  html body #cd-khoa .ck-ong {
    height: 108px !important;
  }
  html body #cd-khoa #ck-day {
    min-height: 48px !important;
  }
}

/* 3. Bảng Lễ Đường Hải Đăng (#bang-kh-le) & thanh / thiệp mời lễ cưới */
html body #bang-kh-le .tp-loi,
html body #bang-kh-le .tp-loi b,
html body #bang-kh-le .kh-le-hang,
html body #bang-kh-le .kh-le-hang small,
html body #bang-kh-le .kh-le-dang,
html body #bang-kh-le .kh-le-dang small {
  color: var(--tm-chu) !important;
  opacity: 1 !important;
}
html body #bang-kh-le .kh-le-nut button:not(.chinh) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 14px 18px 14px 18px !important;
  border-image-repeat: stretch !important;
  color: #031d2e !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 14px !important;
}
html body #bang-kh-le .kh-le-nut button.chinh {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_chinh.png') !important;
  border-image-slice: 44 66 41 66 fill !important;
  border-image-width: 15px 20px 15px 20px !important;
  border-image-repeat: stretch !important;
  color: #1b1300 !important;
  font-weight: 900 !important;
  min-height: 44px !important;
  padding: 6px 16px !important;
}

/* 4. Hòm thư (#bang-xh) & Hồ sơ người chơi (#ho-so): sửa chữ sáng khó đọc trên nền trắng */
html body #bang-xh .xh-giua a,
html body #bang-xh .nho-mo a {
  color: #095182 !important;
  font-weight: 800 !important;
}
html body #ho-so .hs-on {
  color: #0d6d3e !important;
  font-weight: 800 !important;
}
html body #ho-so .hs-pt {
  color: #095182 !important;
  font-weight: 800 !important;
}
html body #ho-so .hs-tp {
  color: #8c3b00 !important;
  text-shadow: none !important;
}
html body #ho-so .hs-tp-cu {
  color: var(--tm-chu-phu) !important;
}
html body #ho-so :is(.dth-dau b, .dth-dx, .dth-ht-dau, .dth-ht-moc, .dth-ngung) {
  color: #8c3b00 !important;
}
html body #ho-so :is(.dth-dau span, .dth-ng, .dth-ng b, .dth-gop, .dth-mq) {
  color: var(--tm-chu-phu) !important;
}
html body #ho-so :is(.dth-ng.xong, .dth-ng.xong b, .dth-gop.xong, .dth-mq.co) {
  color: #0d6d3e !important;
}
html body #ho-so .dth-ht-ds span,
html body #ho-so .dth-mq {
  background: #eef7fd !important;
  border-color: #9ac5df !important;
  color: var(--tm-chu) !important;
}
html body #ho-so .dth-cham {
  color: #b86b00 !important;
}
html body #ho-so .dth-cham i {
  color: #a7c0d1 !important;
}

/* 5. Tháp khoan dầu (#bang-gd) & Trạm điện (#bang-dien): tiêu đề thẻ và chữ phụ đậm rõ */
html body :is(#bang-gd, #bang-dien) .mk-dong > b {
  color: #8c3b00 !important;
}
html body :is(#bang-gd, #bang-mk, #bang-dien) .mk-dong > b small,
html body :is(#bang-gd, #bang-mk, #bang-dien) .mk-tho-ten small {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}
html body :is(#bang-gd, #bang-mk, #bang-dien) .mk-tho {
  background: #f2f9fd !important;
  border-color: #c6dfee !important;
  color: var(--tm-chu) !important;
}

/* 6. Liên kết Quyền riêng tư trong Cài đặt (#bang-caidat) */
html body #bang-caidat a,
html body #bang-caidat #cd-chinh-sach small a {
  color: #095182 !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
}

/* 7. Cờ caro (#bang-caro): màu người chơi O & dòng xác nhận nước đi đậm rõ */
html body #bang-caro .caro-ng .caro-oo {
  color: #095182 !important;
}
html body #bang-caro .caro-xn {
  color: var(--tm-chu) !important;
  font-weight: 700 !important;
  min-height: 44px !important;
}
html body #bang-caro #caro-giay {
  color: #8c3b00 !important;
}

/* 8. Menu ô đảo (#ds-menu): nút × không đè dòng đầu & nút Bể cá >= 44px skin sáng */
html body #ds-menu {
  padding: 12px 54px 14px 14px !important;
}
html body #ds-menu .ds-x {
  position: absolute !important;
  float: none !important;
  top: 8px !important;
  right: 8px !important;
  margin: 0 !important;
}
html body #ds-menu :is(.be-dong button, .be-tha button) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_phu.png') !important;
  border-image-slice: 40 65 41 66 fill !important;
  border-image-width: 12px 16px 12px 16px !important;
  border-image-repeat: stretch !important;
  color: #031d2e !important;
  font-weight: 800 !important;
  min-height: 44px !important;
  padding: 6px 12px !important;
}
html body #ds-menu .be-ten small {
  color: var(--tm-chu-phu) !important;
  opacity: 1 !important;
}

/* 9. Thuyền viên (#bang-tv): nút đang chọn trong nhóm Bắn cá mập / giao nghề nổi bật rõ */
html body #bang-tv :is(.tv-nghe button.chon, .tv-hang button.chon) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/nut_chinh.png') !important;
  border-image-slice: 44 66 41 66 fill !important;
  border-image-width: 15px 20px 15px 20px !important;
  border-image-repeat: stretch !important;
  color: #1b1300 !important;
}

/* 10. Xếp hạng chung (#bang-hc, #bang-xh) tab rộng >= 48px, Góp ý (#bang-gy) & nút HUD >= 44px */
html body :is(#bang-hc, #bang-xh) .xh-loai button {
  min-width: 48px !important;
  min-height: 44px !important;
}
html body #bang-gy .gy-tick {
  min-height: 44px !important;
  color: var(--tm-chu) !important;
  font-weight: 700 !important;
}
html body #bang-gy #gy-xem {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  background: #e9f5fd !important;
  border: 2px solid #9ac5df !important;
}
html body.cam-ung #ph-thanh-nd {
  min-height: 44px !important;
  padding: 6px 12px !important;
}
html body.cam-ung :is(#tham-thanh button, #tc-thanh button, #cd-dai button, #kh-le-thanh button, #kh-le-moi button, .th-cua button, .th-dong button, #kc-khoa button) {
  min-height: 44px !important;
  min-width: 44px !important;
}
html body #cd-chip:not([hidden]) {
  min-height: 44px !important;
  display: inline-flex;
  align-items: center !important;
}

/* ===== 21. iOS / iPadOS (Safari, mọi trình duyệt WebKit iOS): NỀN DỰ PHÒNG dưới khung ảnh bang.png / hop.png (02/12) =====
   Chủ game (iPad): bảng Quà mỗi ngày trong suốt — mất cả nền trắng lẫn dải tiêu đề xanh (cả hai nằm trong ảnh viền 9 mảnh border-image),
   chữ + ô bên trong vẫn hiện. Chrome không tái hiện được.
   Sửa lượt 7: vẽ 2 lớp background (dải tiêu đề xanh ở trên + nền sáng) NGAY TRÊN KHUNG CHA (vẽ DƯỚI border-image) thay vì tô lên > .tieu-de
   (trước đó > .tieu-de vẽ ĐÈ lên góc bo tròn của bang.png!). Đồng thời phủ cả #dang-nhap .sanh-the và nhóm popup 16b (hop.png).
   html.thu-ios: bật tay trên Chrome để soát (kèm tắt border-image-source để giả lỗi). */
@supports (-webkit-touch-callout: none) {
  html body :is(
  #bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat,
  #bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #menu-luoi .ml-tam,
  #bang-kho, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tdo, #chat,
  #dang-nhap .sanh-the, #tnv-form, #bang-tv, #bang-tvq, #bang-cc, #bang-bv, #bang-moi,
  #bang-dt, #bang-cgm, #bang-gy, #bang-hdn, #bang-tk, #bang-cd, #cd-khoa, #cd-bc,
  #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong,
  #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-kp-dan, #bang-kh-le, #bang-pk-ln,
  #bang-pk-moi, #bang-pk-viec, #bang-pk-do, #bang-td, #bang-td-gan, #bang-ln, #bang-mk,
  #bang-dien, #bang-gd, #bang-rd, #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt
  ) {
    background:
      linear-gradient(180deg, #15669c 0%, #0e4c78 100%) center 5px / calc(100% - 12px) 44px no-repeat,
      linear-gradient(180deg, #fffdf6 0%, #f1f9ff 100%) center / calc(100% - 8px) calc(100% - 8px) no-repeat !important;
    background-origin: border-box !important;
    border-radius: 22px !important;
  }
  html body :is(
  #hop-thoai .ht-hop, #man-ruong .khung-ruong, #man-chet .khung-dn, #the-vat .tv-hop, #mt-hang,
  #tk-ma .tk-ma-hop, #man-kp .kp-hop, #hc-man-chim .hc-chim-khung, #mg-man-kq .mg-kq-khung,
  #man-xoay .xoay-khung, #kr-the, #bb-the, #kb-the, #ptt-the, #mua-the, #trang-the, #the-nguoi, #the-ca, #ban-tin, #gio-tuan-the,
  #bd-the, #bd-cg, #hop-moi, #truyen, #moi-the, #td-moi-hop, .the-nhac, .caro-moi-the, #dtac-moi,
  .bv-ru, #kh-le-moi
  ) {
    background: linear-gradient(180deg, #fffdf6 0%, #f1f9ff 100%) center / calc(100% - 8px) calc(100% - 8px) no-repeat !important;
    background-origin: border-box !important;
    border-radius: 18px !important;
  }
}
html.thu-ios body :is(
  #bang-tui, #bang-che, #bang-na, #bang-dn, #bang-san, #bang-tau-buon, #bang-caidat,
  #bang-ht, #bang-st, #bang-qua-ngay, #bang-ban-do, #bang-chuong, #menu-luoi .ml-tam,
  #bang-kho, #bang-nc, #bang-xt, #bang-hc, #bang-xh, #ho-so, #bang-tdo, #chat,
  #dang-nhap .sanh-the, #tnv-form, #bang-tv, #bang-tvq, #bang-cc, #bang-bv, #bang-moi,
  #bang-dt, #bang-cgm, #bang-gy, #bang-hdn, #bang-tk, #bang-cd, #cd-khoa, #cd-bc,
  #ph-bao-cao, #bang-caro, #bang-dtt, #bang-gca, #bang-tp-cho, #bang-tp-sap, #bang-tp-xuong,
  #bang-tp-tiem, #bang-tp-chi-dan, #bang-vcg, #bang-kp-dan, #bang-kh-le, #bang-pk-ln,
  #bang-pk-moi, #bang-pk-viec, #bang-pk-do, #bang-td, #bang-td-gan, #bang-ln, #bang-mk,
  #bang-dien, #bang-gd, #bang-rd, #bang-ctr, #bang-dc, #bang-ttr, #bang-nguoi-ca, #tl-hop, #bang-qt
) {
  background:
    linear-gradient(180deg, #15669c 0%, #0e4c78 100%) center 5px / calc(100% - 12px) 44px no-repeat,
    linear-gradient(180deg, #fffdf6 0%, #f1f9ff 100%) center / calc(100% - 8px) calc(100% - 8px) no-repeat !important;
  background-origin: border-box !important;
  border-radius: 22px !important;
}
html.thu-ios body :is(
  #hop-thoai .ht-hop, #man-ruong .khung-ruong, #man-chet .khung-dn, #the-vat .tv-hop, #mt-hang,
  #tk-ma .tk-ma-hop, #man-kp .kp-hop, #hc-man-chim .hc-chim-khung, #mg-man-kq .mg-kq-khung,
  #man-xoay .xoay-khung, #kr-the, #bb-the, #kb-the, #ptt-the, #mua-the, #trang-the, #the-nguoi, #the-ca, #ban-tin, #gio-tuan-the,
  #bd-the, #bd-cg, #hop-moi, #truyen, #moi-the, #td-moi-hop, .the-nhac, .caro-moi-the, #dtac-moi,
  .bv-ru, #kh-le-moi
) {
  background: linear-gradient(180deg, #fffdf6 0%, #f1f9ff 100%) center / calc(100% - 8px) calc(100% - 8px) no-repeat !important;
  background-origin: border-box !important;
  border-radius: 18px !important;
}

/* ===== 22. CÀI ĐẶT TUỲ BIẾN MOBILE + CHỈ ĐƯỜNG MÉP MÀN + NHÃN CẢNH 3D (02/12) ===== */
/* Khoá nền đặc 100% cho HUD và ẩn hàng "Độ rõ giao diện" cũ */
html body #hud {
  opacity: 1 !important;
}
html body #bang-caidat .cd-hang:has(#cd-mo) {
  display: none !important;
}

/* Cỡ nút thao tác 80% – 130% (--co-nut từ cai_dat_mobile.ts) */
body {
  --co-nut: 1;
}
html body.cam-ung {
  --nut: max(44px, calc(44px * var(--hud, 1) * var(--co-nut, 1)));
  --nc: clamp(72px, calc(96px * var(--hud, 1) * var(--co-nut, 1)), 132px);
  --vc: clamp(44px, calc(54px * var(--hud, 1) * var(--co-nut, 1)), 74px);
}
@media (max-width: 620px) {
  html body.cam-ung {
    --nut: max(44px, calc(42px * var(--hud, 1) * min(var(--co-nut, 1), 1.15)));
    --nc: clamp(72px, calc(90px * var(--hud, 1) * var(--co-nut, 1)), 120px);
    --vc: clamp(44px, calc(52px * var(--hud, 1) * var(--co-nut, 1)), 68px);
  }
}
@media (max-height: 500px) and (min-width: 621px) {
  html body.cam-ung {
    --nut: max(44px, calc(42px * var(--hud, 1) * min(var(--co-nut, 1), 1.18)));
    --menu: max(46px, calc(48px * var(--hud, 1) * min(var(--co-nut, 1), 1.18)));
    --nc: clamp(68px, calc(86px * var(--hud, 1) * var(--co-nut, 1)), 114px);
    --vc: clamp(44px, calc(50px * var(--hud, 1) * var(--co-nut, 1)), 66px);
  }
}
html body.cam-ung #nut-chinh #nut-chinh-chu {
  font-size: clamp(13px, calc(15px * var(--hud, 1) * var(--co-nut, 1)), 20px);
}
html body.cam-ung #lai-nut-cam {
  min-height: max(44px, calc(46px * var(--co-nut, 1))) !important;
  min-width: max(44px, calc(108px * var(--co-nut, 1)));
}
html body.cam-ung .lai-nut {
  min-width: max(44px, calc(52px * var(--hud, 1) * var(--co-nut, 1))) !important;
  min-height: max(44px, calc(48px * var(--hud, 1) * var(--co-nut, 1))) !important;
}
html body.cam-ung #nut-tren > .nut-vuong {
  min-width: 44px;
  min-height: 44px;
}

/* Hàng cài đặt mobile trong #bang-caidat */
html body #bang-caidat .cd-gia-tri {
  color: #0b5c8e !important;
  font-weight: 900;
  margin-left: 6px;
}
html body #bang-caidat .cd-bo-truot {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
}
html body #bang-caidat .cd-bo-truot input[type="range"] {
  flex: 1 1 auto;
  min-width: 90px;
  height: 44px !important;
}
html body #bang-caidat .cd-bo-truot .cd-nut {
  min-width: 44px !important;
  min-height: 44px !important;
  width: 44px !important;
  padding: 0 !important;
  flex-shrink: 0;
}
html body #bang-caidat .cd-bo-truot .cd-chu {
  min-height: 44px !important;
  padding: 0 12px !important;
  white-space: nowrap;
  flex-shrink: 0;
}
html body #bang-caidat #cd-nhan-canh {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
html body #bang-caidat #cd-nhan-canh button {
  flex: 1 1 auto;
  min-height: 44px !important;
}

/* Mũi tên chỉ đường mép màn hình (#cdm-lop / .cdm-mui) */
#cdm-lop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-duoi-hud, 15);
}
#cdm-lop[hidden] {
  display: none !important;
}
.cdm-mui {
  position: fixed;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid #04253a;
  box-shadow: 0 3px 10px rgba(4, 24, 40, 0.34);
  color: #0b2f47;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}
.cdm-mui[hidden] {
  display: none !important;
}
.cdm-mui .cdm-ten {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0c314c;
  color: #ffd84a;
  font-size: 11px;
  font-style: normal;
  flex-shrink: 0;
}
.cdm-mui .cdm-bieu {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.cdm-mui .cdm-chu {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.cdm-mui .cdm-nhan {
  color: #0b2f47;
  font-weight: 800;
  font-size: 12px;
}
.cdm-mui .cdm-kc {
  color: #0a5b94;
  font-weight: 900;
  font-size: 11.5px;
}
.cdm-mui[data-mau="vang"] {
  border-color: #9e4b00;
}
.cdm-mui[data-mau="vang"] .cdm-ten {
  background: #9e4b00;
  color: #ffffff;
}
.cdm-mui[data-mau="ngoc"] {
  border-color: #096594;
}
.cdm-mui[data-mau="ngoc"] .cdm-ten {
  background: #096594;
  color: #ffffff;
}
.cdm-mui[data-mau="xanh"] {
  border-color: #0b6a3c;
}
.cdm-mui[data-mau="xanh"] .cdm-ten {
  background: #0b6a3c;
  color: #ffffff;
}
.cdm-mui[data-mau="bien"] {
  border-color: #0e4c78;
}
.cdm-mui[data-mau="bien"] .cdm-ten {
  background: #0e4c78;
  color: #ffffff;
}
.cdm-mui[data-mau="do"] {
  border-color: #9e1520;
}
.cdm-mui[data-mau="do"] .cdm-ten {
  background: #c81e2b;
  color: #ffffff;
}
.cdm-mui[data-mau="tim"] {
  border-color: #5b268c;
}
.cdm-mui[data-mau="tim"] .cdm-ten {
  background: #6b2ca8;
  color: #ffffff;
}
.cdm-mui.thu-gon {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
.cdm-mui.thu-gon .cdm-chu {
  display: none;
}
.cdm-mui.thu-gon .cdm-ten {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  font-size: 9px;
  border: 1.5px solid #ffffff;
}

/* Chấm mép cho các nhãn cảnh 3D vượt trần 3 nhãn */
#nc-lop-cham-mep {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}
#nc-lop-cham-mep.an {
  display: none !important;
}
.nc-cham-mep {
  position: fixed;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #04253a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.nc-cham-mep.an {
  display: none !important;
}
.nc-cham-mep[data-mau="vang"] {
  background: #ffd84a;
}
.nc-cham-mep[data-mau="ngoc"] {
  background: #5fd4ff;
}
.nc-cham-mep[data-mau="xanh"] {
  background: #6fffb0;
}
.nc-cham-mep[data-mau="tim"] {
  background: #d8a6ff;
}

/* ===== 23. UNSLOP POLISH — SPACING, TYPE, NUMBERS, RADIUS, MOTION (02/12) =====
   Chế độ Polish (unslop @heydamir, CC BY 4.0): giữ nguyên skin Tròn mềm, màu, font, hình nút 9 mảnh,
   nút >= 44 px và tương phản >= 4.5:1; chuẩn hoá lưới 4 px, bỏ in hoa giãn chữ, bật tabular-nums,
   sửa bo góc lồng nhau + viền vuông + vệt trống chat, tắt nhấp nháy/glow vô cớ. */

/* --- 23a. Chữ thường câu, bỏ giãn chữ tiêu đề phụ & chữ nghiêng chú thích --- */
html body :is(
  #menu-luoi .ml-nhom h3,
  #bang-tui #chi-tiet .ct-nguon-dau,
  #the-vat .tv-nguon-dau,
  #bang-tui #tui-thanh .tt-ten,
  #bang-nc .nc-nhan,
  #bang-nc .nc-muc,
  #bang-qua-ngay .xh-muc,
  #bang-xh .xh-muc,
  #bang-ban-do .bd-muc,
  #bang-ht .str-nhanh h4,
  #bang-san .gt-muc,
  #bang-tp-cho .tp-nhom
) {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}
html body #bang-ht .str-nhanh h4 {
  font-size: 13px !important;
}
html body :is(
  #menu-luoi .ml-dau,
  #bang-ch > .tieu-de,
  .bang.lon > .tieu-de,
  .bang.lon > .tieu-de > span:first-child,
  body.menu-the #mt-ten .mt-ten-chu
) {
  text-transform: none !important;
  letter-spacing: 0.01em !important;
}
html body.menu-the #mt-ten .mt-ten-chu,
html body #menu-luoi .ml-dau {
  text-shadow: 0 1px 2px rgba(4, 37, 58, 0.45) !important;
}
html body.cam-ung .nut-vong .nv-c,
html body.menu-the #mt-hang .mt-n span {
  letter-spacing: 0 !important;
}
html body :is(.ct-nguon-trong, .che-nl-cho, .tv-cho) {
  font-style: normal !important;
}

/* --- 23b. Đồng nhất định dạng số liệu (tabular-nums) --- */
html body :is(
  #dst, #cap-be, #online, #bdn-toc, #dn-ve, #tp-ve, .cdm-mui .cdm-kc, #dh-ngay, #dh-mua, #nhiem-vu #nv-tom,
  #bang-tui > .tieu-de small, #bang-tui .tui-loc button em, #bang-tui .o-tui .so, #bang-tui .o-cam .so,
  #bang-tui #chi-tiet .ct-phu b, #bang-tui .ct-tl li b, #bang-tui .cu-ben-ct span,
  #che-tab button i, #ds-che .dong-che .can > span, #ds-che .dong-che .che-nl-so, #ds-che .dong-che .ten small,
  #bang-dn .dn-so b, #bang-dn .dn-can b, #bang-dn .dn-thanh b, #bang-dn .dn-gio, #bang-dn .dn-ss-o small,
  #bang-dn .dn-ct small, #bang-dn .dn-hinh b,
  #bang-nc .nc-li b, #bang-nc .nc-can b, #bang-nc .nc-thanh em, #bang-nc #nc-con, #bang-nc .nc-nut button small,
  #bang-ht .dong-nv .thuong, #bang-ht .pt-hom, #bang-ht .pt-qua, #bang-ht .pt-khoa, #bang-ht .pt-nguon,
  #bang-qua-ngay .qn-dong, #bang-qua-ngay .qn-o-dau b, #bang-qua-ngay .mb-qua, #bang-qua-ngay .mb-tien, #bang-qua-ngay .mb-tong > b,
  #bang-caidat #cd-so, #bang-caidat #cd-mo-so, #bang-caidat .cd-gia-tri,
  #bang-ch .ch-the b, #bang-ch .ch-ten b, #bang-ch .ch-buoc-dau span, #bang-ch .ch-buoc-dau small,
  #bang-ch .ch-nl i, #bang-ch .ch-hq, .o-tui .ch-n,
  #khihau-the .kh-muc > span, #khihau-the .kh-muc ul b, #mua-the > span, #trang-the > span,
  #xtt-chip, #ptt-hud .ptt-mau span, #ptt-hud .ptt-goi, #ptt-hud .ptt-toi,
  #ptt-the .ptt-the-dong, #ptt-the .ptt-the-ds, #lan-chip, #lan-hud .lan-day,
  #chat .nr-hang1 small, #chat .nr-bong time, #chat .nr-so
) {
  font-variant-numeric: tabular-nums !important;
}
html body #bang-qua-ngay .qn-o .mb-qua {
  font-weight: 700 !important;
}

/* --- 23c. Sửa viền vuông lòi ra, vệt trống Chat, và bo góc lồng nhau (nested radius) --- */
html body #bang-nc #than-nc .nc-thang .nc-bac {
  border-radius: 12px !important;
}
html body #bang-nc #than-nc .nc-thang .nc-bac.nay {
  box-shadow: 0 0 0 2.5px #0d89bf !important;
}
html body #bang-nc #than-nc .nc-thang .nc-bac.xem,
html body #bang-nc #than-nc .nc-thang .nc-bac.nay.xem,
html body #bang-st .sc-o.chon,
html body #bang-st .sc-o.chua.chon {
  outline: none !important;
  box-shadow: 0 0 0 2.5px #c24a02 !important;
}
html body #chat-log:not(:has(> p)) {
  display: none !important;
}

html body #bang-tui #chi-tiet {
  border-radius: 16px !important;
}
html body #bang-tui #chi-tiet :is(img.to, .ct-nguon, .ct-goi, .ct-tl, .hang-nut button) {
  border-radius: 8px !important;
}
html body #ds-che .dong-che {
  border-radius: 16px !important;
}
html body #ds-che .dong-che :is(.can > span, .che-nl, .che-nut button) {
  border-radius: 8px !important;
}
html body #bang-caidat .cd-hang {
  border-radius: 16px !important;
}
html body #bang-caidat :is(.cd-chon button, .cd-nut, .cd-chu, .cd-meo) {
  border-radius: 8px !important;
}
html body #bang-ch :is(.ch-buoc, .ch-kham) {
  border-radius: 16px !important;
}
html body #bang-ch :is(.ch-hq.sau, .ch-nl, .ch-nut, .ch-dong) {
  border-radius: 8px !important;
}
html body #bang-qua-ngay .qn-o {
  border-radius: 12px !important;
}
html body #bang-qua-ngay .qn-o .mb-qua {
  border-radius: 6px !important;
}
html body #bang-ht .pt-khung {
  border-radius: 16px !important;
}
html body #bang-ht .pt-nac {
  border-radius: 10px !important;
}
html body #bang-ht .pt-nhan {
  border-radius: 6px !important;
}
html body #khihau-the > .tieu-de {
  border-radius: 17px 17px 0 0 !important;
}
html body #khihau-the .kh-muc {
  border-radius: 12px !important;
}
html body #lan-hud .lan-ruot {
  border-radius: 14px !important;
}

/* --- 23d. Chuẩn hoá khoảng cách theo lưới 4 px --- */
html body #menu-luoi .ml-than {
  padding: 4px 12px 12px !important;
  gap: 0 !important;
}
html body #menu-luoi .ml-nhom h3 {
  margin: 16px 0 8px !important;
}
html body #menu-luoi .ml-nhom:first-child h3 {
  margin-top: 4px !important;
}
html body #menu-luoi .ml-luoi {
  gap: 8px !important;
}
html body #menu-luoi .ml-o {
  padding: 8px 4px !important;
  gap: 4px !important;
}
@media (max-height: 500px) {
  html body #menu-luoi .ml-o {
    padding: 4px !important;
  }
}

html body #bang-tui .than-tui {
  gap: 8px 12px !important;
  padding: 4px 12px 12px !important;
}
html body #bang-tui #luoi-tui {
  gap: 8px !important;
}
html body #bang-tui #chi-tiet {
  padding: 12px !important;
  gap: 8px !important;
}
html body #bang-tui #chi-tiet .ct-nguon {
  padding: 8px !important;
}
html body #bang-tui #chi-tiet .hang-nut {
  gap: 8px !important;
}
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-tui .than-tui {
    gap: 8px !important;
    padding: 4px 8px 8px !important;
  }
  html body #bang-tui #luoi-tui {
    gap: 4px !important;
  }
  html body #bang-tui #chi-tiet {
    padding: 8px !important;
    gap: 4px !important;
  }
}
@media (max-width: 620px) {
  html body #bang-tui .than-tui {
    gap: 8px !important;
    padding: 4px 8px 8px !important;
  }
  html body #bang-tui #luoi-tui {
    gap: 8px !important;
  }
  html body #bang-tui #chi-tiet {
    padding: 8px !important;
    gap: 8px !important;
  }
}

html body #che-than {
  gap: 8px !important;
  padding: 4px 12px 12px !important;
}
html body #ds-che .dong-che {
  padding: 8px 12px !important;
  gap: 8px !important;
}
html body #ds-che .dong-che .can {
  gap: 4px !important;
}
html body #ds-che .dong-che .can > span {
  padding: 2px 8px 2px 4px !important;
}
@media (max-height: 500px) and (min-width: 621px), (max-width: 620px) {
  html body #che-than {
    gap: 8px !important;
    padding: 4px 8px 8px !important;
  }
  html body #ds-che .dong-che {
    padding: 8px !important;
  }
}

html body #bang-dn #than-dn {
  padding: 8px 12px 12px !important;
  gap: 8px !important;
}
html body #bang-dn .dn-the {
  padding: 12px !important;
  margin-bottom: 0 !important;
}
html body #bang-dn .dn-the h4 {
  margin-bottom: 4px !important;
}
html body #bang-dn .dn-the p {
  margin: 0 0 8px !important;
}
html body #bang-dn .dn-dau {
  gap: 12px !important;
}
html body #bang-dn .dn-so {
  gap: 4px 12px !important;
}
html body #bang-dn .dn-cans,
html body #bang-dn .dn-cts {
  gap: 8px !important;
}
@media (max-height: 500px) and (min-width: 621px) {
  html body #bang-dn .dn-the {
    padding: 8px 12px !important;
    margin-bottom: 0 !important;
  }
  html body #bang-dn .dn-the p {
    margin: 0 0 4px !important;
  }
  html body #bang-dn .dn-hang {
    gap: 8px !important;
  }
}

html body #bang-nc #than-nc {
  padding: 4px 12px 12px !important;
  gap: 8px !important;
}
html body #bang-nc .nc-the {
  padding: 12px !important;
}
html body #bang-nc .nc-dau {
  gap: 12px !important;
}
html body #bang-nc .nc-muc {
  margin: 12px 0 4px !important;
}
html body #bang-nc .nc-loi,
html body #bang-nc .nc-ds {
  gap: 4px !important;
}
html body #bang-nc .nc-nut {
  gap: 8px !important;
}

html body #bang-ht .pt-khung {
  padding: 12px !important;
  margin-bottom: 12px !important;
}
html body #bang-ht .pt-nacs {
  gap: 8px !important;
}
html body #bang-ht .pt-nac {
  padding: 8px !important;
  gap: 4px !important;
}
html body #bang-ht .pt-chan {
  margin-top: 8px !important;
}
@media (max-width: 420px) {
  html body #bang-ht .pt-nacs {
    gap: 4px !important;
  }
}
@media (orientation: landscape) and (max-height: 480px) {
  html body #bang-ht .pt-khung {
    padding: 8px !important;
    margin-bottom: 8px !important;
  }
}

html body #bang-qua-ngay .qn-than {
  padding: 4px 12px 12px !important;
  gap: 8px !important;
}
html body #bang-qua-ngay .qn-luoi {
  gap: 8px !important;
}
html body #bang-qua-ngay .qn-o {
  padding: 8px !important;
  gap: 4px !important;
}
html body #bang-qua-ngay .qn-o-qua {
  gap: 4px !important;
}

html body #bang-caidat .cd-hang {
  padding: 12px !important;
  margin-top: 8px !important;
}
html body #bang-caidat .cd-chon {
  gap: 8px !important;
}
html body #bang-caidat .cd-meo {
  padding: 8px 12px !important;
}

html body #bang-ch .ch-hang-the {
  gap: 4px !important;
}
html body #bang-ch .ch-ct {
  gap: 8px !important;
}
html body #bang-ch .ch-hq {
  padding: 8px 12px !important;
}
html body #bang-ch :is(.ch-buoc, .ch-kham) {
  padding: 12px !important;
  gap: 8px !important;
}
html body #bang-ch :is(.ch-hang, .ch-dongs) {
  gap: 8px !important;
}
html body #bang-ch .ch-dong {
  padding: 8px !important;
}
@media (max-height: 500px) and (orientation: landscape) {
  html body #bang-ch :is(.ch-buoc, .ch-kham) {
    padding: 8px !important;
    gap: 4px !important;
  }
}

html body #khihau-the > .tieu-de {
  padding: 4px 8px 4px 16px !important;
}
html body #khihau-the .kh-than {
  padding: 12px !important;
  gap: 8px !important;
}
html body #khihau-the .kh-muc {
  padding: 8px 12px !important;
  gap: 4px !important;
}
html body :is(#mua-the, #trang-the) {
  padding: 12px 16px !important;
}

html body #ptt-hud {
  padding: 8px 12px !important;
}
html body #ptt-hud .ptt-ca {
  gap: 8px !important;
  margin: 4px 0 !important;
}
html body #ptt-the {
  padding: 16px !important;
}
@media (min-width: 621px) and (max-height: 500px) {
  html body #ptt-hud {
    padding: 4px 8px !important;
  }
}

html body #lan-hud .lan-ruot {
  padding: 4px 12px 4px 4px !important;
  gap: 8px !important;
}
html body #lan-hud .lan-hang {
  gap: 8px !important;
}
@media (orientation: landscape) and (max-height: 480px) {
  html body #lan-hud .lan-ruot {
    padding: 4px 8px 4px 4px !important;
  }
}

html body :is(#chat-log, #hd-chat-log) {
  padding: 8px 12px !important;
}
html body #chat :is(.nr-tim, .nr-form) {
  gap: 8px !important;
  padding: 8px !important;
}
html body #chat .nr-dong {
  padding: 8px !important;
  margin-bottom: 4px !important;
}

/* --- 23e. Tắt chuyển động lặp vô cớ & hạ glow màu thừa (giữ nguyên cảnh báo khẩn cấp) --- */
html body :is(
  #nhiem-vu.ctr-xong.thu-gon,
  #bang-nc .nc-bac.dong,
  #ghim-chip.du,
  #vk-chip.nhay,
  #lai-nut-cam,
  #bang-st .sc-moc.duoc,
  #bang-st .sc-o.dang,
  .cc-o.vip,
  .cc-anh.vip,
  #lan-nut.lan-moi
) {
  animation: none !important;
}
html body #bang-tui .o-tui.chon {
  box-shadow: 0 0 0 2.5px #ff9f1c !important;
}
html body #thanh-cam .o-cam.chon {
  box-shadow: 0 0 0 2px #ffffff, 0 3px 8px rgba(4, 24, 40, 0.35) !important;
}
html body #bang-ch .ch-sao i.sang {
  box-shadow: none !important;
}
html body #bang-ch .ch-buoc-dau span b {
  text-shadow: none !important;
}
html body #chat .nr-so,
html body .nut-vuong .cham.nr-cham {
  box-shadow: none !important;
}
@keyframes tm-the-vao {
  0% { opacity: 0; transform: translateY(8px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 02/12: giữ thanh TIÊU ĐỀ bảng viết hoa như skin v2 (nhận diện Tròn mềm) — chữ nguồn đã đổi sang kiểu câu ở lượt unslop polish, phần thân vẫn kiểu câu */
html body .bang > .tieu-de > span:first-child { text-transform: uppercase; }

/* --- 23f. Tiến độ nâng đảo (#dn-chip) & nâng thuyền (#nc-chip) trong #chi-so: cỡ chạm >= 44 px + tương phản chữ >= 4.5:1 trên nền sáng Tròn mềm --- */
html body #chi-so > :is(#dn-chip, #nc-chip)[hidden] { display: none !important; }
html body #chi-so > :is(#dn-chip, #nc-chip) {
  border-top: 1px solid rgba(11, 56, 86, 0.18);
  padding: 4px 2px 2px;
  margin: 4px 0 0;
  gap: 4px;
  align-content: center;
}
html body.cam-ung #chi-so > :is(#dn-chip, #nc-chip) {
  min-height: 44px;
}
html body #dn-chip span {
  color: #0d5e34 !important;
  font-variant-numeric: tabular-nums;
}
html body #nc-chip span {
  color: #8a4b00 !important;
  font-variant-numeric: tabular-nums;
}
html body :is(#dn-chip, #nc-chip) b {
  height: 8px;
  border-radius: 999px;
  background: #d4e8f5;
  border: 1.5px solid #04253a;
}
html body #dn-chip i {
  background: linear-gradient(90deg, #19874c, #2ec26b);
}
html body #nc-chip i {
  background: linear-gradient(90deg, #d98200, #f5b31a);
}

/* ===== 03/12 chủ game (iPhone ngang): "về nhà với ra đảo có mấy cái ô vướng màn hình" =====
   Điện thoại ngang (cảm ứng, cao ≤ 500 px — gồm iPhone Pro Max cao 430 không lọt lớp man-nho ≤ 400):
   - dòng nhiệm vụ / tân thủ gọn: hẹp, chữ nhỏ, tối đa 2 dòng
   - gợi ý (#hd-loi, #tt-goi) gọn theo
   - chip Giải câu (trừ lúc đang thi) + Bến Vui (vào Menu → Bến Vui) + chip Bến cảng đã thu "🏙 👥 N" không lơ lửng giữa màn */
@media (orientation: landscape) and (max-height: 500px) {
  html body.cam-ung #nhiem-vu.thu-gon {
    max-width: 240px !important;
    min-height: 0 !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
  }
  html body.cam-ung #nhiem-vu.thu-gon .tieu-de { min-height: 0 !important; padding: 0 !important; gap: 6px !important; }
  html body.cam-ung #nhiem-vu.thu-gon #nv-tom {
    font-size: 12.5px !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
  }
  html body.cam-ung #hd-loi,
  html body.cam-ung #tt-goi {
    max-width: 240px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    padding: 4px 10px !important;
  }
  html body.cam-ung #gca-chip:not(.dang),
  html body.cam-ung #bv-chip,
  html body.cam-ung #th-the.th-thu { display: none !important; }
}
