/* =============================================================================
   kVisuals.css - HỆ THỐNG HOẠT CẢNH & HIỆU ỨNG THỊ GIÁC TIÊN HIỆP ĐỈNH CAO
   Tu Tiên Nano - Đạo Giới Thổ Nạp, Lò Bát Quái, Gieo Quẻ & Lôi Kiếp
   ============================================================================= */

/* 1. KHUNG CẢNH NỀN ĐỘNG PHỦ (CAVE SCENERY - VIEWPORT FLUID ONE VIEW) */
.kx-cave-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #16243b 0%, #0c1424 50%, #060a12 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--kx-header-h, 48px) + var(--kx-top-action-h, 50px) + 16px) 14px calc(var(--kx-bottom-dock-h, 50px) + 16px + env(safe-area-inset-bottom, 0px)) 14px;
  user-select: none;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Lớp cảnh nền núi mây mờ ảo */
.kx-scenery-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  opacity: 0.38;
  transition: opacity 0.8s ease, transform 1s ease;
}

/* Mây trôi lượn lờ */
.kx-cloud-layer {
  position: absolute;
  top: 0; left: -100%; width: 300%; height: 100%;
  background: radial-gradient(ellipse at 50% 85%, rgba(0, 229, 255, 0.12) 0%, transparent 70%);
  animation: cloudDrift 40s linear infinite;
  pointer-events: none;
}

@keyframes cloudDrift {
  0% { transform: translateX(0); }
  100% { transform: translateX(33.33%); }
}


/* =============================================================================
   HỆ THỐNG DONUT TU VI MANDALA & CULTIVATOR HERO
   ============================================================================= */
.kx-cultivator-hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  max-width: 100%;
}

/* 1. HUD PHÍA TRÊN DONUT (CẢNH GIỚI, THIÊN THƯ, TỐC ĐỘ TU LUYỆN) */
.kx-donut-top-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  z-index: 15;
  user-select: none;
}

.kx-donut-realm-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 16, 30, 0.72);
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 20px;
  padding: 3px 10px 3px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.kx-donut-realm-title {
  font-size: 0.84rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--gold-glow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}
.kx-donut-realm-title:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--gold-glow);
}

.kx-donut-realm-bar .kx-btn-realm-info {
  padding: 2px 8px;
  font-size: 0.68rem;
  border-radius: 12px;
}

/* Badge Tốc Độ Tu Luyện (Đặt ngay phía trên Donut theo yêu cầu) */
.kx-donut-speed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(8, 14, 26, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-radius: 16px;
  padding: 3px 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 229, 255, 0.12);
  font-size: 0.72rem;
  transition: all 0.2s ease;
}

.kx-donut-speed-rate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #e2e8f0;
}
.kx-donut-speed-rate b {
  color: var(--cyan-glow);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.kx-donut-speed-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
}

.kx-donut-tuvi-progress {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold-glow);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  cursor: pointer;
}

.kx-donut-pct-pill {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: var(--gold-glow);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 8px;
  line-height: 1.4;
}

/* 2. VÒNG DONUT TIẾN TRÌNH */
.kx-donut-stage-wrapper {
  position: relative;
  width: clamp(170px, 30vh, 250px);
  height: clamp(170px, 30vh, 250px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto;
}

.kx-donut-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  overflow: visible;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.3));
}

.kx-donut-progress {
  transition: stroke-dashoffset 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.kx-donut-progress.can-break {
  stroke: url(#donutBreakGradient) !important;
  animation: donutPulse 1.6s infinite alternate;
}

@keyframes donutPulse {
  0% {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.75)) drop-shadow(0 0 16px rgba(255, 145, 0, 0.5));
    stroke-width: 8px;
  }
  100% {
    filter: drop-shadow(0 0 18px rgba(255, 215, 0, 1)) drop-shadow(0 0 32px rgba(255, 145, 0, 0.85));
    stroke-width: 10px;
  }
}

/* Nhân vật Tu Sĩ nằm trong lòng Donut */
.kx-donut-stage-wrapper .kx-cultivator-wrapper {
  position: relative;
  width: 78%;
  height: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 2. KHU VỰC NHÂN VẬT ĐẢ TỌA (CULTIVATOR HERO - VIEWPORT FLUID SCALE) */
.kx-cultivator-wrapper {
  position: relative;
  width: clamp(120px, 26vh, 230px);
  height: clamp(120px, 26vh, 230px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kx-cultivator-wrapper:hover {
  transform: scale(1.03);
}

.kx-cultivator-wrapper:active {
  transform: scale(0.96);
}

/* Vòng Bát Quái xoay chậm sau lưng */
.kx-halo-ring {
  position: absolute;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.2);
  animation: haloSpin 25s linear infinite;
  pointer-events: none;
}

.kx-halo-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

@keyframes haloSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hình tượng Tu Sĩ Đả Tọa Chân Thực Điện Ảnh */
.kx-cultivator-figure {
  position: relative;
  width: 78%;
  height: 78%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: floatMeditate 3.6s ease-in-out infinite;
}

@keyframes floatMeditate {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.kx-figure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.15s ease, filter 0.25s ease;
}

.kx-figure-img.is-male {
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.75)) drop-shadow(0 0 24px rgba(255, 215, 0, 0.45));
}

.kx-figure-img.is-female {
  filter: drop-shadow(0 0 14px rgba(224, 64, 251, 0.8)) drop-shadow(0 0 24px rgba(0, 229, 255, 0.45));
}

.kx-cultivator-wrapper:active .kx-figure-img {
  transform: scale(0.95);
  filter: brightness(1.25) drop-shadow(0 0 28px rgba(255, 215, 0, 0.95));
}

/* Tòa Sen Phát Sáng (Lotus Throne) */
.kx-lotus-throne {
  position: absolute;
  bottom: -6px;
  width: 72%;
  height: clamp(24px, 5vh, 46px);
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 215, 0, 0.3) 0%, rgba(0, 229, 255, 0.2) 60%, transparent 100%);
  border-radius: 50%;
  filter: blur(4px);
  animation: lotusPulse 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes lotusPulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.08); opacity: 1; filter: blur(6px); }
}

/* Sóng Linh Khí tỏa ra khi Click (Qi Shockwave) */
.kx-shockwave {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--cyan-glow);
  box-shadow: 0 0 20px var(--cyan-glow);
  pointer-events: none;
  animation: shockwaveExpand 0.75s ease-out forwards;
}

@keyframes shockwaveExpand {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(7.5);
    opacity: 0;
  }
}

/* Chữ hiển thị "+10 Tu Vi" bay bổng */
.kx-fly-tuvi {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: #ffd700;
  text-shadow: 0 0 10px #ff9800, 0 0 20px #ff5722;
  pointer-events: none;
  animation: flyTuVi 1.1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  z-index: 50;
}

@keyframes flyTuVi {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -25px) scale(1.2);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -65px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -90px) scale(0.8);
  }
}

/* 3. LÒ BÁT QUÁI LUYỆN ĐAN (ALCHEMY CAULDRON) */
.kx-alchemy-chamber {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 30px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.kx-furnace-body {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kx-furnace-body.refining {
  animation: furnaceShake 0.12s infinite;
}

@keyframes furnaceShake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  25% { transform: translate(-2px, -1px) rotate(-1deg); }
  50% { transform: translate(-1px, 2px) rotate(1deg); }
  75% { transform: translate(2px, 1px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.kx-furnace-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(255, 106, 0, 0.6));
}

/* Lửa Tam Muội Chân Hỏa dưới đáy lò */
.kx-samadhi-fire {
  position: absolute;
  bottom: -15px;
  width: 160px;
  height: 60px;
  background: radial-gradient(ellipse at 50% 80%, #ff3d00 0%, #ff9100 40%, rgba(0, 229, 255, 0.4) 75%, transparent 100%);
  border-radius: 50%;
  filter: blur(8px);
  animation: fireFlicker 1.8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes fireFlicker {
  0% { transform: scale(0.9) translateY(0); opacity: 0.7; }
  50% { transform: scale(1.1) translateY(-3px); opacity: 1; }
  100% { transform: scale(1.02) translateY(2px); opacity: 0.85; }
}

/* Tia đan dược bay vút ra */
.kx-pill-ascent {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffd700, #ff6d00);
  box-shadow: 0 0 25px #ffd700, 0 0 50px #ff3d00;
  pointer-events: none;
  animation: pillAscent 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  z-index: 60;
}

@keyframes pillAscent {
  0% { transform: translate(0, 40px) scale(0.2); opacity: 0; }
  30% { transform: translate(0, -60px) scale(1.4); opacity: 1; }
  70% { transform: translate(0, -120px) scale(1.2); opacity: 1; }
  100% { transform: translate(0, -180px) scale(0.4); opacity: 0; }
}

/* 4. ỐNG XĂM VẤN ĐẠO (DIVINATION BAMBOO CYLINDER) */
.kx-divination-stage {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto 30px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.kx-bamboo-tube {
  position: relative;
  width: 170px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.kx-bamboo-tube.shaking {
  animation: tubeRattle 0.15s ease-in-out infinite;
}

@keyframes tubeRattle {
  0% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-8deg) translateY(-8px); }
  50% { transform: rotate(5deg) translateY(4px); }
  75% { transform: rotate(-5deg) translateY(-5px); }
  100% { transform: rotate(7deg) translateY(0); }
}

.kx-tube-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

/* Thẻ xăm vàng bay vút lên */
.kx-divine-stick-pop {
  position: absolute;
  width: 18px;
  height: 110px;
  background: linear-gradient(180deg, #ffd700, #ffb300, #8d6e63);
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.9), 0 0 40px rgba(255, 152, 0, 0.6);
  pointer-events: none;
  animation: stickLeap 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  z-index: 50;
}

@keyframes stickLeap {
  0% { transform: translateY(40px) scale(0.6); opacity: 0; }
  30% { transform: translateY(-80px) scale(1.1) rotate(5deg); opacity: 1; }
  70% { transform: translateY(-130px) scale(1.2) rotate(-3deg); opacity: 1; }
  100% { transform: translateY(-170px) scale(0.5); opacity: 0; }
}

/* 5. LƯ HƯƠNG DÂNG HƯƠNG (INCENSE ALTAR) */
.kx-incense-burner-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 18px;
  margin-top: 18px;
  position: relative;
  overflow: hidden;
}

.kx-incense-sticks {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 60px;
}

.kx-incense-stick {
  width: 3px;
  height: 48px;
  background: #a0522d;
  position: relative;
  border-radius: 2px;
}

.kx-stick-tip {
  position: absolute;
  top: -4px;
  left: -2px;
  width: 7px;
  height: 7px;
  background: #ff3d00;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff3d00, 0 0 20px #ff9800;
  animation: emberGlow 1.2s ease-in-out infinite alternate;
}

@keyframes emberGlow {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}

.kx-smoke-stream {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 8px;
  height: 40px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.4), transparent);
  filter: blur(2px);
  animation: smokeWaft 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes smokeWaft {
  0% { transform: translateX(-50%) scaleX(1) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-30%) scaleX(2) translateY(-25px); opacity: 0.3; }
  100% { transform: translateX(-60%) scaleX(3) translateY(-50px); opacity: 0; }
}

/* =============================================================================
   6. SÂN KHẤU LUÂN HỒI ĐIỆN & LỤC ĐẠO TRÙNG SINH (SAMSARA REINCARNATION STAGE)
   ============================================================================= */
.kx-reincarnation-stage {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 36px auto;
  min-height: 400px;
  border-radius: 24px;
  overflow: hidden;
  border: 1.5px solid rgba(179, 136, 255, 0.4);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7), 0 0 60px rgba(124, 77, 255, 0.25), inset 0 0 100px rgba(10, 5, 25, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  user-select: none;
  background: #080512;
}

/* Nền tranh Luân Hồi Điện lung linh */
.kx-reincarnation-backdrop {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url('/static/img/luan_hoi_dien.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.45;
  filter: saturate(1.2) contrast(1.1);
  pointer-events: none;
  transition: opacity 0.8s ease, transform 1s ease;
}

/* Lớp sương mù hư không màu tím */
.kx-void-fog {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(179, 136, 255, 0.15) 0%, rgba(10, 5, 25, 0.7) 65%, #080512 100%);
  pointer-events: none;
}

/* Tâm điểm Luân Hồi Bàn */
.kx-samsara-wheel-box {
  position: relative;
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  z-index: 5;
}

/* Vòng xoay Luân Hồi Bàn */
.kx-samsara-wheel-disc {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(179, 136, 255, 0.85));
  animation: samsaraRotate 35s linear infinite;
  transition: filter 0.5s ease, transform 0.5s ease;
}

.kx-samsara-wheel-box:hover .kx-samsara-wheel-disc {
  filter: drop-shadow(0 0 45px rgba(255, 215, 0, 0.95));
}

@keyframes samsaraRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes samsaraRotateFast {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(540deg) scale(1.15); filter: drop-shadow(0 0 70px #ffd700); }
  100% { transform: rotate(1080deg) scale(1.05); }
}

/* Hào quang Thái Cực rung động */
.kx-samsara-halo {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 1.5px dashed rgba(179, 136, 255, 0.5);
  box-shadow: 0 0 35px rgba(124, 77, 255, 0.4), inset 0 0 35px rgba(0, 229, 255, 0.2);
  animation: haloCounterSpin 20s linear infinite;
  pointer-events: none;
}

@keyframes haloCounterSpin {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* Đốm linh hồn trôi nổi (Floating Soul Wisps) */
.kx-soul-wisps-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.kx-soul-wisp {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b388ff;
  box-shadow: 0 0 15px #b388ff, 0 0 30px #7c4dff;
  opacity: 0.7;
  animation: wispFloat 6s ease-in-out infinite;
}

@keyframes wispFloat {
  0%, 100% { transform: translateY(0) scale(0.8); opacity: 0.3; }
  50% { transform: translateY(-40px) scale(1.3); opacity: 0.9; }
}

/* =============================================================================
   7. HIỆU ỨNG THAO TÁC CẮT CẢNH (REINCARNATION CUTSCENES & OVERLAYS)
   ============================================================================= */

/* Màn hình Trùng Sinh Toàn Cảnh (Rebirth Fullscreen Cutscene) */
.kx-rebirth-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 2, 10, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.kx-rebirth-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Vòng xoay đại bác bão tố */
.kx-rebirth-core {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.kx-rebirth-flash {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffd700, #b388ff, transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.kx-rebirth-flash.burst {
  animation: flashBurst 1.2s ease-out forwards;
}

@keyframes flashBurst {
  0% { transform: scale(0.2); opacity: 1; }
  40% { transform: scale(3.5); opacity: 0.9; }
  100% { transform: scale(5); opacity: 0; }
}

.kx-rebirth-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 25px rgba(255, 215, 0, 0.8), 0 0 50px rgba(179, 136, 255, 0.9);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 12px;
}

.kx-rebirth-subtitle {
  color: #e0e0e0;
  font-size: 1.1rem;
  max-width: 600px;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Card Thần Thông Luân Hồi - Header hình ảnh */
.kx-reincarnation-card-img {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kx-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.kx-card:hover .kx-card-thumb {
  transform: scale(1.08);
}

/* Xuyên Không Lỗ Hổng Thời Không (Space-Time Rift Effect) */
.kx-rift-portal {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--cyan-glow);
  box-shadow: 0 0 25px var(--cyan-glow), inset 0 0 25px #7c4dff;
  animation: riftPulse 1.8s ease-in-out infinite alternate;
}

@keyframes riftPulse {
  0% { transform: scale(0.9) rotate(0deg); border-radius: 50% 40% 50% 40%; }
  100% { transform: scale(1.15) rotate(180deg); border-radius: 40% 50% 40% 50%; }
}

/* Xuất Hồn Bay Bổng Thần Thức (Astral Soul Elevation) */
.kx-astral-figure {
  animation: astralAscend 2.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 20px #ffd700);
}

@keyframes astralAscend {
  0% { transform: translateY(5px) scale(0.95); opacity: 0.8; }
  100% { transform: translateY(-12px) scale(1.08); opacity: 1; }
}

/* =============================================================================
   8. ĐIỀU CHỈNH GIAO DIỆN HÌNH ẢNH & SÂN KHẤU (RESPONSIVE STAGES: PC - TABLET - MOBILE)
   ============================================================================= */

/* TABLET (768px <= width <= 1024px) */
@media (max-width: 1024px) {
  .kx-cave-stage {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
.kx-reincarnation-stage {
    min-height: 280px;
    padding: 16px 12px;
  }
  .kx-samsara-wheel-box {
    width: 180px;
    height: 180px;
  }
}

/* MOBILE (< 768px) */
@media (max-width: 767px) {
  .kx-cave-stage {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding-top: calc(var(--kx-header-h, 44px) + var(--kx-top-action-h, 46px) + 10px);
    padding-bottom: calc(var(--kx-bottom-dock-h, 48px) + 14px + env(safe-area-inset-bottom, 0px));
  }

  .kx-donut-top-hud {
    gap: 4px;
    margin-bottom: 2px;
  }
  .kx-donut-realm-bar {
    padding: 2px 8px 2px 10px;
    gap: 6px;
  }
  .kx-donut-realm-title {
    font-size: 0.76rem;
    gap: 4px;
  }
  .kx-donut-speed-badge {
    padding: 2px 8px;
    font-size: 0.65rem;
    gap: 4px;
  }
  .kx-donut-tuvi-progress {
    font-size: 0.65rem;
  }
  .kx-donut-pct-pill {
    font-size: 0.58rem;
    padding: 0 4px;
  }
  .kx-donut-stage-wrapper {
    width: clamp(160px, 28vh, 220px);
    height: clamp(160px, 28vh, 220px);
    margin: 2px auto;
  }

  
  .kx-breakthrough-duo-container {
    gap: 6px;
    margin-top: 6px;
    max-width: 360px;
  }
  .kx-btn-break-pill {
    padding: 5px 8px;
    gap: 6px;
    border-radius: 12px;
  }
  .kx-btn-break-pill .kx-break-icon-wrap {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }
  .kx-break-main-lbl {
    font-size: 0.7rem;
  }
  .kx-break-sub-lbl {
    font-size: 0.55rem;
  }

  .kx-fly-tuvi {
    font-size: 1.15rem;
  }

  /* Lò Bát Quái trên Mobile */
  .kx-alchemy-chamber {
    margin-bottom: 18px;
  }
  .kx-furnace-body {
    width: 160px;
    height: 160px;
  }
  .kx-furnace-img {
    max-width: 130px;
  }
  .kx-samadhi-fire {
    width: 120px;
    height: 45px;
    bottom: -8px;
  }

  /* Ống Xăm trên Mobile */
  .kx-divination-stage {
    min-height: 220px;
    margin-bottom: 18px;
  }
  .kx-bamboo-tube {
    width: 135px;
    height: 175px;
  }

  /* Luân Hồi Điện trên Mobile */
  .kx-reincarnation-stage {
    min-height: 280px;
    padding: 18px 12px;
    border-radius: 16px;
    margin-bottom: 20px;
  }
  .kx-samsara-wheel-box {
    width: 160px;
    height: 160px;
    margin-bottom: 10px;
  }
  .kx-rebirth-core {
    width: 210px;
    height: 210px;
  }
  .kx-rebirth-title {
    font-size: 1.6rem;
  }
  .kx-rebirth-subtitle {
    font-size: 0.95rem;
    padding: 0 16px;
  }
}


/* =============================================================================
   9. GIAO DIỆN THANH LÂU CÁC (TIÊU DAO HỒNG TRẦN)
   ============================================================================= */
.kx-view-thanh_lau .kx-feature-modal-header {
  border-bottom-color: rgba(236, 72, 153, 0.35) !important;
}

.kx-thanh-lau-banner {
  background: linear-gradient(135deg, rgba(236,72,153,0.15) 0%, rgba(168,85,247,0.1) 50%, rgba(10,14,23,0.95) 100%);
  border: 1px solid rgba(236,72,153,0.3);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.kx-beauties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kx-beauty-card {
  background: rgba(10, 14, 23, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  transition: all 0.25s ease;
  cursor: pointer;
  overflow: hidden;
}

.kx-beauty-card:hover, .kx-beauty-card.active {
  border-color: #ec4899;
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.35);
  transform: translateY(-2px);
}

.kx-beauty-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.kx-beauty-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid #ec4899;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #ec4899;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.4);
  flex-shrink: 0;
}

.kx-beauty-quote {
  font-style: italic;
  font-size: 0.82rem;
  color: #fce7f3;
  background: rgba(236, 72, 153, 0.08);
  border-left: 3px solid #ec4899;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 14px;
  line-height: 1.45;
}

.kx-activity-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.kx-activity-tab-btn {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 7px 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.kx-activity-tab-btn.active, .kx-activity-tab-btn:hover {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(236,72,153,0.4);
}

/* =============================================================================
   10. GIAO DIỆN TU NHÂN & HÒM ĐỒ CÀN KHÔN (CHIA 50% THEO CHIỀU DỌC & CỐ ĐỊNH)
   ============================================================================= */

/* Ẩn action bar phụ & header của Tu Nhân (bỏ tab và bỏ tiêu đề để tối đa diện tích hiển thị) */
#kx-action-bar-nhanvat,
.kx-view-profile .kx-feature-modal-header {
  display: none !important;
}

/* Thân modal Tu Nhân: cố định hoàn toàn không cuộn, chia đều 50% trên và 50% dưới, vừa khít giữa Header game và Dock đáy */
.kx-view-profile .kx-feature-modal-body {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding-top: calc(var(--kx-header-h, 48px) + 6px) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h, 52px) + 6px + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

@media (max-width: 767px) {
  .kx-view-profile .kx-feature-modal-body {
    padding-top: calc(var(--kx-header-h, 44px) + 5px) !important;
    padding-bottom: calc(var(--kx-bottom-dock-h, 48px) + 5px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    gap: 6px !important;
    justify-content: space-between !important;
  }
}

/* PHẦN TRÊN VÀ DƯỚI: ĐỒNG BỘ 100% WIDTH, CÙNG MAX-WIDTH, CỐ ĐỊNH 50% CHIỀU CAO */
.kx-view-profile #tunhan-hero-stage,
.kx-view-profile #tunhan-chest-stage {
  width: 100% !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  flex: 1 1 calc(50% - 4px) !important;
  height: calc(50% - 4px) !important;
  max-height: calc(50% - 4px) !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

/* =============================================================================
   PHẦN TRÊN: BẢN THỂ TU NHÂN (HERO STAGE)
   ============================================================================= */
.kx-view-profile #tunhan-hero-stage,
.kx-tunhan-stage {
  border: 1.5px solid var(--border-cyan) !important;
  background-size: cover !important;
  background-position: center center !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6) !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
}

.kx-tunhan-backdrop-overlay {
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.82) 0%, rgba(10, 14, 23, 0.96) 100%);
  padding: 6px 12px !important;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr !important;
  gap: 8px;
  align-items: center;
  height: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* RESPONSIVE CHO MÀN HÌNH TABLET / MOBILE NGANG (681px - 850px, ví dụ 745px trong ảnh chụp) */
@media (max-width: 850px) and (min-width: 681px) {
  .kx-tunhan-backdrop-overlay {
    grid-template-columns: 1fr 1.22fr 1fr !important;
    gap: 6px !important;
    padding: 4px 8px !important;
  }
  .kx-tunhan-stat-card {
    padding: 2px 6px !important;
    gap: 3px !important;
  }
  .kx-stat-title {
    font-size: 0.66rem !important;
  }
  .kx-stat-desc {
    display: none !important; /* Ẩn subtext để mở rộng diện tích hiển thị số/chữ */
  }
  .kx-stat-number {
    font-size: 0.76rem !important;
  }
  .kx-stat-text-val {
    font-size: 0.66rem !important;
    max-width: 60% !important;
  }
  .kx-tunhan-tuvi-wrap {
    max-width: 275px !important;
    padding: 3px 6px !important;
  }
}

/* RESPONSIVE MOBILE CHO BẢN THỂ TU NHÂN (<= 680px hoặc màn hình dọc) */
@media (max-width: 680px) {
  .kx-view-profile .kx-feature-modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start !important;
    padding-top: calc(var(--kx-header-h, 44px) + 6px) !important;
    padding-bottom: calc(var(--kx-bottom-dock-h, 48px) + 12px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    gap: 8px !important;
  }

  .kx-view-profile #tunhan-hero-stage,
  .kx-view-profile #tunhan-chest-stage,
  .kx-tunhan-stage,
  .kx-tunhan-chest-stage {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    width: 100% !important;
  }

  .kx-tunhan-backdrop-overlay {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "center center"
      "left right" !important;
    gap: 6px 8px !important;
    padding: 8px 6px !important;
    height: auto !important;
    min-height: auto !important;
    align-items: center !important;
  }

  .kx-tunhan-centerpiece {
    grid-area: center !important;
    margin-bottom: 2px !important;
  }

  .kx-tunhan-stats-col.col-left {
    grid-area: left !important;
    gap: 3px !important;
    height: auto !important;
  }

  .kx-tunhan-stats-col.col-right {
    grid-area: right !important;
    gap: 3px !important;
    height: auto !important;
  }

  .kx-tunhan-stat-card {
    padding: 3px 6px !important;
  }

  .kx-stat-title {
    font-size: 0.66rem !important;
  }

  .kx-stat-desc {
    display: none !important; /* Ẩn subtext trên mobile để thẻ thoáng, không rớt chữ */
  }

  .kx-stat-number {
    font-size: 0.74rem !important;
  }

  .kx-stat-text-val {
    font-size: 0.64rem !important;
    max-width: 58% !important;
  }

  .kx-tunhan-avatar-aura {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.25rem !important;
    margin: 0 auto 2px auto !important;
  }

  .kx-tunhan-sect-tagline {
    font-size: 0.6rem !important;
    padding: 1px 6px !important;
    margin-bottom: 1px !important;
    max-width: 95%;
  }

  .kx-tunhan-dao-hieu {
    font-size: 1rem !important;
    margin: 0 !important;
  }

  .kx-tunhan-subline {
    font-size: 0.62rem !important;
    margin-bottom: 2px !important;
  }

  .kx-tunhan-tuvi-wrap {
    max-width: 290px !important;
    width: 100% !important;
    padding: 3px 8px !important;
  }
}

/* CỘT CHỈ SỐ HAI BÊN (DESKTOP) */
.kx-tunhan-stats-col {
  display: flex;
  flex-direction: column;
  gap: 4px !important;
  justify-content: center;
  height: 100%;
  min-width: 0;
}

.kx-stats-col-head {
  font-size: 0.68rem !important;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px !important;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.kx-stats-col-head.right {
  justify-content: flex-end;
}

@media (max-width: 680px) {
  .kx-stats-col-head {
    display: none !important; /* Ẩn tiêu đề cột trên mobile để nhường diện tích cho 4 thẻ */
  }
}

.kx-tunhan-stat-card {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px !important;
  padding: 3px 8px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px !important;
  transition: all 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden !important;
}

.kx-tunhan-stat-card:hover {
  border-color: var(--border-gold);
  background: rgba(0, 0, 0, 0.82);
}

.kx-tunhan-stat-meta {
  display: flex;
  align-items: center;
  gap: 5px !important;
  min-width: 0;
  flex-shrink: 1;
}

.kx-tunhan-stat-meta i {
  font-size: 0.82rem !important;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.kx-stat-title {
  font-size: 0.7rem !important;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.1;
  white-space: nowrap;
}

.kx-stat-desc {
  font-size: 0.58rem !important;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
}

.kx-stat-number {
  font-size: 0.8rem !important;
  font-weight: 800;
  font-family: var(--font-heading);
  white-space: nowrap !important;
  text-align: right;
  flex-shrink: 0;
}

.kx-stat-text-val {
  font-size: 0.7rem !important;
  font-weight: 700;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 58% !important;
  text-align: right;
}

.kx-tuvi-header-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 3px !important;
  width: 100% !important;
}

.kx-tuvi-realm {
  color: var(--gold-glow) !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  flex-shrink: 1 !important;
}

.kx-tuvi-numbers {
  color: var(--cyan-glow) !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  white-space: nowrap !important;
  text-align: right !important;
  flex-shrink: 0 !important;
}

/* KHỐI TRUNG TÂM TU NHÂN */
.kx-tunhan-centerpiece {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  gap: 2px;
  min-width: 0;
}

.kx-tunhan-sect-tagline {
  font-size: 0.65rem !important;
  color: var(--gold-glow);
  font-weight: 700;
  margin-bottom: 2px !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 8px !important;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  white-space: nowrap;
}

.kx-tunhan-avatar-aura {
  width: 46px !important;
  height: 46px !important;
  border-radius: 50%;
  border: 2px solid var(--gold-glow) !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.4) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.7);
  overflow: hidden;
  font-size: 1.4rem !important;
  color: var(--cyan-glow);
  margin: 0 auto 2px auto !important;
  transition: transform 0.2s ease;
}

.kx-tunhan-avatar-aura:hover {
  transform: scale(1.08);
}

.kx-tunhan-avatar-aura img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kx-avatar-edit-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50%;
  background: var(--gold-glow);
  color: #0b0f19;
  font-size: 0.52rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.2px solid #000;
}

.kx-tunhan-badges-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px !important;
  margin-bottom: 2px !important;
  flex-wrap: wrap;
}

.kx-tunhan-badges-row .kx-badge-stat {
  font-size: 0.62rem !important;
  padding: 1px 6px !important;
  border-radius: 10px;
  white-space: nowrap;
}

.kx-tunhan-dao-hieu {
  font-size: 1.1rem !important;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #fff;
  margin: 0 0 1px 0 !important;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  line-height: 1.2;
}

.kx-tunhan-subline {
  font-size: 0.66rem !important;
  color: var(--text-muted);
  margin-bottom: 3px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px !important;
  white-space: nowrap;
}

.kx-tunhan-tuvi-wrap {
  width: 100%;
  max-width: 290px !important;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

/* =============================================================================
   PHẦN DƯỚI: HÒM ĐỒ CÀN KHÔN (CHEST STAGE)
   ============================================================================= */
.kx-view-profile #tunhan-chest-stage,
.kx-tunhan-chest-stage {
  border: 1.5px solid rgba(255, 215, 0, 0.35) !important;
  background: rgba(6, 10, 18, 0.8) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55) !important;
  padding: 6px 10px 8px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
}

.kx-chest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px !important;
  border-bottom: 1px dashed rgba(255, 215, 0, 0.2) !important;
  padding-bottom: 3px !important;
  flex-shrink: 0;
}

.kx-chest-title {
  display: flex;
  align-items: center;
  gap: 6px !important;
}

.kx-chest-title i {
  font-size: 0.95rem !important;
}

.kx-chest-title h4 {
  margin: 0;
  font-size: 0.86rem !important;
  color: var(--gold-glow);
}

.kx-chest-title span {
  font-size: 0.65rem !important;
  color: var(--text-muted);
}

.kx-chest-capacity-badge {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid var(--border-gold);
  padding: 2px 8px !important;
  border-radius: 14px !important;
  font-size: 0.7rem !important;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* =============================================================================
   LƯỚI HÒM ĐỒ 6 DÒNG X 5 CỘT (CỐ ĐỊNH KÍCH THƯỚC Ô, VUÔNG VẮN, KHÔNG ĐÈ NHAU)
============================================================================= */
.kx-inv-grid-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  padding: 2px 0;
}

.kx-inv-grid-4x7,
.kx-inv-grid-6x5 {
  display: grid !important;
  grid-template-columns: repeat(7, 38px) !important;
  grid-template-rows: repeat(4, 38px) !important;
  gap: 5px !important;
  justify-content: center !important;
  align-content: center !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: auto !important;
  box-sizing: border-box !important;
}

@media (min-width: 681px) {
  .kx-inv-grid-4x7,
  .kx-inv-grid-6x5 {
    grid-template-columns: repeat(7, 44px) !important;
    grid-template-rows: repeat(4, 44px) !important;
    gap: 6px !important;
  }

  .kx-inv-grid-4x7 .kx-inv-slot,
  .kx-inv-grid-6x5 .kx-inv-slot {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
  }

  .kx-inv-grid-4x7 .kx-inv-slot-icon,
  .kx-inv-grid-6x5 .kx-inv-slot-icon {
    font-size: 1.25rem !important;
  }

  .kx-inv-grid-4x7 .kx-inv-slot-badge,
  .kx-inv-grid-6x5 .kx-inv-slot-badge {
    font-size: 0.6rem !important;
    bottom: 2px !important;
    right: 3px !important;
  }
}

.kx-inv-slot {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  aspect-ratio: auto !important;
  background: rgba(10, 16, 28, 0.85) !important;
  border: 1.2px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
  user-select: none !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5) !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.kx-inv-slot:hover {
  transform: scale(1.1) !important;
  border-color: rgba(0, 229, 255, 0.9) !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5) !important;
  z-index: 10 !important;
}

.kx-inv-slot.selected {
  transform: scale(1.1) !important;
  border-color: var(--gold-glow) !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6), inset 0 0 6px rgba(255, 215, 0, 0.3) !important;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(10, 16, 28, 0.95) 100%) !important;
  z-index: 11 !important;
}

.kx-inv-slot.empty {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px dashed rgba(255, 255, 255, 0.08) !important;
  cursor: default !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.kx-inv-slot-empty-icon {
  font-size: 0.6rem !important;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.1) !important;
}

.kx-inv-slot.gold { border-color: rgba(255, 215, 0, 0.65) !important; }
.kx-inv-slot.purple { border-color: rgba(192, 132, 252, 0.65) !important; }
.kx-inv-slot.cyan { border-color: rgba(0, 229, 255, 0.65) !important; }
.kx-inv-slot.green { border-color: rgba(118, 255, 3, 0.65) !important; }
.kx-inv-slot.crimson { border-color: rgba(255, 64, 129, 0.65) !important; }

.kx-inv-slot-icon {
  font-size: 1.05rem !important;
  line-height: 1 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.kx-inv-slot-badge {
  position: absolute !important;
  bottom: 1px !important;
  right: 2px !important;
  font-size: 0.52rem !important;
  font-weight: 800 !important;
  font-family: var(--font-heading) !important;
  color: #fff !important;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000 !important;
  line-height: 1 !important;
  pointer-events: none !important;
}

/* =============================================================================
   TOOLTIP NỔI TIÊN HIỆP (FLOATING ITEM TOOLTIP)
============================================================================= */
.kx-item-floating-tooltip {
  position: absolute;
  z-index: 120;
  width: 230px;
  max-width: 90%;
  background: rgba(8, 14, 24, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-gold);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 16px rgba(255, 215, 0, 0.25);
  pointer-events: auto;
  animation: kxTtFadeIn 0.15s ease-out;
  box-sizing: border-box;
}

@keyframes kxTtFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.kx-tt-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.kx-tt-badge-category {
  font-size: 0.6rem;
  color: var(--cyan-glow);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.kx-tt-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.kx-tt-close-btn:hover {
  color: #fff;
}

.kx-tt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(255, 215, 0, 0.2);
}

.kx-tt-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.kx-tt-meta {
  flex: 1;
  min-width: 0;
}

.kx-tt-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-glow);
  margin: 0 0 2px 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-tt-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kx-tt-quality {
  font-weight: 700;
}

.kx-tt-quality.gold { color: var(--gold-glow); }
.kx-tt-quality.purple { color: #c084fc; }
.kx-tt-quality.cyan { color: var(--cyan-glow); }
.kx-tt-quality.green { color: #76ff03; }

.kx-tt-desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  max-height: 70px;
  overflow-y: auto;
}

.kx-tt-actions {
  display: block;
}

.kx-btn-sm {
  padding: 4px 10px !important;
  font-size: 0.72rem !important;
  border-radius: 6px !important;
}

/* =============================================================================
   3. NÚT ĐỘT PHÁ SONG SONG (DUO BREAKTHROUGH BUTTONS)
   ============================================================================= */
.kx-breakthrough-duo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  z-index: 15;
  width: 100%;
  max-width: 440px;
}

.kx-btn-break-pill {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: rgba(10, 16, 30, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  text-align: left;
  box-sizing: border-box;
}

.kx-btn-break-pill .kx-break-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.kx-btn-break-pill .kx-break-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.kx-break-main-lbl {
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.kx-break-sub-lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Nút 1: Dùng Đan Dược */
.kx-btn-break-pill.kx-break-dan:not(:disabled):not(.is-disabled) {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.16) 0%, rgba(255, 215, 0, 0.2) 100%);
  border-color: rgba(0, 230, 118, 0.55);
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.35), inset 0 0 10px rgba(0, 230, 118, 0.15);
  animation: kxPulseDan 2s infinite alternate;
}
.kx-btn-break-pill.kx-break-dan:not(:disabled):not(.is-disabled) .kx-break-icon-wrap {
  background: rgba(0, 230, 118, 0.22);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.5);
}
.kx-btn-break-pill.kx-break-dan:not(:disabled):not(.is-disabled) .kx-break-main-lbl {
  color: #a7f3d0;
}
.kx-btn-break-pill.kx-break-dan:not(:disabled):not(.is-disabled):hover {
  transform: translateY(-2px);
  border-color: #00e676;
  box-shadow: 0 0 24px rgba(0, 230, 118, 0.6);
}

@keyframes kxPulseDan {
  0% { box-shadow: 0 0 10px rgba(0, 230, 118, 0.25); }
  100% { box-shadow: 0 0 20px rgba(0, 230, 118, 0.55), 0 0 30px rgba(255, 215, 0, 0.25); }
}

/* Nút 2: Nhục Thân Đỡ Sét */
.kx-btn-break-pill.kx-break-raw:not(:disabled):not(.is-disabled) {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18) 0%, rgba(255, 145, 0, 0.22) 100%);
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.35), inset 0 0 10px rgba(255, 145, 0, 0.15);
  animation: kxPulseRaw 1.7s infinite alternate;
}
.kx-btn-break-pill.kx-break-raw:not(:disabled):not(.is-disabled) .kx-break-icon-wrap {
  background: rgba(255, 215, 0, 0.22);
  color: var(--gold-glow);
  border: 1px solid rgba(255, 215, 0, 0.5);
}
.kx-btn-break-pill.kx-break-raw:not(:disabled):not(.is-disabled) .kx-break-main-lbl {
  color: #fef08a;
}
.kx-btn-break-pill.kx-break-raw:not(:disabled):not(.is-disabled):hover {
  transform: translateY(-2px);
  border-color: var(--gold-glow);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.65);
}

@keyframes kxPulseRaw {
  0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.25); }
  100% { box-shadow: 0 0 22px rgba(255, 215, 0, 0.6), 0 0 32px rgba(255, 145, 0, 0.35); }
}

/* Trạng thái Disabled (khi chưa đủ Tu Vi) */
.kx-btn-break-pill:disabled,
.kx-btn-break-pill.is-disabled {
  opacity: 0.42;
  background: rgba(12, 18, 30, 0.65);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none !important;
  animation: none !important;
  filter: grayscale(0.5);
}
.kx-btn-break-pill:disabled .kx-break-icon-wrap,
.kx-btn-break-pill.is-disabled .kx-break-icon-wrap {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.kx-btn-break-pill:disabled .kx-break-main-lbl,
.kx-btn-break-pill.is-disabled .kx-break-main-lbl {
  color: #94a3b8;
}
.kx-btn-break-pill:disabled:hover,
.kx-btn-break-pill.is-disabled:hover {
  transform: none;
}

/* Nút Close Modal Icon */
.kx-modal-close-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.kx-modal-close-icon-btn:hover {
  background: rgba(255, 23, 68, 0.25);
  border-color: #ff1744;
  color: #ff5252;
  transform: rotate(90deg);
}

/* =========================================================================
   THANH LÂU CÁC - GIAI NHÂN PORTRAIT & AI CHAT STAGE (NEW ENHANCEMENT)
   ========================================================================= */
.kx-beauty-card {
  background: rgba(10, 14, 23, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kx-beauty-card:hover {
  transform: translateY(-3px);
  border-color: #ec4899;
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.3);
}

.kx-beauty-card.active {
  border-color: #ff4081;
  box-shadow: 0 0 25px rgba(255, 64, 129, 0.45);
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.18), rgba(10, 14, 23, 0.95));
}

.kx-beauty-card-thumb-wrap {
  position: relative;
  width: 100%;
  height: 175px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.kx-beauty-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.4s ease;
}

.kx-beauty-card:hover .kx-beauty-card-thumb {
  transform: scale(1.06);
}

.kx-beauty-badge-selected {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  z-index: 2;
}

/* Giai Nhân Interactive Stage */
.kx-tl-stage {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .kx-tl-stage {
    grid-template-columns: 1fr;
  }
}

.kx-tl-stage-portrait {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kx-tl-portrait-img-wrap {
  width: 100%;
  height: 310px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(236, 72, 153, 0.5);
  position: relative;
  background: #000;
}

.kx-tl-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
}

.kx-tl-portrait-img:hover {
  transform: scale(1.04);
}

.kx-tl-stage-chat {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 480px;
}

.kx-tl-chat-stream {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
  margin-bottom: 12px;
}

.kx-tl-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: fadeIn 0.3s ease;
}

.kx-tl-msg.beauty {
  align-self: flex-start;
}

.kx-tl-msg.cultivator {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.kx-tl-msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #ec4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

.kx-tl-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.kx-tl-msg.beauty .kx-tl-msg-bubble {
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.35);
  color: #fce7f3;
  border-top-left-radius: 2px;
}

.kx-tl-msg.cultivator .kx-tl-msg-bubble {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #e0f2fe;
  border-top-right-radius: 2px;
}

.kx-tl-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.kx-tl-quick-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: #fce7f3;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.kx-tl-quick-btn:hover {
  background: rgba(236, 72, 153, 0.25);
  border-color: #ec4899;
  color: #fff;
  transform: translateY(-1px);
}

.kx-tl-input-bar {
  display: flex;
  gap: 8px;
}

.kx-tl-input-bar input {
  flex: 1;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 9px 16px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.kx-tl-input-bar input:focus {
  border-color: #ec4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.35);
}

.kx-tl-send-btn {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  border: none;
  border-radius: 20px;
  padding: 0 20px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

.kx-tl-send-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* =========================================================================
   THANH LÂU CÁC - GENDER ZONE SWITCHER & TÚ BÀ / TÚ ÔNG TRUNG TÂM
   ========================================================================= */
.kx-tl-gender-switch {
  display: inline-flex;
  align-items: center;
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding: 0 clamp(4px, 0.8vw, 8px) 0 0 !important;
  gap: 2px !important;
  box-shadow: none !important;
}

.kx-tl-zone-btn {
  background: transparent !important;
  border: none !important;
  padding: 2px clamp(2px, 0.4vw, 4px) !important;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.45;
  transition: all 0.22s ease;
  box-shadow: none !important;
}

.kx-tl-zone-btn:hover {
  color: #fff;
  opacity: 0.85;
}

.kx-tl-zone-btn.active {
  background: transparent !important;
  color: #fff;
  opacity: 1 !important;
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px #ff4081);
  box-shadow: none !important;
}

.kx-tl-zone-btn.zone-male.active {
  background: transparent !important;
  filter: drop-shadow(0 0 8px #ffd700);
  box-shadow: none !important;
}

/* Thẻ Tú Bà / Tú Ông đặc biệt ở Trung Tâm */
.kx-beauty-card.boss {
  border: 2px dashed #f43f5e;
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.15), rgba(10, 14, 23, 0.95)) !important;
  animation: kxPulseBorder 3s infinite ease-in-out;
}

.kx-beauty-card.boss:hover, .kx-beauty-card.boss.active {
  border: 2px solid #f43f5e !important;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.55) !important;
  transform: translateY(-4px) scale(1.02);
}

@keyframes kxPulseBorder {
  0%, 100% { border-color: rgba(244, 63, 94, 0.6); }
  50% { border-color: rgba(234, 179, 8, 0.9); }
}

.kx-boss-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #f43f5e, #eab308);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.7);
  z-index: 3;
  text-transform: uppercase;
}


/* =============================================================================
   BẾ QUAN NGỘ ĐẠO: CÂY NGỘ ĐẠO (TREE OF ENLIGHTENMENT) VỪA KHÍT 1 VIEW
   ============================================================================= */

/* CẤU TRÚC BODY VỪA KHÍT 1 VIEW KHÔNG PHẢI CUỘN */
.kx-view-bequan .kx-feature-modal-body {
  height: 100% !important;
  max-height: 100% !important;
  padding-top: calc(var(--kx-header-h, 44px) + var(--kx-top-action-h, 42px) + 6px) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h, 48px) + 6px + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: clamp(8px, 1.8vw, 16px) !important;
  padding-right: clamp(8px, 1.8vw, 16px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

@media (max-height: 520px) {
  .kx-view-bequan .kx-feature-modal-body {
    overflow-y: auto !important;
    justify-content: flex-start !important;
  }
}

/* TĨNH THẤT SLIM HERO BANNER */
.kx-bequan-hero-slim {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(26, 16, 46, 0.75), rgba(10, 20, 36, 0.8));
  border: 1px solid rgba(224, 64, 251, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  box-sizing: border-box;
}

.kx-bequan-hero-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kx-bequan-hero-icon-mini {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(224, 64, 251, 0.18);
  border: 1px solid rgba(224, 64, 251, 0.45);
  color: #e040fb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(224, 64, 251, 0.3);
}

.kx-bequan-hero-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kx-bequan-hero-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-heading);
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-bequan-hero-motto {
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-bequan-hero-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .kx-bequan-hero-motto {
    display: none;
  }
  .kx-bequan-hero-slim {
    padding: 4px 8px;
    gap: 6px;
  }
  .kx-bequan-hero-title {
    font-size: 0.78rem;
  }
  .kx-bequan-hero-icon-mini {
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
  }
}

.kx-bequan-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.kx-bequan-stat-chip i {
  font-size: 0.75rem;
}

.kx-bequan-stat-chip.cave {
  color: var(--gold-glow);
  border-color: rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.08);
}

.kx-bequan-stat-chip.partner {
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.25);
  background: rgba(236, 72, 153, 0.08);
}

.kx-bequan-stat-chip.dan {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.08);
}

/* CÂY BẾ QUAN: BOX CHÍNH */
.kx-bequan-tree-box {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
  box-sizing: border-box;
}

/* TRỤC THÂN CÂY TRUNG TÂM (CENTRAL TRUNK) */
.kx-tree-trunk {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: linear-gradient(180deg, #e040fb 0%, #fb923c 35%, #eab308 65%, #00e5ff 100%);
  border-radius: 99px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45), 0 0 18px rgba(224, 64, 251, 0.35);
  z-index: 1;
}

/* ĐỈNH THỤ */
.kx-tree-crown {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #e040fb, #2e0854);
  border: 1.5px solid #f472b6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.6);
  animation: kxSpin 14s linear infinite;
  z-index: 3;
}

/* LINH CĂN (ROOT) */
.kx-tree-root {
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #00e5ff, #06283d);
  border: 1.5px solid #00e5ff;
  color: #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  z-index: 3;
}

/* XUNG LINH KHÍ CHẠY LÊN THEO THÂN CÂY */
.kx-tree-pulse {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 24px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(0, 229, 255, 0.6));
  filter: blur(1px);
  animation: kxTreePulseFlow 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes kxTreePulseFlow {
  0% {
    bottom: 2%;
    opacity: 0;
  }
  20% {
    opacity: 0.95;
  }
  80% {
    opacity: 0.95;
  }
  100% {
    bottom: 92%;
    opacity: 0;
  }
}

/* CÁC TẦNG NHÁNH CÂY */
.kx-tree-branches {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  z-index: 2;
}

.kx-tree-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 18px;
  position: relative;
}

/* MỖI NHÁNH CÂY (BRANCH NODE) */
.kx-tree-node {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.kx-tree-node.branch-left {
  justify-content: flex-end;
}

.kx-tree-node.branch-right {
  justify-content: flex-start;
}

/* CÀNH CÂY NỐI TỪ CARD VÀO TRỤC (BRANCH ARM & BUD) */
.kx-tree-arm {
  flex: 0 0 12px;
  height: 2px;
  position: relative;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.kx-tree-node.branch-left .kx-tree-arm {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(0, 229, 255, 0.7));
}

.kx-tree-node.branch-right .kx-tree-arm {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.7), rgba(255, 255, 255, 0.2));
}

.kx-tree-bud {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kx-tree-node.branch-left .kx-tree-bud {
  right: -4px;
}

.kx-tree-node.branch-right .kx-tree-bud {
  left: -4px;
}

/* THẺ THÔNG TIN TRÊN NHÁNH (TREE CARD) */
.kx-tree-card {
  width: 100%;
  background: rgba(10, 16, 28, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.kx-tree-node:hover .kx-tree-card {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.kx-tree-node:hover .kx-tree-arm {
  height: 2.5px;
}

.kx-tree-node:hover .kx-tree-bud {
  transform: scale(1.3);
}

.kx-tree-node:active .kx-tree-card {
  transform: scale(0.98);
}

/* HEAD OF CARD: ICON + NAME + TIME */
.kx-tree-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kx-tree-icon-badge {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.kx-tree-name-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.kx-tree-tier-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-heading);
  white-space: nowrap;
}

.kx-tree-time-tag {
  font-size: 0.64rem;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* REWARDS ROW */
.kx-tree-rewards {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.kx-reward-item {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.kx-reward-item.tv {
  color: var(--gold-glow);
}

.kx-reward-item.lt {
  color: var(--cyan-glow);
  font-size: 0.66rem;
}

.kx-reward-pill {
  font-size: 0.6rem;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 600;
  white-space: nowrap;
}

.kx-reward-pill.gold {
  background: rgba(255, 215, 0, 0.16);
  color: var(--gold-glow);
  border-color: rgba(255, 215, 0, 0.35);
}

/* ACTION MINI BUTTON */
.kx-tree-btn-sub {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 1px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.kx-tree-node:hover .kx-tree-btn-sub {
  color: #fff;
  transform: translateX(2px);
}

.kx-tree-btn-sub i {
  font-size: 0.58rem;
}

/* COLOR THEMES CHO TỪNG NHÁNH */
/* 1. Tiểu Định */
.kx-tree-node.tier-tieu .kx-tree-card {
  border-color: rgba(0, 229, 255, 0.3);
}
.kx-tree-node.tier-tieu:hover .kx-tree-card {
  border-color: var(--cyan-glow);
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.25);
}
.kx-tree-node.tier-tieu .kx-tree-icon-badge {
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan-glow);
  border: 1px solid rgba(0, 229, 255, 0.3);
}
.kx-tree-node.tier-tieu .kx-tree-bud {
  background: #00e5ff;
  box-shadow: 0 0 6px #00e5ff;
}
.kx-tree-node.tier-tieu .kx-tree-btn-sub {
  color: var(--cyan-glow);
}

/* 2. Thâm Thiền */
.kx-tree-node.tier-tham .kx-tree-card {
  border-color: rgba(255, 215, 0, 0.3);
}
.kx-tree-node.tier-tham:hover .kx-tree-card {
  border-color: var(--gold-glow);
  box-shadow: 0 4px 18px rgba(255, 215, 0, 0.25);
}
.kx-tree-node.tier-tham .kx-tree-icon-badge {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-glow);
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.kx-tree-node.tier-tham .kx-tree-bud {
  background: #ffd700;
  box-shadow: 0 0 6px #ffd700;
}
.kx-tree-node.tier-tham .kx-tree-btn-sub {
  color: var(--gold-glow);
}

/* 3. Đại Định */
.kx-tree-node.tier-dai .kx-tree-card {
  border-color: rgba(224, 64, 251, 0.35);
}
.kx-tree-node.tier-dai:hover .kx-tree-card {
  border-color: #e040fb;
  box-shadow: 0 4px 18px rgba(224, 64, 251, 0.3);
}
.kx-tree-node.tier-dai .kx-tree-icon-badge {
  background: rgba(224, 64, 251, 0.15);
  color: #e040fb;
  border: 1px solid rgba(224, 64, 251, 0.35);
}
.kx-tree-node.tier-dai .kx-tree-bud {
  background: #e040fb;
  box-shadow: 0 0 6px #e040fb;
}
.kx-tree-node.tier-dai .kx-tree-btn-sub {
  color: #e040fb;
}

/* 4. Ngộ Đạo */
.kx-tree-node.tier-ngo .kx-tree-card {
  border-color: rgba(249, 115, 22, 0.35);
}
.kx-tree-node.tier-ngo:hover .kx-tree-card {
  border-color: #f97316;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.3);
}
.kx-tree-node.tier-ngo .kx-tree-icon-badge {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}
.kx-tree-node.tier-ngo .kx-tree-bud {
  background: #fb923c;
  box-shadow: 0 0 6px #fb923c;
}
.kx-tree-node.tier-ngo .kx-tree-btn-sub {
  color: #fb923c;
}

/* 5. Tử Quan */
.kx-tree-node.tier-tu .kx-tree-card {
  border-color: rgba(16, 185, 129, 0.35);
}
.kx-tree-node.tier-tu:hover .kx-tree-card {
  border-color: #10b981;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.3);
}
.kx-tree-node.tier-tu .kx-tree-icon-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.kx-tree-node.tier-tu .kx-tree-bud {
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}
.kx-tree-node.tier-tu .kx-tree-btn-sub {
  color: #34d399;
}

/* 6. Niết Bàn */
.kx-tree-node.tier-luan .kx-tree-card {
  border-color: rgba(236, 72, 153, 0.45);
  background: linear-gradient(135deg, rgba(28, 12, 42, 0.88), rgba(12, 18, 32, 0.88));
}
.kx-tree-node.tier-luan:hover .kx-tree-card {
  border-color: #f472b6;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}
.kx-tree-node.tier-luan .kx-tree-icon-badge {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(147, 51, 234, 0.25));
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.45);
  text-shadow: 0 0 8px rgba(236, 72, 153, 0.6);
}
.kx-tree-node.tier-luan .kx-tree-bud {
  background: #f472b6;
  box-shadow: 0 0 6px #f472b6;
}
.kx-tree-node.tier-luan .kx-tree-btn-sub {
  color: #f472b6;
}

/* CHỈ DẪN TRỢ LỰC GỌN GÀNG (TICKER) */
.kx-bequan-tree-ticker {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden;
}

.kx-ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.kx-ticker-pill b,
.kx-ticker-pill span {
  font-weight: 500;
}

.kx-ticker-dot {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}

@media (max-width: 500px) {
  .kx-bequan-tree-ticker {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .kx-bequan-tree-ticker::-webkit-scrollbar {
    display: none;
  }
}


/* Giao diện Bế Quan Đang Chạy */
.kx-bequan-active-card {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 14px auto;
  background: rgba(10, 16, 28, 0.88);
  border: 1.5px solid var(--border-cyan);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(0,229,255,0.15);
  backdrop-filter: blur(16px);
}

.kx-bequan-zen-aura {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kx-bequan-zen-spin {
  font-size: 2.2rem;
  color: var(--cyan-glow);
  animation: kxSpin 12s linear infinite;
}

.kx-bequan-active-status {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.kx-bequan-countdown-wrap {
  margin: 6px 0;
}

.kx-bequan-countdown-digits {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--gold-glow);
  text-shadow: 0 0 15px rgba(255,215,0,0.5);
  letter-spacing: 2px;
}

.kx-bequan-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 12px 0;
}

.kx-bequan-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-glow), var(--gold-glow));
  transition: width 0.3s ease;
}

.kx-bequan-pause-notice {
  font-size: 0.74rem;
  color: #facc15;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  line-height: 1.35;
}

.kx-bequan-btn-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.kx-btn-cancel-med {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.2s;
}
.kx-btn-cancel-med:hover {
  border-color: #f43f5e;
  color: #f43f5e;
}

.kx-bequan-footer-notice {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  max-width: 480px;
  margin: 0 auto;
}

/* Banner Bế Quan trên Động Phủ */
.kx-cave-meditation-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(10, 16, 28, 0.88);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(224, 64, 251, 0.6);
  border-radius: 24px;
  box-shadow: 0 0 15px rgba(224, 64, 251, 0.35);
  margin-top: 6px;
  cursor: pointer;
  animation: kxPulse 3s infinite;
  z-index: 20;
}
.kx-cave-med-icon {
  font-size: 1.1rem;
  color: #e040fb;
}
.kx-cave-med-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.kx-cave-med-lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-weight: 600;
}
.kx-cave-med-timer {
  font-size: 0.88rem;
  color: var(--gold-glow);
  font-family: var(--font-heading);
}
.kx-cave-med-btn {
  font-size: 0.72rem;
  color: var(--cyan-glow);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Action Bar Thổ Nạp khi đang bế quan */
.kx-bottom-action-btn.action-tap.is-meditating {
  opacity: 0.45;
  filter: grayscale(0.6);
  cursor: not-allowed;
}

/* =============================================================================
   TÚI ĐAN DƯỢC & BỘ CHỌN SỐ LƯỢNG PHỤC DỤNG (BATCH CONSUME)
   ============================================================================= */
.kx-dan-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(10, 16, 28, 0.75);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 12px auto;
}
.kx-dan-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kx-dan-hero-icon-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 230, 118, 0.15);
  border: 1.5px solid var(--emerald-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-glow);
  font-size: 1.25rem;
}
.kx-dan-hero-name {
  color: var(--emerald-glow);
  font-size: 1rem;
  display: block;
}
.kx-dan-hero-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.kx-dan-hero-right {
  text-align: right;
}
.kx-dan-hero-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}
.kx-dan-hero-count {
  font-size: 1.35rem;
  color: var(--gold-glow);
  font-family: var(--font-heading);
}

.kx-dan-batch-box {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 12px auto;
  background: rgba(10, 16, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  box-sizing: border-box;
}
.kx-dan-batch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 6px;
}
.kx-dan-safe-badge {
  font-size: 0.72rem;
  color: var(--cyan-glow);
  background: rgba(0, 229, 255, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.25);
}
.kx-dan-stepper-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0;
}
.kx-dan-step-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}
.kx-dan-step-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--cyan-glow);
}
.kx-dan-input-box {
  position: relative;
  width: 110px;
}
.kx-dan-input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid var(--border-gold);
  border-radius: 10px;
  color: var(--gold-glow);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  padding: 6px 26px 6px 6px;
  outline: none;
  box-sizing: border-box;
}
.kx-dan-input-unit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
}
.kx-dan-preset-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.kx-dan-preset-pill {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
}
.kx-dan-preset-pill:hover,
.kx-dan-preset-pill.active {
  background: rgba(255, 215, 0, 0.22);
  border-color: var(--gold-glow);
  color: var(--gold-glow);
}
.kx-dan-preset-pill.max-pill {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}
.kx-dan-preset-pill.max-pill.active {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
}

.kx-dan-preview-card {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 8px;
  text-align: left;
}
.kx-dan-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kx-dan-pv-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.kx-dan-pv-gain {
  font-size: 0.88rem;
  color: var(--gold-glow);
  font-family: var(--font-heading);
}

.kx-dan-risk-indicator {
  font-size: 0.72rem;
  line-height: 1.35;
  margin-top: 5px;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.kx-dan-risk-indicator.safe {
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.kx-dan-risk-indicator.danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.kx-dan-action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 10px auto;
}
.kx-btn-consume-large {
  padding: 10px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.kx-dan-footer-lore {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.4;
  max-width: 500px;
  margin: 0 auto;
}

/* =============================================================================
   THANH LÂU CÁC: HỆ THỐNG GIAO DIỆN CHUẨN MỰC KHOA HỌC & ĐỒNG BỘ 1 VIEW
   ============================================================================= */

/* 1. Header Deck (Tích hợp Banner + Túi Tiền + Chuyển Khu Vực + Tiêu Điểm) */
.kx-tl-header-deck {
  width: 100%;
  max-width: 1040px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.14) 0%, rgba(168, 85, 247, 0.08) 50%, rgba(10, 14, 23, 0.95) 100%);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.kx-tl-deck-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.kx-tl-deck-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kx-tl-deck-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ec4899;
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.kx-tl-deck-title {
  color: var(--gold-glow);
  font-size: 1.15rem;
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
}

.kx-tl-deck-purse {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 16px;
  padding: 3px 12px;
}

.kx-tl-deck-purse .purse-lbl {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.kx-tl-deck-purse .purse-val {
  font-size: 1.15rem;
  color: var(--gold-glow);
  font-family: var(--font-heading);
}

.kx-tl-deck-purse .purse-unit {
  font-size: 0.76rem;
  color: var(--cyan-glow);
}

.kx-tl-deck-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.kx-tl-target-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 3px 12px;
}

/* 2. Layout 2 Cột Cân Đối Khoa Học */
.kx-tl-single-view-container {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 16px;
  align-items: start;
  width: 100%;
  max-width: 1040px;
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .kx-tl-single-view-container {
    grid-template-columns: 1fr;
  }
}

/* Mandala Arena Cột Trái */
.kx-tl-mandala-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kx-tl-mandala-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 480px;
  margin: 0 auto;
  background: radial-gradient(circle at center, rgba(236, 72, 153, 0.12) 0%, rgba(10, 14, 23, 0.96) 72%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85), inset 0 0 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.kx-tl-mandala-decor {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 1px dashed rgba(236, 72, 153, 0.25);
  pointer-events: none;
  animation: kxSpin 60s linear infinite;
}

/* 4 Thẻ Vuông Ở 4 Góc Sát Nhau */
.kx-tl-petal {
  position: absolute;
  width: calc(50% - 4px);
  height: calc(50% - 4px);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #050811;
  z-index: 2;
}

.kx-tl-petal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.4s ease;
}

.kx-tl-petal:hover img {
  transform: scale(1.06);
}

.kx-tl-petal:hover {
  transform: scale(1.02);
  z-index: 4;
}

.kx-tl-petal.top-left {
  top: 2px;
  left: 2px;
}
.kx-tl-petal.top-left.active {
  border-color: #a855f7 !important;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.85) !important;
  transform: scale(1.02);
  z-index: 3;
}

.kx-tl-petal.top-right {
  top: 2px;
  right: 2px;
}
.kx-tl-petal.top-right.active {
  border-color: #ec4899 !important;
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.85) !important;
  transform: scale(1.02);
  z-index: 3;
}

.kx-tl-petal.bottom-left {
  bottom: 2px;
  left: 2px;
}
.kx-tl-petal.bottom-left.active {
  border-color: #f59e0b !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.85) !important;
  transform: scale(1.02);
  z-index: 3;
}

.kx-tl-petal.bottom-right {
  bottom: 2px;
  right: 2px;
}
.kx-tl-petal.bottom-right.active {
  border-color: #10b981 !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.85) !important;
  transform: scale(1.02);
  z-index: 3;
}

.kx-tl-petal-label {
  position: absolute;
  left: 0;
  right: 0;
  padding: 8px 12px;
  pointer-events: none;
  z-index: 3;
}

/* 2 hình vuông Ở TRÊN: Đặt tên / nhãn Ở TRÊN */
.kx-tl-petal.top-left .kx-tl-petal-label,
.kx-tl-petal.top-right .kx-tl-petal-label {
  top: 0;
  bottom: auto;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.65) 60%, transparent 100%);
  padding-top: 10px;
  padding-bottom: 18px;
}

/* 2 hình vuông Ở DƯỚI: Đặt tên / nhãn Ở DƯỚI */
.kx-tl-petal.bottom-left .kx-tl-petal-label,
.kx-tl-petal.bottom-right .kx-tl-petal-label {
  bottom: 0;
  top: auto;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.65) 60%, transparent 100%);
  padding-bottom: 10px;
  padding-top: 18px;
}

/* Căn Trái / Phải theo bên */
.kx-tl-petal.top-left .kx-tl-petal-label,
.kx-tl-petal.bottom-left .kx-tl-petal-label {
  text-align: left !important;
  padding-left: 12px;
  padding-right: 8px;
}
.kx-tl-petal.top-left .kx-tl-petal-title,
.kx-tl-petal.top-left .kx-tl-petal-name,
.kx-tl-petal.bottom-left .kx-tl-petal-title,
.kx-tl-petal.bottom-left .kx-tl-petal-name {
  text-align: left !important;
  display: block;
  width: 100%;
}

.kx-tl-petal.top-right .kx-tl-petal-label,
.kx-tl-petal.bottom-right .kx-tl-petal-label {
  text-align: right !important;
  padding-right: 12px;
  padding-left: 8px;
}
.kx-tl-petal.top-right .kx-tl-petal-title,
.kx-tl-petal.top-right .kx-tl-petal-name,
.kx-tl-petal.bottom-right .kx-tl-petal-title,
.kx-tl-petal.bottom-right .kx-tl-petal-name {
  text-align: right !important;
  display: block;
  width: 100%;
}

.kx-tl-petal-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kx-tl-petal-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-heading);
  white-space: nowrap;
}

/* HÌNH TRÒN Ở GIỮA: TÚ BÀ / TÚ ÔNG (BOSS) */
.kx-tl-center-boss {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 152px;
  height: 152px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.6), 0 0 0 4px rgba(244, 63, 94, 0.35);
  border: 3px solid #f43f5e;
  z-index: 5;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: #000;
  animation: kxPulseCenter 3s infinite ease-in-out;
}

.kx-tl-center-boss:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 0 45px rgba(244, 63, 94, 0.9), 0 0 0 5px rgba(234, 179, 8, 0.8);
  border-color: #eab308;
}

.kx-tl-center-boss.active {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 0 45px rgba(244, 63, 94, 0.95), 0 0 0 5px #ffd700 !important;
  border-color: #ffd700 !important;
}

.kx-tl-center-boss img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: transform 0.4s ease;
}

.kx-tl-center-boss-tag {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 23, 0.96);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.85);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 215, 0, 0.4);
  pointer-events: none;
  max-width: 95%;
  text-align: center;
  z-index: 6;
}

.kx-tl-stage-hint {
  text-align: center;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 3. CỘT PHẢI: KHUNG ĐIỀU HƯỚNG TỔNG THỂ & 3 TABS KHOA HỌC */
.kx-tl-content-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kx-tl-nav-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-around;
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  box-sizing: border-box;
}

.kx-tl-nav-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 2px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
  position: relative;
}

.kx-tl-nav-tab-btn i {
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.kx-tl-nav-tab-btn span {
  font-size: 0.68rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kx-tl-nav-tab-btn:hover {
  color: #fff;
  opacity: 0.9;
  background: transparent !important;
}

.kx-tl-nav-tab-btn:hover i {
  filter: drop-shadow(0 0 6px currentColor);
}

.kx-tl-nav-tab-btn.active {
  background: transparent !important;
  color: #fff;
  box-shadow: none !important;
  opacity: 1;
}

.kx-tl-nav-tab-btn.active i {
  filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 14px currentColor);
  transform: scale(1.12);
}

.kx-tl-nav-tab-btn.active span {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 64, 129, 0.8), 0 0 16px rgba(255, 64, 129, 0.4);
}

.kx-tl-nav-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: #ff4081;
  box-shadow: 0 0 8px #ff4081;
  border-radius: 2px;
}

/* 4. Khung Thân Của Mỗi Panel (Đồng Nhất Kích Thước & Chiều Cao) */
.kx-tl-panel-card {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 16px;
  padding: 12px 14px;
  height: 388px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.kx-tl-panel-card.theme-cyan {
  border-color: rgba(0, 229, 255, 0.35);
}

.kx-tl-panel-card.theme-purple {
  border-color: rgba(168, 85, 247, 0.35);
}

/* Panel Scroll Body (Custom Slim Scrollbar) */
.kx-tl-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.35) transparent;
  padding-right: 4px;
}

.kx-tl-scroll-body.cyan-scroll {
  scrollbar-color: rgba(0, 229, 255, 0.35) transparent;
}

.kx-tl-scroll-body.purple-scroll {
  scrollbar-color: rgba(168, 85, 247, 0.35) transparent;
}

/* Các thành phần chi tiết của Panel 1 */
.kx-tl-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.kx-tl-active-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kx-tl-active-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ec4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

.kx-tl-chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  margin-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.3) transparent;
}

.kx-tl-quick-actions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.kx-tl-quick-actions::-webkit-scrollbar {
  display: none;
}

.kx-tl-quick-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 4px 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.kx-tl-quick-btn:hover {
  background: rgba(236, 72, 153, 0.2);
  border-color: #ec4899;
  color: #fff;
}

.kx-tl-input-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.kx-tl-input-bar input {
  flex: 1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 7px 12px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.kx-tl-input-bar input:focus {
  border-color: #ec4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.kx-tl-send-btn {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  border: none;
  border-radius: 12px;
  padding: 7px 14px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.kx-tl-send-btn:hover {
  opacity: 0.95;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

.kx-tl-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.kx-tl-active-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kx-tl-active-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ec4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

/* =============================================================================
   11. CHUẨN HÓA MODAL THIÊN THƯ ĐẠO TỊCH (TU NHÂN · ĐẠO TỊCH · CÀI ĐẶT)
   Thiết kế gọn gàng, quý phái, tên đặt ngay dưới avatar, tinh giản không gian
   ============================================================================= */
.kx-unimodal-box {
  max-width: 440px !important;
  width: 94% !important;
  padding: 14px 16px !important;
  border-radius: 16px !important;
  background: rgba(10, 14, 23, 0.98) !important;
  border: 1.5px solid var(--border-gold) !important;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 215, 0, 0.25) !important;
}

.kx-unimodal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 215, 0, 0.25);
}

.kx-unimodal-title {
  color: var(--gold-glow);
  font-size: 1.08rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
}

.kx-unimodal-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--cyan-glow);
  font-weight: 700;
  font-family: var(--font-body, inherit);
  letter-spacing: 0.5px;
}

.kx-unimodal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}

.kx-unimodal-close:hover {
  color: #ff5252;
}

/* 3 TAB NAVIGATION ĐỒNG BỘ */
.kx-profile-tabs-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 3px !important;
  border-radius: 10px !important;
  margin-bottom: 12px !important;
}

.kx-profile-tab-pill {
  flex: 1 1 0 !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  font-family: var(--font-heading) !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

.kx-profile-tab-pill:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.kx-profile-tab-pill.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(0, 176, 255, 0.15) 100%) !important;
  border: 1px solid var(--cyan-glow) !important;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.35) !important;
}

/* KHUNG NỘI DUNG 3 TAB CO GIÃN THÔNG MINH */
.kx-profile-tab-panel {
  display: none;
  max-height: calc(85vh - 120px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 2px !important;
}

.kx-profile-tab-panel.active {
  display: block !important;
  animation: kxProfileTabFade 0.22s ease forwards !important;
}

.kx-profile-tab-panel::-webkit-scrollbar {
  width: 5px;
}
.kx-profile-tab-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.25);
  border-radius: 4px;
}
.kx-profile-tab-panel::-webkit-scrollbar-track {
  background: transparent;
}

/* THẺ CHUẨN MỰC BÊN TRONG CÁC TAB */
.kx-unimodal-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color 0.2s ease;
}

.kx-unimodal-card:hover {
  border-color: rgba(0, 229, 255, 0.25);
}

.kx-unimodal-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-glow);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ==================== TAB 1: TU NHÂN HERO CARD ==================== */
.kx-profile-hero-card {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.07) 0%, rgba(0, 229, 255, 0.03) 100%);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 14px;
  padding: 14px 12px 10px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.kx-profile-avatar-wrap {
  position: relative;
  margin-bottom: 8px;
}

.kx-profile-avatar-preview {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2.5px solid var(--gold-glow);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  margin-bottom: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kx-profile-avatar-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.65);
}

.kx-profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kx-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-glow);
  color: #0b0f19;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  border: 2px solid #0b0f19;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.kx-profile-name-box {
  width: 100%;
  max-width: 260px;
  margin-bottom: 6px;
}

.kx-profile-name-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kx-profile-name-input {
  width: 100%;
  height: 36px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  padding: 0 30px 0 12px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.kx-profile-name-input:focus {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
  background: rgba(0, 0, 0, 0.75);
}

.kx-profile-name-pen {
  position: absolute;
  right: 10px;
  color: var(--gold-glow);
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.kx-profile-name-pen:hover {
  opacity: 1;
}

.kx-profile-title-row {
  display: flex;
  justify-content: center;
  align-items: center;
}

.kx-profile-title-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.22) 0%, rgba(147, 51, 234, 0.16) 100%);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #f3e8ff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.2);
}

.kx-profile-title-badge-btn:hover {
  transform: translateY(-1px);
  border-color: #c084fc;
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.4);
  color: #fff;
}

.kx-title-change-tag {
  font-size: 0.65rem;
  color: var(--gold-glow);
  background: rgba(255, 215, 0, 0.15);
  padding: 1px 6px;
  border-radius: 5px;
  margin-left: 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* KHỐI CHỌN PHÁP TƯỚNG (ICONS) */
.kx-avatar-icons-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.kx-avatar-icons-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.kx-avatar-icons-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kx-avatar-actions-group {
  display: flex;
  gap: 6px;
}

.kx-avatar-subbtn {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--border-cyan);
  color: var(--cyan-glow);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kx-avatar-subbtn:hover {
  background: var(--cyan-glow);
  color: #0b0f19;
}

.kx-avatar-subbtn.reset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
}

.kx-avatar-subbtn.reset:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.kx-avatar-icon-grid-5 {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.kx-avatar-icon-choice {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.kx-avatar-icon-choice:hover {
  border-color: var(--cyan-glow);
  color: var(--cyan-glow);
  background: rgba(0, 229, 255, 0.12);
}

.kx-avatar-icon-choice.active {
  border-color: var(--gold-glow);
  color: var(--gold-glow);
  background: rgba(255, 215, 0, 0.2);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}

@media (max-width: 440px) {
  .kx-avatar-icon-grid-5 {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .kx-avatar-icon-choice {
    height: 32px;
  }
}

/* NÚT LƯU PROFILE */
.kx-profile-save-btn {
  width: 100%;
  height: 36px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 3 CHỈ SỐ CƠ BẢN */
.kx-profile-3stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.kx-profile-stat-item {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.kx-profile-stat-item i {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.kx-stat-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kx-stat-label {
  font-size: 0.64rem;
  color: var(--text-muted);
  line-height: 1.1;
}

.kx-stat-value {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== TAB 2: ĐẠO TỊCH ==================== */
.kx-account-info-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kx-account-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kx-account-lbl {
  color: var(--text-muted);
}

.kx-account-val {
  color: #fff;
}

.kx-account-role-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.74rem;
}

.kx-account-role-badge.role-super {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold-glow);
  border: 1px solid var(--border-gold);
}

.kx-account-role-badge.role-admin {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan-glow);
  border: 1px solid var(--border-cyan);
}

.kx-account-role-badge.role-user {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.kx-account-verify-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.kx-verify-status-badge.verified {
  color: var(--emerald-glow);
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kx-verify-prompt {
  color: var(--gold-glow);
  font-size: 0.74rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kx-verify-input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.kx-verify-input {
  flex: 1;
  height: 32px;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  color: #fff;
  text-align: center;
  letter-spacing: 2px;
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
}

.kx-verify-btn {
  height: 32px;
  padding: 0 10px;
  font-size: 0.74rem;
}

.kx-verify-msg {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.kx-verify-empty {
  color: var(--text-muted);
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kx-pwd-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.kx-pwd-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}

.kx-pwd-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
  outline: none;
  box-sizing: border-box;
}

.kx-pwd-input:focus {
  border-color: var(--cyan-glow);
}

.kx-pwd-msg {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kx-change-pwd-btn {
  width: 100%;
  height: 34px;
  font-size: 0.76rem;
  font-weight: 700;
  justify-content: center;
}

.kx-logout-btn {
  width: 100%;
  height: 36px;
  font-size: 0.8rem;
  border-radius: 8px;
  background: rgba(255, 23, 68, 0.12);
  border: 1px solid rgba(255, 23, 68, 0.45);
  color: #ff5252;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kx-logout-btn:hover {
  background: rgba(255, 23, 68, 0.22);
  border-color: #ff5252;
  color: #ff1744;
}

/* ==================== TAB 3: CÀI ĐẶT ==================== */
.kx-settings-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s ease;
}

.kx-settings-item-card:hover {
  border-color: rgba(0, 229, 255, 0.2);
}

.kx-settings-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kx-settings-item-icon {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kx-settings-item-icon.sound {
  background: rgba(0, 230, 118, 0.15);
  color: var(--emerald-glow);
}

.kx-settings-item-icon.particles {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan-glow);
}

.kx-settings-item-icon.shake {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold-glow);
}

.kx-settings-item-icon.version {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
}

.kx-settings-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.kx-settings-item-desc {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.kx-settings-toggle-btn {
  width: 84px;
  height: 30px;
  font-size: 0.72rem;
  border-radius: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.kx-settings-toggle-btn.active {
  background: rgba(0, 230, 118, 0.2);
  border-color: #00e676;
  color: #00e676;
}

.kx-settings-toggle-btn.cyan {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--cyan-glow);
  color: var(--cyan-glow);
}

.kx-settings-toggle-btn.gold {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--gold-glow);
  color: var(--gold-glow);
}

/* ĐIỆN PHONG DANH OVERLAY TRÊN CÙNG KHI MỞ TỪ MODAL TU NHÂN */
#titles-modal {
  z-index: 1050 !important;
}

/* Tương thích legacy */
.kx-unimodal-avatar-preview {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2.5px solid var(--gold-glow);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  margin-bottom: 8px;
  cursor: pointer;
}
.kx-unimodal-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.kx-profile-summary-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
.kx-profile-stat-card {
  min-height: 52px !important;
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 9px !important;
  padding: 7px 10px !important;
}
.kx-profile-stat-icon {
  font-size: 1.15rem !important;
  flex-shrink: 0 !important;
}
.kx-profile-stat-info {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}
.kx-profile-stat-lbl {
  font-size: 0.68rem !important;
  color: var(--text-muted) !important;
  line-height: 1.2 !important;
}
.kx-profile-stat-val {
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* =============================================================================
   12. MODULE 2: LỊCH LUYỆN - THIẾT KẾ CÂN ĐỐI VỪA 1 VIEW (MOBILE & TABLET)
   Bao gồm:
   1. Du Ngoạn Bát Hoang (kx-view-travel)
   2. Lò Bát Quái Luyện Đan (kx-view-alchemy)
   3. Vấn Đạo Thiên Cơ (kx-view-divination)
   ============================================================================= */

/* ĐỒNG BỘ BODY CỦA CẢ 3 VIEW LỊCH LUYỆN: CỐ ĐỊNH VỪA 1 VIEW MÀN HÌNH */
.kx-view-travel .kx-feature-modal-body,
.kx-view-alchemy .kx-feature-modal-body,
.kx-view-divination .kx-feature-modal-body {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 6px 12px calc(var(--kx-bottom-dock-h, 52px) + 8px + env(safe-area-inset-bottom, 0px)) 12px !important;
  box-sizing: border-box !important;
  gap: 8px !important;
}

@media (max-height: 520px) {
  .kx-view-travel .kx-feature-modal-body,
  .kx-view-alchemy .kx-feature-modal-body,
  .kx-view-divination .kx-feature-modal-body {
    overflow-y: auto !important;
  }
}

/* -----------------------------------------------------------------------------
   A. DU NGOẠN BÁT HOANG (kx-view-travel)
   ----------------------------------------------------------------------------- */
.kx-active-voyage-card {
  width: 100%;
  max-width: 860px;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12) 0%, rgba(10, 14, 23, 0.94) 100%);
  border: 1.5px solid var(--border-cyan);
  border-radius: 12px;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 229, 255, 0.15);
  flex-shrink: 0;
}

.kx-voyage-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.kx-voyage-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1.5px solid var(--cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-glow);
  font-size: 1.1rem;
  animation: kxPulse 2s infinite;
  flex-shrink: 0;
}

.kx-voyage-text {
  min-width: 0;
}

.kx-voyage-lbl {
  font-size: 0.68rem;
  color: var(--cyan-glow);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
  line-height: 1.1;
  white-space: nowrap;
}

.kx-voyage-realm {
  color: var(--gold-glow);
  font-size: 0.95rem;
  margin: 1px 0 0 0;
  font-family: var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.kx-voyage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kx-voyage-timer {
  font-size: clamp(0.82rem, 1.1vw + 0.5vh, 1.15rem);
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--gold-glow);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  line-height: 1.2;
  white-space: nowrap;
}

.kx-voyage-done-badge,
.kx-alchemy-done-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-glow);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.kx-btn-claim-voyage {
  width: auto !important;
  min-width: unset !important;
  height: auto !important;
  padding: 6px 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  background: linear-gradient(135deg, #ffd700 0%, #ff9800 100%) !important;
  color: #1a0f00 !important;
  border: none !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.5) !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, filter 0.2s ease !important;
  animation: pulseGold 2s infinite ease-in-out !important;
}

.kx-btn-claim-voyage:hover {
  filter: brightness(1.15);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.75) !important;
}

.kx-btn-claim-pill {
  width: auto !important;
  min-width: unset !important;
  height: auto !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: linear-gradient(135deg, #ffd700 0%, #ff9800 100%) !important;
  color: #1a0f00 !important;
  border: none !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4) !important;
  cursor: pointer !important;
  animation: pulseGold 2s infinite ease-in-out !important;
}

@media (max-width: 480px) {
  .kx-active-voyage-card {
    padding: 6px 10px;
    gap: 8px;
  }
  .kx-voyage-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .kx-voyage-lbl {
    font-size: 0.62rem;
  }
  .kx-voyage-realm {
    font-size: 0.85rem;
  }
  .kx-voyage-timer {
    font-size: 0.8rem;
  }
  .kx-btn-claim-voyage {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    gap: 4px !important;
  }
}

.kx-btn-cancel-voyage {
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
  padding: 5px 10px !important;
  white-space: nowrap;
}

/* Grid & Bản Đồ Bát Hoang Thập Đại Cấm Địa */
.kx-travel-header-bar {
  width: 100%;
  max-width: 560px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  margin: 0 auto;
  box-sizing: border-box;
  font-family: var(--font-heading);
}

.kx-travel-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--cyan-glow);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.kx-travel-subtitle {
  font-size: 0.72rem;
  color: var(--gold-glow);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.35);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
}

/* =============================================================================
   BẢN ĐỒ TIÊN ĐỒ BÁT HOANG DỌC (TỪ DƯỚI LÊN TRÊN - MOBILE & TABLET OPTIMIZED)
   ============================================================================= */
.kx-travel-map-wrap.kx-travel-map-vertical {
  width: 100%;
  max-width: 560px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 16px;
  border: 1.5px solid rgba(0, 229, 255, 0.25);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9), 0 6px 25px rgba(0, 0, 0, 0.7);
  background: #060a12;
  box-sizing: border-box;
  margin: 0 auto;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.kx-travel-map-wrap.kx-travel-map-vertical::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Ẩn thanh cuộn ở các màn hình chính để tạo cảm giác liền mạch, vô tận */
.kx-travel-map-wrap,
.kx-view-travel .kx-feature-modal-body,
.kx-view-dongphu .kx-feature-modal-body,
.kx-view-bequan .kx-feature-modal-body,
.kx-view-danduoc .kx-feature-modal-body {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.kx-travel-map-wrap::-webkit-scrollbar,
.kx-view-travel .kx-feature-modal-body::-webkit-scrollbar,
.kx-view-dongphu .kx-feature-modal-body::-webkit-scrollbar,
.kx-view-bequan .kx-feature-modal-body::-webkit-scrollbar,
.kx-view-danduoc .kx-feature-modal-body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.kx-travel-map-canvas {
  position: relative;
  width: 100%;
  height: 1250px;
  min-height: 1250px;
  display: block;
}

.kx-travel-map-bg {
  position: absolute;
  inset: 0;
  background-image: url('/static/img/floating_xianxia_mountains.jpg');
  background-size: cover;
  background-position: center bottom;
  opacity: 0.28;
  filter: contrast(1.15) saturate(1.2);
  pointer-events: none;
}

.kx-travel-map-clouds {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(0, 230, 118, 0.12) 0%, transparent 60%),
              radial-gradient(circle at 30% 50%, rgba(0, 229, 255, 0.1) 0%, transparent 60%),
              radial-gradient(circle at 70% 90%, rgba(118, 255, 3, 0.1) 0%, transparent 60%),
              radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.2) 0%, rgba(6, 10, 18, 0.75) 100%);
  pointer-events: none;
}

/* Đỉnh Cửu Trùng Thiên & Chân Núi Hồng Trần */
.kx-map-celestial-pinnacle {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
}

.kx-pinnacle-tag {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.25), rgba(0, 0, 0, 0.85));
  border: 1px solid rgba(0, 230, 118, 0.6);
  color: #69f0ae;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}

.kx-map-mortal-base {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
}

.kx-mortal-tag {
  background: linear-gradient(135deg, rgba(118, 255, 3, 0.2), rgba(0, 0, 0, 0.85));
  border: 1px solid rgba(118, 255, 3, 0.5);
  color: #b2ff59;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(118, 255, 3, 0.25);
}

.kx-travel-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.kx-map-trail-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 6 10;
}

.kx-map-trail-active {
  fill: none;
  stroke: url(#kxDragonVeinVertical);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 8 6;
  animation: kxDragonTrailVertical 20s linear infinite;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.7));
}

@keyframes kxDragonTrailVertical {
  from { stroke-dashoffset: 200; }
  to { stroke-dashoffset: 0; }
}

.kx-travel-map-waypoints {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
}

/* Từng Cột Mốc Bí Cảnh Trên Đường Leo Núi */
.kx-map-waypoint {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.2s ease;
  z-index: 3;
}

.kx-map-waypoint:hover {
  transform: translate(-50%, -56%) scale(1.12);
  z-index: 10;
}

.kx-wp-aura {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--wp-accent, rgba(0, 229, 255, 0.45)) 0%, transparent 70%);
  opacity: 0.65;
  animation: kxWpPulseVertical 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes kxWpPulseVertical {
  0%, 100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.45; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.9; }
}

.kx-wp-marker {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 28, 48, 0.96) 0%, rgba(6, 10, 18, 0.98) 100%);
  border: 2px solid var(--wp-accent, var(--border-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 14px var(--wp-accent, rgba(0, 229, 255, 0.45));
  font-size: 1.15rem;
  color: var(--wp-accent, #00e5ff);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kx-map-waypoint:hover .kx-wp-marker {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.9), 0 0 25px var(--wp-accent, rgba(0, 229, 255, 0.85));
}

.kx-wp-roman {
  position: absolute;
  top: -9px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--wp-accent, var(--border-gold));
  color: var(--gold-glow);
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0 6px;
  border-radius: 6px;
  line-height: 1.25;
}

.kx-wp-lock-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(18, 22, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.kx-wp-sword-flight {
  position: absolute;
  top: -15px;
  right: -10px;
  color: var(--gold-glow);
  font-size: 1rem;
  filter: drop-shadow(0 0 8px var(--gold-glow));
  animation: kxSwordBobVertical 1.6s ease-in-out infinite;
}

@keyframes kxSwordBobVertical {
  0%, 100% { transform: translateY(0) rotate(-15deg); }
  50% { transform: translateY(-5px) rotate(-5deg); }
}

.kx-map-waypoint.is-locked .kx-wp-marker {
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #64748b !important;
  box-shadow: none !important;
  filter: grayscale(85%);
}

.kx-map-waypoint.is-locked .kx-wp-aura {
  display: none;
}

.kx-map-waypoint.is-traveling .kx-wp-marker {
  border-color: var(--gold-glow) !important;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.9) !important;
  color: var(--gold-glow) !important;
}

.kx-wp-label-plate {
  margin-top: 6px;
  background: rgba(6, 10, 18, 0.92);
  border: 1px solid var(--wp-accent, rgba(0, 229, 255, 0.35));
  border-radius: 12px;
  padding: 3px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.kx-wp-name {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.kx-wp-time {
  font-size: 0.6rem;
  color: var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* =============================================================================
   CHIẾU GIÁM BÍ CẢNH (SCENIC REALM INSPECTOR POPUP & ELEGANT EMBARK BUTTON)
   ============================================================================= */
.kx-realm-inspector {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  animation: kxInspectorFadeIn 0.25s ease-out;
}

@keyframes kxInspectorFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.kx-realm-inspector-box {
  width: 100%;
  max-width: 440px;
  background: #090e18;
  border: 1.5px solid var(--border-gold, #ffd700);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9), 0 0 25px rgba(255, 215, 0, 0.2);
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
}

.kx-realm-inspector-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s;
}

.kx-realm-inspector-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

.kx-realm-inspector-hero {
  position: relative;
  height: 145px;
  background-size: cover;
  background-position: center center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 14px;
  box-sizing: border-box;
}

.kx-realm-inspector-hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 14, 24, 0.25) 0%, rgba(9, 14, 24, 0.85) 75%, #090e18 100%);
  pointer-events: none;
}

.kx-realm-inspector-hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kx-inspector-tier-badge {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--border-gold, #ffd700);
  color: var(--gold-glow);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.kx-inspector-time-badge {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kx-realm-inspector-hero-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kx-inspector-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(6, 10, 18, 0.9);
  border: 2px solid var(--cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--cyan-glow);
  flex-shrink: 0;
}

.kx-inspector-title-text h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px #000;
}

.kx-inspector-realm-req {
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--cyan-glow);
  border-radius: 6px;
  padding: 1px 6px;
  display: inline-block;
  margin-top: 3px;
  background: rgba(0, 0, 0, 0.6);
}

.kx-realm-inspector-body {
  padding: 12px 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.kx-inspector-desc-wrap {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--border-gold, #ffd700);
  border-radius: 8px;
  padding: 8px 10px;
}

.kx-inspector-desc-label {
  font-size: 0.65rem;
  color: var(--gold-glow);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kx-inspector-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #cbd5e1;
  font-style: italic;
}

.kx-inspector-rewards-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kx-inspector-reward-col {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
}

.kx-reward-col-lbl {
  font-size: 0.66rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kx-reward-col-val {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fff;
}

/* NÚT KHỞI HÀNH TINH TẾ CHUẨN TIÊN HIỆP */
.kx-inspector-action-wrap {
  margin-top: 4px;
}

.kx-btn-xianxia-embark {
  position: relative;
  width: 100%;
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.kx-btn-xianxia-embark.is-ready {
  background: linear-gradient(135deg, #0d3b66 0%, #00a896 50%, #028090 100%);
  border: 1.5px solid var(--border-gold, #ffd700);
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
  box-shadow: 0 4px 18px rgba(0, 168, 150, 0.5), 0 0 15px rgba(255, 215, 0, 0.35);
}

.kx-btn-xianxia-embark.is-ready:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #134e8a 0%, #00c4af 50%, #029db0 100%);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.7), 0 0 20px rgba(255, 215, 0, 0.6);
}

.kx-btn-xianxia-embark.is-ready:active {
  transform: translateY(1px);
}

.kx-btn-xianxia-embark.is-traveling {
  background: rgba(255, 215, 0, 0.15);
  border: 1.5px solid var(--gold-glow);
  color: var(--gold-glow);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
  cursor: not-allowed;
}

.kx-btn-xianxia-embark.is-disabled {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  cursor: not-allowed;
}

.kx-btn-xianxia-embark.is-locked {
  background: rgba(20, 24, 34, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  cursor: not-allowed;
}

.kx-btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-25deg);
  animation: kxShineSweep 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes kxShineSweep {
  0% { left: -100%; }
  35%, 100% { left: 200%; }
}

/* -----------------------------------------------------------------------------
   B. LÒ BÁT QUÁI LUYỆN ĐAN (kx-view-alchemy)
   ----------------------------------------------------------------------------- */
.kx-alchemy-container {
  width: 100%;
  max-width: 860px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .kx-alchemy-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 14px;
    align-items: stretch;
  }
}

.kx-alchemy-furnace-stage {
  background: rgba(10, 14, 23, 0.75);
  border: 1.5px solid rgba(255, 109, 0, 0.35);
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .kx-alchemy-furnace-stage {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    height: 125px;
  }
}

.kx-furnace-body-compact {
  position: relative;
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .kx-furnace-body-compact {
    width: 110px;
    height: 110px;
    margin: 8px auto;
  }
}

.kx-furnace-img-compact {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.kx-furnace-meta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  min-width: 0;
}

@media (max-width: 767px) {
  .kx-furnace-meta-wrap {
    align-items: flex-start;
    text-align: left;
    flex: 1 1 auto;
  }
}

.kx-furnace-title-compact {
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--gold-glow);
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(255, 109, 0, 0.7);
  white-space: nowrap;
}

#active-alchemy-box {
  background: rgba(0, 0, 0, 0.82) !important;
  border: 1.5px solid var(--border-gold) !important;
  border-radius: 10px !important;
  padding: 6px 12px !important;
  width: 100% !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
  box-shadow: 0 0 20px rgba(255, 109, 0, 0.35) !important;
  margin: 4px 0 !important;
}

.kx-active-alchemy-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#active-recipe-name {
  color: var(--gold-glow);
  font-size: 0.85rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#active-alchemy-timer {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  font-family: var(--font-heading) !important;
  color: var(--cyan-glow) !important;
  margin: 0 !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.kx-alchemy-stocks {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.kx-stock-pill {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.kx-alchemy-recipes-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

#alchemy-recipes-grid {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 6px !important;
  height: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.kx-recipe-card-compact {
  background: rgba(16, 24, 40, 0.85);
  border: 1.2px solid var(--recipe-accent, var(--border-cyan));
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 0;
  min-height: 0;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kx-recipe-card-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 10px var(--recipe-accent, rgba(0, 229, 255, 0.3));
}

.kx-recipe-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.kx-recipe-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.kx-recipe-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-recipe-duration {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.kx-recipe-cost-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: #d1d5db;
  white-space: nowrap;
}

.kx-recipe-btn {
  padding: 5px 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .kx-recipe-card-compact {
    padding: 10px 14px;
    gap: 12px;
  }
  .kx-recipe-name {
    font-size: 0.95rem;
  }
  .kx-recipe-cost-row {
    font-size: 0.75rem;
  }
  .kx-recipe-btn {
    padding: 8px 16px !important;
    font-size: 0.84rem !important;
  }
}

/* -----------------------------------------------------------------------------
   C. VẤN ĐẠO THIÊN CƠ (kx-view-divination)
   ----------------------------------------------------------------------------- */
.kx-divination-container {
  width: 100%;
  max-width: 720px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 2px 4px 14px 4px;
}

.kx-div-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.kx-divination-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.kx-div-tab-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 18px;
  padding: 5px 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.kx-div-tab-btn.active, .kx-div-tab-btn:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(10, 14, 23, 0.9) 100%);
  color: var(--cyan-glow);
  border-color: var(--cyan-glow);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.kx-vd-panel {
  display: none;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
}

.kx-vd-panel.active {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

.kx-div-input-box {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-cyan);
  border-radius: 12px;
  padding: 8px 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.kx-div-textarea {
  width: 100%;
  height: 48px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  resize: none;
  box-sizing: border-box;
  font-family: inherit;
}

.kx-div-textarea:focus {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.kx-div-chips-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 3px 0;
  margin-top: 2px;
}

.kx-div-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.68rem;
  color: #e0e7ff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.kx-div-chip:hover {
  border-color: var(--cyan-glow);
  color: var(--cyan-glow);
  background: rgba(0, 229, 255, 0.1);
}

.kx-div-submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

#divination-result-box {
  background: rgba(10, 16, 28, 0.88) !important;
  border: 1.5px solid var(--border-gold) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 215, 0, 0.18) !important;
  box-sizing: border-box !important;
}

.kx-div-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  gap: 6px;
  padding: 12px;
  border: 1px dashed rgba(0, 229, 255, 0.2);
  border-radius: 12px;
}

.kx-que-stage {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

#que-result-box {
  background: rgba(10, 16, 28, 0.88) !important;
  border: 1.5px solid var(--border-gold) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}


/* =============================================================================
   RESPONSIVE OPTIMIZATION CHO MODULE 1 (ĐỘNG PHỦ, SƠN MÔN, ĐAN DƯỢC)
   ============================================================================= */
.kx-dongphu-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.kx-dongphu-stat-card {
  background: rgba(10, 16, 28, 0.78);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  box-sizing: border-box;
}

#modal-incense-list {
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.kx-incense-burner-box {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 480px) {
  .kx-dongphu-stat-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .kx-dan-action-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  .kx-dan-preset-row {
    gap: 4px;
  }
  
  .kx-dan-preset-pill {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}


/* =============================================================================
   KIẾN THIẾT ĐỘNG PHỦ & KHAI PHÁ LINH MẠCH (LINH MẠCH TAB)
   ============================================================================= */
.kx-cave-hero-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(0, 229, 255, 0.08));
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 14px;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.kx-cave-hero-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, rgba(20, 25, 40, 0.8) 100%);
  border: 1.5px solid var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--gold-glow);
  flex-shrink: 0;
  position: relative;
}

.kx-cave-hero-info {
  flex: 1;
  min-width: 0;
}

.kx-cave-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.kx-cave-hero-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kx-cave-hero-tier {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan-glow);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 8px;
  padding: 2px 8px;
}

.kx-cave-hero-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  margin: 2px 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-cave-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kx-cave-stat-chip {
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kx-cave-stat-chip.auto-rate {
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan-glow);
  border: 1px solid rgba(0, 229, 255, 0.25);
}
.kx-cave-stat-chip.stones {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-glow);
  border: 1px solid rgba(255, 215, 0, 0.25);
}

/* =============================================================================
   KIẾN THIẾT ĐỘNG PHỦ & CỬU TRÙNG TIÊN THÁP LINH MẠCH (LEO THÁP STYLE)
   ============================================================================= */
.kx-tower-climb-wrapper {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.kx-cave-hero-banner.kx-tower-hero-banner {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.14), rgba(0, 229, 255, 0.09));
  border: 1px solid rgba(255, 215, 0, 0.4);
  margin-bottom: 10px;
}

/* Thanh điều hướng & Tiến trình leo tháp */
.kx-tower-nav-bar {
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.kx-tower-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.kx-tower-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff 0%, #ffd700 100%);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  transition: width 0.5s ease;
}

.kx-tower-nav-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kx-tower-nav-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.kx-tower-nav-label b {
  color: var(--gold-glow);
}

.kx-tower-locate-btn {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold-glow);
  border: 1px solid rgba(255, 215, 0, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.kx-tower-locate-btn:hover {
  background: rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
  transform: translateY(-1px);
}

/* =============================================================================
   CẤU TRÚC TÒA THÁP PHONG THỦY (PAGODA STRUCTURE)
   ============================================================================= */
.kx-tower-pagoda {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Luồng linh mạch năng lượng trung tâm xuyên suốt các tầng tháp */
.kx-tower-pagoda::before {
  content: '';
  position: absolute;
  top: 75px;
  bottom: 45px;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,215,0,0.8) 0%, rgba(0,229,255,0.5) 60%, rgba(255,255,255,0.12) 100%);
  box-shadow: 0 0 12px rgba(0,229,255,0.5), 0 0 20px rgba(255,215,0,0.35);
  border-radius: 4px;
  z-index: 1;
  pointer-events: none;
}

/* Đỉnh Tháp (Tower Apex / Spire) */
.kx-tower-spire {
  position: relative;
  text-align: center;
  z-index: 3;
  margin-bottom: 6px;
  padding-top: 6px;
}

.kx-tower-apex-ornament {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
  position: relative;
}

.kx-tower-apex-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 10%, #ffd700 65%, #b8860b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #2b1700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
  animation: pulseOrb 2.8s infinite ease-in-out;
  position: relative;
}

@keyframes pulseOrb {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.7);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 28px rgba(255, 215, 0, 1), 0 0 50px rgba(0, 229, 255, 0.4);
  }
}

.kx-tower-apex-roof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.kx-tower-eaves-curved {
  flex: 1;
  height: 8px;
  border-top: 2px solid rgba(255, 215, 0, 0.5);
  position: relative;
}
.kx-tower-eaves-curved.left {
  border-top-left-radius: 18px;
  box-shadow: -4px -2px 10px rgba(255, 215, 0, 0.3);
}
.kx-tower-eaves-curved.right {
  border-top-right-radius: 18px;
  box-shadow: 4px -2px 10px rgba(255, 215, 0, 0.3);
}

.kx-tower-title-plaque {
  background: linear-gradient(135deg, rgba(25, 20, 10, 0.95), rgba(12, 22, 40, 0.95));
  border: 1.5px solid var(--gold-glow);
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-glow);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  letter-spacing: 0.8px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.kx-tower-clouds {
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  margin-top: -6px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}
.kx-tower-cloud.cloud-1 {
  animation: floatClouds 5s infinite ease-in-out;
}
.kx-tower-cloud.cloud-2 {
  animation: floatClouds 6s infinite ease-in-out reverse;
}

@keyframes floatClouds {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  50% { transform: translateY(-4px) translateX(6px); opacity: 0.6; }
}

/* =============================================================================
   DANH SÁCH TẦNG THÁP (TOWER FLOORS)
   ============================================================================= */
.kx-cave-tiers-container.kx-tower-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.kx-cave-tier-card.kx-tower-floor {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: rgba(12, 18, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-sizing: border-box;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Mái ngói tầng tháp */
.kx-tower-floor-roof {
  height: 8px;
  background: linear-gradient(90deg, rgba(255,215,0,0.08) 0%, rgba(255,215,0,0.35) 50%, rgba(255,215,0,0.08) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  position: relative;
}

.kx-tower-eaves-bell {
  color: var(--gold-glow);
  font-size: 0.62rem;
  opacity: 0.6;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.kx-tower-roof-ridge {
  flex: 1;
}

/* Thân điện các của tầng tháp */
.kx-tower-floor-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 12px 14px;
  position: relative;
  z-index: 2;
}

/* ĐANG NGỰ TỌA (IS-ACTIVE) */
.kx-cave-tier-card.kx-tower-floor.is-active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(18, 26, 46, 0.96));
  border: 1.5px solid var(--gold-glow);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.35), inset 0 0 16px rgba(255, 215, 0, 0.08);
}
.kx-cave-tier-card.kx-tower-floor.is-active .kx-tower-floor-roof {
  background: linear-gradient(90deg, rgba(255,215,0,0.3) 0%, #ffd700 50%, rgba(255,215,0,0.3) 100%);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}
.kx-cave-tier-card.kx-tower-floor.is-active .kx-tower-eaves-bell {
  opacity: 1;
  color: #fff;
  text-shadow: 0 0 6px #ffd700;
}

/* TẦNG KẾ TIẾP CẦN KHAI PHÁ (IS-NEXT) */
.kx-cave-tier-card.kx-tower-floor.is-next {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.14), rgba(16, 26, 48, 0.95));
  border: 1.5px solid var(--cyan-glow);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.28);
  animation: pulseTowerNext 2.5s infinite ease-in-out;
}
.kx-cave-tier-card.kx-tower-floor.is-next .kx-tower-floor-roof {
  background: linear-gradient(90deg, rgba(0,229,255,0.2) 0%, #00e5ff 50%, rgba(0,229,255,0.2) 100%);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
.kx-cave-tier-card.kx-tower-floor.is-next .kx-tower-eaves-bell {
  color: var(--cyan-glow);
  opacity: 0.9;
}

@keyframes pulseTowerNext {
  0%, 100% {
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
    border-color: rgba(0, 229, 255, 0.65);
  }
  50% {
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.55), inset 0 0 10px rgba(0, 229, 255, 0.15);
    border-color: #00e5ff;
  }
}

/* ĐÃ THÔNG MẠCH (IS-UNLOCKED) */
.kx-cave-tier-card.kx-tower-floor.is-unlocked {
  background: rgba(10, 18, 30, 0.75);
  border-color: rgba(0, 229, 255, 0.22);
}

/* CHƯA MỞ / KHÓA (IS-LOCKED) */
.kx-cave-tier-card.kx-tower-floor.is-locked {
  background: rgba(8, 12, 20, 0.65);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Bệ Tọa Đài Tu Sĩ (Meditator Seat) */
.kx-tower-meditator-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}

.kx-tower-meditator-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold-glow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, rgba(15,20,35,0.95) 100%);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
  font-size: 1.3rem;
  color: var(--gold-glow);
  position: relative;
}

.kx-tower-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.kx-tower-seat-tag {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--gold-glow);
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.45);
  padding: 1px 7px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Nút Khai Phá Tầng Kế Tiếp */
.kx-tower-breakthrough-btn {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
  background: linear-gradient(135deg, #ffd700 0%, #ff9800 100%);
  color: #1a0f00;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.kx-tower-breakthrough-btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.8);
}

/* Màn Sương Mù Phong Ấn Tầng Trên Cao */
.kx-tower-mist-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14, 22, 38, 0.75) 0%, rgba(8, 14, 26, 0.88) 100%);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.76rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 3;
}
.kx-tower-mist-layer i {
  color: var(--cyan-glow);
  opacity: 0.6;
}

/* =============================================================================
   CHÂN THÁP (TOWER FOUNDATION)
   ============================================================================= */
.kx-tower-foundation {
  position: relative;
  z-index: 3;
  margin-top: 10px;
}

.kx-tower-pedestal-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
}

.kx-tower-pedestal-steps .step {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.kx-tower-pedestal-steps .step-1 {
  width: 70%;
  background: rgba(0, 229, 255, 0.2);
}
.kx-tower-pedestal-steps .step-2 {
  width: 85%;
  background: rgba(255, 215, 0, 0.25);
}

.kx-tower-pedestal-base {
  background: linear-gradient(180deg, #162238 0%, #0b111e 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.kx-tower-pedestal-base i {
  color: var(--gold-glow);
  font-size: 0.85rem;
}

/* =============================================================================
   CÁC ELEMENT NỘI DUNG TẦNG CŨ ĐƯỢC KẾ THỪA
   ============================================================================= */
.kx-cave-tier-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.kx-cave-tier-card.is-active .kx-cave-tier-icon {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold-glow);
  color: var(--gold-glow);
}
.kx-cave-tier-card.is-next .kx-cave-tier-icon {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--cyan-glow);
  color: var(--cyan-glow);
}

.kx-cave-tier-content {
  flex: 1;
  min-width: 0;
}

.kx-cave-tier-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.kx-cave-tier-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.kx-cave-tier-card.is-active .kx-cave-tier-badge {
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold-glow);
}
.kx-cave-tier-card.is-next .kx-cave-tier-badge {
  background: rgba(0, 229, 255, 0.2);
  color: var(--cyan-glow);
}

.kx-cave-tier-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kx-cave-tier-card.is-active .kx-cave-tier-title {
  color: var(--gold-glow);
}

.kx-cave-tier-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 4px;
}

.kx-cave-tier-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.72rem;
}

.kx-cave-bonus-tag {
  color: var(--cyan-glow);
  font-weight: 600;
}

.kx-cave-cost-tag {
  color: var(--gold-glow);
  font-weight: 600;
}
.kx-cave-cost-tag.free {
  color: var(--emerald-glow);
}

.kx-cave-tier-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.kx-cave-status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.kx-cave-status-pill.active {
  background: rgba(255, 215, 0, 0.18);
  color: var(--gold-glow);
  border: 1px solid rgba(255, 215, 0, 0.4);
}
.kx-cave-status-pill.completed {
  background: rgba(0, 229, 255, 0.08);
  color: rgba(0, 229, 255, 0.65);
  border: 1px solid rgba(0, 229, 255, 0.18);
}
.kx-cave-status-pill.locked {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.kx-btn-upgrade-cave {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
  animation: pulseGold 2s infinite ease-in-out;
}
.kx-btn-upgrade-cave:disabled {
  opacity: 0.45;
  box-shadow: none;
  animation: none;
  cursor: not-allowed;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.6); }
}

@media (max-width: 480px) {
  .kx-tower-floor-body {
    padding: 8px 10px 10px 10px;
    gap: 10px;
  }
  .kx-cave-tier-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .kx-btn-upgrade-cave,
  .kx-tower-breakthrough-btn {
    padding: 7px 10px;
    font-size: 0.75rem;
  }
}


.kx-tl-zone-btn.icon-only {
  padding: 4px 10px;
  font-size: 1.05rem;
  line-height: 1.1;
  border-radius: 14px;
  min-width: 36px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kx-tl-tab-pane {
  width: 100%;
  max-width: 1040px;
  box-sizing: border-box;
}


/* Container Tab 1: Chọn Giai Nhân */
.kx-tl-select-container {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 20px;
  align-items: stretch;
  width: 100%;
  max-width: 1040px;
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .kx-tl-select-container {
    grid-template-columns: 1fr;
  }
}

/* Thẻ Thông Tin Giai Nhân Đang Chọn trong Tab 1 */
.kx-tl-selected-preview-card {
  background: rgba(10, 14, 23, 0.75);
  border: 1.5px solid rgba(236, 72, 153, 0.35);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 410px;
  box-sizing: border-box;
}

.kx-tl-preview-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.preview-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ec4899;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.5);
}

.preview-quote-box {
  background: rgba(0, 0, 0, 0.4);
  border-left: 3px solid #ec4899;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.preview-actions-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  margin-top: 10px;
}

.kx-btn-chat-enter {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.45);
  transition: all 0.25s ease;
}

.kx-btn-chat-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.65);
}


/* Thanh Điều Hướng Tổng Hợp: [ Chọn Giới Tính Đầu Tiên ] + [ 4 Tabs: Giai Nhân, Tâm Tình, Thính Phong, Luyện Tâm ] LUÔN TRÊN 1 DÒNG DUY NHẤT */
/* SUBMENU HỒNG TRẦN / THANH LÂU: 1 DÒNG DUY NHẤT, HỌC TẬP PHONG CÁCH SUBMENU CÁC MODULE KHÁC (KHÔNG MÀU NỀN, KHÔNG BORDER) */
.kx-tl-nav-bar-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: clamp(2px, 0.6vw, 8px) !important;
  width: 100% !important;
  max-width: min(96vw, 760px) !important;
  margin: 0 auto clamp(4px, 0.8vh, 8px) auto !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: clamp(2px, 0.4vh, 6px) clamp(2px, 0.6vw, 8px) !important;
  box-sizing: border-box !important;
}

.kx-tl-nav-bar-row .kx-tl-gender-switch {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
  padding: 0 clamp(4px, 0.6vw, 8px) 0 0 !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
}

.kx-tl-gender-switch .kx-tl-zone-btn.icon-only {
  width: clamp(24px, 4.5vmin, 32px) !important;
  height: clamp(24px, 4.5vmin, 32px) !important;
  min-width: clamp(24px, 4.5vmin, 32px) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: clamp(0.95rem, 1.8vmin, 1.25rem) !important;
  line-height: 1 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  opacity: 0.45 !important;
  filter: grayscale(0.5) !important;
  transition: all 0.22s ease !important;
}

.kx-tl-gender-switch .kx-tl-zone-btn.icon-only:hover {
  opacity: 0.85 !important;
  filter: none !important;
  transform: scale(1.1) !important;
}

.kx-tl-gender-switch .kx-tl-zone-btn.icon-only.active {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 8px #ff4081) !important;
  transform: scale(1.15) !important;
}

.kx-tl-gender-switch .kx-tl-zone-btn.zone-male.active {
  filter: drop-shadow(0 0 8px #ffd700) !important;
}

.kx-tl-nav-bar-row .kx-tl-nav-tabs {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-around !important;
  gap: clamp(1px, 0.4vw, 6px) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.kx-tl-nav-tab-btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(1px, 0.2vh, 3px) !important;
  padding: clamp(2px, 0.4vh, 6px) clamp(1px, 0.4vw, 4px) !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 0.22s ease !important;
  position: relative !important;
  opacity: 0.65 !important;
  color: var(--text-muted) !important;
}

.kx-tl-nav-tab-btn i {
  font-size: clamp(0.85rem, 1.6vmin, 1.15rem) !important;
  line-height: 1 !important;
  margin-bottom: clamp(1px, 0.2vh, 2px) !important;
  transition: transform 0.2s ease, filter 0.2s ease !important;
}

.kx-tl-nav-tab-btn span {
  font-size: clamp(0.58rem, 0.85vw + 0.2vh, 0.74rem) !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  letter-spacing: 0.2px !important;
  transition: color 0.2s ease, text-shadow 0.2s ease !important;
}

.kx-tl-nav-tab-btn:hover {
  opacity: 0.9 !important;
  color: #fff !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.kx-tl-nav-tab-btn:hover i {
  filter: drop-shadow(0 0 6px currentColor) !important;
}

.kx-tl-nav-tab-btn.active {
  opacity: 1 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #fff !important;
}

.kx-tl-nav-tab-btn.active i {
  filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 14px currentColor) !important;
  transform: scale(1.12) !important;
}

.kx-tl-nav-tab-btn.active span {
  color: #fff !important;
  text-shadow: 0 0 10px rgba(255, 64, 129, 0.8), 0 0 16px rgba(255, 64, 129, 0.4) !important;
}

.kx-tl-nav-tab-btn.active::after {
  content: "" !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 15% !important;
  right: 15% !important;
  height: 2px !important;
  background: #ff4081 !important;
  box-shadow: 0 0 8px #ff4081, 0 0 12px rgba(255, 64, 129, 0.6) !important;
  border-radius: 2px !important;
}

#tab-btn-tl-select.active::after { background: #ec4899 !important; box-shadow: 0 0 8px #ec4899 !important; }
#tab-btn-tl-chat.active::after { background: #f43f5e !important; box-shadow: 0 0 8px #f43f5e !important; }
#tab-btn-tl-kyngo.active::after { background: var(--cyan-glow) !important; box-shadow: 0 0 8px var(--cyan-glow) !important; }
#tab-btn-tl-luyentam.active::after { background: #a855f7 !important; box-shadow: 0 0 8px #a855f7 !important; }
#tab-btn-tl-marriage.active::after { background: #ff4081 !important; box-shadow: 0 0 8px #ff4081 !important; }

#tab-btn-tl-kyngo.active span { text-shadow: 0 0 10px rgba(0, 229, 255, 0.8) !important; }
#tab-btn-tl-luyentam.active span { text-shadow: 0 0 10px rgba(168, 85, 247, 0.8) !important; }
#tab-btn-tl-marriage.active span { text-shadow: 0 0 10px rgba(255, 64, 129, 0.8) !important; }


/* =============================================================================
   THANH LÂU CÁC: LẤP ĐẦY TỐI ĐA KHÔNG GIAN XUỐNG TẬN BOTTOM DOCK MENU
   ============================================================================= */
.kx-view-thanh_lau .kx-feature-modal-body {
  height: 100% !important;
  max-height: 100% !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding-top: calc(var(--kx-header-h, 48px) + var(--kx-top-action-h, 46px) + 10px) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h, 52px) + 8px + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .kx-view-thanh_lau .kx-feature-modal-body {
    padding-top: calc(var(--kx-header-h, 44px) + var(--kx-top-action-h, 42px) + 8px) !important;
    padding-bottom: calc(var(--kx-bottom-dock-h, 48px) + 8px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* TẤT CẢ CÁC TAB-PANE MẶC ĐỊNH BỊ ẨN HOÀN TOÀN - TAB NÀO RA TAB ĐÓ */
.kx-view-thanh_lau .kx-tl-tab-pane {
  display: none !important;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 1040px;
  overflow: hidden;
  box-sizing: border-box;
}

/* CHỈ CÓ DUY NHẤT TAB-PANE ACTIVE MỚI ĐƯỢC HIỂN THỊ FLEX */
.kx-view-thanh_lau .kx-tl-tab-pane.active {
  display: flex !important;
  flex-direction: column;
}

/* KHUNG PANEL CARD CHỈ CĂN CHỈNH KÍCH THƯỚC, KHÔNG CƯỠNG ÉP HIỂN THỊ KHI ẨN */
.kx-view-thanh_lau .kx-tl-panel-card {
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

/* TAB 1: CHỌN GIAI NHÂN - ĐÀI VÕ TRUNG TÂM 4 HÌNH VUÔNG 1 HÌNH TRÒN */
.kx-tl-select-arena-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
}

.kx-tl-mandala-stage,
.kx-view-thanh_lau .kx-tl-mandala-stage {
  position: relative !important;
  width: 440px !important;
  height: 480px !important;
  max-width: 92vw !important;
  max-height: 85vh !important;
  margin: 0 auto !important;
  background: radial-gradient(circle at center, rgba(236, 72, 153, 0.12) 0%, rgba(10, 14, 23, 0.96) 72%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px !important;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85), inset 0 0 40px rgba(0, 0, 0, 0.7) !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.kx-tl-select-footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.kx-btn-enter-chat {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  padding: 10px 24px;
  border-radius: 28px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5), inset 0 0 12px rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.kx-btn-enter-chat:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 26px rgba(236, 72, 153, 0.75), 0 0 16px rgba(255, 215, 0, 0.5);
  background: linear-gradient(135deg, #f43f5e, #a855f7);
}

.kx-tl-cost-tag {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.6);
  color: #ffd700;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* POPUP XÁC NHẬN THANH TOÁN CHIÊU ĐÃI GIAI NHÂN / TÚ BÀ / TÚ ÔNG */
.kx-view-thanh_lau .kx-feature-modal-box {
  position: relative !important;
}

.kx-tl-modal-overlay {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 9999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: kxFadeIn 0.22s ease-out;
}

.kx-tl-confirm-box {
  background: linear-gradient(180deg, #131b2e 0%, #0a0e19 100%);
  border: 1.5px solid rgba(236, 72, 153, 0.45);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(236, 72, 153, 0.25);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kx-tl-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(236, 72, 153, 0.25);
  background: rgba(0, 0, 0, 0.35);
}

.kx-tl-confirm-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--gold-glow);
  font-family: var(--font-heading);
}

.kx-tl-modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.kx-tl-confirm-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kx-tl-confirm-char-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.kx-tl-modal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.kx-tl-stack-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #fff;
}

.stack-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stepper-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.stepper-btn:hover {
  background: rgba(236, 72, 153, 0.4);
  border-color: #ec4899;
}

.stepper-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffd700;
  min-width: 140px;
  text-align: center;
}

.stack-presets {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.preset-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 4px 0;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-pill.active,
.preset-pill:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.4), rgba(168, 85, 247, 0.4));
  border-color: #ec4899;
  color: #fff;
}

.stack-hint {
  font-size: 0.72rem;
  color: var(--cyan-glow);
  background: rgba(0, 229, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px dashed rgba(0, 229, 255, 0.3);
  text-align: center;
}

.kx-tl-boss-box {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
}

.kx-tl-cost-summary {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.kx-tl-confirm-footer {
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.kx-btn-choose-beauty {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  border: 1.5px solid rgba(255, 215, 0, 0.5);
  padding: 10px 32px;
  border-radius: 28px;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5), inset 0 0 12px rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.kx-btn-choose-beauty:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 26px rgba(236, 72, 153, 0.8), 0 0 16px rgba(255, 215, 0, 0.6);
  background: linear-gradient(135deg, #f43f5e, #a855f7);
}

/* THANH CÔNG CỤ ĐIỀU KHIỂN TINH TẾ PHÒNG TÂM TÌNH */
.kx-tl-tools-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Badge đếm ngược thời lượng: Thiết kế ngọc tỷ tiên hiệp thanh lịch */
.kx-tl-timer-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 20px;
  padding: 4px 6px 4px 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(251, 191, 36, 0.08);
  white-space: nowrap;
}

.kx-tl-timer-badge i {
  color: #fbbf24;
  font-size: 0.8rem;
  animation: kxPulse 2s infinite ease-in-out;
}

.kx-tl-timer-badge span,
#tl-chat-timer-val {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Roboto Mono', monospace;
  color: #fef08a;
  letter-spacing: 0.5px;
}

/* Nút Gia Hạn: Gradient tím hồng tiên hoa tinh tế, không còn cục màu xanh lá thô */
.kx-btn-extend-time {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 14px !important;
  padding: 3px 10px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kx-btn-extend-time:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.7);
  background: linear-gradient(135deg, #f43f5e 0%, #c084fc 100%) !important;
}

/* Nút công cụ tinh tế (Đổi Giai Nhân, Xóa Chat) */
.kx-tl-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.kx-tl-tool-btn:hover {
  background: rgba(236, 72, 153, 0.2);
  border-color: rgba(236, 72, 153, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.kx-tl-tool-btn.btn-switch-beauty {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.3);
}

.kx-tl-tool-btn.btn-switch-beauty:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.kx-tl-tool-btn.btn-clear-chat {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.12);
}

.kx-tl-tool-btn.btn-clear-chat:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fecdd3;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}


/* 13. Menu top đồng bộ phong cách Động Phủ (icon + text bên dưới) */


/* =============================================================================
   15. ĐỒNG BỘ THANH ACTION BAR & KHOẢNG CÁCH NỘI DUNG THOÁNG ĐÃNG TOÀN BỘ CÁC MODULE
   ============================================================================= */
/* 1. Thanh action bar trong suốt hoàn toàn: không viền, không nền, không bóng mờ, không blur */
.kx-bottom-action-bar {
  background: transparent !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  overflow: visible !important;
  height: auto !important;
  min-height: 48px !important;
  padding: 2px 8px !important;
}

@media (max-width: 767px) {
  .kx-bottom-action-bar {
    height: auto !important;
    min-height: 44px !important;
    padding: 2px 4px !important;
  }
}

/* 2. Các nút & icon bỏ nền hoàn toàn: không viền, không nền kể cả hover / active / focus / tap */
.kx-bottom-action-btn,
.kx-bottom-action-btn.action-tap,
.kx-bottom-action-btn.is-current,
.kx-bottom-action-btn.action-main,
.kx-bottom-action-btn:hover,
.kx-bottom-action-btn:active,
.kx-bottom-action-btn:focus,
.kx-bottom-action-icon {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Nút đang chọn / active / tap: Tuyệt đối KHÔNG NỀN, KHÔNG VIỀN, chỉ sáng rực chữ & icon hào quang */
.kx-bottom-action-btn.action-tap,
.kx-bottom-action-btn.is-current {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--cyan-glow) !important;
}

.kx-bottom-action-btn.action-tap .kx-bottom-action-icon,
.kx-bottom-action-btn.is-current .kx-bottom-action-icon {
  filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 14px currentColor) !important;
  transform: scale(1.1);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.kx-bottom-action-btn.action-tap .kx-bottom-action-lbl,
.kx-bottom-action-btn.is-current .kx-bottom-action-lbl {
  color: var(--cyan-glow) !important;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 18px rgba(0, 229, 255, 0.4) !important;
}

.kx-bottom-action-btn:hover .kx-bottom-action-icon {
  filter: drop-shadow(0 0 6px currentColor);
}

/* Đảm bảo phụ đề dưới icon (subtext) không bao giờ bị cắt hoặc đè chữ */
.kx-bottom-action-sub {
  line-height: 1.2 !important;
  overflow: visible !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  display: block !important;
  margin-top: 1px !important;
}

/* Loại bỏ header tiêu đề thừa ở tất cả các module */
.kx-feature-modal-header {
  display: none !important;
}

/* 2. Khoảng cách rộng rãi, thoáng đãng giữa Action Bar và nội dung bên dưới ở TẤT CẢ các module */
.kx-feature-modal-body,
.kx-view-bequan .kx-feature-modal-body,
.kx-view-danghuong .kx-feature-modal-body,
.kx-view-tongmon .kx-feature-modal-body,
.kx-view-dongphu .kx-feature-modal-body,
.kx-view-dotpha .kx-feature-modal-body,
.kx-view-travel .kx-feature-modal-body,
.kx-view-alchemy .kx-feature-modal-body,
.kx-view-divination .kx-feature-modal-body,
.kx-view-danduoc .kx-feature-modal-body,
.kx-view-reincarnation .kx-feature-modal-body,
.kx-view-thanh_lau .kx-feature-modal-body,
.kx-view-marriage .kx-feature-modal-body,
.kx-view-phongthan .kx-feature-modal-body,
.kx-view-chat .kx-feature-modal-body,
.kx-view-super .kx-feature-modal-body,
.kx-view-thienthu .kx-feature-modal-body,
.kx-view-danhhieu .kx-feature-modal-body,
.kx-view-donate .kx-feature-modal-body,
.kx-view-hoso .kx-feature-modal-body,
.kx-view-global-panel .kx-feature-modal-body {
  padding-top: calc(var(--kx-header-h, 48px) + 12px + var(--kx-top-action-h, 50px) + 26px) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h, 52px) + 16px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box !important;
}

@media (max-width: 767px) {
  .kx-feature-modal-body,
  .kx-view-bequan .kx-feature-modal-body,
  .kx-view-danghuong .kx-feature-modal-body,
  .kx-view-tongmon .kx-feature-modal-body,
  .kx-view-dongphu .kx-feature-modal-body,
  .kx-view-dotpha .kx-feature-modal-body,
  .kx-view-travel .kx-feature-modal-body,
  .kx-view-alchemy .kx-feature-modal-body,
  .kx-view-divination .kx-feature-modal-body,
  .kx-view-danduoc .kx-feature-modal-body,
  .kx-view-reincarnation .kx-feature-modal-body,
  .kx-view-thanh_lau .kx-feature-modal-body,
  .kx-view-marriage .kx-feature-modal-body,
  .kx-view-phongthan .kx-feature-modal-body,
  .kx-view-chat .kx-feature-modal-body,
  .kx-view-super .kx-feature-modal-body,
  .kx-view-thienthu .kx-feature-modal-body,
  .kx-view-danhhieu .kx-feature-modal-body,
  .kx-view-donate .kx-feature-modal-body,
  .kx-view-hoso .kx-feature-modal-body,
  .kx-view-global-panel .kx-feature-modal-body {
    padding-top: calc(var(--kx-header-h, 44px) + 8px + var(--kx-top-action-h, 46px) + 18px) !important;
    padding-bottom: calc(var(--kx-bottom-dock-h, 48px) + 12px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* =============================================================================
   BẢNG PHONG THẦN: TỐI ƯU GIAO DIỆN TABLET & MOBILE + AVATAR TU SĨ
   ============================================================================= */
.kx-phongthan-container {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 4px;
  box-sizing: border-box;
}

.kx-phongthan-table-wrap {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 16px;
  background: rgba(10, 16, 28, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.22);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(0, 229, 255, 0.05);
  -webkit-overflow-scrolling: touch;
}

.kx-phongthan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
  table-layout: auto;
}

.kx-phongthan-table thead tr {
  border-bottom: 1.5px solid rgba(0, 229, 255, 0.3);
  background: rgba(7, 11, 20, 0.85);
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.kx-phongthan-table th {
  padding: 10px 8px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kx-phongthan-table td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.kx-phongthan-table tbody tr:hover {
  background: rgba(0, 229, 255, 0.07);
}

/* Cột Hạng */
.kx-col-rank {
  width: 44px;
  text-align: center !important;
}

.kx-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
}

.kx-rank-badge.rank-1 {
  color: #ffd700;
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.kx-rank-badge.rank-2 {
  color: #e2e8f0;
  font-size: 1.02rem;
  text-shadow: 0 0 8px rgba(226, 232, 240, 0.5);
}

.kx-rank-badge.rank-3 {
  color: #f59e0b;
  font-size: 0.98rem;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.kx-rank-badge.rank-other {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Cột Tu Sĩ: Avatar + Tên + Danh Xưng */
.kx-col-cultivator {
  min-width: 140px;
}

.kx-rank-cultivator-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kx-rank-avatar-wrapper {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.kx-rank-avatar-wrapper.rank-1 {
  border: 2px solid #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.55);
}

.kx-rank-avatar-wrapper.rank-2 {
  border: 2px solid #cbd5e1;
  box-shadow: 0 0 10px rgba(203, 213, 225, 0.5);
}

.kx-rank-avatar-wrapper.rank-3 {
  border: 2px solid #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.kx-rank-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.kx-rank-avatar-icon {
  font-size: 1rem;
  color: var(--cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.kx-rank-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.kx-rank-daohieu-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.kx-rank-daohieu {
  font-weight: 700;
  color: #fff;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-rank-title-row {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Cột Tu Sĩ 4 dòng: Đạo Hiệu, Danh Hiệu, Cảnh Giới, Tông Môn */
.kx-rank-realm-row {
  font-size: 0.73rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-rank-sect-row {
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-rank-sub-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 4px;
  row-gap: 2px;
  font-size: 0.73rem;
  line-height: 1.25;
  margin-top: 2px;
}

.kx-rank-sub-realm {
  color: var(--cyan-glow);
  font-weight: 600;
  white-space: nowrap;
}

.kx-rank-sub-dot {
  color: var(--text-muted);
  opacity: 0.6;
  font-size: 0.65rem;
}

.kx-rank-sub-sect {
  color: var(--text-muted);
  white-space: nowrap;
}

.kx-rank-sub-title {
  white-space: nowrap;
  font-size: 0.72rem;
}

/* Cột Cảnh Giới */
.kx-col-realm {
  min-width: 95px;
  font-size: 0.82rem;
  color: var(--cyan-glow);
}

.kx-rank-realm {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-rank-sect-sub {
  display: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Cột Tông Môn */
.kx-col-sect {
  min-width: 95px;
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cột Tu Vi */
.kx-col-tuvi {
  text-align: right !important;
  font-weight: 800;
  color: var(--gold-glow) !important;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  white-space: nowrap;
  min-width: 75px;
}

/* =============================================================================
   RESPONSIVE CHO TABLET (<= 768px) VÀ MOBILE (<= 600px)
   ============================================================================= */
@media (max-width: 768px) {
  .kx-phongthan-table th,
  .kx-phongthan-table td {
    padding: 7px 5px;
  }
  .kx-rank-avatar-wrapper {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
  .kx-rank-avatar-icon {
    font-size: 0.85rem;
  }
  .kx-rank-daohieu {
    font-size: 0.82rem;
  }
  .kx-col-tuvi {
    font-size: 0.86rem;
  }
}

@media (max-width: 880px) {
  .kx-col-sect {
    display: none !important;
  }
  .kx-rank-sect-sub {
    display: block !important;
  }
  .kx-col-rank {
    width: 32px;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }
  .kx-rank-badge {
    font-size: 0.8rem;
  }
  .kx-rank-avatar-wrapper {
    width: 26px;
    height: 26px;
    min-width: 26px;
  }
  .kx-rank-avatar-icon {
    font-size: 0.78rem;
  }
  .kx-rank-daohieu {
    font-size: 0.78rem;
  }
  .kx-col-realm {
    min-width: 80px;
    font-size: 0.76rem;
  }
  .kx-col-tuvi {
    font-size: 0.82rem;
    min-width: 65px;
    padding-right: 4px !important;
  }
}



/* =============================================================================
   BẢNG PHONG THẦN: 5 DANH MỤC + BẢN THÂN TÀI KHOẢN (TOP 10 + MY RANK)
   ============================================================================= */
.kx-phongthan-tabs-wrapper {
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.kx-phongthan-tabs-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  min-width: max-content;
  padding: 2px;
}

.kx-phongthan-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: rgba(12, 19, 34, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 20px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
  user-select: none;
}

.kx-phongthan-tab:hover {
  border-color: rgba(0, 229, 255, 0.55);
  color: #fff;
  transform: translateY(-1px);
  background: rgba(16, 26, 46, 0.95);
}

.kx-phongthan-tab.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(255, 215, 0, 0.2) 100%);
  border-color: var(--gold-glow);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
}

.kx-phongthan-tab i {
  font-size: 0.88rem;
  transition: transform 0.2s ease;
}

.kx-phongthan-tab:hover i {
  transform: scale(1.15);
}

.kx-phongthan-tab[data-phongthan-cat="tu_vi"].active i { color: #ffd700; }
.kx-phongthan-tab[data-phongthan-cat="linh_thach"].active i { color: #00e5ff; }
.kx-phongthan-tab[data-phongthan-cat="dan_duoc"].active i { color: #10b981; }
.kx-phongthan-tab[data-phongthan-cat="giai_nhan"].active i { color: #ec4899; }
.kx-phongthan-tab[data-phongthan-cat="ky_duyen"].active i { color: #f59e0b; }

/* Thẻ Thứ Hạng Bản Thân */
.kx-phongthan-my-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(25, 38, 65, 0.92) 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), inset 0 0 16px rgba(255, 215, 0, 0.08);
  gap: 12px;
}

.kx-my-rank-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.kx-my-rank-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 8px;
  flex-shrink: 0;
}

.kx-my-rank-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--gold-glow);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.kx-my-rank-num {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.kx-my-rank-total {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kx-my-rank-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.kx-my-rank-sub {
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

.kx-my-rank-right {
  text-align: right;
  flex-shrink: 0;
}

.kx-my-rank-val-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
}

.kx-my-rank-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-glow);
  font-family: var(--font-heading);
}

.kx-phongthan-table-header-desc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 4px;
}

.kx-phongthan-desc-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* =============================================================================
   BỤC VINH DANH TAM ĐẠI ĐỈNH PHONG (TOP 3 PODIUM: #2 TRÁI - #1 GIỮA - #3 PHẢI)
   ============================================================================= */
.kx-phongthan-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(6px, 1.8vw, 14px);
  margin: 8px 0 16px 0;
  width: 100%;
  box-sizing: border-box;
}

.kx-podium-slot {
  flex: 1;
  max-width: 250px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(13, 22, 40, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 14px 14px 0 0;
  padding: 8px 4px 0 4px;
  box-sizing: border-box;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.kx-podium-slot.rank-1 {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.16) 0%, rgba(13, 22, 40, 0.9) 100%);
  border: 1.5px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 2;
  padding-top: 10px;
}

.kx-podium-slot.rank-2 {
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.12) 0%, rgba(13, 22, 40, 0.85) 100%);
  border: 1.2px solid #cbd5e1;
  box-shadow: 0 0 14px rgba(203, 213, 225, 0.15);
}

.kx-podium-slot.rank-3 {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(13, 22, 40, 0.85) 100%);
  border: 1.2px solid #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.15);
}

.kx-podium-slot.is-me {
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.4), inset 0 0 12px rgba(255, 215, 0, 0.15);
  border-color: #ffd700 !important;
}

.kx-podium-slot.is-empty {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.kx-podium-crown {
  font-size: 1.2rem;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 6px currentColor);
}
.kx-podium-slot.rank-1 .kx-podium-crown { color: #ffd700; font-size: 1.35rem; }
.kx-podium-slot.rank-2 .kx-podium-crown { color: #cbd5e1; }
.kx-podium-slot.rank-3 .kx-podium-crown { color: #f59e0b; }

.kx-podium-avatar-wrap {
  width: clamp(34px, 9vw, 44px);
  height: clamp(34px, 9vw, 44px);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0 5px 0;
}

.kx-podium-slot.rank-1 .kx-podium-avatar-wrap {
  width: clamp(42px, 11vw, 54px);
  height: clamp(42px, 11vw, 54px);
}

.kx-podium-avatar-wrap img,
.kx-podium-avatar-wrap .kx-rank-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.kx-podium-slot.rank-1 .kx-podium-avatar-wrap img,
.kx-podium-slot.rank-1 .kx-podium-avatar-wrap .kx-rank-avatar {
  border: 2px solid #ffd700;
}
.kx-podium-slot.rank-2 .kx-podium-avatar-wrap img,
.kx-podium-slot.rank-2 .kx-podium-avatar-wrap .kx-rank-avatar {
  border: 2px solid #cbd5e1;
}
.kx-podium-slot.rank-3 .kx-podium-avatar-wrap img,
.kx-podium-slot.rank-3 .kx-podium-avatar-wrap .kx-rank-avatar {
  border: 2px solid #f59e0b;
}

.kx-podium-rank-tag {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #000;
  font-weight: 900;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}

.kx-podium-slot.rank-1 .kx-podium-rank-tag { background: #ffd700; }
.kx-podium-slot.rank-2 .kx-podium-rank-tag { background: #cbd5e1; }
.kx-podium-slot.rank-3 .kx-podium-rank-tag { background: #f59e0b; }

.kx-podium-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  align-items: center;
  overflow: hidden;
  padding: 0 2px;
}

.kx-podium-name {
  font-weight: 700;
  color: #fff;
  font-size: clamp(0.72rem, 2vw, 0.85rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kx-podium-title {
  font-size: clamp(0.62rem, 1.5vw, 0.72rem);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kx-podium-realm {
  font-size: clamp(0.64rem, 1.6vw, 0.74rem);
  color: var(--cyan-glow);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kx-podium-sect {
  font-size: clamp(0.62rem, 1.5vw, 0.72rem);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kx-podium-val {
  margin: 3px 0 6px 0;
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  font-weight: 800;
  white-space: nowrap;
}

.kx-podium-base {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px 4px 0 0;
  border-top: 2px solid;
}

.kx-podium-slot.rank-1 .kx-podium-base {
  height: 34px;
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

.kx-podium-slot.rank-2 .kx-podium-base {
  height: 25px;
  background: rgba(203, 213, 225, 0.15);
  border-color: #cbd5e1;
}

.kx-podium-slot.rank-3 .kx-podium-base {
  height: 18px;
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
}

.kx-podium-base-lbl {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  opacity: 0.9;
}
.kx-podium-slot.rank-1 .kx-podium-base-lbl { color: #ffd700; }
.kx-podium-slot.rank-2 .kx-podium-base-lbl { color: #cbd5e1; }
.kx-podium-slot.rank-3 .kx-podium-base-lbl { color: #f59e0b; }

.kx-phongthan-row-me {
  background: rgba(255, 215, 0, 0.14) !important;
  box-shadow: inset 0 0 12px rgba(255, 215, 0, 0.15), 0 0 12px rgba(255, 215, 0, 0.25) !important;
  position: relative;
}

.kx-phongthan-row-me td {
  border-top: 1.5px solid #ffd700 !important;
  border-bottom: 1.5px solid #ffd700 !important;
}

.kx-phongthan-row-me td:first-child {
  border-left: 3.5px solid #ffd700 !important;
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
}

.kx-phongthan-row-me td:last-child {
  border-right: 2px solid #ffd700 !important;
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}

.kx-phongthan-divider-row td {
  border: none !important;
  background: transparent !important;
}

.kx-me-tag {
  background: linear-gradient(135deg, #ffd700, #ff9100);
  color: #000;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 5px;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

.kx-phongthan-guest-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(255, 215, 0, 0.35);
  border-radius: 12px;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .kx-phongthan-tabs-bar {
    justify-content: flex-start;
    padding-left: 2px;
  }
  .kx-phongthan-tab {
    padding: 6px 11px;
    font-size: 0.76rem;
  }
  .kx-my-rank-badge-wrap {
    min-width: 48px;
    padding: 3px 4px;
  }
  .kx-my-rank-num {
    font-size: 0.95rem;
  }
  .kx-my-rank-val {
    font-size: 0.9rem;
  }
}


/* =============================================================================
   16. HỆ THỐNG GIAI NHÂN PHỤ (BÁN CẢ NGHỆ LẪN THÂN · 10K - 50K LT) & SONG TU
   ============================================================================= */

/* Dải Giai Nhân Phụ Của Từng Góc Viện */
.kx-tl-juniors-strip {
  width: 100%;
  max-width: 480px;
  background: rgba(10, 14, 26, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 14px;
  padding: 6px 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.kx-tl-juniors-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 3px;
}

.kx-tl-type-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.kx-tl-type-tag.pure {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.kx-tl-type-tag.non-pure {
  background: rgba(236, 72, 153, 0.25);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.5);
}

.kx-tl-juniors-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.kx-tl-juniors-list::-webkit-scrollbar {
  height: 3px;
}

.kx-tl-juniors-list::-webkit-scrollbar-thumb {
  background: rgba(236, 72, 153, 0.4);
  border-radius: 3px;
}

.kx-tl-junior-pill {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.kx-tl-junior-pill:hover {
  background: rgba(236, 72, 153, 0.22);
  border-color: rgba(236, 72, 153, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.kx-tl-junior-pill.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.45), rgba(168, 85, 247, 0.45)) !important;
  border-color: #ffd700 !important;
  color: #ffd700 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.35) !important;
}

.kx-tl-junior-pill.pillar-pill {
  border-color: rgba(255, 215, 0, 0.4);
  color: #fef08a;
  background: rgba(251, 191, 36, 0.1);
}

.kx-tl-junior-pill.pillar-pill.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.55), rgba(255, 215, 0, 0.35)) !important;
  border-color: #ffd700 !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5) !important;
}

/* NÚT SONG TU */
.kx-btn-song-tu {
  background: linear-gradient(135deg, #ec4899, #f43f5e) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
}

.kx-btn-song-tu:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.75);
  background: linear-gradient(135deg, #f43f5e, #c084fc) !important;
}

.kx-btn-song-tu.locked {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}


/* DẢI AVATAR TRÒN DẠNG CỘT DỌC TINH TẾ (THEO BÊN TRÁI / PHẢI) */
.kx-tl-corner-quick-avatars {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  gap: 3px;
  position: absolute;
  z-index: 6;
  pointer-events: auto;
}

.kx-tl-quick-avatar-btn {
  position: relative;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: #050811;
  cursor: pointer;
  overflow: visible;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

.kx-tl-quick-avatar-btn img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block;
}

.kx-tl-quick-avatar-btn:hover {
  transform: scale(1.25);
  border-color: #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.9);
  z-index: 10;
}

.kx-tl-quick-avatar-btn.active {
  border-color: #ec4899 !important;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.95), 0 0 0 2px rgba(255, 255, 255, 0.85) !important;
  transform: scale(1.18);
  z-index: 9;
}

.kx-tl-quick-avatar-btn.pillar-btn.active {
  border-color: #ffd700 !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.95), 0 0 0 2px rgba(255, 215, 0, 0.6) !important;
}

.kx-tl-quick-avatar-cost {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: rgba(10, 14, 23, 0.95);
  color: #fef08a;
  border: 1px solid rgba(255, 215, 0, 0.6);
  border-radius: 4px;
  font-size: 0.5rem;
  font-weight: 800;
  padding: 0 2px;
  line-height: 1.1;
  pointer-events: none;
  white-space: nowrap;
}


/* THANH 4 ĐIỂM NGHỆ ĐẠO TỨ TUYỆT PHÒNG TÂM TÌNH */
.kx-tl-art-points-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 10px;
  padding: 5px 8px;
  margin-bottom: 8px;
  gap: 6px;
}

.kx-tl-art-point-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 600;
}

.kx-tl-art-point-item b {
  color: #fef08a;
  font-family: 'SF Mono', monospace;
}

/* NÚT SONG TU TÚ BÀ BỊ ÂM 5% TU VI */
.kx-btn-song-tu.boss-warning {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  border-color: #fca5a5 !important;
  color: #fff !important;
  animation: kxPulse 1.8s infinite;
}


/* =============================================================================
   HỢP NHẤT GIAO DIỆN ĐAN DƯỢC & LUYỆN ĐAN (kx-view-danduoc)
   ============================================================================= */
/* =============================================================================
   HỢP NHẤT GIAO DIỆN ĐAN DƯỢC & LUYỆN ĐAN (ONEVIEW SIÊU GỌN - KHÔNG SCROLL)
   ============================================================================= */
.kx-view-danduoc .kx-feature-modal-body {
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 4px 6px calc(var(--kx-bottom-dock-h, 56px) + 6px) 6px !important;
  box-sizing: border-box !important;
}

@media (min-height: 520px) {
  .kx-view-danduoc .kx-feature-modal-body {
    overflow-y: hidden !important;
  }
}

.kx-danduoc-unified-wrapper {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-bottom: 0;
  flex: 1 1 auto;
}

.kx-danduoc-unified-card {
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 8px;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.kx-danduoc-unified-card.alchemy-card {
  border-color: rgba(255, 145, 0, 0.35);
}

.kx-danduoc-unified-card.consume-card {
  border-color: rgba(16, 185, 129, 0.35);
}

.kx-danduoc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kx-danduoc-section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.4px;
  color: var(--text-bright);
  text-transform: uppercase;
}

.kx-danduoc-section-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: #ff9100;
  border: 1px solid rgba(255, 145, 0, 0.3);
  background: rgba(255, 145, 0, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

/* 1. KHUNG 2 CỘT CHO LÒ LUYỆN ĐAN */
.kx-danduoc-unified-card .kx-alchemy-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(110px, 32%) minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
}

@media (min-width: 640px) {
  .kx-danduoc-unified-card .kx-alchemy-container {
    grid-template-columns: 180px minmax(0, 1fr) !important;
    gap: 10px !important;
  }
}

.kx-danduoc-unified-card .kx-alchemy-furnace-stage {
  min-width: 0 !important;
  min-height: 145px !important;
  box-sizing: border-box !important;
  padding: 6px 4px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  position: relative !important;
  overflow: hidden !important;
  background: rgba(10, 14, 23, 0.75) !important;
  border: 1.2px solid rgba(255, 109, 0, 0.35) !important;
  border-radius: 9px !important;
}

.kx-danduoc-unified-card .kx-furnace-body-compact {
  width: 44px !important;
  height: 44px !important;
  margin: 0 auto !important;
  flex-shrink: 0 !important;
  position: relative !important;
}

.kx-furnace-img-compact {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.kx-danduoc-unified-card .kx-furnace-meta-wrap {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  justify-content: flex-end !important;
}

.kx-danduoc-unified-card .kx-furnace-title-compact {
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  color: #ff9100 !important;
  letter-spacing: 0.3px !important;
  text-align: center !important;
  margin-top: 2px !important;
}

.kx-danduoc-unified-card #active-alchemy-box {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 3px 4px !important;
  margin: 1px 0 !important;
  background: rgba(0, 0, 0, 0.88) !important;
  border: 1px solid var(--border-gold) !important;
  border-radius: 6px !important;
  box-shadow: 0 0 10px rgba(255, 109, 0, 0.4) !important;
}

.kx-danduoc-unified-card #active-alchemy-timer {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
}

.kx-danduoc-unified-card #active-recipe-name {
  font-size: 0.68rem !important;
}

.kx-danduoc-unified-card .kx-alchemy-stocks {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  margin-top: 2px !important;
}

.kx-danduoc-unified-card .kx-stock-pill {
  width: 100% !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 1px 5px !important;
  font-size: 0.64rem !important;
  border-radius: 5px !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-sizing: border-box !important;
}

.kx-danduoc-unified-card .kx-alchemy-recipes-stage {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 4px !important;
}

.kx-danduoc-unified-card #alchemy-recipes-grid {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex: 1 1 auto !important;
  justify-content: space-between !important;
}

/* 3 Ô ĐẠI DIỆN PHẨM CẤP SIÊU GỌN (2 HÀNG/Ô) */
.kx-alchemy-tier-box {
  background: rgba(14, 20, 32, 0.88);
  border: 1px solid var(--tier-border, rgba(0, 229, 255, 0.3));
  border-radius: 8px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.kx-alchemy-tier-box:hover {
  border-color: var(--tier-accent, var(--border-cyan));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 8px var(--tier-glow, rgba(0, 229, 255, 0.2));
}

.kx-alchemy-tier-box.is-active-crafting {
  border-color: #ff9100 !important;
  box-shadow: 0 0 12px rgba(255, 145, 0, 0.35) !important;
  background: rgba(28, 20, 14, 0.94) !important;
}

.kx-tier-box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kx-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--tier-accent, var(--gold-glow));
  white-space: nowrap;
  flex-shrink: 0;
}

.kx-tier-badge i {
  font-size: 0.72rem;
}

.kx-tier-badge .kx-tier-sub {
  font-size: 0.58rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 4px;
  border-radius: 3px;
  margin-left: 2px;
}

.kx-tier-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.kx-tier-nav-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.56rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.kx-tier-nav-btn:hover:not(:disabled) {
  background: var(--tier-border, rgba(0, 229, 255, 0.3));
  color: #fff;
  border-color: var(--tier-accent, #00e5ff);
}

.kx-tier-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.kx-tier-select-wrap {
  position: relative;
  min-width: 0;
  max-width: 195px;
  flex: 1 1 auto;
}

.kx-tier-select {
  width: 100%;
  height: 20px;
  background: rgba(10, 15, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #f8fafc;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0 16px 0 5px;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease;
}

.kx-tier-select:focus, .kx-tier-select:hover {
  border-color: var(--tier-accent, var(--gold-glow));
}

.kx-tier-select option {
  background: #0d1322;
  color: #f1f5f9;
  font-size: 0.74rem;
  padding: 3px 5px;
}

.kx-tier-select-arrow {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.56rem;
  color: var(--text-muted);
}

.kx-tier-box-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.kx-tier-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.kx-tier-stats-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.66rem;
  color: #cbd5e1;
  flex-wrap: wrap;
  min-width: 0;
  line-height: 1.2;
}

.kx-tier-stats-row b {
  color: #f8fafc;
}

.kx-tier-reward {
  font-weight: 700;
  font-size: 0.64rem;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.kx-tier-lock-msg {
  font-size: 0.6rem;
  color: #f87171;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px dashed rgba(239, 68, 68, 0.35);
  border-radius: 3px;
  padding: 0 4px;
  width: fit-content;
}

.kx-tier-action {
  flex-shrink: 0;
}

.kx-tier-action .kx-recipe-btn {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  height: 27px !important;
  padding: 0 3px !important;
  font-size: 0.69rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  white-space: nowrap !important;
  text-align: center !important;
  border-radius: 5px !important;
}

/* 2. DƯỢC PHÒNG PHỤC DỤNG & XUẤT BÁN (SIÊU GỌN) */
.kx-dan-mini-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.7rem;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.kx-dan-mini-hero-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kx-dan-mini-hero-right {
  font-weight: 700;
}

.kx-dan-safe-badge {
  font-size: 0.62rem;
  color: var(--emerald-glow);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
}

.kx-dan-slider-container {
  width: 100%;
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 8px;
  box-sizing: border-box;
  margin-bottom: 5px;
}

.kx-dan-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.kx-dan-slider-target {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.kx-dan-slider-label {
  font-size: 0.68rem;
  color: #cbd5e1;
  font-weight: 600;
}

.kx-dan-slider-value b {
  font-size: 0.92rem;
  font-family: var(--font-heading);
  color: var(--gold-glow);
  font-weight: 800;
}

.kx-dan-slider-value small {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.kx-dan-slider-marks {
  display: inline-flex;
  gap: 3px;
}

.kx-dan-mark-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.kx-dan-mark-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--emerald-glow);
  color: #fff;
}

.kx-dan-range-wrap {
  width: 100%;
  padding: 3px 0 4px 0;
  box-sizing: border-box;
}

.kx-dan-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 4px;
  background: linear-gradient(to right, #10b981 var(--slider-pct, 0%), rgba(255, 255, 255, 0.15) var(--slider-pct, 0%));
  outline: none;
  cursor: pointer;
  margin: 0;
}

.kx-dan-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 30%, #eab308 100%);
  border: 1.5px solid #fff;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.8);
  cursor: grab;
}

.kx-dan-range-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 30%, #eab308 100%);
  border: 1.5px solid #fff;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.8);
  cursor: grab;
}

.kx-dan-preview-card {
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 3px;
}

.kx-dan-preview-chips {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.66rem;
}

.kx-dan-pv-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kx-dan-risk-indicator {
  font-size: 0.6rem;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}

.kx-dan-risk-indicator.safe {
  color: #34d399;
}

.kx-dan-risk-indicator.danger {
  color: #f87171;
}

.kx-view-danduoc .kx-dan-action-row.kx-dan-action-dual {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 !important;
}

.kx-view-danduoc .kx-dan-btn-split {
  width: 100% !important;
  padding: 4px 6px !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  min-height: 31px !important;
  height: 31px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.kx-view-danduoc .kx-dan-btn-sell {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.5)) !important;
  border: 1px solid rgba(16, 185, 129, 0.6) !important;
  color: #a7f3d0 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25) !important;
}

.kx-view-danduoc .kx-dan-btn-sell:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(5, 150, 105, 0.7)) !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
}

.kx-view-danduoc .kx-dan-btn-sell:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}

.kx-tl-petal-pillar {
  font-size: 0.66rem !important;
  font-weight: 800 !important;
  color: #fde047 !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9) !important;
  line-height: 1.2 !important;
  margin-bottom: 2px !important;
  display: block !important;
}

.kx-tl-petal-title {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9) !important;
  line-height: 1.2 !important;
  margin-bottom: 2px !important;
  display: block !important;
}

.kx-tl-petal-name {
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  font-family: var(--font-heading) !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95) !important;
  line-height: 1.2 !important;
  display: block !important;
  white-space: nowrap !important;
}

.kx-tl-price-tag {
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  color: #fef08a !important;
  font-family: 'SF Mono', monospace !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  margin-left: 3px !important;
}

/* THIẾT KẾ CỘT AVATAR GIẢM DẦN KÍCH THƯỚC THEO GIÁ TIỀN */
.kx-tl-corner-quick-avatars {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
  position: absolute !important;
  z-index: 6 !important;
  pointer-events: auto !important;
}

/* Nút chấn phái to nhất (32px) */
.kx-tl-quick-avatar-btn.pillar-btn {
  width: 32px !important;
  height: 32px !important;
  border: 2px solid #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.85) !important;
}

/* SỬA LỖI TRÀN HEADER VÀ TIMER BADGE PHÒNG TÂM TÌNH */
.kx-tl-active-bar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  width: 100% !important;
}

.kx-tl-active-info {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

#tl-portrait-desc {
  max-width: 180px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.72rem !important;
  line-height: 1.2 !important;
}

.kx-tl-tools-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

.kx-tl-timer-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(251, 191, 36, 0.45) !important;
  border-radius: 14px !important;
  padding: 2px 4px 2px 7px !important;
  font-size: 0.72rem !important;
  white-space: nowrap !important;
}

.kx-btn-extend-time {
  padding: 2px 6px !important;
  font-size: 0.68rem !important;
  border-radius: 10px !important;
}

.kx-tl-tool-btn {
  padding: 3px 8px !important;
  font-size: 0.72rem !important;
  border-radius: 12px !important;
}


/* TRIỆT ĐỂ ẨN DẢI NÚT GIAI NHÂN PHỤ BỊ TRÙNG LẶP */
#tl-corner-juniors-strip,
.kx-tl-juniors-strip {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* CHỮ UỐN CONG THEO ĐƯỜNG TRÒN CỦA TÚ BÀ / TÚ ÔNG */
.kx-tl-boss-curved-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.kx-tl-boss-curved-svg text {
  fill: #ffd700;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  stroke: #050811;
  stroke-width: 3px;
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9));
}

/* Đáy vòng tròn có bóng mờ bán nguyệt giúp chữ nổi rõ */
.kx-tl-center-boss::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.4) 65%, rgba(0, 0, 0, 0.85) 90%);
  pointer-events: none;
  z-index: 2;
}



/* ==========================================================================
   CĂN CHỈNH CHUẨN XÁC: ICON CHẤN LẦU CÙNG HÀNG VỚI 3 DÒNG CHỮ Ở 4 GÓC
   ========================================================================== */

/* 2 GÓC TRÊN: Icon Chấn Lầu (32px) ở ĐỈNH CÙNG HÀNG với 3 dòng chữ ở ĐỈNH */
.kx-tl-petal.top-left .kx-tl-corner-quick-avatars {
  top: 8px !important;
  bottom: auto !important;
  left: 8px !important;
  right: auto !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}
.kx-tl-petal.top-left .kx-tl-petal-label {
  padding-top: 8px !important;
  padding-left: 48px !important;
}

.kx-tl-petal.top-right .kx-tl-corner-quick-avatars {
  top: 8px !important;
  bottom: auto !important;
  right: 8px !important;
  left: auto !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}
.kx-tl-petal.top-right .kx-tl-petal-label {
  padding-top: 8px !important;
  padding-right: 48px !important;
}

/* 2 GÓC DƯỚI: Icon Chấn Lầu (32px) ở ĐÁY CÙNG HÀNG với 3 dòng chữ ở ĐÁY */
.kx-tl-petal.bottom-left .kx-tl-corner-quick-avatars {
  bottom: 8px !important;
  top: auto !important;
  left: 8px !important;
  right: auto !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
}
.kx-tl-petal.bottom-left .kx-tl-petal-label {
  padding-bottom: 8px !important;
  padding-left: 48px !important;
}

.kx-tl-petal.bottom-right .kx-tl-corner-quick-avatars {
  bottom: 8px !important;
  top: auto !important;
  right: 8px !important;
  left: auto !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
}
.kx-tl-petal.bottom-right .kx-tl-petal-label {
  padding-bottom: 8px !important;
  padding-right: 48px !important;
}

/* ẨN VĨNH VIỄN KHỐI CHỌN JUNIOR CŨ TRÙNG LẶP */
#tl-corner-juniors-strip,
.kx-tl-corner-juniors-strip {
  display: none !important;
}

/* TÚ BÀ / TÚ ÔNG (BOSS) CHỮ UỐN CONG THEO ĐƯỜNG TRÒN ĐÁY */
.kx-tl-center-boss-tag {
  display: none !important;
}

.kx-tl-boss-curved-svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 5 !important;
}

.kx-tl-boss-curved-svg text {
  fill: #ffd700 !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  letter-spacing: 1.5px !important;
  stroke: #050811 !important;
  stroke-width: 3.5px !important;
  paint-order: stroke fill !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.95)) !important;
}


/* ==========================================================================
   TÂM TÌNH TRI KỶ & MICRO ĐÀM ĐẠO BẰNG GIỌNG NÓI
   ========================================================================== */

.kx-tl-soulmate-memory-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 12px;
  background: rgba(244, 114, 182, 0.08);
  border-bottom: 1px solid rgba(244, 114, 182, 0.2);
  font-size: 0.72rem;
  color: #f472b6;
}

.kx-tl-soulmate-badge {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kx-tl-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25) 0%, rgba(236, 72, 153, 0.4) 100%);
  border: 1.5px solid rgba(244, 114, 182, 0.65);
  color: #f472b6;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.kx-tl-mic-btn:hover {
  transform: scale(1.08);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
}

.kx-tl-mic-btn.recording {
  background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.95), 0 0 0 4px rgba(239, 68, 68, 0.35) !important;
  animation: kxMicPulse 1.2s infinite ease-in-out;
}

@keyframes kxMicPulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { transform: scale(1.12); box-shadow: 0 0 20px rgba(239, 68, 68, 1), 0 0 0 6px rgba(239, 68, 68, 0.2); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 0 0 rgba(239, 68, 68, 0); }
}

.kx-tl-msg-action {
  font-style: italic;
  color: #f9a8d4;
  opacity: 0.95;
  font-weight: 500;
  display: inline;
}


/* BẢO ĐẢM 4 CÁNH PETAL VÀ BOSS TRUNG TÂM NẰM ĐÚNG VỊ TRÍ TUYỆT ĐỐI */
.kx-tl-mandala-stage .kx-tl-petal {
  position: absolute !important;
  width: calc(50% - 4px) !important;
  height: calc(50% - 4px) !important;
  cursor: pointer !important;
  overflow: hidden !important;
  z-index: 2 !important;
  display: block !important;
  box-sizing: border-box !important;
  border-radius: 14px !important;
}

.kx-tl-mandala-stage .kx-tl-petal.top-left {
  top: 2px !important;
  left: 2px !important;
  bottom: auto !important;
  right: auto !important;
}

.kx-tl-mandala-stage .kx-tl-petal.top-right {
  top: 2px !important;
  right: 2px !important;
  bottom: auto !important;
  left: auto !important;
}

.kx-tl-mandala-stage .kx-tl-petal.bottom-left {
  bottom: 2px !important;
  left: 2px !important;
  top: auto !important;
  right: auto !important;
}

.kx-tl-mandala-stage .kx-tl-petal.bottom-right {
  bottom: 2px !important;
  right: 2px !important;
  top: auto !important;
  left: auto !important;
}

.kx-tl-mandala-stage .kx-tl-petal img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.kx-tl-mandala-stage .kx-tl-center-boss {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 152px !important;
  height: 152px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  overflow: hidden !important;
  z-index: 5 !important;
  display: block !important;
}


/* ==========================================================================
   TỐI GIẢN ICON CÔNG CỤ & ĐIỂM TỨ TUYỆT NGHỆ ĐẠO (BỎ TEXT, GIỮ ICON)
   ========================================================================== */

/* Nhóm công cụ trên thanh header phòng Tâm Tình */
.kx-tl-tools-group {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

/* Badge thời gian đếm ngược */
.kx-tl-timer-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: rgba(0, 0, 0, 0.7) !important;
  border: 1px solid rgba(234, 179, 8, 0.5) !important;
  padding: 3px 6px 3px 8px !important;
  border-radius: 14px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #ffd700 !important;
}

/* Nút (+) Gia hạn thời gian */
.kx-btn-extend-time {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  font-size: 0.65rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  margin-left: 2px !important;
}
.kx-btn-extend-time:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.9) !important;
}

/* Nút tròn công cụ: Đổi Giai Nhân (👥), Xóa Chat (🔄) */
.kx-tl-tool-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  color: #e2e8f0 !important;
}
.kx-tl-tool-btn.btn-switch-beauty {
  color: #ffd700 !important;
  border-color: rgba(255, 215, 0, 0.35) !important;
}
.kx-tl-tool-btn.btn-switch-beauty:hover {
  background: rgba(255, 215, 0, 0.2) !important;
  transform: scale(1.12) !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6) !important;
}
.kx-tl-tool-btn.btn-clear-chat {
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
.kx-tl-tool-btn.btn-clear-chat:hover {
  background: rgba(244, 63, 94, 0.22) !important;
  color: #fecdd3 !important;
  border-color: rgba(244, 63, 94, 0.5) !important;
  transform: scale(1.12) !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.6) !important;
}

/* Thanh Điểm Tứ Tuyệt Nghệ Đạo: 🎵 0  🪶 0  🪭 0  🍵 0 */
.kx-tl-art-points-bar {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  border-radius: 8px !important;
  padding: 2px 8px !important;
}

.kx-tl-art-point-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
}
.kx-tl-art-point-item i {
  font-size: 0.76rem !important;
}
.kx-tl-art-point-item b {
  font-size: 0.76rem !important;
}


/* =============================================================================
   HỆ THỐNG GIAO DIỆN CO GIÃN ĐỘNG (FLUID RESPONSIVE ENGINE) THEO % / VH / DVH / CLAMP
   Thay thế toàn bộ fix-chết px, đảm bảo thích ứng mượt mà trên mọi thiết bị
   (Mobile nhỏ 360px -> Tablet 768px-1024px -> Desktop -> Xoay ngang màn hình)
   ============================================================================= */

/* 1. KHUNG CHAT TÂM TÌNH (THANH LÂU): FLUID AUTO-FILL 100% CHIỀU CAO KHẢ DỤNG */
#tl-panel-chat.active {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  max-height: calc(100dvh - var(--kx-header-h, 44px) - var(--kx-bottom-dock-h, 48px) - 2vh) !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  padding: clamp(6px, 1.2vh, 12px) clamp(6px, 1.5vw, 14px) !important;
}

#tl-panel-chat:not(.active),
.kx-view-thanh_lau .kx-tl-tab-pane:not(.active) {
  display: none !important;
}

/* Các thanh cố định nội dung không bao giờ bị co rúm */
#tl-panel-chat .kx-tl-active-bar,
#tl-panel-chat .kx-tl-affection-box,
#tl-panel-chat .kx-tl-soulmate-memory-bar,
#tl-panel-chat .kx-tl-quick-actions,
#tl-panel-chat .kx-tl-input-bar,
#tl-panel-chat .kx-tl-bottom-hints {
  flex-shrink: 0 !important;
}

/* Khung chat stream: TỰ ĐỘNG LẤP ĐẦY 100% CHIỀU CAO CÒN LẠI (KHÔNG CẦN TRỪ PX FIX CỨNG) */
#tl-panel-chat .kx-tl-chat-stream {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(6px, 1vh, 10px) !important;
  padding: clamp(4px, 0.8vh, 8px) 4px !important;
  scrollbar-width: thin !important;
}

#tl-panel-chat .kx-tl-msg-bubble {
  padding: clamp(6px, 1vh, 10px) clamp(8px, 1.5vw, 12px) !important;
  font-size: clamp(0.78rem, 1.8vw, 0.86rem) !important;
  line-height: 1.45 !important;
  border-radius: 12px !important;
  background: rgba(8, 12, 24, 0.40) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.8) !important;
  transition: opacity 0.3s ease, background 0.3s ease !important;
}

#tl-panel-chat .kx-tl-msg.beauty .kx-tl-msg-bubble {
  border-left: 2.5px solid rgba(236, 72, 153, 0.7) !important;
}

#tl-panel-chat .kx-tl-msg.cultivator .kx-tl-msg-bubble {
  border-right: 2.5px solid rgba(0, 229, 255, 0.7) !important;
}

#tl-panel-chat .kx-tl-msg:not(:last-child) {
  opacity: 0.65;
  transition: opacity 0.25s ease;
}

#tl-panel-chat .kx-tl-msg:hover {
  opacity: 1 !important;
}

/* Chế độ Ngắm Dung Nhan (Làm mờ chữ chat để lộ hình mỹ nhân) */
#tl-panel-chat.dimmed-chat #tl-chat-stream {
  opacity: 0.12 !important;
  transition: opacity 0.35s ease !important;
}

#tl-panel-chat.dimmed-chat #tl-chat-stream:hover,
#tl-panel-chat.dimmed-chat #tl-chat-stream:active {
  opacity: 0.88 !important;
}

#btn-tl-toggle-dim.active {
  background: rgba(236, 72, 153, 0.35) !important;
  border-color: #ec4899 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.6) !important;
}

/* 2. CỘT NÚT NHANH NỔI BÊN PHẢI: DẠNG ICON TRÒN XẾP DỌC THẲNG VỚI CỘT BÊN PHẢI (THẾ CHỖ AVATAR BẢN THÂN NGƯỜI CHƠI) */
#tl-panel-chat {
  position: relative !important;
}

#tl-panel-chat .kx-tl-quick-actions {
  position: absolute !important;
  right: clamp(10px, 1.5vw, 16px) !important;
  left: auto !important;
  top: clamp(140px, 22vh, 185px) !important;
  width: clamp(38px, 5.5vw, 44px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: clamp(8px, 1.2vh, 12px) !important;
  z-index: 25 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

#tl-panel-chat .kx-tl-quick-actions button,
#tl-panel-chat .kx-tl-quick-actions .kx-tl-quick-btn {
  width: clamp(34px, 4.8vw, 40px) !important;
  height: clamp(34px, 4.8vw, 40px) !important;
  min-width: clamp(34px, 4.8vw, 40px) !important;
  min-height: clamp(34px, 4.8vw, 40px) !important;
  border-radius: 50% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45) !important;
  cursor: pointer !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease !important;
  flex-shrink: 0 !important;
}

#tl-panel-chat .kx-tl-quick-actions button:hover,
#tl-panel-chat .kx-tl-quick-actions .kx-tl-quick-btn:hover {
  transform: scale(1.18) !important;
  box-shadow: 0 0 14px currentColor !important;
  filter: brightness(1.2) !important;
}

/* Thụt lề phải cho khung chat stream để tin nhắn không đè lên cột nút nhanh nổi bên phải, trả lại lề trái tự nhiên */
#tl-panel-chat .kx-tl-chat-stream {
  padding-left: clamp(8px, 1.2vw, 12px) !important;
  padding-right: clamp(52px, 7.5vw, 64px) !important;
}

/* Responsive Header và nút gửi trên Mobile / Tablet */
@media (max-width: 768px) {
  #tl-panel-chat .kx-tl-send-btn .kx-tl-send-lbl {
    display: none !important;
  }
  #tl-panel-chat #tl-portrait-desc {
    display: none !important;
  }
  #tl-panel-chat .kx-tl-affection-text {
    display: none !important;
  }
  #tl-panel-chat .kx-tl-soulmate-hint {
    display: none !important;
  }
  #tl-panel-chat .kx-tl-active-info > div > div:first-child {
    flex-wrap: nowrap !important;
  }
  #tl-panel-chat .kx-tl-affection-box > div:first-child {
    flex-wrap: nowrap !important;
  }
  #tl-panel-chat #tl-portrait-name {
    font-size: clamp(0.8rem, 2vw, 0.9rem) !important;
    white-space: nowrap !important;
  }
  #tl-panel-chat #tl-portrait-title {
    font-size: clamp(0.6rem, 1.4vw, 0.66rem) !important;
    max-width: 80px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* 3. BẢNG PHONG THẦN: CHIA TỈ LỆ % TOÀN DIỆN (FLUID TABLE LAYOUT) */
.kx-phongthan-container {
  width: min(96vw, 860px) !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.kx-phongthan-table-wrap {
  width: 100% !important;
  max-height: clamp(200px, 38vh, 48vh) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
}

.kx-phongthan-table {
  width: 100% !important;
  table-layout: fixed !important;
}

.kx-phongthan-table thead tr {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
}

.kx-phongthan-table th,
.kx-phongthan-table td {
  padding: clamp(5px, 0.9vh, 9px) clamp(4px, 1vw, 8px) !important;
}

.kx-col-rank {
  width: clamp(36px, 9vw, 44px) !important;
  text-align: center !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
}

.kx-col-cultivator {
  width: auto !important;
  min-width: 0 !important;
}

.kx-col-tuvi {
  width: clamp(75px, 24vw, 110px) !important;
  min-width: clamp(75px, 24vw, 110px) !important;
  font-size: clamp(0.76rem, 1.8vw, 0.88rem) !important;
  text-align: right !important;
  padding-right: 8px !important;
  white-space: nowrap !important;
}

@media (max-width: 880px) {
  /* Bảng Phong Thần 3 Cột Thống Nhất Cho Mobile: Luôn Vừa Vặn 100%, Không Bị Tràn */
  .kx-phongthan-podium {
    gap: 6px;
    margin: 6px 0 12px 0;
  }
  .kx-podium-val {
    font-size: 0.76rem;
  }
  .kx-col-rank {
    width: clamp(34px, 9vw, 40px) !important;
  }
  .kx-col-tuvi {
    width: clamp(75px, 24vw, 95px) !important;
    min-width: clamp(75px, 24vw, 95px) !important;
    padding-right: 4px !important;
  }
  .kx-rank-sub-row {
    font-size: clamp(0.65rem, 1.5vw, 0.72rem);
  }
}

/* 4. CHẤP PHÁP: TỐI ƯU TOÀN DIỆN CHO DESKTOP, TABLET & MOBILE */
.kx-super-container {
  width: 100% !important;
  max-width: min(98vw, 980px) !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  padding: 0 4px !important;
}

/* Tabs Chấp Pháp: Desktop 4 cột, Tablet & Mobile Grid 2x2 */
.kx-admin-tabs {
  width: 100% !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
  background: rgba(13, 20, 36, 0.75) !important;
  padding: 8px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.45) !important;
}

@media (max-width: 900px) {
  .kx-admin-tabs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    padding: 6px !important;
  }
}

@media (max-width: 540px) {
  .kx-admin-tabs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px !important;
    padding: 5px !important;
    margin-bottom: 8px !important;
  }
}

.kx-admin-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: clamp(8px, 1.2vh, 12px) clamp(8px, 1.2vw, 12px) !important;
  border-radius: 10px !important;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  transition: all 0.25s ease;
  user-select: none;
  min-height: 48px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .kx-admin-tab-btn {
    padding: 8px 10px !important;
    min-height: 46px !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    text-align: left !important;
  }
  .kx-admin-tab-btn .tab-main-title {
    font-size: 0.82rem !important;
    flex-direction: row !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }
  .kx-admin-tab-btn .tab-sub-title {
    display: none !important;
  }
}

@media (max-width: 540px) {
  .kx-admin-tab-btn {
    padding: 6px 8px !important;
    min-height: 42px !important;
  }
  .kx-admin-tab-btn .tab-main-title {
    font-size: 0.76rem !important;
    gap: 5px !important;
  }
  .kx-admin-tab-btn .tab-main-title i {
    font-size: 0.85rem !important;
  }
}

/* Thanh công cụ quản lý tu sĩ */
.kx-admin-cultivators-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.kx-admin-toolbar-title {
  color: var(--cyan-glow);
  font-size: clamp(0.85rem, 1.6vw, 0.98rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kx-admin-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.kx-admin-filter-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-cyan);
  border-radius: 8px;
  padding: 2px;
  gap: 3px;
}

.kx-admin-btn-pill {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  border-radius: 6px !important;
}

.kx-admin-btn-toggle {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  border-radius: 8px !important;
  color: var(--gold-glow) !important;
  border-color: rgba(255, 215, 0, 0.4) !important;
  background: rgba(255, 215, 0, 0.08) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.kx-admin-btn-toggle.active {
  background: rgba(255, 215, 0, 0.22) !important;
  border-color: var(--gold-glow) !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3) !important;
}

.kx-admin-btn-clear-bots {
  background: rgba(255, 23, 68, 0.2) !important;
  border: 1px solid #ff1744 !important;
  color: #ff5252 !important;
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

/* Chế độ xem Thẻ (Card View) - Cuộn mượt mà trên Mobile & Tablet */
.kx-admin-cards-wrap {
  width: 100%;
  box-sizing: border-box;
}

.kx-admin-cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.kx-admin-cultivator-card {
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.kx-admin-cultivator-card:hover {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
  transform: translateY(-1px);
}

.kx-admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.kx-admin-card-lead {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kx-admin-card-id {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: monospace;
}

.kx-admin-card-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.kx-tag-guest {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 167, 38, 0.2);
  border: 1px solid rgba(255, 167, 38, 0.4);
  color: #ffa726;
}

.kx-tag-real {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.kx-admin-card-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kx-card-delete-btn {
  background: rgba(255, 23, 68, 0.2) !important;
  border: 1px solid #ff1744 !important;
  color: #ff5252 !important;
  padding: 4px 8px !important;
  font-size: 0.72rem !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kx-card-delete-btn:hover {
  background: rgba(255, 23, 68, 0.4) !important;
  transform: scale(1.05);
}

.kx-admin-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  border-radius: 8px;
}

.kx-admin-cstat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  gap: 4px;
}

.kx-cstat-lbl {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.kx-cstat-val {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.kx-cstat-val.cyan { color: var(--cyan-glow); }
.kx-cstat-val.gold { color: var(--gold-glow); }
.kx-cstat-val.emerald { color: var(--emerald-glow); }
.kx-cstat-val.muted { color: var(--text-muted); }

.kx-admin-card-foot {
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  padding-top: 6px;
}

.kx-admin-card-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.kx-admin-card-info-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Chế độ xem Bảng (Table View) - 12 Cột Chuyên Nghiệp */
.kx-admin-table-view-container {
  width: 100%;
  box-sizing: border-box;
}

.kx-admin-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  max-height: clamp(320px, 52vh, 600px) !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: pan-x pan-y !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0, 229, 255, 0.22) !important;
  background: rgba(10, 16, 28, 0.85) !important;
  scrollbar-width: thin !important;
  scrollbar-color: var(--cyan-glow) rgba(0, 0, 0, 0.3) !important;
  box-sizing: border-box !important;
}

.kx-admin-cultivators-table {
  width: 100% !important;
  min-width: 960px !important;
  border-collapse: collapse !important;
  font-size: clamp(0.76rem, 1.5vw, 0.84rem) !important;
  text-align: left !important;
}

.kx-admin-cultivators-table thead tr {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7, 11, 20, 0.96) !important;
  backdrop-filter: blur(8px);
}

.kx-admin-cultivators-table th {
  padding: 10px 8px !important;
  color: var(--text-muted) !important;
  font-size: 0.78rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25) !important;
  box-shadow: 0 1px 0 rgba(0, 229, 255, 0.2) !important;
  white-space: nowrap !important;
}

.kx-admin-cultivators-table td {
  padding: 8px 8px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.kx-scroll-hint {
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.7rem, 1.5vw, 0.78rem);
  color: var(--cyan-glow);
  margin-bottom: 5px;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .kx-scroll-hint {
    display: flex !important;
  }
}

/* Các Phòng Chấp Pháp Khác: Form co giãn linh hoạt */
.kx-admin-panel-box {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.kx-admin-panel-box.godmode {
  max-width: 680px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-cyan);
  border-radius: 12px;
  padding: 18px;
}

.kx-admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.kx-form-field {
  width: 100%;
  box-sizing: border-box;
}

.kx-field-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.kx-field-input, .kx-field-textarea {
  width: 100% !important;
  padding: 8px 12px !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid var(--border-cyan) !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-size: 0.9rem !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.kx-field-textarea {
  resize: none;
  margin-bottom: 10px;
}

.kx-admin-qr-preview-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed var(--border-gold);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.kx-preview-title {
  color: var(--gold-glow);
  font-size: 0.88rem;
  display: block;
  margin-bottom: 8px;
}

.kx-preview-img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  display: inline-block;
}

.kx-admin-broadcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.kx-admin-subcard {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  width: 100%;
}

.kx-admin-subcard.gold { border: 1px solid var(--border-gold); }
.kx-admin-subcard.cyan { border: 1px solid var(--border-cyan); }

.kx-subcard-title {
  margin-bottom: 10px;
  font-size: 0.98rem;
}
.kx-subcard-title.gold { color: var(--gold-glow); }
.kx-subcard-title.cyan { color: var(--cyan-glow); }

.kx-admin-godmode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 10px;
  width: 100%;
}

.kx-godmode-btn {
  padding: 10px !important;
  font-size: 0.82rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border-radius: 8px !important;
}

/* 5. TÁN LỘC THÍ TIÊN (VIETQR & GÓI ỦNG HỘ FLUID SCALE) */
.kx-donate-modal-box {
  width: min(94vw, 780px) !important;
  max-width: 94vw !important;
  max-height: min(88dvh, 88vh) !important;
  overflow-y: auto !important;
  padding: clamp(10px, 2vh, 18px) clamp(12px, 2.5vw, 22px) !important;
  gap: clamp(6px, 1.2vh, 12px) !important;
  box-sizing: border-box !important;
  border-radius: clamp(12px, 2vw, 20px) !important;
}

.kx-donate-title {
  font-size: clamp(1rem, 2.2vw, 1.25rem) !important;
}

.kx-donate-sub {
  font-size: clamp(0.68rem, 1.4vw, 0.78rem) !important;
  line-height: 1.35 !important;
}

.kx-donate-bank-badge {
  padding: clamp(4px, 0.8vh, 7px) clamp(8px, 1.5vw, 14px) !important;
  font-size: clamp(0.7rem, 1.5vw, 0.82rem) !important;
}

/* Màn hình Tablet & Trung Bình (<= 900px): Khung 2 cột cân xứng 50% - 50% */
@media (max-width: 900px) {
  .kx-donate-twocol {
    grid-template-columns: 1fr 1fr !important;
    gap: clamp(8px, 1.5vw, 12px) !important;
    align-items: center !important;
  }
  .kx-donate-grid-compact {
    grid-template-columns: 1fr !important;
    gap: clamp(4px, 0.8vh, 6px) !important;
  }
  .kx-donate-pack-btn {
    padding: clamp(5px, 0.9vh, 8px) clamp(6px, 1.2vw, 10px) !important;
    gap: 8px !important;
  }
  .kx-donate-pack-icon {
    font-size: clamp(1rem, 2vw, 1.2rem) !important;
  }
  .kx-donate-pack-title {
    font-size: clamp(0.7rem, 1.5vw, 0.78rem) !important;
  }
  .kx-donate-pack-amt {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem) !important;
  }
  .kx-donate-qr-card {
    padding: clamp(6px, 1.2vh, 10px) !important;
  }
  .kx-donate-qr-title {
    font-size: clamp(0.78rem, 1.6vw, 0.86rem) !important;
  }
  .kx-donate-qr-amount {
    font-size: clamp(0.95rem, 2vw, 1.15rem) !important;
    margin-bottom: clamp(2px, 0.5vh, 5px) !important;
  }
  .kx-donate-qr-img-wrapper img {
    width: clamp(100px, 16vh, 130px) !important;
    height: clamp(100px, 16vh, 130px) !important;
  }
}

/* Màn hình Mobile (< 640px): 1 cột cuộn mượt, 6 gói dạng grid 3x2, QR bên dưới */
@media (max-width: 640px) {
  .kx-donate-bank-badge {
    flex-direction: column !important;
    text-align: center !important;
    gap: 2px !important;
  }
  .kx-donate-twocol {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .kx-donate-grid-compact {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }
  .kx-donate-pack-btn {
    padding: 4px 3px !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 2px !important;
  }
  .kx-donate-pack-info {
    text-align: center !important;
  }
  .kx-donate-pack-title {
    font-size: 0.64rem !important;
  }
  .kx-donate-pack-amt {
    font-size: 0.76rem !important;
  }
  .kx-donate-notice-pill {
    margin-top: 4px !important;
    font-size: 0.62rem !important;
    padding: 3px 6px !important;
  }
  .kx-donate-qr-img-wrapper img {
    width: clamp(95px, 26vw, 115px) !important;
    height: clamp(95px, 26vw, 115px) !important;
  }
}


/* =============================================================================
   HỆ THỐNG KHUNG GIAO DIỆN MODULE BASE (k*b.html) & THIẾT KẾ CO GIÃN TỈ LỆ (% / vh / vw)
   - Loại bỏ fix pixel cứng nhắc, mọi phân hệ co giãn linh hoạt theo tỷ lệ màn hình
   - Các giao diện con (submenu) hiển thị tròn chịa, vừa khít, cân đối trong khung
   - Chữ nghĩa (typography) auto co giãn thích ứng theo kích thước hiển thị
   ============================================================================= */

:root {
  --kx-header-h: clamp(40px, 6vh, 52px);
  --kx-top-action-h: clamp(38px, 5.5vh, 48px);
  --kx-bottom-dock-h: clamp(44px, 6.5vh, 56px);
  --kx-fluid-radius-frame: clamp(14px, 2vmin, 26px);
  --kx-fluid-radius-card: clamp(10px, 1.6vmin, 18px);
  --kx-fluid-radius-btn: clamp(8px, 1.3vmin, 14px);
  --kx-fluid-radius-pill: clamp(16px, 3vmin, 30px);
}

/* 1. KHUNG GIAO DIỆN MODULE BASE & VIEWPORT */
.kx-module-frame {
  display: contents;
}

.kx-module-viewport {
  display: contents;
}

/* 2. THANH ĐIỀU HƯỚNG SUBMENU / ACTION BAR CỦA MỖI MODULE BASE */
.kx-bottom-action-bar {
  position: fixed !important;
  top: calc(var(--kx-header-h) + clamp(4px, 1vh, 10px)) !important;
  bottom: auto !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: clamp(280px, 94vw, 740px) !important;
  max-width: 96vw !important;
  height: var(--kx-top-action-h) !important;
  min-height: 0 !important;
  padding: clamp(2px, 0.4vh, 6px) clamp(4px, 1vw, 12px) !important;
  gap: clamp(2px, 0.6vw, 8px) !important;
  border-radius: var(--kx-fluid-radius-pill) !important;
  box-sizing: border-box !important;
  z-index: 920 !important;
}

.kx-bottom-action-bar .kx-bottom-action-btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  height: 100% !important;
  padding: clamp(2px, 0.3vh, 4px) clamp(2px, 0.5vw, 6px) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--kx-fluid-radius-btn) !important;
  box-sizing: border-box !important;
}

.kx-bottom-action-bar .kx-bottom-action-icon {
  font-size: clamp(0.85rem, 1.6vmin, 1.25rem) !important;
  line-height: 1 !important;
  margin-bottom: clamp(1px, 0.2vh, 3px) !important;
}

.kx-bottom-action-bar .kx-bottom-action-lbl {
  font-size: clamp(0.6rem, 0.95vw + 0.25vh, 0.78rem) !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

.kx-bottom-action-bar .kx-bottom-action-sub {
  font-size: clamp(0.5rem, 0.75vw + 0.2vh, 0.62rem) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  opacity: 0.85 !important;
}

.kx-bottom-action-bar .kx-bottom-action-badge {
  font-size: clamp(0.48rem, 0.7vw + 0.18vh, 0.6rem) !important;
  padding: 1px clamp(3px, 0.5vw, 6px) !important;
  border-radius: var(--kx-fluid-radius-pill) !important;
}

/* 3. KHUNG HIỂN THỊ CÁC GIAO DIỆN CON (SUBMENU VIEWS) VỪA KHÍT & TRÒN TRỊA */
.kx-feature-modal {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 20 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: stretch !important;
}

.kx-feature-modal-box {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
}

.kx-feature-modal-body,
.kx-view-bequan .kx-feature-modal-body,
.kx-view-danghuong .kx-feature-modal-body,
.kx-view-tongmon .kx-feature-modal-body,
.kx-view-dongphu .kx-feature-modal-body,
.kx-view-dotpha .kx-feature-modal-body,
.kx-view-travel .kx-feature-modal-body,
.kx-view-alchemy .kx-feature-modal-body,
.kx-view-divination .kx-feature-modal-body,
.kx-view-danduoc .kx-feature-modal-body,
.kx-view-reincarnation .kx-feature-modal-body,
.kx-view-thanh_lau .kx-feature-modal-body,
.kx-view-marriage .kx-feature-modal-body,
.kx-view-phongthan .kx-feature-modal-body,
.kx-view-chat .kx-feature-modal-body,
.kx-view-super .kx-feature-modal-body,
.kx-view-thienthu .kx-feature-modal-body,
.kx-view-danhhieu .kx-feature-modal-body,
.kx-view-donate .kx-feature-modal-body,
.kx-view-hoso .kx-feature-modal-body,
.kx-view-global-panel .kx-feature-modal-body {
  width: 100% !important;
  height: 100% !important;
  padding-top: calc(var(--kx-header-h) + var(--kx-top-action-h) + clamp(8px, 1.8vh, 20px)) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h) + clamp(10px, 2vh, 22px) + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: clamp(6px, 1.8vw, 16px) !important;
  padding-right: clamp(6px, 1.8vw, 16px) !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

/* 4. TẤT CẢ PHẦN TỬ BÊN TRONG CÁC SUBMENU: CO GIÃN THEO %, VH, VW & TRÒN TRỊA */
.kx-bequan-active-card,
.kx-bequan-card,
.kx-incense-burner-box,
.kx-cave-hero-banner,
.kx-cave-tier-card,
.kx-active-voyage-card,
.kx-travel-card,
.kx-danduoc-unified-card,
.kx-vd-panel,
.kx-phongthan-container,
.kx-super-container,
.kx-marriage-card,
.kx-tl-dialogue-box,
.kx-tl-courtesan-card,
.kx-samsara-card {
  width: 100% !important;
  max-width: min(96vw, 860px) !important;
  border-radius: var(--kx-fluid-radius-card) !important;
  box-sizing: border-box !important;
}

/* 5. HỆ THỐNG CHỮ TỰ ĐỘNG THEO MÀN HÌNH (AUTO FLUID TYPOGRAPHY) */
.kx-feature-modal h3,
.kx-feature-modal .kx-view-title {
  font-size: clamp(1rem, 1.5vw + 0.7vh, 1.4rem) !important;
  line-height: 1.25 !important;
}

.kx-feature-modal h4,
.kx-section-title,
.kx-bequan-title,
.kx-cave-hero-name,
.kx-voyage-realm {
  font-size: clamp(0.85rem, 1.15vw + 0.5vh, 1.15rem) !important;
  line-height: 1.3 !important;
}

.kx-feature-modal h5,
.kx-cave-tier-title,
.kx-recipe-title {
  font-size: clamp(0.76rem, 1vw + 0.4vh, 0.98rem) !important;
  line-height: 1.3 !important;
}

.kx-feature-modal p,
.kx-bequan-desc,
.kx-cave-tier-desc,
.kx-travel-desc {
  font-size: clamp(0.7rem, 0.9vw + 0.3vh, 0.88rem) !important;
  line-height: 1.4 !important;
}

.kx-feature-modal .kx-btn,
.kx-feature-modal button:not(.kx-modal-close) {
  border-radius: var(--kx-fluid-radius-btn) !important;
  font-size: clamp(0.72rem, 0.95vw + 0.3vh, 0.9rem) !important;
}

/* 6. SUBMENU TU NHÂN (kProfile.html): CHIA ĐỀU TỈ LỆ 50% / 50% KHÔNG BỊ TRÀN */
.kx-view-profile .kx-feature-modal-body {
  padding-top: calc(var(--kx-header-h) + clamp(4px, 1vh, 10px)) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h) + clamp(6px, 1.2vh, 12px) + env(safe-area-inset-bottom, 0px)) !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  gap: clamp(4px, 0.8vh, 10px) !important;
}

.kx-view-profile .kx-tunhan-stage {
  height: 50% !important;
  max-height: 50% !important;
  border-radius: var(--kx-fluid-radius-card) !important;
  overflow: hidden !important;
}

.kx-view-profile .kx-cankhon-stage {
  height: 50% !important;
  max-height: 50% !important;
  border-radius: var(--kx-fluid-radius-card) !important;
  overflow: hidden !important;
}

.kx-view-profile .kx-tunhan-stat-card {
  border-radius: var(--kx-fluid-radius-btn) !important;
  padding: clamp(2px, 0.5vh, 5px) clamp(4px, 0.8vw, 8px) !important;
}

.kx-view-profile .kx-stat-number {
  font-size: clamp(0.72rem, 1.0vw + 0.3vh, 0.92rem) !important;
}

.kx-view-profile .kx-stat-text-val {
  font-size: clamp(0.62rem, 0.85vw + 0.2vh, 0.74rem) !important;
  max-width: 58% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: right !important;
}

.kx-view-profile .kx-bag-slot {
  border-radius: var(--kx-fluid-radius-btn) !important;
}

/* 7. SUBMENU BÁT HOANG (kTravel.html) & ĐAN DƯỢC (kDanDuoc.html) & THIÊN CƠ (kDivination.html) */
.kx-travel-grid {
  width: 100% !important;
  max-width: min(96vw, 840px) !important;
  gap: clamp(6px, 1.2vmin, 14px) !important;
}

.kx-travel-card {
  border-radius: var(--kx-fluid-radius-card) !important;
}

.kx-travel-card .kx-travel-img-thumb {
  height: clamp(65px, 14vh, 120px) !important;
  border-radius: clamp(8px, 1.2vmin, 14px) !important;
}

.kx-danduoc-unified-wrapper {
  width: 100% !important;
  max-width: min(96vw, 860px) !important;
  gap: clamp(8px, 1.4vh, 16px) !important;
}

/* 8. SUBMENU THANH LÂU (kThanhLau.html) & HỒNG TRẦN: 1 DÒNG DUY NHẤT, KHÔNG MÀU NỀN, KHÔNG BORDER */
.kx-tl-nav-bar-row {
  width: 100% !important;
  max-width: min(96vw, 760px) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: clamp(2px, 0.4vh, 6px) clamp(2px, 0.6vw, 8px) !important;
  gap: clamp(2px, 0.6vw, 6px) !important;
}

.kx-tl-nav-tab-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: clamp(2px, 0.4vh, 5px) clamp(1px, 0.4vw, 4px) !important;
}

.kx-tl-courtesan-card {
  border-radius: var(--kx-fluid-radius-card) !important;
}

/* 9. SUBMENU THIÊN ĐẠO (kChat.html, kSect.html, kSuper.html) */
.kx-vd-panel.kx-chat {
  width: 100% !important;
  max-width: min(98vw, 880px) !important;
  height: 100% !important;
  border-radius: var(--kx-fluid-radius-card) !important;
}

.kx-chat-sidebar {
  border-radius: var(--kx-fluid-radius-card) 0 0 var(--kx-fluid-radius-card) !important;
}

.kx-chat-main {
  border-radius: 0 var(--kx-fluid-radius-card) var(--kx-fluid-radius-card) 0 !important;
}

.kx-chat-input input {
  border-radius: var(--kx-fluid-radius-pill) !important;
  font-size: clamp(0.72rem, 0.95vw + 0.3vh, 0.9rem) !important;
}

.kx-phongthan-table-wrap {
  border-radius: var(--kx-fluid-radius-card) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

.kx-phongthan-table th,
.kx-phongthan-table td {
  font-size: clamp(0.68rem, 0.9vw + 0.25vh, 0.85rem) !important;
  padding: clamp(4px, 0.8vh, 10px) clamp(4px, 0.8vw, 10px) !important;
}


/* =============================================================================
   THANH ĐIỀU HƯỚNG ĐÁY (KX-FLOATING-DOCK) - LOẠI BỎ HOÀN TOÀN MÀU NỀN & BORDER
   Theo yêu cầu người dùng: Bỏ hết nền và viền của thanh dock và 5 nút menu
   ============================================================================= */
.kx-floating-dock {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.kx-dock-item,
.kx-dock-item.cave,
.kx-dock-item.nhanvat,
.kx-dock-item.hero-center,
.kx-dock-item.lichluyen,
.kx-dock-item.hongtran,
.kx-dock-item.thiendao {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

.kx-dock-item:hover,
.kx-dock-item:focus,
.kx-dock-item:active,
.kx-dock-item.active,
.kx-dock-item.cave:hover,
.kx-dock-item.cave.active,
.kx-dock-item.nhanvat:hover,
.kx-dock-item.nhanvat.active,
.kx-dock-item.hero-center:hover,
.kx-dock-item.hero-center.active,
.kx-dock-item.lichluyen:hover,
.kx-dock-item.lichluyen.active,
.kx-dock-item.hongtran:hover,
.kx-dock-item.hongtran.active,
.kx-dock-item.thiendao:hover,
.kx-dock-item.thiendao.active {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}


/* =============================================================================
   HỒNG TRẦN: HỢP NHẤT NHÂN DUYÊN VÀO TAB BÊN PHẢI LUYỆN TÂM, BỎ ACTION BAR TRÊN
   ============================================================================= */
#kx-action-bar-hongtran {
  display: none !important;
}

.kx-view-thanh_lau .kx-feature-modal-body {
  padding-top: calc(var(--kx-header-h) + clamp(4px, 1vh, 10px)) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h) + clamp(6px, 1.2vh, 12px) + env(safe-area-inset-bottom, 0px)) !important;
}

.kx-tl-nav-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-around !important;
  gap: clamp(1px, 0.4vw, 6px) !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.kx-tl-nav-tab-btn {
  white-space: nowrap !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: clamp(2px, 0.4vh, 5px) clamp(1px, 0.4vw, 3px) !important;
}

#tl-panel-marriage.active {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 1040px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  padding: clamp(6px, 1.2vh, 14px) clamp(6px, 1.5vw, 16px) !important;
}

#tl-panel-marriage:not(.active) {
  display: none !important;
}


/* NÚT TOGGLE 1-CLICK CHUYỂN ĐỔI GIAI NHÂN (🌸) <-> MỸ NAM (👑) */
.kx-tl-zone-toggle-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(236, 72, 153, 0.4) !important;
  border-radius: 50% !important;
  width: clamp(28px, 4.5vmin, 34px) !important;
  height: clamp(28px, 4.5vmin, 34px) !important;
  min-width: clamp(28px, 4.5vmin, 34px) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: clamp(1rem, 2.2vmin, 1.2rem) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.35) !important;
  padding: 0 !important;
}

.kx-tl-zone-toggle-btn:hover {
  transform: scale(1.15) rotate(15deg) !important;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.6) !important;
}

.kx-tl-zone-toggle-btn.zone-male {
  border-color: rgba(255, 215, 0, 0.5) !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.45) !important;
}

.kx-tl-zone-toggle-btn.zone-male:hover {
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.7) !important;
}


/* =============================================================================
   NÂNG CẤP TOÀN DIỆN GIAO DIỆN ĐẠI TÔNG MÔN (kDongPhu / kTongMon)
   ============================================================================= */
.kx-tongmon-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(8, 14, 26, 0.95));
  border: 1.5px solid rgba(0, 229, 255, 0.35);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.kx-tongmon-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 180%;
  background: radial-gradient(circle at 20% 50%, var(--hero-accent-color, rgba(0, 229, 255, 0.12)), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.kx-tongmon-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  position: relative;
  z-index: 1;
  flex: 1;
}

.kx-tongmon-hero-crest {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: radial-gradient(circle, var(--hero-accent-bg, rgba(0, 229, 255, 0.2)) 0%, rgba(12, 18, 32, 0.9) 100%);
  border: 1.5px solid var(--hero-accent-color, var(--cyan-glow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  color: var(--hero-accent-color, var(--cyan-glow));
  flex-shrink: 0;
  box-shadow: 0 0 18px var(--hero-accent-glow, rgba(0, 229, 255, 0.35));
  transition: all 0.3s ease;
}

.kx-tongmon-hero-info {
  flex: 1;
  min-width: 0;
}

.kx-tongmon-hero-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.kx-tongmon-hero-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.kx-tongmon-hero-role {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--hero-accent-color, var(--cyan-glow));
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--hero-accent-color, var(--cyan-glow));
  border-radius: 8px;
  padding: 2px 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.kx-tongmon-hero-name {
  font-size: 1.28rem;
  font-weight: 800;
  color: #fff;
  margin: 2px 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 12px var(--hero-accent-glow, rgba(0, 229, 255, 0.5));
  letter-spacing: 0.3px;
}

.kx-tongmon-hero-motto {
  font-size: 0.8rem;
  color: #cbd5e1;
  font-style: italic;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.kx-tongmon-hero-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.kx-tongmon-chip {
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.kx-tongmon-chip.chip-cyan {
  background: rgba(0, 229, 255, 0.1);
  color: var(--cyan-glow);
  border-color: rgba(0, 229, 255, 0.3);
}

.kx-tongmon-chip.chip-gold {
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold-glow);
  border-color: rgba(255, 215, 0, 0.3);
}

.kx-tongmon-chip.chip-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.kx-tongmon-chip.chip-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.kx-tongmon-chip.chip-buff {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(0, 229, 255, 0.1));
  color: #fef08a;
  border-color: rgba(255, 215, 0, 0.4);
  font-weight: 800;
}

.kx-tongmon-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.kx-btn-leave-sect {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.kx-btn-leave-sect:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.kx-btn-chat-sect {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: var(--cyan-glow);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.kx-btn-chat-sect:hover {
  background: rgba(0, 229, 255, 0.3);
  border-color: var(--cyan-glow);
  color: #fff;
  transform: translateY(-1px);
}

/* SECTION HEADER & FILTER BAR */
.kx-tongmon-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.kx-tongmon-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kx-tongmon-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.4px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.kx-tongmon-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.kx-tongmon-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 2px;
}

.kx-filter-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.kx-filter-pill:hover {
  color: #fff;
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.08);
}

.kx-filter-pill.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(255, 215, 0, 0.15));
  border-color: var(--cyan-glow);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* SECT CARD GRID */
.kx-sects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 14px;
  width: 100%;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.kx-sect-card {
  position: relative;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.92), rgba(9, 14, 26, 0.96));
  border: 1px solid var(--sect-border, rgba(0, 229, 255, 0.22));
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.kx-sect-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sect-color, #00e5ff), transparent);
  opacity: 0.8;
}

.kx-sect-card:hover {
  transform: translateY(-3px);
  border-color: var(--sect-color, var(--cyan-glow));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 20px var(--sect-glow, rgba(0, 229, 255, 0.25));
}

.kx-sect-card.is-joined {
  border-color: #10b981;
  background: linear-gradient(165deg, rgba(6, 32, 24, 0.92), rgba(8, 18, 24, 0.96));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(16, 185, 129, 0.3);
}

.kx-sect-card.is-joined::before {
  background: linear-gradient(90deg, transparent, #10b981, transparent);
}

.kx-sect-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.kx-sect-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.kx-sect-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: radial-gradient(circle, var(--sect-bg, rgba(0, 229, 255, 0.2)) 0%, rgba(10, 15, 26, 0.85) 100%);
  border: 1.5px solid var(--sect-color, #00e5ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sect-color, #00e5ff);
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--sect-glow, rgba(0, 229, 255, 0.25));
  transition: transform 0.2s ease;
}

.kx-sect-card:hover .kx-sect-icon-box {
  transform: scale(1.06);
}

.kx-sect-headings {
  min-width: 0;
  flex: 1;
}

.kx-sect-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kx-sect-name {
  color: var(--sect-color, var(--gold-glow));
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.kx-sect-leader-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.kx-sect-leader-meta i {
  color: var(--gold-glow);
  font-size: 0.68rem;
}

.kx-sect-tag-pill {
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--sect-border, rgba(0, 229, 255, 0.3));
  background: var(--sect-bg, rgba(0, 229, 255, 0.1));
  color: var(--sect-color, var(--cyan-glow));
}

.kx-sect-motto {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-style: italic;
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 2px solid var(--sect-color, var(--cyan-glow));
  line-height: 1.4;
  opacity: 0.95;
}

.kx-sect-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 10px;
}

.kx-sect-perk-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed var(--sect-border, rgba(0, 229, 255, 0.3));
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.75rem;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.kx-sect-perk-box i {
  color: var(--gold-glow);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.kx-sect-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kx-sect-total-tuvi {
  font-size: 0.74rem;
  color: var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kx-sect-total-tuvi b {
  font-weight: 800;
  font-size: 0.82rem;
}

.kx-btn-join-sect {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(255, 215, 0, 0.2));
  border: 1px solid var(--sect-color, var(--cyan-glow));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 12px var(--sect-glow, rgba(0, 229, 255, 0.25));
}

.kx-btn-join-sect:hover {
  background: var(--sect-color, var(--cyan-glow));
  color: #000;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 16px var(--sect-glow, rgba(0, 229, 255, 0.45));
}

.kx-sect-active-chip {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* PHONG THẦN PORTAL BANNER */
.kx-phongthan-portal-banner {
  background: linear-gradient(135deg, rgba(20, 24, 45, 0.9), rgba(15, 20, 36, 0.95));
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 16px;
  padding: 14px 18px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 215, 0, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}

.kx-phongthan-portal-banner:hover {
  border-color: var(--gold-glow);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.35);
}

.kx-phongthan-portal-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.kx-phongthan-portal-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, rgba(15, 20, 35, 0.9) 100%);
  border: 1px solid var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-glow);
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.kx-phongthan-portal-texts {
  min-width: 0;
}

.kx-phongthan-portal-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.kx-phongthan-portal-desc {
  font-size: 0.74rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-phongthan-portal-btn {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 179, 0, 0.15));
  border: 1px solid var(--gold-glow);
  color: var(--gold-glow);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.kx-phongthan-portal-banner:hover .kx-phongthan-portal-btn {
  background: var(--gold-glow);
  color: #000;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
}

@media (max-width: 640px) {
  .kx-tongmon-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }
  .kx-tongmon-hero-actions {
    width: 100%;
    flex-direction: row;
    margin-top: 6px;
  }
  .kx-btn-leave-sect,
  .kx-btn-chat-sect {
    flex: 1;
  }
  .kx-sects-grid {
    grid-template-columns: 1fr;
  }
  .kx-phongthan-portal-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .kx-phongthan-portal-left {
    justify-content: center;
  }
  .kx-phongthan-portal-desc {
    white-space: normal;
  }
  .kx-phongthan-portal-btn {
    justify-content: center;
  }
}


/* HỘP THOẠI XÁC NHẬN TIÊN HIỆP (MODAL CONFIRM CÓ / KHÔNG) */
.kx-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: auto;
}
.kx-confirm-overlay.active {
  opacity: 1;
}
.kx-confirm-modal-box {
  background: linear-gradient(145deg, rgba(16, 24, 42, 0.98), rgba(9, 14, 26, 0.98));
  border: 1.5px solid var(--gold-glow);
  border-radius: 18px;
  max-width: 440px;
  width: 100%;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.25);
  transform: scale(0.92);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}
.kx-confirm-overlay.active .kx-confirm-modal-box {
  transform: scale(1);
}
.kx-confirm-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kx-confirm-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.kx-confirm-modal-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.kx-confirm-modal-body {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.6;
}
.kx-confirm-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.kx-btn-confirm-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.kx-btn-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.kx-btn-confirm-ok {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 8px 22px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: 1px solid;
}
.kx-btn-confirm-ok.is-gold {
  background: linear-gradient(135deg, #ffd700, #ffb300);
  color: #000;
  border-color: #ffd700;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.4);
}
.kx-btn-confirm-ok.is-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(255, 215, 0, 0.6);
}
.kx-btn-confirm-ok.is-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}
.kx-btn-confirm-ok.is-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.6);
}

/* ĐẠI ĐIỆN TÔNG MÔN TRẤN THỦ (KHI ĐÃ GIA NHẬP TÔNG MÔN) */
.kx-sect-hall {
  width: 100%;
  max-width: 880px;
  margin: 0 auto 16px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kx-sect-hall-banner {
  position: relative;
  border-radius: 20px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(16, 24, 42, 0.95), rgba(9, 14, 26, 0.96));
  border: 1.5px solid var(--sect-theme-color, var(--cyan-glow));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 25px var(--sect-theme-glow, rgba(0, 229, 255, 0.25));
  overflow: hidden;
}
.kx-sect-hall-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--sect-theme-glow, rgba(0, 229, 255, 0.25)) 0%, transparent 70%);
  pointer-events: none;
}
.kx-sect-hall-header {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.kx-sect-hall-crest {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: radial-gradient(circle, var(--sect-theme-bg, rgba(0, 229, 255, 0.25)) 0%, rgba(12, 18, 32, 0.9) 100%);
  border: 2px solid var(--sect-theme-color, var(--cyan-glow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--sect-theme-color, var(--cyan-glow));
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--sect-theme-glow, rgba(0, 229, 255, 0.35));
}
.kx-sect-hall-meta {
  flex: 1;
  min-width: 0;
}
.kx-sect-hall-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.kx-sect-hall-role-badge {
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 8px;
  padding: 3px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--sect-theme-color, var(--cyan-glow));
  color: var(--sect-theme-color, var(--cyan-glow));
}
.kx-sect-hall-tag-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-glow);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 6px;
  padding: 2px 8px;
}
.kx-sect-hall-name {
  font-size: 1.55rem;
  font-weight: 900;
  color: #fff;
  margin: 2px 0 6px 0;
  text-shadow: 0 0 16px var(--sect-theme-glow, rgba(0, 229, 255, 0.5));
  letter-spacing: 0.5px;
}
.kx-sect-hall-motto {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-style: italic;
  padding-left: 10px;
  border-left: 3px solid var(--sect-theme-color, var(--cyan-glow));
  margin-bottom: 8px;
  line-height: 1.45;
}
.kx-sect-hall-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.kx-sect-hall-stat-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.kx-sect-hall-stat-card i {
  font-size: 1.35rem;
  color: var(--sect-theme-color, var(--gold-glow));
}
.kx-sect-hall-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
.kx-sect-hall-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.kx-sect-hall-perk-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(0, 229, 255, 0.05));
  border: 1.5px dashed var(--sect-theme-color, var(--gold-glow));
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}
.kx-sect-hall-perk-card i {
  font-size: 1.6rem;
  color: var(--gold-glow);
  flex-shrink: 0;
}
.kx-sect-hall-perk-title {
  font-size: 0.76rem;
  color: var(--gold-glow);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kx-sect-hall-perk-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fef08a;
  margin-top: 2px;
}
.kx-sect-hall-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.kx-sect-action-btn {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: 1px solid;
}
.kx-sect-action-btn.btn-chat {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--cyan-glow);
}
.kx-sect-action-btn.btn-chat:hover {
  background: rgba(0, 229, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.35);
}
.kx-sect-action-btn.btn-worship {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 179, 0, 0.12));
  border-color: rgba(255, 215, 0, 0.4);
  color: var(--gold-glow);
}
.kx-sect-action-btn.btn-worship:hover {
  background: var(--gold-glow);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.45);
}
.kx-sect-action-btn.btn-switch {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
}
.kx-sect-action-btn.btn-switch:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: translateY(-2px);
}
.kx-sect-action-btn.btn-leave {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.kx-sect-action-btn.btn-leave:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

@media (max-width: 640px) {
  .kx-sect-hall-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .kx-sect-hall-actions {
    grid-template-columns: 1fr;
  }
  .kx-sect-hall-stats {
    grid-template-columns: 1fr;
  }
}


/* =============================================================================
   THÍNH PHONG CÁC · SIÊU THỊ BẢO VẬT & MẬT BÁO (SUPERMARKET PRODUCT CARDS)
   ============================================================================= */
.kx-tp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  padding-bottom: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.kx-tp-header-title b {
  color: var(--cyan-glow);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kx-tp-header-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kx-tp-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kx-tp-filter-group .kx-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
}

.kx-tp-scroll-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.kx-tp-section {
  display: flex;
  flex-direction: column;
}

.kx-tp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 6px;
}

.kx-tp-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kx-tp-section-title.theme-intel {
  color: var(--cyan-glow);
}

.kx-tp-section-title.theme-market {
  color: var(--gold-glow);
}

.kx-tp-section-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  white-space: nowrap;
}

.kx-tp-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 165px));
  gap: 14px;
  align-items: start;
}

.kx-tp-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 14, 26, 0.98) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.28);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.kx-tp-card.theme-market {
  border-color: rgba(245, 158, 11, 0.35);
}

.kx-tp-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--cyan-glow);
  box-shadow: 0 10px 25px rgba(0, 229, 255, 0.35);
}

.kx-tp-card.theme-market:hover {
  border-color: #f59e0b;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.35);
}

.kx-tp-card:active {
  transform: scale(0.96);
  opacity: 0.92;
}

.kx-tp-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #020617;
  overflow: hidden;
}

.kx-tp-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.kx-tp-card:hover .kx-tp-card-thumb {
  transform: scale(1.08);
}

.kx-tp-hover-buy-mask {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.kx-tp-card:hover .kx-tp-hover-buy-mask,
.kx-tp-card:active .kx-tp-hover-buy-mask {
  opacity: 1;
}

.kx-tp-hover-buy-mask i {
  font-size: 1.35rem;
  color: var(--cyan-glow);
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
}

.kx-tp-card.theme-market .kx-tp-hover-buy-mask i {
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

.kx-tp-tag-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.kx-tp-price-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1e1b4b;
  font-weight: 900;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.35);
  z-index: 3;
}


.kx-tp-market-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 12px;
  padding: 1.5px 8px;
  margin-right: 4px;
  white-space: nowrap;
}

.kx-tp-trend-badge {
  position: absolute;
  top: 6px;
  right: 32px;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1.5px 5px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.2px;
}

.kx-tp-trend-badge.up {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(185, 28, 28, 0.95));
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fef2f2;
}

.kx-tp-trend-badge.down {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.95));
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #ecfdf5;
}

.kx-tp-price-badge.down {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #064e3b;
  border-color: rgba(167, 243, 208, 0.6);
}

.kx-tp-price-badge.up {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border-color: rgba(254, 202, 202, 0.6);
}

.kx-tp-info-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #cbd5e1;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: all 0.2s ease;
  padding: 0;
}

.kx-tp-info-btn:hover {
  color: var(--cyan-glow);
  border-color: var(--cyan-glow);
  transform: scale(1.15);
  background: rgba(15, 23, 42, 0.98);
}

.kx-tp-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  padding: 7px 6px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kx-tp-card.theme-intel .kx-tp-card-name {
  color: #38bdf8;
}

.kx-tp-card.theme-market .kx-tp-card-name {
  color: #fbbf24;
}

/* Modal / Popover Tooltip Chi Tiết Vật Phẩm Khi Bấm Chọn */
.kx-tp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: kxFadeIn 0.2s ease;
}

.kx-tp-modal-box {
  background: linear-gradient(145deg, #0f172a, #0b0f19);
  border: 1.5px solid rgba(0, 229, 255, 0.4);
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 229, 255, 0.2);
  overflow: hidden;
  animation: kxZoomIn 0.22s ease;
}

.kx-tp-modal-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kx-tp-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =============================================================================
   RESPONSIVE MOBILE CHO THÍNH PHONG CÁC (2 CỘT SẢN PHẨM - IPHONE & ANDROID)
   ============================================================================= */
@media (max-width: 768px) {
  #tl-panel-kyngo {
    padding: 8px 8px !important;
  }

  .kx-tp-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    gap: 6px;
  }

  .kx-tp-header-title b {
    font-size: 0.9rem;
  }

  .kx-tp-header-desc {
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .kx-tp-filter-group {
    gap: 4px;
    width: 100%;
  }

  .kx-tp-filter-group .kx-btn {
    font-size: 0.72rem !important;
    padding: 3px 8px !important;
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  .kx-tp-scroll-body {
    gap: 12px !important;
  }

  .kx-tp-section-header {
    margin-bottom: 6px;
  }

  .kx-tp-section-title {
    font-size: 0.75rem;
  }

  .kx-tp-section-hint {
    font-size: 0.65rem;
  }

  /* 2 CỘT SẢN PHẨM TỰ ĐỘNG CÂN ĐỐI TRÊN MỌI THIẾT BỊ IPHONE & ANDROID */
  .kx-tp-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .kx-tp-card {
    border-radius: 10px;
    border-width: 1.2px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  }

  .kx-tp-card-thumb-wrap {
    aspect-ratio: 1 / 1;
  }

  .kx-tp-tag-badge {
    top: 4px;
    left: 4px;
    font-size: 0.58rem;
    padding: 1.5px 5px;
    border-radius: 4px;
  }

  .kx-tp-price-badge {
    bottom: 4px;
    right: 4px;
    font-size: 0.65rem;
    padding: 1.5px 5px;
    border-radius: 4px;
    gap: 3px;
  }


  .kx-tp-trend-badge {
    top: 4px;
    right: 27px;
    font-size: 0.52rem;
    padding: 1px 4px;
  }

  .kx-tp-info-btn {
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
  }

  .kx-tp-card-name {
    font-size: 0.72rem;
    padding: 5px 4px 4px;
    letter-spacing: 0;
  }

  .kx-tp-hover-buy-mask {
    font-size: 0.74rem;
    gap: 4px;
  }

  .kx-tp-hover-buy-mask i {
    font-size: 1.1rem;
  }

  /* Modal Tooltip Chi Tiết Sản Phẩm Mobile */
  .kx-tp-modal-overlay {
    padding: 12px;
  }

  .kx-tp-modal-box {
    border-radius: 14px;
  }

  .kx-tp-modal-header {
    padding: 10px 12px;
  }

  .kx-tp-modal-body {
    padding: 12px;
    gap: 10px;
  }

  #tl-tooltip-img {
    width: 78px !important;
    height: 78px !important;
  }

  #tl-tooltip-name {
    font-size: 0.94rem !important;
  }

  #tl-tooltip-cost {
    font-size: 0.86rem !important;
  }

  #tl-tooltip-desc {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
  }
}

/* --- Chống chồng chéo huy hiệu trên thẻ (mọi kích thước) --- */
.kx-tp-tag-badge {
  max-width: calc(100% - 38px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
#tl-tooltip-tag {
  max-width: none;
  overflow: visible;
  white-space: normal;
}
/* % biến động giá chuyển xuống góc dưới-trái, đối xứng với giá ở dưới-phải */
.kx-tp-trend-badge {
  top: auto;
  right: auto;
  bottom: 6px;
  left: 6px;
}

@media (max-width: 768px) {
  .kx-tp-trend-badge {
    top: auto;
    right: auto;
    bottom: 4px;
    left: 4px;
  }

  .kx-tp-tag-badge {
    max-width: calc(100% - 32px);
  }

  /* Vùng chạm dễ bấm hơn cho nút (i) */
  .kx-tp-info-btn {
    width: 24px;
    height: 24px;
  }

  .kx-tp-header-title b {
    line-height: 1.3;
    align-items: flex-start;
  }

  /* Nhãn lọc cuộn ngang thay vì rớt dòng */
  .kx-tp-filter-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .kx-tp-filter-group::-webkit-scrollbar { display: none; }
  .kx-tp-filter-group .kx-btn { white-space: nowrap; flex: 0 0 auto; }

  /* Chừa chỗ cho thanh điều hướng đáy / vùng an toàn iPhone */
  #tl-panel-kyngo {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .kx-tp-modal-box {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
}

/* Thiết bị cảm ứng: bỏ hiệu ứng hover bị "dính" sau khi chạm */
@media (hover: none) {
  .kx-tp-card:hover {
    transform: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 229, 255, 0.28);
  }
  .kx-tp-card.theme-market:hover { border-color: rgba(245, 158, 11, 0.35); }
  .kx-tp-card:hover .kx-tp-card-thumb { transform: none; }
  .kx-tp-card:hover .kx-tp-hover-buy-mask { opacity: 0; }
  .kx-tp-card:active .kx-tp-hover-buy-mask { opacity: 1; }
}

/* Tối ưu thêm cho màn hình siêu nhỏ (<= 360px như Galaxy cỡ nhỏ, iPhone SE 1st gen) */
@media (max-width: 360px) {
  .kx-tp-market-grid {
    gap: 6px !important;
  }

  .kx-tp-card-name {
    font-size: 0.66rem;
    padding: 4px 2px 3px;
  }

  .kx-tp-price-badge {
    font-size: 0.58rem;
    padding: 1px 4px;
  }

  .kx-tp-tag-badge {
    font-size: 0.52rem;
    padding: 1px 4px;
  }
}

/* =============================================================================
   HỒNG TRẦN LUYỆN TÂM - GIAO DIỆN & HOẠT ẢNH TIÊN ĐẠO (kHongTran LuyenTam)
============================================================================= */

.kx-lt-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  color: #f1f5f9;
  overflow-x: hidden;
}

/* 1. Header Banner Thần Bí (Sleek Compact 1-Row Responsive) */
.kx-lt-header {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.45), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(168, 85, 247, 0.1);
  box-sizing: border-box;
  width: 100%;
}

.kx-lt-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.kx-lt-title-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #c084fc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
  animation: lotusPulse 3s ease-in-out infinite alternate;
  flex-shrink: 0;
}

.kx-lt-title-text {
  min-width: 0;
  flex: 1;
}

.kx-lt-title-text h3 {
  margin: 0;
  font-size: clamp(0.82rem, 3.2vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #fff, #e9d5ff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-lt-title-text p {
  margin: 1px 0 0 0;
  font-size: 0.68rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-lt-status-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.kx-lt-pill {
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.kx-lt-pill.mind-state {
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.kx-lt-pill.mind-state.warning {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.kx-lt-pill.mind-state.danger {
  border-color: rgba(244, 63, 94, 0.6);
  color: #fb7185;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.35);
}

.kx-lt-pill.lt-val {
  border-color: rgba(255, 215, 0, 0.4);
  color: #ffd700;
}

/* 2. Middle Grid: Split 2 Columns (Tiên Đài bên trái | 5 Pháp Môn bên phải) */
.kx-lt-middle-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .kx-lt-middle-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.kx-lt-left-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

/* Tiên Đài Tĩnh Tọa Gọn Gàng (Interactive Altar) */
.kx-lt-altar-stage {
  position: relative;
  width: 100%;
  height: 125px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 55%, rgba(67, 24, 115, 0.45) 0%, rgba(15, 23, 42, 0.95) 70%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 4px 14px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Mandala Bát Quái Xoay Vần */
.kx-lt-mandala {
  position: absolute;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 1.5px dashed rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.2), inset 0 0 18px rgba(168, 85, 247, 0.15);
  animation: haloSpin 36s linear infinite;
  pointer-events: none;
}

.kx-lt-mandala::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
  animation: haloSpin 24s linear infinite reverse;
}

/* Tòa Sen Phát Sáng */
.kx-lt-lotus-throne {
  position: absolute;
  bottom: 12px;
  width: 95px;
  height: 24px;
  background: radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.4) 0%, rgba(0, 229, 255, 0.25) 55%, transparent 75%);
  border-radius: 50%;
  filter: blur(2px);
  animation: lotusPulse 3s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Hình tượng Tu Sĩ Đả Tọa */
.kx-lt-figure-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: floatMeditate 3.6s ease-in-out infinite;
  transition: transform 0.2s ease;
  margin-bottom: 8px;
}

.kx-lt-figure-wrap:hover {
  transform: scale(1.08);
}

.kx-lt-figure-silhouette {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(0, 229, 255, 0.15));
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.5), inset 0 0 10px rgba(0, 229, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e9d5ff;
  font-size: 1.35rem;
  transition: all 0.3s ease;
}

.kx-lt-figure-wrap:active .kx-lt-figure-silhouette {
  transform: scale(0.92);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
}

/* Huyễn Khí Dị Trạng (Miasma) khi Tâm Ma cao */
.kx-lt-miasma-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(244, 63, 94, 0.22) 0%, rgba(147, 51, 234, 0.18) 45%, transparent 75%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: miasmaSwirl 4s ease-in-out infinite alternate;
}

/* Hào Quang Thuần Khiết khi Tâm Ma = 0% */
.kx-lt-pure-aura {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.22) 0%, rgba(0, 229, 255, 0.15) 50%, transparent 75%);
  pointer-events: none;
  animation: pureAuraGlow 2.8s ease-in-out infinite alternate;
}

/* Nút Tĩnh Tọa Nhanh trên Tiên Đài */
.kx-lt-altar-action-btn {
  position: absolute;
  bottom: 6px;
  z-index: 3;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: #38bdf8;
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
  transition: all 0.2s ease;
  max-width: 90%;
  white-space: nowrap;
}

.kx-lt-altar-action-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.45);
}

/* 3. Bảng Giám Sát Tâm Ma & Thanh Tẩy (Cleanse Dashboard - Xếp Dọc Chuẩn UX) */
.kx-lt-cleanse-dashboard {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  width: 100%;
}

.kx-lt-cleanse-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.kx-lt-meter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.kx-lt-meter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.86rem;
  color: #f43f5e;
}

.kx-lt-meter-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.kx-lt-meter-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #f43f5e 100%);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

.kx-lt-afflictions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

.kx-lt-affliction-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.kx-lt-affliction-tag.pure {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Nút Đại Thừa Thanh Tẩy Full Width Hiện Đại */
.kx-lt-cleanse-cta-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 10px;
  color: #fff;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  margin-top: 2px;
}

.kx-lt-cleanse-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.55);
  filter: brightness(1.1);
}

.kx-lt-cleanse-cta-btn:active {
  transform: scale(0.98);
}

.kx-lt-cleanse-cta-btn small {
  font-size: 0.7rem;
  opacity: 0.95;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  white-space: nowrap;
}

/* Cột Phải: 5 Pháp Môn Luyện Tâm Tiêu Dao */
.kx-lt-right-col {
  display: flex;
  flex-direction: column;
  background: rgba(20, 15, 35, 0.65);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.kx-lt-actions-list-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

.kx-lt-act-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  transition: all 0.2s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.kx-lt-act-row:hover {
  background: rgba(88, 28, 135, 0.25);
  border-color: rgba(168, 85, 247, 0.4);
}

.kx-lt-act-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.kx-lt-act-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.kx-lt-act-row-info {
  min-width: 0;
  flex: 1;
  line-height: 1.25;
  overflow: hidden;
}

.kx-lt-act-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-lt-act-row-cost {
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.kx-lt-act-row-benefit {
  font-size: 0.67rem;
  color: #34d399;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.kx-lt-act-row-btn {
  padding: 6px 10px;
  min-width: 66px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.kx-lt-act-row-btn:hover {
  filter: brightness(1.2);
  transform: scale(1.03);
}

.kx-lt-act-row-btn:active {
  transform: scale(0.96);
}

.kx-lt-result-banner {
  margin-bottom: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
  font-size: 0.74rem;
  line-height: 1.35;
  width: 100%;
  box-sizing: border-box;
}

/* 4. Khối Thiên Phú Tâm Cảnh (Mind Talents Showcase - Responsive 5 -> 3 -> 2 Cột) */
.kx-lt-talent-section {
  background: rgba(20, 15, 35, 0.65);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
  width: 100%;
  box-sizing: border-box;
}

.kx-lt-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  width: 100%;
}

.kx-lt-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffd700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.kx-lt-talent-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .kx-lt-talent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .kx-lt-talent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kx-lt-talent-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
  cursor: pointer;
}

.kx-lt-talent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25);
}

.kx-lt-talent-card.unlocked {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.25), rgba(15, 23, 42, 0.75));
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

.kx-lt-talent-card.unlocked:hover {
  transform: translateY(-2px);
  border-color: #c084fc;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.kx-lt-talent-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.kx-lt-talent-icon-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.kx-lt-talent-name {
  font-weight: 800;
  font-size: 0.76rem;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kx-lt-talent-tier {
  font-size: 0.67rem;
  color: #ffd700;
  font-weight: 700;
}

.kx-lt-talent-desc {
  font-size: 0.66rem;
  color: #94a3b8;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kx-lt-talent-stars {
  font-size: 0.67rem;
  color: #ffd700;
  letter-spacing: 1px;
  margin-top: auto;
}

/* Modal Popup Chi Tiết Thiên Phú (Mobile & PC) */
.kx-lt-talent-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease;
}

.kx-lt-talent-modal-box {
  background: linear-gradient(135deg, #1e1136 0%, #0f172a 100%);
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(168, 85, 247, 0.3);
  box-sizing: border-box;
  animation: floatMeditate 0.3s ease;
  position: relative;
}

/* 6. Hoạt Ảnh Hoành Tráng (Overlays & Animations) */

/* 6.1 Hoạt Ảnh Thanh Tẩy (Cleanse Overlay) */
.kx-lt-overlay-cleanse {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.3) 0%, rgba(15, 23, 42, 0.95) 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 14px;
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

.kx-lt-cleanse-beam {
  position: absolute;
  top: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(52, 211, 153, 0.8) 50%, transparent 100%);
  filter: blur(8px);
  animation: cleanseBeamFall 1.2s ease-out forwards;
}

@keyframes cleanseBeamFall {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1.2); opacity: 0; }
}

.kx-lt-cleanse-shockwave {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid #34d399;
  box-shadow: 0 0 40px #34d399, inset 0 0 20px #34d399;
  animation: shockwaveExpand 1.2s ease-out forwards;
}

/* 6.2 Hoạt Ảnh Đột Phá Thiên Phú (Breakthrough Overlay) */
.kx-lt-overlay-breakthrough {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.3) 0%, rgba(15, 23, 42, 0.95) 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

.kx-lt-breakthrough-vortex {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px dashed #ffd700;
  box-shadow: 0 0 30px #f59e0b;
  animation: haloSpin 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.kx-lt-breakthrough-seal {
  font-size: 2.2rem;
  color: #ffd700;
  text-shadow: 0 0 25px #ff9800, 0 0 45px #ff5722;
  animation: flyTuVi 1.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

/* 6.3 Hoạt Ảnh Đấu Tửu Xúc Xắc (Dice Roll Overlay) */
.kx-lt-overlay-dice {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(10, 15, 25, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 14px;
  animation: fadeIn 0.3s ease;
}

.kx-lt-dice-table {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(236, 72, 153, 0.4);
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.2);
}

.kx-lt-dice-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kx-lt-dice-box {
  display: flex;
  gap: 10px;
}

.kx-lt-die {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 2px solid #6ee7b7;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 14px rgba(16, 185, 129, 0.5);
  animation: diceTumble 0.8s ease-out;
}

.kx-lt-die.opp {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  border-color: #fda4af;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 14px rgba(244, 63, 94, 0.5);
}

@keyframes diceTumble {
  0% { transform: rotate(0deg) scale(0.6); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Chữ nổi thông báo kết quả Luyện Tâm */
.kx-lt-result-banner {
  background: rgba(88, 28, 135, 0.2);
  border: 1px solid #c084fc;
  border-radius: 10px;
  padding: 12px 16px;
  color: #f3e8ff;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2);
}
/* =============================================================================
   TỐI ƯU GIAO DIỆN HẢO CẢM 2 DÒNG:
   DÒNG 1: 4 ĐIỂM NGHỆ ĐẠO + NÚT CHUỘC THÂN (TRÊN)
   DÒNG 2: TRÁI TIM + PROGRESS BAR (100% BÊN TRONG) + NÚT SONG TU (DƯỚI)
   ============================================================================= */
.kx-tl-affection-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(236, 72, 153, 0.25) !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  margin-bottom: 8px !important;
}

.kx-tl-affection-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
}

/* Đảm bảo 2 nút Chuộc Thân và Song Tu nằm CÙNG 1 CỘT BÊN PHẢI */
#btn-tl-redeem,
#btn-tl-song-tu {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  height: 24px !important;
  font-size: 0.72rem !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  margin-left: auto !important; /* Luôn ép sát lề phải để cùng cột */
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#btn-tl-redeem {
  background: rgba(255, 215, 0, 0.15) !important;
  border: 1px solid #ffd700 !important;
  color: #ffd700 !important;
}

#btn-tl-redeem:hover:not(:disabled) {
  background: rgba(255, 215, 0, 0.28) !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}

/* Dòng 2: Trái tim + Thanh tiến độ Hảo Cảm */
.kx-tl-progress-group {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

.kx-tl-heart-icon {
  font-size: 0.85rem !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.6)) !important;
}

.kx-tl-affection-progress {
  position: relative !important;
  flex: 1 1 0 !important;
  min-width: 40px !important;
  height: 15px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid rgba(236, 72, 153, 0.35) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

/* Chữ % (ví dụ: 100%) nằm giữa thanh tiến độ */
.kx-tl-bar-pct {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 5px rgba(0, 0, 0, 0.8) !important;
  font-family: 'SF Mono', monospace !important;
  pointer-events: none !important;
  z-index: 2 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

/* Thanh Điểm Tứ Tuyệt Nghệ Đạo */
.kx-tl-art-points-bar {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  border-radius: 8px !important;
  padding: 2px 8px !important;
  margin: 0 !important;
}

/* Responsive Mobile */
@media (max-width: 600px) {
  .kx-tl-affection-box {
    padding: 5px 8px !important;
    gap: 5px !important;
  }
  #btn-tl-redeem,
  #btn-tl-song-tu {
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    font-size: 0.69rem !important;
    height: 23px !important;
  }
  .kx-tl-art-points-bar {
    padding: 2px 5px !important;
    gap: 4px !important;
  }
  .kx-tl-art-point-item {
    font-size: 0.68rem !important;
    gap: 2px !important;
  }
}

@media (max-width: 380px) {
  #btn-tl-redeem,
  #btn-tl-song-tu {
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    font-size: 0.65rem !important;
  }
}

/* Căn chỉnh thanh nhắc nhở & trạng thái tâm trạng dưới khung chat */
#tl-panel-chat .kx-tl-bottom-hints {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.72rem !important;
  color: var(--text-muted) !important;
  margin-top: 5px !important;
  white-space: nowrap !important;
}

#tl-panel-chat #tl-chat-cost-hint {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  cursor: help !important;
}

#tl-panel-chat #tl-ai-status-indicator {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: right !important;
  max-width: 55% !important;
}


/* =============================================================================
   CHUYÊN BIỆT: BẾ QUAN NGỘ ĐẠO CỔ THỤ (FIT 100% VỪA VIEW)
   ============================================================================= */
#modal-feature-bequan.kx-view-bequan .kx-feature-modal-body,
#modal-feature-bequan .kx-feature-modal-body {
  height: 100% !important;
  max-height: 100% !important;
  padding-top: calc(var(--kx-header-h, 44px) + var(--kx-top-action-h, 42px) + 6px) !important;
  padding-bottom: calc(var(--kx-bottom-dock-h, 48px) + 6px + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: clamp(8px, 1.8vw, 16px) !important;
  padding-right: clamp(8px, 1.8vw, 16px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

@media (max-height: 520px) {
  #modal-feature-bequan.kx-view-bequan .kx-feature-modal-body,
  #modal-feature-bequan .kx-feature-modal-body {
    overflow-y: auto !important;
    justify-content: flex-start !important;
  }
}

/* =============================================================================
   MENU: VÙNG CHẠM TỐI THIỂU TRÊN CẢM ỨNG (iPhone / Android / Tablet)
   ============================================================================= */
@media (pointer: coarse) {
  .kx-tl-nav-tab-btn { min-height: 40px !important; }
  .kx-tl-gender-switch .kx-tl-zone-btn.icon-only {
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
  }
  .kx-profile-tab-pill { height: 40px !important; }
}
