/* --- TU TIEN DROPDOWN (BẢN REDESIGN HẮC ÁM 2 CỘT) --- */
@import url("https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Zhi+Mang+Xing&display=swap");

.tu-tien-dropdown {
  display: none;
  position: fixed; /* Bứt phá khỏi navbar, trở thành Floating Card */
  top: 85px; /* Nằm gọn ngay dưới Navbar */
  right: 5%; /* Đồng bộ lề với Navbar */
  width: 320px;
  max-height: calc(
    100dvh - 100px
  ); /* Dùng dvh thay vh để fix lỗi bottom-bar trên iOS Safari */
  overflow-y: auto; /* Bật thanh cuộn nếu màn hình quá nhỏ */
  background: var(--bg-dark);
  border-radius: 12px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.8),
    0 0 15px rgba(212, 175, 55, 0.2);
  z-index: var(--z-dropdown);
  border: 1px solid var(--dark-gold);
  animation: fadeIn 0.3s ease;
}

/* Tinh chỉnh thanh cuộn cho Menu */
.tu-tien-dropdown::-webkit-scrollbar {
  width: 5px;
}
.tu-tien-dropdown::-webkit-scrollbar-thumb {
  background: var(--dark-gold);
  border-radius: 3px;
}

/* Tấm khiên Backdrop che Zalo/Messenger khi mở Menu */
.tu-tien-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(
    --z-chat
  ); /* Che đè lên Chat (9990) nhưng vẫn nằm dưới Dropdown (9991) */
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tu-tien-backdrop.active {
  display: block;
  opacity: 1;
}
.tu-tien-dropdown.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Lưới Grid 2 Cột Thay Thế Danh Sách Dài */
.xianxia-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 15px;
  list-style: none;
  margin: 0;
}
.xianxia-menu-grid li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 12px 5px;
  color: #ccc;
  font-size: 0.75rem;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  height: 100%;
  text-align: center;
}
.xianxia-menu-grid li a i {
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.xianxia-menu-grid li a:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--dark-gold);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
}

/* Nút Đăng Xuất */
.btn-logout-xianxia {
  width: 100%;
  background: rgba(211, 47, 47, 0.1);
  color: #f44336;
  border: 1px solid var(--primary-red);
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn-logout-xianxia:hover {
  background: var(--primary-red);
  color: white;
  box-shadow: 0 0 10px rgba(211, 47, 47, 0.5);
}

/* AVATAR FRAMES */
.avatar-frame-item,
.frame-trucco,
.frame-ketdan,
.frame-nguyenanh {
  position: relative !important;
  display: inline-block;
  border-radius: 50%;
  background: transparent !important;
  border: none !important;
  animation: none !important;
  box-shadow: none !important;
  z-index: 1;
  padding: 5px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.frame-trucco::before,
.frame-ketdan::before,
.frame-nguyenanh::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  z-index: -1;
}
.frame-luyenkhi img {
  border: 3px solid #4caf50;
}
.frame-trucco::before {
  background: linear-gradient(45deg, #2196f3, #00bcd4);
  box-shadow: 0 0 10px #2196f3;
}
.frame-ketdan::before {
  background: conic-gradient(
    #ffeb3b,
    var(--accent-gold),
    #fff,
    var(--accent-gold),
    #ffeb3b
  );
  animation: spinBorder 4s linear infinite;
  box-shadow: 0 0 15px var(--accent-gold);
}
.frame-nguyenanh::before {
  background: conic-gradient(
    #f44336,
    var(--dark-red),
    #ffeb3b,
    var(--dark-red),
    #f44336
  );
  animation: spinBorder 2s linear infinite;
  box-shadow: 0 0 20px #f44336;
}
.frame-ketdan img,
.frame-nguyenanh img {
  animation: none !important;
  transform: none !important;
}
.admin-dragon-frame {
  position: relative;
  border: 4px solid var(--accent-gold) !important;
  box-shadow:
    0 0 20px #ff0000,
    inset 0 0 15px var(--accent-gold) !important;
  animation: admin_aura 1.5s infinite alternate !important;
}

/* PROFILE MODAL */
.profile-container {
  display: flex;
  gap: 30px;
  background: var(--bg-panel);
  color: #eee;
  padding: 30px;
  border-radius: 15px;
  border: 1px solid #333;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}
.profile-left {
  text-align: center;
  width: 30%;
  border-right: 1px solid #333;
  padding-right: 20px;
}
.profile-right {
  flex: 1;
}
.pro-avatar-box {
  position: relative; /* 3-layer overlay: frame đè lên avatar */
  width: 120px;
  height: 120px;
  margin: 0 auto 15px;
  border-radius: 50%;
  border: 3px dashed #555;
  overflow: visible; /* [v8.65] frame layer được phép bọc ra ngoài avatar circle */
  background: radial-gradient(ellipse at center, #1a0e2e, #080614); /* [v8.92] dark bg bắt buộc cho screen blend */
  isolation: isolate; /* [v8.92] stacking context cho mix-blend-mode */
}
.pro-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.pro-rank-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 5px;
  background: -webkit-linear-gradient(var(--accent-gold), #ffeb3b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}
.exp-bar-container {
  background: #333;
  height: 20px;
  border-radius: 10px;
  margin: 15px 0;
  position: relative;
  overflow: hidden;
  border: 1px solid #555;
}
.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  width: 0%;
  transition: width 0.5s;
}
.exp-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px black;
}

/* SHOP & LEADERBOARD */
/* BỎ SHOP BOX CŨ
.shop-box {
  ...
} */
.shop-tabs {
  display: flex;
  border-bottom: 2px solid #ddd;
  margin-bottom: 20px;
}
.shop-tab-btn {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: bold;
  color: #888;
  border: none;
  background: none;
  transition: 0.3s;
}
.shop-tab-btn.active {
  color: var(--primary-red);
  border-bottom: 3px solid var(--primary-red);
}
.shop-content {
  display: none;
  animation: fadeIn 0.3s;
}
.shop-content.active {
  display: block;
}
.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2a2a2a;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #444;
  color: #eee;
}
.item-preview {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border-radius: 50%;
  border: 1px solid #555;
}

/* BỎ RANK BOX VÀ HEADER CŨ
.rank-box { ... }
.rank-header { ... } */
.leaderboard-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
}
.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #2a2a2a;
  color: #eee;
  margin-bottom: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  border: 1px solid #444;
  transition: 0.2s;
  cursor: default;
}
.leaderboard-item:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  background: #333 !important;
  border-color: var(--accent-gold);
}
.leaderboard-item:nth-child(1) {
  border: 2px solid var(--accent-gold);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), transparent);
}
.leaderboard-item:nth-child(2) {
  border: 2px solid #c0c0c0;
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
}
.leaderboard-item:nth-child(3) {
  border: 2px solid #cd7f32;
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

/* WHEEL, CHAT, TOAST */
.cultivation-toast,
.toast-msg {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: rgba(40, 40, 40, 0.95);
  color: var(--accent-gold);
  padding: 12px 25px;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: var(--z-toast);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #555;
  opacity: 1;
  animation: slideDown 0.5s ease;
}
.wheel-btn {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 9995;
  background: linear-gradient(to right, #ffeb3b, var(--accent-gold));
  padding: 10px 15px 10px 10px;
  border-radius: 0 30px 30px 0;
  cursor: pointer;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
  font-weight: bold;
  color: var(--dark-red);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.3s;
}
.wheel-btn:hover {
  left: 5px;
}
.wheel-btn i {
  font-size: 24px;
  animation: spinIcon 2s infinite linear;
}
.wheel-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: var(--z-modal-top);
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}
.wheel-container {
  position: relative;
  width: 350px;
  height: 350px;
  background: white;
  border-radius: 50%;
  border: 10px solid #fff;
  box-shadow: 0 0 50px rgba(255, 235, 59, 0.5);
  overflow: hidden;
}
.the-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    #f44336 0deg 60deg,
    #ffeb3b 60deg 120deg,
    #2196f3 120deg 180deg,
    #4caf50 180deg 240deg,
    #9c27b0 240deg 300deg,
    #ff9800 300deg 360deg
  );
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}
.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid #333;
  z-index: 2;
}
.spin-btn-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: var(--primary-red);
  cursor: pointer;
  border: 4px solid #eee;
  z-index: 3;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.fb-chat-btn {
  position: fixed;
  bottom: 110px;
  right: 20px;
  z-index: 9990;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0084ff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 5px 20px rgba(0, 132, 255, 0.4);
  transition: 0.3s;
}
.fb-chat-btn:hover {
  transform: scale(1.1);
}
.fb-chat-btn i {
  color: white;
  font-size: 30px;
}
.zalo-chat-btn {
  position: fixed;
  bottom: 40px;
  right: 20px;
  z-index: 9990;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0068ff;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: 900;
  font-family: sans-serif;
  text-decoration: none;
  box-shadow: 0 5px 20px rgba(0, 104, 255, 0.4);
  border: 2px solid white;
  transition: 0.3s;
  font-size: 14px;
}
.zalo-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0, 104, 255, 0.6);
}

/* [SOCIAL V3] Ẩn nút Messenger/Zalo khi đã đăng nhập (có Chat Dock thay thế) */
body.hide-social-widgets .fb-chat-btn,
body.hide-social-widgets .zalo-chat-btn {
  display: none !important;
}

/* Hotline Ringing */
.hotline-phone-ring-wrap {
  position: fixed;
  bottom: 100px;
  left: 20px;
  z-index: var(--z-max); /* Quy hoạch lại bằng biến toàn cục */
}
.hotline-phone-ring {
  position: relative;
  visibility: visible;
  background-color: transparent;
  width: 110px;
  height: 110px;
  cursor: pointer;
  z-index: 11;
  transition: visibility 0.5s;
  left: 0;
  bottom: 0;
  display: block;
}
.hotline-phone-ring-circle {
  width: 85px;
  height: 85px;
  top: 10px;
  left: 10px;
  position: absolute;
  background-color: transparent;
  border-radius: 100%;
  border: 2px solid var(--primary-red);
  opacity: 0.5;
  animation: hotline-phone-ring-circle-anim 2.2s infinite ease-in-out !important;
  transition: all 0.5s;
  transform-origin: 50% 50%;
}
.hotline-phone-ring-circle-fill {
  width: 55px;
  height: 55px;
  top: 25px;
  left: 25px;
  position: absolute;
  background-color: rgba(211, 47, 47, 0.7);
  border-radius: 100%;
  border: 2px solid transparent;
  opacity: 0.5;
  animation: hotline-phone-ring-circle-fill-anim 2.3s infinite ease-in-out !important;
  transition: all 0.5s;
  transform-origin: 50% 50%;
}
.hotline-phone-ring-img-circle {
  background-color: var(--primary-red);
  width: 33px;
  height: 33px;
  top: 37px;
  left: 37px;
  position: absolute;
  background-size: 20px;
  border-radius: 100%;
  border: 2px solid transparent;
  animation: hotline-phone-ring-img-circle-anim 1s infinite ease-in-out !important;
  transform-origin: 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hotline-phone-ring-img-circle i {
  color: #fff;
  font-size: 18px;
}

/* INVENTORY (Moved from End of File) */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 5px;
}
.inventory-grid::-webkit-scrollbar {
  width: 5px;
}
.inventory-grid::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}
.inv-item {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.inv-item:hover {
  border-color: var(--accent-gold);
  transform: translateY(-3px);
  background: #333;
}
.inv-img-box {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.inv-img-box img,
.inv-img-box video {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
}
.inv-name {
  font-size: 0.8rem;
  font-weight: bold;
  color: #eee;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-actions {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.btn-inv {
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: 0.2s;
  flex: 1;
}
.btn-inv.use {
  background: #2196f3;
  color: white;
}
.btn-inv.use:hover {
  background: #1976d2;
}
.btn-inv.equipped {
  background: #4caf50;
  color: white;
  cursor: pointer;
}
.btn-inv.gift {
  background: #e91e63;
  color: white;
  max-width: 30px;
}
.btn-inv.gift:hover {
  background: #c2185b;
}
.btn-inv.sell {
  background: #555;
  color: #aaa;
  max-width: 30px;
}
.btn-inv.sell:hover {
  background: var(--primary-red);
  color: white;
}

@keyframes spinIcon {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes spinBorder {
  100% {
    transform: rotate(360deg);
  }
}
@keyframes admin_aura {
  from {
    box-shadow:
      0 0 10px #ff4500,
      0 0 5px var(--accent-gold);
  }
  to {
    box-shadow:
      0 0 25px #ff0000,
      0 0 15px var(--accent-gold);
  }
}
@keyframes shine_text {
  to {
    background-position: 200% center;
  }
}
@keyframes hotline-phone-ring-circle-anim {
  0% {
    transform: rotate(0) scale(0.5) skew(1deg);
    opacity: 0.1;
  }
  30% {
    transform: rotate(0) scale(0.7) skew(1deg);
    opacity: 0.5;
  }
  100% {
    transform: rotate(0) scale(1) skew(1deg);
    opacity: 0.1;
  }
}
@keyframes hotline-phone-ring-circle-fill-anim {
  0% {
    transform: rotate(0) scale(0.7) skew(1deg);
    opacity: 0.2;
  }
  50% {
    transform: rotate(0) scale(1) skew(1deg);
    opacity: 0.2;
  }
  100% {
    transform: rotate(0) scale(0.7) skew(1deg);
    opacity: 0.2;
  }
}
@keyframes hotline-phone-ring-img-circle-anim {
  0% {
    transform: rotate(0) scale(1) skew(1deg);
  }
  10% {
    transform: rotate(-25deg) scale(1) skew(1deg);
  }
  20% {
    transform: rotate(25deg) scale(1) skew(1deg);
  }
  30% {
    transform: rotate(-25deg) scale(1) skew(1deg);
  }
  40% {
    transform: rotate(25deg) scale(1) skew(1deg);
  }
  50% {
    transform: rotate(0) scale(1) skew(1deg);
  }
  100% {
    transform: rotate(0) scale(1) skew(1deg);
  }
}

/* =========================================
   GIAO DIỆN TÀNG KINH CÁC (TIÊN HIỆP)
========================================= */
/* Tắt thanh cuộn ngoài cùng của Shop Modal, dồn việc cuộn cho từng tab bên trong */
#shopModal .drawer-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shop-grid-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  max-height: none; /* Let flex handle height */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 15px;
  background: #0a0a0a;
  border-radius: 10px;
}

.shop-content.shop-grid-container {
  display: none !important;
}
.shop-content.shop-grid-container.active {
  display: grid !important;
}

.shop-grid-container::-webkit-scrollbar {
  width: 8px;
}
.shop-grid-container::-webkit-scrollbar-track {
  background: var(--bg-panel);
  border-radius: 10px;
}
.shop-grid-container::-webkit-scrollbar-thumb {
  background: var(--dark-gold);
  border-radius: 10px;
}

.xianxia-item-card {
  background: linear-gradient(145deg, #1f1f1f, #2a2a2a);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.xianxia-item-card:hover {
  border-color: var(--dark-gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
  transform: translateY(-5px);
}

.item-img-wrapper {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.item-img-wrapper img,
.item-img-wrapper video {
  max-width: 90px;
  max-height: 90px;
  animation: itemFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

@keyframes itemFloat {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
  100% {
    transform: translateY(0px);
  }
}

.item-name {
  font-family: "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent-gold);
  margin-bottom: 5px;
  text-shadow: 1px 1px 2px #000;
}
.item-desc {
  font-size: 0.8rem;
  color: #bbb;
  margin-bottom: 10px;
  min-height: 35px;
}
.item-stock {
  font-size: 0.85rem;
  color: #ff9800;
  margin-bottom: 10px;
  background: rgba(255, 152, 0, 0.1);
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-block;
}
.item-price {
  font-size: 1rem;
  color: #4caf50;
  font-weight: bold;
  margin-bottom: 15px;
}

.btn-buy-item {
  background: linear-gradient(to right, var(--dark-red), var(--primary-red));
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  transition: 0.3s;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.btn-buy-item:hover {
  background: linear-gradient(to right, var(--primary-red), #f44336);
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}
.btn-buy-item:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.floating-equip-icon {
  animation: floatEquip 2.5s ease-in-out infinite;
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.3));
}
@keyframes floatEquip {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* =========================================
   HIỆU ỨNG TÊN (THƯ PHÁP TOÀN SERVER ĐỒNG BỘ)
========================================= */

/* ==========================================
   1. TỰ ĐỘNG THÍCH ỨNG NỀN (ADAPTIVE CSS)
   ========================================== */
/* Tự động đổi màu chữ theo Dark/Light Mode bằng biến hệ thống */
.user-name-tu-tien {
  color: var(--text-dark);
  font-weight: 800;
  text-shadow: none;
  transition: all 0.3s ease;
}

/* Khi lọt vào Ma trận nền tối (Menu, Profile, Bảng Phong Thần) */
.tu-tien-dropdown .user-name-tu-tien,
.rank-list-item .user-name-tu-tien,
#pro-name.user-name-tu-tien, 
#pro-name, /* Bắt trọn ổ thẻ cha */
#pro-name span, /* Bắt luôn cả thẻ con nếu có */
.profile-info .user-name-tu-tien,
#menu-name.user-name-tu-tien {
  color: #f8f9fa !important; /* Trắng sáng tự động */
  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* ==========================================
   2. DANH HIỆU VIP (BÁN TRONG TÀNG KINH CÁC)
   ========================================== */
/* Màu máu */
.name-color-blood {
  color: #ff5252 !important;
  text-shadow:
    0 0 5px var(--primary-red),
    0 0 10px var(--dark-red) !important;
}

/* Màu Vàng ròng */
.name-color-gold {
  color: var(--accent-gold) !important;
  text-shadow:
    0 0 5px #ffb300,
    0 0 10px #ff8f00 !important;
}

/* Đa sắc Lưu Ly (VIP nhất) */
.name-color-legend {
  background: linear-gradient(90deg, #ff8a00, #e52e71, #9c27b0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none !important;
  font-weight: 900 !important;
}

/* Font chữ Thư Pháp */
.name-font-thuphap {
  font-family: "Pacifico", "KaiTi", cursive !important;
  font-size: 1.25em; /* Phóng to nhẹ vì font thư pháp thường nét mảnh */
}

/* Tên Admin Siêu Thoát */
.admin-name-glow {
  font-family: "Zhi Mang Xing", "Dancing Script", cursive !important;
  font-size: 1.6rem !important;
  font-weight: bold !important;
  background: linear-gradient(
    to right,
    #ff4d4d 20%,
    #ff0000 40%,
    #cc0000 60%,
    #ff4d4d 80%
  ) !important;
  background-size: 200% auto !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: shine_text 2.5s linear infinite !important;
  text-shadow: 0 0 15px rgba(255, 0, 0, 0.5) !important;
}

/* =========================================
   TÙY CHỈNH KHUNG BÌNH LUẬN (LIGHT THEME - RÕ RÀNG HƠN)
========================================= */
.cmt-item {
  background: #ffffff !important; /* Nền trắng sáng bóng */
  color: #333 !important; /* Chữ đậm màu đen để đọc siêu rõ */
  border: 1px solid #e0e0e0 !important; /* Viền xám nhạt tạo khối */
  border-radius: 12px !important;
  padding: 16px !important;
  margin-bottom: 15px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  transition: background 0.3s ease;
}
.cmt-item:hover {
  background: #2a2a2a !important; /* Xám đen nhạt, không chói mắt */
  border-color: rgba(251, 192, 45, 0.5) !important; /* Viền vàng gold mờ */
}

.cmt-time,
.cmt-btn {
  color: #777 !important;
}
.cmt-btn:hover {
  color: var(--primary-red) !important;
}

/* Khung trả lời (Reply) bên trong */
.reply-item {
  background: #f8f9fa !important; /* Xám siêu nhạt cho lớp trong */
  color: #333 !important;
  border-left: 3px solid var(--primary-red) !important;
  padding: 10px 12px !important;
  margin-top: 8px !important;
  border-radius: 0 8px 8px 0 !important;
}
/* =========================================
   TOOLTIP & HIỆU ỨNG VẬT PHẨM TRANG BỊ
========================================= */
.equip-item-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  cursor: pointer;
}

/* 1. Kích thước vật phẩm mặc định to và rõ hơn (Đã xóa các style inline cũ) */
.equip-item-wrapper .floating-equip-icon {
  width: 35px !important;
  height: 35px !important;
  object-fit: contain;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Tooltip Box nền tối */
.equip-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(15px) scale(0.8);
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid var(--dark-gold);
  border-radius: 12px;
  padding: 15px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.8),
    inset 0 0 15px rgba(212, 175, 55, 0.2);
  z-index: var(--z-tooltip); /* Quản lý tập trung tại :root */
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  width: max-content;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Mũi tên chỉ xuống của Tooltip */
.equip-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: var(--dark-gold) transparent transparent transparent;
}

/* Ảnh chi tiết bên trong tooltip */
.equip-tooltip .tooltip-item-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
  animation: itemFloat 3s ease-in-out infinite;
}

/* 2. Hover hiện Tooltip */
.equip-item-wrapper:hover .equip-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* 3. Hiệu ứng Glow Hoành Tráng cho Slot 1 */
.equip-item-wrapper:hover .equip-slot-1 {
  transform: scale(1.6);
  filter: drop-shadow(0 0 15px #ffdf00) drop-shadow(0 0 30px #ff4500)
    brightness(1.3);
  z-index: 10;
}

/* Hiệu ứng phình to nhẹ cho các Slot thường */
.equip-item-wrapper:hover .equip-slot-normal {
  transform: scale(1.3);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7));
  z-index: 10;
}
/* =========================================
   TÍNH NĂNG THU GỌN / XEM TẤT CẢ BÌNH LUẬN
========================================= */
/* Mặc định nếu có class collapsed, ẩn từ bình luận thứ 3 trở đi */
#comments-list.collapsed .cmt-item:nth-child(n + 3) {
  display: none !important;
}

/* Giao diện nút bấm Xem tất cả */
.toggle-comments-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  background: transparent;
  color: var(--primary-red);
  border: 2px dashed var(--primary-red);
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 20px;
  transition: all 0.3s;
}

.toggle-comments-btn:hover {
  background: rgba(211, 47, 47, 0.05);
  transform: translateY(-2px);
}
.vip-equipped-item,
.normal-equipped-item {
  width: 35px !important;
  height: 35px !important;
  object-fit: contain;
}
/* Đảm bảo khung avatar gốc không bị đè CSS */
.avatar-wrapper {
  position: relative;
}
/* ==========================================================
   HỆ THỐNG GIAO DIỆN VẬT PHẨM (TUYỆT ĐỐI KHÔNG VỠ KHUNG)
   ========================================================== */

/* 1. KHUNG AVATAR ĐƯỢC KHÓA TÂM TUYỆT ĐỐI */
.avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 40px auto 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 2. CỘT 1 (KẾ BÊN TÊN) - 5 MÓN VIP HIỆU ỨNG KHỦNG */
#pro-equipped-top {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
}

.vip-equipped-item {
  width: 35px !important;
  height: 35px !important;
  object-fit: contain;
  cursor: pointer;
  position: relative;
  z-index: 10;
  background: transparent; /* KHÔNG CÓ NỀN ĐEN */
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    filter 0.3s;
}

/* HIỆU ỨNG PHÓNG TO GẤP 3 LẦN AVATAR KHI RÊ CHUỘT */
.vip-equipped-item:hover {
  transform: scale(8); /* 35px * 8 = 280px (Cực đại) */
  z-index: 99999 !important; /* Nổi lên trên tất cả mọi thứ */
  /* Hiệu ứng hào quang tỏa sáng nền */
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 1))
    drop-shadow(0 0 20px rgba(255, 69, 0, 0.8));
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 215, 0, 0) 70%
  );
  border-radius: 50%;
}

/* 3. CỘT 2 (DƯỚI TÊN) - VÔ HẠN VẬT PHẨM (ĐÃ TỐI ƯU GỘP CODE) */
#pro-equipped-bottom {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap; /* Rớt dòng khi đầy */
  margin: 10px auto;
  padding: 10px;
  background: transparent !important; /* Xóa nền đen dứt điểm */
  border-radius: 8px;
  border: none !important; /* Xóa viền dứt điểm */
  width: 100%;
  box-sizing: border-box;
  /* Khóa chiều cao và tạo thanh cuộn */
  max-height: 120px;
  overflow-y: auto;
}

/* Làm đẹp thanh cuộn cho khu vực vô hạn */
#pro-equipped-bottom::-webkit-scrollbar {
  width: 6px;
}
#pro-equipped-bottom::-webkit-scrollbar-thumb {
  background: var(--dark-gold);
  border-radius: 5px;
}

.normal-equipped-item {
  width: 35px !important;
  height: 35px !important;
  object-fit: contain;
  background: transparent !important;
  border: none !important;
  border-radius: 5px;
  padding: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.normal-equipped-item:hover {
  /* Khi rê chuột vào thì nó mới hiện nền mờ mờ lên cho đẹp */
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid var(--accent-gold) !important;
  transform: translateY(-2px); /* Nảy nhẹ lên cho có cảm giác tương tác */
}

/* =========================================
   GIAO DIỆN TÀNG KINH CÁC (DẠNG NGANG CHO BÍ KÍP)
========================================= */
.shop-list-container {
  display: flex !important;
  flex-direction: column;
  gap: 15px;
  max-height: none; /* Let flex handle height */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 15px;
  background: #0a0a0a;
  border-radius: 10px;
}
.shop-content.shop-list-container {
  display: none !important;
}
.shop-content.shop-list-container.active {
  display: flex !important;
}
.shop-list-container::-webkit-scrollbar {
  width: 8px;
}
.shop-list-container::-webkit-scrollbar-track {
  background: var(--bg-panel);
  border-radius: 10px;
}
.shop-list-container::-webkit-scrollbar-thumb {
  background: var(--dark-gold);
  border-radius: 10px;
}

.xianxia-list-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(145deg, #222, #2a2a2a);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 15px 20px;
  transition: all 0.3s ease;
}
.xianxia-list-card:hover {
  border-color: var(--dark-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}
.list-card-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.list-card-img {
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.list-card-img img,
.list-card-img video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: itemFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}
.list-card-info {
  text-align: left;
}
.list-card-title {
  font-family: "Times New Roman", serif;
  font-weight: bold;
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 5px;
  text-shadow: 1px 1px 2px #000;
}
.list-card-price {
  font-size: 1.1rem;
  color: var(--accent-gold);
  font-weight: bold;
}
.btn-list-buy {
  border-radius: 30px;
  padding: 10px 25px;
  font-weight: bold;
  border: none;
  width: 140px;
  cursor: pointer;
  transition: 0.3s;
  text-transform: uppercase;
}
.btn-list-buy.owned {
  background: #555;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-list-buy.buy {
  background: linear-gradient(to right, var(--dark-red), var(--primary-red));
  color: white;
}
.btn-list-buy.buy:hover {
  background: linear-gradient(to right, var(--primary-red), #f44336);
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* Ép bóp khung trên điện thoại để không bị vỡ */
@media (max-width: 480px) {
  .xianxia-list-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .btn-list-buy {
    width: 100%;
  }
}

/* ===================================================
   BÓNG TỐI BAO PHỦ ĐÀM ĐẠO CÁC (DARK THEME) - TỐI ƯU KÍCH THƯỚC
   =================================================== */
#community-reviews {
  background: var(--bg-dark) !important;
  border-top: 1px solid #333 !important;
  padding: 50px 5% !important; /* Cắt giảm khoảng trống thừa trên dưới */
}
#community-reviews .section-title {
  color: var(--accent-gold) !important;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  font-size: 2.2rem !important; /* Tiêu đề nhỏ lại 1 chút cho tinh tế */
}
#community-reviews .section-subtitle {
  color: #aaa !important;
  margin-bottom: 30px !important;
}
.review-box-wrapper {
  background: #1e1e1e !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
  border: 1px solid #333 !important;
  padding: 25px 25px !important; /* Ép nền đen ôm sát ô bình luận */
}
.cmt-item {
  background: #252525 !important;
  border: 1px solid #3a3a3a !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4) !important;
  padding: 15px !important; /* Làm từng thẻ bình luận mỏng lại */
}
#my-cmt-name,
.cmt-name {
  color: #fff !important;
}
.cmt-content {
  color: #ddd !important;
}
.cmt-time {
  color: #888 !important;
}

/* ===================================================
   TỐI ƯU LAYOUT ĐÀM ĐẠO CÁC (AVATAR TRÊN - NỘI DUNG DƯỚI)
   =================================================== */

/* 1. Ẩn hoàn toàn tên người dùng (Chờ tính năng click Profile) */
#my-cmt-name,
.cmt-name {
  display: none !important;
}

/* 2. Ép khung nhập liệu thành hàng dọc (Column) */
#comment-input-area > div {
  flex-direction: column !important;
  align-items: flex-start !important;
}

/* Đẩy ô nhập text xuống dưới, rộng 100% để không bị ép vào góc */
#comment-input-area > div > div {
  width: 100% !important;
  margin-top: 15px !important;
}
#main-comment-text {
  width: 100% !important;
  max-width: 100% !important;
}

/* 3. Ép khung bình luận đã đăng thành hàng dọc */
.cmt-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}
.cmt-user-info {
  width: 100% !important;
  margin-bottom: 15px !important;
}

/* ===================================================
   ÉP CÂN RESPONSIVE MOBILE ĐÀM ĐẠO CÁC (DÙNG TRANSFORM)
   =================================================== */
@media (max-width: 768px) {
  /* Dùng scale để thu nhỏ toàn bộ cụm thay vì gán Pixel cứng làm vỡ ảnh */
  .avatar-wrapper-tu-tien {
    transform: scale(0.8);
    transform-origin: left top;
  }

  .tu-tien-phap-tuong {
    transform: scale(0.7);
    transform-origin: left bottom;
    margin-left: -5px !important;
  }
  .tu-tien-phap-tuong.is-reply {
    transform: scale(0.6);
  }

  /* Thu nhỏ khay trang bị */
  .bottom-equip-box {
    transform: scale(0.85);
    transform-origin: left center;
    margin: 0 !important;
  }
}

/* ===================================================
   MỞ KHÓA TOOLTIP CẤP ĐỘ HSK (BẢN FIX TRIỆT ĐỂ)
   =================================================== */

/* 1. Ép nút gốc phải hiển thị nội dung tràn ra ngoài (quan trọng nhất) */
.faq-button {
  width: 35px !important;
  height: 35px !important;
  border-radius: 50% !important;
  border: none !important;
  background-color: #ffe53b;
  background-image: linear-gradient(147deg, #ffe53b 0%, #ff2525 74%);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.15);
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  z-index: 100 !important; /* Đẩy nút lên cao */
  flex-shrink: 0 !important;
  align-self: flex-start !important;
  overflow: visible !important; /* MỞ KHÓA: Cho phép tooltip bay ra ngoài */
}

.faq-button svg {
  height: 1.2em !important;
  width: 1.2em !important;
  fill: white !important;
}

/* 2. Cấu hình Tooltip nảy ra bên trái */
.faq-button .tooltip {
  position: absolute !important;
  top: 50% !important;
  right: 130% !important;
  transform: translateY(-50%) !important;

  /* Hiệu ứng ẩn hiện chắc chắn hơn */
  visibility: hidden !important;
  opacity: 0 !important;

  background-color: #ffe53b !important;
  background-image: linear-gradient(147deg, #ffe53b 0%, #ff2525 74%) !important;
  color: white !important;
  padding: 6px 15px !important;
  border-radius: 5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  /* Hiệu ứng nảy mượt mà */
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;

  pointer-events: none !important;
  font-weight: bold !important;
  font-size: 0.85rem !important;
  white-space: nowrap !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5) !important;
  z-index: 99999 !important; /* Nổi lên trên tất cả */
}

/* Mũi tên của Tooltip */
.faq-button .tooltip::before {
  position: absolute;
  content: "";
  width: 10px;
  height: 10px;
  background-color: #ff2525;
  transform: rotate(45deg) translateY(-50%);
  right: -5px;
  top: 50%;
  z-index: -1;
}

/* 3. Hiệu ứng khi Hover */
.faq-button:hover .tooltip {
  visibility: visible !important;
  opacity: 1 !important;
  right: 150% !important; /* Nảy xa ra một chút cho đẹp */
}


/* ===================================================
   GIAO DIỆN BÍ KÍP TU LUYỆN (GUIDE MODAL) - CHUẨN XIANXIA
   =================================================== */

/* Ép cái Modal nền chứa nó phải trong suốt và ra giữa */
#guideModal {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#guideModal > div {
  /* Ép thẻ bọc ngoài cùng (nếu có) phải trong suốt để nhường chỗ cho xianxia-guide-wrapper */
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 600px !important;
}

/* Khung chính của Bí Kíp */
.xianxia-guide-wrapper {
  background: var(--bg-dark);
  border: 2px solid var(--dark-gold);
  border-radius: 15px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  box-shadow:
    0 0 40px rgba(212, 175, 55, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Nút Đóng */
.close-guide-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(211, 47, 47, 0.2);
  color: #f44336;
  border: 1px solid var(--primary-red);
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: 0.3s;
}
.close-guide-btn:hover {
  background: var(--primary-red);
  color: white;
  transform: rotate(90deg);
}

/* Header */
.guide-title {
  font-family: "Zhi Mang Xing", cursive;
  font-size: 2.8rem;
  color: var(--accent-gold);
  text-align: center;
  margin: 25px 0 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}
.guide-subtitle {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 20px;
  font-style: italic;
}

/* Khu vực cuộn - Yếu tố then chốt chống tràn màn hình */
.guide-scroll-area {
  max-height: 60vh; /* Giới hạn chiều cao 60% màn hình */
  overflow-y: auto;
  padding: 0 25px 25px;
}
.guide-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.guide-scroll-area::-webkit-scrollbar-thumb {
  background: var(--dark-gold);
  border-radius: 5px;
}
.guide-scroll-area::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

/* Các phần tử bên trong */
.section-heading {
  color: #eee;
  font-size: 1.2rem;
  margin-bottom: 15px;
  border-bottom: 1px dashed #444;
  padding-bottom: 10px;
}

/* Ghi chú mở đầu section */
.guide-note {
  background: rgba(33, 150, 243, 0.08);
  border: 1px solid rgba(33, 150, 243, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 15px;
  font-size: 0.82rem;
  color: #bbb;
  line-height: 1.6;
}
.guide-note i {
  color: #2196f3;
  margin-right: 5px;
}

/* Lưới Nhiệm Vụ */
.task-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 30px;
}
.task-item {
  background: rgba(25, 25, 30, 0.95) !important;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.task-item:hover {
  border-color: #555;
  background: rgba(40, 40, 48, 0.95) !important;
}
.task-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-gold);
  font-size: 1.2rem;
  margin-top: 2px;
}
.task-info h4 {
  margin: 0 0 4px;
  color: #eee;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-info p {
  margin: 0 0 2px;
  font-size: 0.8rem;
  color: #aaa;
  line-height: 1.5;
}
.task-sub {
  font-size: 0.72rem !important;
  color: #777 !important;
  font-style: italic;
  margin-top: 3px !important;
}
/* Badge nhỏ bên cạnh tiêu đề */
.task-badge {
  font-size: 0.65rem;
  background: rgba(33, 150, 243, 0.15);
  color: #64b5f6;
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.task-badge.badge-gold {
  background: rgba(251, 192, 45, 0.15);
  color: #fbc02d;
}
.task-badge.badge-green {
  background: rgba(76, 175, 80, 0.15);
  color: #66bb6a;
}

.text-green {
  color: #4caf50;
  font-weight: bold;
}
.text-blue {
  color: #2196f3;
  font-weight: bold;
}
.text-red {
  color: #f44336;
  font-weight: bold;
}

/* Danh sách Cảnh giới */
.rank-list {
  background: rgba(25, 25, 30, 0.95) !important;
  border: 1px solid #333;
  border-radius: 10px;
  overflow: hidden;
}
.rank-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 15px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 0.85rem;
}
.rank-row:last-child {
  border-bottom: none;
}
.rank-row:hover {
  background: rgba(255,255,255,0.03);
}
.rank-header {
  background: rgba(251, 192, 45, 0.08) !important;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rank-header .rank-name { color: #fbc02d; }
.rank-header .rank-exp { color: #fbc02d; }
.rank-header .rank-hsk { color: #fbc02d; }

.rank-name {
  font-weight: bold;
  width: 35%;
}
.rank-exp {
  color: #ccc;
  width: 30%;
  text-align: center;
}
.rank-hsk {
  color: #ff9800;
  width: 35%;
  text-align: right;
}

.rank-vip {
  background: rgba(212, 175, 55, 0.05);
}

/* Phần Tips Tu Luyện */
.guide-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: #bbb;
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(76, 175, 80, 0.06);
  border: 1px solid rgba(76, 175, 80, 0.15);
  border-radius: 8px;
}
.tip-item i {
  color: #4caf50;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ===================================================
   FIX LỖI MÉO AVATAR & ĐỒNG BỘ MỌI LOẠI KHUNG (DÁN Ở ĐÁY FILE)
   =================================================== */
.admin-dragon-frame {
  box-sizing: border-box !important; /* Chống méo thành hình bầu dục */
}

#pro-avatar-border {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
  /* width/height/left/top được JS set theo absolute px (RCA v2) */
}

/* ===================================================
   FIX TOOLTIP HSK BỊ CẮT XÉN VÀ ĐỔI HƯỚNG NẢY
   =================================================== */
/* Mở khóa không gian cho hộp Menu Dropdown để Tooltip bay ra ngoài được */
.tu-tien-dropdown {
  overflow: visible !important;
}
.tu-tien-dropdown > div:first-child {
  border-radius: 11px 11px 0 0 !important;
}
.tu-tien-dropdown > div:last-child {
  border-radius: 0 0 11px 11px !important;
}

/* Đảo hướng nảy Tooltip sang Phải (.pop-right) để không bị viền màn hình nuốt mất */
.faq-button .tooltip.pop-right {
  right: auto !important;
  left: 130% !important;
}
.faq-button:hover .tooltip.pop-right {
  right: auto !important;
  left: 150% !important;
}
.faq-button .tooltip.pop-right::before {
  right: auto;
  left: -5px;
}

/* ===================================================
   TOOLTIP HSK MINI CHUẨN XIANXIA (NỔI PHÍA TRÊN ICON)
   =================================================== */
.hsk-mini-btn {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(147deg, #ffe53b 0%, #ff2525 74%) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  width: 20px !important;
  height: 20px !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  font-family: Arial, sans-serif !important;
  cursor: pointer !important;
  margin-left: 6px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
  flex-shrink: 0 !important;
  z-index: 10 !important;
  line-height: 1 !important;
  text-indent: 0 !important;
  letter-spacing: normal !important;
  -webkit-text-fill-color: initial !important;
}

.hsk-mini-tooltip {
  position: absolute !important;
  bottom: 150% !important; /* Đẩy lên phía trên */
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: #111 !important;
  color: #ff9800 !important;
  padding: 6px 12px !important;
  border-radius: 5px !important;
  font-size: 12px !important;
  font-weight: bold !important;
  white-space: nowrap !important;
  border: 1px solid var(--dark-gold) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5) !important;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease-in-out !important;
  pointer-events: none !important;
  z-index: 99999 !important;
  -webkit-text-fill-color: initial !important;
}

/* Mũi tên nhỏ chỉ xuống Icon */
.hsk-mini-tooltip::after {
  content: "" !important;
  position: absolute !important;
  top: 100% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  border-width: 5px !important;
  border-style: solid !important;
  border-color: var(--dark-gold) transparent transparent transparent !important;
}

/* Rê chuột vào hiện lên */
.hsk-mini-btn:hover .hsk-mini-tooltip {
  visibility: visible !important;
  opacity: 1 !important;
  bottom: 180% !important; /* Nảy nhẹ lên xíu cho mượt */
}

/* =========================================
   THANH THÔNG BÁO CHẠY NGANG (MARQUEE TIÊN HIỆP)
========================================= */
.xianxia-marquee-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(18, 18, 18, 0.95);
  border-top: 1px solid var(--dark-gold);
  box-shadow:
    0 -5px 20px rgba(0, 0, 0, 0.8),
    inset 0 2px 10px rgba(212, 175, 55, 0.1);
  color: var(--dark-gold);
  padding: 8px 0;
  z-index: 9980; /* Nằm dưới nút Zalo (9990) nhưng đè lên mọi thứ khác */
  overflow: hidden;
  white-space: nowrap;
  display: block !important;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
}

.xianxia-marquee-content {
  display: inline-block;
  padding-left: 100%; /* Bắt đầu chạy từ mép phải màn hình */
  animation: xianxiaMarquee 40s linear infinite; /* Chạy tà tà 40 giây */
}

/* Đạo hữu rê chuột vào thì nó dừng lại để đọc */
.xianxia-marquee-content:hover {
  animation-play-state: paused;
  cursor: pointer;
}

@keyframes xianxiaMarquee {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-100%, 0);
  }
}

/* Tối ưu chữ nhỏ lại trên điện thoại */
@media (max-width: 768px) {
  .xianxia-marquee-container {
    font-size: 0.8rem;
    padding: 6px 0;
  }
}

/* ===================================================
   HIỆU ỨNG PHÓNG TO THẦN THÁNH CHO VẬT PHẨM ĐÀM ĐẠO CÁC
=================================================== */
.cmt-divine-item {
  object-fit: contain;
  cursor: pointer;
  /* GPU ACCELERATION — explicit props, không dùng 'all' */
  will-change: transform;
  transform: translateZ(0);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              filter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              z-index 0s;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transform-origin: center;
  contain: layout style; /* Giới hạn repaint trong element */
}

.cmt-divine-item:hover {
  transform: scale(5.5);
  z-index: var(--z-max) !important; /* Đồng bộ quyền lực tối cao */

  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 1))
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 40px rgba(255, 69, 0, 0.8));

  animation: divinePulse 1.5s infinite alternate;
}

/* Ánh sáng nhấp nháy liên tục khi giữ chuột */
@keyframes divinePulse {
  0% {
    filter: drop-shadow(0 0 10px var(--accent-gold))
      drop-shadow(0 0 20px rgba(255, 255, 255, 0.9))
      drop-shadow(0 0 30px #ff4500);
  }
  100% {
    filter: drop-shadow(0 0 20px #fff) drop-shadow(0 0 40px var(--accent-gold))
      drop-shadow(0 0 60px #ff0000);
  }
}

/* ===================================================
   QUẦN ANH HỘI (LIVE CHAT MODAL) - BẢN REDESIGN 2 CỘT
   =================================================== */
.live-chat-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.9);
  z-index: var(--z-max); /* Lấy mốc cao nhất của hệ thống */
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.live-chat-container {
  width: 95vw;
  height: 90dvh;
  max-width: 1300px;
  background: var(--bg-dark);
  border-radius: 12px;
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 1);
}

.live-chat-header {
  background: var(--bg-panel);
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary-red);
}

.lc-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 15px;
}

.lc-badge {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  border: 1px solid #2ecc71;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 20px;
}

.lc-close {
  color: #aaa;
  font-size: 28px;
  cursor: pointer;
  transition: 0.3s;
}
.lc-close:hover {
  color: var(--primary-red);
}

.live-chat-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* KHUNG CHAT TRÁI */
.lc-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #181818;
}

.lc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.lc-messages::-webkit-scrollbar {
  width: 6px;
}
.lc-messages::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.lc-input-area {
  background: #1e1e1e;
  padding: 15px;
  border-top: 1px solid #333;
}

.lc-toolbar {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
}
.lc-tool-btn {
  background: transparent;
  color: #888;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  transition: 0.2s;
}
.lc-tool-btn:hover {
  color: var(--accent-gold);
  transform: scale(1.1);
}
.vip-only {
  color: var(--primary-red);
} /* Nút ảnh VIP phân biệt màu */

.lc-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
#lc-input-text {
  flex: 1;
  background: #252525;
  border: 1px solid #444;
  color: #fff;
  border-radius: 8px;
  padding: 12px;
  resize: none;
  font-family: inherit;
  font-size: 0.95rem;
}
#lc-input-text:focus {
  outline: none;
  border-color: var(--dark-gold);
}

.lc-send-btn {
  background: var(--primary-red);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.3s;
}
.lc-send-btn:hover {
  background: var(--dark-red);
  transform: scale(1.1);
}

/* SIDEBAR PHẢI */
.lc-sidebar {
  width: 320px;
  background: var(--bg-panel);
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
}

.lc-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #333;
}
.lc-tab-btn {
  flex: 1;
  background: transparent;
  color: #888;
  border: none;
  padding: 15px 0;
  font-weight: bold;
  cursor: pointer;
}
.lc-tab-btn.active {
  color: var(--dark-gold);
  border-bottom: 2px solid var(--dark-gold);
}

.lc-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}
.lc-tab-content.active {
  display: block;
}

/* Switch Toggle CSS */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
}
input:checked + .slider {
  background-color: #4caf50;
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

.lc-setting-card {
  background: #222;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid #333;
}
.lc-setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ccc;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .lc-sidebar {
    display: none;
  }
}

/* --- HỘP NHÃN DÁN (STICKER BOX) --- */
.lc-sticker-box {
  display: none;
  background: var(--bg-dark);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  max-height: 180px;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 10px;
}

.lc-sticker-box.active {
  display: grid;
  animation: fadeIn 0.2s ease;
}

.lc-sticker-box::-webkit-scrollbar {
  width: 5px;
}
.lc-sticker-box::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.lc-sticker-item {
  width: 100%;
  height: 65px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: 0.2s;
  background: var(--bg-panel);
}

.lc-sticker-item:hover {
  transform: scale(1.1);
  border-color: var(--dark-gold);
  background: #222;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* =====================================================
   PHONG ẤN VIỀN ĐEN — WebM Vật Phẩm Tràn Viền Tự Nhiên
   Áp dụng tự động cho mọi vật phẩm WebM mới thêm vào
   Điều kiện: Container phải có nền TỐI (Dark Mode)
   mix-blend-mode: screen loại bỏ pixel đen (#000),
   giữ nguyên pixel sáng → hiệu ứng tràn viền mượt mà
   ===================================================== */

/* 1. SHOP — Vật phẩm trong Tàng Kinh Các */
.item-img-wrapper video {
  mix-blend-mode: screen;
  background: transparent;
}

/* 2. INVENTORY — Túi đồ */
.inv-img-box video {
  mix-blend-mode: screen;
  background: transparent;
}

/* 3. EQUIPPED ITEMS — Vật phẩm đang trang bị (Profile + Menu) */
video.xianxia-equip-icon {
  mix-blend-mode: screen;
  background: transparent;
}

/* 4. AVATAR FRAME — Khung avatar hồ sơ */
#pro-avatar-border video {
  background: transparent;
}

/* 5. LEADERBOARD — Khung avatar Bảng Xếp Hạng */
.avatar-wrapper-tu-tien video {
  background: transparent;
}

/* ═══════════════════════════════════════════
   [Sprint F1] ADMIN "TU LA" BADGE
   ═══════════════════════════════════════════ */
/* Chỉ visible khi body.is-admin — set bởi auth.js */
body.is-admin .admin-badge-tu-la {
  display: inline-flex !important;
}
.admin-badge-tu-la {
  display: none;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--accent-gold);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
  animation: tuLaPulse 2s ease-in-out infinite alternate;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 6px;
}
@keyframes tuLaPulse {
  from {
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.3);
  }
  to {
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
    border-color: rgba(212, 175, 55, 0.8);
  }
}

/* ═══════════════════════════════════════════════════════════
   [Sprint F3] LEARNING STATS DASHBOARD — Thành Tích Tu Luyện
   ═══════════════════════════════════════════════════════════ */

/* Stats Grid — 2×2 layout */
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.profile-stat-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.profile-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-accent, #4caf50);
  opacity: 0.6;
  border-radius: 14px 14px 0 0;
}

.profile-stat-card:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.profile-stat-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
  display: block;
}

.profile-stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--stat-accent, #fff);
  line-height: 1.2;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

.profile-stat-label {
  font-size: 0.72rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  font-weight: 600;
}

/* Progress Ring — SVG Donut */
.profile-progress-section {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.005));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  margin-bottom: 16px;
}

.profile-progress-ring {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.profile-progress-ring svg {
  transform: rotate(-90deg);
}

.profile-progress-ring .ring-bg {
  stroke: rgba(255,255,255,0.06);
}

.profile-progress-ring .ring-fill {
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Inter', -apple-system, sans-serif;
}

.profile-progress-info {
  flex: 1;
}

.profile-progress-info h4 {
  margin: 0 0 6px 0;
  color: #ddd;
  font-size: 0.95rem;
  font-weight: 700;
}

.profile-progress-info p {
  margin: 0;
  color: #888;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* HSK Badge & Meta Row */
.profile-stats-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-stats-meta-item {
  flex: 1;
  min-width: 100px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-size: 0.82rem;
  color: #aaa;
}

.profile-stats-meta-item .meta-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 3px;
}

/* Profile Stats Empty State */
.profile-stats-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 0.9rem;
}

.profile-stats-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
  display: block;
}

/* Mini-Profile Stats (compact) */
.mp-stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mp-stat-chip {
  flex: 1;
  min-width: 60px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  font-size: 0.7rem;
  color: #999;
}

.mp-stat-chip .mp-stat-val {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

/* Animation for stats loading */
@keyframes statCountUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-stat-card {
  animation: statCountUp 0.4s ease forwards;
}
.profile-stat-card:nth-child(2) { animation-delay: 0.08s; }
.profile-stat-card:nth-child(3) { animation-delay: 0.16s; }

/* ═══════════════════════════════════════════════════════════════
   DANH HIỆU (TITLE BADGE SYSTEM) — v8.40
   Phong cách Duolingo/HanziDict — 5 tier: bronze→silver→gold→purple→epic
   ═══════════════════════════════════════════════════════════════ */

.ytt-title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 4px;
  border: 1px solid transparent;
  line-height: 1.4;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
  text-transform: none;
}
.ytt-title-badge:hover { transform: scale(1.07); }

/* Sơ Đẳng — Bronze */
.ytt-title-badge.tier-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
  color: #fff3e0;
  border-color: #7a3b0f;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Trung Đẳng — Silver */
.ytt-title-badge.tier-silver {
  background: linear-gradient(135deg, #b8c4cc 0%, #6e7f8d 100%);
  color: #fff;
  border-color: #5a6a77;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Cao Đẳng — Gold */
.ytt-title-badge.tier-gold {
  background: linear-gradient(135deg, #ffd700 0%, #e65c00 100%);
  color: #1a0a00;
  border-color: #c97000;
}

/* Thượng Đẳng — Purple */
.ytt-title-badge.tier-purple {
  background: linear-gradient(135deg, #c77dff 0%, #7b2fbe 100%);
  color: #fff;
  border-color: #6a0dad;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  box-shadow: 0 0 6px rgba(157,78,221,0.45);
}

/* Tối Thượng — Epic */
.ytt-title-badge.tier-epic {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a2e 50%, #0d0d0d 100%);
  color: #ffd700;
  border-color: #ffd700;
  text-shadow: 0 0 6px rgba(255,215,0,0.7);
  box-shadow: 0 0 10px rgba(255,215,0,0.2), inset 0 0 4px rgba(255,215,0,0.08);
}

/* Kích thước lớn trong shop/inventory card */
.ytt-title-badge.badge-lg {
  font-size: 0.95rem;
  padding: 5px 16px;
  border-radius: 8px;
  letter-spacing: 1px;
}

/* Container cạnh tên user (navbar, comment) */
.ytt-user-title { display: inline-block; vertical-align: middle; }
.profile-stat-card:nth-child(4) { animation-delay: 0.24s; }
