/* =================================================================
   Thiên Long: Sơn Hà Vạn Tượng — Homepage
   Style theo docs/design-guideline-homepage.md (Hướng A: Chiến trận khốc liệt)
   ================================================================= */

/* ---------- Custom font ---------- */
@font-face {
  font-family: "NTH Justice Mist";
  src: url("assets/fonts/NTH_Justice_Mist-Regular.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

/* ---------- Design Tokens ---------- */
:root {
  /* Background & Surface — green-black theo logo rồng ngọc */
  --bg-base: #07130D;
  --bg-surface: #0E2017;
  --bg-surface-2: #153322;

  /* Accent — xanh lá rồng (dragon emerald) */
  --emerald-deep: #0B5E33;  /* nền/dải đậm thay crimson cũ */
  --emerald: #1E9E57;       /* xanh lá chủ đạo, điểm nhấn */
  --jade: #4BE38A;          /* xanh lá sáng, glow/hover */

  /* Accent — vàng gold (giữ như chữ trong logo, dùng cho CTA & tiêu đề) */
  --gold-deep: #B8801F;     /* đầu tối của gradient gold */
  --gold: #E0AC46;
  --gold-bright: #ffdf8e;   /* CTA primary only */

  /* Accent cool — xanh dương núi non trong logo */
  --steel: #3B5A6B;

  /* Text */
  --text-primary: #EAF3E4;
  --text-muted: #8FB39C;

  /* Border & Overlay */
  --border-metal: #2C5A3E;
  --overlay: rgba(4, 14, 9, .55);
  --glow-cta: rgba(247, 208, 107, .45);
  --glow-jade: rgba(75, 227, 138, .45);

  /* Fonts — font game cho tiêu đề, Be Vietnam Pro cho đoạn văn (dễ đọc) */
  --font-display: "NTH Justice Mist", "Be Vietnam Pro", system-ui, sans-serif;
  --font-heading: "NTH Justice Mist", "Be Vietnam Pro", system-ui, sans-serif;
  --font-body: "Be Vietnam Pro", system-ui, sans-serif;

  /* Font sizes — tiêu đề phóng to bù x-height nhỏ của font game */
  --fs-hero: clamp(2.6rem, 7vw, 6.5rem);
  --fs-section: clamp(2.1rem, 3.6vw, 3rem);
  --fs-card: 1.75rem;
  --fs-body: 1rem;
  --fs-caption: 0.8125rem;
  --fs-button: 1.0625rem;

  /* Spacing */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 24px;  --sp-6: 32px;  --sp-7: 48px;  --sp-8: 64px;
  --sp-9: 96px;  --sp-10: 128px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Shadow & Glow */
  --shadow-card: 0 8px 24px rgba(0,0,0,.45);
  --glow-gold: 0 0 24px var(--glow-cta);

  /* Motion */
  --dur-fast: 180ms;
  --dur-base: 300ms;
  --dur-slow: 550ms;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* Layout */
  --container: 1280px;
  --gutter: 24px;

  /* Z-index */
  --z-base: 0;
  --z-art: 10;
  --z-content: 20;
  --z-nav: 100;
  --z-sticky-cta: 200;
  --z-modal: 1000;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Tiêu đề dùng font game; đoạn văn kế thừa Be Vietnam Pro từ body.
   Font game có x-height nhỏ → phóng to ~12% + line-height thoáng để không lọt thỏm. */
h1, h2, h3,
.section-title, .hero__title, .hero__kicker,
.class-info__name,
.article__title, .content-main__cat,
.side-panel__head, .auth-card__title, .beta-bar__label {
  font-family: var(--font-heading);
  line-height: 1.25;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Section heads ---------- */
.section-head { text-align: center; margin-bottom: var(--sp-8); }

.section-title {
  position: relative;
  display: inline-block;
  font-size: var(--fs-section);
  font-weight: 800;
  color: var(--gold);
  letter-spacing: .02em;
  padding: var(--sp-3) var(--sp-8);
}
/* Khung hoành phi (biến đổi khỏi reference — 2 đầu vuốt bằng CSS) */
.section-title::before,
.section-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.section-title::before { left: -12px; transform: translateY(-50%); }
.section-title::after  { right: -12px; transform: translateY(-50%) scaleX(-1); background: linear-gradient(90deg, transparent, var(--emerald)); }

.section-sub { color: var(--text-muted); margin-top: var(--sp-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--fs-button);
  letter-spacing: .03em;
  padding: var(--sp-3) var(--sp-6);
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              background var(--dur-base) var(--ease);
}
.btn--lg { padding: var(--sp-4) var(--sp-8); font-size: 1.15rem; }
.btn__icon { font-size: 1.2em; }

.btn--primary {
  color: #2A1400;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: var(--glow-gold);
  border-color: transparent;
}
.btn--primary:hover { transform: scale(1.03); box-shadow: 0 0 34px var(--glow-cta); }

/* Blinking red/gold text for "TẢI GAME NGAY" CTA */
.btn__blink { animation: blinkRedGold 1s steps(2, jump-none) infinite; }
@keyframes blinkRedGold { 0% { color: #e11d1d; } 100% { color: #ffde7b; } }

.btn--outline {
  color: var(--gold);
  border-color: var(--border-metal);
  background: rgba(0,0,0,.25);
}
.btn--outline:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ================================================================
   1. HEADER
   ================================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  z-index: var(--z-nav);
  background: linear-gradient(180deg, rgba(7,19,13,.92), rgba(7,19,13,0));
  transition: background var(--dur-base);
}
.site-header.is-scrolled { background: rgba(7,19,13,.96); border-bottom: 1px solid var(--border-metal); }

.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: var(--sp-2); }
.brand__logo { height: 52px; width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.brand__mark {
  font-size: 1.6rem; font-weight: 800; color: var(--gold-bright);
  text-shadow: 0 0 12px var(--glow-cta);
}
.brand__name { font-weight: 700; letter-spacing: .06em; }

.nav { position: relative; display: flex; flex-wrap: nowrap; gap: var(--sp-3); align-items: center; margin-left: auto; }
.nav a { white-space: nowrap; }
.nav a {
  position: relative;
  font-weight: 600; font-size: .95rem; letter-spacing: .04em;
  color: var(--text-primary);
  padding: var(--sp-2) var(--sp-4); border-radius: 999px;
  border: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              text-shadow var(--dur-fast) var(--ease),
              border-color var(--dur-fast), background var(--dur-fast);
}
/* Hover: chữ sáng lên + phóng to nhẹ, mượt */
.nav a:hover { color: var(--gold-bright); transform: scale(1.1); text-shadow: 0 0 20px var(--glow-cta); }

/* Gạch dọc ngăn cách giữa các mục điều hướng (bỏ trước Đăng Nhập/Đăng Ký) */
.nav a + a:not(.nav__login):not(.nav__register)::before {
  content: ""; position: absolute; left: calc(var(--sp-3) / -2);
  top: 50%; transform: translateY(-50%);
  width: 1px; height: 16px; background: var(--border-metal);
}
/* Item đang chọn: chỉ đổi màu chữ — viền bo tròn do .nav__indicator đảm nhận */
.nav a.is-active { color: var(--gold-bright); }

/* Sliding active indicator: 1 viền pill duy nhất, trượt theo mục đang xem.
   Vị trí (left/width) do JS cập nhật; ẩn khi chưa có mục nào active. */
.nav__indicator {
  position: absolute; top: 50%; left: 0; width: 0;
  height: 52px; transform: translateY(-50%);
  border: 1px solid var(--border-metal); border-radius: 999px;
  background: rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; z-index: -1;
  transition: left var(--dur-base) var(--ease),
              width var(--dur-base) var(--ease),
              opacity var(--dur-fast) var(--ease);
}


.nav__indicator.is-shown { opacity: 1; }
/* Gạch chân vàng bám đáy pill, trượt cùng indicator */
/*.nav__indicator::after {
  content: ""; position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright)); 

}
*/
.nav__social { color: var(--gold); }
.nav__login, .nav__register, .nav__download { padding: var(--sp-2) var(--sp-4); font-size: .85rem; }
/* Nút Đăng Ký: chữ đen, hover chuyển đỏ */
/* Dùng .nav a.nav__register để đủ specificity đè .nav a (vốn cho chữ màu sáng) */
.nav a.nav__register { color: #000; }
.nav a.nav__register:hover { color: #e11d1d; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; }
.nav-toggle span { width: 26px; height: 2px; background: var(--gold); transition: var(--dur-fast); }

/* ================================================================
   2. HERO
   ================================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh; /* dvh: tránh giật khi thanh địa chỉ mobile ẩn/hiện */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0; z-index: var(--z-base);
  background:
    radial-gradient(120% 90% at 70% 30%, rgba(30,158,87,.35), transparent 55%),
    radial-gradient(90% 70% at 80% 60%, rgba(11,94,51,.45), transparent 60%),
    linear-gradient(160deg, rgba(12,36,22,.55) 0%, rgba(4,14,9,.6) 70%),
    url("assets/hero-cover.webp") center/cover no-repeat,
    #0c2416;
}
.hero__bg::after { /* vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 80% at 50% 45%, transparent 40%, rgba(4,14,9,.85) 100%);
}
.hero__glow {
  position: absolute; z-index: var(--z-art);
  top: 32%; right: 26%; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255,240,200,.85), rgba(247,208,107,.35) 30%, transparent 65%);
  filter: blur(6px);
  animation: pulseGlow 4s ease-in-out infinite;
}
.hero__character {
  display: none;
  position: absolute; z-index: var(--z-art);
  right: 4%; bottom: 0; width: 46%; height: 92%;
  background:
    radial-gradient(60% 40% at 50% 12%, rgba(200,255,220,.4), transparent 60%),
    linear-gradient(180deg, transparent 8%, rgba(11,94,51,.5) 40%, rgba(4,14,9,.9) 92%);
  clip-path: polygon(30% 0, 72% 4%, 88% 40%, 80% 100%, 20% 100%, 12% 44%);
  filter: drop-shadow(-8px 0 24px rgba(30,158,87,.5));
}
.hero__content {
  position: relative;
  z-index: var(--z-content);
  max-width: 680px;
  margin-inline: auto;
  padding: var(--sp-7) var(--sp-6);
  text-align: center;
  border: 1px solid rgba(224, 172, 70, .34);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(7,19,13,.72), rgba(7,19,13,.46));
  box-shadow:
    0 22px 60px rgba(0,0,0,.56),
    0 0 36px rgba(247,208,107,.2),
    inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(4px);
}

.hero__kicker {
  display: inline-block;
  font-family: var(--font-body);
  color: var(--gold);
  font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  font-size: .8rem; margin-bottom: var(--sp-4);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--border-metal); border-radius: var(--radius-sm);
}
.hero__title { font-size: var(--fs-hero); font-weight: 800; line-height: 1.02; letter-spacing: .01em; }
.hero__logo { width: min(560px, 100%); height: auto; filter: drop-shadow(0 6px 28px rgba(0,0,0,.6)); }
.hero__title-lg { display: block; text-shadow: 0 4px 20px rgba(0,0,0,.7); }
.hero__title-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 12px rgba(247,208,107,.4));
}
.hero__sub {
  color: var(--text-primary);
  opacity: .9;
  margin: var(--sp-5) auto;
  max-width: 34rem;
}

.hero__status {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  background: rgba(0,0,0,.4); border: 1px solid var(--border-metal);
  border-radius: 999px; padding: var(--sp-2) var(--sp-5);
  font-size: .85rem; color: var(--text-primary); margin-bottom: var(--sp-6);
  white-space: nowrap;
}
.hero__status strong { color: var(--gold-bright); }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #4be36a;
  box-shadow: 0 0 13px #2deb53; animation: blink 1.6s infinite;
}

.hero__cta { display: flex; align-items: center; justify-content: center; gap: var(--sp-6); flex-wrap: wrap; }
.hero__qr { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-muted); font-size: .82rem; }
.qr-box {
  width: 64px; height: 64px; display: grid; place-items: center;
  background: #fff; color: #140B07; font-weight: 800; border-radius: var(--radius-sm);
}
.hero__qr--light { color: rgba(255,255,255,.85); }

.hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: var(--z-content); font-size: 1.6rem; color: var(--gold);
  animation: floatY 2s ease-in-out infinite;
}

/* Embers */
.hero__embers { position: absolute; inset: 0; z-index: var(--z-art); pointer-events: none; }
.ember {
  position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--jade); box-shadow: 0 0 6px var(--jade);
  animation: rise linear infinite;
}

/* ================================================================
   3. BETA BAR
   ================================================================ */
.beta-bar { background: linear-gradient(90deg, var(--emerald-deep), var(--bg-surface-2), var(--emerald-deep)); border-block: 1px solid var(--border-metal); }
/* Lưới 3 cột: 2 cột bên bằng nhau (1fr) -> bộ đếm ở cột giữa luôn nằm chính giữa trang */
/* Chỉ còn bộ đếm -> canh giữa trang */
.beta-bar__inner { display: flex; justify-content: center; align-items: center; padding: var(--sp-5) var(--gutter); }
.beta-bar__label { font-family: var(--font-body); font-weight: 800; color: var(--gold-bright); font-size: 1.1rem; letter-spacing: .03em; }
.beta-bar__counts { display: flex; gap: var(--sp-6); flex-wrap: wrap; justify-content: center; }
.beta-bar__group { display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; }
.beta-bar__ctitle { font-weight: 700; font-size: .8rem; letter-spacing: .04em; color: var(--gold); text-transform: uppercase; }
.beta-bar__count { display: flex; gap: var(--sp-3); }
.count-box { text-align: center; background: rgba(0,0,0,.35); border: 1px solid var(--border-metal); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-4); min-width: 58px; }
.count-box b { display: block; font-size: 1.4rem; color: var(--gold-bright); line-height: 1; }
.count-box span { font-size: .68rem; color: var(--text-muted); }


/* ================================================================
   6. NEWS
   ================================================================ */
.news { padding-block: var(--sp-9); }
/* Khoá chiều cao khung cha → đổi tab không làm co giãn layout, cả 2 cột luôn bằng nhau */
.news__body { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: var(--sp-7); align-items: stretch; height: 380px; }
.news__feature { height: 100%; min-width: 0; }
.news__list { display: flex; flex-direction: column; height: 100%; overflow: hidden; min-width: 0; }
.news__feature-img {
  height: 100%; border-radius: var(--radius-lg);
  border: 1px solid var(--border-metal); display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(75,200,180,.25), transparent 60%),
    linear-gradient(160deg, #10202a, #0c1418);
}
.news__feature-img span { font-weight: 800; font-size: 1.4rem; color: #bfe9df; letter-spacing: .1em; }

.news__tabs { display: flex; gap: var(--sp-2); border-bottom: 1px solid var(--border-metal); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.news__tab {
  background: none; border: 0; color: var(--text-muted); cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem;
  padding: var(--sp-3) var(--sp-4); position: relative;
}
.news__tab.is-active { color: var(--gold); }
.news__tab.is-active::after { content: ""; position: absolute; left: var(--sp-4); right: var(--sp-4); bottom: -1px; height: 2px; background: var(--gold); }

.news__items li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px dashed rgba(44,90,62,.5); }
.news__items a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--dur-fast); }
.news__items a:hover { color: var(--gold); }
.news__items time { color: var(--text-muted); font-size: .82rem; }
.tag { font-size: .68rem; font-weight: 800; color: #04140A; background: var(--emerald); padding: 2px 7px; border-radius: var(--radius-sm); }
.news__more { display: inline-block; margin-top: auto; padding-top: var(--sp-5); color: var(--gold); font-weight: 700; }

/* ================================================================
   7. FEATURES CAROUSEL
   ================================================================ */
.features { padding-block: var(--sp-9); background: var(--bg-surface); }
.carousel { position: relative; display: flex; align-items: center; gap: var(--sp-4); }
.carousel__track { flex: 1; display: flex; gap: var(--sp-5); overflow: hidden; padding: var(--sp-4) 0; }
.feat-card {
  flex: 0 0 calc((100% - 2 * var(--sp-5)) / 3);
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-metal);
  background: var(--bg-surface-2);
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base), filter var(--dur-base);
}
.feat-card__img { aspect-ratio: 16/10; }
.feat-card__img--photo { background-size: cover; background-position: center; }
.feat-card__img[data-theme="a"] { background: linear-gradient(160deg,#2e5a4a,#0f2a22); }
.feat-card__img[data-theme="b"] { background: linear-gradient(160deg,#0b5e33,#0a2418); }
.feat-card__img[data-theme="c"] { background: linear-gradient(160deg,#8a6a1e,#2a1f08); }
.feat-card__img[data-theme="d"] { background: linear-gradient(160deg,#3b5a6b,#131f26); }
.feat-card__body { padding: var(--sp-5); }
.feat-card__body h3 { color: var(--gold); font-size: 1.35rem; margin-bottom: var(--sp-2); }
.feat-card__body p { color: var(--text-muted); font-size: .9rem; }
.feat-card.is-side { opacity: .55; filter: saturate(.6); transform: scale(.94); }

.carousel__arrow {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0,0,0,.4); border: 1px solid var(--border-metal); color: var(--gold);
  font-size: 1.6rem; cursor: pointer; transition: var(--dur-fast);
}
.carousel__arrow:hover { border-color: var(--gold); color: var(--gold-bright); background: rgba(0,0,0,.6); }
.carousel__dots { display: flex; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-5); }
.carousel__dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--border-metal); cursor: pointer; }
.carousel__dots button.is-active { background: var(--gold); }

/* ================================================================
   8. CLASSES
   ================================================================ */
.classes { padding-top: var(--sp-9); background: var(--bg-base); }
.classes__stage { position: relative; min-height: 560px; overflow: hidden; }
.classes__stage::before { /* dải băng ngang cắt nền */
  content: ""; position: absolute; inset: 18% 0 auto 0; height: 64%;
  background: linear-gradient(90deg, rgba(11,94,51,.45), rgba(21,51,34,.65), rgba(59,90,107,.3));
  border-block: 1px solid var(--border-metal);
}

/* Aura glow phía sau nhân vật — đổi màu theo phái qua biến --aura */
.classes__aura {
  position: absolute; z-index: var(--z-art); left: 62%; bottom: 4%;
  transform: translateX(-50%);
  width: 620px; height: 620px; max-width: 70vw; max-height: 88%;
  background: radial-gradient(circle, var(--aura, rgba(30,158,87,.5)), transparent 62%);
  filter: blur(8px);
  transition: background var(--dur-slow) var(--ease);
  animation: pulseGlow 5s ease-in-out infinite;
  pointer-events: none;
}

/* Ảnh nhân vật thật (đã tách nền) */
.classes__char-img {
  position: absolute; z-index: var(--z-art); right: 4%; bottom: 0;
  width: auto; height: auto; max-height: 100%; max-width: 48%; object-fit: contain; object-position: bottom;
  /* mask fade cạnh trái + dưới để giấu phần nền sót và hòa vào section */
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 16%),
    linear-gradient(180deg, #000 82%, transparent 100%);
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 16%),
    linear-gradient(180deg, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  filter: drop-shadow(-10px 6px 28px rgba(0,0,0,.55));
  opacity: 0; transform: translateY(18px) scale(.99);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.classes__char-img.is-in { opacity: 1; transform: none; }

/* Silhouette placeholder cho phái chưa có ảnh (Mạn Đà) */
.classes__character {
  position: absolute; z-index: var(--z-art); right: 12%; bottom: 0;
  width: 300px; height: 460px; display: none;
  background:
    radial-gradient(50% 30% at 50% 15%, rgba(200,120,220,.4), transparent 60%),
    linear-gradient(180deg, transparent, #4a2e6b 45%, #1a0f2a 95%);
  clip-path: polygon(38% 0,62% 2%,78% 30%,70% 100%,30% 100%,22% 32%);
  filter: drop-shadow(0 0 30px rgba(160,80,220,.5));
}

.classes__soon-badge {
  position: absolute; z-index: var(--z-content); right: 14%; top: 34%;
  padding: var(--sp-2) var(--sp-5); border-radius: 999px;
  background: rgba(74,46,107,.85); border: 1px solid #a050dc; color: #ead4ff;
  font-weight: 800; letter-spacing: .08em; font-size: .82rem;
  box-shadow: 0 0 20px rgba(160,80,220,.5); opacity: 0; transition: opacity var(--dur-base);
}
.classes.is-soon .classes__soon-badge { opacity: 1; }

.classes__panel { position: relative; z-index: var(--z-content); min-height: 560px; display: flex; align-items: center; }
/* Bố cục: [Tên + giới thiệu + radar] | [4 ô specs] — 2 cột gần nhau, dồn về giữa sân khấu */
.class-info { display: grid; grid-template-columns: auto auto; column-gap: var(--sp-7); align-items: start; max-width: none; margin-left: 6%; }
.class-info__name, .class-info__type { grid-column: 1 / -1; }
.class-info__main { max-width: 340px; }
.class-info__name { font-size: 3.2rem; font-weight: 800; color: var(--gold-bright); text-shadow: 0 2px 16px rgba(0,0,0,.75); line-height: 1; }
.class-info__type { color: var(--gold); letter-spacing: .1em; font-size: .82rem; font-weight: 700; margin: var(--sp-3) 0; text-transform: uppercase; }
.class-info__lore { color: var(--text-muted); font-size: .88rem; line-height: 1.6; margin-bottom: var(--sp-5); }

/* Bảng thông số phái — mỗi ô 1 dòng, nhãn không xuống dòng */
.class-info__specs { display: grid; gap: var(--sp-3); margin: 0; align-content: start; }
.class-info__specs > div { display: grid; grid-template-columns: 108px 1fr; gap: var(--sp-3); align-items: center; }
.class-info__specs dt {
  font-size: .72rem; font-weight: 800; color: #2A1400; letter-spacing: .04em; white-space: nowrap;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  padding: 6px 8px; border-radius: var(--radius-sm); text-align: center; text-transform: uppercase;
}
.class-info__specs dd { color: var(--text-primary); font-size: .86rem; line-height: 1.4; }

.class-radar { position: relative; width: 190px; height: 190px; margin-top: var(--sp-5); }
.class-radar svg { width: 100%; height: 100%; }
.radar__grid { fill: rgba(0,0,0,.25); stroke: var(--border-metal); stroke-width: 1; }
.radar__stat { fill: rgba(247,208,107,.28); stroke: var(--gold); stroke-width: 2; transition: all var(--dur-slow) var(--ease); }
.radar__label { position: absolute; font-size: .72rem; color: var(--text-muted); font-weight: 700; }
.radar__label--atk { top: -6px; left: 50%; transform: translateX(-50%); }
.radar__label--def { top: 32%; right: -20px; }
.radar__label--spd { bottom: 8%; right: 8px; }
.radar__label--sup { bottom: 8%; left: 8px; }
.radar__label--ctrl{ top: 32%; left: -24px; }

.class-picker { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; padding: var(--sp-7) var(--gutter) var(--sp-9); }
.class-pick {
  position: relative; flex: 0 1 auto; white-space: nowrap;
  background: var(--bg-surface-2); border: 1px solid var(--border-metal); color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-body); font-weight: 700; letter-spacing: .03em; font-size: .92rem;
  transition: var(--dur-fast);
}
.class-pick:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }
.class-pick.is-active { color: #2A1400; background: linear-gradient(180deg,var(--gold-bright),var(--gold)); border-color: #fff3cf; box-shadow: var(--glow-gold); }
.class-pick.is-locked { color: #b98fd8; border-style: dashed; border-color: #6a4a8b; }
.class-pick.is-locked::after {
  content: attr(data-badge);
  position: absolute; top: -8px; right: -6px;
  font-size: .58rem; font-weight: 800; letter-spacing: .02em;
  background: #a050dc; color: #fff; padding: 1px 6px; border-radius: 999px;
}
.class-pick.is-locked.is-active { color: #fff; background: linear-gradient(180deg,#a050dc,#6a3a9b); border-color: #d4a0ff; box-shadow: 0 0 18px rgba(160,80,220,.5); }

/* Nút phái nổi bật (tân phái — art mới) */
.class-pick.is-featured {
  color: var(--jade); border-color: var(--jade);
  background: linear-gradient(180deg, rgba(75,227,138,.16), rgba(30,158,87,.12));
  box-shadow: 0 0 14px rgba(75,227,138,.35);
}
.class-pick.is-featured::after {
  content: attr(data-badge);
  position: absolute; top: -8px; right: -6px;
  font-size: .58rem; font-weight: 800; letter-spacing: .02em;
  background: var(--jade); color: #04140A; padding: 1px 6px; border-radius: 999px;
}
.class-pick.is-featured:hover { color: #eafff2; border-color: var(--jade); }
.class-pick.is-featured.is-active {
  color: #04140A; background: linear-gradient(180deg, var(--jade), var(--emerald));
  border-color: #cffde2; box-shadow: 0 0 20px rgba(75,227,138,.55);
}

/* ================================================================
   13. FOOTER
   ================================================================ */
.site-footer { background: #050F0A; border-top: 1px solid var(--border-metal); padding-block: var(--sp-7); }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); text-align: center; }
.footer__brand { display: flex; align-items: center; gap: var(--sp-3); }
.footer__logo { height: 72px; width: auto; filter: drop-shadow(0 2px 10px rgba(0,0,0,.5)); }
.footer__brand p { font-weight: 700; color: var(--text-primary); }
.footer__links { display: flex; gap: var(--sp-5); flex-wrap: wrap; justify-content: center; }
.footer__links a { color: var(--text-muted); font-size: .9rem; transition: color var(--dur-fast); }
.footer__links a:hover { color: var(--gold); }
.footer__legal { color: var(--text-muted); font-size: .78rem; line-height: 1.7; max-width: 720px; }

/* ================================================================
   Sticky CTA (mobile) + Back to top
   ================================================================ */
.back-top {
  position: fixed; right: 20px; bottom: 24px; z-index: var(--z-sticky-cta);
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.5); border: 1px solid var(--border-metal); color: var(--gold);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-base), border-color var(--dur-fast);
}
.back-top.is-visible { opacity: 1; pointer-events: auto; }
.back-top:hover { border-color: var(--gold); }

/* ================================================================
   Reveal on scroll
   ================================================================ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ================================================================
   Keyframes
   ================================================================ */
@keyframes pulseGlow { 0%,100% { opacity: .8; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes floatY { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }
@keyframes rise { 0% { transform: translateY(0) scale(1); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-100vh) scale(.4); opacity: 0; } }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1439px) {
  .news, .features { padding-block: var(--sp-8); }
}

/* Tablet */
@media (max-width: 1199px) {
  .feat-card { flex-basis: calc((100% - var(--sp-5)) / 2); }
  .hero__character { width: 52%; opacity: .8; }
}

/* Mobile */
@media (max-width: 767px) {
  /* Menu overlay chỉ áp cho nav trang chủ (có nút hamburger + JS toggle) */
  .nav-toggle { display: flex; }
  #navMenu.nav--right {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; gap: 0; align-items: stretch; margin-left: 0;
    background: rgba(7,19,13,.98); border-bottom: 1px solid var(--border-metal);
    transform: translateY(-120%); transition: transform var(--dur-base) var(--ease);
    padding: var(--sp-4) var(--gutter);
  }
  #navMenu.nav--right.is-open { transform: none; }
  #navMenu.nav--right a { padding: var(--sp-4) 0; border-radius: 0; border: none; border-bottom: 1px solid rgba(44,90,62,.4); }
  /* Menu dọc: pill trượt không hợp lý -> ẩn, đánh dấu mục active bằng gạch bên trái */
  #navMenu.nav--right .nav__indicator { display: none; }
  #navMenu.nav--right a.is-active { box-shadow: inset 3px 0 0 var(--gold-bright); padding-left: var(--sp-3); }
  /* Nav các trang phụ (register/login/article): giữ hàng ngang gọn, co chữ */
  .nav--right:not(#navMenu) { gap: var(--sp-3); margin-left: 0; }
  .nav--right:not(#navMenu) a { padding: var(--sp-2) var(--sp-3); font-size: .86rem; }
  .header__inner { justify-content: space-between; }
  .brand__logo { height: 40px; }

  .hero { min-height: 88vh; min-height: 88dvh; }
  .hero__content {
    padding: var(--sp-6) var(--sp-4);
    box-shadow:
      0 14px 42px rgba(0,0,0,.48),
      0 0 24px rgba(247,208,107,.16),
      inset 0 1px 0 rgba(255,255,255,.08);
  }
  .hero__character { width: 80%; height: 60%; opacity: .5; right: -10%; }
  .hero__glow { width: 300px; height: 300px; top: 20%; right: 5%; }
  .hero__cta { gap: var(--sp-4); }
  .hero__qr { display: none; }

  .beta-bar__inner { justify-content: center; text-align: center; }
  .news__body { grid-template-columns: minmax(0,1fr); height: auto; }
  .news__feature-img { height: 220px; }
  .news__list { height: auto; min-height: 300px; overflow: visible; }
  /* Carousel: cho vuốt tay (swipe) trên mobile + snap từng card, ẩn thanh cuộn */
  .carousel__track {
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .carousel__track::-webkit-scrollbar { display: none; }
  .feat-card { flex-basis: 100%; scroll-snap-align: center; }
  .carousel__arrow { display: none; }

  /* Mobile: nhân vật làm nền mờ phía sau, info nổi lên trên */
  .classes__stage { min-height: 620px; }
  .classes__char-img { right: -8%; height: 88%; max-width: 78%; opacity: .32 !important; }
  .classes__char-img.is-in { opacity: .32 !important; }
  .classes__aura { left: 60%; width: 380px; height: 380px; }
  .classes__character { width: 200px; height: 320px; right: 2%; }
  .classes__soon-badge { right: 8%; top: 24%; }
  .classes__panel { min-height: 620px; align-items: center; }
  .class-info { grid-template-columns: 1fr; gap: var(--sp-5); margin-left: 0; }
  .class-info__main { max-width: 100%; }
  .class-info__specs > div { grid-template-columns: 108px 1fr; }
  /* Chừa lề trái/phải để nhãn radar (Khống/Thủ) không bị cắt */
  .class-radar { margin-left: 28px; }

  .back-top { bottom: 24px; right: 16px; }

  .section-title { font-size: 1.6rem; padding-inline: var(--sp-5); }
}

/* Điện thoại nhỏ (≤480px) */
@media (max-width: 480px) {
  /* Đồng hồ đếm ngược: ô nhỏ lại để 4 ô/cụm không tràn */
  .beta-bar__counts { gap: var(--sp-4); }
  .beta-bar__count { gap: var(--sp-2); }
  .count-box { min-width: 44px; padding: var(--sp-2) var(--sp-2); }
  .count-box b { font-size: 1.1rem; }
  .count-box span { font-size: .6rem; }
  .beta-bar__ctitle { font-size: .72rem; }

  /* Hero: giảm giãn cách chữ để không tràn trên màn hẹp */
  .hero__kicker { letter-spacing: .1em; font-size: .72rem; }
  .hero__status { font-size: .82rem; }

  /* 4 ô specs: nhãn co gọn, không chiếm quá nhiều bề ngang */
  .class-info__specs > div { grid-template-columns: 88px 1fr; gap: var(--sp-2); }
  .class-info__specs dt { font-size: .66rem; padding: 5px 6px; }
  .class-info__specs dd { font-size: .8rem; }

  .btn--lg { padding: var(--sp-3) var(--sp-5); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__embers { display: none; }
  /* Keep the "TẢI GAME NGAY" text blinking even with reduced motion */
  .btn__blink { animation: blinkRedGold 1s steps(2, jump-none) infinite !important; }
}
