/* Dọn màn hình chính (14/11/2026) — nạp SAU CÙNG (sau app-*.css, banner.css, owner-avatar.css…).
   Nguyên tắc: không đổi vị trí, thứ tự hay chức năng nút nào; chỉ thống nhất kiểu, căn lề, sửa chỗ đè nhau.
   1) Một kiểu nút kem chung (viền mảnh màu nâu + gờ 3px cùng tông) cho cột trái, cột phải, nhiệm vụ.
   2) HUD: tiền/coupon cùng kiểu với nút menu; 6 chỉ số gộp thành MỘT dải có vạch chia; cảnh báo đỏ dịu hơn nhưng vẫn rõ.
   3) Số tiền nổi (+67.000đ) thành nhãn nhỏ ở góc ví, không còn đè dòng chỉ số; chỉ hiện nhãn mới nhất.
   4) Nút UR LIMITED co theo chữ, không tràn mép phải. 5) Lề trái/phải cùng 8px. */

:root {
  --td-cream-hi: #fffaf0; --td-cream-lo: #ffe7b8; --td-cream-bd: #cfa862; --td-cream-lip: #a87d3c;
  --td-edge: 8px; --td-chip-h: 34px; --td-gap: 6px; --td-r: 11px;
}

/* ---------------------------------------------------------------- 1. nút kem chung */
#floor-nav .floor-toggle, #shop-hub, #temple-hub, #quest-tracker {
  background: linear-gradient(var(--td-cream-hi), var(--td-cream-lo));
  border: 1.5px solid var(--td-cream-bd);
  border-radius: var(--td-r);
  box-shadow: 0 3px 0 var(--td-cream-lip), inset 0 1px 0 #fff;
  color: var(--ink);
}
#floor-nav .floor-toggle, #shop-hub, #temple-hub { gap: 6px; justify-content: flex-start; letter-spacing: 0; }
/* cùng bề rộng + chiều cao (dọc và PC); điện thoại xoay ngang giữ cỡ gọn của bố cục ngang */
@media (orientation: portrait), (min-height: 521px) {
  #floor-nav .floor-toggle, #shop-hub, #temple-hub {
    min-width: 100px; height: var(--td-chip-h); min-height: var(--td-chip-h); padding: 0 10px 0 8px; font: 700 12.5px var(--font);
  }
}
#floor-nav .floor-toggle:active, #shop-hub:active, #temple-hub:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--td-cream-lip), inset 0 1px 0 #fff; }
#shop-hub .hub-ic, #temple-hub .hub-ic { width: 18px; height: 18px; flex: 0 0 auto; }
/* tầng: thêm biểu tượng cầu thang cho đồng bộ với Chủ đề / Chùa; mũi tên dồn sang phải */
#floor-nav .floor-toggle::before {
  content: ''; width: 18px; height: 18px; flex: 0 0 auto; image-rendering: pixelated;
  background: no-repeat center / 18px 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath fill='%232b1740' d='M2 0h8v1h1v10h-1v1H2v-1H1V1h1z'/%3E%3Cpath fill='%23f6dcb0' d='M2 1h8v10H2z'/%3E%3Cpath fill='%23fff3c4' d='M2 1h8v1H2z'/%3E%3Cpath fill='%23c0392b' d='M5 2h2v1h1v1H4V3h1zM4 8h4v1H7v1H5V9H4z'/%3E%3Cpath fill='%23a07a4a' d='M3 6h6v1H3z'/%3E%3C/svg%3E");
}
#floor-nav .floor-toggle > :last-child { margin-left: auto; }
/* vùng chạm cao hơn phần vẽ (≥ 40px) mà không đổi khoảng cách */
#shop-hub::after, #temple-hub::after, #floor-nav .floor-toggle::after { content: ''; position: absolute; inset: -3px -2px; }
#floor-nav .floor-toggle { position: relative; }

/* danh sách tầng khi mở: cùng kiểu kem */
#floor-nav .floor-list { border: 1.5px solid var(--td-cream-bd); border-radius: 13px; background: #fff8ea; box-shadow: 0 3px 0 var(--td-cream-lip), 0 10px 20px rgba(20, 10, 30, .28); }
#floor-nav .floor-list button { border: 1.5px solid #e6cc96; border-radius: 10px; background: linear-gradient(var(--td-cream-hi), #fff1d6); box-shadow: 0 2px 0 #d9b77a; }
#floor-nav .floor-list button.on { background: linear-gradient(#ffe066, #ffbf1a); border-color: #cf9800; box-shadow: 0 2px 0 #a87800, inset 0 1px 0 #fff6c2; }

#quest-tracker { border-width: 1.5px; }
#quest-tracker:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--td-cream-lip), inset 0 1px 0 #fff; }

/* ---------------------------------------------------------------- 2. HUD */
#hud-money {
  border: 1.5px solid #c99a3a; border-radius: var(--td-r);
  box-shadow: 0 3px 0 #a87d3c, inset 0 1px 0 #fff;
}
#hud-coupon {
  border: 1.5px solid #3aa894; border-radius: var(--td-r);
  box-shadow: 0 3px 0 #237a6a, inset 0 1px 0 #fff;
}
#btn-menu { border-radius: var(--td-r); box-shadow: 0 3px 0 #8a6a2e, inset 0 1px 0 #fff; }

/* sự kiện: cùng ngôn ngữ viền mảnh + gờ, tím giữ nguyên để dễ nhận */
#hud-events .ev {
  border: 1.5px solid #2f1d8a; border-radius: var(--td-r);
  box-shadow: 0 3px 0 #2f1d8a, inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* ---------------------------------------------------------------- 3. tiền nổi: nhãn nhỏ ở góc ví */
.money-delta {
  left: var(--td-md-x, 50%) !important; top: var(--td-md-y, 4px) !important;
  transform: translateX(-50%) !important; z-index: 18 !important;
}
.money-delta.td-old { display: none !important; }
.money-delta.td-tight .money-delta-number { font-size: 11px !important; padding: 0 5px; }
.money-delta-number {
  font: 800 12.5px/18px var(--font) !important; letter-spacing: 0;
  padding: 0 7px; border-radius: 9px; -webkit-text-stroke: 0; text-shadow: none;
  background: #1f6a35; color: #d6ffb0; border: 1.5px solid #0f3a1c; box-shadow: 0 2px 0 #0f3a1c;
}
.money-delta.neg .money-delta-number { background: #7a2620; color: #ffd6cc; border-color: #42110d; box-shadow: 0 2px 0 #42110d; }

/* ---------------------------------------------------------------- 4. UR LIMITED co theo chữ */
.bn-hud .bn-btn { width: auto; min-width: 140px; max-width: calc(100vw - 128px); padding-right: 10px; }
.bn-hud .bn-sub { overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- 4b. điện thoại xoay ngang
   nút sự kiện + UR LIMITED đứng dưới cột Tầng/Chủ đề/Chùa: bố cục cũ chỉ chừa chỗ cho Chủ đề nên bị Chùa che */
body:not(.portrait):has(#temple-hub:not([hidden])) { --lc3: 80px; }

/* ---------------------------------------------------------------- 5. điện thoại dọc */
body.portrait {
  --float-edge: calc(var(--td-edge) + env(safe-area-inset-right));
}
body.portrait #floor-nav, body.portrait #shop-hub, body.portrait #temple-hub { left: calc(var(--td-edge) + env(safe-area-inset-left)); }
body.portrait #shop-hub { top: calc(var(--top-h) + 4px + var(--hub-off, 0px)); }
body.portrait #temple-hub { top: calc(var(--top-h) + 4px + var(--td-chip-h) + var(--td-gap) + var(--hub-off, 0px)); }
body.portrait #floor-nav { top: calc(var(--top-h) + 4px); }
body.portrait:has(#floor-nav:not([hidden])) { --hub-off: calc(var(--td-chip-h) + var(--td-gap)); }
body.portrait #quest-tracker { left: calc(var(--td-edge) + env(safe-area-inset-left)); max-width: calc(100vw - 2 * var(--td-edge) - var(--float-size) - 12px); }

/* dòng chỉ số: một dải duy nhất, vạch chia mảnh, chia đều chỗ trống */
body.portrait .hud-stats {
  gap: 0; padding: 0; border-radius: var(--td-r); overflow: hidden;
  background: rgba(12, 6, 20, .34); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .06);
}
body.portrait .hud-stats > .hud-stat, body.portrait #hud-status > .st {
  flex: 1 1 auto; min-width: 0; justify-content: center; position: relative;
  background: transparent; border-radius: 0; padding: 0 4px; height: 34px;
}
body.portrait #hud-status { gap: 0; flex: 3 1 auto; }
body.portrait .hud-stats > .hud-stat + .hud-stat::before, body.portrait #hud-status > .st::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; background: rgba(255, 255, 255, .13);
}
body.portrait #hud-status > .st.bad {
  background: linear-gradient(rgba(229, 57, 53, .42), rgba(229, 57, 53, .26)); color: #fff;
  box-shadow: inset 0 -3px 0 #ff5a4d;
}
body.portrait #hud-status > .st.bad::before { background: rgba(0, 0, 0, .35); top: 6px; bottom: 6px; }
body.portrait #hud-status > .st.bad:first-child::before { opacity: 0; }

/* dòng tên quán + cấp: thanh EXP dài hơn, số nhỏ gọn */
body.portrait #hud-stage { gap: 8px; }
body.portrait #hud-stage .hs-prog { flex: 1 1 auto; min-width: 0; }
body.portrait #hud-stage .hs-xp { flex: 1 1 auto; height: 7px; border: 0; border-radius: 4px; background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
body.portrait #hud-stage .hs-xp > i { background: linear-gradient(#ffe066, #f0a020); border-radius: 4px; }
body.portrait #hud-stage .hs-num { flex: 0 0 auto; font-size: 10px; opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  #floor-nav .floor-toggle:active, #shop-hub:active, #temple-hub:active, #quest-tracker:active { transform: none; }
}
