/* ==========================================================================
   VÕ LÂM 3 MOBILE - GIAO DIỆN KIẾM HIỆP CHÍNH THỨC
   Tương phản sáng tối rõ ràng, chống vỡ ảnh, khử răng cưa mượt mà 100%
   ========================================================================== */

:root {
  /* Tông màu nền sâu thẳm sang trọng */
  --bg-dark: #080b12;
  --bg-deep: #0b101c;
  --bg-card: #0f1626;
  --bg-card-hover: #141d32;
  --bg-input: #080d18;
  
  /* Sắc vàng Hoàng Kim rực rỡ, độ tương phản cao */
  --gold-primary: #f59e0b;
  --gold-light: #fef08a;
  --gold-bright: #ffd166;
  --gold-hover: #fbbf24;
  --gold-dark: #b45309;
  --gold-glow: rgba(245, 158, 11, 0.35);
  --gold-border: rgba(245, 158, 11, 0.3);
  --gold-border-bright: rgba(254, 240, 138, 0.65);

  /* Điểm nhấn võ hiệp */
  --crimson: #ef4444;
  --crimson-glow: rgba(239, 68, 68, 0.4);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.4);
  --violet: #818cf8;

  /* Màu chữ sáng rõ ràng, chống mờ mỏi mắt */
  --text-pure: #ffffff;
  --text-main: #f1f5f9;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --text-gold: #fef08a;

  /* Font chữ kinh điển */
  --font-heading: 'Cinzel', serif, Georgia;
  --font-body: 'Noto Sans Vietnamese', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(180, 83, 9, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 90% 70%, rgba(239, 68, 68, 0.04) 0%, transparent 50%);
}

/* Chống vỡ ảnh tuyệt đối trên mọi thiết bị */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Thanh cuộn phong cách giang hồ */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.7);
}

/* Canvas hiệu ứng tàn lửa bay */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Khung nội dung trung tâm tự thích ứng */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   NAVIGATION BAR (CHUẨN ĐẸP, GỌN GÀNG, KHÔNG RÁC ICON)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(8, 11, 18, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gold-border);
  z-index: 100;
  transition: var(--transition);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px var(--gold-glow));
  transition: transform 0.3s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.06);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px var(--gold-glow);
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Nav Menu Links Desktop (Chữ thanh thoát, gạch chân vàng mượt mà) */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  list-style: none;
}

.nav-link {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-light);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 75%;
  height: 2px;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
  transition: transform 0.25s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Nav Auth Controls */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Mobile Toggle Hamburger Button */
.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: var(--transition);
}

.mobile-toggle:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--gold-light);
}

.mobile-toggle svg {
  width: 22px;
  height: 22px;
  stroke: var(--gold-light);
}

/* User & Admin Pills in Header */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--gold-border);
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.85rem;
}

.user-pill .username {
  font-weight: 700;
  color: var(--gold-light);
}

.user-pill .wallet {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(254, 240, 138, 0.25);
  padding: 2px 8px;
  border-radius: 20px;
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 600;
}



/* ==========================================================================
   BUTTONS (SÁNG RÕ, PHẢN HỒI MƯỢT MÀ)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #050811;
  font-weight: 700;
  border: 1px solid rgba(254, 240, 138, 0.6);
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffd166 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.55);
  color: #050811;
}

.btn-outline {
  background: rgba(15, 22, 38, 0.8);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
}

.btn-outline:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--gold-light);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-zalo {
  background: linear-gradient(135deg, rgba(0, 104, 255, 0.24) 0%, rgba(14, 165, 233, 0.14) 100%);
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 4px 14px rgba(0, 104, 255, 0.22);
}

.btn-zalo:hover {
  background: linear-gradient(135deg, rgba(0, 104, 255, 0.38) 0%, rgba(14, 165, 233, 0.24) 100%);
  border-color: #7dd3fc;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(14, 165, 233, 0.4);
  color: #ffffff;
}

.zalo-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.72)) brightness(1.15);
}

.btn-admin {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  border: 1px solid rgba(252, 165, 165, 0.4);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.btn-admin:hover {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.55);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   HERO SECTION: CHIA 2 CỘT RÕ RÀNG (ẢNH SÁNG RỰC, NỘI DUNG SẮC NÉT)
   ========================================================================== */
.hero {
  padding: clamp(35px, 6vw, 65px) 0 clamp(30px, 5vw, 55px);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.hero-content {
  text-align: left;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold-border-bright);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 1px;
  margin-bottom: 14px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.9);
}

.hero-title span {
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 40%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 26px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* Thanh huy hiệu tính năng nổi bật */
.hero-highlights {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.hl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.hl-item strong {
  color: var(--gold-light);
}

/* Khung hiển thị tranh kiếm hiệp hoàng tráng, sáng rõ, không phủ tối */
.hero-artwork-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(245, 158, 11, 0.45);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(254, 240, 138, 0.4);
  background: #0b101c;
}

.hero-artwork-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.hero-artwork-frame:hover .hero-artwork-img {
  transform: scale(1.03);
}

/* Viền phát quang góc tranh phong cách kiếm hiệp */
.hero-artwork-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* ==========================================================================
   MODULE 1: TRUNG TÂM TẢI GAME (DOWNLOAD HUB)
   ========================================================================== */
.section {
  padding: clamp(45px, 7vw, 75px) 0;
  position: relative;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.section-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3.8vw, 2.3rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
}

.section-sub {
  color: var(--text-muted);
  max-width: 600px;
  margin: 8px auto 0;
  font-size: clamp(0.88rem, 1.8vw, 0.98rem);
}

/* Lời nhắc cho trình duyệt nhúng (Zalo, Facebook…) và iPhone ở đầu mục Tải Game - web/js/app.js renderDownloadHint. */
.dl-inapp {
  margin: 0 auto 20px;
  max-width: 880px;
  padding: 12px 16px;
  border: 1px solid var(--gold-border-bright);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--text-gold);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
}

/* Lưới thẻ tải game tự cân đối */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 28vw, 340px), 1fr));
  gap: clamp(20px, 3vw, 30px);
  margin-bottom: 36px;
}

.dl-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-top: 1px solid var(--gold-border-bright);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 34px) clamp(20px, 3vw, 28px) clamp(24px, 3vw, 28px);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.dl-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold-border-bright);
  background: var(--bg-card-hover);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 25px var(--gold-glow);
}

.dl-card-badge {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  text-transform: uppercase;
}

/* Hộp Icon Kiếm Hiệp Độc Bản (Khử răng cưa hoàn hảo) */
.dl-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.dl-card:hover .dl-icon-box {
  transform: scale(1.08);
}

.dl-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.dl-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 20px;
  min-height: 44px;
  line-height: 1.5;
}

.dl-specs {
  background: rgba(8, 13, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.83rem;
}

.dl-spec-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  color: var(--text-muted);
}

.dl-spec-row span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dl-spec-row strong {
  color: var(--text-main);
  font-weight: 600;
  min-width: 0;
  text-align: right;
}

.dl-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.dl-btn {
  width: 100%;
}

.dl-notice {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
}

/* Hộp hướng dẫn cài đặt */
.guide-box {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: clamp(20px, 3vw, 30px);
  margin-top: 24px;
}

.guide-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-bottom: 16px;
}

.guide-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.guide-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.guide-tab-btn.active, .guide-tab-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
}

.guide-content {
  display: none;
}

.guide-content.active {
  display: block;
}

.guide-steps {
  list-style-type: decimal;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-sub);
}

.guide-steps li strong {
  color: #ffffff;
}

/* ==========================================================================
   ROADMAP MODULES (LỘ TRÌNH MODULE TIẾP THEO)
   ========================================================================== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 28vw, 320px), 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  margin-top: 20px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: clamp(20px, 3vw, 26px);
  transition: var(--transition);
}

.module-card:hover {
  border-color: var(--gold-border-bright);
  transform: translateY(-3px);
}

.module-tag-top {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.module-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.module-desc {
  font-size: 0.86rem;
  color: var(--text-sub);
  margin-bottom: 14px;
  line-height: 1.5;
}

.module-status {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.module-status.done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   MODAL DIALOGS (AUTH, USER DASHBOARD, ADMIN)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #0d1424;
  border: 1px solid var(--gold-border-bright);
  border-radius: var(--radius-lg);
  width: min(94vw, 460px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px var(--gold-glow);
  position: relative;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-card.modal-lg {
  width: min(96vw, 840px);
}

.modal-head {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(245, 158, 11, 0.18);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-light);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: #ffffff;
  transform: scale(1.15);
}

.modal-body {
  padding: 20px 24px 28px;
  max-height: 82vh;
  overflow-y: auto;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.modal-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 11px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.modal-tab-btn.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.08);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.92rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

.form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: none;
}

.form-alert.error {
  display: block;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.form-alert.success {
  display: block;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

/* Thẻ nhân vật trong User Dashboard */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.char-card {
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
}

.char-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.char-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
}

.char-sect {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
}

.bar-wrap {
  margin: 6px 0;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill.hp {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  height: 100%;
}

.progress-fill.mp {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  height: 100%;
}

/* Bảng Quản trị Admin */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
  white-space: nowrap;
}

.admin-table th, .admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table th {
  background: rgba(245, 158, 11, 0.1);
  color: var(--gold-light);
  font-weight: 700;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: rgba(8, 12, 22, 0.75);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-num {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  color: var(--gold-light);
}

.stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: clamp(16px, 3vw, 24px);
  right: clamp(16px, 3vw, 24px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(90vw, 380px);
}

.toast {
  pointer-events: auto;
  width: 100%;
  background: #0d1424;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(100%);
  animation: slideInToast 0.3s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInToast {
  to { transform: translateX(0); }
}

.toast.toast-success {
  border-color: var(--emerald);
  box-shadow: 0 0 16px var(--emerald-glow);
}

.toast.toast-error {
  border-color: var(--crimson);
  box-shadow: 0 0 16px var(--crimson-glow);
}

/* ==========================================================================
   FOOTER (BẢO MẬT AN TOÀN, ĐẦY ĐỦ BẢN QUYỀN)
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--gold-border);
  background: #04070e;
  padding: 40px 0 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
}

.footer-copy {
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TỰ CĂN CHỈNH KÍCH THƯỚC)
   ========================================================================== */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }

  .hero-content {
    text-align: center;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-highlights {
    justify-content: center;
  }

  .mobile-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(8, 11, 18, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gold-border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 14px;
    align-items: stretch;
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
  }

  .nav-links.mobile-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 10px 14px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .nav-link.active {
    background: rgba(245, 158, 11, 0.12);
  }
}

@media (max-width: 600px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .nav-wrap {
    height: 64px;
  }

  .nav-links {
    top: 64px;
  }
}

/* Danh sách bản tải dựng bằng JS (app.js: loadDownloads) */
.dl-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
}
.dl-sha {
  margin-top: 10px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
}

/* Hai mục bản tải: có phím di chuyển / ẩn phím di chuyển (app.js: loadDownloads, cột web_download.variant) */
.download-grid.dl-groups {
  display: block;
}
.dl-group {
  margin-bottom: clamp(28px, 4vw, 44px);
}
.dl-group:last-child {
  margin-bottom: 0;
}
.dl-group-head {
  text-align: center;
  margin-bottom: clamp(16px, 2.5vw, 26px);
}
.dl-group-title {
  color: var(--gold-light);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}
.dl-group-title::after {
  content: '';
  display: block;
  width: 64px;
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-border-bright), transparent);
}
.dl-group-sub {
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  font-size: clamp(0.86rem, 1.7vw, 0.96rem);
}
.dl-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 28vw, 340px), 1fr));
  gap: clamp(20px, 3vw, 30px);
}
@media (max-width: 600px) {
  .dl-group-grid {
    grid-template-columns: 1fr;
  }
}

/* Mục menu chưa có trang thật */
.nav-link.nav-soon {
  opacity: 0.5;
  cursor: default;
}
.nav-link.nav-soon:hover::after {
  transform: translateX(-50%) scaleX(0);
}

/* Thông báo phiên bản client (app.js: renderReleaseBar) - bảng web_release, ADMIN đặt ở trang quản trị */
.release-bar {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.32), rgba(245, 158, 11, 0.14));
  border-bottom: 1px solid var(--gold-border);
  padding: 10px 0;
  color: var(--gold-light);
  font-size: 0.95rem;
}
.release-bar[hidden] {
  display: none;
}
.release-bar.is-update {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.34), rgba(245, 158, 11, 0.22));
  border-bottom-color: rgba(248, 113, 113, 0.6);
}
.release-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.rb-badge {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: #1a1206;
  background: var(--gold-bright);
  border-radius: 5px;
  padding: 2px 9px;
}
.release-bar.is-update .rb-badge {
  background: #fecaca;
}
.rb-text {
  flex: 1 1 320px;
  color: var(--text-main);
}
.rb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rb-notes {
  flex: 1 1 100%;
  margin: 4px 0 2px;
  padding-left: 22px;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.6;
}
.rb-notes[hidden] {
  display: none;
}
