/* layout.css — lớp bố cục cuối cùng của InfyPets (nạp sau mọi tệp CSS khác).
   Mục tiêu: (1) giao diện tự phóng theo màn hình, từ iPhone 13 tới màn 2K/4K;
             (2) một điểm nhìn chính: "Mục tiêu kế tiếp" nằm ngay trên các nút thao tác;
             (3) các cụm không đè lên nhau. */

/* ---------- 1. Tự phóng to trên màn hình lớn ----------
   --ui-zoom do đoạn mã đầu game.html tính (1 trên điện thoại/máy tính bảng; ~1,4–1,8 trên màn 2K).
   Mọi đơn vị vw/vh trong các tệp CSS đã được chia cho --ui-zoom nên kích thước theo khung nhìn vẫn đúng. */
body > :not(canvas):not(script):not(style):not(link) { zoom: var(--ui-zoom, 1); }

/* ---------- 2. Ô "Mục tiêu kế tiếp" ở đầu thanh dưới ---------- */
#ui.pr-ui #bottom-dock > #ob-next-goal {
  order: -1;
  align-self: center;
  width: 100%;
  max-width: 460px;
  min-height: 54px;
  padding: 7px 10px 7px 12px;
  gap: 10px;
  border-radius: 18px;
  filter: drop-shadow(0 0 0 rgba(255, 196, 56, 0)) drop-shadow(0 5px 10px rgba(36, 15, 4, 0.34));
  animation: lay-goal-glow 2.6s ease-in-out infinite;
}
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-ico { width: 30px; height: 30px; flex: 0 0 30px; }
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-kicker { display: inline; font-size: 10.5px; }
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-num { font-size: 12px; }
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-text {
  font-size: 14.5px;
  line-height: 1.22;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-bar { height: 8px; }
/* "Đi tới ›" thành nút thật: thứ duy nhất màu xanh nổi trên nền kem, mắt tự tìm tới. */
#ui.pr-ui #bottom-dock > #ob-next-goal .gd-go {
  align-self: center;
  margin-inline-start: 2px;
  min-height: 38px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(#58b9ff, #1f7fe0 62%, #1a6cc6);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #0f4c94;
  color: #fff;
  font-size: 13.5px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 0 #0f4c94;
}
@keyframes lay-goal-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 196, 56, 0)) drop-shadow(0 5px 10px rgba(36, 15, 4, 0.34)); }
  50% { filter: drop-shadow(0 0 9px rgba(255, 196, 56, 0.95)) drop-shadow(0 5px 10px rgba(36, 15, 4, 0.34)); }
}
/* Đã có ô mục tiêu thì dải nhiệm vụ mảnh (trùng thông tin) nhường chỗ ở mọi cỡ màn hình. */
body:has(#ob-next-goal:not(.ob-hidden)) #ui.pr-ui #quest-hint { display: none; }

/* ---------- 3. Thông báo nổi: nằm ngay dưới cụm trên cùng, không đè HUD, đảo tab hay cột nút phải ---------- */
body:has(#ui) #ui.pr-ui .pr-toast-stack {
  top: calc(var(--pr-top-end, 104px) + 8px);
  width: min(calc(100% - 128px), 390px);
}
#ui.pr-ui .pr-toast { position: relative; }
#ui.pr-ui .pr-toast-count {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #1f7fe0;
  color: #fff;
  font-size: 0.86em;
  font-weight: 900;
  text-shadow: none;
  vertical-align: 1px;
}

/* ---------- 4. Điện thoại dọc (iPhone 13: 390×844; Safari còn ~390×664) ---------- */
@media (max-width: 700px) and (orientation: portrait) {
  /* Cột nút phải bắt đầu dưới hàng tab đảo để không cắn vào tab hay dải trứng lạ. */
  #ui-peek { top: calc(max(var(--ui-pad, 8px), env(safe-area-inset-top, 0px)) + 96px); }
  #ui.pr-ui > #nav-group { top: calc(max(var(--ui-pad, 8px), env(safe-area-inset-top, 0px)) + 148px); }
  #ui.pr-ui .pr-wild-banner { max-width: calc(100% - 56px); }
  body:has(#ui) #ui.pr-ui .pr-toast-stack { left: max(var(--ui-pad, 8px), env(safe-area-inset-left, 0px)); right: 60px; width: auto; transform: none; }
  #ui.pr-ui #bottom-dock > #ob-next-goal { max-width: none; }
}
/* Màn rất thấp (Safari có thanh địa chỉ, máy nhỏ): thu gọn ô mục tiêu còn một dòng. */
@media (max-width: 700px) and (max-height: 700px) and (orientation: portrait) {
  #ui.pr-ui #bottom-dock > #ob-next-goal { min-height: 46px; padding-block: 5px; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-kicker { display: none; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-text { -webkit-line-clamp: 1; line-clamp: 1; }
}

/* ---------- 5. Điện thoại ngang / cửa sổ thấp ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  #ui.pr-ui #bottom-dock > #ob-next-goal { min-height: 40px; max-width: 360px; padding: 3px 8px 3px 10px; gap: 7px; animation: none; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-ico { width: 22px; height: 22px; flex-basis: 22px; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-kicker,
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-bar { display: none; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-text { font-size: 12.5px; -webkit-line-clamp: 1; line-clamp: 1; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .gd-go { min-height: 30px; padding: 4px 10px; font-size: 12px; }
}

/* ---------- 6. Màn rộng (laptop → 2K/4K sau khi phóng) ---------- */
@media (min-width: 1180px) and (min-height: 501px) {
  /* Thanh dưới ba hàng: [mục tiêu] / [khay trứng | nhiệm vụ] / [thẻ pet | nút thao tác]. */
  #ui.pr-ui .ar-dock > #ob-next-goal { grid-area: 1 / 1 / 2 / 3; justify-self: center; width: min(100%, 520px); max-width: none; }
  #ui.pr-ui .ar-dock > .pr-quest-hint { grid-area: 2 / 2; }
  #ui.pr-ui .ar-dock > .pr-egg-tray { grid-area: 2 / 1; }
  #ui.pr-ui .ar-dock > .pr-action-bar { grid-area: 3 / 2; }
  #ui.pr-ui .ar-dock > .ar-pet-rail { grid-area: 3 / 1; }
  /* Cụm tài khoản luôn bám góc phải trên, không trôi xuống giữa màn khi có dải sự kiện. */
  body:has(#ui) #ob-hud { top: max(12px, env(safe-area-inset-top, 0px)) !important; }
}

@media (prefers-reduced-motion: reduce) {
  #ui.pr-ui #bottom-dock > #ob-next-goal { animation: none; }
}

/* ---------- 7. iPhone / màn cảm ứng: ô nhập chữ ≥ 16px để Safari không tự phóng trang khi gõ (lỗi giao diện bị cắt hai mép) ---------- */
@media (pointer: coarse) {
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), textarea, select { font-size: 16px !important; }
}

/* ---------- 8. Thẻ mừng (lên cấp, xong chương): nằm ngay dưới cụm trên cùng; thông báo nổi tự lùi xuống dưới thẻ ---------- */
body #gd-celebration { top: calc(var(--pr-top-end, 104px) + 8px); max-width: min(calc(100% - 128px), 400px); }
body:has(#gd-celebration:not(.ob-hidden)) #ui.pr-ui .pr-toast-stack { top: calc(var(--pr-top-end, 104px) + 96px); }
@media (max-width: 700px) and (orientation: portrait) {
  body #gd-celebration { left: max(var(--ui-pad, 8px), env(safe-area-inset-left, 0px)); right: 60px; width: auto; max-width: none; transform: none; padding: 9px 12px; gap: 10px; animation-name: lay-arrive; }
  body #gd-celebration > span { font-size: 26px; }
  body:has(#gd-celebration:not(.ob-hidden)) #ui.pr-ui .pr-toast-stack { top: calc(var(--pr-top-end, 104px) + 84px); }
}
@media (max-height: 520px) and (orientation: landscape) {
  body:has(#gd-celebration:not(.ob-hidden)) #ui.pr-ui .pr-toast-stack { top: calc(var(--pr-top-end, 60px) + 64px); }
}
@keyframes lay-arrive { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- 9. Màn cảm ứng: chạm hai lần / giữ lâu không gọi phóng trang, bôi chữ hay bảng chọn của hệ thống ---------- */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .pr-code-box, .pr-share-code { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* Độ ưu tiên bằng 0 (:where) để các vùng tự xử lý chạm như sân chơi nhỏ, cảnh 3D vẫn giữ touch-action riêng. */
:where(#ui, #ui *, #ob-root, #ob-root *, dialog, dialog *) { touch-action: manipulation; }
img { -webkit-user-drag: none; }

/* ---------- 10. Chữ trên nút trong cửa hàng không xuống dòng ("Mua trứng", "+5 phần (25 xu)", "Cấp 4") ---------- */
:is(.pr-shop-row, .pr-food-btns, .pr-zone-row) .pr-btn,
:is(.pr-shop-row, .pr-food-btns, .pr-zone-row) .pr-btn * { white-space: nowrap; }
:is(.pr-shop-row, .pr-zone-row) > .pr-btn { flex-shrink: 0; padding-inline: 10px; }
.pr-food-btns .pr-btn { flex: 1 1 118px; padding-inline: 8px; }

/* ---------- 11. Khi một bảng đang mở, thông báo nổi dời lên sát mép trên (trên phần HUD đã mờ) để không che nội dung bảng ---------- */
body:has(#modal-backdrop.is-open) #ui.pr-ui .pr-toast-stack { top: max(6px, env(safe-area-inset-top, 0px)); }

/* ---------- 12. Dải pet gọn: mỗi pet một ô hình; chạm vào thì tên và ba vạch chỉ số hiện ở bảng hành động ngay phía trên.
   Bấm "Thao tác" thì thẻ đang chọn mới bung đủ chi tiết. Nút lọc theo độ hiếm ở đầu dải ---------- */
#ui.pr-ui #pet-strip .pr-pet-card:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) {
  flex: 0 0 auto; width: 48px; height: 48px; min-width: 0; max-width: none; padding: 4px;
  align-self: center; align-items: center; justify-content: center;
}
#ui.pr-ui #pet-strip .pr-pet-card:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) :is(.pr-pet-info, .pr-pet-bars, .pr-pet-v3, .pr-away-badge) { display: none; }
#ui.pr-ui #pet-strip .pr-pet-card:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) .pr-pet-head { gap: 0; }
#ui.pr-ui #pet-strip .pr-pet-card:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) .pr-pet-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; }
#ui.pr-ui #pet-strip .pr-pet-card:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) .pr-pet-avatar svg { width: 30px; height: 30px; }
#ui.pr-ui #pet-strip .pr-pet-card.is-selected { flex: 0 0 auto; }
#ui.pr-ui #pet-strip .pr-pet-avatar { position: relative; }
/* Chấm báo: đỏ = pet đang đói, buồn hoặc mệt; vàng = pet thám hiểm đã về, chờ nhận quà. */
.pr-pet-flag { display: none; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff6d8; z-index: 2; pointer-events: none; }
.pr-pet-card.is-needy .pr-pet-flag { display: block; background: #e5484d; }
.pr-pet-card.is-gift .pr-pet-flag { display: block; background: #f5b014; }
.pr-pet-card.is-selected .pr-pet-flag { display: none; }   /* pet đang chọn đã có đủ vạch chỉ số ở bảng hành động */
@media (prefers-reduced-motion: no-preference) {
  .pr-pet-card.is-gift:not(.is-selected) .pr-pet-flag { animation: lay-flag-pulse 1.4s ease-in-out infinite; }
}
@keyframes lay-flag-pulse { 50% { transform: scale(1.3); } }

#ui.pr-ui #pet-strip .pr-rar-filter {
  position: sticky; left: 0; z-index: 3; flex: 0 0 auto; align-self: center;
  width: 48px; height: 48px; min-width: 0; min-height: 0; padding: 3px 2px; gap: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 900; line-height: 1.1; white-space: nowrap; pointer-events: auto;
  /* Nút dính ở mép trái: nền đặc bo góc như ô pet và một viền tối để ô pet cuộn qua bên dưới không ló ra ở bốn góc. */
  border-radius: 13px; box-shadow: 0 0 0 3px rgba(42, 22, 8, 0.55), 6px 0 8px -3px rgba(42, 22, 8, 0.5);
}
.pr-rar-filter-gem { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); margin: 2px 0 4px; border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: conic-gradient(var(--rar-0) 0 25%, var(--rar-1) 0 50%, var(--rar-2) 0 75%, var(--rar-3) 0); }
.pr-rar-filter[data-rar="0"] .pr-rar-filter-gem { background: var(--rar-0); }
.pr-rar-filter[data-rar="1"] .pr-rar-filter-gem { background: var(--rar-1); }
.pr-rar-filter[data-rar="2"] .pr-rar-filter-gem { background: var(--rar-2); }
.pr-rar-filter[data-rar="3"] .pr-rar-filter-gem { background: var(--rar-3); }
.pr-rar-filter-txt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pr-rar-filter-num { font-size: 9px; opacity: 0.85; }

/* Ba vạch chỉ số của pet đang chọn: một hàng mảnh giữa dòng tên và hàng nút. */
#ui.pr-ui .pr-sel-bars { flex-direction: row; gap: 10px; padding: 0 3px; }
#ui.pr-ui .pr-sel-bars .pr-stat-row { flex: 1 1 0; min-width: 0; grid-template-columns: 15px minmax(0, 1fr) auto; gap: 4px; font-size: 10px; line-height: 1; }
#ui.pr-ui .pr-sel-bars .pr-stat-row > span:first-child { width: 14px; height: 14px; }
#ui.pr-ui .pr-sel-bars .pr-stat-track { height: 7px; }
#ui.pr-ui .pr-sel-bars .pr-stat-num { min-width: 15px; text-align: right; }
#ui.pr-ui .pr-bottom-dock.is-more .pr-sel-bars { display: none; }   /* lúc này thẻ đang chọn đã bung đủ chi tiết */

/* ---------- 13. Màn dọc: không để khoảng trống thừa ---------- */
@media (max-width: 700px) and (orientation: portrait) {
  /* Ít pet thì hàng ô hình canh giữa dưới bảng hành động; nhiều pet thì tự thành dải cuộn như cũ. */
  #ui.pr-ui #pet-strip > :first-child { margin-inline-start: auto; }
  #ui.pr-ui #pet-strip > :last-child { margin-inline-end: auto; }
  #ui.pr-ui .pr-pet-strip { gap: 5px; }
  /* Thẻ mục tiêu: bỏ dòng nhãn, đưa số đếm xuống cạnh vạch tiến độ. */
  #ui.pr-ui #bottom-dock > #ob-next-goal { min-height: 46px; padding-block: 5px; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-top { display: contents; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-kicker { display: none; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-text { grid-area: 1 / 1 / 2 / 3; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-bar { grid-area: 2 / 1; }
  #ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-num { grid-area: 2 / 2; }
}

/* ---------- 14. (Chiều cao trang trên iPhone khi mở từ màn hình chính: đặt trong game.html, vì kiểu nội tuyến ở đó đứng sau tệp này) ---------- */

/* ---------- 15. Điện thoại ngang: thanh dưới dùng hết bề ngang (trước bị chặn ở 700px nên máy rộng hở một khoảng bên phải) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  #ui.pr-ui .pr-bottom-dock { max-width: min(880px, calc(100% - 54px)); }
}

/* ---------- 16. Đang mở "Thao tác": thẻ pet đang chọn bung rộng nên nút lọc (dính mép trái) tạm ẩn để không đè lên thẻ. Tên pet không bị cắt vì dòng mô tả bên cạnh ---------- */
#ui.pr-ui .pr-bottom-dock.is-more #pet-strip .pr-rar-filter { display: none; }
#ui.pr-ui .pr-sel-name { flex: 0 0 auto; max-width: 62%; }

/* ---------- 17. Điện thoại ngang: hai cột của thanh dưới khít nhau ----------
   Cột trái: thẻ mục tiêu nằm sát ngay trên dải pet. Cột phải: khay trứng (nếu có) rồi bảng hành động.
   Hàng giữa co giãn (1fr) nên dù bảng hành động cao hơn dải pet, thẻ mục tiêu vẫn không bị đẩy rời khỏi dải pet. */
@media (max-height: 500px) and (orientation: landscape) {
  #ui.pr-ui .pr-bottom-dock { grid-template-rows: auto 1fr auto; }
  #ui.pr-ui .pr-bottom-dock > .pr-egg-tray { grid-area: 1 / 2; }
  #ui.pr-ui .pr-bottom-dock > :is(.pr-quest-hint, #ob-next-goal) { grid-area: 2 / 1; align-self: end; }
  #ui.pr-ui .pr-bottom-dock .pr-pet-strip { grid-area: 3 / 1; }
  #ui.pr-ui .pr-bottom-dock > .pr-action-bar { grid-area: 2 / 2 / 4 / 3; align-self: end; }
}

/* Màn ngang đang mở "Thao tác": thẻ pet bung gần hết chiều cao nên thẻ mục tiêu tạm ẩn, không để hai thẻ đè lên nhau. */
@media (max-height: 500px) and (orientation: landscape) {
  #ui.pr-ui .pr-bottom-dock.is-more > :is(.pr-quest-hint, #ob-next-goal) { display: none; }
}

/* ---------- 18. Cài đặt: mục "Máy quay và hình ảnh" ---------- */
.pr-view-card { display: flex; flex-direction: column; gap: 9px; }
.pr-view-quality { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 6px; }
.pr-view-quality .pr-btn { min-height: 40px; padding: 4px 6px; font-size: 12.5px; white-space: nowrap; }
/* Không dùng filter đổi màu hay opacity ở đây: Safari trên iPhone vẽ nút dùng border-image kèm filter thu nhỏ còn 1/3. */
.pr-view-quality .pr-btn[aria-pressed="false"] { border-image: none; background: rgba(122, 84, 38, 0.14); color: #6b4423; text-shadow: none; filter: none; border-radius: 12px; }
.pr-view-quality .pr-btn[aria-pressed="false"]:hover:not(:disabled), .pr-view-quality .pr-btn[aria-pressed="false"]:active:not(:disabled) { filter: none; background: rgba(122, 84, 38, 0.24); }
.pr-view-quality .pr-btn[aria-pressed="true"] { box-shadow: 0 0 0 3px #ffd45a; }
.pr-view-status { margin: 0; font-size: 12.5px; line-height: 1.35; }
.pr-view-check { display: flex; align-items: center; gap: 9px; min-height: 36px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.pr-view-check input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: #2f9bff; }
.pr-view-card > #btn-view-reset { align-self: flex-start; }
/* Đang kéo thanh độ phóng: bảng Cài đặt tạm trong suốt, chỉ còn thanh trượt, để thấy ngay đảo gần hay xa. */
.pr-modal-backdrop.pr-view-peek { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.pr-modal-backdrop.pr-view-peek * { visibility: hidden; }
.pr-modal-backdrop.pr-view-peek label[for="view-dist"], .pr-modal-backdrop.pr-view-peek label[for="view-dist"] * { visibility: visible; }
.pr-modal-backdrop.pr-view-peek label[for="view-dist"] { background: rgba(255, 246, 216, 0.95); border-radius: 12px; box-shadow: 0 0 0 9px rgba(255, 246, 216, 0.95), 0 5px 16px 9px rgba(42, 22, 8, 0.35); }

/* ---------- 19. Giao diện không viền (b15) ----------
   Ảnh khung gỗ 9-slice (card, slot, slot-selected, slot-locked, chip, bar-track, panel-inner) đã đổi sang bản phẳng trong assets/ui/flat/
   nên mọi bảng, thẻ trong game không còn viền. Riêng phần nổi trên cảnh 3D (thanh trên, thẻ đảo, mục tiêu, bảng hành động, ô pet)
   bỏ luôn nền thẻ: chữ trắng có bóng, nền kính mờ, phía sau là một dải tối nhẹ ở mép trên và mép dưới màn để chữ luôn đọc được. */
#ui.pr-ui { --hud-ink: #fffdf5; --hud-shadow: 0 1px 2px rgba(8, 6, 16, 0.9), 0 0 6px rgba(8, 6, 16, 0.55); --hud-glass: rgba(14, 16, 32, 0.46); }
#ui.pr-ui::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity 0.25s ease;
  background:
    linear-gradient(to bottom, rgba(10, 9, 22, 0.44), rgba(10, 9, 22, 0) 120px),
    linear-gradient(to top, rgba(10, 9, 22, 0.7), rgba(10, 9, 22, 0.42) 150px, rgba(10, 9, 22, 0) 260px);
}
#ui.pr-ui.is-peek::before { opacity: 0; }
@media (max-height: 500px) and (orientation: landscape) {
  #ui.pr-ui::before {
    background:
      linear-gradient(to bottom, rgba(10, 9, 22, 0.4), rgba(10, 9, 22, 0) 70px),
      linear-gradient(to top, rgba(10, 9, 22, 0.66), rgba(10, 9, 22, 0.36) 90px, rgba(10, 9, 22, 0) 160px);
  }
}

/* Thanh trên: bỏ thẻ nền, các nhãn chỉ số thành viên kính mờ */
#ui.pr-ui #top-bar.pr-top-bar { background: none; border-image: none; filter: none; padding-inline: 0; }
#ui.pr-ui #top-bar .pr-pill { border-image: none; background: var(--hud-glass); text-shadow: var(--hud-shadow); }
#ui.pr-ui #top-bar .pr-xp-track { border-image: none; background: rgba(255, 255, 255, 0.24); border-radius: 99px; }

/* Thẻ đảo: đảo đang đứng vẫn là nút xanh, các đảo khác là viên kính mờ */
#ui.pr-ui .pr-island-chip:not(.is-active) { border-image: none; background: var(--hud-glass); color: var(--hud-ink); text-shadow: var(--hud-shadow); filter: none; border-radius: 999px; }
#ui.pr-ui .pr-island-chip:not(.is-active) .pr-isl-meta { color: #ffe17d; }

/* Thẻ mục tiêu */
#ui.pr-ui #quest-hint.pr-quest-hint { border-image: none; background: var(--hud-glass); filter: none; box-shadow: none; border-radius: 14px; }
#ui.pr-ui #quest-hint .pr-quest-hint-title { color: var(--hud-ink); text-shadow: var(--hud-shadow); }
#ui.pr-ui #quest-hint .pr-quest-hint-prog { color: #a8dcff; text-shadow: var(--hud-shadow); }
#ui.pr-ui #quest-hint-bar { border-image: none; background: rgba(255, 255, 255, 0.22); border-radius: 99px; }

/* Bảng hành động: không còn thẻ nền, tên pet và số đo nổi thẳng trên cảnh */
#ui.pr-ui #action-bar.pr-action-bar { border-image: none; background: none; filter: none; box-shadow: none; }
#ui.pr-ui #action-bar :is(#sel-name, .pr-stat-num) { color: var(--hud-ink); text-shadow: var(--hud-shadow); }
#ui.pr-ui #action-bar #sel-hint { color: #ffe9b8; text-shadow: var(--hud-shadow); }

/* Ô pet: chỉ còn ảnh chân dung; ô đang chọn nhấc lên và có quầng vàng thay cho khung xanh */
#ui.pr-ui #pet-strip .pr-pet-card:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) { border-image: none; background: none; filter: none; box-shadow: none; border-radius: 15px; transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease; }
#ui.pr-ui #pet-strip .pr-pet-card:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) .pr-pet-avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; }
#ui.pr-ui #pet-strip .pr-pet-card.is-selected:not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) { background: #ffd45a; box-shadow: 0 0 12px 2px rgba(255, 212, 90, 0.65); transform: translateY(-3px); }
#ui.pr-ui #pet-strip .pr-pet-card:is(:has(.pr-rar-tag[style*="--rar-0"]), .is-rar-0, [data-rar="0"]):not(.pr-bottom-dock.is-more .pr-pet-card.is-selected) .pr-pet-avatar::after { background-image: none; }
/* Đang mở "Thao tác": thanh dưới cao gần nửa màn nên dải tối phía sau cũng cao theo */
#ui.pr-ui:has(.pr-bottom-dock.is-more)::before {
  background:
    linear-gradient(to bottom, rgba(10, 9, 22, 0.44), rgba(10, 9, 22, 0) 120px),
    linear-gradient(to top, rgba(10, 9, 22, 0.72), rgba(10, 9, 22, 0.5) 400px, rgba(10, 9, 22, 0) 540px);
}
@media (max-height: 500px) and (orientation: landscape) {
  #ui.pr-ui:has(.pr-bottom-dock.is-more)::before {
    background:
      linear-gradient(to bottom, rgba(10, 9, 22, 0.4), rgba(10, 9, 22, 0) 70px),
      linear-gradient(to top, rgba(10, 9, 22, 0.7), rgba(10, 9, 22, 0.46) 190px, rgba(10, 9, 22, 0) 280px);
  }
}
/* Thẻ "việc tiếp theo" của người chơi mới: cùng kiểu kính mờ, nút "Đi tới" vẫn là nút nổi */
#ui.pr-ui #bottom-dock > #ob-next-goal { border-image: none; background: rgba(14, 16, 32, 0.56); filter: none; color: var(--hud-ink); text-shadow: var(--hud-shadow); }
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-text { color: var(--hud-ink); }
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-kicker { color: #ffb9c8; }
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-num { color: #a8dcff; }
#ui.pr-ui #bottom-dock > #ob-next-goal .ob-ng-bar { border-image: none; background: rgba(255, 255, 255, 0.22); border-radius: 99px; }

/* Viền vẽ bằng mã quanh nhãn, thẻ, ảnh: cho trong suốt (giữ nguyên kích thước). Giữ lại: ô nhập, thanh trượt, vòng chỉ dẫn, chấm báo, viền khi dùng bàn phím. */
:is(.pr-wild-tag, .pr-rar-tag, .pr-el-badge, .pr-trait-pill, .pr-reward-tag, .pr-deliver-warn, .pr-rank-list strong, .pr-sound-row output, .ar-isle-art,
    .mg-postcard, .mg-choice-copy small, .mg-arena, .mg-trophy, .mg-rewards span,
    #ob-guide-bubble, .gd-face, .gd-do-it, #gd-celebration, .ob-splash-sub, .ob-story-art, .ob-chapter-art, .ob-msg.is-err, .ob-msg.is-ok, .ob-msg.is-warn),
.pr-rank-list > li::before, .pr-album-stage.is-missing::after { border-color: transparent !important; }
#ob-guide-bubble { box-shadow: 0 6px 18px rgba(24, 14, 6, 0.3) !important; }
.mg-arena { box-shadow: 0 4px 12px rgba(42, 18, 5, 0.36) !important; }
.mg-trophy { box-shadow: 0 6px 14px rgba(56, 22, 6, 0.36) !important; }
.ob-story-art { box-shadow: 0 3px 8px rgba(60, 40, 20, 0.34) !important; }
#ui.pr-ui #action-bar .pr-stat-track { border-image: none; background: rgba(255, 255, 255, 0.22); border-radius: 99px; }
/* Safari trên iPhone không vẽ nền chuyển màu ở núm và rãnh thanh trượt (núm thành vòng rỗng): thêm màu nền đặc bên dưới. */
.pr-sound-row input[type="range"]::-webkit-slider-thumb { background-color: #42c947; }
.pr-sound-row input[type="range"]::-webkit-slider-runnable-track { background-color: #55290f; }

/* ---------- 20. Lực chiến: ô trên thanh trên cùng, hồ sơ chiến đấu, bảng đội hình 8 thú cưng (HTML ở game/power.js) ----------
   Không khung viền: phân lớp bằng nền nhạt và bo góc. Không dùng filter đổi màu + opacity (Safari trên iPhone vẽ sai). */
.pw-ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
#ui.pr-ui #top-bar .pw-pill { -webkit-appearance: none; appearance: none; border: 0; font-family: inherit; cursor: pointer; gap: 3px; -webkit-tap-highlight-color: transparent; }
#ui.pr-ui #top-bar .pw-pill-ico { display: inline-flex; }
#ui.pr-ui #top-bar .pw-pill #val-power { color: #ffe08a; font-weight: 900; }
#ui.pr-ui .pw-delta { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 0); opacity: 0; pointer-events: none; white-space: nowrap; font-weight: 900; font-size: 0.95em; color: #a8ff8f; text-shadow: var(--hud-shadow, 0 1px 2px rgba(0, 0, 0, 0.6)); }
#ui.pr-ui .pw-pill.is-up { animation: pw-pop 0.5s ease-out; }
#ui.pr-ui .pw-pill.is-up .pw-delta { animation: pw-rise 1.4s ease-out forwards; }
@keyframes pw-pop { 0% { transform: scale(1); } 35% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes pw-rise { 0% { opacity: 0; transform: translate(-50%, -4px); } 15% { opacity: 1; } 70% { opacity: 1; transform: translate(-50%, 5px); } 100% { opacity: 0; transform: translate(-50%, 11px); } }
#ui.pr-ui .pw-chip { -webkit-appearance: none; appearance: none; border: 0; font: inherit; font-weight: 900; color: inherit; cursor: pointer; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px 1px 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); white-space: nowrap; }
#ui.pr-ui .pw-chip b { color: #ffe08a; }

#ui.pr-ui .pw-strip { -webkit-appearance: none; appearance: none; border: 0; font: inherit; color: #fff; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 7px; margin: 8px 0; padding: 8px 12px; border-radius: 14px; text-align: left; background-color: #6b3212; background-image: linear-gradient(120deg, #4a210b, #9a4a17); }
#ui.pr-ui .pw-strip .pw-ico { width: 22px; height: 22px; }
#ui.pr-ui .pw-strip b { font-size: 18px; font-weight: 900; color: #ffe08a; font-variant-numeric: tabular-nums; }
#ui.pr-ui .pw-strip span { flex: 1 1 auto; min-width: 0; font-size: 12px; opacity: 0.92; }
#ui.pr-ui .pw-strip em { font-style: normal; font-size: 12px; font-weight: 900; white-space: nowrap; }

#ui.pr-ui .pw-sheet { color: var(--ui-ink); }
#ui.pr-ui .pw-sheet .is-up { color: #1f8a2e; }
#ui.pr-ui .pw-sheet .is-down { color: #c0392b; }
#ui.pr-ui .pw-head { display: flex; align-items: center; gap: 10px; }
#ui.pr-ui .pw-sheet .pr-pet-avatar { position: relative; flex: none; width: 46px; height: 46px; }
#ui.pr-ui .pw-sheet .pw-face { width: 58px; height: 58px; }
#ui.pr-ui .pw-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#ui.pr-ui .pw-who strong { font-size: 17px; font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
#ui.pr-ui .pw-who > span { font-size: 12px; color: var(--ui-ink-soft); }
#ui.pr-ui .pw-els { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
#ui.pr-ui .pw-power { flex: none; display: flex; flex-direction: column; align-items: center; padding: 7px 11px 6px; border-radius: 14px; color: #fff; background-color: #6b3212; background-image: linear-gradient(160deg, #4a210b, #9a4a17); }
#ui.pr-ui .pw-power .pw-ico { width: 20px; height: 20px; }
#ui.pr-ui .pw-power b { font-size: 22px; line-height: 1.05; font-weight: 900; color: #ffe08a; font-variant-numeric: tabular-nums; }
#ui.pr-ui .pw-power span { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.88; }
#ui.pr-ui .pw-variant { margin-top: 10px; padding: 8px 12px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px; background-color: #ffe9a8; background-image: linear-gradient(90deg, #ffe9a8, #ffd3e6 55%, #d3e8ff); }
#ui.pr-ui .pw-variant b { font-weight: 900; color: #8a2a6b; }
#ui.pr-ui .pw-variant span { font-size: 12px; line-height: 1.35; }
#ui.pr-ui .pw-grade { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
#ui.pr-ui .pw-grade > div { display: flex; flex-direction: column; min-width: 0; }
#ui.pr-ui .pw-grade strong { font-size: 14px; font-weight: 900; }
#ui.pr-ui .pw-grade span { font-size: 12px; line-height: 1.35; color: var(--ui-ink-soft); }
#ui.pr-ui .pw-grade .pw-grade-badge { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 900; line-height: 1; color: #fff; background: #9a8a70; }
#ui.pr-ui .pw-grade .pw-grade-badge.is-ss { background-color: #e0473f; background-image: linear-gradient(140deg, #ffb13d, #e0473f); box-shadow: 0 0 0 3px rgba(255, 196, 80, 0.55); }
#ui.pr-ui .pw-grade .pw-grade-badge.is-s { background: #f0851c; }
#ui.pr-ui .pw-grade .pw-grade-badge.is-a { background: #9b59d0; }
#ui.pr-ui .pw-grade .pw-grade-badge.is-b { background: #2f8fdd; }
#ui.pr-ui .pw-grade .pw-grade-badge.is-c { background: #3aa655; }

#ui.pr-ui .pw-radar { display: block; width: 100%; max-width: 380px; height: auto; margin: 6px auto 0; overflow: visible; }
#ui.pr-ui .pw-ring { fill: none; stroke: rgba(122, 84, 38, 0.2); stroke-width: 1; }
#ui.pr-ui .pw-axis { stroke: rgba(122, 84, 38, 0.14); stroke-width: 1; }
#ui.pr-ui .pw-lab { font-size: 9.5px; font-weight: 800; fill: var(--ui-ink-soft); }
#ui.pr-ui .pw-lab.is-cong { fill: #c2410c; }
#ui.pr-ui .pw-lab.is-thu { fill: #1d6fb8; }
#ui.pr-ui .pw-lab.is-nhip { fill: #2f8a3a; }
#ui.pr-ui .pw-base { fill: none; stroke: rgba(76, 36, 13, 0.55); stroke-width: 1.2; stroke-dasharray: 4 3; }
#ui.pr-ui .pw-shape { fill: rgba(255, 148, 46, 0.4); stroke: #e06112; stroke-width: 2; stroke-linejoin: round; transform-origin: 150px 118px; animation: pw-grow 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
@keyframes pw-grow { from { transform: scale(0.15); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#ui.pr-ui .pw-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--ui-ink-soft); }
#ui.pr-ui .pw-legend i { display: inline-block; width: 14px; height: 8px; margin-right: 5px; border-radius: 3px; background: #f39a3c; vertical-align: -1px; }
#ui.pr-ui .pw-legend i.is-base { height: 0; border-radius: 0; background: none; border-top: 2px dashed rgba(76, 36, 13, 0.6); vertical-align: 3px; }

#ui.pr-ui .pw-stats { display: grid; gap: 8px; margin-top: 10px; }
#ui.pr-ui .pw-group { border-radius: 14px; padding: 8px 11px 9px; background: rgba(122, 84, 38, 0.09); min-width: 0; }
#ui.pr-ui .pw-group h4 { margin: 0 0 3px; font-size: 12px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
#ui.pr-ui .pw-group.is-cong h4 { color: #c2410c; }
#ui.pr-ui .pw-group.is-thu h4 { color: #1d6fb8; }
#ui.pr-ui .pw-group.is-nhip h4 { color: #2f8a3a; }
#ui.pr-ui .pw-stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 3px 0; }
#ui.pr-ui .pw-stat > span { font-size: 13px; font-weight: 700; }
#ui.pr-ui .pw-stat > b { font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; }
#ui.pr-ui .pw-stat em { font-style: normal; font-size: 10.5px; font-weight: 900; margin-left: 5px; }
#ui.pr-ui .pw-bar { display: block; height: 6px; border-radius: 99px; background: rgba(76, 36, 13, 0.14); overflow: hidden; }
#ui.pr-ui .pw-bar > i { display: block; height: 100%; border-radius: 99px; background: #ff942e; }
#ui.pr-ui .pw-group.is-thu .pw-bar > i { background: #3d9be9; }
#ui.pr-ui .pw-group.is-nhip .pw-bar > i { background: #43b54e; }
#ui.pr-ui .pw-stat small { font-size: 10.5px; color: var(--ui-ink-soft); white-space: nowrap; text-align: right; }

#ui.pr-ui .pw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
#ui.pr-ui .pw-card { border-radius: 14px; padding: 9px 12px 10px; background: rgba(255, 255, 255, 0.55); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#ui.pr-ui .pw-card small { font-size: 10.5px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ui-ink-soft); }
#ui.pr-ui .pw-card strong { font-size: 15px; font-weight: 900; }
#ui.pr-ui .pw-card span { font-size: 12px; line-height: 1.38; }
#ui.pr-ui .pw-card .pw-note { font-size: 11px; color: var(--ui-ink-soft); }
#ui.pr-ui .pw-tip { margin: 10px 0 0; font-size: 12px; line-height: 1.4; text-align: center; color: var(--ui-ink-soft); }
#ui.pr-ui .pw-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
#ui.pr-ui .pw-sheet .pr-btn.pw-btn-soft { border-image: none; background: rgba(122, 84, 38, 0.14); color: #6b4423; text-shadow: none; filter: none; border-radius: 12px; }
#ui.pr-ui .pw-sheet .pr-btn.pw-btn-soft:disabled { filter: none; opacity: 0.8; cursor: default; }

#ui.pr-ui .pw-account { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; color: #fff; background-color: #6b3212; background-image: linear-gradient(150deg, #43200b, #8f4214 70%, #b85c1a); }
#ui.pr-ui .pw-account-main { flex: none; display: flex; align-items: center; gap: 4px; }
#ui.pr-ui .pw-account-main .pw-ico { width: 30px; height: 30px; }
#ui.pr-ui .pw-account-main b { font-size: 30px; line-height: 1; font-weight: 900; color: #ffe08a; font-variant-numeric: tabular-nums; }
#ui.pr-ui .pw-account-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#ui.pr-ui .pw-account-side span { font-size: 11px; line-height: 1.3; opacity: 0.88; }
#ui.pr-ui .pw-account-side strong { font-size: 16px; font-weight: 900; }
#ui.pr-ui .pw-rank-bar { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.24); overflow: hidden; }
#ui.pr-ui .pw-rank-bar > i { display: block; height: 100%; border-radius: 99px; background: #ffd45a; }
#ui.pr-ui .pw-account-side small { font-size: 11px; opacity: 0.94; }
#ui.pr-ui .pw-account-side small b { color: #ffe08a; }
#ui.pr-ui .pw-cover { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 10px; }
#ui.pr-ui .pw-cover > span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border-radius: 99px; font-size: 11px; font-weight: 800; background: rgba(122, 84, 38, 0.08); opacity: 0.45; }
#ui.pr-ui .pw-cover > span.is-on { opacity: 1; background: rgba(255, 255, 255, 0.62); }
#ui.pr-ui .pw-cover :is(img, svg, .pr-art) { width: 16px; height: 16px; }

#ui.pr-ui .pw-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
#ui.pr-ui :is(.pw-slot, .pw-bench-pet) { -webkit-appearance: none; appearance: none; border: 0; font: inherit; color: inherit; cursor: pointer; position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.58); transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s; -webkit-tap-highlight-color: transparent; }
#ui.pr-ui .pw-slot > i { position: absolute; left: 7px; top: 4px; font-style: normal; font-size: 10px; font-weight: 900; color: var(--ui-ink-soft); opacity: 0.7; }
#ui.pr-ui :is(.pw-slot, .pw-bench-pet) strong { max-width: 100%; font-size: 11.5px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ui.pr-ui :is(.pw-slot, .pw-bench-pet) small { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; color: #a8480a; font-variant-numeric: tabular-nums; }
#ui.pr-ui .pw-slot.is-empty { min-height: 94px; justify-content: center; background: rgba(122, 84, 38, 0.08); color: var(--ui-ink-soft); }
#ui.pr-ui .pw-slot.is-empty small { color: inherit; }
#ui.pr-ui .pw-plus { font-size: 22px; line-height: 1; opacity: 0.5; }
#ui.pr-ui .pw-slot.is-pick { background: #fff3c4; box-shadow: 0 0 0 3px #ffb13d, 0 6px 14px rgba(120, 60, 10, 0.25); transform: translateY(-2px); }
#ui.pr-ui :is(.pw-slot, .pw-bench-pet):disabled { cursor: default; opacity: 0.75; }
#ui.pr-ui :is(.pw-slot, .pw-bench-pet):active:not(:disabled) { transform: scale(0.96); }
#ui.pr-ui .pw-sub { margin: 14px 0 6px; font-size: 13px; font-weight: 900; }
#ui.pr-ui .pw-bench { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
#ui.pr-ui .pw-bench-pet { background: rgba(122, 84, 38, 0.09); }
@media (min-width: 700px) {
  #ui.pr-ui .pw-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #ui.pr-ui .pw-slots { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  #ui.pr-ui .pw-pill.is-up, #ui.pr-ui .pw-shape { animation: none; }
  #ui.pr-ui .pw-pill.is-up .pw-delta { animation: none; opacity: 1; }
}
#ui.pr-ui #sel-summary #sel-hint { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 21. Thanh chọn đảo dễ thấy hơn: mỗi ô nhuộm màu hệ của đảo (trước đây kính tối trên nền trời tối nên chìm hẳn),
   ô đang chọn luôn được cuộn vào giữa, mép thanh mờ dần ở phía còn ô chưa thấy ---------- */
#ui.pr-ui .pr-island-chip:not(.is-active) {
  background: rgba(46, 54, 104, 0.9);
  background: linear-gradient(180deg, color-mix(in srgb, var(--el-color, #7f8cff) 60%, #222850), color-mix(in srgb, var(--el-color, #7f8cff) 38%, #171c3a));
  box-shadow: 0 2px 8px rgba(6, 8, 20, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff; font-weight: 900;
}
#ui.pr-ui .pr-island-chip:not(.is-active) .pr-isl-meta { color: #ffe98f; }
#ui.pr-ui .pr-island-chip.is-locked:not(.is-active) { background: rgba(24, 27, 52, 0.86); box-shadow: 0 2px 6px rgba(6, 8, 20, 0.35); color: #d9dcf2; }
#ui.pr-ui .pr-island-chip.is-locked:not(.is-active) .pr-isl-meta { color: #ffd45a; }
#ui.pr-ui .pr-island-bar { scroll-behavior: smooth; scroll-padding-inline: 16px; }
@media (min-width: 1180px) { #ui.pr-ui .pr-island-bar { align-self: flex-start; width: max-content; max-width: 680px; } }   /* màn rộng: đủ chỗ cho cả sáu đảo, không phải cuộn */
#ui.pr-ui .pr-island-bar.can-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
#ui.pr-ui .pr-island-bar.can-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px); mask-image: linear-gradient(90deg, transparent, #000 34px); }
#ui.pr-ui .pr-island-bar.can-left.can-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, transparent, #000 34px, #000 calc(100% - 34px), transparent); }

/* ---------- 22. Hàng xóm (thẻ trong Bến giao lưu) và ô chat chung. Không khung viền, phân lớp bằng nền nhạt ---------- */
#ui.pr-ui .pr-social-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 699px) { #ui.pr-ui .pr-social-tabs .pr-btn { padding-inline: 6px; font-size: 12px; white-space: nowrap; } #ui.pr-ui .pr-social-tabs .pr-btn .pr-ico { display: none; } }
@media (min-width: 700px) { #ui.pr-ui .pr-social-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
#ui.pr-ui .nb-title { margin: 12px 0 6px; font-size: 13px; font-weight: 900; color: var(--ui-ink); }
#ui.pr-ui .nb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 7px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); color: var(--ui-ink); }
#ui.pr-ui .nb-who { flex: 1 1 150px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 12px; }
#ui.pr-ui .nb-who strong { flex: 1 1 100%; font-size: 15px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ui.pr-ui .nb-who span { color: var(--ui-ink-soft); }
#ui.pr-ui .nb-power { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; color: #a8480a !important; font-variant-numeric: tabular-nums; }
#ui.pr-ui .nb-who em { font-style: normal; font-size: 11px; color: var(--ui-ink-soft); }
#ui.pr-ui .nb-row.is-online .nb-who em { color: #1f8a2e; font-weight: 900; }
#ui.pr-ui .nb-row.is-online .nb-who em::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #2fbf4a; }
#ui.pr-ui .nb-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
#ui.pr-ui .nb-acts .pr-btn { min-height: 36px; padding: 5px 12px; font-size: 12.5px; }
#ui.pr-ui .pr-btn.nb-soft { border-image: none; background: rgba(122, 84, 38, 0.14); color: #6b4423; text-shadow: none; filter: none; border-radius: 12px; }
#ui.pr-ui .pr-btn.nb-soft:disabled { filter: none; opacity: 0.7; }

#ui.pr-ui .ch-sheet { color: var(--ui-ink); }
#ui.pr-ui .ch-form { display: flex; gap: 8px; align-items: center; }
#ui.pr-ui .ch-form .pr-input { flex: 1 1 auto; min-width: 0; font-size: 16px; }   /* 16px: Safari trên iPhone không tự phóng to trang khi chạm ô nhập */
#ui.pr-ui .ch-form .pr-btn { flex: none; min-height: 40px; }
#ui.pr-ui .ch-rule { margin: 6px 2px 0; font-size: 11px; line-height: 1.35; color: var(--ui-ink-soft); }
#ui.pr-ui .ch-status { margin: 4px 2px 0; min-height: 0; font-size: 12px; font-weight: 800; color: #b3261e; }
#ui.pr-ui .ch-status:empty { display: none; }
#ui.pr-ui .ch-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
#ui.pr-ui .ch-empty { margin: 14px 0; text-align: center; font-size: 13px; color: var(--ui-ink-soft); }
#ui.pr-ui .ch-msg { padding: 7px 11px 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); }
#ui.pr-ui .ch-msg.is-me { background: rgba(255, 196, 92, 0.42); }
#ui.pr-ui .ch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#ui.pr-ui .ch-name { -webkit-appearance: none; appearance: none; border: 0; padding: 0; background: none; font: inherit; font-size: 13px; font-weight: 900; color: #1d6fb8; cursor: pointer; position: relative; max-width: 70%; min-width: 0 !important; min-height: 0 !important; width: auto; line-height: 1.3; text-align: left; box-shadow: none; text-shadow: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ui.pr-ui .ch-name::after { content: ""; position: absolute; inset: -9px -10px -12px; }   /* vùng chạm rộng hơn chữ, không làm dòng cao lên */
#ui.pr-ui .ch-msg.is-me .ch-name { color: #a8480a; cursor: default; }
#ui.pr-ui .ch-head time { flex: none; font-size: 10.5px; color: var(--ui-ink-soft); }
#ui.pr-ui .ch-msg p { margin: 2px 0 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
#ui.pr-ui .ch-menu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
#ui.pr-ui .ch-menu .pr-btn { min-height: 34px; padding: 4px 11px; font-size: 12px; }
