/* ============================================================================
 * TKC ANCIENT LACQUER, DARK JADE & BRONZE-GOLD UI SYSTEM (v24.3 — 0 KB PNGs)
 * Dùng chung cho: /tang-kinh-cac/25d & /tang-kinh-cac/3d trên Đa Trạm Nhân Bản
 * - Tự host font .woff2 chia dải Unicode Tiếng Việt + Latin (Be Vietnam Pro & Noto Serif)
 * - Bảng màu Đa Trạm:
 *   + Mặc định (TruyệnHub / Tiên Hiệp): Sơn Mài Mun × Ngọc Bích Trầm × Vàng Đồng Cổ
 *   + Minh Nguyệt Lâu ([data-tenant="minh-nguyet-lau"]): Lam Đêm × Bạc Trăng × Vàng Đèn Lồng
 * - Khung 3 lớp viền mạ vàng đồng bằng box-shadow + chỉ chìm ::before (0 KB ảnh viền)
 * - Co giãn đồng nhất --tkc-ui-scale, Contextual Combat HUD & Cảnh báo điện ảnh clip-path
 * ============================================================================ */

/* ── 1. Tự Host Font .woff2 Nội Bộ (0ms chặn mạng ngoài, chạy mượt cả Offline) ── */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('Be Vietnam Pro Medium'), local('BeVietnamPro-Medium'),
       url('/fonts/be-vietnam-pro-500-vn.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('Be Vietnam Pro Medium'), local('BeVietnamPro-Medium'),
       url('/fonts/be-vietnam-pro-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: local('Be Vietnam Pro Bold'), local('BeVietnamPro-Bold'),
       url('/fonts/be-vietnam-pro-700-vn.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: local('Be Vietnam Pro Bold'), local('BeVietnamPro-Bold'),
       url('/fonts/be-vietnam-pro-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: local('Noto Serif'), local('NotoSerif'),
       url('/fonts/noto-serif-var-vn.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: local('Noto Serif'), local('NotoSerif'),
       url('/fonts/noto-serif-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Alias tương thích cho các thẻ tiêu đề 'Lora' trên Sảnh 3D dùng chung bộ đệm Noto Serif .woff2 0 KB tải thêm */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: local('Lora'), local('Noto Serif'),
       url('/fonts/noto-serif-var-vn.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: local('Lora'), local('Noto Serif'),
       url('/fonts/noto-serif-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 2. Hệ Biến Màu Cổ Phong Đa Trạm (Sơn Mài Ngọc Bích vs Lam Đêm Minh Nguyệt) ── */
:root {
  --tkc-ui-scale: 1;
  --tkc-font-sans: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --tkc-font-serif: 'Noto Serif', Georgia, serif;

  /* Trạm #1 TruyệnHub: Sơn Mài Mun × Ngọc Bích Trầm × Vàng Đồng Cổ */
  --tkc-shell-bg: radial-gradient(circle at 50% 28%, #173d34 0%, #091c18 56%, #040d0b 100%);
  --tkc-lacquer-bg: radial-gradient(ellipse at 50% 0%, rgba(23, 61, 52, 0.96) 0%, rgba(11, 27, 23, 0.97) 58%, rgba(5, 14, 12, 0.99) 100%);
  --tkc-panel-bg: linear-gradient(180deg, rgba(19, 43, 37, 0.95) 0%, rgba(9, 21, 18, 0.97) 100%);
  --tkc-card-bg: linear-gradient(180deg, rgba(24, 52, 45, 0.86) 0%, rgba(11, 25, 22, 0.93) 100%);
  --tkc-gold-hi: #ffe6a0;
  --tkc-gold: #d9b865;
  --tkc-gold-deep: #6c4f24;
  --tkc-gold-dark: #140f09;
  --tkc-jade: #74e7ca;
  --tkc-jade-deep: #1b5245;
  --tkc-paper: #f0e6d2;
  --tkc-muted: #b9ad95;
  --tkc-crimson: #c93b3b;

  /* Viền khung 3 lớp Sơn Mài Vàng Đồng (0 KB ảnh viền!) */
  --tkc-frame-shadow:
    0 0 0 1px var(--tkc-gold-deep),
    0 0 0 2px var(--tkc-gold-dark),
    0 0 0 3px rgba(217, 184, 101, 0.78),
    0 14px 34px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 236, 179, 0.22);

  --tkc-pill-shadow:
    0 0 0 1px var(--tkc-gold-deep),
    0 0 0 2px rgba(14, 10, 6, 0.92),
    0 6px 16px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 236, 179, 0.2);
}

/* Trạm #2 Minh Nguyệt Lâu: Lam Đêm Cổ Trang × Bạc Trăng × Vàng Đèn Lồng */
body[data-tenant="minh-nguyet-lau"] {
  --tkc-shell-bg: radial-gradient(circle at 50% 26%, #182b4f 0%, #0B1324 58%, #050913 100%);
  --tkc-lacquer-bg: radial-gradient(ellipse at 50% 0%, rgba(25, 43, 78, 0.96) 0%, rgba(11, 19, 36, 0.98) 60%, rgba(6, 10, 20, 0.99) 100%);
  --tkc-panel-bg: linear-gradient(180deg, rgba(20, 34, 62, 0.95) 0%, rgba(11, 19, 36, 0.98) 100%);
  --tkc-card-bg: linear-gradient(180deg, rgba(26, 42, 74, 0.88) 0%, rgba(13, 22, 42, 0.94) 100%);
  --tkc-gold-hi: #fff2c2;
  --tkc-gold: #F4C86A;
  --tkc-gold-deep: #7a5923;
  --tkc-gold-dark: #080d1a;
  --tkc-jade: #93c5fd;
  --tkc-jade-deep: #1e3a6d;
  --tkc-paper: #E2E8F8;
  --tkc-muted: #9fb0d0;
  --tkc-frame-shadow:
    0 0 0 1px var(--tkc-gold-deep),
    0 0 0 2px var(--tkc-gold-dark),
    0 0 0 3px rgba(244, 200, 106, 0.8),
    0 14px 36px rgba(2, 6, 18, 0.84),
    inset 0 1px 0 rgba(226, 232, 248, 0.24);
}

/* ── 3. Con Trỏ Chuột Mũi Kiếm Vàng Kim SVG Trên Máy Tính (0 KB file .cur) ── */
@media (hover: hover) and (pointer: fine) {
  .w25d-shell,
  .tkc3d-root {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M2 2 L10 21 L13 14 L20 21 L22 19 L15 12 L22 9 Z' fill='%23ffe6a0' stroke='%234a3210' stroke-width='1.5' stroke-linejoin='round'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.4' fill='%2374e7ca'/%3E%3C/svg%3E") 2 2, auto;
  }
  .w25d-shell button,
  .w25d-shell a,
  .tkc3d-root button,
  .tkc3d-root a {
    cursor: pointer;
  }
}

/* ── 4. Áp Khung Sơn Mài 3 Lớp & Chữ Ánh Kim Lên Sân 2.5D & 3D ── */
.w25d-shell {
  background: var(--tkc-shell-bg);
  font-family: var(--tkc-font-sans);
  color: var(--tkc-paper);
}

.w25d-frame {
  box-shadow:
    0 0 0 1px var(--tkc-gold-deep),
    0 0 0 3px rgba(10, 8, 5, 0.95),
    0 24px 70px rgba(0, 0, 0, 0.85);
}

/* Bảng cửa sổ chính dùng 3 lớp viền box-shadow + chỉ chìm ::before */
.w25d-modal-card,
.w25d-live-panel,
.w25d-chat-dock,
.w25d-build-drawer,
.w25d-ftue,
.tkc-lacquer-panel,
.dclub-free-card,
.dclub-gift-card {
  background: var(--tkc-lacquer-bg) !important;
  border: 1px solid rgba(255, 230, 160, 0.28) !important;
  box-shadow: var(--tkc-frame-shadow) !important;
  color: var(--tkc-paper);
}

.w25d-modal-card {
  position: relative;
  border-radius: 16px !important;
}

.w25d-modal-card::before,
.tkc-lacquer-panel::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  border: 1px solid rgba(217, 184, 101, 0.18);
  pointer-events: none;
}

/* Tiêu đề khắc Vàng Kim Cổ Thư (Noto Serif + metallic background-clip) */
.w25d-modal-card > div:first-child > strong:first-child,
.tkc-ancient-title {
  font-family: var(--tkc-font-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--tkc-gold-hi) 0%, var(--tkc-gold) 58%, #9f7531 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

/* Đường cắt kim cương ◆ cổ điển */
.tkc-diamond-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  color: var(--tkc-gold);
  font-size: 9px;
  opacity: 0.82;
}
.tkc-diamond-rule::before,
.tkc-diamond-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 184, 101, 0.55), transparent);
}

/* ── 5. Thẻ Avatar Chủ Nhân Khoét Vòng Cung & Dải Lụa Cảnh Giới ── */
.w25d-profile-pill {
  background: var(--tkc-panel-bg) !important;
  border: 1px solid rgba(217, 184, 101, 0.62) !important;
  box-shadow: var(--tkc-pill-shadow) !important;
  padding: 4px 11px 4px 5px !important;
}

.w25d-crest {
  position: relative;
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #ffe6a0 0%, #b45309 55%, #451a03 100%) !important;
  border: 1.5px solid var(--tkc-gold-hi) !important;
  color: #fffbeb !important;
  font-family: var(--tkc-font-serif);
  box-shadow: 0 0 10px rgba(217, 184, 101, 0.45), inset 0 0 6px rgba(0, 0, 0, 0.5);
}

.w25d-crest::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(116, 231, 202, 0.55);
  -webkit-mask: radial-gradient(circle at 85% 85%, transparent 5px, #000 6px);
  mask: radial-gradient(circle at 85% 85%, transparent 5px, #000 6px);
  pointer-events: none;
}

.w25d-lvl-tag {
  background: linear-gradient(135deg, var(--tkc-jade-deep), #0b241e) !important;
  border: 1px solid rgba(217, 184, 101, 0.58);
  color: var(--tkc-gold-hi) !important;
  padding: 1px 6px !important;
  border-radius: 3px 8px 3px 8px !important;
  letter-spacing: 0.02em;
}

.w25d-xp-bar i {
  background: linear-gradient(90deg, #2dd4bf, var(--tkc-jade), var(--tkc-gold-hi)) !important;
}

.w25d-coin-pill,
.w25d-res-chip,
.w25d-side-btn,
.w25d-sanc-rbtn,
.w25d-pond-btn:not(.is-primary):not(.is-biting),
.w25d-chat-fab {
  background: var(--tkc-panel-bg) !important;
  border: 1px solid rgba(217, 184, 101, 0.52) !important;
  box-shadow: var(--tkc-pill-shadow);
}

/* Thanh Điều Hướng 6 Tab Đáy Sơn Mài Ngọc Bích */
.w25d-bottom {
  background: var(--tkc-panel-bg) !important;
  border: 1px solid rgba(217, 184, 101, 0.5) !important;
  box-shadow: var(--tkc-frame-shadow) !important;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.w25d-tab {
  border-color: rgba(217, 184, 101, 0.16) !important;
  color: var(--tkc-muted) !important;
  transition: transform 0.14s ease, border-color 0.18s ease, background 0.18s ease;
}

.w25d-tab.is-on {
  background: linear-gradient(180deg, var(--tkc-gold-hi) 0%, var(--tkc-gold) 65%, #b78632 100%) !important;
  border-color: #4a310e !important;
  color: #1c1105 !important;
  box-shadow: 0 3px 10px rgba(217, 184, 101, 0.38);
}

/* Bong bóng thoại GPU #w25d-labels nâng cấp chất liệu Giấy Tuyên Viền Vàng */
.w25d-lbl-bubble {
  background: linear-gradient(180deg, rgba(20, 36, 32, 0.94), rgba(9, 18, 16, 0.96)) !important;
  border: 1px solid var(--tkc-gold) !important;
  box-shadow: 0 0 0 1px rgba(10, 8, 5, 0.9), 0 6px 16px rgba(0, 0, 0, 0.65) !important;
  color: var(--tkc-gold-hi) !important;
}

/* ── 6. Nút Quay Clip Highlight .mp4 1 Chạm (#w25d-rec-btn) ── */
.w25d-rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--tkc-panel-bg);
  border: 1px solid rgba(217, 184, 101, 0.6);
  box-shadow: var(--tkc-pill-shadow);
  color: var(--tkc-gold-hi);
  font-family: var(--tkc-font-sans);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.2s ease, border-color 0.2s ease;
}
.w25d-rec-btn:active {
  transform: scale(0.95);
}
.w25d-rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.8);
  flex: none;
}
.w25d-rec-btn.is-recording {
  background: linear-gradient(135deg, #991b1b, #dc2626) !important;
  border-color: var(--tkc-gold-hi) !important;
  color: #ffffff !important;
  animation: tkcRecPulse 1.1s ease-in-out infinite alternate;
}
.w25d-rec-btn.is-recording .w25d-rec-dot {
  background: #fef08a;
  box-shadow: 0 0 8px #fef08a;
}

@keyframes tkcRecPulse {
  from { box-shadow: 0 0 0 1px #450a0a, 0 0 8px rgba(239, 68, 68, 0.55); }
  to   { box-shadow: 0 0 0 1px #fde047, 0 0 18px rgba(239, 68, 68, 0.95); }
}

/* ── 7. Dải Cảnh Báo Điện Ảnh Clip-Path (#w25d-cinematic-alert) ── */
.w25d-cinematic-alert {
  position: absolute;
  top: 52px;
  left: 10px;
  right: 10px;
  z-index: 44;
  padding: 7px 16px;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  background: linear-gradient(90deg, rgba(69, 10, 10, 0.94) 0%, rgba(153, 27, 27, 0.96) 50%, rgba(69, 10, 10, 0.94) 100%);
  border-top: 1.5px solid var(--tkc-gold-hi);
  border-bottom: 1.5px solid var(--tkc-gold);
  color: var(--tkc-gold-hi);
  font-family: var(--tkc-font-serif);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  overflow: hidden;
  animation: tkcAlertEnter 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.w25d-cinematic-alert[hidden] {
  display: none !important;
}
.w25d-cinematic-alert.is-jade {
  background: linear-gradient(90deg, rgba(8, 47, 41, 0.95) 0%, rgba(19, 92, 77, 0.96) 50%, rgba(8, 47, 41, 0.95) 100%);
}
.w25d-cinematic-alert::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  left: -45%;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 196, 0.35), transparent);
  transform: skewX(-24deg);
  animation: tkcAlertSweep 1.8s ease-in-out infinite;
}

@keyframes tkcAlertEnter {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tkcAlertSweep {
  0%   { left: -45%; }
  100% { left: 115%; }
}

/* ── 8. Co Giãn Đồng Nhất (--tkc-ui-scale) & Contextual Combat HUD ── */
.w25d-top {
  transform: scale(var(--tkc-ui-scale, 1));
  transform-origin: top center;
}

/* Khi đang Công Thành, PK 3 Phút Cuối hoặc Giằng Co Cá Lớn -> tự gọn chrome phụ */
body.is-combat-focus .w25d-ftue,
body.is-combat-focus .w25d-3d-btn,
body.is-combat-focus #w25d-help-btn {
  display: none !important;
}

body.is-combat-focus .w25d-bottom {
  opacity: 0.84;
}
body.is-combat-focus .w25d-bottom:hover,
body.is-combat-focus .w25d-bottom:focus-within {
  opacity: 1;
}

/* Bảo toàn 100% chế độ sạch khung viền OBS (?embed=1) */
body.is-embed-obs .w25d-rec-btn,
body.is-embed-obs .w25d-cinematic-alert {
  display: none !important;
}

/* ── 9. Sân Khấu Xem Tướng #hallStage (12 Khe · 9 Hạt Đan Điền · 360° · 4 Tư Thế · Xưởng Dệt Gấm) ── */
.w25d-arm-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 6px 8px 2px;
}
.w25d-arm-seg-btn {
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(217, 184, 101, 0.35);
  background: rgba(8, 22, 26, 0.85);
  color: var(--tkc-muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.w25d-arm-seg-btn.is-on {
  background: linear-gradient(180deg, var(--tkc-gold-hi), var(--tkc-gold));
  color: #1c1105;
  border-color: #4a310e;
}

.tkc-hall-stage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px 8px;
  overflow-y: auto;
  max-height: calc(100dvh - 180px);
}
.tkc-hall-stage[hidden] {
  display: none !important;
}

.hall-arena-grid {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 66px;
  gap: 6px;
  align-items: stretch;
}
.hall-slot-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hall-slot-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 3px;
  min-height: 44px;
  border-radius: 9px;
  background: rgba(10, 26, 28, 0.88);
  border: 1px solid rgba(217, 184, 101, 0.36);
  color: var(--tkc-paper);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.hall-slot-tile.is-sel {
  border-color: var(--tkc-gold-hi);
  box-shadow: 0 0 0 1px var(--tkc-gold-hi), 0 0 12px rgba(217, 184, 101, 0.38);
  background: rgba(25, 58, 50, 0.94);
}
.hall-slot-tile .slot-ico {
  font-size: 14px;
  line-height: 1.1;
}
.hall-slot-tile .slot-plus {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 8.5px;
  font-weight: 900;
  color: #38bdf8;
}
.hall-slot-tile .slot-plus.is-p7 { color: #67e8f9; }
.hall-slot-tile .slot-plus.is-p10 { color: #fde047; text-shadow: 0 0 6px rgba(253, 224, 71, 0.75); }

.hall-center-pedestal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 62%, rgba(23, 68, 60, 0.72) 0%, rgba(6, 16, 20, 0.95) 78%);
  border: 1px solid rgba(217, 184, 101, 0.48);
  padding: 5px;
  min-height: 274px;
}
#hallStage-canvas {
  width: 100%;
  height: 218px;
  display: block;
}

/* Chuỗi 9 Hạt Đan Điền Cảnh Giới */
.hall-dantian-wrap {
  width: 100%;
  padding: 5px 7px;
  border-radius: 9px;
  background: rgba(7, 19, 24, 0.88);
  border: 1px solid rgba(116, 231, 202, 0.28);
}
.hall-dantian-9 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  margin-top: 4px;
}
.hall-dantian-bead {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid rgba(148, 163, 184, 0.42);
  background: rgba(15, 23, 42, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
  font-weight: 900;
  color: #64748b;
}
.hall-dantian-bead.is-lit {
  color: #090d16;
  border-color: #fffbeb;
  box-shadow: 0 0 9px var(--bead-col, #38bdf8);
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--bead-col, #38bdf8) 70%);
}

.hall-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.hall-chip {
  padding: 4px 7px;
  border-radius: 8px;
  border: 1px solid rgba(217, 184, 101, 0.34);
  background: rgba(12, 30, 34, 0.86);
  color: var(--tkc-paper);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.hall-chip.is-on {
  background: linear-gradient(180deg, var(--tkc-gold-hi), var(--tkc-gold));
  color: #1c1105;
  border-color: #4a310e;
}

.hall-inspector-box {
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(8, 22, 26, 0.9);
  border: 1px solid rgba(217, 184, 101, 0.38);
  display: grid;
  gap: 6px;
}
.hall-dye-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.hall-dye-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  color: var(--tkc-muted);
}
.hall-dye-cell input[type="color"] {
  width: 100%;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(217, 184, 101, 0.5);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

/* ============================================================================
 * TKC ULTRA VIP PRO v26.0 — SVG Filigree, Utility Drawer, 3D HUD & Realms UI
 * ============================================================================ */

.tkc-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Họa tiết mây góc SVG 4 góc khung sơn mài */
.w25d-modal-card,
.tkc-lacquer-panel,
.realm-win-modal .card,
.tkc3d-modal .modal-card {
  position: relative;
}
.tkc-filigree-corner {
  position: relative;
}
.tkc-filigree-corner::after {
  content: '';
  position: absolute;
  inset: 5px;
  pointer-events: none;
  z-index: 2;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' fill='none' stroke='%23d9b865' stroke-width='1.5'><path d='M2 14V3a1 1 0 0 1 1-1h11M5.5 10.5V5.5h5'/><circle cx='16' cy='3.5' r='1.1' fill='%23f4d892'/><circle cx='3.5' cy='16' r='1.1' fill='%23f4d892'/></svg>") left top / 22px 22px no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' fill='none' stroke='%23d9b865' stroke-width='1.5'><path d='M26 14V3a1 1 0 0 0-1-1H14M22.5 10.5V5.5h-5'/><circle cx='12' cy='3.5' r='1.1' fill='%23f4d892'/><circle cx='24.5' cy='16' r='1.1' fill='%23f4d892'/></svg>") right top / 22px 22px no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' fill='none' stroke='%23d9b865' stroke-width='1.5'><path d='M2 14v11a1 1 0 0 0 1 1h11M5.5 17.5v5h5'/><circle cx='16' cy='24.5' r='1.1' fill='%23f4d892'/><circle cx='3.5' cy='12' r='1.1' fill='%23f4d892'/></svg>") left bottom / 22px 22px no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' fill='none' stroke='%23d9b865' stroke-width='1.5'><path d='M26 14v11a1 1 0 0 1-1 1H14M22.5 17.5v5h-5'/><circle cx='12' cy='24.5' r='1.1' fill='%23f4d892'/><circle cx='24.5' cy='12' r='1.1' fill='%23f4d892'/></svg>") right bottom / 22px 22px no-repeat;
  opacity: 0.72;
}
body[data-tenant="minh-nguyet-lau"] .tkc-filigree-corner::after {
  filter: hue-rotate(8deg) saturate(1.1);
}

/* Biển hoành phi tiêu đề & Triện đóng chu sa */
.tkc-title-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  margin: -4px auto 10px;
  width: fit-content;
  max-width: 92%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(36, 78, 70, 0.92), rgba(11, 29, 32, 0.96));
  border: 1.5px solid var(--tkc-gold);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 240, 200, 0.28);
  font-family: 'Noto Serif', 'Lora', Georgia, serif;
  font-size: 13px;
  font-weight: 900;
  color: var(--tkc-gold-hi);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.tkc-close-seal {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #991b1b, #5f1111);
  border: 1.2px solid #fca5a5;
  color: #fff7ed;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(127, 29, 29, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, filter 0.14s ease;
}
.tkc-close-seal:hover { filter: brightness(1.15); }
.tkc-close-seal:active { transform: scale(0.92); }

/* Ngăn kéo Tiện Ích thu gọn cho Topbar 2.5D */
.w25d-utils-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.w25d-utils-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--tkc-lacquer-hi);
  border: 1px solid rgba(217, 184, 101, 0.55);
  color: var(--tkc-gold-hi);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 200, 0.22);
}
.w25d-utils-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #061215;
}
.w25d-utils-drawer {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 65;
  width: min(286px, 84vw);
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(16, 46, 42, 0.97), rgba(6, 16, 20, 0.99));
  border: 1.5px solid var(--tkc-gold);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.78), inset 0 0 0 1px rgba(217, 184, 101, 0.22);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  backdrop-filter: blur(12px);
}
body[data-tenant="minh-nguyet-lau"] .w25d-utils-drawer {
  background: linear-gradient(165deg, rgba(14, 24, 44, 0.97), rgba(7, 13, 27, 0.99));
}
.w25d-utils-drawer[hidden] {
  display: none !important;
}
.w25d-utils-drawer > * {
  width: 100%;
  justify-content: center !important;
  min-height: 33px !important;
  font-size: 11px !important;
}

/* ============================================================================
 * Đồng bộ Trạm 3D (tkc3d.js) theo Ngọc Bích Sơn Mài / Minh Nguyệt Lâu
 * ============================================================================ */
body.tkc3d-ancient-mode {
  background: var(--tkc-bg);
  color: var(--tkc-paper);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
}
body.tkc3d-ancient-mode .hud-top {
  background: linear-gradient(180deg, rgba(7, 19, 24, 0.94), rgba(5, 13, 17, 0.78), rgba(5, 13, 17, 0));
  border-bottom: 1px solid rgba(217, 184, 101, 0.16);
}
body[data-tenant="minh-nguyet-lau"].tkc3d-ancient-mode .hud-top {
  background: linear-gradient(180deg, rgba(11, 19, 36, 0.94), rgba(8, 14, 28, 0.76), rgba(8, 14, 28, 0));
}
body.tkc3d-ancient-mode .hud-brand {
  font-family: 'Noto Serif', 'Lora', Georgia, serif;
  color: var(--tkc-gold-hi);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}
body.tkc3d-ancient-mode .hud-btn,
body.tkc3d-ancient-mode .zone-pill,
body.tkc3d-ancient-mode .weather-orb {
  background: var(--tkc-lacquer-hi);
  border: 1px solid rgba(217, 184, 101, 0.45);
  color: var(--tkc-paper);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 200, 0.18);
  backdrop-filter: blur(8px);
}
body.tkc3d-ancient-mode .hud-btn:hover,
body.tkc3d-ancient-mode .zone-pill:hover,
body.tkc3d-ancient-mode .zone-pill.active,
body.tkc3d-ancient-mode .weather-orb.active {
  border-color: var(--tkc-gold-hi);
  color: var(--tkc-gold-hi);
  box-shadow: 0 0 14px rgba(217, 184, 101, 0.34), inset 0 1px 0 rgba(255, 248, 220, 0.32);
}
body.tkc3d-ancient-mode .hud-btn.gold {
  background: linear-gradient(180deg, var(--tkc-gold-hi), var(--tkc-gold));
  color: #1c1105;
  border-color: #4a310e;
}
body.tkc3d-ancient-mode .hud-btn.purple {
  background: linear-gradient(180deg, var(--tkc-jade-hi), var(--tkc-jade));
  color: #f0fdfa;
  border-color: rgba(116, 231, 202, 0.55);
}
body.tkc3d-ancient-mode .hud-btn.primary {
  background: linear-gradient(180deg, #b91c1c, #7f1d1d);
  color: #fff7ed;
  border-color: rgba(253, 186, 116, 0.65);
}
body.tkc3d-ancient-mode .hud-zones {
  background: rgba(8, 22, 26, 0.78);
  border: 1px solid rgba(217, 184, 101, 0.32);
  border-radius: 999px;
  padding: 4px 7px;
  backdrop-filter: blur(10px);
}
body.tkc3d-ancient-mode .fishing-dock,
body.tkc3d-ancient-mode .zenaqua-dock,
body.tkc3d-ancient-mode .cinema-dock,
body.tkc3d-ancient-mode .obs-studio-drawer,
body.tkc3d-ancient-mode .tkc3d-modal .modal-card {
  background: var(--tkc-lacquer);
  border: 1.5px solid var(--tkc-gold);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.72), inset 0 0 0 1px rgba(217, 184, 101, 0.25);
  color: var(--tkc-paper);
}
body.tkc3d-ancient-mode .hud-more-wrap {
  position: relative;
  display: inline-flex;
}
body.tkc3d-ancient-mode .hud-more-drawer {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 60;
  width: min(350px, 92vw);
  padding: 12px;
  border-radius: 16px;
  background: var(--tkc-lacquer);
  border: 1.5px solid var(--tkc-gold);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(217, 184, 101, 0.25);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  backdrop-filter: blur(12px);
}
body.tkc3d-ancient-mode .hud-more-drawer[hidden] {
  display: none !important;
}
body.tkc3d-ancient-mode .hud-more-drawer .hud-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 7px 10px;
}

/* ============================================================================
 * Đồng bộ Hub Vạn Giới (/van-gioi) & Hộ Chiếu Tài Khoản (/tai-khoan)
 * ============================================================================ */
.tkc-realm-hub {
  color: var(--tkc-paper);
}
.tkc-realm-hub .tkc-lacquer-panel,
.realm-card.tkc-lacquer-panel {
  border-radius: 16px;
  padding: 18px;
}
.tkc-badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(217, 184, 101, 0.22), rgba(217, 184, 101, 0.08));
  border: 1px solid rgba(217, 184, 101, 0.55);
  color: var(--tkc-gold-hi);
  font-size: 11px;
  font-weight: 800;
}
.tkc-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid #4a310e;
  background: linear-gradient(180deg, var(--tkc-gold-hi), var(--tkc-gold));
  color: #1c1105 !important;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.tkc-btn-gold:hover { filter: brightness(1.06); }
.tkc-btn-gold:active { transform: translateY(1px) scale(0.98); }

.tkc-btn-jade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid rgba(116, 231, 202, 0.48);
  background: linear-gradient(180deg, var(--tkc-jade-hi), var(--tkc-jade));
  color: #f0fdfa !important;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Hộ chiếu Vạn Giới & Truyền Thư Các trên /tai-khoan */
#passport-van-gioi.tkc-lacquer-panel,
#truyen-thu-cac.tkc-lacquer-panel {
  border-radius: 16px;
  padding: 20px;
  color: var(--tkc-paper);
}
#passport-van-gioi .passport-stat-box {
  background: rgba(7, 20, 24, 0.84);
  border: 1px solid rgba(217, 184, 101, 0.35);
  border-radius: 12px;
  padding: 12px;
}
body[data-tenant="minh-nguyet-lau"] #passport-van-gioi .passport-stat-box {
  background: rgba(11, 21, 41, 0.86);
}

