/* ===== 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(calc(var(--cao, 100vh) * 0.4), 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: calc(var(--cao, 100vh) * 0.34); }
  .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; }
/* ===== hai_au_pha.css ===== */
/* Hải âu phá rau (trinh_khach/src/hai_au_pha.ts tự gắn tệp này): nút "Đuổi chim" nổi giữa dưới lúc có chim ghé vườn. Nền đặc, tương phản. */
#ha-nut { position: fixed; z-index: var(--z-hud-noi); left: 50%; transform: translateX(-50%); bottom: calc(var(--day, 0px) + var(--o-cam, 48px) + 196px);
  padding: 8px 16px; border-radius: 12px; border: 2px solid #ffd54a; background: #3a2a08; color: #fff4c8; font-size: 15px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5); cursor: pointer; white-space: nowrap; touch-action: manipulation; }
#ha-nut.gan { background: #c0392b; border-color: #fff; color: #fff; animation: ha-nhay .45s ease-in-out infinite alternate; }
#ha-nut:active { transform: translateX(-50%) scale(.95); }
@keyframes ha-nhay { from { box-shadow: 0 0 0 0 rgba(255, 213, 74, .8), 0 4px 14px rgba(0, 0, 0, .5); } to { box-shadow: 0 0 0 6px rgba(255, 213, 74, 0), 0 4px 14px rgba(0, 0, 0, .5); } }
body.cam-ung #ha-nut { font-size: 16px; padding: 10px 18px; }
/* ===== 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: 14px; margin: 5px 0 3px; border-radius: 2px; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); background: linear-gradient(180deg, #0b1929 0%, #152b42 100%); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 213, 74, .38); overflow: hidden; }
#bb-thanh .bb-mau::before { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), rgba(6, 14, 24, .55) calc(20% - 1px) 20%); }
#bb-thanh .bb-mau .mau-tre { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; z-index: 1; background: linear-gradient(180deg, #ffe29a, #f59e0b); transition: width .65s cubic-bezier(.22, 1, .36, 1) .14s; }
#bb-thanh .bb-mau i { position: relative; z-index: 2; display: block; height: 100%; width: 100%; background: linear-gradient(180deg, #ff9384 0%, #e03131 52%, #9b1622 100%); transition: width .14s ease-out; }
#bb-thanh .bb-mau i::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 3px; background: rgba(255, 255, 255, .88); box-shadow: 0 0 5px rgba(255, 255, 255, .8); }
#bb-thanh .bb-mau span { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; 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(180deg, #b8f5ff 0%, #38bdf8 52%, #1d6fa5 100%); }
#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; }
/* ===== phao_tiep_te.css ===== */
/* Pháo hiệu tiếp tế + Hòm Vàng (trinh_khach/src/phao_tiep_te.ts tự gắn tệp này): bảng sự kiện gọn,
   nút "tới" khi ở xa (>= 44 px trên cảm ứng), thẻ thưởng Tròn mềm. Nền đặc, chữ tương phản >= 4.5:1. */
#ptt-hud { position: fixed; top: calc(var(--dh-day, 54px) + 6px); left: 50%; transform: translateX(-50%); z-index: var(--z-hud-noi);
  width: min(336px, calc(100vw - 460px)); min-width: 230px; padding: 5px 10px 6px; border-radius: 12px;
  background: linear-gradient(180deg, #3c2a08 0%, #221604 100%); border: 2px solid #ffd54a;
  color: #fff8e6; text-align: center; box-shadow: 0 4px 12px rgba(4, 16, 30, .5); pointer-events: none; }
#ptt-hud[hidden] { display: none !important; }
#ptt-hud.duoi { top: calc(var(--dh-day, 54px) + 96px); }
#ptt-hud .ptt-dau { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; line-height: 1.2; }
#ptt-hud .ptt-dau b { font-weight: 800; white-space: nowrap; color: #ffffff; }
#ptt-hud .ptt-gio { font-size: 12px; font-weight: 800; color: #ffe6a0; font-variant-numeric: tabular-nums; }
#ptt-hud .ptt-ca { display: flex; gap: 6px; margin: 4px 0 3px; }
#ptt-hud .ptt-mau { position: relative; flex: 1; height: 12px; border-radius: 6px; background: #140f04; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); overflow: hidden; }
#ptt-hud .ptt-mau i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff9a6a, #c8361c); transition: width .25s; }
#ptt-hud .ptt-mau.chet i { width: 0; }
#ptt-hud .ptt-mau span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #ffffff; text-shadow: 0 1px 2px #000; }
#ptt-hud .ptt-cho { height: 12px; margin: 4px 0 3px; border-radius: 6px; background: #140f04; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }
#ptt-hud .ptt-cho i { display: block; height: 100%; width: 0; background: linear-gradient(#ffe27a, #d99a14); }
#ptt-hud .ptt-goi { font-size: 11.5px; line-height: 1.25; color: #fff0c4; }
#ptt-hud .ptt-goi.du { color: #a8ffb0; font-weight: 800; }
#ptt-hud .ptt-toi { pointer-events: auto; margin-top: 4px; min-height: 32px; padding: 4px 14px; border-radius: 99px; border: 2px solid #ffd54a;
  background: #6b4704; color: #ffffff; font-size: 12.5px; font-weight: 800; cursor: pointer; opacity: 1; }
body.cam-ung #ptt-hud .ptt-toi { min-height: 44px; padding: 6px 16px; }

@media (min-width: 621px) and (max-height: 500px) {
  #ptt-hud { top: calc(var(--dh-day, 46px) + 4px); width: min(304px, calc(100vw - 460px)); min-width: 216px; padding: 4px 8px; }
  #ptt-hud.duoi { top: calc(var(--dh-day, 46px) + 88px); }
  #ptt-hud .ptt-dau { font-size: 11.5px; gap: 5px; }
  #ptt-hud .ptt-gio { font-size: 11px; }
  #ptt-hud .ptt-ca, #ptt-hud .ptt-cho { margin: 3px 0 2px; }
  #ptt-hud .ptt-mau, #ptt-hud .ptt-cho { height: 11px; }
  #ptt-hud .ptt-mau span { font-size: 9.5px; }
  #ptt-hud .ptt-goi { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 620px) {
  #ptt-hud { top: calc(var(--dh-day, 148px) + 8px); width: min(356px, calc(100vw - 24px)); min-width: 0; padding: 5px 10px 6px; }
  #ptt-hud.duoi { top: calc(var(--dh-day, 148px) + 92px); }
}

#ptt-the { position: fixed; left: 50%; top: 34%; transform: translateX(-50%); z-index: var(--z-modal); width: min(340px, calc(100vw - 24px));
  padding: 14px 16px; text-align: center; color: #0b2f47; }
#ptt-the h3 { margin: 2px 32px 6px; font-size: 17px; color: #8c3b00; font-weight: 900; }
#ptt-the .ptt-the-dong { font-size: 13px; margin-bottom: 8px; color: #245a7a; font-weight: 700; }
#ptt-the .ptt-the-ds { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; font-size: 13px; font-weight: 800; color: #0b2f47; }
#ptt-the .ptt-the-ds span { display: inline-flex; align-items: center; gap: 4px; }
#ptt-the .ptt-the-ds img { width: 22px; height: 22px; }
/* ===== kraken.css ===== */
/* Kraken + Hải Thú công bè (trinh_khach/src/kraken.ts tự gắn tệp này): dải báo trước, thanh máu Kraken, bảng đợt hải thú, chip, thẻ kết quả.
   Nền đặc, chữ tương phản (không làm mờ nút). */
#kr-hud { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 52px); left: 50%; transform: translateX(-50%); z-index: var(--z-hud-noi);
  width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#kr-hud.duoi-bb { top: calc(env(safe-area-inset-top, 0px) + 132px); }
#kr-hud > div { border-radius: 10px; color: #f4ecff; text-align: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
#kr-hud .kr-bao { padding: 6px 12px; background: #2a1440; border: 1px solid #b47bff; font-size: 13px; font-weight: 800; line-height: 1.3;
  animation: kr-nhay .8s ease-in-out infinite alternate; }
#kr-hud .kr-thanh, #kr-hud .kr-hb { padding: 6px 10px 7px; background: #1e0f2e; border: 1px solid #9a5cff; }
#kr-hud .kr-hb { background: #2e140a; border-color: #ff8a4a; }
#kr-hud .kr-dau { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; }
#kr-hud .kr-dau b { font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
#kr-hud .kr-n, #kr-hud .kr-gio, #kr-hud .kr-dot { font-size: 12px; font-weight: 700; color: #e5d2ff; }
#kr-hud .kr-hb .kr-gio, #kr-hud .kr-hb .kr-dot { color: #ffd9c2; }
#kr-hud .kr-mau { position: relative; height: 14px; margin: 5px 0 3px; border-radius: 2px; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); background: linear-gradient(180deg, #0b1929 0%, #152b42 100%); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .65), 0 0 0 1px rgba(213, 155, 255, .42); overflow: hidden; }
#kr-hud .kr-mau::before { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), rgba(6, 14, 24, .55) calc(20% - 1px) 20%); }
#kr-hud .kr-mau .mau-tre { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; z-index: 1; background: linear-gradient(180deg, #ffe29a, #f59e0b); transition: width .65s cubic-bezier(.22, 1, .36, 1) .14s; }
#kr-hud .kr-mau i { position: relative; z-index: 2; display: block; height: 100%; width: 100%; background: linear-gradient(180deg, #e0b3ff 0%, #9333ea 52%, #581c87 100%); transition: width .14s ease-out; }
#kr-hud .kr-mau i::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 3px; background: rgba(255, 255, 255, .88); box-shadow: 0 0 5px rgba(255, 255, 255, .8); }
#kr-hud .kr-mat i { width: 0; background: linear-gradient(180deg, #ffd08a 0%, #ea580c 52%, #9a2410 100%); }
#kr-hud .kr-mau span { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
#kr-hud .kr-xt { font-size: 13px; letter-spacing: 2px; min-height: 16px; }
#kr-hud .kr-goi { font-size: 12px; line-height: 1.3; color: #e9dcff; }
#kr-hud .kr-thanh.bam { border-color: #ffb24a; }
#kr-hud .kr-thanh.bam .kr-goi { color: #ffd27a; font-weight: 800; }
@keyframes kr-nhay { from { border-color: #b47bff; } to { border-color: #ffd0ff; } }

#kr-chip { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 92px); 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 #9a5cff; background: #24103a; color: #f0e4ff;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
body.cam-ung #kr-chip { min-height: 40px; }
#kr-chip:active { transform: translateX(-50%) translateY(1px); }

#kr-the { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: var(--z-modal); width: min(360px, calc(100vw - 24px)); padding: 12px 14px;
  border: 1px solid #b47bff; text-align: center; }
#kr-the h3 { margin: 2px 26px 6px; font-size: 17px; color: #f1dcff; }
#kr-the .kr-the-dong { font-size: 13px; margin-bottom: 8px; }
#kr-the .kr-the-ds { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; font-size: 13px; font-weight: 700; }
#kr-the .kr-the-ds span { display: inline-flex; align-items: center; gap: 4px; }
#kr-the .kr-the-ds img { width: 22px; height: 22px; }
/* ===== 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: calc(var(--cao, 100vh) * 0.38); 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; } }

/* ---------- Cá heo báo cá mập / bè vỡ cứu chó (#ch-chip, trinh_khach/src/ca_heo_cho.ts) — nền đặc, tương phản, không làm mờ ---------- */
#ch-chip[hidden] { display: none !important; }
#ch-chip {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); /* trên thanh đồ nhanh, khỏi đè thông báo phía trên */
  z-index: var(--z-chip, 12);
  display: flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 3px 13px 3px 5px; border-radius: 20px;
  pointer-events: none; white-space: nowrap;
  border: 2.5px solid #04253a; font-size: 13px; font-weight: 900;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 #04253a, 0 5px 12px rgba(4, 24, 40, .35);
}
#ch-chip i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #04253a; font-size: 15px; }
#ch-chip.nguy { background: linear-gradient(180deg, #ffe0d8 0%, #ffb19c 100%); color: #5a0f00; animation: ch-nhay 0.9s ease-in-out infinite; }
#ch-chip.cho { background: linear-gradient(180deg, #fff6d8 0%, #ffe39a 100%); color: #3a2200; }
@keyframes ch-nhay { 50% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 #04253a, 0 0 0 5px rgba(255, 90, 60, .45); } }
@media (orientation: portrait) { #ch-chip { bottom: calc(env(safe-area-inset-bottom, 0px) + 200px); } }
/* ===== 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: calc(var(--cao, 100vh) * 0.34); 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: calc(var(--cao, 100vh) * 0.4); 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('/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: visible; 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: calc(var(--cao, 100vh) * 0.38);
  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; }
}
/* ===== cuong_hoa.css ===== */
/* CƯỜNG HOÁ CÔNG CỤ +1..+5 + KHẢM THÚ HẠCH (trinh_khach/src/cuong_hoa_ui.ts, máy chủ may_chu/cuong_hoa.go). Nạp động napCss('/cuong_hoa.css'),
   gộp vào goi.css (tools/gop_css.mjs DONG). Vỏ "Tròn mềm" như các bảng khác (khung bang.png, nền sáng đặc, chữ đậm tối, nút ≥ 44 px).
   Điện thoại dọc: hàng 6 thẻ nhóm trên, chi tiết dưới. Màn ngang thấp (≤ 500 px cao): thẻ nhóm thành cột trái. --ch = màu cấp. */
html body #bang-ch { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 20px));
  max-height: calc(var(--cao, 100vh) - 16px); display: flex; flex-direction: column; overflow: visible; z-index: calc(var(--z-bang, 50) + 2);
  background: transparent !important; border: 0 solid transparent !important; border-radius: 0 !important; box-shadow: none !important;
  border-image-source: url('/anh/skin/tron_mem/bang.png') !important; border-image-slice: 97 47 50 47 fill !important;
  border-image-width: 49px 20px 22px 20px !important; border-image-repeat: stretch !important;
  padding: 2px 12px 14px 12px !important; color: #0b2f47 !important; }
html body #bang-ch[hidden] { display: none; }
html body #bang-ch > .tieu-de { background: transparent !important; border: 0 !important; box-shadow: none !important; min-height: 48px;
  margin: 0 0 4px; padding: 2px 2px 4px 8px; color: #fff !important; text-shadow: 0 1px 2px rgba(4, 37, 58, .55); display: flex; align-items: center;
  justify-content: space-between; font-weight: 900; letter-spacing: .3px; }
#bang-ch .ch-than { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; overflow-y: auto; padding: 2px; }
#bang-ch .ch-hang-the { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
#bang-ch .ch-the { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 56px; padding: 4px 2px;
  border-radius: 14px; background: linear-gradient(180deg, #fff 0%, #e7f4ff 100%); border: 2px solid #9ac5df; color: #0b2f47; font: inherit; cursor: pointer; }
#bang-ch .ch-the img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
#bang-ch .ch-the span { font-size: 10.5px; font-weight: 800; line-height: 1.1; max-width: 100%; text-align: center; overflow-wrap: anywhere; }
#bang-ch .ch-the b { position: absolute; top: -6px; right: -4px; min-width: 22px; padding: 0 5px; border-radius: 999px; background: #0c314c; color: var(--ch);
  border: 1.5px solid #fff; font-size: 11px; font-weight: 900; line-height: 17px; }
#bang-ch .ch-the.chon { border-color: #04253a; background: linear-gradient(180deg, #fff6d6 0%, #ffe3a3 100%); box-shadow: 0 0 0 2px var(--ch) inset; }
#bang-ch .ch-the.chua-co img { filter: grayscale(1); opacity: .55; }
#bang-ch .ch-the.ch-no { animation: ch-no .6s ease-out; }
@keyframes ch-no { 0% { transform: scale(1); } 30% { transform: scale(1.18); box-shadow: 0 0 18px 4px var(--ch); } 100% { transform: scale(1); } }
#bang-ch .ch-ct { display: flex; flex-direction: column; gap: 7px; }
#bang-ch .ch-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#bang-ch .ch-ten { font-size: 16px; font-weight: 900; color: #0b2f47; }
#bang-ch .ch-ten b { padding: 0 7px; border-radius: 999px; background: #0c314c; color: var(--ch); font-size: 14px; }
#bang-ch .ch-ten .ch-dang { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: #0d7fb4; color: #fff; font-style: normal; font-size: 11.5px; font-weight: 800; vertical-align: 2px; }
#bang-ch .ch-sao { display: flex; gap: 4px; }
#bang-ch .ch-sao i { width: 14px; height: 14px; border-radius: 50%; background: #d4e1ea; border: 1.5px solid #04253a; }
#bang-ch .ch-sao i.sang { background: var(--ch); box-shadow: 0 0 6px var(--ch); }
#bang-ch .ch-hq { margin: 0; padding: 6px 10px; list-style: none; border-radius: 12px; background: #f1f9ff; border: 1.5px solid #9ac5df; font-size: 12.5px; font-weight: 700; }
#bang-ch .ch-hq li::before { content: '• '; color: #0d7fb4; }
#bang-ch .ch-hq li.mo { color: #245a7a; font-weight: 600; }
#bang-ch .ch-hq.sau { background: #effbea; border-color: #8fd08a; }
#bang-ch .ch-hq.sau li::before { content: '▲ '; color: #13854f; }
#bang-ch .ch-buoc { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: #fffdf6; border: 2px solid #04253a; }
#bang-ch .ch-buoc-dau { display: flex; justify-content: space-between; align-items: center; }
#bang-ch .ch-buoc-dau span { font-size: 15px; font-weight: 900; }
#bang-ch .ch-buoc-dau span b { color: #0c314c; text-shadow: 0 0 6px var(--ch); }
#bang-ch .ch-buoc-dau small { padding: 1px 8px; border-radius: 999px; background: #13854f; color: #fff; font-weight: 800; font-size: 11px; }
#bang-ch .ch-hang { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#bang-ch .ch-nl { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px 2px 2px; border-radius: 10px; background: #fff;
  border: 1.5px solid #9ac5df; }
#bang-ch .ch-nl img { width: 28px; height: 28px; image-rendering: pixelated; }
#bang-ch .ch-nl i, #bang-ch .ch-nl em { font-style: normal; font-size: 12px; font-weight: 900; color: #0b2f47; }
#bang-ch .ch-nl.ch-xu { padding: 4px 8px; }
#bang-ch .ch-nl.thieu { border-color: #c81e2b; background: #ffecec; }
#bang-ch .ch-nl.thieu i { color: #c81e2b; }
#bang-ch .ch-nut { width: 100%; min-height: 46px; border-radius: 14px; border: 2px solid #04253a; background: linear-gradient(180deg, #c24a02 0%, #9e3500 100%);
  color: #fff; font-weight: 900; font-size: 15px; cursor: pointer; }
#bang-ch .ch-nut:disabled { background: linear-gradient(180deg, #eef4f8 0%, #d4e1ea 100%); color: #5d7a8e; cursor: default; }
#bang-ch .ch-max { margin: 0; padding: 10px; text-align: center; border-radius: 14px; background: #fff3d1; border: 2px solid #ffb13d; font-weight: 900; }
#bang-ch .ch-ghi { margin: 0; font-size: 11.5px; color: #245a7a; }
#bang-ch .ch-loi { color: #b0351a; font-weight: 700; }
#bang-ch .ch-kham { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: #f1f9ff; border: 2px solid #0d7fb4; }
#bang-ch .ch-kham-dau { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; font-weight: 900; }
#bang-ch .ch-kham-dau small { color: #245a7a; font-weight: 700; }
#bang-ch .ch-hang.nho .ch-nl img { width: 22px; height: 22px; }
#bang-ch .ch-dongs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
#bang-ch .ch-dong { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 6px; text-align: left; border-radius: 12px;
  background: #fff; border: 2px solid #9ac5df; color: #0b2f47; font: inherit; cursor: pointer; }
#bang-ch .ch-dong b { font-size: 12.5px; }
#bang-ch .ch-dong small { font-size: 10.5px; line-height: 1.25; color: #245a7a; }
#bang-ch .ch-dong em { position: absolute; top: -7px; right: 4px; padding: 0 6px; border-radius: 999px; background: #0d7fb4; color: #fff; font-style: normal;
  font-size: 10px; font-weight: 800; }
#bang-ch .ch-dong.dang { border-color: #0d7fb4; background: #e2f3ff; }
#bang-ch .ch-dong.khoa { background: #eef2f5; border-style: dashed; }
#bang-ch .ch-dong:disabled:not(.dang) { cursor: default; }
#bang-ch .ch-dong:not(:disabled):hover { border-color: #04253a; }
/* nút mở ở tiêu đề Túi */
html body #bang-tui > .tieu-de .ch-mo-tui { margin-left: auto; margin-right: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px;
  border: 2px solid #04253a; background: linear-gradient(180deg, #c24a02 0%, #9e3500 100%); color: #fff; font-weight: 900; font-size: 13px; cursor: pointer;
  text-shadow: none; }
/* huy hiệu +N trên ô đồ Túi */
.o-tui .ch-n { position: absolute; left: 2px; top: 2px; padding: 0 4px; border-radius: 999px; background: #0c314c; color: var(--ch, #fff);
  border: 1px solid #fff; font-size: 10.5px; font-weight: 900; line-height: 14px; pointer-events: none; }
/* 02/12 dọn: ô vừa có +N vừa đang "Giữ lại trong túi" → 🔒 (tui_do.css .o-khoa, góc trên trái) xuống ngay dưới huy hiệu, cùng mép trái
   (góc trên phải là số lượng ở skin Tròn mềm, khe giữa hai thứ chỉ ~15 px), khỏi bị huy hiệu đè */
html body .o-tui:has(.ch-n) > .o-khoa { left: 3px; right: auto; top: 19px; }
@media (max-height: 500px) and (orientation: landscape) {
  html body #bang-ch { width: min(720px, calc(100vw - 24px)); }
  #bang-ch .ch-than { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: start; }
  #bang-ch .ch-hang-the { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; position: sticky; top: 0; z-index: 1; padding-top: 6px; }
  #bang-ch .ch-the { min-height: 50px; }
  #bang-ch .ch-ct { min-height: 0; }
}
/* ===== lan_bien.css ===== */
/* LẶN BIỂN (trinh_khach/src/lan_bien.ts tự gắn tệp này; đồng bộ v2 lan_bien_hud.ts + vỏ Tròn mềm):
   vòng dưỡng khí 4 mức + độ sâu + bình, viền đỏ toàn màn hình 5 s cuối / hết khí, chip xác tàu, vòng tiến độ giữ trên nút, lớp nước.
   Nền đặc, chữ tương phản >= 4.5:1 (không làm mờ nút). */
#lan-hud[hidden], #lan-chip[hidden], #lan-nuoc[hidden], #lan-vien-do[hidden] { display: none !important; }

/* ---------- Viền đỏ toàn màn hình (5 s cuối: cảnh báo nhẹ; hết khí: đậm nhịp thở) ---------- */
#lan-vien-do {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: calc(var(--z-hud-noi, 14) - 1);
}
#lan-vien-do.nguy {
  box-shadow: inset 0 0 38px 10px rgba(235, 36, 48, .48), inset 0 0 80px 18px rgba(175, 10, 24, .24);
  animation: lan-vien-do-tho .85s ease-in-out infinite;
}
#lan-vien-do.het {
  box-shadow: inset 0 0 58px 18px rgba(235, 32, 46, .74), inset 0 0 110px 28px rgba(175, 10, 24, .44);
  animation: lan-vien-do-tho .72s ease-in-out infinite;
}
@keyframes lan-vien-do-tho {
  0%, 100% { opacity: .68; }
  50% { opacity: 1; }
}

/* ---------- HUD vòng dưỡng khí + độ sâu + bình (#lan-hud, vỏ Tròn mềm 2 lớp giống v2) ---------- */
#lan-hud {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 124px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  z-index: var(--z-hud-noi, 14);
  padding: 4px;
  border-radius: 20px;
  border: 2.5px solid #04253a;
  background: linear-gradient(180deg, #62ecff 0%, #159ed8 26%, #09699e 76%, #05446b 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .64), 0 6px 16px rgba(4, 24, 40, .38);
  pointer-events: none;
  max-width: min(268px, calc(100vw - 24px));
}
#lan-hud.it {
  background: linear-gradient(180deg, #ffe27c 0%, #f59c1a 46%, #bf6206 100%);
}
#lan-hud.nguy, #lan-hud.het {
  background: linear-gradient(180deg, #ff9992 0%, #f2424a 42%, #b01620 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .62), 0 0 18px rgba(255, 62, 72, .72), 0 6px 16px rgba(4, 24, 40, .42);
}
#lan-hud.rung { animation: lan-rung .30s linear infinite; }
@keyframes lan-rung {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 1px); }
  50% { transform: translate(3px, -1px); }
  75% { transform: translate(-2px, -1px); }
}

#lan-hud .lan-ruot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border-radius: 15px;
  border: 1.5px solid #0b6394;
  background: linear-gradient(180deg, #ffffff 0%, #edfaff 100%);
  color: #073a5c;
}
#lan-hud.nguy .lan-ruot, #lan-hud.het .lan-ruot {
  border-color: #a81c24;
  background: linear-gradient(180deg, #fffafa 0%, #ffe8e8 100%);
}
#lan-hud .lan-vong {
  --k: 1;
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(#1cb8eb calc(var(--k) * 360deg), #d3e6ef 0);
}
#lan-hud .lan-vong::before {
  content: '';
  position: absolute;
  inset: 5.5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
}
#lan-hud .lan-vong b { position: relative; font-size: 16px; font-weight: 900; line-height: 1; color: #063352; font-variant-numeric: tabular-nums; }
#lan-hud .lan-vong small { position: relative; font-size: 10px; font-weight: 800; margin: 4px 0 0 1px; color: #0b4c75; }
#lan-hud .lan-vong.it { background: conic-gradient(#f28b18 calc(var(--k) * 360deg), #f3dccb 0); }
#lan-hud .lan-vong.it b, #lan-hud .lan-vong.it small { color: #8c3700; }
#lan-hud .lan-vong.nguy { background: conic-gradient(#e0362b calc(var(--k) * 360deg), #f5cfd1 0); }
#lan-hud .lan-vong.nguy b, #lan-hud .lan-vong.nguy small { color: #9c141c; }
#lan-hud .lan-vong.het { background: #e0362b; animation: lan-nhay .5s ease-in-out infinite alternate; }
#lan-hud .lan-vong.het b, #lan-hud .lan-vong.het small { color: #9c141c; }
@keyframes lan-nhay { from { box-shadow: 0 0 0 0 rgba(224, 54, 43, .6); } to { box-shadow: 0 0 0 6px rgba(224, 54, 43, 0); } }

#lan-hud .lan-chu { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.15; white-space: nowrap; }
#lan-hud .lan-hang { display: flex; align-items: center; gap: 6px; }
#lan-hud .lan-sau { font-size: 14.5px; font-weight: 900; color: #073a5c; font-variant-numeric: tabular-nums; }
#lan-hud.nguy .lan-sau, #lan-hud.het .lan-sau { color: #9e1520; }
#lan-hud .lan-binh {
  padding: 1.5px 6px;
  border-radius: 999px;
  border: 1.5px solid #0b6394;
  background: #e1f5ff;
  color: #073a5c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
#lan-hud .lan-binh.co-binh {
  background: linear-gradient(180deg, #dffef0 0%, #a9f4d0 100%);
  border-color: #0f7653;
  color: #074730;
}
#lan-hud .lan-day { font-size: 11.5px; font-weight: 800; color: #0b517a; overflow: hidden; text-overflow: ellipsis; }
#lan-hud.nguy .lan-day, #lan-hud.het .lan-day { color: #a31824; }

/* Điện thoại dọc: đặt #lan-hud phía trên cần ảo (tránh #vk-chip, #dong-ho, #nhiem-vu trên trái) */
@media (orientation: portrait) {
  #lan-hud {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 168px);
    left: calc(env(safe-area-inset-left, 0px) + 10px);
    max-width: calc(100vw - 148px);
  }
}
@media (orientation: landscape) and (max-height: 480px) {
  #lan-hud {
    top: calc(var(--ct-day, 102px) + 4px);
    left: calc(var(--le, 0px) + 10px);
    padding: 3px;
  }
  #lan-hud .lan-ruot { padding: 3px 8px 3px 4px; gap: 6px; }
  #lan-hud .lan-vong { width: 38px; height: 38px; }
  #lan-hud .lan-vong::before { inset: 4.5px; }
  #lan-hud .lan-vong b { font-size: 14px; }
}

/* ---------- Chip chỉ đường Xác tàu đắm (#lan-chip): cột phải dưới bản đồ nhỏ, xep_chip.ts tự xếp theo ưu tiên ---------- */
#lan-chip {
  position: fixed;
  top: calc(var(--mt, 8px) + var(--tren, 0px) + var(--ban-do, 76px) + 14px);
  right: calc(var(--mep, 8px) + var(--phai, 0px));
  z-index: var(--z-chip, 12);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 3px 10px 3px 5px;
  border-radius: 18px;
  pointer-events: none;
  white-space: nowrap;
  max-width: min(210px, 54vw);
  background: linear-gradient(180deg, #fff6d8 0%, #ffe39a 100%);
  border: 2px solid #04253a;
  color: #3a2200;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .65), 0 2px 0 #04253a, 0 4px 10px rgba(4, 24, 40, .3);
}
#lan-chip span { overflow: hidden; text-overflow: ellipsis; }
#lan-chip .lan-mui {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  font-style: normal;
  background: #6b4300;
  color: #fff8e2;
  font-size: 12px;
  transition: transform .15s linear;
}

/* ---------- Nút vòng cung #lan-nut & #lan-nut-giu (vỏ Tròn mềm, tương phản >= 4.5:1) ---------- */
#lan-nut { font-weight: 900; }
html body.dang-lan #lan-nut,
html body.cam-ung.dang-lan #lan-nut {
  background: radial-gradient(circle at 44% 30%, #27b57c 0%, #0f7a52 62%, #074f35 100%) !important;
  border: 2.5px solid #04253a !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 3px 0 #04253a, 0 5px 12px rgba(4, 24, 40, .38) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
html body.dang-lan #lan-nut .nv-c,
html body.cam-ung.dang-lan #lan-nut .nv-c,
html body.cam-ung.dang-lan #lan-nut .nv-i {
  color: #ffffff !important;
}
html body.dang-lan #lan-nut.lan-gap,
html body.cam-ung.dang-lan #lan-nut.lan-gap {
  background: radial-gradient(circle at 44% 30%, #ff7a38 0%, #cc2914 62%, #8a1306 100%) !important;
  border-color: #fff2b2 !important;
  animation: lan-gap .65s ease-in-out infinite alternate !important;
}
@keyframes lan-gap {
  from { box-shadow: 0 0 0 2px rgba(255, 224, 120, .6), 0 0 12px rgba(255, 92, 41, .6); transform: scale(1); }
  to { box-shadow: 0 0 0 5px rgba(255, 224, 120, .92), 0 0 22px rgba(255, 62, 41, .9); transform: scale(1.06); }
}

html body #lan-nut-giu.lan-xac,
html body.cam-ung #lan-nut-giu.lan-xac {
  background: radial-gradient(circle at 44% 30%, #fffbe0 0%, #ffe284 54%, #e59c1e 100%) !important;
  border: 2.5px solid #04253a !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), 0 3px 0 #04253a, 0 5px 12px rgba(4, 24, 40, .35) !important;
  color: #2e1400 !important;
}
html body.cam-ung #lan-nut-giu.lan-xac .nv-c,
html body.cam-ung #lan-nut-giu.lan-xac .nv-i {
  color: #2e1400 !important;
}

/* Đang giữ khai thác / mở rương: vòng vàng chạy quanh viền, giữa là đĩa sáng đặc giữ chữ tương phản cao */
html body #lan-nut-giu.lan-giu,
html body.cam-ung #lan-nut-giu.lan-giu {
  --tien: 0;
  position: relative;
  background: conic-gradient(#ffd84a calc(var(--tien) * 360deg), #0c4d78 0) !important;
  border: 2.5px solid #04253a !important;
  box-shadow: 0 3px 0 #04253a, 0 5px 14px rgba(4, 24, 40, .42) !important;
  color: #04253a !important;
}
html body #lan-nut-giu.lan-giu::before,
html body.cam-ung #lan-nut-giu.lan-giu::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #e7f6ff 100%);
  box-shadow: inset 0 1px 2px rgba(4, 24, 40, .2);
  z-index: 0;
  pointer-events: none;
}
html body #lan-nut-giu.lan-giu.lan-xac::before,
html body.cam-ung #lan-nut-giu.lan-giu.lan-xac::before {
  background: linear-gradient(180deg, #fffef4 0%, #ffefc2 100%);
}
html body #lan-nut-giu.lan-giu > *,
html body.cam-ung #lan-nut-giu.lan-giu .nv-i,
html body.cam-ung #lan-nut-giu.lan-giu .nv-c {
  position: relative;
  z-index: 1;
  color: #04253a !important;
}

/* lớp nước dưới mặt biển: phủ lên cảnh 3D, dưới HUD; --k 0..1 (độ chìm), --s 0..1 (sâu / sâu tối đa) */
#lan-nuoc {
  --k: 0;
  --s: 0;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: calc(.2 + var(--k) * .6);
  background:
    radial-gradient(ellipse 75% 65% at 50% 55%, rgba(0, 0, 0, 0) 55%, rgba(4, 36, 74, calc(.12 + var(--s) * .22)) 100%),
    linear-gradient(180deg, rgba(0, 175, 225, calc(.36 - var(--s) * .10)) 0%, rgba(0, 130, 200, calc(.28 + var(--s) * .10)) 55%, rgba(4, 56, 120, calc(.32 + var(--s) * .20)) 100%);
}
#lan-nuoc.het { box-shadow: inset 0 0 90px rgba(200, 20, 20, .55); }
#lan-nuoc .lan-tia, #lan-nuoc .lan-bot { display: none; }
body.lan-hd #lan-nuoc .lan-tia {
  display: block;
  position: absolute;
  top: -20%;
  left: 18%;
  width: 16%;
  height: 120%;
  transform: skewX(-18deg);
  background: linear-gradient(180deg, rgba(200, 250, 255, .22) 0%, rgba(200, 250, 255, 0) 80%);
  opacity: calc(1 - var(--s) * .8);
  animation: lan-tia 7s ease-in-out infinite alternate;
}
body.lan-hd #lan-nuoc .lan-tia.t2 { left: 48%; width: 10%; animation-duration: 9s; animation-delay: -3s; }
body.lan-hd #lan-nuoc .lan-tia.t3 { left: 72%; width: 13%; animation-duration: 11s; animation-delay: -6s; }
@keyframes lan-tia { from { opacity: calc(.35 - var(--s) * .3); translate: -2vw 0; } to { opacity: calc(.9 - var(--s) * .7); translate: 2vw 0; } }
body.lan-hd #lan-nuoc .lan-bot {
  display: block;
  position: absolute;
  bottom: -12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(225, 250, 255, .75);
  background: rgba(225, 250, 255, .18);
  animation: lan-bot 3.4s linear infinite;
}
body.lan-hd #lan-nuoc .lan-bot:nth-of-type(1) { left: 47%; animation-delay: 0s; }
body.lan-hd #lan-nuoc .lan-bot:nth-of-type(2) { left: 51%; width: 5px; height: 5px; animation-delay: -.7s; }
body.lan-hd #lan-nuoc .lan-bot:nth-of-type(3) { left: 49%; width: 6px; height: 6px; animation-delay: -1.5s; }
body.lan-hd #lan-nuoc .lan-bot:nth-of-type(4) { left: 53%; animation-delay: -2.1s; }
body.lan-hd #lan-nuoc .lan-bot:nth-of-type(5) { left: 22%; width: 5px; height: 5px; animation-delay: -1.1s; animation-duration: 5s; }
body.lan-hd #lan-nuoc .lan-bot:nth-of-type(6) { left: 78%; width: 6px; height: 6px; animation-delay: -2.8s; animation-duration: 4.4s; }
body.lan-hd #lan-nuoc .lan-bot:nth-of-type(7) { left: 64%; width: 4px; height: 4px; animation-delay: -3.9s; animation-duration: 6s; }
@keyframes lan-bot { from { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } to { transform: translate(8px, -60vh); opacity: 0; } }

/* lần đầu xuống bơi (lan_bien.ts meoLanDau): nút Lặn nhấp nháy viền vàng tới khi lặn lần đầu */
html body #lan-nut.lan-moi { outline: 3px solid #ffd84a !important; outline-offset: 2px; animation: lan-moi .8s ease-in-out infinite alternate !important; }
@keyframes lan-moi { from { outline-color: #ffd84a; transform: scale(1); } to { outline-color: #fff6c8; transform: scale(1.08); } }

/* LẶN ĐÊM (ve3d/lan_bien3d.ts capNhatAnhSang, bê v2 tinhMoiTruongDuoiNuoc suongDem + đèn pin): --dem 0..1 tối màn theo đêm;
   mức Vừa trở lên (class den) chừa quầng sáng đèn pin quanh người lặn (--dx, --dy = toạ độ màn của người). Tia nắng / bọt nhạt dần về đêm. */
#lan-nuoc { --dem: 0; --dx: 50%; --dy: 55%; }
#lan-nuoc::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: var(--dem); background: rgba(2, 10, 28, .55); }
#lan-nuoc.den::after { background: radial-gradient(circle at var(--dx) var(--dy), rgba(2, 10, 28, 0) 0, rgba(2, 10, 28, .06) 70px, rgba(2, 10, 28, .5) 170px, rgba(2, 8, 22, .82) 300px); }
body.lan-hd #lan-nuoc .lan-tia { filter: opacity(calc(1 - var(--dem))); }
body.lan-hd #lan-nuoc .lan-bot { filter: opacity(calc(1 - var(--dem) * .6)); }
@media (prefers-reduced-motion: reduce) {
  #lan-hud.rung, #lan-vien-do.nguy, #lan-vien-do.het, #lan-hud .lan-vong.het,
  html body.dang-lan #lan-nut.lan-gap, html body #lan-nut.lan-moi {
    animation: none !important;
  }
}
/* ===== v2_dot3.css ===== */
/* Đợt bê v2 thứ 3 (02/12/2026): thẻ Tiện nghi (tien_nghi_ui.ts), dải thông báo toàn biển + tab Tiên phong (moc_dau_ui.ts).
   Nền đặc, tương phản cao (không hạ opacity nút / chữ). */

/* ---- dải thông báo toàn biển: một dòng, giữa-trên ---- */
#tb-hv {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 44px); transform: translateX(-50%);
  z-index: 60; max-width: min(92vw, 560px); padding: 6px 14px; border-radius: 999px;
  background: #2a1d08; border: 2px solid #ffd84a; color: #fff3c4; font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}
#tb-hv { text-align: center; }   /* vị trí + bề rộng do thong_bao_hang.ts datDaiNoi đặt inline (dải trống như toast) */
#tb-hv.vao { animation: tbhv-vao .35s ease-out; }
@keyframes tbhv-vao { from { translate: 0 -14px; } to { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { #tb-hv.vao { animation: none; } }

/* ---- tab Tiên phong ---- */
.md-bang .st-ghi { margin: 4px 0 8px; color: #1d3a4d; font-size: 13px; font-weight: 600; }
.md-ds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.md-ds li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; padding: 8px 10px;
  border-radius: 8px; background: #12283a; border: 1px solid #2f5672; }
.md-ds li.co { background: #2a2208; border-color: #c9a227; }
.md-ten { font-weight: 700; color: #fff; }
.md-ai { color: #ffd84a; font-weight: 700; }
.md-ai small { margin-left: 6px; color: #e8d9a8; font-weight: 400; }
.md-chua { color: #9fc0d6; font-size: 12px; }

/* ---- thẻ Tiện nghi trong bảng Đảo nhà ---- */
.tng-the h4 { margin: 0 0 6px; }
.tng-thanh { position: relative; height: 12px; border-radius: 6px; background: #0d1e2b; border: 1px solid #2f5672; overflow: visible; }
.tng-thanh > i:first-child { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #4fd18b, #ffd84a); }
.tng-moc { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: #9fc0d6; border-radius: 2px; }
.tng-moc.dat { background: #fff3c4; }
.tng-tt { margin: 6px 0; font-size: 13px; color: #e8f2f8; }
.tng-ds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 8px; }
.tng-ds li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #9fc0d6; padding: 3px 6px; border-radius: 6px; background: #10222f; }
.tng-ds li.co { color: #eafff1; background: #133a26; }
.tng-ds li span { width: 14px; text-align: center; font-weight: 700; }
.tng-ds li.co span { color: #6dffa6; }
.tng-ds li b { margin-left: auto; color: #ffd84a; font-weight: 700; }
/* ===== than_nhiet.css ===== */
/* THÂN NHIỆT + ĐÊM BÃO CỰC HÀN (trinh_khach/src/than_nhiet.ts tự gắn tệp này). Nền đặc, chữ tương phản; viền băng nằm DƯỚI HUD
   (không làm mờ nút), chỉ đọng ở mép màn. */
#cs-tn[hidden], #tn-bang[hidden], #bch-chip[hidden] { display: none !important; }

/* ---------- vạch thân nhiệt trong khung chỉ số ---------- */
#cs-tn { cursor: pointer; pointer-events: auto; }
#cs-tn > i.tn-icon { display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
#cs-tn > i.tn-icon svg { width: 100%; height: 100%; display: block; }
html body #cs-tn b span { background: linear-gradient(90deg, #3a8dff, #7fd6ff 55%, #ffb25a); }
html body #cs-tn.lanh b span { background: linear-gradient(90deg, #2f7de8, #8fdcff); }
html body #cs-tn.thap b span { background: linear-gradient(90deg, #1e5fd0, #5fb8ff); }
html body #cs-tn.bao > em { color: #bfe9ff; }
html body #cs-tn.thap > em { color: #9fe0ff; }

/* ---------- viền băng: sương giá ở bốn mép, giữa trong suốt ---------- */
#tn-bang {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-canh, 5);   /* lớp phủ sát cảnh, dưới mọi nút / HUD */
  transition: opacity .8s ease;
}
#tn-bang.m1 { background: radial-gradient(ellipse 72% 70% at 50% 50%, transparent 62%, rgba(200, 236, 255, .28) 86%, rgba(232, 248, 255, .55) 100%); }
#tn-bang.m2 { background: radial-gradient(ellipse 70% 66% at 50% 50%, transparent 52%, rgba(200, 236, 255, .38) 80%, rgba(238, 250, 255, .78) 100%);
  box-shadow: inset 0 0 40px 10px rgba(238, 250, 255, .6); }
#tn-bang.m3 {
  background: radial-gradient(ellipse 66% 62% at 50% 50%, transparent 44%, rgba(190, 230, 255, .45) 74%, rgba(244, 252, 255, .9) 100%);
  box-shadow: inset 0 0 56px 18px rgba(244, 252, 255, .8);
  animation: tn-bang-tho 2.4s ease-in-out infinite;
}
@keyframes tn-bang-tho { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }

/* ---------- chip Đêm Bão Cực Hàn (cột chip phải dưới bản đồ nhỏ, xep_chip.ts xếp) ---------- */
#bch-chip {
  position: fixed;
  top: calc(var(--mt, 8px) + var(--tren, 0px) + var(--ban-do, 76px) + 14px);
  right: calc(var(--mep, 8px) + var(--phai, 0px));
  z-index: var(--z-chip, 12);
  display: flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 3px 10px; border-radius: 18px;
  pointer-events: none; white-space: nowrap; max-width: min(240px, 60vw);
  font-size: 12px; font-weight: 900; border: 2px solid #04253a;
  background: linear-gradient(180deg, #eef8ff 0%, #c9e6ff 100%); color: #06304f;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .65), 0 2px 0 #04253a, 0 4px 10px rgba(4, 24, 40, .3);
}
#bch-chip.dang { background: linear-gradient(180deg, #dff2ff 0%, #9fd2ff 100%); color: #032845; }
#bch-chip.du { background: linear-gradient(180deg, #e5fff3 0%, #b8f5d8 100%); color: #06472c; }
#bch-chip span { overflow: hidden; text-overflow: ellipsis; }
#bch-chip b { font-variant-numeric: tabular-nums; font-weight: 900; }
#bch-chip i { font-style: normal; font-weight: 900; padding: 0 6px; border-radius: 10px; background: #04253a; color: #e8f7ff; font-size: 11px; }
/* ===== nhip_bien.css ===== */
/* NHỊP BIỂN (trinh_khach/src/nhip_bien.ts): trăng #dh-trang trong cụm #dh-khihau, thẻ chung #khihau-the (Tròn mềm),
   chip đợt đồ trôi #dh-dot & xác tàu trôi #xtt-chip (xep_chip.ts xếp cột phải dưới bản đồ nhỏ), nút vòng #xtt-nut, dòng bảo đảm rương #ruong-bd. */
#dh-trang .trang-svg, #khihau-the .trang-svg, #trang-the .trang-svg { width: 17px; height: 17px; flex: 0 0 auto; display: block; }
#khihau-the .mua-svg { width: 19px; height: 19px; flex: 0 0 auto; display: block; }
#dong-ho.co1 #dh-trang .dh-dai, #dong-ho.co2 #dh-trang .dh-dai, #dong-ho.co3 #dh-trang .dh-dai { display: none; }

/* Thẻ chung Thời tiết · Mùa · Trăng (#khihau-the): skin Tròn mềm nền đặc sáng */
#khihau-the {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  top: calc(var(--tren, 0px) + var(--mt, 8px) + 52px);
  width: min(356px, calc(100vw - 24px));
  max-height: calc(100vh - var(--tren, 0px) - var(--day, 0px) - 70px);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; border: 3px solid #04253a;
  background: linear-gradient(180deg, #fffdf6 0%, #f1f9ff 100%);
  box-shadow: 0 14px 32px rgba(3, 18, 34, 0.45), inset 0 2px 0 #ffffff;
  color: #0b2f47;
}
#khihau-the[hidden] { display: none !important; }
#khihau-the > .tieu-de {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: linear-gradient(180deg, #15669c 0%, #0e4c78 100%);
  border-bottom: 2.5px solid #04253a; border-radius: 16px 16px 0 0;
  padding: 5px 8px 5px 14px; color: #ffffff; font-size: 14px; font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35); flex: 0 0 auto;
}
#khihau-the > .tieu-de .nut-x {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: 0 0 auto;
  border-radius: 12px; border: 2px solid #04253a;
  background: linear-gradient(180deg, #c81e2b 0%, #9e1520 100%);
  color: #ffffff; font-size: 24px; font-weight: 900; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 0 #701018;
}
#khihau-the .kh-than {
  overflow-y: auto; padding: 10px 11px 12px; display: grid; gap: 8px;
}
#khihau-the .kh-muc {
  background: #ffffff; border: 2px solid #b5d5e8; border-radius: 14px;
  padding: 8px 10px; display: grid; gap: 3px;
  box-shadow: 0 2px 6px rgba(4, 24, 40, .06);
}
#khihau-the .kh-muc.kh-troi { border-color: #7cc5eb; background: linear-gradient(180deg, #ffffff 0%, #f2faff 100%); }
#khihau-the .kh-muc.kh-mua { border-color: #e6bd56; background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%); }
#khihau-the .kh-muc.kh-trang { border-color: #9bb8d6; background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%); }
#khihau-the .kh-muc b { font-size: 14.5px; font-weight: 900; color: #0b2f47; display: flex; align-items: center; gap: 6px; }
#khihau-the .kh-muc > span { font-size: 12px; font-weight: 700; color: #245a7a; }
#khihau-the .kh-muc p { margin: 2px 0 0; font-size: 13px; line-height: 1.38; color: #0b2f47; }
#khihau-the .kh-muc ul { margin: 2px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.4; color: #0b2f47; }
#khihau-the .kh-muc ul b { display: inline; font-size: 12.5px; color: #0d6d3e; }
#khihau-the .kh-muc small { font-size: 11.5px; color: #245a7a; line-height: 1.35; }
#khihau-the .kh-muc .trang-svg { width: 20px; height: 20px; }

#trang-the { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: 48px; width: min(320px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 18px; background: linear-gradient(180deg, #fffdf6 0%, #f1f9ff 100%); border: 3px solid #04253a;
  box-shadow: 0 12px 28px rgba(3, 18, 34, .4); color: #0b2f47; display: grid; gap: 4px; cursor: pointer; }
#trang-the[hidden] { display: none; }
#trang-the b { font-size: 16px; display: flex; align-items: center; gap: 6px; color: #0b2f47; }
#trang-the b .trang-svg { width: 24px; height: 24px; }
#trang-the > span { font-size: 12.5px; color: #245a7a; font-weight: 700; }
#trang-the p { margin: 2px 0; font-size: 13.5px; line-height: 1.4; color: #0b2f47; }
#trang-the small { font-size: 11.5px; color: #245a7a; }

#ruong-bd { margin: 6px auto 0; max-width: 92%; text-align: center; font-size: 13px; font-weight: 700; color: #0b2f47; background: #e8f5ff;
  border: 2px solid #04253a; border-radius: 12px; padding: 5px 10px; }
#ruong-bd.trung { background: #fff4c8; border-color: #9e4b00; color: #4a2300; }

/* Chip sự kiện cột phải dưới bản đồ nhỏ (#dh-dot đợt đồ trôi + #xtt-chip xác tàu trôi): xep_chip.ts xếp theo ưu tiên, không đè nhau */
#dh-dot, #xtt-chip {
  position: fixed;
  top: calc(var(--mt, 8px) + var(--tren, 0px) + var(--ban-do, 76px) + 14px);
  right: calc(var(--mep, 8px) + var(--phai, 0px));
  z-index: var(--z-chip, 12);
  display: flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 3px 10px; border-radius: 18px;
  pointer-events: none; white-space: nowrap; max-width: min(210px, 54vw);
  font-size: 12px; font-weight: 900; border: 2px solid #04253a;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .65), 0 2px 0 #04253a, 0 4px 10px rgba(4, 24, 40, .3);
}
#dh-dot[hidden], #xtt-chip[hidden], #xtt-nut[hidden] { display: none !important; }
#dh-dot { background: linear-gradient(180deg, #e8faff 0%, #c6efff 100%); color: #053854; }
#dh-dot.dang { background: linear-gradient(180deg, #e5fff3 0%, #b8f5d8 100%); color: #06472c; }
#dh-dot b { font-variant-numeric: tabular-nums; font-weight: 900; }

#xtt-chip { padding-left: 5px; background: linear-gradient(180deg, #ffe9d2 0%, #ffc98a 100%); color: #3a1a00; }
#xtt-chip span { overflow: hidden; text-overflow: ellipsis; }
#xtt-chip .xtt-mui { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 50%; font-style: normal; background: #7a3a00; color: #fff8e2; font-size: 12px; transition: transform .15s linear; }

/* Nút #xtt-nut ("🪓 Trục vớt"): nằm trong vòng cung .nut-vong (cảm ứng) hoặc #dn-thanh (PC), KHÔNG cố định giữa đáy */
html body #xtt-nut {
  font-weight: 900; opacity: 1 !important;
  background: radial-gradient(circle at 44% 30%, #fff6e0 0%, #ffbe63 55%, #d67614 100%) !important;
  border: 2.5px solid #04253a !important;
  color: #2e1400 !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), 0 3px 0 #04253a, 0 5px 12px rgba(4, 24, 40, .35) !important;
}
html body.cam-ung #xtt-nut .nv-i,
html body.cam-ung #xtt-nut .nv-c { color: #2e1400 !important; }
html body #xtt-nut.xtt-giu,
html body.cam-ung #xtt-nut.xtt-giu {
  --tien: 0;
  background: conic-gradient(from -90deg, #ffd84a calc(var(--tien, 0) * 360deg), #6b3d0e 0) !important;
}
html body #xtt-nut.xtt-giu::before {
  content: ''; position: absolute; inset: 5px; border-radius: 8px;
  background: linear-gradient(180deg, #fffef4 0%, #ffefc2 100%); z-index: 0; pointer-events: none;
}
html body.cam-ung #xtt-nut.xtt-giu::before { border-radius: 50%; }
html body #xtt-nut.xtt-giu > * { position: relative; z-index: 1; color: #2e1400 !important; }
/* ===== intro.css ===== */
/* ĐOẠN INTRO MỞ ĐẦU (trinh_khach/src/intro.ts, ve3d/intro3d.ts; kịch bản docs/so_sanh_ui_v1_v2/intro_0212.md).
   #intro: lớp phủ bắt chạm cả màn (z 66: trên thông báo nổi, dưới màn che / hộp xác nhận / màn tải) gồm màn mờ đầu, một dòng phụ đề ở mép
   dưới và nút "Bỏ qua ▸" ≥ 44 px góc trên phải (tránh tai thỏ). body.dang-intro: ẩn mọi thứ trừ cảnh 3D, lớp intro và các màn hệ thống. */
#intro { position: fixed; inset: 0; z-index: 66; pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
#intro[hidden] { display: none; }
#intro .it-man { position: absolute; inset: 0; pointer-events: none; opacity: 1;
  background: linear-gradient(180deg, #f6c79a 0%, #f3d9b8 38%, #bfe2ec 70%, #7fc3d6 100%); }
#intro .it-bo { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px));
  min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid rgba(232, 251, 255, .55);
  background: rgba(6, 20, 34, .72); color: #f4fbff; font: 700 15px/44px system-ui, sans-serif; letter-spacing: .02em; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25); z-index: 2; }
#intro .it-bo:active { transform: scale(.96); background: rgba(6, 20, 34, .88); }
#intro .it-chu { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 6px);
  width: max-content; max-width: min(calc(100vw - 32px), 640px); padding: 7px 16px; border-radius: 18px;
  background: rgba(6, 20, 34, .74); border: 1px solid rgba(232, 251, 255, .32); box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  text-align: center; pointer-events: none; z-index: 1;
  color: #fffdf6; font: 600 17px/1.35 system-ui, sans-serif; text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
  opacity: 0; transition: opacity .35s ease, transform .35s ease; }
#intro .it-chu.hien { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 480px) { #intro .it-chu { font-size: 15px; } }
@media (max-height: 420px) { #intro .it-chu { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { #intro .it-chu { transition: opacity .2s linear; transform: translate(-50%, 0); } }
/* đang diễn: chỉ còn cảnh 3D + lớp intro; màn tải, mất kết nối, hộp xác nhận, màn che vẫn hiện nếu có */
body.dang-intro > *:not(#cv3d):not(#intro):not(#man-tai):not(#mat-ket-noi):not(#hop-thoai):not(#gl-mat):not(script):not(style):not(link) { visibility: hidden !important; }
/* ===== mang_hud.css ===== */
/* Chip mạng trên HUD (trinh_khach/src/mang_hud.ts): trễ khứ hồi + "Đang nối lại…". Chỉ để xem: không nhận chạm.
   Nền đặc tối, chữ tương phản ≥ 4.5:1 (docs feedback: không làm mờ nút). */
#mang-chi {
  position: fixed;
  z-index: 40;
  /* góc dưới trái: dưới cần đi (điện thoại dọc / ngang), không chồng nút nào (tools/chup_noi_lai.mjs đo) */
  left: calc(env(safe-area-inset-left, 0px) + 6px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9px;
  background: #0f1d2b;
  border: 1px solid #2c4258;
  color: #f1f5f9;
  font: 600 11px/16px system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
#mang-chi[hidden] { display: none; }
#mang-chi i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
#mang-chi.tot { color: #4ade80; }
#mang-chi.vua { color: #fbbf24; }
#mang-chi.cham { color: #fca5a5; }
#mang-chi.noi { color: #fde68a; background: #3b2a06; border-color: #a16207; }
#mang-chi.noi i {
  background: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  width: 6px;
  height: 6px;
  animation: mang-chi-quay 0.8s linear infinite;
}
@keyframes mang-chi-quay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #mang-chi.noi i { animation: none; } }
/* tay trái (cài đặt): cần đi sang phải, nút chính sang trái → chip theo cần đi sang góc dưới phải */
body.tay-trai #mang-chi { left: auto; right: calc(env(safe-area-inset-right, 0px) + 6px); }
/* ===== 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: calc(var(--cao, 100vh) * 0.4); 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: calc(var(--cao, 100vh) * 0.22); 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: calc(var(--cao, 100vh) * 0.18); }
  .gy-than { gap: 6px; }
}
