/* ===== 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);
  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: 60vh;
  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: 70vh; 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: 66vh; }
.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, 34vh); }
  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: 38vh; 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) {
  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); overflow: auto; }
#tl-hop[hidden] { display: none; }
#tl-hop, #tl-hop * { box-sizing: border-box; }
#tl-hop { overflow-x: hidden; }
#tl-hop .tl-than { grid-template-columns: minmax(0, 1fr); }
#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) { 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; 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(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(78vh, 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^="/v1/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; 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: .55; filter: saturate(.55); 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: .4; }

.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: .4; }
.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: 52vh; }
.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: 30vh; }
}

/* 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);
  overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a5066 transparent; z-index: var(--z-bang); padding: 8px 12px 12px; }
#bang-ln[hidden] { display: none; }
.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-x: hidden; }   /* 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-x: hidden; }   /* 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-x: hidden; }   /* 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); }
/* ===== 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: .85; 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ờ (overflow: hidden, cao 26–28) cắt mất vùng chạm ẩn của 👥 → trên cảm ứng tối giản dải cao 44 (nền đã trong suốt), lề âm giữ nguyên chỗ */
html body.cam-ung.toi-gian #dong-ho { height: 46px; margin-top: -9px; margin-bottom: -9px; }
html body.cam-ung:is(.bang-doc, .bang-ngang) #dong-ho { height: 46px; }   /* máy bảng: dải có nền, đủ chỗ cao hơn */
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% - 46px) / 2)); bottom: min(0px, calc((100% - 46px) / 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(42vw, 300px); }
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); }
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: hidden; }
@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; 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; }
/* ===== hai_chien.css ===== */
/* Hải chiến · Hải đội · Mùa giải (trinh_khach/src/hai_chien_ui.ts, hai_doi_ui.ts, mua_giai_ui.ts tự gắn tệp này).
   Theo khung bảng thống nhất (.bang.lon): tiêu đề + nút đóng 44px + tab (.tab-st của so_tay.css) + 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 ở hai_chien_ui.ts — khung bảng thống nhất) */
#than-hc { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 10px 12px; touch-action: pan-y; }
#tab-hc .cham { top: -6px; right: -4px; }
#than-hc .trong { text-align: center; color: var(--chu-mo); }
.hc-khoi { background: rgba(79, 227, 255, .05); border: 1px solid var(--vien-mo); border-radius: 9px; padding: 9px 10px; margin: 0 0 8px; }
.hc-ghi { font-size: var(--chu-phu, 12px); color: var(--chu-mo); margin: 6px 0; line-height: 1.4; }
.hc-ghi b { color: var(--chu); }
.hc-do { color: var(--do) !important; } .hc-cam { color: var(--cam) !important; }
.hc-nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 7px 12px; margin: 4px 6px 2px 0; border-radius: 8px; border: 1px solid var(--vien-mo);
  background: rgba(79, 227, 255, .08); font-size: 13px; font-weight: 700; }
.hc-nut img { width: 20px; height: 20px; image-rendering: pixelated; }
.hc-nut.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.hc-nut.do { border-color: #ff8a6a; background: rgba(160, 40, 30, .45); color: #ffe3da; }
.hc-nut:disabled { opacity: .45; }
.hc-nut:active:not(:disabled) { transform: translateY(1px); }
body.cam-ung .hc-nut, body.cam-ung #than-hc .xh-nut button, body.cam-ung .hd-phu button { min-height: 44px; }

/* tab Thuyền chiến */
.hc-dau { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.hc-dau > img { width: 44px; height: 44px; image-rendering: pixelated; object-fit: contain; }
.hc-tk { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: flex-end; font-size: 13px; font-weight: 700; color: #ffe9a8; max-width: 150px; }
.hc-mau { position: relative; height: 22px; margin: 8px 0 2px; border-radius: 6px; background: rgba(0, 0, 0, .5); box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); overflow: hidden; }
.hc-mau i { display: block; height: 100%; background: linear-gradient(#7fdcff, #3a9fd0); transition: width .3s; }
.hc-mau.vua i { background: linear-gradient(#ffc76a, #e08a2a); }
.hc-mau.xau i { background: linear-gradient(#ff8a7a, #d0402e); }
.hc-mau span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.hc-man { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed rgba(79, 227, 255, .16); font-size: 13px; }
.hc-man img, .hc-dan img, .hd-gop b img { width: 20px; height: 20px; image-rendering: pixelated; vertical-align: -5px; margin-right: 3px; }
.hc-man em { font-style: normal; font-size: 12px; color: var(--cam); }
.hc-man em.tot { color: var(--xanh); }
.hc-dan-hang { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 7px 0 2px; font-size: 13px; }
.hc-dan b { color: #ffe9a8; }
.hc-co-tt { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.hc-co-tt.bat { color: #ff9a80; } .hc-co-tt.cho { color: var(--vang); }
.hc-luat { margin: 8px 0 0; padding: 0 0 0 18px; font-size: 12.5px; color: var(--chu-mo); line-height: 1.45; }
.hc-luat b { color: var(--chu); }
.hc-luat li { margin-bottom: 3px; }

/* thanh máu thân thuyền trong khung chỉ số + chip cờ */
#cs-than .hc-neo { font-style: normal; font-size: 10px; line-height: 11px; width: 11px; text-align: center; }
#cs-than b span { background: #6fd0ff; }
#hc-chip-co { cursor: pointer; pointer-events: auto; border-color: rgba(255, 150, 120, .6) !important; color: #ffd9cf !important; }
#hc-chip-co.nguy { background: rgba(140, 30, 20, .75) !important; animation: hcNhay 1.2s infinite; }
@keyframes hcNhay { 50% { box-shadow: 0 0 10px rgba(255, 110, 80, .8); } }

/* 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 / hàng trên cụm lái (class nut-vong) */
#hc-thanh { position: fixed; z-index: var(--z-duoi-hud); left: 50%; bottom: calc(196px + var(--day)); transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
body.dang-lai #hc-thanh { bottom: calc(214px + var(--day)); }
#hc-thanh .hc-nv { pointer-events: auto; position: relative; min-width: 104px; min-height: 46px; padding: 6px 12px; border-radius: 10px; background: var(--nen); border: 1.5px solid var(--vien);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--chu); overflow: hidden; }
#hc-thanh .hc-nv i { font-style: normal; font-size: 15px; }
#hc-thanh .hc-nv em { font-style: normal; font-size: 11px; color: #ffe9a8; }
#hc-thanh .hc-nv.ban { border-color: #ff9a6a; }
#hc-thanh .hc-nv.ban::before { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--nap, 100) * 1%); background: #ff9a6a; transition: width .1s linear; }
#hc-thanh .hc-nv.ban.san { background: rgba(150, 50, 20, .9); box-shadow: 0 0 12px rgba(255, 130, 70, .55), 0 2px 8px rgba(0, 0, 0, .4); }
#hc-thanh .hc-nv.ban.san::before { background: #ffe08a; }
#hc-thanh .hc-nv.ban.het { border-color: #9aa3ad; filter: grayscale(.7); }
#hc-thanh .hc-nv.ban.tu-ve { border-color: #ff5a4a; box-shadow: 0 0 14px rgba(255, 70, 50, .7), 0 2px 8px rgba(0, 0, 0, .4); } /* hoà bình đang được bắn trả */
#hc-thanh .hc-nv.vot { border-color: var(--vang); }
#hc-thanh .hc-nv.va { border-color: #9dffb0; }
#hc-thanh .hc-nv.no { border-color: #ff6a4a; } /* thả thùng nổ (thung_no.go): vạch hồi chiêu như nút bắn */
#hc-thanh .hc-nv.no::before { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--nap, 100) * 1%); background: #ff6a4a; transition: width .1s linear; }
#hc-thanh .hc-nv.no.san { background: rgba(120, 30, 20, .9); }
#hc-thanh .hc-nv.cv { border-color: #ffd84a; touch-action: none; } /* pháo cầu vồng (phao_cau_vong.go): giữ – kéo – thả */
#hc-thanh .hc-nv.cv::before { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--nap, 100) * 1%); background: linear-gradient(90deg, #ff5a4a, #ffb24a, #ffe46a, #6fd06f, #5aa8ff, #a070f0); transition: width .1s linear; }
#hc-thanh .hc-nv.cv.san { background: rgba(60, 40, 90, .9); }
#hc-thanh .hc-nv.cv.het { border-color: #9aa3ad; filter: grayscale(.7); }
#hc-thanh .hc-nv.cv.ngam { transform: scale(1.12); box-shadow: 0 0 0 3px rgba(255, 228, 106, .55); }
html body.cam-ung #hc-thanh { inset: 0; left: 0; bottom: 0; transform: none; display: block; }
html body.cam-ung #hc-thanh .hc-nv { position: absolute; min-width: 0; min-height: 0; width: var(--vc); height: var(--vc); padding: 2px; border-radius: 50%; flex-direction: column; gap: 0; font-size: 10.5px; line-height: 1.05; }
html body.cam-ung #hc-thanh .hc-nv i { font-size: 14px; line-height: 1; }
html body.cam-ung #hc-thanh .hc-nv em { font-size: 10px; line-height: 1; }
html body.cam-ung #hc-thanh .hc-nv.ban::before { height: 100%; width: 100%; left: 0; bottom: 0; z-index: -1; opacity: .5;
  background: conic-gradient(#ff9a6a calc(var(--nap, 100) * 1%), transparent 0); }
html body.cam-ung #hc-thanh .hc-nv.ban.san::before { background: none; }
html body.cam-ung #hc-thanh .hc-nv.no::before { height: 100%; width: 100%; left: 0; bottom: 0; z-index: -1; opacity: .5; border-radius: 50%; background: conic-gradient(#ff6a4a calc(var(--nap, 100) * 1%), transparent 0); }
html body.cam-ung #hc-thanh .hc-nv.no.san::before { background: none; }
html body.cam-ung #hc-thanh .hc-nv.cv::before { height: 100%; width: 100%; left: 0; bottom: 0; z-index: -1; opacity: .55; border-radius: 50%; background: conic-gradient(#ffd84a calc(var(--nap, 100) * 1%), transparent 0); }
html body.cam-ung #hc-thanh .hc-nv.cv.san::before { background: none; }
html body.cam-ung #hc-thanh .hc-nv > * { position: relative; }

/* chớp đỏ viền màn khi thuyền mình trúng đạn */
#hc-chop { position: fixed; inset: 0; z-index: var(--z-canh); pointer-events: none; opacity: 0; box-shadow: inset 0 0 80px 18px rgba(255, 60, 40, .75); }
#hc-chop.bat { animation: hcChop .5s ease-out; }
@keyframes hcChop { 0% { opacity: 1; } 100% { opacity: 0; } }

/* màn thuyền chìm + kết quả mùa */
#hc-man-chim, #mg-man-kq { position: fixed; inset: 0; z-index: var(--z-man-che); display: flex; align-items: center; justify-content: center; background: rgba(2, 10, 20, .78); padding: 12px; }
.hc-chim-khung, .mg-kq-khung { position: relative; width: min(440px, 100%); padding: 14px 16px; background: var(--nen-dam); text-align: center; }
#hc-chim-nd, #mg-kq-nd { max-height: calc(var(--cao, 100vh) - 210px); overflow-y: auto; }
.hc-chim-khung h2, .mg-kq-khung h2 { margin: 6px 0 8px; font-size: 18px; letter-spacing: 2px; color: #ffb3a0; }
.mg-kq-khung h2 { color: var(--vang); }
#hc-chim-nd, #mg-kq-nd { font-size: 13.5px; line-height: 1.5; margin-bottom: 12px; }
.hc-chim-mat { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; margin: 8px 0; font-weight: 700; color: #ffd0c4; }
.hc-chim-mat img { width: 20px; height: 20px; image-rendering: pixelated; vertical-align: -5px; margin-right: 2px; }
.hc-chim-hinh { position: relative; height: 62px; overflow: hidden; border-radius: 8px; background: linear-gradient(#17384f, #0b2233); }
.hc-chim-hinh i { position: absolute; left: 50%; top: 4px; font-style: normal; font-size: 36px; transform-origin: 50% 80%; animation: hcChim 2.6s ease-in forwards; }
.hc-chim-hinh b { position: absolute; left: -10%; right: -10%; bottom: -14px; height: 30px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: #1f6f8c; box-shadow: 0 -4px 0 #4fb6d6; animation: hcSong 1.6s ease-in-out infinite alternate; }
@keyframes hcChim { 0% { transform: translate(-50%, 0) rotate(0); } 60% { transform: translate(-50%, 14px) rotate(-28deg); } 100% { transform: translate(-50%, 54px) rotate(-55deg); opacity: .2; } }
@keyframes hcSong { to { transform: translateX(14px); } }
.mg-kq-dong { display: flex; flex-direction: column; gap: 3px; padding: 7px 8px; margin: 6px 0; border-radius: 8px; border: 1px solid rgba(255, 216, 74, .4); background: rgba(255, 216, 74, .07); text-align: left; }

/* hải đội */
.hd-co { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 5px; }
.hd-co.to { width: 52px; height: 52px; }
.hd-dong, .hd-tv, .hd-gop { cursor: default; }
.xh-dong.hd-dong { grid-template-columns: 34px minmax(0, 1fr) auto; }
.hd-dau { display: flex; gap: 12px; align-items: center; }
.hd-dau-giua { min-width: 0; }
.hd-dau-giua > b { font-size: 16px; overflow-wrap: anywhere; }
.hd-buff { font-size: 12.5px; color: #cfefff; margin-top: 2px; }
.hd-buff b { color: #ffe9a8; }
.hd-tb { font-size: 13px; padding: 6px 9px; margin-bottom: 8px; border-radius: 8px; border: 1px dashed rgba(255, 216, 74, .45); color: #ffe9a8; overflow-wrap: anywhere; }
.hd-tb a, .hd-nk a { color: #9fe8ff; text-decoration: underline dotted; cursor: pointer; margin-left: 6px; }
.hd-phu button { position: relative; }
.hd-phu .cham { top: -6px; right: -3px; }
.hd-tv.cua-toi { border-color: rgba(255, 216, 74, .55); }
#than-hc .xh-nut { flex-wrap: wrap; justify-content: flex-end; }
#than-hc .xh-nut button { font-size: 12.5px; }
.hd-cuoi { display: flex; flex-wrap: wrap; margin-top: 8px; }
.hd-lap-dau { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.hd-lap-dau input, #than-hc .xh-tim input { flex: 1; min-width: 0; padding: 8px 10px; min-height: 42px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(0, 0, 0, .35); color: var(--chu); font-size: 16px; outline: none; }
.hd-lap-dau input:focus { border-color: var(--vien); }
.hd-chon { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: center; margin: 6px 0; font-size: 12.5px; color: var(--chu-mo); }
.hd-chon > div { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-mau { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); padding: 0; }
.hd-mau.chon { border-color: #fff; box-shadow: 0 0 0 2px var(--vien); }
.hd-ht { padding: 2px; border-radius: 8px; border: 2px solid transparent; background: none; line-height: 0; }
.hd-ht.chon { border-color: var(--vien); }
body.cam-ung .hd-mau { width: 44px; height: 44px; }
body.cam-ung .hd-ht .hd-co { width: 40px; height: 40px; }
body.cam-ung .hd-ht { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.hd-nv.xong { border-color: rgba(111, 255, 210, .55); }
.hd-nv-dau { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.hd-nv-dau span { font-weight: 800; color: #ffe9a8; font-variant-numeric: tabular-nums; }
.hd-nv-cuoi { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.hd-thanh { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .5); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); overflow: hidden; margin: 6px 0 2px; }
.hd-thanh i { display: block; height: 100%; background: linear-gradient(90deg, #4fe3ff, #6fffd2); transition: width .3s; }
.hd-th { display: inline-flex; align-items: center; gap: 2px; margin-right: 8px; font-size: 12.5px; font-weight: 700; color: #ffe9a8; white-space: nowrap; }
.hd-th img { width: 20px; height: 20px; image-rendering: pixelated; }
#hd-chat-log { height: min(40vh, 260px); overflow-y: auto; padding: 6px 8px; margin-bottom: 6px; border-radius: 8px; background: rgba(0, 0, 0, .3); border: 1px solid var(--vien-mo); -webkit-user-select: text; user-select: text; touch-action: pan-y; }
#hd-chat-log p { margin: 0 0 4px; font-size: 13.5px; overflow-wrap: anywhere; }
#hd-chat-log p b { color: #9fe8ff; margin-right: 4px; }
#hd-chat-log p.toi b { color: #ffe9a8; }
.hd-nk { font-size: 13px; padding: 4px 2px; border-bottom: 1px dashed rgba(79, 227, 255, .14); overflow-wrap: anywhere; }

/* mùa giải */
.mg-dau-hang { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mg-dau-hang > b { font-size: 17px; letter-spacing: 2px; color: var(--vang); }
.mg-dau-hang span b { color: #ffe9a8; font-variant-numeric: tabular-nums; }
.mg-luoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-bottom: 8px; }
.mg-the { min-height: 56px; }
body.cam-ung .mg-the { min-height: 56px; }
.mg-the { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 0 6px; align-items: center; text-align: left; padding: 7px 9px; min-height: 52px; border-radius: 9px;
  border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06); }
.mg-the.chon { border-color: var(--vang); background: rgba(255, 216, 74, .12); }
.mg-the i { grid-row: 1 / 3; font-style: normal; font-size: 20px; }
/* C11: nhãn + giá trị được XUỐNG DÒNG (không còn "Danh vọng…" / "chưa có đội /…"); giá trị ở dòng 2 */
.mg-the b { font-size: 13px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
.mg-the span { grid-column: 2; font-size: 12px; line-height: 1.3; color: var(--chu-mo); white-space: normal; overflow-wrap: anywhere; }
.mg-the span .mg-chua { display: block; font-size: 12px; color: var(--chu-mo); opacity: .8; }
.mg-the em { grid-column: 3; grid-row: 1 / 3; font-style: normal; font-size: 17px; font-weight: 800; color: var(--chu); }
.mg-the em.top { color: var(--vang); }
.mg-the em small { font-size: 10px; font-weight: 400; color: var(--chu-mo); }
.mg-dong { cursor: default; }
.mg-diem { font-weight: 800; color: #ffe9a8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-dong .hd-co { width: 20px; height: 20px; vertical-align: -5px; margin-right: 5px; }
.mg-so { display: inline-block; min-width: 22px; margin-right: 6px; text-align: center; font-weight: 800; color: var(--chu-mo); }
.mg-dong.h1 .mg-so { color: #ffd84a; } .mg-dong.h2 .mg-so { color: #d5dde4; } .mg-dong.h3 .mg-so { color: #e2a070; }
.mg-dong.cua-toi { border-color: var(--vang); }
.mg-thuong { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed rgba(79, 227, 255, .14); }
.mg-thuong:last-of-type { border-bottom: 0; }
.mg-thuong.h1 b { color: #ffd84a; } .mg-thuong.h2 b { color: #d5dde4; } .mg-thuong.h3 b { color: #e2a070; }
.mg-thuong span { display: flex; flex-wrap: wrap; gap: 2px 0; }
.mg-dh { color: #ffd0f0 !important; }
.mg-truoc > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; font-size: 12.5px; padding: 3px 0; }
.mg-truoc span { color: var(--chu-mo); overflow-wrap: anywhere; }
.mg-kq-toi { display: block !important; margin-top: 6px; color: #ffe9a8; }

@media (max-width: 520px) {
  .hc-dau { grid-template-columns: 40px minmax(0, 1fr); }
  .hc-tk { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
  .mg-truoc > div { grid-template-columns: 1fr; gap: 0; }
  .hc-man { grid-template-columns: 70px minmax(0, 1fr); }
  .hc-man em { grid-column: 2; }
}
@media (max-height: 460px) and (orientation: landscape) {
  #hd-chat-log { height: 34vh; }
  .hc-chim-hinh { height: 44px; }
}

/* C12: "Còn thiếu: Xưởng đóng tàu · 20 Vải …" ngay trên nút đóng / nâng tàu hộ tống (ho_tong.ts); luật dài nằm trong <details class="huong-dan"> */
.ht-thieu { margin: 2px 0 8px; font-size: var(--chu-phu, 12px); font-weight: 700; color: var(--cam); line-height: 1.4; }
#than-hc details.huong-dan { margin: 6px 0 8px; }
#than-hc details.huong-dan > .hc-ghi { margin: 0 0 4px; }
#than-hc details.huong-dan .hc-luat { margin: 0 0 0; padding-left: 30px; }
/* ===== boss_bien.css ===== */
/* Boss biển (trinh_khach/src/boss_bien.ts tự gắn tệp này): thanh máu boss trên cùng, chip boss ở xa, thẻ kết quả chia thưởng. */
#bb-thanh { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 52px); left: 50%; transform: translateX(-50%); z-index: var(--z-hud-noi); width: min(440px, calc(100vw - 24px));
  padding: 6px 10px 7px; border-radius: 10px; background: rgba(34, 6, 14, .82); border: 1px solid rgba(255, 90, 90, .65); box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  pointer-events: none; color: #fff0ea; text-align: center; }
#bb-thanh .bb-dau { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; }
#bb-thanh .bb-bieu { font-size: 17px; }
#bb-thanh .bb-ten { font-weight: 800; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bb-thanh .bb-pha { font-size: 11px; color: #ffb4a8; letter-spacing: 1px; }
#bb-thanh .bb-mau { position: relative; height: 13px; margin: 5px 0 3px; border-radius: 6px; background: rgba(0, 0, 0, .55); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); overflow: hidden; }
#bb-thanh .bb-mau i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff7a7a, #c0262f); transition: width .25s; }
#bb-thanh .bb-mau span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; text-shadow: 0 1px 2px #000; }
#bb-thanh .bb-goi { font-size: 12px; line-height: 1.3; min-height: 15px; color: #ffd9cf; }
#bb-thanh.yeu { border-color: #ffe066; box-shadow: 0 0 0 2px rgba(255, 224, 102, .35), 0 4px 14px rgba(0, 0, 0, .45); }
#bb-thanh.yeu .bb-goi { color: #ffe066; font-weight: 800; animation: bb-nhay .5s ease-in-out infinite alternate; }
#bb-thanh.che .bb-mau i { background: linear-gradient(#9ff0ff, #3a9fd0); }
#bb-thanh.bao { border-color: #b47bff; background: rgba(24, 10, 40, .82); }
#bb-thanh.bao .bb-mau i { background: repeating-linear-gradient(45deg, #6a3fb0 0 8px, #8a5ad0 8px 16px); }
/* thu gọn: nút tròn góc trái (dưới cụm chỉ số), vòng đỏ = máu boss còn lại, chạm để mở lại */
#bb-thanh { pointer-events: auto; cursor: pointer; }
#bb-thanh .bb-tron { display: none; }
#bb-thanh.thu { left: calc(10px + env(safe-area-inset-left, 0px)); transform: none; top: calc(env(safe-area-inset-top, 0px) + 150px); width: 52px; height: 52px; padding: 0;
  border-radius: 50%; background: conic-gradient(#ff5a5a calc(var(--p, 100) * 1%), rgba(0, 0, 0, .55) 0); border-width: 2px; }
#bb-thanh.thu > :not(.bb-tron) { display: none; }
#bb-thanh.thu .bb-tron { display: flex; position: absolute; inset: 4px; border-radius: 50%; align-items: center; justify-content: center; font-size: 22px;
  background: rgba(34, 6, 14, .92); }
#bb-thanh.thu .bb-tron::after { content: attr(data-p); position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); padding: 0 4px; border-radius: 6px;
  font-size: 10px; font-weight: 800; background: rgba(34, 6, 14, .95); color: #ffd9cf; white-space: nowrap; }
#bb-thanh.thu.yeu { box-shadow: 0 0 0 3px rgba(255, 224, 102, .7); animation: bb-nhay .5s ease-in-out infinite alternate; }
#bb-thanh.thu.bao { background: conic-gradient(#b47bff 100%, transparent 0); }
@keyframes bb-nhay { from { opacity: .7; } to { opacity: 1; transform: scale(1.03); } }

#bb-chip { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 52px); left: 50%; transform: translateX(-50%); z-index: var(--z-hud-noi); max-width: calc(100vw - 24px);
  padding: 5px 12px; min-height: 32px; border-radius: 16px; border: 1px solid rgba(255, 90, 90, .7); background: rgba(40, 8, 14, .8); color: #ffe3da;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
body.cam-ung #bb-chip { min-height: 40px; }
#bb-chip:active { transform: translateX(-50%) translateY(1px); }

#bb-the { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: var(--z-modal); width: min(380px, calc(100vw - 24px)); padding: 12px 14px 12px;
  border: 1px solid rgba(255, 216, 74, .7); text-align: center; }
#bb-the h3 { margin: 2px 26px 6px; font-size: 17px; color: #ffe9a8; }
#bb-the .bb-the-x { position: absolute; top: 4px; right: 6px; width: 40px; height: 40px; font-size: 22px; background: none; border: 0; color: inherit; }
#bb-the .bb-the-phan { font-size: 12.5px; color: var(--chu-mo, #bcd); }
#bb-the .bb-the-dau { margin: 6px 0 0; font-size: 13px; font-weight: 800; color: #ffd84a; }
#bb-the .bb-the-ds { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 12px; margin: 9px 0 4px; font-size: 13.5px; font-weight: 700; }
#bb-the .bb-the-ds img { width: 22px; height: 22px; image-rendering: pixelated; vertical-align: -6px; margin-right: 3px; }
#bb-the .bb-the-ly { font-size: 12px; color: #ffb87a; margin-top: 4px; }
#bb-the .bb-the-con { font-size: 11.5px; color: var(--chu-mo, #9ab); margin-top: 5px; }
/* ===== kho_bau.css ===== */
/* Tìm kho báu (trinh_khach/src/kho_bau.ts tự gắn tệp này): chip dẫn đường, nút kéo rương, thẻ kết quả, tab Kho báu trong Sổ tay. */
#kb-chip { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 90px); left: 50%; transform: translateX(-50%); z-index: var(--z-chip); max-width: calc(100vw - 24px);
  padding: 5px 12px; min-height: 32px; border-radius: 16px; border: 1px solid rgba(255, 215, 106, .75); background: rgba(40, 28, 8, .82); color: #fff1cf;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
body.cam-ung #kb-chip { min-height: 40px; }
#kb-chip:active { transform: translateX(-50%) translateY(1px); }
#kb-chip .kb-mui { display: inline-block; font-style: normal; color: #ffd76a; margin-right: 2px; transition: transform .15s; }
#kb-chip.nong { border-color: #ff8a4a; box-shadow: 0 0 0 2px rgba(255, 138, 74, .3); }

#kb-keo { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 30%); transform: translateX(-50%); z-index: var(--z-hud-noi);
  width: min(300px, calc(100vw - 32px)); min-height: 48px; padding: 0; overflow: hidden; border-radius: 12px; border: 2px solid #ffd76a;
  background: rgba(40, 28, 8, .9); color: #fff1cf; font-size: 15px; font-weight: 800; cursor: pointer; }
#kb-keo i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#e8b83a, #a8741e); opacity: .55; transition: width .2s; }
#kb-keo .kb-keo-chu { position: relative; z-index: 1; display: block; padding: 12px 10px; text-shadow: 0 1px 2px #000; }
#kb-keo.dang { border-color: #ffb05a; animation: kb-nhip 1.2s ease-in-out infinite alternate; }
@keyframes kb-nhip { from { box-shadow: 0 0 0 0 rgba(255, 176, 90, .5); } to { box-shadow: 0 0 0 6px rgba(255, 176, 90, 0); } }

#kb-the { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: var(--z-modal); width: min(380px, calc(100vw - 24px)); padding: 12px 14px;
  border: 1px solid rgba(255, 216, 74, .75); text-align: center; }
#kb-the h3 { margin: 2px 26px 6px; font-size: 17px; color: #ffe9a8; }
#kb-the .kb-the-x { position: absolute; top: 4px; right: 6px; width: 40px; height: 40px; font-size: 22px; background: none; border: 0; color: inherit; }
#kb-the .kb-the-ds { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 12px; margin: 9px 0 4px; font-size: 13.5px; font-weight: 700; }
#kb-the .kb-the-ds img { width: 22px; height: 22px; image-rendering: pixelated; vertical-align: -6px; margin-right: 3px; }

.kb { display: flex; flex-direction: column; gap: 10px; }
.kb-dang { padding: 10px; border-radius: 10px; border: 1px solid rgba(255, 215, 106, .6); background: rgba(255, 215, 106, .08); }
.kb-dang-dau, .kb-dong { display: flex; align-items: center; gap: 10px; }
.kb-dang-dau > img, .kb-dong > img { width: 40px; height: 40px; image-rendering: pixelated; flex: none; }
.kb-dang .thanh { margin-top: 8px; }
.kb-ds { display: flex; flex-direction: column; gap: 8px; }
.kb-dong { padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.kb-ten { flex: 1; min-width: 0; }
.kb-manh { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin-right: 3px; }
.kb-khoa { color: #ffb87a; }
/* C19: nút Ghép / Dùng nằm CÙNG HÀNG với tên (bên phải), thẻ gọn 1 hàng — không còn dồn xuống góc dưới phải; nút tắt thì mờ hẳn */
.kb-nut { display: flex; gap: 6px; flex: 0 0 auto; justify-content: flex-end; margin-top: 0; }
.kb-nut button { min-height: 40px; min-width: 60px; }
body.cam-ung .kb-nut button { min-height: 44px; }
.kb-nut button:disabled { opacity: .4; background: none; border-color: var(--vien-mo); }
.kb-ghi { line-height: 1.4; }
@media (max-width: 340px) { .kb-dong { flex-wrap: wrap; } .kb-dong .kb-nut { width: 100%; } }
/* ===== doi_song.css ===== */
/* Thú nuôi · nông trại + nấu ăn · trang trí (trinh_khach/src/thu_nuoi_ui.ts, nong_trai_ui.ts, nau_an_ui.ts, trang_tri_ui.ts).
   Theo khung bảng thống nhất (.bang.lon), vùng bấm ≥ 44px trên cảm ứng, vừa 844×390. */

/* ---- HUD: hàng icon buff + thú đang theo, nằm trong khung chỉ số ---- */
#chi-so > #ds-hud { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; margin: 2px 0 0 4px; min-height: 0; flex-wrap: wrap; }
#ds-hud:has(#tn-chip[hidden]):not(:has(.ds-buff)) { display: none; }
#ds-buff { display: flex; gap: 4px; }
.ds-buff { position: relative; display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 6px 0 2px; border-radius: 12px; background: rgba(6, 20, 34, .72);
  border: 1px solid rgba(255, 224, 102, .55); font-size: 11px; font-weight: 800; color: #ffe9a6; cursor: pointer; }
.ds-buff::after, #tn-chip::after { content: ""; position: absolute; inset: -10px -3px; }
.ds-buff img { width: 20px; height: 20px; image-rendering: pixelated; }
.ds-buff.sap { animation: ds-nhay 1s steps(2) infinite; border-color: #ff8a6a; color: #ffc0a8; }
@keyframes ds-nhay { 50% { opacity: .45; } }
#tn-chip { position: relative; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: rgba(6, 20, 34, .72); border: 1px solid var(--vien-mo); display: inline-flex; align-items: center; justify-content: center; }
#tn-chip img { width: 22px; height: 22px; image-rendering: pixelated; }
#tn-chip i { position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; display: none; }
#tn-chip.chua i { display: block; background: #ffd84a; }
#tn-chip.doi i { display: block; background: var(--do); }
#tn-chip.doi img { filter: grayscale(.8); }

/* ---- thanh nhỏ nổi gắn với một ô (chọn hạt, thẻ luống, xoay / gỡ) ---- */
#ds-menu { position: fixed; z-index: var(--z-hud-noi); left: 50%; bottom: calc(var(--day, 0px) + 96px); transform: translateX(-50%); max-width: min(520px, calc(100vw - 24px)); padding: 8px 40px 8px 10px; font-size: 13px; }
body.cam-ung #ds-menu { bottom: calc(var(--day, 0px) + 84px); }
#ds-menu .ds-td { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 5px; flex-wrap: wrap; }
#ds-menu .ds-td img { width: 24px; height: 24px; image-rendering: pixelated; }
#ds-menu .thanh { margin: 2px 0 3px; }
#ds-menu .ds-hang { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; max-height: 38vh; overflow-y: auto; }
#ds-menu .ds-hang button { min-height: 44px; min-width: 64px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; line-height: 1.15; }
#ds-menu .ds-hang button.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
#ds-menu .ds-hang button:disabled { opacity: .45; }
#ds-menu .ds-hang button img { width: 28px; height: 28px; image-rendering: pixelated; }
#ds-menu .ds-hang button small { font-weight: 400; font-size: 10.5px; color: var(--chu-mo); white-space: nowrap; }
#ds-menu .ds-x { position: absolute; top: 0; right: 0; width: 40px; height: 40px; font-size: 20px; background: none; border: 0; color: var(--chu-mo); }
.ds-tot { color: #8dffb0; } .ds-canh { color: #ffb08a; }

/* ---- tab Thú nuôi ---- */
.tn-the { border: 1px solid var(--vien-mo); border-radius: 9px; margin-bottom: 7px; background: rgba(79, 227, 255, .04); }
.tn-the.mo { border-color: var(--vien); }
.tn-the.doi { border-color: rgba(255, 138, 106, .6); }
.tn-dau { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 60px; padding: 5px 9px; background: none; border: 0; text-align: left; }
.tn-dau > img, .tn-nhan > img, .tn-bong > img { width: 48px; height: 48px; image-rendering: pixelated; }
.tn-giua small { color: var(--chu-mo); }
.tn-tim i { font-style: normal; color: rgba(255, 255, 255, .22); margin-right: 1px; }
.tn-tim i.day { color: #ff6a8a; }
.tn-giua .thanh { margin: 3px 0 0; height: 5px; max-width: 220px; }
.tn-theo { color: #8dffb0; font-size: 12px; }
.tn-giua .tn-doi, .tn-giua .tn-chua { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: rgba(255, 106, 106, .25); color: #ffb0a0; }
.tn-giua .tn-chua { background: rgba(255, 216, 74, .2); color: #ffe9a6; }
.tn-the > p, .tn-the > .tn-nut, .tn-the > .tn-mon { margin: 4px 10px 8px; }
.tn-loi { color: #ffe9a6; } .tn-loi.mat { color: #ffb0a0; } .tn-loi i { color: var(--chu-mo); }
.tn-lon { margin: 4px 10px 8px; padding: 6px 9px; border-radius: 8px; border: 1px solid rgba(255, 216, 74, .3); background: rgba(255, 216, 74, .06); }
.tn-lon ul { margin: 4px 0; padding-left: 4px; list-style: none; font-size: 12px; color: var(--chu-mo); }
.tn-lon li.da { color: #ffe9a6; }
.tn-hinh-nut { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.tn-hinh-nut button { min-height: 36px; padding: 3px 10px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-size: 12px; font-weight: 700; }
.tn-hinh-nut button.chinh { border-color: var(--vang); background: rgba(255, 216, 74, .16); } .tn-hinh-nut button:disabled { opacity: .45; }
.tn-lon > p { margin: 4px 0 0; }
.tn-lon-dau { font-style: normal; font-size: 11px; }
.tn-nho { width: 20px; height: 20px; vertical-align: middle; image-rendering: pixelated; }
.tn-the .tn-nut { display: flex; gap: 6px; flex-wrap: wrap; }
.tn-the .tn-nut button { min-height: 40px; padding: 5px 11px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-weight: 700; }
.tn-the .tn-nut button:disabled, .tn-nhan button:disabled { opacity: .45; }
.tn-mon, .na-kho, .na-noi { display: flex; gap: 5px; flex-wrap: wrap; }
.tn-mon button, .na-kho button, .na-noi button { position: relative; width: 52px; min-height: 52px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(0, 0, 0, .25); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px; }
.tn-mon button.thich { border-color: #ff8ab0; background: rgba(255, 106, 138, .14); }
.tn-mon img, .na-kho img, .na-noi img { width: 32px; height: 32px; image-rendering: pixelated; }
.tn-mon span, .na-kho span, .na-noi span { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.tn-nhan, .tn-bong { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 9px; margin-bottom: 7px; border-radius: 9px; border: 1px dashed var(--vang); background: rgba(255, 216, 74, .07); }
.tn-bong { border: 1px solid rgba(255, 255, 255, .1); background: none; margin-bottom: 5px; }
.tn-bong > img { filter: brightness(0) invert(.35); opacity: .7; }
.tn-gioi { margin: 2px 2px 10px; }
body.cam-ung .tn-the .tn-nut button { min-height: 44px; }

/* ---- bảng Bếp nấu + tab Công thức ---- */
#bang-na, #bang-ttr { display: flex; flex-direction: column; }
#bang-na[hidden], #bang-ttr[hidden] { display: none; }
#than-na, #than-ttr { flex: 1 1 auto; overflow-y: auto; padding: 0 10px 10px; -webkit-overflow-scrolling: touch; }
.na-tab { margin-bottom: 8px; }
.na-mon { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px 8px; margin-bottom: 6px; border-radius: 9px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .04); }
.na-mon.an { opacity: .75; border-style: dashed; }
.na-icon { width: 44px; height: 44px; image-rendering: pixelated; }
.na-icon.mo { filter: brightness(0) invert(.3); }
.na-buff { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; padding: 1px 7px 1px 2px; border-radius: 10px; background: rgba(255, 224, 102, .14); color: #ffe9a6; border: 1px solid rgba(255, 224, 102, .4); vertical-align: middle; white-space: nowrap; }
.na-buff img { width: 18px; height: 18px; image-rendering: pixelated; }
.na-cans { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.na-can { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; padding: 1px 6px 1px 2px; border-radius: 7px; background: rgba(255, 106, 106, .16); color: #ffb0a0; }
.na-can.du { background: rgba(111, 255, 210, .12); color: #9dffd8; }
.na-can img { width: 20px; height: 20px; image-rendering: pixelated; }
.na-mon > button, .na-hang button, .na-dau button { min-height: 44px; min-width: 64px; padding: 6px 14px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-weight: 700; }
.na-mon > button.chinh, .na-hang button.chinh, .na-dau button.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.na-mon > button:disabled, .na-hang button:disabled, .na-kho button:disabled { opacity: .4; }
/* đơn hàng nhà nông (nong_trai3_ui.ts): cột nút Giao / Đổi, nút ≥ 44px */
.na-don-nut { display: flex; flex-direction: column; gap: 5px; }
.na-don-nut button { min-height: 44px; min-width: 70px; padding: 4px 12px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-weight: 700; }
.na-don-nut button.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.na-don-nut button:disabled { opacity: .4; }
.na-hang { display: flex; gap: 8px; margin: 8px 0; }
.na-noi { min-height: 56px; align-items: center; padding: 6px; border-radius: 9px; border: 1px dashed var(--vang); background: rgba(255, 216, 74, .06); }
.na-kho button { width: 62px; min-height: 64px; justify-content: flex-start; }
.na-kho small { font-size: 9.5px; line-height: 1.05; color: var(--chu-mo); text-align: center; max-height: 20px; overflow: hidden; }
.na-kho span { top: 22px; bottom: auto; }
.na-ghi { margin: 4px 2px 8px; }
.na-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.na-dau button img { width: 22px; height: 22px; vertical-align: middle; image-rendering: pixelated; }

/* ---- Trang trí & thuyền ---- */
.ttr-dong { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; margin-bottom: 3px; background: rgba(79, 227, 255, .05); }
.ttr-dong.toi { background: rgba(255, 216, 74, .14); outline: 1px solid rgba(255, 216, 74, .5); }
.ttr-hang { text-align: center; font-size: 14px; }
.ttr-hang.h1 { color: #ffd84a; } .ttr-hang.h2 { color: #d8e0e8; } .ttr-hang.h3 { color: #e0a060; }
.ttr-ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ttr-tim { color: #ff8aa8; font-weight: 800; }
.ttr-toi { padding: 7px 9px; margin: 6px 0; border-radius: 8px; background: rgba(79, 227, 255, .1); }
.ttr-thuong { display: flex; gap: 10px; align-items: center; padding: 3px 8px; font-size: 13px; }
.ttr-thuong img { width: 22px; height: 22px; vertical-align: middle; image-rendering: pixelated; }
.ttr-maus { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 7px; margin-bottom: 4px; }
.ttr-mau { height: 44px; border-radius: 8px; background: var(--m); border: 2px solid rgba(0, 0, 0, .4); }
.ttr-mau.chon { border-color: #fff; box-shadow: 0 0 0 2px var(--vien); }
.ttr-hv { flex-wrap: wrap; }
/* B12: 6 hoa văn xếp 3 cột × 2 hàng đều nhau (trước 5 cột nên "Viền" đứng một mình cả hàng) */
.th-cua.ttr-hv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ttr-ten-tau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.ttr-ten-tau b { font-size: 16px; margin-right: auto; }
.ttr-ten-tau button, #than-ttr .ttr-hv button { min-height: 44px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .08); font-weight: 700; }
.ttr-ten-tau button.chinh, #than-ttr .ttr-hv button.chon { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
#bang-ttr .tab-ht { padding: 0 10px 8px; }
.ttr-hs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 6px 10px; margin: 6px 0; border-radius: 8px; background: rgba(79, 227, 255, .07); font-size: 13px; }
.ttr-hs img { width: 22px; height: 22px; vertical-align: middle; image-rendering: pixelated; }
/* 17/11 (người chơi: "giao diện bị cấn mất 1 miếng trên đt"): thẻ neo ở đáy, nội dung dài (chuồng có nâng cấp) thì trồi quá mép trên màn ngang thấp
   → giới hạn chiều cao theo màn và cho cuộn trong thẻ; nút đóng dính góc khi cuộn. */
#ds-menu { max-height: calc(100vh - var(--day, 0px) - 96px - var(--tren, 0px) - 8px); max-height: calc(100dvh - var(--day, 0px) - 96px - var(--tren, 0px) - 8px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
body.cam-ung #ds-menu { max-height: calc(100vh - var(--day, 0px) - 84px - var(--tren, 0px) - 8px); max-height: calc(100dvh - var(--day, 0px) - 84px - var(--tren, 0px) - 8px); }
#ds-menu .ds-x { position: sticky; float: right; top: -8px; margin: -8px -40px -40px 0; z-index: 1; width: 44px; height: 44px; font-size: 24px; color: var(--chu); }
@media (max-height: 460px) { #ds-menu .ds-hang { max-height: none; overflow: visible; } }
/* ===== rung.css ===== */
/* RỪNG NGUYÊN SINH (trinh_khach/src/rung_ui.ts). Trong rừng body có class trong-rung + trong-hang (hang_mo.css giấu nút đảo / biển).
   Nút dùng chung kiểu .hm-nut của hang mỏ. */

#rg-ui { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
#rg-ui[hidden], #rg-moi-the[hidden], #rg-ve[hidden], #rg-nut-vao[hidden], #rg-nut-doi-ben[hidden] { display: none !important; }
#rg-ui button, #rg-nut-chinh { pointer-events: auto; }
/* 17/11: kiểu .hm-nut trước nằm trong hang_mo.css, bỏ hang mỏ thì mất theo → nút Tổ đội / Trầm / Lều trong rừng hiện ô trắng, không đọc được chữ. Chép về đây. */
.hm-nut { min-height: 42px; padding: 6px 12px; border-radius: 10px; background: var(--nen); border: 1.5px solid var(--vien); color: var(--chu);
  font-weight: 800; font-size: 13px; box-shadow: 0 0 8px rgba(79, 227, 255, .35), 0 3px 8px rgba(0, 0, 0, .4); cursor: pointer; display: flex; align-items: center; gap: 5px; }
.hm-nut[hidden] { display: none; }
.hm-nut:active { transform: scale(.94); }


/* bản đồ nhỏ của rừng: đúng chỗ + đúng cỡ bản đồ biển (--ban-do). Trước to 1.25× nên lấn sang Menu / Chat (hàng nút trên chỉ chừa --ban-do) */
#rg-bdn-nut { 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: var(--bo-the); overflow: hidden; border: 1.5px solid #9dffb0; background: #0b1408; cursor: pointer; }
#rg-bdn { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#rg-nut-ra { position: absolute; top: calc(var(--mt) + var(--tren) + var(--ban-do) + 8px); right: calc(var(--mep) + var(--phai)); border-color: #9dffb0; color: #d6ffe0; }
#rg-nut-ra[hidden] { display: none; }
/* chỉ hướng tới mốc (góp ý #27): dưới nút Ra khỏi rừng, chạm = bỏ */
#rg-chi { position: absolute; top: calc(var(--mt) + var(--tren) + var(--ban-do) + 58px); right: calc(var(--mep) + var(--phai)); min-width: var(--ban-do); min-height: 32px;
  padding: 5px 8px; border-radius: var(--bo-the, 12px); background: var(--nen-chip, rgba(4, 14, 26, .82)); border: 1px solid #ffd84a; color: #fff3c4; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; box-shadow: 0 3px 8px rgba(0, 0, 0, .4); pointer-events: auto; }
#rg-chi[hidden] { display: none; }
#rg-chi i { display: inline-block; font-style: normal; color: #ffd84a; font-size: 15px; line-height: 1; transition: transform .2s linear; will-change: transform; }
#rg-chi b { font-size: 13px; opacity: .7; margin-left: 2px; }

/* thẻ khu: góc trái dưới (như thẻ tầng hang). Gọn 15/11: tên khu · mùa · khí hậu ngắn; chạm thẻ = xem đồ chống cần mang.
   Là nút (vùng chạm ≥ 44px), chiều rộng cố định cỡ ~ 210–260px thay vì giãn theo câu dài. */
#rg-chip { position: static; pointer-events: auto; width: max-content; max-width: 100%;   /* 15/11 buổi 10: thẻ khu nằm ĐẦU cột trái #rg-trai (dưới chỉ số), không còn tự xếp chip */
  min-height: var(--cham-toi-thieu);
  padding: 6px 10px; border-radius: var(--bo-the); background: rgba(6, 14, 6, .8); border: 1px solid rgba(157, 255, 176, .45); color: var(--chu); font: inherit;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; cursor: pointer; }
#rg-chip:active { transform: scale(.97); }
body:not(.cam-ung) #rg-chip { max-width: 260px; }
#rg-chip b { font-size: 13px; line-height: 1.25; color: #d6ffe0; letter-spacing: .3px; }
#rg-chip span { font-size: 11px; color: var(--chu-mo); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rg-chip span[hidden] { display: none; }
#rg-chip.nhap { animation: rg-chip-nhap .5s ease-out 3; }
@keyframes rg-chip-nhap { 50% { border-color: #ffcf8a; box-shadow: 0 0 14px rgba(255, 190, 90, .7); } }

/* khung máu đồng đội */
/* cột trái dưới khung chỉ số: dải boss rồi khung máu đồng đội, xếp chồng trong MỘT khối (trước khung máu đè dòng đồng hồ, dải boss đè khung máu).
   Cảm ứng: xep_chip.ts dời cả khối xuống dưới thanh máu boss / vật cản. */
#rg-trai { position: absolute; left: calc(var(--mep) + var(--le)); top: calc(var(--tren-cao, 72px) + 8px); display: flex; flex-direction: column; align-items: flex-start; gap: var(--cach); max-width: min(300px, 56vw); pointer-events: none; }
#rg-doi-khung { display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
#rg-doi-khung:empty { display: none; }
.rg-tv { min-width: 120px; padding: 3px 7px; border-radius: 8px; background: rgba(4, 10, 14, .72); border: 1px solid rgba(122, 215, 255, .45); font-size: 11px; color: #e8f8ff; }
.rg-tv.xa { opacity: .55; }
.rg-tv span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.rg-mau { display: block; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .55); overflow: hidden; min-width: 60px; flex: 1 1 60px; }
.rg-mau b { display: block; height: 100%; background: linear-gradient(90deg, #ff5a4a, #7dff9a); }

/* cột nút phụ cạnh nút chính (PC). Cảm ứng: các nút mang class nut-vong, hud.ts xepVong xếp lên vòng cung quanh #rg-nut-chinh,
   tránh thanh cầm (trước cột này đứng đè ô thanh cầm ở điện thoại dọc) */
#rg-cot { position: absolute; right: calc(var(--nc-phai) + var(--phai) + var(--nc) + 12px); bottom: calc(var(--nc-day) + var(--day) + 6px); display: flex; flex-direction: column-reverse; gap: 6px; align-items: flex-end; }
#rg-cot .hm-nut[hidden] { display: none; }
#rg-nut-xua.chay { border-color: #ffb454; color: #ffe2b0; box-shadow: 0 0 12px rgba(255, 160, 60, .6); }
body.tay-trai #rg-cot { right: auto; left: calc(var(--nc-phai) + var(--le) + var(--nc) + 12px); align-items: flex-start; }
html body.cam-ung #rg-cot { left: 0; top: 0; right: 0; bottom: 0; display: block; pointer-events: none; }
html body.cam-ung #rg-cot .nut-vong { max-width: none; white-space: normal; text-overflow: clip; font-size: 10.5px; line-height: 1.1; min-height: 0; }
html body.cam-ung #rg-cot .nut-vong span { display: block; }

/* nút chính: đúng chỗ, đúng cỡ, đúng kiểu nút Câu (#nut-chinh, style.css) — 15/11: trước thu vào 7% + nền xanh lá riêng.
   Đánh giữ nền đỏ (đỏ = nguy hiểm); không có mục tiêu ("Tìm…") chỉ mờ đi, không xám hoá. Vòng nhịp nằm TRÊN nút, sát viền. */
#rg-nut-chinh { 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; cursor: pointer; }
#rg-nut-chinh .vong { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center;
  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); font-weight: 800; font-size: 17px; letter-spacing: 1px; line-height: 1.05; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); color: var(--chu); }
body.cam-ung #rg-nut-chinh .vong { font-size: 16px; }
#rg-nut-chinh.danh .vong { background: radial-gradient(circle at 50% 38%, rgba(200, 70, 50, .96), rgba(70, 14, 10, .94) 72%); border-color: #ffb0a0; box-shadow: 0 0 10px rgba(255, 120, 90, .45), 0 4px 10px rgba(0, 0, 0, .45); }
#rg-nut-chinh.mo .vong { opacity: .65; font-size: 14px; letter-spacing: 0; }
#rg-nut-chinh.mo #rg-vong { opacity: 0; }
#rg-nut-chinh.an .vong { transform: scale(.94); }
#rg-nut-chinh svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; z-index: 1; }
#rg-vong { fill: none; stroke: #bff6ff; stroke-width: 4; stroke-dasharray: 289; stroke-linecap: round; opacity: .9; }
body.tay-trai #rg-nut-chinh { right: auto; left: calc(var(--nc-phai) + var(--le)); }

/* ngoài khơi: chip bến rừng (dưới chip thành phố), nút Vào rừng */
#rg-ngoai { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
#rg-ngoai button { pointer-events: auto; }
#rg-ve { position: absolute; top: calc(var(--mt, 8px) + var(--tren, 0px) + var(--ban-do, 88px) + 86px); right: calc(var(--mep, 8px) + var(--phai, 0px)); min-width: var(--ban-do, 88px); min-height: 32px;
  padding: 6px 10px; border-radius: var(--bo-the, 12px); background: var(--nen-chip, rgba(4, 14, 26, .82)); border: 1px solid #9dffb0; color: #d6ffe0; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
#rg-ve i { display: inline-block; font-style: normal; color: #9dffb0; font-size: 14px; line-height: 1; transition: transform .2s linear; }
#rg-ve.xa { border-color: var(--vien-mo); color: var(--chu); }
html body.co-dao-thanh #rg-ve { top: calc(var(--mt, 8px) + var(--tren, 0px) + var(--ban-do, 88px) + 122px); }
body.trong-hang #rg-ve, body.tp-dau #rg-ve, body.ngam-canh #rg-ve { display: none !important; }
#rg-nut-vao { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--nc-day, 20px) + var(--day, 0px) + var(--nc, 80px) + 80px); border-color: #9dffb0; color: #d6ffe0; font-size: 15px; min-height: 48px; padding: 8px 18px; }
#rg-nut-doi-ben { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--nc-day, 20px) + var(--day, 0px) + var(--nc, 80px) + 136px); }

/* lời mời tổ đội */
#rg-moi-the { position: fixed; left: 50%; top: calc(var(--mt, 8px) + 70px); transform: translateX(-50%); z-index: var(--z-the-nhac); max-width: min(360px, calc(100vw - 20px)); font-size: 13px; }
.rg-hang { display: flex; gap: 8px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.rg-hang input { flex: 1 1 140px; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(0, 0, 0, .35); color: var(--chu); }

/* bảng: tổ đội, lều, bản đồ lớn */
.rg-bang { width: min(420px, calc(100vw - 20px)); max-height: calc(var(--cao, 100vh) - 24px); overflow: auto; }
.rg-than { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.rg-muc { margin-top: 8px; font-size: 11px; letter-spacing: 1px; color: #9dffb0; display: flex; align-items: center; gap: 6px; }
.rg-ghi { font-size: 12px; color: var(--chu-mo); line-height: 1.35; }
.rg-dong { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.rg-dong span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-dong img { width: 26px; height: 26px; image-rendering: pixelated; }
.rg-chat { font-size: 12px; max-height: 120px; overflow: auto; background: rgba(0, 0, 0, .25); border-radius: 8px; padding: 4px 6px; }
.hm-nut.nho { min-height: 32px; padding: 4px 9px; font-size: 12px; }
.hm-nut:disabled { opacity: .45; }
#rg-bdl canvas { width: min(540px, calc(100vw - 64px), calc(var(--cao, 100vh) - 150px)); aspect-ratio: 1; display: block; margin: 6px auto; image-rendering: pixelated; border-radius: 8px; background: #05080a; cursor: crosshair; }
#rg-bdl.rg-bang { width: auto; overflow: hidden; }

/* trong rừng: giấu thêm chip / nút của biển */
body.trong-rung #tp-ve, body.trong-rung #dn-ve, body.trong-rung #cd-chip, body.trong-rung #hm-ui, body.trong-rung #hm-toi { display: none !important; }

/* đợt 2 – 3: mùa + khí hậu, miễn đánh, vùng PvP, boss, nút đánh người / phá lều */
#rg-chip.pvp { border-color: rgba(255, 120, 100, .7); }
#rg-chip.pvp b { color: #ffd2c8; }
#rg-chip i { font-style: normal; font-size: 11px; color: #cfe8d4; max-width: 100%; }
#rg-chip i[hidden] { display: none; }
#rg-khi.canh { color: #ffcf8a; font-weight: 700; }
#rg-khi.tot { color: #9dffb0; }
#rg-mien { color: #9fd8ff !important; font-weight: 700; }
#rg-bo-the { position: static; max-width: 100%; pointer-events: auto;
  padding: 6px 10px; border-radius: var(--bo-the); background: rgba(40, 6, 4, .82); border: 1px solid #ff7a5a; color: #ffe0d6; font-weight: 800; font-size: 12px; line-height: 1.35;
  white-space: pre-line; text-align: left; cursor: pointer; }
/* tin boss mới (xuất hiện / gục / rút) đứng đầu dải vài giây: nháy sáng ở đây thay cho thông báo nổi + dòng hệ thống ở chat mờ */
#rg-bo-the.tin { animation: rg-nhap 1s ease-in-out infinite; border-width: 1.5px; }
#rg-bo-the.tin::first-line { color: #ffd84a; }
#rg-bo-the[hidden], #rg-bo-mau[hidden] { display: none; }
@keyframes rg-nhap { 50% { box-shadow: 0 0 14px rgba(255, 90, 60, .7); } }
/* thanh máu boss: giữa trên (PC: dưới hàng nút trên, ~360px). Điện thoại dọc: trải ngang dưới cụm Menu / Chat / bản đồ; điện thoại ngang:
   300px giữa, dưới đồng hồ. Cảm ứng còn được xep_chip.ts dời xuống nếu vẫn chạm vật cản (trước đè Chat + bản đồ). */
#rg-bo-mau { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--mt) + var(--tren) + 58px); width: min(360px, 60vw); pointer-events: none;
  padding: 4px 10px 6px; border-radius: var(--bo-the); background: rgba(20, 4, 2, .8); border: 1px solid rgba(255, 120, 90, .6); text-align: center; }
body.cam-ung #rg-bo-mau { top: calc(var(--mt) + var(--tren) + 40px); width: 300px; padding: 3px 10px 5px; }
@media (orientation: portrait) {
  body.cam-ung #rg-bo-mau { left: calc(var(--mep) + var(--le)); right: calc(var(--mep) + var(--phai)); width: auto; transform: none; top: calc(var(--tren-cao, 72px) + 8px); }
}
#rg-bo-mau b#rg-bo-ten { display: block; font-size: 12px; line-height: 1.3; color: #ffe0d6; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rg-bo-mau .rg-mau { height: 8px; }
#rg-bo-mau .rg-mau b { background: linear-gradient(90deg, #ff3a2a, #ffb14a); }
#rg-nut-pvp { border-color: #ff8a7a; color: #ffe0d6; background: rgba(70, 12, 8, .9); font-weight: 800; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rg-nut-pvp.cho { opacity: .65; }
#rg-nut-pha { border-color: #ffb454; color: #ffe2b0; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* thông báo gộp vào khu / PvP / khí hậu: tối đa 2 dòng (chi tiết đã nằm ở thẻ khu). Tin lỗi / phần thưởng không bị cắt. */
#thong-bao .tb.rg-gop { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 15/11 (góp ý "thẻ boss chắn hết" — cùng luật với boss biển): trên cảm ứng, dải giờ boss rừng chỉ một dòng (boss gần nhất);
   tin boss mới (.tin) vẫn hai dòng vài giây; chạm dải mở bản đồ rừng xem đủ */
body.cam-ung #rg-bo-the:not([hidden]):not(.tin) { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
body.cam-ung #rg-bo-the.tin:not([hidden]) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* ===== thuyen_vien.css ===== */
/* Thuyền viên học nghề (trinh_khach/src/thuyen_vien_ui.ts): bảng Thuyền viên + bảng Quán rượu.
   Theo khung bảng thống nhất (.bang.lon), vùng bấm ≥ 44px, vừa iPhone ngang 844×390 (bảng phủ gần hết màn, thân cuộn). */
.tv-than { overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 10px; min-height: 0; font-size: 13px; }
.tv-dau { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 2px 2px 6px; color: var(--chu-mo); }
.tv-dau b { color: var(--chu); }
.tv-hang { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.tv-hang button, .tv-uv .tv-dong > button, .tv-the .tv-dong > button[data-l] { min-height: 44px; 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-hang button.chinh, .tv-dong > button.chinh { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.tv-hang button.chon { border-color: var(--vien); background: rgba(79, 227, 255, .2); }
.tv-hang button.nguy { border-color: rgba(255, 120, 100, .55); color: #ffc0b0; background: rgba(140, 30, 20, .25); margin-left: auto; }
.tv-hang button:disabled, .tv-dong > button:disabled, .tv-nghe button:disabled, .tv-nap button:disabled { opacity: .42; }
.tv-ghi { color: var(--chu-mo); font-size: 12.5px; line-height: 1.4; margin: 4px 2px 6px; }
.tv-hq { color: #bfe8ff; }
.tv-muc { font-size: 11px; letter-spacing: 1px; color: var(--vien); font-weight: 700; margin: 8px 2px 4px; }

/* thẻ một người */
.tv-the { border: 1px solid var(--vien-mo); border-radius: 9px; margin-bottom: 7px; background: rgba(79, 227, 255, .04); }
.tv-the.mo { border-color: var(--vien); }
.tv-the.xau { border-color: rgba(255, 138, 106, .6); }
.tv-the.da { opacity: .6; }
.tv-dong { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 58px; padding: 5px 9px;
  background: none; border: 0; text-align: left; color: var(--chu); }
button.tv-dong { cursor: pointer; }
.tv-mat { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--da); border: 2px solid var(--toc); display: flex; align-items: center;
  justify-content: center; font-size: 22px; overflow: hidden; }
.tv-mat i { position: absolute; left: 0; right: 0; top: 0; height: 30%; background: var(--toc); }
.tv-giua { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tv-giua b { font-size: 14px; }
.tv-giua small { color: var(--chu-mo); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* B09: ứng viên ở Quán rượu — mô tả tính cách xuống dòng đầy đủ (trước bị cắt "…" làm mất thông tin để quyết định thuê) */
.tv-uv .tv-giua small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
/* 17/11: thẻ thợ sửa đảo — dòng "Tập sự · 36 giây / lượt · đã sửa N" dài hơn cột giữa ở điện thoại dọc (bị cắt cụt bằng …) → cho xuống dòng */
.tv-giua small.ts-dong { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; overflow-wrap: anywhere; }
.tv-hang .tv-ghi { margin: 0; }
.tv-giua .thanh { margin: 4px 0 0; height: 6px; }
.tv-giua > .tv-tinh { align-self: flex-start; }
.tv-tinh { font-style: normal; font-size: 12px; padding: 1px 6px; border-radius: 9px; background: rgba(255, 224, 102, .14); color: #ffe9a6; border: 1px solid rgba(255, 224, 102, .35); }
.tv-tt { text-align: right; font-weight: 700; font-size: 12px; color: #8dffb0; display: flex; flex-direction: column; align-items: flex-end; max-width: 150px; }
.tv-tt small { font-weight: 400; color: var(--chu-mo); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.tv-tt.cho, .tv-tt.du, .tv-tt.ben, .tv-tt.nghi, .tv-tt.o_nha, .tv-tt.giao, .tv-tt.bao { color: #ffe9a6; }
.tv-tt.day, .tv-tt.doi, .tv-tt.mat, .tv-tt.het_dan, .tv-tt.het_van, .tv-tt.thieu_bep, .tv-tt.thieu_ham { color: #ffb08a; }
.tv-ct { padding: 0 9px 8px; border-top: 1px solid var(--vien-mo); }
.tv-chip { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.tv-chip span { font-size: 11.5px; padding: 2px 7px; border-radius: 9px; background: rgba(79, 227, 255, .1); color: var(--chu-mo); }

/* lưới chọn việc / khẩu pháo / món nạp lương */
.tv-nghe, .tv-nap { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.tv-nghe button, .tv-nap button { min-height: 56px; padding: 4px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .06); color: var(--chu);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.tv-nghe button b { font-size: 18px; font-weight: 400; }
.tv-nghe button span { font-size: 12px; font-weight: 700; }
.tv-nghe button small, .tv-nap button small { font-size: 10.5px; color: var(--chu-mo); white-space: nowrap; }
.tv-nghe button.chon { border-color: var(--vien); background: rgba(79, 227, 255, .26); }
.tv-nghe button img, .tv-nap button img { width: 26px; height: 26px; image-rendering: pixelated; }
.tv-nap { margin-bottom: 8px; }

/* điện thoại ngang thấp: gọn lại */
@media (max-height: 430px) {
  .tv-dong { min-height: 50px; padding: 3px 8px; }
  .tv-mat { width: 36px; height: 36px; font-size: 19px; }
  .tv-nghe, .tv-nap { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .tv-nghe button, .tv-nap button { min-height: 48px; }
}

/* buổi 9 (15/11 đợt 3): từ 621 px, khi mở một thuyền viên → danh sách bên trái, chi tiết bên phải (master-detail). Dọc vẫn xổ xuống như cũ.
   .tv-the bỏ khung (display: contents) để .tv-dong vào cột 1 và .tv-ct vào cột 2; hàng cuối là 1fr để chi tiết cao hơn danh sách
   không làm giãn các hàng bên trái. */
@media (min-width: 621px) {
  #than-tv:has(.tv-the.mo) { display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: repeat(23, max-content) 1fr; column-gap: 10px; align-content: start; align-items: start; }
  #than-tv:has(.tv-the.mo) > * { grid-column: 1; }
  #than-tv:has(.tv-the.mo) > .tv-the { display: contents; }
  #than-tv:has(.tv-the.mo) .tv-the > .tv-dong { grid-column: 1; border: 1px solid var(--vien-mo); border-radius: 9px; margin-bottom: 7px; background: rgba(79, 227, 255, .04); }
  #than-tv:has(.tv-the.mo) .tv-the.mo > .tv-dong { border-color: var(--vien); }
  #than-tv:has(.tv-the.mo) .tv-the.xau > .tv-dong { border-color: rgba(255, 138, 106, .6); }
  #than-tv:has(.tv-the.mo) .tv-the.mo > .tv-ct { grid-column: 2; grid-row: 1 / -1; border: 1px solid var(--vien); border-radius: 9px; padding: 8px 9px; background: rgba(79, 227, 255, .05); }
}
/* Ăn uống thuyền viên (trinh_khach/src/tv_an_ui.ts · may_chu/tv_an_uong.go): hai thanh đói / khát nhỏ dưới tên, cảnh báo, nút cho ăn.
   Dùng chung cho thẻ thợ sửa (tho_sua_ui.ts) và thẻ thợ mỏ (mo_khai_thac.ts) — tệp này nạp lúc khởi động bảng Thuyền viên. */
.tva-hang { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 4px; font-size: 11px; color: var(--chu-mo); }
.tva-o { display: inline-flex; align-items: center; gap: 3px; }
.tva-o small { font-size: 10.5px; min-width: 18px; }
.tva-thanh { display: inline-block; width: 52px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.tva-thanh i { display: block; height: 100%; background: #8dffb0; }
.tva-thanh.khat i { background: #7fd4ff; }
.tva-thanh.vua i { background: #ffe9a6; }
.tva-thanh.yeu i { background: #ff8a6a; }
.tva-canh { color: #ffe9a6; font-size: 11px; }
.tva-canh.nghi { color: #ffb08a; font-weight: 700; }
.tva-ngon { color: #ffd27a; font-size: 11px; }
.tva-nut { margin: 2px 0 4px; }
.tv-tt.doi_an, .tv-tt.khat_nuoc { color: #ffb08a; }

/* 22/11 "trả bằng xu, bao ăn bao ở" (thuyen_vien_ui.ts): ba khối Lương (xu) / Bao ăn / Bao ở + băng đỏ khi quỹ lương xu cạn */
.tv-khoi { border: 1px solid var(--vien-mo); border-radius: 9px; padding: 2px 8px; margin: 0 0 8px; background: rgba(79, 227, 255, .03); }
.tv-khoi > .tv-muc:first-child { margin-top: 6px; }
.tv-bang-do { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; border: 2px solid #ff6b57;
  background: rgba(170, 30, 20, .42); color: #ffe3dc; font-size: 13px; line-height: 1.35; }
.tv-bang-do > b { font-size: 15px; color: #fff; }
.tv-bang-do .tv-hang { margin: 4px 0 0; }
.tv-bang-do button.chinh { border-color: #ffb3a6; background: rgba(255, 110, 90, .45); }
.tv-tutra button { flex: 1 1 auto; }
.tv-canh { color: #ffc89a; }
.tv-tt.doi { color: #ff9a8a; }
.tv-nk summary { cursor: pointer; color: var(--chu-mo); font-size: 12.5px; min-height: 32px; display: flex; align-items: center; }
.tv-nk ul { margin: 2px 0 6px; padding-left: 18px; color: var(--chu-mo); font-size: 12px; line-height: 1.5; }
/* ===== thanh_pho.css ===== */
/* Thành phố cảng Bến Vạn Buồm: nút cảng, chip chỉ đường, bảng Chợ cảng / Sạp Cô Mười Gió / Xưởng tàu (trinh_khach/src/thanh_pho_ui.ts) */

/* nút ngữ cảnh: dùng chung khung #dn-thanh của đảo nhà (máy tính = hàng nút giữa dưới, cảm ứng = vòng cung) */
#tp-nut-cap, #tp-nut-roi { border-color: #ffd866 !important; color: #ffe9a6 !important; }
#tp-nut-cua { border-color: #9dffb0 !important; color: #d9ffe2 !important; }
/* nút "Vào {nhà}": to, nhấp nháy nhẹ cho dễ thấy; cảm ứng = nút tròn: biểu tượng to + chữ "Vào" (tên nhà nổi trên đầu người + nhãn toà nhà) */
#dn-thanh #tp-nut-cua { font-size: 15px; animation: tp-cua-nhay 1.6s ease-in-out infinite; }
html body.cam-ung #dn-thanh #tp-nut-cua:not([hidden]) { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-size: 12px; gap: 1px; border-width: 2.5px; transform: scale(1.12); }
#tp-nut-cua .tp-cua-bieu { font-size: 22px; line-height: 1; }
@keyframes tp-cua-nhay { 0%, 100% { box-shadow: 0 0 8px rgba(157, 255, 176, .35), 0 3px 8px rgba(0, 0, 0, .4); } 50% { box-shadow: 0 0 18px rgba(157, 255, 176, .9), 0 3px 8px rgba(0, 0, 0, .4); } }
@media (prefers-reduced-motion: reduce) { #dn-thanh #tp-nut-cua { animation: none; } }

/* chip chỉ đường tới thành phố: ngay dưới chip đảo nhà */
#tp-ve { position: absolute; top: calc(47px + 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 rgba(255, 216, 102, .45); color: #ffe9a6; font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: auto; cursor: pointer; z-index: 2; }
#tp-ve::before { content: ""; position: absolute; inset: -6px -4px; }
#tp-ve[hidden] { display: none; }
#tp-ve i { display: inline-block; font-style: normal; color: #ffd866; font-size: 14px; line-height: 1; transition: transform .2s linear; }
#tp-ve i[hidden] { display: none; }
#tp-ve.xa { border-color: var(--vien-mo); color: var(--chu); }
html body #tp-ve { top: calc(var(--mt, 8px) + var(--tren, 0px) + var(--ban-do, 88px) + 50px); right: calc(var(--mep, 8px) + var(--phai, 0px)); }
html body.co-dao-thanh #tp-ve { top: calc(var(--mt, 8px) + var(--tren, 0px) + var(--ban-do, 88px) + 86px); }
@media (pointer: coarse), (max-height: 520px) {
  html body.cam-ung #tp-ve { top: calc(var(--dh-day, 34px) + 44px); right: calc(var(--ban-do, 88px) + var(--mep, 8px) + 14px + var(--phai, 0px)); min-width: 0; }
}
/* màn ngang cảm ứng: hàng Menu + lối tắt nằm bên trái bản đồ nhỏ, chip này xuống dưới hàng đó */
@media (orientation: landscape) {
  html body.cam-ung #tp-ve { top: calc(var(--dh-day, 34px) + var(--menu, 50px) + 12px); }
  html body.cam-ung.co-dao-thanh #tp-ve { top: calc(var(--dh-day, 34px) + var(--menu, 50px) + 48px); }
}

/* bảng */
.tp-bang .tp-than { overflow-y: auto; padding: 0 10px 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.tp-cho-dau { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 2px 8px; font-size: 13px; color: var(--chu-mo); flex-wrap: wrap; }
.tp-cho-dau b { color: #ffe9a6; font-size: 15px; }
/* thẻ Mua / Bán: hàng thẻ chuẩn .tab-ht (style.css "KHUNG BẢNG THỐNG NHẤT"); ở đây chỉ chỉnh lề vì nằm trong thân bảng */
.tp-tab { margin: 0 0 6px; padding: 0; }
.tp-tab button { flex: 1 1 0; }
.tp-cho-chu { margin: 2px 2px 8px; font-size: 12px; color: var(--chu-mo); line-height: 1.4; }
.tp-ds { display: grid; gap: 5px; }
.tp-nhom { grid-column: 1 / -1; margin: 8px 2px 2px; font-size: 11px; letter-spacing: 1px; color: var(--chu-mo); text-transform: uppercase; }
/* .tp-dong dùng khuôn chung .hang-vat (style.css: ảnh · tên · giá · nút) */
.tp-dong { padding: 5px 7px; border-radius: 9px; background: rgba(79, 227, 255, .05); border: 1px solid var(--vien-mo); }
.tp-dong.mo { opacity: .55; }

.tp-ten { font-size: 13px; font-weight: 700; color: var(--chu); display: flex; flex-direction: column; min-width: 0; }
.tp-ten small { font-size: 11px; font-weight: 500; color: var(--chu-mo); }
/* 17/11: hạn mức thu mua chung toàn máy chủ mỗi ngày ("Cả vùng còn X/Y"): sắp hết tô vàng, hết tô cam */
.tp-ten small.tp-chung { color: #9fd8e6; }
.tp-ten small.tp-chung.sap { color: #ffd27a; }
.tp-ten small.tp-chung.het { color: #ffb08a; font-weight: 700; }
.tp-gia { font-size: 13px; color: #ffe9a6; white-space: nowrap; }
.tp-gia i { font-style: normal; font-size: 10px; margin-left: 2px; }
.tp-len { color: #9dffb0; } .tp-xuong { color: #ff9a8a; }
.tp-nut button, .tp-xuong-nut button { min-height: var(--cham-pc, 36px); min-width: 64px; padding: 4px 12px; border-radius: var(--bo-the, 12px); background: var(--nut-phu-nen); border: 1px solid var(--vien-mo);
  color: var(--chu); font-weight: 700; font-size: 13px; cursor: pointer; }
.tp-nut button.chinh, .tp-xuong-nut button.chinh { border-color: #ffd866; color: #ffe9a6; }
body.cam-ung .tp-nut button, body.cam-ung .tp-xuong-nut button, body.cam-ung .tp-cd-bo { min-height: var(--cham-toi-thieu, 44px); }
.tp-xuong-nut button.nut-chinh { border-color: var(--vien); color: var(--chu); background: var(--nut-chinh-nen); font-size: 14px; }
.tp-xuong-nut button.nut-phu { font-size: 14px; }
.tp-xuong-ok { display: flex; justify-content: center; }
.tp-xuong-ok .chip { font-size: 13px; padding: 6px 14px; }
.tp-nut button:disabled, .tp-xuong-nut button:disabled { opacity: .45; cursor: default; }
.tp-xuong-mau { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 13px; color: var(--chu); margin: 4px 2px 10px; }
.tp-xuong-mau b { height: 10px; border-radius: 6px; background: rgba(0, 0, 0, .5); overflow: hidden; display: block; }
.tp-xuong-mau i { display: block; height: 100%; background: linear-gradient(90deg, #ff9a6a, #9dffb0); }
.tp-xuong-nut { display: grid; gap: 7px; }


/* tiệm trong phố + chỉ dẫn phố (trinh_khach/src/tiem_pho_ui.ts) */
.tp-loi { margin: 2px 2px 8px; font-size: 12.5px; color: #ffe9c4; line-height: 1.4; font-style: italic; }
.tp-loi b { font-style: normal; color: #ffd866; }
.tp-doi { font-size: 12px; } .tp-doi b { font-size: 13px; color: #9dffb0; }
.tp-ly { font-size: var(--chu-phu, 12px); color: var(--chu-mo); padding: 6px 2px; }
/* C08: ba vùng a (biểu tượng) · t (tên + mô tả) · g (khoảng cách) trên MỘT hàng; trước đây .tp-ten khai vùng "t" mà lưới không có → vỡ hàng */
.tp-cd { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "a t g"; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 6px 9px; text-align: left;
  border-radius: 9px; background: rgba(79, 227, 255, .05); border: 1px solid var(--vien-mo); color: var(--chu); cursor: pointer; }
.tp-cd.chon { border-color: #ffd866; background: rgba(255, 216, 102, .12); }
.tp-cd-bieu { grid-area: a; font-size: 22px; text-align: center; }
.tp-cd .tp-ten { grid-area: t; }
.tp-cd-xa { grid-area: g; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #ffe9a6; white-space: nowrap; }
.tp-cd-xa i { display: inline-block; font-style: normal; color: #ffd866; }
.tp-cd-bo { min-height: 40px; border-radius: var(--bo-the, 12px); background: var(--nut-phu-nen); border: 1px solid var(--vien-mo); color: var(--chu); font-weight: 700; font-size: 14px; }

/* C21: sạp Cô Mười Gió — mỗi ô hàng có TÊN dưới hình, nút Đổi cùng tông xanh biển như mọi bảng (dao.css dùng chung .nca-* với bảng người cá, giữ nguyên bên đó) */
#bang-tp-sap .nca-vat { width: 68px; padding: 3px 2px 2px; }
#bang-tp-sap .nca-vat em { display: block; max-width: 100%; font-style: normal; font-size: var(--chu-phu, 12px); line-height: 1.2; color: var(--chu-mo);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bang-tp-sap .nca-vat b { font-size: var(--chu-phu, 12px); }
#bang-tp-sap .nca-vat small { font-size: 11px; }
#bang-tp-sap .nca-luot { font-size: var(--chu-phu, 12px); }
#bang-tp-sap .nca-doi { min-width: 72px; min-height: var(--cham-pc, 36px); border-radius: var(--bo-the, 12px); border: 1px solid var(--vien); color: var(--chu); font-size: 14px;
  background: var(--nut-chinh-nen); box-shadow: 0 0 8px rgba(79, 227, 255, .35); }
body.cam-ung #bang-tp-sap .nca-doi { min-height: var(--cham-toi-thieu, 44px); }
#bang-tp-sap .nca-doi:disabled { opacity: .45; box-shadow: none; filter: none; }
@media (max-width: 620px) { #bang-tp-sap .nca-mon { flex-wrap: wrap; } #bang-tp-sap .nca-phai { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; } }

/* buổi 9: Chợ / Tiệm từ 621 px: lưới 2 cột (ô ≥ 280 px); tiêu đề nhóm trải hết hàng */
@media (min-width: 621px) {
  .tp-ds { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
}

/* buổi 10: thuyền đang buộc bến phố → chỉ còn chip Về thành phố ở cột phải (chip Về đảo nhà hết bị đẩy ra giữa tàu) */
body.tp-dau #dn-ve { display: none !important; }

/* ---------- VIỆC BẾN CẢNG ở Bảng việc làm (trinh_khach/src/viec_cang_ui.ts, may_chu/viec_cang.go) ---------- */
#vcg-nut { border-color: #ffd866 !important; color: #ffe9a6 !important; animation: tp-cua-nhay 1.6s ease-in-out infinite; }
.vcg-than { display: flex; flex-direction: column; gap: 8px; }
.vcg-chu, .vcg-luat { color: var(--chu-mo); font-size: 12px; margin: 0; line-height: 1.45; }
.vcg-dong-dau { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }
.vcg-dong-dau > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vcg-dong-dau small, .vcg-than > small { color: var(--chu-mo); font-size: 12px; }
.vcg-cham { display: flex; gap: 5px; }
.vcg-cham i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--vien-mo); background: rgba(0, 10, 20, .4); }
.vcg-cham i.da { border-color: #ffd866; background: #ffd866; box-shadow: 0 0 6px rgba(255, 216, 102, .6); }
.vcg-het { margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid #9dffb0; color: #d9ffe2; background: rgba(157, 255, 176, .08); }
.vcg-the { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--vien-mo); background: rgba(0, 10, 20, .3); }
.vcg-the.dang { border-color: #ffd866; background: rgba(255, 216, 102, .07); }
.vcg-the p { margin: 0; font-size: 13px; line-height: 1.4; }
.vcg-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vcg-dau b, .vcg-chuoi b { color: #ffe9a8; }
.vcg-dau button { min-height: 40px; padding: 0 14px; flex: 0 0 auto; }
body.cam-ung .vcg-dau button, body.cam-ung .vcg-hang button { min-height: 44px; }
.vcg-thuong { font-size: 12.5px; font-weight: 700; color: #d9ffe2; }
.vcg-chuoi.da { opacity: .65; }
.vcg-hang { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.vcg-hang button { min-height: 40px; padding: 0 12px; }
.vcg-hang .nguy { border-color: rgba(255, 106, 90, .6); }
/* chip việc đang làm: giữa trên, dưới chip cờ caro */
.vcg-chip { position: fixed; z-index: var(--z-bang); left: 50%; transform: translateX(-50%); top: calc(var(--tren, 0px) + 116px); display: flex; align-items: center; gap: 6px;
  max-width: calc(100vw - 24px); min-height: 40px; padding: 0 4px 0 14px; border-radius: 20px; border: 1px solid #ffd866; background: var(--nen-dam); color: #ffe9a6;
  font-weight: 800; font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.vcg-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcg-chip.gap { border-color: #ff8a7a; color: #ffc4b8; animation: vcg-gap 0.9s ease-in-out infinite; }
@keyframes vcg-gap { 50% { box-shadow: 0 0 14px rgba(255, 120, 100, .8); } }
.vcg-bo { flex: 0 0 auto; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--vien-mo); background: rgba(0, 0, 0, .3); color: var(--chu); font-size: 15px; }
body.cam-ung .vcg-bo { width: 40px; height: 40px; }
.vcg-chip[hidden], .vcg-luoi[hidden] { display: none; }
@media (orientation: landscape) and (max-height: 560px) { .vcg-chip { top: calc(var(--tren, 0px) + 54px); font-size: 12px; } }
/* lớp vá lưới: tấm lưới vuông, chỗ rách là nút tròn ≥ 46 px */
.vcg-luoi { position: fixed; z-index: calc(var(--z-bang) + 1); left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 6px;
  width: min(420px, calc(100vw - 24px), calc(var(--cao, 100vh) - 140px)); padding: 10px; border-radius: 14px; border: 1px solid #ffd866; background: var(--nen-dam);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .6); }
.vcg-luoi-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #ffe9a8; }
.vcg-luoi-o { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; touch-action: manipulation;
  background:
    repeating-linear-gradient(45deg, transparent 0 15px, rgba(222, 196, 140, .55) 15px 17px),
    repeating-linear-gradient(-45deg, transparent 0 15px, rgba(222, 196, 140, .55) 15px 17px),
    linear-gradient(#1d4a5e, #123445); border: 3px solid #8a5a34; }
.vcg-lo { position: absolute; transform: translate(-50%, -50%); width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, .55); background: rgba(5, 20, 30, .85); color: #fff; font-weight: 900; font-size: 18px; }
.vcg-lo.ke { border: 3px solid #ffd866; color: #ffe9a6; animation: vcg-ke 0.9s ease-in-out infinite; }
.vcg-lo.va { border: 3px solid #9dffb0; background: rgba(157, 255, 176, .25); color: #d9ffe2; }
.vcg-lo.lac { animation: vcg-lac .3s; }
@keyframes vcg-ke { 50% { box-shadow: 0 0 0 6px rgba(255, 216, 102, .35), 0 0 16px rgba(255, 216, 102, .8); } }
@keyframes vcg-lac { 25% { margin-left: -5px; } 75% { margin-left: 5px; } }
@media (orientation: landscape) and (max-height: 560px) { .vcg-luoi { width: min(360px, calc(var(--cao, 100vh) - 24px)); padding: 6px; } .vcg-luoi > .vcg-chu { display: none; } .vcg-lo { width: 46px; height: 46px; } }
@media (prefers-reduced-motion: reduce) { #vcg-nut, .vcg-lo.ke, .vcg-chip.gap { animation: none; } }
/* ===== khu_pho.css ===== */
/* KHU MỚI CỦA PHỐ CẢNG (18/11 mở rộng phố): tên khu khi bước vào, việc vặt nhà dân, ngắm từ hải đăng, góc chụp ảnh (trinh_khach/src/khu_pho_ui.ts) */
#kpho-ten { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  z-index: 40; text-align: center; padding: 8px 18px 7px; border-radius: 14px; background: rgba(9, 26, 42, .78); border: 1px solid rgba(255, 216, 102, .55);
  color: #ffe9a6; transition: opacity .35s, transform .35s; max-width: calc(100vw - 32px); }
#kpho-ten.hien { opacity: 1; transform: translate(-50%, 0); }
#kpho-ten b { display: block; font-size: 17px; letter-spacing: .5px; text-shadow: 0 1px 2px #000; white-space: nowrap; }
#kpho-ten small { display: block; font-size: 12px; color: #cfeaf5; margin-top: 2px; }
#bang-kp-dan .kp-loi { font-style: italic; color: var(--chu, #e8fdff); margin: 4px 2px 8px; line-height: 1.4; }
body.kp-ngam::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 5; box-shadow: inset 0 0 120px rgba(255, 233, 166, .35); }
/* chế độ chụp ảnh: ẩn mọi thứ trừ màn chơi và khung ảnh */
body.kp-anh > *:not(#cv):not(#kp-anh-khung) { visibility: hidden !important; }
#kp-anh-khung { display: none; }
body.kp-anh #kp-anh-khung { display: flex; position: fixed; inset: 10px; z-index: 60; border: 6px solid rgba(255, 248, 230, .92); border-radius: 6px;
  flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 10px; box-shadow: 0 0 0 2px rgba(60, 40, 10, .5) inset; cursor: pointer; }
#kp-anh-khung span { font: 700 16px system-ui, sans-serif; color: #fff8e6; text-shadow: 0 1px 3px #000; }
#kp-anh-khung small { font: 12px system-ui, sans-serif; color: #fff8e6; opacity: .85; text-shadow: 0 1px 2px #000; }
/* ===== tu_hoi.css ===== */
/* BẾN TỤ HỘI (tu_hoi_ui.ts, 20/11): thẻ "Vạn Buồm đang có N người" + nút Ra phố · khu đang có người trong Chỉ dẫn phố */
#th-the { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--mt, 8px) + var(--tren, 0px) + 58px); z-index: 6;
  width: min(330px, calc(100vw - 24px)); box-sizing: border-box; display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 6px 8px 12px; border-radius: var(--bo-the, 12px); background: var(--nen-chip, rgba(4, 14, 26, .86));
  border: 1px solid rgba(255, 216, 102, .5); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); color: var(--chu, #eaf6ff); pointer-events: auto;
  animation: th-vao .35s ease-out; }
#th-the[hidden] { display: none; }
@keyframes th-vao { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
#th-the .th-nd { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
#th-the .th-dau { font-size: 13px; font-weight: 700; line-height: 1.3; }
#th-the .th-dau b { color: #ffe9a6; }
#th-the .th-phu { font-size: 12px; color: var(--chu-mo, #a9c3d6); line-height: 1.3; }
#th-the .th-di { justify-self: start; margin-top: 3px; min-height: 36px; padding: 6px 16px; border-radius: 18px; border: 0; cursor: pointer;
  background: linear-gradient(#ffd866, #f0b43a); color: #2a1a00; font-weight: 800; font-size: 13px; }
#th-the .th-ly { font-size: 11px; color: #ffcf9e; line-height: 1.3; }
#th-the .th-x { flex: 0 0 auto; width: 32px; height: 32px; border: 0; background: none; color: var(--chu-mo, #a9c3d6); font-size: 20px;
  line-height: 1; cursor: pointer; padding: 0; }

/* Chỉ dẫn phố: hàng khu đang có người (tiem_pho_ui.ts veChiDan ← tu_hoi_ui.ts htmlKhuChiDan) */
.tp-cd.th-cd { border-color: rgba(159, 240, 184, .4); }
.tp-cd.th-cd .th-so { color: #9ff0b8; font-weight: 800; }
/* màn dọc: hàng nút + chip quà ngày chiếm ~170 px đầu màn → thẻ nằm dưới, giữa vùng biển trống */
@media (orientation: portrait) {
  #th-the { top: calc(var(--mt, 8px) + var(--tren, 0px) + 172px); }
}
@media (orientation: landscape) {
  #th-the { top: calc(var(--mt, 8px) + var(--tren, 0px) + 46px); width: min(300px, calc(100vw - 24px)); }
}
/* ===== giao_thuong.css ===== */
/* Giao thương: bảng Sàn giao dịch (trinh_khach/src/san_giao_dich_ui.ts) + cửa sổ trao đổi trực tiếp (trao_doi_ui.ts).
   Dùng lại khung .bang.lon / .tab-ht / .o-tui có sẵn; mọi vùng bấm ≥ 44 px trên máy cảm ứng, ô nhập 16 px (iOS khỏi tự phóng to). */

.gt-bang:not(.co-vua) { width: min(720px, calc(100vw - 20px - var(--le) - var(--phai))); }   /* Sàn có lớp co-vua; chỉ bảng Trao đổi còn dùng cỡ này */
.gt-bang .tieu-de .gt-dst { margin-left: auto; color: #ffe9a6; font-weight: 800; letter-spacing: 0; font-size: 14px; white-space: nowrap; }
.gt-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 0 10px 10px; }
.gt-tab button i.cham { position: static; display: inline-block; margin-left: 4px; }
.gt-tab button .so { font-size: 11px; color: var(--chu-mo); margin-left: 3px; }

/* thanh lọc */
.gt-loc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 0 8px; }
.gt-loc input, .gt-loc select, .gt-form input, .gt-form select { min-height: 40px; border-radius: 8px; background: rgba(4, 14, 26, .7); border: 1px solid var(--vien-mo);
  color: var(--chu); font-size: 16px; padding: 4px 10px; min-width: 0; }
.gt-loc input { flex: 1 1 150px; }
.gt-loc select { flex: 0 1 auto; max-width: 46%; font-size: 14px; }
.gt-nut { min-height: 40px; min-width: 44px; padding: 4px 12px; border-radius: 8px; background: rgba(79, 227, 255, .1); border: 1px solid var(--vien-mo);
  color: var(--chu); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.gt-nut.chinh { border-color: #ffd866; color: #ffe9a6; background: rgba(255, 216, 102, .12); }
.gt-nut.do { border-color: #ff8f80; color: #ffc4bb; }
.gt-nut:disabled { opacity: .45; cursor: default; }
body.cam-ung .gt-nut, body.cam-ung .gt-loc input, body.cam-ung .gt-loc select, body.cam-ung .gt-form input { min-height: 44px; }
.gt-ghi { font-size: 12px; color: var(--chu-mo); line-height: 1.45; margin: 2px 2px 8px; }
.gt-ghi b { color: var(--chu); }
.gt-canh { font-size: 13px; color: #ffd6a0; background: rgba(255, 180, 84, .1); border: 1px solid rgba(255, 180, 84, .45); border-radius: 8px; padding: 7px 10px; margin: 0 0 8px; line-height: 1.4; }

/* danh sách tin */
.gt-ds { display: grid; gap: 6px; }
.gt-dong { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 6px 8px; border-radius: 10px;
  background: rgba(79, 227, 255, .05); border: 1px solid var(--vien-mo); }
.gt-dong.toi { background: rgba(255, 216, 102, .06); border-color: rgba(255, 216, 102, .35); }
.gt-dong > img, .gt-vat img { width: 36px; height: 36px; image-rendering: pixelated; }
.gt-giua { min-width: 0; }
.gt-giua > b { display: block; font-size: 14px; color: var(--chu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-giua small, .gt-phu { font-size: 12px; color: var(--chu-mo); }
.gt-phu { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 1px; }
.gt-phu .gt-cua { color: #ffe9a6; }
.gt-phai { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.gt-gia { text-align: right; color: #ffe9a6; font-weight: 800; font-size: 15px; white-space: nowrap; line-height: 1.15; }
.gt-gia small { display: block; font-size: 11px; color: var(--chu-mo); font-weight: 500; }
.gt-tk { font-weight: 700; }
.gt-tk.re { color: #9dffb0; } .gt-tk.dat { color: #ff9a8a; } .gt-tk.vua { color: var(--chu-mo); }
.gt-doi { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--chu); font-weight: 700; }
.gt-doi img { width: 28px; height: 28px; image-rendering: pixelated; vertical-align: middle; }
.gt-doi .mui { color: #ffd866; }
.gt-chon { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0 2px; border-top: 1px dashed var(--vien-mo); margin-top: 4px; }
.gt-chon input { width: 76px; min-height: 40px; border-radius: 8px; background: rgba(4, 14, 26, .7); border: 1px solid var(--vien-mo); color: var(--chu); font-size: 16px; text-align: center; }
.gt-chon .gt-tong { flex: 1 1 140px; font-size: 13px; color: var(--chu); }
.gt-chon .gt-tong b { color: #ffe9a6; }
.gt-trong { color: var(--chu-mo); padding: 22px 10px; text-align: center; font-size: 13px; line-height: 1.5; }
.gt-nhan { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--vien-mo); color: var(--chu-mo); }
.gt-nhan.ban { color: #9fe8ff; border-color: rgba(79, 227, 255, .5); } .gt-nhan.mua { color: #ffe9a6; border-color: rgba(255, 216, 102, .5); } .gt-nhan.doi { color: #d7b8ff; border-color: rgba(198, 132, 255, .5); }

/* form đăng tin */
.gt-form { display: grid; gap: 9px; }
.gt-loai { display: flex; gap: 6px; }
.gt-loai button { flex: 1; min-height: 44px; border-radius: 9px; background: rgba(79, 227, 255, .06); border: 1px solid var(--vien-mo); color: var(--chu-mo); font-weight: 800; font-size: 14px; }
.gt-loai button.chon { color: var(--chu); background: rgba(79, 227, 255, .22); border-color: var(--vien); }
.gt-muc { font-size: 11px; letter-spacing: 1px; color: var(--chu-mo); text-transform: uppercase; margin-bottom: -4px; }
.gt-luoi { display: grid; grid-template-columns: repeat(auto-fill, 50px); gap: 6px; max-height: 172px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.gt-luoi .o-tui { width: 50px; height: 50px; cursor: pointer; }
.gt-luoi .o-tui img { width: 34px; height: 34px; }
.gt-hang { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gt-hang > label { font-size: 13px; color: var(--chu); font-weight: 700; min-width: 92px; }
.gt-hang input { width: 96px; text-align: center; }
.gt-chon-mon { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--chu); }
.gt-chon-mon img { width: 32px; height: 32px; image-rendering: pixelated; }
.gt-tk-hop { font-size: 12px; color: var(--chu-mo); line-height: 1.5; padding: 7px 9px; border-radius: 8px; background: rgba(79, 227, 255, .05); border: 1px solid var(--vien-mo); }
.gt-tk-hop b { color: var(--chu); }
.gt-form .gt-tong { font-size: 14px; color: var(--chu); }
.gt-form .gt-tong b { color: #ffe9a6; }
.gt-day { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.gt-day .gt-nut { min-width: 110px; min-height: 46px; font-size: 14px; }

/* lịch sử */
.gt-ls { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(79, 227, 255, .12); font-size: 13px; color: var(--chu); }
.gt-ls img { width: 30px; height: 30px; image-rendering: pixelated; }
.gt-ls small { display: block; color: var(--chu-mo); font-size: 11px; }
.gt-ls .cong { color: #9dffb0; font-weight: 800; white-space: nowrap; } .gt-ls .tru { color: #ff9a8a; font-weight: 800; white-space: nowrap; }

/* ===== trao đổi trực tiếp ===== */
#td-moi-hop { position: fixed; z-index: var(--z-modal); left: 50%; top: calc(var(--tren, 0px) + 10px); transform: translateX(-50%); width: min(420px, calc(100vw - 24px));
  background: var(--nen-dam, rgba(4, 16, 28, .96)); border: 2px solid #ffd866; border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .55); }
#td-moi-hop[hidden] { display: none; }
#td-moi-hop .nd { font-size: 15px; font-weight: 800; color: var(--chu); margin-bottom: 8px; }
#td-moi-hop .nut { display: flex; gap: 8px; }
#td-moi-hop .nut .gt-nut { flex: 1; min-height: 46px; font-size: 15px; }
#td-moi-hop .thanh { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 8px; }
#td-moi-hop .thanh i { display: block; height: 100%; background: #ffd866; transition: width .25s linear; }

.td-bang .gt-than { display: flex; flex-direction: column; gap: 8px; }
.td-canh { font-size: 14px; font-weight: 800; color: #fff; background: rgba(220, 70, 50, .85); border: 2px solid #ffb4a6; border-radius: 9px; padding: 8px 10px; animation: tdNhay .6s ease-in-out infinite alternate; }
.td-canh[hidden] { display: none; }
@keyframes tdNhay { from { box-shadow: 0 0 0 rgba(255, 120, 100, 0); } to { box-shadow: 0 0 18px rgba(255, 120, 100, .85); } }
.td-hai { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
.td-ben { border: 1px solid var(--vien-mo); border-radius: 10px; padding: 8px; background: rgba(79, 227, 255, .04); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.td-ben.khoa { border-color: #ffd866; background: rgba(255, 216, 102, .07); }
.td-ben.dong-y { border-color: #9dffb0; background: rgba(157, 255, 176, .08); }
.td-ben h3 { margin: 0; font-size: 15px; color: var(--chu); display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.td-tt { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--vien-mo); color: var(--chu-mo); white-space: nowrap; }
.td-tt.khoa { color: #ffe9a6; border-color: #ffd866; } .td-tt.dong-y { color: #9dffb0; border-color: #9dffb0; }
.td-mon { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 14px; color: var(--chu); }
.td-mon img { width: 30px; height: 30px; image-rendering: pixelated; }
.td-mon .ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.td-mon .so { font-weight: 800; color: #ffe9a6; font-size: 15px; }
.td-mon.bot { outline: 2px solid #ff8f80; border-radius: 6px; }
.td-sl { display: flex; gap: 4px; align-items: center; }
.td-sl button { min-width: 40px; min-height: 40px; border-radius: 8px; background: rgba(4, 14, 26, .6); border: 1px solid var(--vien-mo); color: var(--chu); font-weight: 800; font-size: 16px; }
.td-sl input { width: 52px; min-height: 40px; border-radius: 8px; background: rgba(4, 14, 26, .7); border: 1px solid var(--vien-mo); color: var(--chu); font-size: 16px; text-align: center; }
body.cam-ung .td-sl button, body.cam-ung .td-sl input { min-height: 44px; min-width: 44px; }
.td-dst { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: #ffe9a6; }
.td-dst input { width: 96px; min-height: 40px; border-radius: 8px; background: rgba(4, 14, 26, .7); border: 1px solid var(--vien-mo); color: var(--chu); font-size: 16px; text-align: center; }
.td-trong { font-size: 13px; color: var(--chu-mo); padding: 6px 2px; }
.td-chon { border: 1px dashed var(--vien-mo); border-radius: 10px; padding: 8px; }
.td-chon[hidden] { display: none; }
.td-day { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.td-day .gt-ghi { flex: 1 1 200px; margin: 0; font-size: 13px; }
.td-day .gt-nut { min-height: 48px; min-width: 130px; font-size: 15px; }
.td-tom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.td-tom > div { border-radius: 10px; padding: 10px; border: 2px solid var(--vien-mo); }
.td-tom .dua { border-color: rgba(255, 143, 128, .6); background: rgba(255, 143, 128, .06); }
.td-tom .nhan { border-color: rgba(157, 255, 176, .6); background: rgba(157, 255, 176, .06); }
.td-tom h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: 1px; color: var(--chu-mo); }
.td-tom .td-mon { font-size: 16px; }
.td-gan { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(79, 227, 255, .12); }
.td-gan img { width: 36px; height: 36px; image-rendering: pixelated; border-radius: 8px; }
.td-gan b { font-size: 14px; color: var(--chu); }
.td-gan small { display: block; font-size: 12px; color: var(--chu-mo); }
.td-bat { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; color: var(--chu); cursor: pointer; }
.td-bat input { width: 22px; height: 22px; }

/* điện thoại ngang thấp (iPhone ≈ 740×360 … 844×390): gọn chữ, cột hẹp vẫn đọc được */
@media (max-height: 500px) {
  .gt-than { padding: 0 8px 8px; }
  .gt-loc input { flex-basis: 110px; }
  .gt-loc select { font-size: 13px; padding: 4px 6px; }
  .gt-loc { padding-bottom: 6px; }
  .gt-dong { padding: 5px 7px; }
  .gt-luoi { max-height: 112px; }
  .td-ben { padding: 6px; }
  .td-ben h3 { font-size: 14px; }
  .td-day .gt-nut { min-height: 46px; }
  #td-moi-hop { top: calc(var(--tren, 0px) + 6px); }
}
@media (max-width: 900px) and (max-height: 500px), (max-width: 560px) { .gt-an-hep { display: none; } }
@media (max-width: 560px) {
  .td-hai, .td-tom { grid-template-columns: 1fr; }
  .gt-hang > label { min-width: 0; width: 100%; }
}

/* buổi 9: Sàn giao dịch từ 621 px: lưới tin 2 cột (ô ≥ 280 px); dòng tiêu đề / lời nhắn trong lưới trải hết hàng */
@media (min-width: 621px) {
  .gt-ds { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
  .gt-ds > :not(.gt-dong) { grid-column: 1 / -1; }
}
/* ===== van_hanh.css ===== */
/* Vận hành: bảng Tài khoản, mã khôi phục, quên mật khẩu (tai_khoan_ui.ts) · chuông thông báo, thông báo lớn, hẹn bảo trì
   (thong_bao_ui.ts) · bảng Quản trị (quan_tri_ui.ts). Tệp này do tai_khoan_ui.ts tự gắn <link>. Khung bảng dùng chung .bang / .bang.lon. */

/* ---------- ô nhập + nút dùng chung trong ba bảng ---------- */
.vh-o { display: block; width: 100%; padding: 9px 11px; min-height: 44px; border-radius: 7px; border: 1px solid var(--vien-mo); background: rgba(0, 0, 0, .35);
  color: var(--chu); font: inherit; font-size: 16px; outline: none; -webkit-user-select: text; user-select: text; }
.vh-o:focus { border-color: var(--vien); }
select.vh-o { padding: 0 8px; appearance: auto; }
textarea.vh-o { resize: none; height: 66px; line-height: 1.35; }
.vh-nut { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--vien-mo); background: rgba(79, 227, 255, .1); font-weight: 700; white-space: nowrap; }
.vh-nut.chinh { border-color: var(--vien); background: linear-gradient(#1f6f8c, #134a63); box-shadow: var(--phat); }
.vh-nut.do { border-color: var(--do); background: linear-gradient(#8c2f2f, #5a1c1c); }
.vh-nut.nho { min-height: 36px; padding: 0 10px; font-size: 12.5px; }
.vh-nut:disabled { opacity: .45; }
.vh-nut:active { transform: translateY(1px); }
.vh-loi { color: var(--do); font-size: 13px; min-height: 18px; margin-top: 4px; }
.vh-loi.tot { color: var(--xanh); }
.vh-ghi { font-size: 12.5px; color: var(--chu-mo); line-height: 1.45; }
.vh-ghi b { color: var(--chu); }
.vh-nhan { display: block; font-size: 11px; letter-spacing: 1px; color: var(--chu-mo); margin: 8px 0 3px; text-transform: uppercase; }

/* ---------- bảng Tài khoản ---------- */
/* #bang-tk: cỡ do lớp co-vua (tai_khoan_ui.ts) */
#bang-tk[hidden] { display: none; }
.tk-than { padding: 0 12px 12px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.tk-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.tk-luoi > div { min-width: 0; }
.tk-luoi .rong { grid-column: 1 / -1; }
.tk-dong { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(79, 227, 255, .12); font-size: 13.5px; }
.tk-dong span { color: var(--chu-mo); flex: 0 0 auto; }
.tk-dong b { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-hang { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.tk-hang .vh-o { flex: 1; min-width: 0; }
.tk-khoi { margin-top: 10px; padding: 9px 10px; border-radius: 8px; border: 1px dashed var(--vien-mo); }
.tk-khoi > b { display: block; font-size: 13px; margin-bottom: 2px; }
#cd-tk .vh-nut { min-height: 44px; }
#cd-tk ~ .cd-tieu { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(79, 227, 255, .12); }
@media (max-height: 500px) {
  .vh-nhan { margin: 5px 0 2px; }
  .tk-khoi { margin-top: 7px; padding: 7px 9px; }
  .tk-dong { padding: 5px 0; }
}
@media (max-width: 520px) { .tk-luoi { grid-template-columns: 1fr; } }

/* ---------- mã khôi phục (hiện đúng một lần) + quên mật khẩu ---------- */
#tk-ma, #man-kp { position: fixed; inset: 0; z-index: var(--z-man-tren); display: flex; align-items: center; justify-content: center; background: rgba(2, 10, 20, .72);
  padding: max(8px, var(--tren)) max(10px, var(--phai)) max(8px, var(--day)) max(10px, var(--le)); overflow-y: auto; }
#tk-ma[hidden], #man-kp[hidden] { display: none; }
#man-kp { z-index: var(--z-man-tren); }
.tk-ma-hop { width: min(470px, 100%); margin: auto; background: var(--nen-dam); padding: 12px 16px 14px; text-align: center; }
.tk-ma-hop h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: 1.5px; color: var(--vang); }
.tk-ma-ma { margin: 8px 0; padding: 10px 6px; border-radius: 9px; border: 1px solid var(--vang); background: rgba(255, 216, 74, .08); color: #fff6d8;
  font: 700 clamp(17px, 5.2vw, 24px)/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 1.5px; -webkit-user-select: all; user-select: all; word-break: break-all; }
.tk-ma-nut { display: flex; gap: 8px; margin-top: 10px; }
.tk-ma-nut .vh-nut { flex: 1; }
.kp-hop { width: min(380px, 100%); margin: auto; background: var(--nen-dam); padding: 12px 16px 14px; }
.kp-hop h3 { margin: 0 0 2px; font-size: 14px; letter-spacing: 1.5px; text-align: center; }
.kp-hop .vh-o { margin-top: 7px; }
#dn-quen { display: block; margin: 6px auto 0; padding: 8px 12px; min-height: 40px; background: none; border: 0; color: #bfefff; font-size: 13px; text-decoration: underline; }
@media (max-height: 420px) {
  .tk-ma-hop { padding: 8px 14px 10px; } .tk-ma-ma { margin: 5px 0; padding: 7px 6px; } .tk-ma-nut { margin-top: 6px; }
  .kp-hop { padding: 8px 14px 10px; width: min(560px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .kp-hop > h3, .kp-hop > .vh-ghi, .kp-hop > .vh-loi, .kp-hop > .tk-ma-nut { grid-column: 1 / -1; }
  .kp-hop .vh-o { margin-top: 5px; }
  #dn-quen { margin-top: 0; min-height: 34px; padding: 5px 12px; }
}

/* ---------- chuông thông báo ---------- */
#nut-chuong .nv-chu { font-size: 19px; }
#nut-chuong.rung .nv-chu { animation: chuongRung .7s ease-in-out 2; transform-origin: 50% 10%; }
@keyframes chuongRung { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-16deg); } 50% { transform: rotate(14deg); } 80% { transform: rotate(-8deg); } }
/* C06/C07: Thông báo = bảng nhỏ giữa màn (class "bang lon co-nho" ở thong_bao_ui.ts), cao theo nội dung; không còn thả xuống từ chuông */
#bang-chuong { z-index: var(--z-bang-tren); }
#bang-chuong[hidden] { display: none; }
#bang-chuong > .tieu-de .nut-x { margin-left: 8px; }
#chuong-doc { min-height: var(--cham-pc, 36px); padding: 0 12px; border-radius: var(--bo-the, 12px); border: 1px solid var(--vien-mo); background: var(--nut-phu-nen, none); font-size: 13px; font-weight: 700; color: var(--chu); margin-left: auto; letter-spacing: 0; text-transform: none; }
body.cam-ung #chuong-doc { min-height: var(--cham-toi-thieu, 44px); }
/* C15: không còn thông báo chưa đọc → nút mờ hẳn */
#chuong-doc:disabled { opacity: .4; cursor: default; }
#chuong-ds { overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; min-height: 0; }
.chuong-muc { display: flex; gap: 9px; align-items: center; width: 100%; min-height: 48px; padding: 6px 8px; margin-top: 5px; border-radius: 8px; text-align: left;
  border: 1px solid rgba(79, 227, 255, .14); background: rgba(79, 227, 255, .04); }
.chuong-muc > i { flex: 0 0 26px; font-style: normal; font-size: 19px; text-align: center; }
.chuong-muc > div { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
.chuong-muc small { display: block; font-size: 11px; color: var(--chu-mo); }
.chuong-muc > em { flex: 0 0 auto; font-style: normal; color: var(--vien); font-size: 16px; }
.chuong-muc.moi { border-color: var(--vien); background: rgba(79, 227, 255, .13); }
.chuong-muc.moi > div { font-weight: 700; }
.chuong-muc.cho { border-color: rgba(255, 216, 74, .55); background: rgba(255, 216, 74, .08); }
.chuong-nhom { font-size: 11px; letter-spacing: 1px; color: var(--chu-mo); margin: 8px 2px 0; }

/* thông báo lớn toàn máy chủ + chip hẹn bảo trì */
#tb-lon { position: fixed; z-index: var(--z-toast); left: 50%; top: calc(var(--dh-day, 34px) + 10px); transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--vang); background: rgba(30, 22, 4, .93); box-shadow: 0 0 16px rgba(255, 216, 74, .45);
  color: #fff6d8; font-size: 15px; font-weight: 700; line-height: 1.35; text-align: center; animation: tbVao .25s ease-out; }
#tb-lon[hidden] { display: none; }
#tb-lon small { display: block; font-size: 11px; font-weight: 400; color: #e9d9a0; letter-spacing: 1px; margin-bottom: 2px; }
#dh-baotri { border-color: var(--cam); color: #ffe1b0; }
#dh-baotri.gap { border-color: var(--do); color: #ffd0d0; animation: nhapNhayBT 1s steps(2) infinite; }
@keyframes nhapNhayBT { 50% { opacity: .55; } }

/* ---------- bảng Quản trị ---------- */
#bang-qt { width: min(880px, calc(100vw - 16px)); height: min(580px, calc(var(--cao, 100vh) - 16px)); }
@supports (height: 1dvh) { #bang-qt { height: min(580px, calc(100dvh - 16px)); } }
#bang-qt[hidden] { display: none; }
#qt-tab { display: flex; gap: 5px; padding: 0 10px 7px; flex: 0 0 auto; overflow-x: auto; scrollbar-width: none; }
#qt-tab::-webkit-scrollbar { display: none; }
#qt-tab button { flex: 1 0 auto; min-height: 40px; padding: 5px 10px; 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; }
#qt-tab button.chon { color: var(--chu); background: rgba(79, 227, 255, .2); border-color: var(--vien); }
body.cam-ung #qt-tab button { min-height: 44px; }
#qt-than { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 10px; }
.qt-dau { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.qt-dau b { font-size: 14px; }
.qt-dau .vh-o { flex: 1 1 140px; min-width: 0; width: auto; }
.qt-dau .day { margin-left: auto; }
#bang-qt a { color: var(--vien); }
.qt-bang { width: 100%; border-collapse: collapse; font-size: 13px; }
.qt-bang th { text-align: left; font-size: 11px; letter-spacing: .8px; color: var(--chu-mo); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--vien-mo); position: sticky; top: 0; background: #06131f; }
.qt-bang td { padding: 7px 6px; border-bottom: 1px solid rgba(79, 227, 255, .1); vertical-align: middle; }
.qt-bang tr[data-ten] { cursor: pointer; }
.qt-bang tr[data-ten]:hover td { background: rgba(79, 227, 255, .07); }
.qt-bang td.so { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qt-the { display: inline-block; padding: 1px 6px; border-radius: 99px; font-size: 11px; font-weight: 700; border: 1px solid var(--vien-mo); margin-left: 4px; vertical-align: 1px; }
.qt-the.xanh { border-color: var(--xanh); color: var(--xanh); } .qt-the.do { border-color: var(--do); color: var(--do); } .qt-the.cam { border-color: var(--cam); color: var(--cam); }
.qt-hai { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 10px; align-items: start; }
.qt-khoi { border: 1px solid rgba(79, 227, 255, .18); border-radius: 9px; padding: 8px 10px; background: rgba(79, 227, 255, .03); min-width: 0; }
.qt-khoi + .qt-khoi { margin-top: 8px; }
.qt-khoi > h4 { margin: 0 0 5px; font-size: 12px; letter-spacing: 1px; color: var(--vien); font-weight: 700; }
.qt-hs-ten { font-size: 16px; font-weight: 800; }
.qt-tui { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.qt-tui span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .3); font-size: 12px; }
.qt-tui img { width: 18px; height: 18px; image-rendering: pixelated; }
.qt-hang { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.qt-hang .vh-o { flex: 1 1 110px; min-width: 0; width: auto; }
.qt-hang select.vh-o { flex: 0 1 128px; }
.qt-dong { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(79, 227, 255, .1); font-size: 13px; }
.qt-dong > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qt-dong small { display: block; color: var(--chu-mo); font-size: 11.5px; }
.qt-o-so { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-bottom: 8px; }
.qt-o-so > div { border: 1px solid rgba(79, 227, 255, .18); border-radius: 8px; padding: 6px 9px; background: rgba(79, 227, 255, .04); }
.qt-o-so span { display: block; font-size: 11px; color: var(--chu-mo); }
.qt-o-so b { font-size: 16px; }
.qt-o-so b.xau { color: var(--do); } .qt-o-so b.tot { color: var(--xanh); }
.qt-loi { font: 11.5px/1.4 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; padding: 5px 0; border-bottom: 1px solid rgba(255, 106, 106, .2); color: #ffd6d6; -webkit-user-select: text; user-select: text; }
.qt-cot { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin: 4px 0 2px; }
.qt-cot i { flex: 1; min-width: 4px; background: linear-gradient(#4fe3ff, #1f6f8c); border-radius: 2px 2px 0 0; }
@media (max-width: 700px) { .qt-hai { grid-template-columns: 1fr; } }
@media (max-height: 500px) {
  #qt-tab { padding-bottom: 5px; }
  .qt-khoi { padding: 6px 9px; } .qt-khoi + .qt-khoi { margin-top: 6px; }
  .qt-bang td { padding: 5px 6px; }
}

/* hộp thư: thư quà bù chỉ có 🪙 (xa_hoi_ui.ts) */
.xh-qua.xh-diem { display: inline-flex; align-items: center; justify-content: center; font-size: 24px; color: var(--vang); text-shadow: 0 0 8px rgba(255, 216, 74, .6); }
/* Cài đặt → Tài khoản → Xoá tài khoản (tai_khoan_ui.ts) */
.tk-xoa-ds { margin: 6px 0 8px; padding-left: 20px; font-size: 13px; line-height: 1.45; }
.tk-xoa a, #cd-chinh-sach a { color: var(--vien, #4fe3ff); }

/* bảng Tài khoản có 4 thẻ (thêm "Xoá tài khoản"): màn hẹp thì xuống 2 hàng, không cắt chữ */
#tk-tab { flex-wrap: wrap; }
#tk-tab button { flex: 1 1 calc(50% - 6px); min-width: 0; white-space: normal; }
@media (min-width: 520px) { #tk-tab button { flex-basis: 0; } }
/* ===== menu_the.css ===== */
/* Menu dạng thẻ (trinh_khach/src/menu_the.ts, THỬ NGHIỆM, mặc định tắt). Tệp chỉ được nạp khi bật, và mọi luật đều nằm dưới body.menu-the.
   Cấu trúc kiểu game nhập vai di động cổ điển, cỡ chạm + nhận diện của Farsea:
     #mt-hang  hàng nút hai cấp sát đáy màn (nhóm → mục), nút có biểu tượng + tên, ≥ 68 × 64 px
     .bang.lon[data-mt]  cửa sổ giữa màn (điện thoại ngang ~66% bề ngang, cao tới mép trên hàng nút mềm; Bản đồ 86%; máy tính giữ cỡ cũ)
     #mt-dau   hàng đầu BÊN TRONG cửa sổ: ◀ [biểu tượng + tên thẻ] ▶ (nút 44 × 44), gắn thẳng vào .tieu-de của bảng (15/11 đợt 2)
     #mt-mem   nút mềm ngay dưới cửa sổ, thẳng hai mép: trái = lệnh chính (nếu có), phải = Đóng (≥ 96 × 40)
     #mt-chan  dòng chân xu + cấp (chỉ bảng Túi) · #mt-nen lớp TRONG SUỐT bắt chạm ra ngoài (không làm tối cảnh)
   body.mt-an-hud: ẩn các nút chơi nửa dưới HUD khi hàng nút / cửa sổ đang mở (thanh chỉ số, bản đồ nhỏ, nút Menu + Chat vẫn thấy).
   Lớp chồng (thang chung --z-* ở style.css): HUD < #mt-nen --z-bang-nen < cửa sổ --z-bang < hàng nút --z-bang-tren < hộp --z-modal < màn che / hộp xác nhận.
   Hình học của cửa sổ dùng !important vì nhiều bảng đặt cỡ bằng id (#bang-tui.bang.lon, #bang-st…) mạnh hơn mọi bộ chọn theo lớp. */
body.menu-the { --mt-dau: 40px; --mt-mem: 40px; }

/* ---------- nút chơi nửa dưới HUD: ẩn khi hàng nút / cửa sổ mở (visibility: không đổi bố cục, các phép đo của HUD không chạy lại) ---------- */
body.menu-the.mt-an-hud :is(#thanh-cam, #goi-y, #dpad, #nut-chinh, #nut-phu, #cum-lai, #vung-can, #can-di, #dn-thanh, #hc-thanh, #dao-thanh, #sx-thanh,
  #ttb-nut, #nut-ngam, #nut-goc, .nut-vong, #rg-nut-chinh, #rg-cot, #ghim-chip) { visibility: hidden !important; pointer-events: none !important; }
/* buổi 10: lối tắt trùng với Menu (nút trên cùng) ẩn khi Menu / bảng mở; GIỮ Menu + Chat; nút Zalo / Facebook PC gắn thẳng vào #nut-tren cũng nằm trong luật này */
body.menu-the.mt-an-hud #nut-tren > :not(#nut-menu):not(#nut-chat) { visibility: hidden !important; pointer-events: none !important; }
body.menu-the .mt-n { min-width: 0; }

/* lớp trong suốt bắt chạm ra ngoài: chạm cảnh game là tắt hàng nút / đóng cửa sổ */
body.menu-the #mt-nen { position: fixed; inset: 0; z-index: var(--z-bang-nen); background: transparent; touch-action: none; }

/* ---------- hàng nút hai cấp sát đáy màn ---------- */
body.menu-the #mt-hang { --n: 6; position: fixed; z-index: var(--z-bang-tren); left: 50%; bottom: calc(8px + var(--day)); transform: translateX(-50%);
  width: min(calc(100vw - 16px - var(--le) - var(--phai)), calc(var(--n) * 102px + 12px)); display: flex; gap: 6px; padding: 6px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; touch-action: pan-x; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  background: rgba(4, 14, 26, .78); border: 1px solid var(--vien-mo); border-radius: 14px; box-shadow: var(--phat), 0 6px 18px rgba(0, 0, 0, .5);
  animation: mt-len .14s ease-out; }
body.menu-the #mt-hang::-webkit-scrollbar { display: none; }
/* C14: hàng cuộn ngang có GỢI Ý — bắt khớp nhẹ + mờ dần mép còn nút khuất (khung_bang.ts gắn .con-trai / .con-phai) */
body.menu-the #mt-hang { scroll-snap-type: x proximity; }
body.menu-the .mt-n { scroll-snap-align: start; }
body.menu-the #mt-hang.con-phai { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
body.menu-the #mt-hang.con-trai { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 30px), transparent); }
body.menu-the #mt-hang.con-trai.con-phai { -webkit-mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent); }
/* màn dọc: đúng 5 nút vừa một hàng (nút thứ 6 trở đi cuộn + mờ mép), nút không bị cắt nửa chừng */
@media (max-width: 620px) { body.menu-the #mt-hang .mt-n { flex: 1 0 calc((100% - 24px) / 5); max-width: none; } body.menu-the #mt-hang .mt-n[data-lui] { flex: 0 0 56px; } }
@keyframes mt-len { from { transform: translate(-50%, 14px); opacity: 0; } }
/* nút: biểu tượng sẵn có của mục (28 px) phía trên + tên một dòng; màn rộng thì các nút giãn đều (tới 112 px) */
body.menu-the .mt-n { position: relative; flex: 1 0 68px; max-width: 112px; height: 64px; padding: 4px 4px 3px; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--nen-dam); border: 1.5px solid var(--vien-mo); border-radius: 10px; color: var(--chu); }
body.menu-the .mt-n > * { pointer-events: none; }
body.menu-the .mt-n img { width: 28px; height: 28px; flex: 0 0 auto; object-fit: contain; image-rendering: pixelated; }
body.menu-the .mt-n .mt-bt { flex: 0 0 auto; font-size: 23px; font-weight: 400; line-height: 28px; height: 28px; }
body.menu-the .mt-n span { max-width: 100%; font-size: 11.5px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.menu-the .mt-n .cham { top: 2px; right: 2px; }
body.menu-the .mt-n:hover { border-color: var(--vien); }
body.menu-the .mt-n:active { transform: scale(.95); background: rgba(79, 227, 255, .18); border-color: var(--vien); }
body.menu-the .mt-n[data-lui] { flex: 0 0 56px; color: var(--vien); }
body.menu-the .mt-n[data-lui] .mt-bt { font-size: 30px; font-weight: 700; }

/* ---------- cửa sổ ---------- */
body.menu-the .bang.lon[data-mt] { z-index: var(--z-bang) !important; border: 1.5px solid var(--vien); border-radius: 8px;
  box-shadow: var(--phat), 0 10px 34px rgba(0, 0, 0, .55);
  }   /* máy tính: giữ cỡ và vị trí cũ */
/* ĐẦU BẢNG THỐNG NHẤT (15/11 đợt 2, CH-3): menu_the.ts gắn #mt-dau VÀO hàng .tieu-de (lớp .co-mt-dau), không đè lên nữa.
   Hàng 1: ◀ [biểu tượng + tên thẻ] ▶ · (ô phụ của bảng nếu có) · ×   — mọi nút 44 × 44.
   Hàng 2 (chỉ hiện khi có chữ): phần đếm phụ của nhãn gốc (.td-goc: "29/30 ô", "1/12 cây"…) + dòng xu #mt-chan.
   Nhãn gốc .td-goc: chữ ẩn bằng font-size 0 (chữ trùng với tên giữa), chỉ giữ các phần tử con. Nút × là nút gốc của bảng (kiểu chung ở style.css). */
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau { flex-wrap: wrap; align-items: center; gap: 0 6px; padding: 4px 4px 4px 4px; }
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > * { order: 1; }
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > #mt-dau { order: 0; }
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > .nut-x { order: 2; }
/* ngắt hàng: mọi thứ sau đây xuống hàng 2 (phần tử giả cao 0 nên không có hàng 2 thì không tốn chỗ) */
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau::after { content: ""; order: 8; flex: 0 0 100%; height: 0; }
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > .td-goc { order: 9; flex: 0 1 auto; min-width: 0; font-size: 0; letter-spacing: 0; text-transform: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; }
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > .td-goc > * { font-size: var(--chu-phu); font-weight: 700; color: var(--chu-mo); margin: 0 8px 4px 0; text-shadow: none; }
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > .td-goc > :empty { display: none; }
body.menu-the .bang.lon[data-mt] > .tieu-de.co-mt-dau > #mt-chan { order: 10; }
body.menu-the #mt-mem { display: none !important; }

/* điện thoại cầm ngang: cửa sổ phủ gần hết bề ngang (lề 8 px + vùng an toàn): thanh chỉ số / nhiệm vụ đã ẩn khi mở, bản đồ nhỏ + chip phải nằm DƯỚI cửa sổ (buổi 9: trước đây lùi 100 px mỗi bên làm lộ nửa chip) */
@media (max-width: 620px), (max-height: 500px) {
  /* cửa sổ nằm GIỮA thanh chỉ số (trái, rộng 202 px) và bản đồ nhỏ (phải, 84 px): không đè nửa vời lên cái nào; nút Menu + Chat ẩn khi cửa sổ mở
     (body.mt-co-bang) vì đã có nút "Đóng" và ◀ ▶ */
  body.menu-the .bang.lon[data-mt] { left: calc(8px + max(var(--le), var(--phai))) !important; right: calc(8px + max(var(--le), var(--phai))) !important; top: calc(6px + var(--tren)) !important; bottom: auto !important;
    transform: none !important; width: auto !important; min-width: 0 !important;
    height: calc(var(--cao) - 14px - var(--tren) - var(--day)) !important; max-height: none !important; font-size: 13px; }
  /* 13/11: cửa sổ ở ĐÚNG TÂM màn (hai lề bằng nhau); thanh chỉ số + dòng nhiệm vụ bên trái ẩn khi cửa sổ mở để không bị đè một nửa */
  body.menu-the.mt-co-bang :is(#nut-tren, #chi-so, #cot-trai, #ht-thanh) { visibility: hidden !important; pointer-events: none !important; }
  /* Bản đồ cần rộng (canvas + cột chú giải 176 px): riêng bảng này phủ gần hết bề ngang, che hẳn thanh chỉ số + bản đồ nhỏ */
  body.menu-the #bang-ban-do.bang.lon[data-mt] { left: calc(8px + max(var(--le), var(--phai))) !important; right: calc(8px + max(var(--le), var(--phai))) !important; }
  /* Túi: lưới trái + thông tin phải (giữ), cột thông tin hẹp lại một nấc để lưới còn 3 cột */
  /* màn thấp: dòng xu + cấp nằm ở góc phải hàng đầu (menu_the.ts datViTri), không chừa chân; thẻ lọc + thanh nhanh thấp lại để lưới món thấy ≥ 2 hàng rưỡi */
  body.menu-the #mt-chan.mt-chan-dau .mt-cap { display: none; }
  /* (15/11 đợt 2: bỏ hai dòng ép nút lọc Túi + ô thanh nhanh xuống 32 px — dưới vùng chạm 44 px; cỡ của Túi do nhóm B đặt ở tui_do.css) */
  body.menu-the #bang-tui.bang.lon[data-mt] #tui-thanh { padding-top: 3px; }
  body.menu-the #bang-tui.bang.lon[data-mt] .than-tui { padding-bottom: 5px; }
  body.menu-the #bang-tui.bang.lon[data-mt] .than-tui { grid-template-columns: minmax(0, 1fr) 210px; gap: 6px 8px; }
  body.menu-the #bang-tui.bang.lon[data-mt] #luoi-tui { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
  body.menu-the #bang-tui.bang.lon[data-mt] #luoi-tui .o-tui, body.menu-the #bang-tui.bang.lon[data-mt] #luoi-tui .cc-o { height: 60px; }
  body.menu-the #bang-tui.bang.lon[data-mt] #luoi-tui .o-tui { padding: 3px 3px 2px; gap: 2px; }
  body.menu-the #bang-tui.bang.lon[data-mt] #luoi-tui .o-tui img { width: 34px; height: 34px; }
  /* Sổ tay: cột chi tiết cố định 250 px → 210 px (Thuyền giữ hai cột từ 621 px: nang_cap.css) */
  /* (C10: cột chi tiết 210 px CHỈ khi hai cột cạnh nhau — màn ngang; màn dọc chi tiết nằm dưới lưới, không khoá chiều cao) */
  @media (min-width: 621px) { body.menu-the #bang-st.bang.lon[data-mt] .sc-ct { flex-basis: 210px; font-size: 12px; } }
  /* Đảo nhà: thẻ công trình tối thiểu 210 px → 180 px (vẫn hai cột trong ~540 px) */
  body.menu-the #bang-dn.bang.lon[data-mt] .dn-cts { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  /* Hải chiến / Hải đội / Mùa giải: các cột nhãn cố định 92–150 px co lại */
  body.menu-the #bang-hc.bang.lon[data-mt] .mg-truoc > div { grid-template-columns: 110px minmax(0, 1fr); }
  body.menu-the #bang-hc.bang.lon[data-mt] .hd-chon, body.menu-the #bang-hc.bang.lon[data-mt] .mg-thuong { grid-template-columns: 80px minmax(0, 1fr); }
}
/* điện thoại cầm dọc (đang bị màn xoay ngang chặn, nhưng không được vỡ): cửa sổ gần hết bề ngang */
@media (max-width: 620px) and (min-height: 501px) {
  body.menu-the .bang.lon[data-mt], body.menu-the #bang-ban-do.bang.lon[data-mt] { width: calc(100vw - 16px - var(--le) - var(--phai)) !important; min-width: 0 !important; }
  body.menu-the #bang-tui.bang.lon[data-mt] .than-tui { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- hàng đầu trong khung: ◀ [biểu tượng + tên] ▶ (nằm TRONG .tieu-de, xem "ĐẦU BẢNG THỐNG NHẤT" ở trên) ---------- */
body.menu-the #mt-dau { flex: 1 1 0; min-width: 0; height: 44px; display: flex; align-items: center; gap: 6px; }
/* tên giữa: CÙNG KIỂU tiêu đề bảng thường (chữ hoa 13 px màu --vien), không còn tấm nền riêng */
body.menu-the #mt-ten { flex: 1 1 auto; height: 44px; min-width: 0; padding: 0 8px; display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--vien); touch-action: none; }
body.menu-the #mt-ten .mt-ten-bt { flex: 0 0 auto; display: flex; align-items: center; }
body.menu-the #mt-ten .mt-ten-bt:empty { display: none; }
body.menu-the #mt-ten .mt-ten-bt img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
body.menu-the #mt-ten .mt-ten-bt .mt-bt { font-size: 19px; font-weight: 400; line-height: 24px; color: var(--chu); }
body.menu-the #mt-ten .mt-ten-chu { min-width: 0; font-size: var(--chu-td); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 6px rgba(79, 227, 255, .6); }
/* ◀ ▶: 44 × 44, cùng kiểu nút × của đầu bảng */
body.menu-the .mt-mui { position: relative; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border-radius: var(--bo-the);
  display: inline-flex; align-items: center; justify-content: center; background: var(--nut-phu-nen); border: 1px solid var(--vien-mo);
  color: var(--vien); font-size: 15px; line-height: 1; }
body.menu-the .mt-mui > * { pointer-events: none; }
body.menu-the .mt-mui:hover { border-color: var(--vien); }
body.menu-the .mt-mui:active { transform: scale(.93); background: rgba(79, 227, 255, .18); }
/* chấm đỏ: góc trên phải, NẰM TRONG nút (không che mũi tên, không lấn ra ngoài khung bảng) */
body.menu-the .mt-mui .cham { top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }

/* ---------- dòng xu + cấp (chỉ bảng Túi): hàng 2 của đầu bảng, cạnh "29/30 ô" ---------- */
body.menu-the #mt-chan { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 0; pointer-events: none;
  font-size: var(--chu-phu); font-weight: 700; color: var(--chu-mo); letter-spacing: 0; text-transform: none; text-shadow: none; white-space: nowrap; }
body.menu-the #mt-chan .mt-xu { color: #ffe9a8; }
/* ---------- hai nút mềm ngay dưới cửa sổ, thẳng hai mép ---------- */
body.menu-the #mt-mem { position: fixed; z-index: var(--z-bang-tren); display: flex; align-items: center; gap: 12px; pointer-events: none; }
body.menu-the #mt-mem button { pointer-events: auto; height: var(--mt-mem); min-width: 96px; max-width: 46%; padding: 0 16px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--nen-dam); border: 1.5px solid var(--vien);
  box-shadow: var(--phat), 0 3px 8px rgba(0, 0, 0, .45); color: var(--chu); font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.menu-the #mt-mem #mt-dong { margin-left: auto; }
body.menu-the #mt-mem #mt-lenh { color: #fff; background: linear-gradient(rgba(79, 227, 255, .24), rgba(79, 227, 255, .08)), var(--nen-dam); }
body.menu-the #mt-mem button:hover { filter: brightness(1.15); }
body.menu-the #mt-mem button:active { transform: scale(.95); }

/* chế độ sắp xếp / xây nhà / ngắm cảnh: không bao giờ hiện khung / hàng nút đè lên */
body.menu-the:is(.dang-sx, .dang-xay, .ngam-canh) :is(#mt-dau, #mt-nen, #mt-chan, #mt-mem, #mt-hang) { display: none; }

/* ---------- nút Menu + nút Chat trên màn chính điện thoại: hai nút tròn cùng cỡ (chỉ hình dáng, không đổi vị trí) ---------- */
html body.menu-the.cam-ung #nut-tren > #nut-menu { border-radius: 50%; }
html body.menu-the.cam-ung #nut-tren > #nut-chat { width: var(--menu); height: var(--menu); border-radius: 50%; border: 1.5px solid var(--vien);
  background: var(--nen); box-shadow: var(--phat), 0 3px 8px rgba(0, 0, 0, .45); }

/* buổi 10: 5 nhóm cấp đầu trên điện thoại dọc — chữ nhỏ lại một nấc để "Hằng ngày", "Nhà & thuyền", "Sổ tay & quà" không bị cắt thành "…" */
@media (max-width: 420px) { body.menu-the #mt-hang .mt-n { padding-left: 2px; padding-right: 2px; } body.menu-the #mt-hang .mt-n span { font-size: 10px; letter-spacing: -.2px; } }
/* ===== the_nhac.css ===== */
/* Thẻ nhắc nhỏ không chặn màn hình: mời bật thông báo khi vắng (thong_bao_day.ts) · nhắc khách lưu tài khoản (nhac_luu_tk.ts).
   Tệp này do hai mô-đun đó tự gắn <link>. Thêm: dòng công tắc "Thông báo khi vắng" trong Cài đặt. */
.the-nhac { position: fixed; z-index: var(--z-the-nhac); left: 50%; transform: translateX(-50%); top: calc(var(--tren, 0px) + 112px);
  width: min(360px, calc(100vw - 24px)); padding: 11px 12px 10px; border-radius: 12px; border: 1px solid var(--vien, #4fe3ff);
  background: var(--nen, rgba(7, 24, 40, .9)); box-shadow: var(--phat), 0 6px 20px rgba(0, 0, 0, .45); color: var(--chu, #e2fbff);
  font-size: 14px; line-height: 1.4; animation: the-nhac-vao .25s ease-out; }
.the-nhac[hidden] { display: none; }
/* A07: thẻ nhắc không chồng lên bảng lớn / màn gục / màn tạo nhân vật (đóng xong thì hiện lại, vì thẻ chỉ bị ẩn bằng CSS) */
body.cb-man .the-nhac:not(#_) { display: none; }
.the-nhac > b { padding-right: 36px; }
.the-nhac b { display: block; margin-bottom: 3px; font-size: 14.5px; }
.the-nhac small { display: block; color: var(--chu-mo, #9fc6d0); font-size: 12.5px; }
.the-nhac .tn-hang { display: flex; gap: 8px; justify-content: flex-end; margin-top: 9px; }
.the-nhac button { min-height: var(--cham-toi-thieu, 44px); padding: 0 14px; border-radius: 8px; border: 1px solid var(--vien-mo, rgba(79, 227, 255, .4));
  background: rgba(79, 227, 255, .1); color: inherit; font: inherit; font-weight: 700; }
.the-nhac button.chinh { border-color: var(--vien, #4fe3ff); background: linear-gradient(#1f6f8c, #134a63); }
.the-nhac .tn-x { position: absolute; top: 0; right: 0; min-height: var(--cham-toi-thieu, 44px); width: var(--cham-toi-thieu, 44px); padding: 0; border: 0; background: none; font-size: 18px; opacity: .7; }
@keyframes the-nhac-vao { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-height: 500px) { .the-nhac { top: calc(var(--tren, 0px) + 64px); } }
#cd-day-meo { font-size: 12.5px; color: var(--chu-mo, #9fc6d0); line-height: 1.45; padding: 4px 0 8px; }
/* thẻ "Thêm vào màn hình chính" (the_mhc.ts): các bước hướng dẫn */
.the-nhac .mhc-b { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 13.5px; font-weight: 700; }
.the-nhac .mhc-b i { flex: none; width: 20px; height: 20px; border-radius: 50%; background: rgba(79, 227, 255, .2); border: 1px solid var(--vien-mo, rgba(79, 227, 255, .4));
  font-style: normal; font-size: 12px; line-height: 18px; text-align: center; }
.the-nhac .mhc-ic { flex: none; color: var(--vien, #4fe3ff); }
/* ===== cot_truyen.css ===== */
/* CỐT TRUYỆN sau tân thủ (trinh_khach/src/cot_truyen.ts): hàng nút trong thẻ nhiệm vụ, khung chi tiết #bang-ctr, thẻ Cốt truyện trong bảng Hệ thống */

/* thẻ nhiệm vụ đang là của cốt truyện: nút tắt mũi tên tân thủ không dùng nữa (cốt truyện có nút Chỉ đường riêng) */
body.ctr-bat #hd-tat { display: none; }
#ctr-hang { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 10px 0; }
#ctr-hang[hidden], #nhiem-vu.thu-gon #ctr-hang { display: none; }
#ctr-hang button { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; background: rgba(4, 14, 26, .6);
  border: 1px solid rgba(140, 236, 255, .4); color: #bfefff; }
#ctr-hang button[hidden] { display: none; }
#ctr-hang button.chinh, #bang-ctr button.chinh { background: linear-gradient(#ffd84a, #e0a92a); color: #2a1a00; border-color: #fff0b0; font-weight: 700; }
#nv-nd .ctr-ten { color: #ffe9a6; }
#nv-nd .ctr-td { color: #9fe8ff; font-weight: 700; white-space: nowrap; }
#nv-nd .ctr-dat { color: #7dffb0; }
/* nhiệm vụ xong, chờ nhận: dòng thu gọn sáng vàng nhè nhẹ */
#nhiem-vu.ctr-xong { border-color: rgba(255, 216, 74, .8); }
#nhiem-vu.ctr-xong.thu-gon { animation: ctrSang 1.6s ease-in-out infinite; }
#nhiem-vu.ctr-xong.thu-gon #nv-tom { color: #ffe9a6; }
@keyframes ctrSang { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 216, 74, 0); } 50% { box-shadow: 0 0 12px 2px rgba(255, 216, 74, .65); } }

/* khung chi tiết */
#bang-ctr .ctr-than { padding: 10px 14px 14px; overflow-y: auto; -webkit-overflow-scrolling: touch; line-height: 1.45; }
#bang-ctr .ctr-ten-lon { font-size: 18px; font-weight: 800; color: #ffe9a6; margin: 2px 0 4px; }
#bang-ctr .ctr-mota { font-size: 14px; margin-bottom: 8px; }
#bang-ctr .thanh { margin: 4px 0; }
#bang-ctr .ctr-thuong { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--vang, #ffd84a); }
#bang-ctr .ctr-thuong img, .ctr-chuong img { width: 20px; height: 20px; image-rendering: pixelated; vertical-align: middle; }
#bang-ctr .ctr-mo { margin-top: 6px; font-size: 13px; color: #7dffb0; }
#bang-ctr .ctr-cach { margin: 4px 0 0; padding-left: 22px; font-size: 14px; }
#bang-ctr .ctr-cach li { margin: 3px 0; }
#bang-ctr .ctr-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#bang-ctr .ctr-nut button { flex: 1 1 140px; min-height: 40px; border-radius: 9px; font-size: 14px; }

/* thẻ Cốt truyện */
.ctr-chuong { border: 1px solid var(--vien-mo, rgba(140, 236, 255, .3)); border-radius: 9px; padding: 7px 10px; margin-bottom: 7px; background: rgba(4, 14, 26, .35); }
.ctr-chuong.khoa { opacity: .6; }
.ctr-chuong.dang { border-color: rgba(255, 216, 74, .7); }
.ctr-cd { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ctr-ds-nv { margin: 5px 0 0; padding-left: 20px; font-size: 13px; }
.ctr-ds-nv li { margin: 2px 0; }
.ctr-ds-nv li.xong { color: #9fd9b5; }
.ctr-ds-nv li.dang { color: #ffe9a6; }
.ctr-nut-nho { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ctr-nut-nho button { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.ctr-khoa { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ctr-khoa li { padding: 4px 0; border-bottom: 1px dashed rgba(140, 236, 255, .15); }
.ctr-khoa li.mo { color: #9fd9b5; }

@media (max-width: 480px) {
  #bang-ctr .ctr-ten-lon { font-size: 17px; }
  #bang-ctr .ctr-nut button { flex-basis: 100%; }
}

/* tấm lời kể #truyen (truyen_ui.ts, dùng chung cho tân thủ + cốt truyện): trước nằm giữa màn che nhân vật và đảo → thành DẢI ở mép trên,
   ngay dưới hàng chỉ số (--tren-cao do giao_dien.ts đo), xa cần điều khiển + nút hành động ở đáy. Tự đóng: cot_truyen.ts tuDongDongTruyen
   (vạch mảnh ở đáy dải co dần = thời gian còn lại). */
html body #truyen { top: calc(var(--tren-cao, 56px) + 6px); bottom: auto; width: min(560px, calc(100vw - 24px)); max-height: 34vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; box-sizing: border-box; padding: 8px 14px 9px 34px; font-size: 14.5px; line-height: 1.45;
  border-radius: 10px; animation: truyenTren .3s ease-out; }
html body #truyen .tr-dau { left: 7px; top: 7px; font-size: 19px; }
html body #truyen .tr-tiep { margin-top: 3px; font-size: 11.5px; }
html body #truyen.tr-dem::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 1px; background: rgba(138, 90, 30, .55);
  transform-origin: left center; animation: truyenDem var(--tr-tg, 8000ms) linear forwards; pointer-events: none; }
@keyframes truyenTren { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes truyenDem { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* điện thoại cầm ngang: chừa hai bên cho cột nhiệm vụ (trái) và bản đồ nhỏ (phải) */
@media (orientation: landscape) and (max-height: 520px) {
  html body #truyen { top: calc(var(--tren-cao, 44px) + 4px); width: min(520px, calc(100vw - 300px)); min-width: min(300px, calc(100vw - 24px)); max-height: 40vh; font-size: 13.5px; padding: 6px 12px 8px 30px; }
  html body #truyen .tr-dau { font-size: 16px; left: 6px; top: 6px; }
}
/* điện thoại cầm ngang: lệch sang phải cho khỏi đè dòng nhiệm vụ ở góc trái, hẹp lại cho khỏi chạm nút Menu */
@media (orientation: landscape) and (max-height: 480px) {
  html body.cam-ung #truyen { left: calc(50% + 62px); width: min(470px, calc(100vw - 370px)); }
}
/* ===== ban_co.css ===== */
/* CỜ CARO (trinh_khach/src/ban_co_ui.ts, may_chu/ban_co.go): sảnh mời / chơi với máy / xem, bàn 15×15 trên canvas, chip ván dở, thẻ lời mời.
   Dọc 390×844: bàn rộng hết bảng (ô ~23 px). Ngang thấp (≤ 560 px): bàn bên trái cao gần hết màn, chữ + nút bên phải. */
.caro-than { flex: 1 1 auto; overflow-y: auto; padding: 0 10px 10px; overscroll-behavior: contain; min-height: 0; }
.caro-the { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--vien-mo);
  background: rgba(0, 10, 20, .3); }
.caro-the > b { color: #ffe9a8; }
.caro-the small, .caro-chu, .caro-luat, .caro-phu { color: var(--chu-mo); font-size: 12px; margin: 0; }
.caro-luat { line-height: 1.45; }
.caro-moi-o { border-color: var(--vang); background: rgba(255, 216, 74, .08); }
.caro-dong { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.caro-dong span { min-width: 0; overflow-wrap: anywhere; }
.caro-hang, .caro-nut { display: flex; flex-wrap: wrap; gap: 8px; }
.caro-hang button, .caro-dong button, .caro-nut button { min-height: 40px; padding: 0 12px; }
body.cam-ung .caro-hang button, body.cam-ung .caro-dong button, body.cam-ung .caro-nut button { min-height: 44px; }
.caro-nut .nguy { border-color: rgba(255, 106, 90, .6); }
.caro-van { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.caro-ban { display: flex; justify-content: center; }
#caro-cv { display: block; width: min(100%, 520px, calc(var(--cao) - 330px)); min-width: 240px; aspect-ratio: 1; touch-action: manipulation; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55); cursor: pointer; }
.caro-ben { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.caro-ng { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.caro-ng span { min-width: 0; overflow-wrap: anywhere; padding: 2px 6px; border-radius: 7px; border: 1px solid transparent; }
.caro-ng .caro-x { color: #ff9a8a; } .caro-ng .caro-oo { color: #8ec5ff; }
.caro-ng span.luot { border-color: currentColor; background: rgba(255, 255, 255, .06); }
.caro-trang { font-size: 15px; }
.caro-trang.toi b { color: var(--vang); }
#caro-giay { font-variant-numeric: tabular-nums; color: var(--chu-mo); font-weight: 800; }
.caro-canh { color: #ffb0a0; font-weight: 800; font-size: 13px; }
.caro-xn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--chu-mo); min-height: 36px; }
.caro-xn input { width: 20px; height: 20px; }
@media (orientation: landscape) and (max-height: 560px) {
  #bang-caro.bang.lon > .tieu-de { min-height: 44px; margin-bottom: 4px; }
  .caro-van { flex-direction: row; align-items: flex-start; }
  .caro-ban { flex: 0 0 auto; }
  #caro-cv { width: calc(var(--cao) - 74px - var(--tren) - var(--day)); min-width: 0; }
  .caro-ben { flex: 1 1 0; }
}
.caro-chip { position: fixed; z-index: var(--z-bang); left: 50%; transform: translateX(-50%); top: calc(var(--tren) + 70px); min-height: 40px; padding: 0 16px;
  border-radius: 20px; border: 1px solid var(--vien-mo); background: var(--nen-dam); color: var(--chu); font-weight: 800; white-space: nowrap; }
.caro-chip.toi { border-color: var(--vang); color: #ffe9a8; box-shadow: 0 0 10px rgba(255, 216, 74, .45); }
.caro-moi-the { position: fixed; z-index: calc(var(--z-bang) + 1); left: 50%; transform: translateX(-50%); bottom: calc(var(--day, 0px) + 130px);
  width: min(340px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--vang); background: var(--nen-dam); }
.caro-moi-the[hidden], .caro-chip[hidden] { display: none; }
.caro-mo { margin-left: auto; margin-right: 6px; min-height: 36px; padding: 0 10px; }
/* ===== dua_thuyen.css ===== */
/* ĐUA THUYỀN VÒNG CẢNG (#bang-dtt, #dtt-chip, #dtt-dem: trinh_khach/src/dua_thuyen_ui.ts) + GIẢI CÂU BẾN CẢNG (#bang-gca, #gca-chip:
   trinh_khach/src/giai_cau_ui.ts) + hàng chọn hạng trong bảng Đua tuần (.dt-nhom). Nền bảng: .bang.lon (style.css). */
.dtt-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px 10px 12px;
  display: flex; flex-direction: column; gap: 8px; }
#bang-dtt, #bang-gca { display: flex; flex-direction: column; }
#bang-dtt[hidden], #bang-gca[hidden] { display: none; }
.dtt-chu, .dtt-luat { color: var(--chu-mo); font-size: 12px; margin: 0; line-height: 1.45; }
.dtt-dong-dau { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }
.dtt-dong-dau > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 200px; }
.dtt-dong-dau b { color: #ffe9a8; }
.dtt-dong-dau small { color: var(--chu-mo); font-size: 12px; }
.dtt-the { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--vien-mo); background: rgba(0, 10, 20, .3); }
.dtt-the p { margin: 0; font-size: 13px; line-height: 1.4; }
.dtt-the.dang { border-color: #7fe8ff; background: rgba(127, 232, 255, .07); }
.dtt-the.kq { border-color: #9dffb0; background: rgba(157, 255, 176, .08); }
.dtt-the.kq b { color: #d9ffe2; }
.dtt-the.xa { border-color: rgba(255, 216, 102, .6); }
.dtt-nut { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dtt-nut button { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 8px; }
.dtt-nut button small { font-size: 11px; font-weight: 600; opacity: .8; }
.dtt-nut button[disabled] { opacity: .5; }
.dtt-hang { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.dtt-hang button, .dtt-the > button { min-height: 40px; padding: 0 12px; }
body.cam-ung .dtt-hang button, body.cam-ung .dtt-the > button { min-height: 44px; }
.dtt-hang .nguy { border-color: rgba(255, 106, 90, .6); }
.dtt-ds { display: flex; flex-direction: column; gap: 3px; }
.dtt-ds > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, .2); }
.dtt-ds > div.minh { outline: 1px solid #7fe8ff; }
.dtt-ds span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtt-ds b { color: #bff6ff; flex: 0 0 auto; }
/* chip giữa trên (dưới chip việc bến cảng) */
.dtt-chip { position: fixed; z-index: var(--z-chip, 12); left: 50%; transform: translateX(-50%); top: calc(var(--tren, 0px) + 160px); display: flex; align-items: center; gap: 6px;
  max-width: calc(100vw - 24px); min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid #7fe8ff; background: var(--nen-dam); color: #dff8ff;
  font-weight: 800; font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); cursor: pointer; }
.dtt-chip.dang { padding-right: 4px; border-color: #ffd866; color: #ffe9a6; font-variant-numeric: tabular-nums; }
.dtt-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtt-x { flex: 0 0 auto; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--vien-mo); background: rgba(0, 0, 0, .3); color: var(--chu); font-size: 15px; }
body.cam-ung .dtt-x { width: 40px; height: 40px; }
.dtt-chip[hidden], .dtt-x[hidden], .dtt-dem[hidden] { display: none; }
@media (orientation: landscape) and (max-height: 560px) { .dtt-chip { top: calc(var(--tren, 0px) + 98px); font-size: 12px; min-height: 36px; } }
/* đếm ngược giữa màn */
.dtt-dem { position: fixed; z-index: calc(var(--z-chip, 12) + 1); left: 50%; top: 44%; transform: translate(-50%, -50%); pointer-events: none;
  font: 900 64px system-ui, sans-serif; color: #fff3b8; text-shadow: 0 0 4px #000, 0 3px 14px rgba(0, 0, 0, .8); white-space: nowrap; }
.dtt-dem.nay { animation: dtt-dem .9s ease-out; }
@keyframes dtt-dem { 0% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } 25% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); } }
@media (orientation: landscape) and (max-height: 560px) { .dtt-dem { font-size: 46px; top: 56%; } }
/* giải câu */
.gca-chip { top: calc(var(--tren, 0px) + 204px); border-color: #9dffb0; color: #d9ffe2; }
.gca-chip.dang { border-color: #ffd866; color: #ffe9a6; font-variant-numeric: tabular-nums; }
@media (orientation: landscape) and (max-height: 560px) { .gca-chip { top: calc(var(--tren, 0px) + 140px); } }
.gca-minh { font-weight: 700; color: #bff6ff; }
.gca-ly { color: #ffcf8a; }
.gca-ds { display: flex; flex-direction: column; gap: 3px; }
.gca-dong { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 4px 8px;
  border-radius: 8px; background: rgba(0, 0, 0, .22); font-size: 13px; }
.gca-dong > b { grid-row: 1 / 3; text-align: center; font-size: 15px; }
.gca-dong > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.gca-dong > em { font-style: normal; font-weight: 800; color: #ffe9a6; }
.gca-dong > small { grid-column: 2 / 4; color: var(--chu-mo); font-size: 11.5px; }
.gca-dong.minh { outline: 1px solid #7fe8ff; }
.gca-quas { display: flex; flex-direction: column; gap: 4px; }
.gca-qua { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, .2); }
.gca-qua span { color: #d9ffe2; }
/* bảng Đua tuần: hàng chọn hạng thuyền */
.dt-nhom { display: flex; gap: 6px; margin: 8px 0 6px; }
.dt-nhom button { flex: 1 1 0; min-width: 0; min-height: 38px; padding: 4px 6px; font-size: 12px; border-radius: 10px; border: 1px solid var(--vien-mo); background: rgba(0, 10, 20, .4); color: var(--chu); }
.dt-nhom button.chon { border-color: #7fe8ff; background: rgba(127, 232, 255, .14); color: #dff8ff; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .dtt-dem.nay { animation: none; } }
/* ===== ben_vui.css ===== */
/* BẢNG BẾN VUI (#bang-bv) + chip ở phố (#bv-chip) + lời rủ tại bến (#bv-ru): trinh_khach/src/ben_vui.ts, may_chu/ben_vui.go.
   Nền bảng: .bang.lon (style.css). Chip mượn .dtt-chip (dua_thuyen.css), chỉ đổi chỗ + màu. Dọc 390×844 và ngang 844×390 đều một cột. */
#bang-bv { display: flex; flex-direction: column; }
#bang-bv[hidden] { display: none; }
.bv-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px 10px 12px;
  display: flex; flex-direction: column; gap: 8px; }
.bv-chu { color: var(--chu-mo); font-size: 12px; margin: 0; line-height: 1.45; }
.bv-the { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--vien-mo); background: rgba(0, 10, 20, .3); }
.bv-the.noi { border-color: #9dffb0; background: rgba(157, 255, 176, .07); }
.bv-the p { margin: 0; font-size: 13px; line-height: 1.4; }
.bv-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bv-dau b { color: #ffe9a8; min-width: 0; overflow-wrap: anywhere; }
.bv-toi { flex: 0 0 auto; min-height: 40px; padding: 0 12px; white-space: nowrap; }
body.cam-ung .bv-toi { min-height: 44px; }
.bv-hang { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bv-hang button { min-height: 40px; padding: 0 12px; }
body.cam-ung .bv-hang button { min-height: 44px; }
.bv-hang small { color: var(--chu-mo); font-size: 12px; flex: 1 1 160px; }
.bv-dang-cho { border-color: #9dffb0; color: #d9ffe2; }
.bv-nhan { font-size: 12px; font-weight: 700; color: #bff6ff; }
.bv-dang { color: #ffe9a6; font-weight: 700; }
.bv-ds { display: flex; flex-direction: column; gap: 3px; }
.bv-muc { color: var(--chu-mo); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.bv-dong { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, .2); min-height: 30px; }
.bv-dong span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-dong small { flex: 0 1 auto; color: var(--chu-mo); font-size: 12px; text-align: right; }
.bv-dong button { flex: 0 0 auto; min-height: 34px; padding: 0 10px; }
.bv-dong.minh { outline: 1px solid #7fe8ff; }
/* chip ở phố: dưới chip giải câu */
.bv-chip { top: calc(var(--tren, 0px) + 248px); border-color: #ffb3d9; color: #ffe3f1; }
.bv-chip.co { border-color: #ffd866; color: #fff1b8; }
@media (orientation: landscape) and (max-height: 560px) { .bv-chip { top: calc(var(--tren, 0px) + 182px); font-size: 12px; min-height: 36px; } }
/* lời rủ tại bến: thẻ nhỏ giữa trên, như lời mời dự lễ cưới (ket_hon.css #kh-le-moi) */
.bv-ru { position: fixed; left: 50%; top: calc(112px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 6px 6px 6px 14px; border-radius: 16px; border: 1px solid #ffd866; background: var(--nen-dam, rgba(8, 20, 32, .92));
  color: #fff3c4; font-size: 13px; font-weight: 700; box-shadow: 0 3px 12px rgba(0, 0, 0, .5); animation: bv-ru .35s ease-out; }
.bv-ru[hidden] { display: none; }
.bv-ru span { min-width: 0; line-height: 1.3; }
.bv-ru button { flex: 0 0 auto; min-height: 40px; padding: 0 12px; border-radius: 12px; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 216, 102, .5); }
.bv-ru button.chinh { background: linear-gradient(#ffd866, #e0a73a); color: #2a1a00; font-weight: 800; }
body.cam-ung .bv-ru button { min-height: 44px; }
@keyframes bv-ru { from { transform: translate(-50%, -12px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@media (orientation: landscape) and (max-height: 560px) { .bv-ru { top: calc(64px + env(safe-area-inset-top)); max-width: min(560px, calc(100vw - 24px)); } }
/* ===== ra_do.css ===== */
/* MÁY RÃ ĐỒ (trinh_khach/src/ra_do_ui.ts, máy chủ may_chu/ra_do.go). Nạp động: napCss('/v1/ra_do.css'), gộp vào goi.css (tools/gop_css.mjs DONG).
   Điện thoại dọc: lưới món trên, phần chọn số + nhận lại dưới. Màn ngang thấp (≤ 500px cao): hai cột cạnh nhau. */
#bang-rd { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 20px));
  max-height: calc(var(--cao, 100vh) - 24px); display: flex; flex-direction: column; overflow: hidden; z-index: var(--z-bang); padding: 8px 12px 12px; }
#bang-rd[hidden] { display: none; }
#bang-rd .rd-tile { margin: 0 0 6px; font-size: 11.5px; color: var(--chu-mo); }
#bang-rd .rd-than { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
#bang-rd .rd-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; overflow-y: auto; max-height: 38vh;
  scrollbar-width: thin; scrollbar-color: #2a5066 transparent; padding: 2px; }
#bang-rd .rd-o { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 5px; min-height: 64px;
  border-radius: 9px; background: rgba(0, 0, 0, .35); border: 1px solid var(--vien-mo); color: var(--chu); cursor: pointer; font: inherit; }
#bang-rd .rd-o.chon { border-color: #ffb454; background: rgba(255, 180, 84, .16); box-shadow: 0 0 0 1px #ffb454 inset; }
#bang-rd .rd-o img { width: 32px; height: 32px; image-rendering: pixelated; }
#bang-rd .rd-o span { font-size: 10.5px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bang-rd .rd-o i { position: absolute; right: 4px; top: 2px; font-style: normal; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000; }
#bang-rd .rd-ben { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, .55); overflow: hidden; }
#bang-rd .rd-ben b { display: block; height: 100%; background: #7fd36a; }
#bang-rd .rd-ct { display: flex; flex-direction: column; gap: 7px; }
#bang-rd .rd-chon { display: flex; gap: 8px; align-items: center; }
#bang-rd .rd-chon img { width: 38px; height: 38px; image-rendering: pixelated; }
#bang-rd .rd-chon b { display: block; font-size: 13.5px; color: #ffe9a6; }
#bang-rd .rd-chon small { color: var(--chu-mo); font-size: 11.5px; }
#bang-rd .rd-so { display: flex; gap: 6px; align-items: center; }
#bang-rd .rd-so b { min-width: 34px; text-align: center; font-size: 16px; }
#bang-rd .rd-so button { min-width: 44px; min-height: 36px; border-radius: 8px; background: var(--nen-dam); border: 1px solid var(--vien); color: var(--chu);
  font-weight: 800; font-size: 15px; cursor: pointer; }
#bang-rd .rd-so button:last-child { margin-left: auto; font-size: 12.5px; padding: 0 10px; }
#bang-rd .rd-so button:disabled, #bang-rd .rd-nut:disabled { opacity: .45; cursor: default; }
#bang-rd .rd-ra small { color: var(--chu-mo); font-size: 11.5px; }
#bang-rd .rd-hang { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; align-items: center; }
#bang-rd .rd-nl { position: relative; display: inline-flex; padding: 2px; border-radius: 8px; background: rgba(0, 0, 0, .35); border: 1px solid var(--vien-mo); }
#bang-rd .rd-nl img { width: 30px; height: 30px; image-rendering: pixelated; }
#bang-rd .rd-nl i { position: absolute; right: 1px; bottom: -1px; font-style: normal; font-size: 11.5px; font-weight: 800; text-shadow: 0 1px 2px #000; }
#bang-rd .rd-nut { width: 100%; min-height: 42px; }
#bang-rd .rd-ghi { margin: 0; font-size: 11.5px; color: var(--chu-mo); }
#bang-rd .rd-loi { color: #ffb38a; }
#bang-rd .rd-trong { margin: 10px 2px; font-size: 12.5px; color: var(--chu-mo); line-height: 1.45; }
@media (max-height: 500px) and (orientation: landscape) {
  #bang-rd { width: min(640px, calc(100vw - 24px)); padding: 6px 10px 8px; }
  #bang-rd .rd-tile { margin-bottom: 4px; }
  #bang-rd .rd-than { flex-direction: row; align-items: stretch; }
  #bang-rd .rd-luoi { flex: 1.15; max-height: none; align-content: start; }
  #bang-rd .rd-ct { flex: 1; overflow-y: auto; gap: 5px; }
  #bang-rd .rd-nut { min-height: 38px; }
}
/* ===== ban_do.css ===== */
/* BẢN ĐỒ THẾ GIỚI (trinh_khach/src/ban_do_ui.ts, ban_do_lon.ts): thanh trên, chip lọc, chú giải, thẻ thông tin nổi.
   Tệp tự gắn <link> lúc mở bản đồ lần đầu. Màn dọc 390×700, màn ngang 740×360 và máy tính đều dùng được. */

/* cột bên cũ: giữ số liệu hướng / gió / tốc độ trên màn rộng, chú giải chuyển vào nút ⓘ trên bản đồ */
.bd-the-gioi .bd-ben .bd-muc, .bd-the-gioi .bd-ben .bd-chu-giai, .bd-the-gioi .bd-ben .bd-ghi { display: none; }
/* C13: bỏ cột phải 170 px (4 dòng số, bỏ trống 60 %): hướng / gió / tốc độ / trời thành MỘT thanh ngang nổi trên bản đồ, canvas nhận cả bề rộng */
.bd-the-gioi .than-bd { position: relative; }
.bd-the-gioi .bd-ben { position: absolute; left: 62px; bottom: 36px; z-index: 2; flex: none; width: auto; max-width: calc(100% - 200px); overflow: visible; pointer-events: none; }
.bd-the-gioi .bd-so { display: flex; flex-wrap: nowrap; gap: 6px; }
.bd-the-gioi .bd-so div { padding: 3px 10px; border-radius: 999px; background: rgba(4, 14, 26, .82); border: 1px solid rgba(79, 227, 255, .3); font-size: 12px; gap: 6px; white-space: nowrap; }
@media (max-width: 760px), (max-height: 500px) { .bd-the-gioi .bd-ben { display: none; } }
.bd-the-gioi .than-bd { padding: 0 6px 6px; }
.bd-the-gioi .bd-hoa { top: auto; bottom: 62px; right: 10px; width: 40px; height: 40px; z-index: 1; pointer-events: none; }
.bd-the-gioi .bd-hoa i { width: 30px; margin-left: -15px; }

/* ---- thanh trên ---- */
#bd-thanh { position: absolute; top: 6px; left: 6px; right: 6px; display: flex; gap: 4px; z-index: 3; align-items: stretch; pointer-events: none; }
#bd-thanh > * { pointer-events: auto; }
#bd-tim { flex: 1 1 120px; min-width: 0; display: flex; gap: 0; }
#bd-tim input { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 8px; border-radius: 9px 0 0 9px; border: 1px solid rgba(79, 227, 255, .45); border-right: 0;
  background: rgba(4, 14, 26, .88); color: #e8fdff; font: 13px system-ui, sans-serif; }
#bd-tim input::placeholder { color: #7fa6b5; }
#bd-tim button { flex: 0 0 auto; height: 38px; padding: 0 10px; border-radius: 0 9px 9px 0; border: 1px solid rgba(79, 227, 255, .45); background: rgba(31, 111, 140, .95);
  color: #fff; font: 700 13px system-ui, sans-serif; cursor: pointer; }
#bd-thanh > button { flex: 0 0 auto; width: 42px; height: 38px; border-radius: 9px; background: rgba(7, 24, 40, .9); border: 1px solid rgba(79, 227, 255, .4); color: #e8fdff;
  font: 16px/1 system-ui, sans-serif; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; touch-action: manipulation; }
#bd-thanh > button small { font-size: 8.5px; font-weight: 600; opacity: .9; white-space: nowrap; }
#bd-thanh > button.bat { border-color: #ffd84a; color: #fff6cf; }
#bd-thanh > button:active, #bd-tim button:active { transform: scale(.94); }

/* C13: thanh công cụ + chip lọc đủ vùng chạm trên máy cảm ứng (44 px / chip 36 px, nới vùng chạm bằng ::after) */
body.cam-ung #bd-thanh > button { width: 44px; height: 44px; }
body.cam-ung #bd-tim input, body.cam-ung #bd-tim button { height: 44px; font-size: 14px; }
body.cam-ung #bd-thanh > button small { font-size: 10px; }
body.cam-ung #bd-loc { top: 56px; }
body.cam-ung #bd-loc button { height: 36px; padding: 0 12px; font-size: 13px; position: relative; }
body.cam-ung #bd-loc button::after { content: ""; position: absolute; inset: -4px -2px; }
body.cam-ung #bd-loc:not([hidden]) ~ #bd-cg { top: 96px; max-height: calc(100% - 144px); }
body.cam-ung #bd-cg { top: 56px; }
/* hàng lọc: màn rộng (chuột) xuống dòng chứ không cuộn ẩn; điện thoại giữ cuộn ngang + mờ mép (khung_bang.ts gắn .con-trai / .con-phai) */
@media (pointer: fine) and (min-width: 761px) { body:not(.cam-ung) #bd-loc { flex-wrap: wrap; overflow-x: visible; } } /* A2: ?camung=1 trên máy tính cũng phải cuộn ngang như điện thoại thật, không xuống 2 hàng che nửa bản đồ */
#bd-loc.con-phai { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
#bd-loc.con-trai { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 28px), transparent); }
#bd-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); }
/* dòng trạng thái đáy: màn dọc cho xuống 2 dòng thay vì cắt "…" (nút kéo / phóng + thước tỉ lệ nhích lên theo) */
@media (max-width: 620px) {
  #bang-ban-do #bd-toado { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; line-height: 1.3; }
  #bang-ban-do #bd-dk { bottom: 50px; }
}

/* ---- chip lọc ---- */
#bd-loc { position: absolute; top: 48px; left: 6px; right: 6px; display: flex; gap: 4px; overflow-x: auto; z-index: 3; scrollbar-width: none; overscroll-behavior: contain;
  touch-action: pan-x; -webkit-overflow-scrolling: touch; padding: 2px 3px; border-radius: 12px;
  background: rgba(4, 14, 26, .72); } /* A2 (2c): nền riêng cho hàng lọc: nhãn bến / đảo trên bản đồ chạy xuống dưới hàng thì không lẫn vào chip */
#bd-loc::-webkit-scrollbar { display: none; }
#bd-loc[hidden] { display: none; }
#bd-loc button { flex: 0 0 auto; height: 30px; padding: 0 9px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(4, 14, 26, .78);
  color: #8aa6b2; font: 600 12px system-ui, sans-serif; cursor: pointer; white-space: nowrap; text-decoration: line-through; opacity: .8; }
#bd-loc button.bat { color: #e8fdff; border-color: rgba(79, 227, 255, .55); background: rgba(16, 60, 84, .9); text-decoration: none; opacity: 1; }

/* ---- chú giải (thu gọn được) ---- */
#bd-cg { position: absolute; top: 48px; right: 6px; width: min(270px, calc(100% - 12px)); max-height: calc(100% - 96px); overflow-y: auto; z-index: 4;
  background: rgba(4, 14, 26, .95); border: 1px solid rgba(79, 227, 255, .4); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; color: #e2fbff;
  overscroll-behavior: contain; touch-action: pan-y; }
#bd-cg[hidden] { display: none; }
#bd-loc:not([hidden]) ~ #bd-cg { top: 84px; max-height: calc(100% - 132px); }
#bd-cg ul { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
#bd-cg li { display: flex; align-items: center; gap: 7px; }
#bd-cg li span { flex: 1 1 auto; }
#bd-cg li b { font-size: 10px; letter-spacing: -1px; white-space: nowrap; }
.bdc-muc { font-size: 10.5px; letter-spacing: 1.4px; color: var(--vien, #4fe3ff); font-weight: 700; margin: 4px 0 5px; }
.bdc-o { width: 18px; height: 14px; flex: 0 0 18px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, .25); image-rendering: pixelated; }
.bdc-e { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 2px solid; background: rgba(6, 20, 34, .9); font-size: 9px; font-style: normal;
  display: flex; align-items: center; justify-content: center; line-height: 1; }
.bdc-dau { grid-template-columns: 1fr 1fr; }
.bdc-ghi { color: var(--chu-mo, #8fb9c8); font-size: 11.5px; margin: 2px 0 6px; line-height: 1.35; }

/* ---- thẻ thông tin nổi ---- */
#bd-the { position: absolute; left: 6px; right: 6px; bottom: 6px; max-height: 60%; overflow-y: auto; z-index: 5; overscroll-behavior: contain; touch-action: pan-y;
  background: rgba(5, 16, 28, .97); border: 1px solid rgba(79, 227, 255, .5); border-radius: 12px; padding: 8px 10px 10px; color: #e2fbff; font-size: 13px;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .45); }
#bd-the[hidden] { display: none; }
.bdt-dau { display: flex; align-items: center; gap: 8px; }
.bdt-bieu { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.bdt-ten { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bdt-ten b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdt-ten small { color: var(--chu-mo, #8fb9c8); font-size: 11.5px; }
.bdt-dau .nut-x { min-width: 40px; min-height: 40px; font-size: 24px; }
.bdt-than { margin: 6px 0 8px; display: grid; gap: 5px; }
.bdt-mota { color: #cfe8f0; line-height: 1.35; }
.bdt-khoa { color: #e2d6ff; background: rgba(90, 60, 160, .35); border: 1px solid rgba(180, 150, 255, .45); border-radius: 7px; padding: 4px 8px; }
.bdt-vung { background: rgba(255, 255, 255, .05); border-radius: 8px; padding: 6px 8px; line-height: 1.35; }
.bdt-vung > b { font-size: 13.5px; }
.bdt-gon { padding: 4px 8px; }
.bdt-o { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid rgba(255, 255, 255, .3); }
.bdt-nh { font-size: 11px; letter-spacing: -1px; white-space: nowrap; }
.bdt-nh small { letter-spacing: 0; font-weight: 600; }
.bdt-mo { color: var(--chu-mo, #8fb9c8); font-size: 11px; }
.bdt-ghi { color: var(--chu-mo, #8fb9c8); font-size: 12px; margin-top: 3px; }
.bdt-vung .bdt-mota { margin: 3px 0 5px; font-size: 12.5px; }
.bdt-luoi { display: grid; grid-template-columns: max-content 1fr; gap: 3px 8px; font-size: 12px; }
.bdt-luoi > span { color: var(--chu-mo, #8fb9c8); white-space: nowrap; }
.bdt-luoi em { font-style: normal; }
.bdt-them { justify-self: start; background: none; border: 0; color: var(--vien, #4fe3ff); font: 600 12.5px system-ui, sans-serif; padding: 4px 0; cursor: pointer; min-height: 30px; }
.bdt-td { font-variant-numeric: tabular-nums; font-weight: 700; color: #fff6cf; }
.bdt-ly { color: #ffd38a; font-size: 12px; line-height: 1.35; }
.bdt-ly.tot { color: #9dffbf; }
.bdt-nut { display: flex; flex-wrap: wrap; gap: 5px; }
.bdt-nut button { flex: 1 1 auto; min-height: 40px; padding: 5px 9px; border-radius: 9px; border: 1px solid rgba(79, 227, 255, .4); background: rgba(10, 40, 60, .9);
  color: #e8fdff; font: 600 12.5px system-ui, sans-serif; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.bdt-nut button.bdt-chinh { background: linear-gradient(#1f8fb0, #146b88); border-color: #6fe8ff; color: #fff; flex-basis: 100%; }
.bdt-nut button.bdt-chinh.mo { background: rgba(40, 60, 70, .9); border-color: rgba(255, 211, 138, .6); color: #ffe6b8; }
.bdt-nut button.bat { border-color: #ffd84a; color: #fff6cf; }
.bdt-nut button:active { transform: scale(.96); }

/* màn rộng: thẻ ở góc dưới phải, không che hết bản đồ */
@media (min-width: 761px) and (min-height: 501px) {
  #bd-the { left: auto; right: 8px; bottom: 30px; width: 340px; max-height: calc(100% - 96px); }
  .bdt-nut button.bdt-chinh { flex-basis: 100%; }
}
/* thẻ chi tiết đang mở thì chú giải ẩn (mọi khổ): trước chỉ màn thấp, nên PC / dọc thẻ chồng lên chú giải */
.bd-co-the #bd-cg { display: none; }
/* màn thấp (điện thoại ngang): thẻ thành cột bên phải cao hết bản đồ */
@media (max-height: 500px) {
  #bd-the { left: auto; top: 44px; right: 6px; bottom: 6px; width: min(300px, 52%); max-height: none; }
  /* buổi 9: thêm tiền tố body.cam-ung để độ ưu tiên (1,1,x) ngang luật 44 px của máy cảm ứng ở đầu tệp — trước đây luật thu gọn thua nên thanh trên vẫn 44 px và #bd-loc đè #bd-the */
  #bd-thanh > button small { display: none; }
  body #bd-thanh > button, body.cam-ung #bd-thanh > button { width: 38px; height: 34px; font-size: 17px; }
  body #bd-tim input, body #bd-tim button, body.cam-ung #bd-tim input, body.cam-ung #bd-tim button { height: 34px; }
  body #bd-loc, body.cam-ung #bd-loc { top: 44px; }
  body #bd-loc:not([hidden]) ~ #bd-cg, body.cam-ung #bd-loc:not([hidden]) ~ #bd-cg { top: 78px; }
  body #bd-cg, body.cam-ung #bd-cg { top: 44px; }
  .bdt-nut button { min-height: 36px; padding: 4px 7px; font-size: 12px; }
  .bdt-bieu { font-size: 20px; }
}
/* màn dọc hẹp: nút trong thẻ chia đôi cho đều */
@media (max-width: 480px) {
  .bdt-nut button { flex: 1 1 calc(50% - 5px); }
  .bdt-nut button.bdt-chinh { flex-basis: 100%; }
  #bd-thanh > button { width: 38px; }
}

/* ---- thẻ Bến Vạn Buồm / tiệm trong phố (ban_do_ui.ts htmlPho): danh sách tiệm + quán rượu + chợ cảng, chạm một dòng = chọn tiệm ---- */
.bdt-pho { margin: 4px 0 6px; }
.bdt-pho-dau { font: 700 12px system-ui, sans-serif; letter-spacing: .4px; color: #ffe9a6; margin-bottom: 4px; }
.bdt-pho ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.bdt-pho button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 8px; text-align: left; cursor: pointer;
  border-radius: 8px; border: 1px solid rgba(255, 216, 102, .22); background: rgba(255, 216, 102, .06); color: inherit; font: inherit; -webkit-tap-highlight-color: transparent; }
.bdt-pho button.chon { border-color: #ffd866; background: rgba(255, 216, 102, .18); }
.bdt-pho-bieu { flex: 0 0 22px; font-size: 18px; line-height: 1; text-align: center; }
.bdt-pho-chu { display: flex; flex-direction: column; min-width: 0; }
.bdt-pho-chu b { font-size: 13px; color: #fff3cf; }
.bdt-pho-chu small { font-size: 11.5px; color: #cfe8f0; line-height: 1.3; }
/* ===== dua_tuan.css ===== */
/* Đua tuần (#bang-dt: trinh_khach/src/dua_tuan.ts) + Góp ý / Báo lỗi (#bang-gy: trinh_khach/src/gop_y.ts). Nền bảng: .bang.lon (style.css). */

/* ---------- Đua tuần ---------- */
#bang-dt .dt-tab button { display: flex; align-items: center; justify-content: center; gap: 4px; white-space: normal; line-height: 1.15; font-size: 12px; min-width: 0; flex: 1 1 0; }
#bang-dt .dt-tab button span { overflow: hidden; text-overflow: ellipsis; }
.dt-than { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 10px 10px; }
.dt-dau { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; padding: 6px 10px; border-radius: 8px;
  background: rgba(255, 216, 74, .08); border: 1px solid rgba(255, 216, 74, .3); }
.dt-dau b { color: var(--vang); }
.dt-mo { margin: 6px 0 4px; }
.dt-toi { padding: 6px 10px; border-radius: 8px; background: rgba(79, 227, 255, .08); border: 1px solid var(--vien-mo); font-size: 13px; overflow-wrap: anywhere; }
.dt-toi b { color: var(--xanh); }
.dt-ds { display: grid; gap: 4px; }
.dt-dong { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: rgba(79, 227, 255, .04); border: 1px solid transparent; min-width: 0; }
.dt-dong.toi { border-color: var(--vien); background: rgba(79, 227, 255, .14); }
.dt-dong.h1 { background: rgba(255, 216, 74, .12); } .dt-dong.h2 { background: rgba(220, 230, 240, .09); } .dt-dong.h3 { background: rgba(214, 150, 90, .1); }
.dt-hang { flex: 0 0 28px; text-align: center; font-size: 15px; color: var(--chu-mo); }
.dt-ten { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dt-ten b, .dt-ten small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-ten small { font-size: 11px; color: var(--chu-mo); }
.dt-on { color: var(--xanh); font-style: normal; font-size: 10px; }
.dt-dh { font-style: normal; font-size: 11px; color: var(--vang); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-diem { flex: 0 0 auto; font-weight: 800; color: var(--vang); font-size: 13px; white-space: nowrap; }
.dt-thuongs { display: grid; gap: 4px; }
.dt-thuong { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 8px; border-radius: 8px; background: rgba(79, 227, 255, .04); }
.dt-thuong > b { flex: 0 0 78px; font-size: 12px; }
.dt-thuong > span { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.dt-qua { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .25); font-size: 12px; white-space: nowrap; }
.dt-qua img { width: 20px; height: 20px; image-rendering: pixelated; }
.dt-qua.dt-dh { color: var(--vang); }
.dt-kq { margin-top: 6px; padding: 6px 8px; border-radius: 8px; border: 1px dashed rgba(255, 216, 74, .5); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* ---------- Góp ý / Báo lỗi ---------- */
/* #bang-gy: cỡ do lớp co-nho (gop_y.ts) */
.gy-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: 8px; align-content: start; }
.gy-loai { display: flex; gap: 6px; }
.gy-loai button { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 6px 4px; border-radius: 8px; 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.15; white-space: normal; }
.gy-loai button.chon { color: var(--chu); background: rgba(79, 227, 255, .2); border-color: var(--vien); }
#gy-nd { width: 100%; box-sizing: border-box; min-height: 96px; max-height: 40vh; resize: vertical; padding: 8px; border-radius: 8px; border: 1px solid var(--vien-mo);
  background: rgba(0, 0, 0, .35); color: var(--chu); font: inherit; font-size: 16px; /* 16px: iOS không tự phóng to khi gõ */ }
.gy-hang { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gy-tick { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 13px; cursor: pointer; }
.gy-tick input { width: 20px; height: 20px; margin: 0; }
#gy-xem { display: block; width: 100%; max-height: 22vh; object-fit: contain; border-radius: 6px; border: 1px solid var(--vien-mo); background: #000; }
#gy-xem[hidden] { display: none; }
.gy-loi { color: #ff8a7a; font-size: 13px; min-height: 0; }
.gy-loi:empty { display: none; }
#gy-gui:disabled { opacity: .6; }

/* điện thoại dọc hẹp */
@media (max-width: 420px) {
  #bang-dt .dt-tab button { font-size: 11px; padding: 5px 2px; }
  .dt-thuong > b { flex-basis: 64px; }
  .gy-loai button { font-size: 12px; }
}
/* điện thoại ngang (thấp): bảng chiếm gần hết chiều cao, phần thân cuộn */
@media (max-height: 450px) {
  #bang-dt .dt-tab button { min-height: 34px; }
  .dt-mo { display: none; }
  #gy-nd { min-height: 64px; }
  #gy-xem { max-height: 18vh; }
  .gy-than { gap: 6px; }
}
/* ===== man_mo_ngoai.css ===== */
/* Dải "Mở bằng Safari / Chrome" ở mép trên màn đăng nhập trong trình duyệt của Facebook / Zalo… (trinh_khach/src/man_mo_ngoai.ts). Nạp khi cần.
   Nằm trên màn đăng nhập (z 70), dưới hộp thoại; KHÔNG che nút "Chơi ngay" (nằm giữa màn). */
#man-mo-ngoai.mmn-dai { position: fixed; left: 0; right: 0; top: 0; z-index: 75; padding: calc(6px + var(--tren, 0px)) calc(8px + var(--phai, 0px)) 6px calc(8px + var(--le, 0px));
  background: linear-gradient(rgba(6, 36, 54, .97), rgba(8, 44, 64, .94)); border-bottom: 1px solid var(--vien-mo, rgba(79, 227, 255, .4)); color: #e2fbff; font-family: system-ui, sans-serif; }
#man-mo-ngoai[hidden] { display: none; }
.mmn-hang { display: flex; align-items: center; gap: 8px; }
.mmn-i { font-size: 20px; flex: 0 0 auto; }
.mmn-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mmn-t b { font-size: 13px; line-height: 1.25; font-weight: 800; }
.mmn-t small { font-size: 11px; line-height: 1.25; color: #9fc6d0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#man-mo-ngoai .mmn-chinh { flex: 0 0 auto; min-height: 40px; padding: 0 16px; border-radius: 20px; border: 2px solid #ffe9a8; background: linear-gradient(#ffcf5a, #f29a1f); color: #3a2206;
  font: 900 15px/1 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
#man-mo-ngoai .mmn-x { flex: 0 0 auto; width: 40px; height: 40px; border: 0; background: none; color: #bff6ff; font-size: 26px; line-height: 1; cursor: pointer; touch-action: manipulation; }
.mmn-tay { margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--vien-mo, rgba(79, 227, 255, .4)); background: rgba(79, 227, 255, .07);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.mmn-tay[hidden] { display: none; }
.mmn-tay.nhan { border: 1px solid var(--vien, #4fe3ff); animation: mmn-sang 1.2s ease-in-out 3; }
.mmn-buoc { font-size: 13px; line-height: 1.7; font-weight: 700; }
.mmn-b1 { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #ffd84a; color: #3a2206; font-size: 11px; font-weight: 900; }
.mmn-nut { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 6px; background: #fff; color: #222; font-weight: 900; font-size: 14px; }
.mmn-dc { font-size: 12px; color: #9fc6d0; }
.mmn-dc b { color: #bff6ff; font-size: 13.5px; user-select: all; }
.mmn-chep { min-height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--vien, #4fe3ff); background: linear-gradient(#1f6f8c, #134a63); color: inherit; font: inherit; font-weight: 700; }
@keyframes mmn-sang { 0%, 100% { box-shadow: 0 0 4px rgba(79, 227, 255, .3); } 50% { box-shadow: 0 0 16px rgba(79, 227, 255, .8); } }
@media (prefers-reduced-motion: reduce) { .mmn-tay.nhan { animation: none; } }
/* ===== ngon_ngu.css ===== */
/* Đa ngôn ngữ (trinh_khach/src/ngon_ngu.ts): nút chọn ngôn ngữ + phông hệ thống cho tiếng Trung + chống tràn chữ cho en / zh */

/* tiếng Trung: phông hệ thống, không tải phông ngoài */
html[lang="zh-CN"] body, html[lang="zh-CN"] button, html[lang="zh-CN"] input, html[lang="zh-CN"] textarea, html[lang="zh-CN"] select {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* nút chọn ở góc màn đăng nhập */
.nn-dn {
  position: absolute; z-index: 5; top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px));
  display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(6, 26, 44, .55); backdrop-filter: blur(4px);
}
.nn-dn button {
  min-width: 44px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent;
  color: #cfe6f5; font-size: 13px; font-weight: 700; cursor: pointer;
}
.nn-dn button.chon { background: #ffd27a; color: #2a1c05; }

/* hàng trong bảng Cài đặt */
.nn-cd { flex-wrap: wrap; justify-content: flex-end; }
.nn-cd button { white-space: nowrap; }

/* chữ Anh thường dài hơn chữ Việt: cho phép xuống dòng trong nút / nhãn hẹp thay vì tràn */
html:not([lang="vi"]) .nut-vong, html:not([lang="vi"]) .cd-nhan, html:not([lang="vi"]) .tab, html:not([lang="vi"]) .muc-menu {
  overflow-wrap: anywhere;
}
html:not([lang="vi"]) .nut-vong { line-height: 1.05; }

/* nút "Tới món đồ" (hud_gon.css) để nowrap: chữ Anh dài hơn thì cho xuống dòng thay vì tràn ra mép màn */
html:not([lang="vi"]) #tt-toi { white-space: normal; text-align: center; max-width: min(260px, calc(100vw - 24px)); padding-top: 6px; padding-bottom: 6px; line-height: 1.15; }
