/* Đảo trôi + người cá (trinh_khach/src/dao_ui.ts, nguoi_ca_ui.ts) */

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

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

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

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

/* điện thoại dọc: tấm trượt dưới đáy */
@media (max-width: 620px) {
  #bang-nguoi-ca { left: calc(8px + var(--le)); right: calc(8px + var(--phai)); top: auto; bottom: calc(8px + var(--day)); transform: none;
    width: auto; max-height: 66vh; }
  @supports (height: 1dvh) { #bang-nguoi-ca { max-height: 66dvh; } }
  .nca-vat { width: 46px; }
}
/* điện thoại ngang: cột bên phải, cao hết màn */
@media (max-height: 500px) and (min-width: 621px) {
  #bang-nguoi-ca { top: calc(8px + var(--tren)); bottom: calc(8px + var(--day)); transform: none; width: min(400px, 54vw); max-height: none; }
  .nca-dau { padding-top: 6px; }
  .nca-chan { width: 44px; height: 44px; }
}
