/* =========================================================
   Thiên Long Kỳ Hiệp · layout tông sáng (giấy dó + mực + son)
   ========================================================= */
:root {
  --paper: #fbf8f1;
  --paper-2: #f4eee2;
  --paper-3: #ebe2cf;
  --card: #fffdf9;
  --ink: #221c16;
  --ink-2: #4c4237;
  --muted: #877b6b;
  --line: #e8decb;
  --line-2: #d8c8ab;

  --red: #b4372b;
  --red-d: #93281e;
  --red-soft: #f9e5df;
  --gold: #a87b22;
  --gold-l: #e2bf6c;
  --gold-soft: #f6ebd0;
  --jade: #2d7562;
  --jade-soft: #def0e9;
  --sky: #3f6f99;
  --sky-soft: #e2edf6;

  --shadow-sm: 0 1px 2px rgba(70, 45, 20, .06), 0 3px 10px rgba(70, 45, 20, .05);
  --shadow: 0 18px 40px -18px rgba(80, 50, 20, .28);
  --radius: 14px;
  --radius-lg: 20px;

  /* Một font duy nhất cho toàn site: Be Vietnam Pro (thiết kế riêng cho tiếng Việt, chuyên nghiệp & dễ đọc).
     --serif giữ tên biến cũ nhưng trỏ về cùng một font để mọi tiêu đề/số liệu dùng chung. */
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--sans);
  --cn: "Noto Serif SC", "SimSun", "Songti SC", serif;
  --wrap: 1200px;
  --header-h: 78px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font: 400 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); line-height: 1.2; color: var(--ink); }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Nút & chip ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn--sm .ic { width: 17px; height: 17px; }
.btn--lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn--red {
  color: #fff;
  background: linear-gradient(180deg, #c8463a, var(--red) 55%, var(--red-d));
  box-shadow: 0 8px 20px -8px rgba(180, 55, 43, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--red:hover { box-shadow: 0 12px 26px -10px rgba(180, 55, 43, .75), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn--ghost { color: var(--ink); background: rgba(255, 253, 249, .8); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--gold); background: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font: 600 12px/1.5 var(--sans); letter-spacing: .02em; white-space: nowrap;
  background: var(--paper-2); color: var(--ink-2);
}
.chip--red { background: var(--red-soft); color: var(--red-d); }
.chip--gold { background: var(--gold-soft); color: #87601a; }
.chip--jade { background: var(--jade-soft); color: var(--jade); }
.chip--sky { background: var(--sky-soft); color: var(--sky); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #3aa676; box-shadow: 0 0 0 3px rgba(58, 166, 118, .18); display: inline-block; }
.dot--red { background: var(--red); box-shadow: 0 0 0 3px rgba(180, 55, 43, .16); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--card); transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--red); color: var(--red); }

/* ---------- Tiêu đề mục ---------- */
.section { padding: 88px 0; position: relative; }
.section--tight { padding: 56px 0; }
.section--alt { background: var(--paper-2); }
.sec-head { text-align: center; margin-bottom: 40px; }
.sec-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 700; letter-spacing: -.01em; }
.sec-head p { margin-top: 10px; color: var(--muted); }
.sec-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; text-align: left; }
.sec-head__note { color: var(--muted); font-size: 14px; max-width: 320px; text-align: right; }
.kicker {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
}
.kicker::before, .kicker::after { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-l)); }
.kicker::after { transform: scaleX(-1); }
.sec-head--row .kicker::before, .kicker--left::before { display: none; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--red); white-space: nowrap; }
.link-more .ic { width: 18px; height: 18px; transition: transform .2s; }
.link-more:hover .ic { transform: translateX(3px); }

/* ---------- Topbar ---------- */
.topbar { background: var(--ink); color: #e9e0cf; font-size: 13px; }
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; }
.topbar b { color: #fff; font-weight: 600; }
.topbar .status { display: inline-flex; align-items: center; gap: 8px; }
.topbar__right { display: inline-flex; align-items: center; gap: 22px; }
.topbar__right a:hover { color: var(--gold-l); }
.topbar .clock { display: inline-flex; align-items: center; gap: 6px; }
.topbar .clock .ic { width: 15px; height: 15px; }
#srv-clock { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 248, 241, .86);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 24px -18px rgba(70, 45, 20, .5); }
.header__in { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand img { height: 66px; width: auto; filter: drop-shadow(0 3px 6px rgba(120, 70, 20, .15)); }
.nav { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
.nav > a, .dd__btn {
  position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 8px 13px; border: 0; border-radius: 999px; background: none;
  font-weight: 500; font-size: 15px; color: var(--ink-2); white-space: nowrap; transition: color .2s, background-color .2s;
}
.nav > a:hover, .dd__btn:hover, .dd.is-open .dd__btn { color: var(--ink); background: var(--paper-2); }
.nav > a.is-active, .dd.is-active .dd__btn { color: var(--red); }
.nav > a.is-active::after, .dd.is-active .dd__btn::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--red); }

/* Menu thả Cẩm nang */
.dd { position: relative; }
.dd__btn .ic { width: 16px; height: 16px; transition: transform .2s; }
.dd.is-open .dd__btn .ic { transform: rotate(180deg); }
.dd__panel {
  position: absolute; top: calc(100% + 10px); left: 50%; z-index: 50; width: 680px;
  display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 6px 18px; padding: 18px 18px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 24px 50px -20px rgba(70, 45, 20, .35);
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.dd__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.dd.is-open .dd__panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.dd__col h5 { margin: 4px 10px 8px; font: 600 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.dd__col a { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink); transition: background-color .15s, color .15s; }
.dd__col a .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--gold); }
.dd__col a small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.dd__col a:hover { background: var(--paper-2); }
.dd__col a.is-active { background: var(--red-soft); color: var(--red-d); }
.dd__col a.is-active .ic { color: var(--red); }
.dd__foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; padding: 10px; border-top: 1px dashed var(--line); font-size: 14px; font-weight: 600; color: var(--red); }
.dd__foot .ic { width: 16px; height: 16px; }
.header__cta { display: flex; align-items: center; gap: 10px; }
.burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); place-items: center; }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(34, 28, 22, .35); }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw);
  background: var(--paper); padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .35); animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__head img { height: 44px; width: auto; }
.drawer__nav { display: flex; flex-direction: column; }
.drawer__panel { overflow-y: auto; }
.drawer__nav a, .drawer__group summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 4px; border-bottom: 1px solid var(--line); font-weight: 500; }
.drawer__nav a.is-active { color: var(--red); }
.drawer__group summary { cursor: pointer; list-style: none; }
.drawer__group summary::-webkit-details-marker { display: none; }
.drawer__group summary .ic { width: 18px; height: 18px; transition: transform .2s; }
.drawer__group[open] summary .ic { transform: rotate(180deg); }
.drawer__group a { padding: 10px 4px 10px 16px; font-size: 15px; color: var(--ink-2); }
.drawer__cta { display: grid; gap: 10px; margin-top: auto; padding-top: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background: url(../img/hero.webp) 70% 30% / cover no-repeat;
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--paper) 0%, rgba(251, 248, 241, .94) 30%, rgba(251, 248, 241, .55) 52%, rgba(251, 248, 241, 0) 72%),
    linear-gradient(0deg, var(--paper) 0%, rgba(251, 248, 241, 0) 28%);
}
.hero__in { min-height: 640px; display: flex; flex-direction: column; justify-content: center; padding-top: 48px; padding-bottom: 120px; }
.hero__content { max-width: 540px; }
.hero__logo { margin: 18px 0 14px; }
.hero__logo img { width: min(420px, 100%); filter: drop-shadow(0 14px 22px rgba(120, 70, 20, .18)); }
.hero__lead { font-size: 18px; color: var(--ink-2); max-width: 470px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.rates {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 640px;
  background: rgba(255, 253, 249, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.rates li { padding: 14px 10px; text-align: center; }
.rates li + li { border-left: 1px solid var(--line); }
.rates b { display: block; font: 700 26px/1.1 var(--serif); color: var(--red); }
.rates span { font-size: 12.5px; color: var(--muted); }

/* ---------- Truy cập nhanh ---------- */
.quick { position: relative; z-index: 2; margin-top: -64px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.qcard {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s;
}
.qcard:hover { transform: translateY(-3px); border-color: var(--line-2); }
.qcard b { display: block; font-size: 16px; }
.qcard small { color: var(--muted); font-size: 13px; }
.qcard__ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; flex: none; }
.qcard__ic .ic { width: 22px; height: 22px; }
.qcard__ic--red { background: var(--red-soft); color: var(--red); }
.qcard__ic--gold { background: var(--gold-soft); color: var(--gold); }
.qcard__ic--jade { background: var(--jade-soft); color: var(--jade); }
.qcard__ic--sky { background: var(--sky-soft); color: var(--sky); }

/* ---------- Tin tức ---------- */
.news { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: stretch; }
.slider { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.slider__track { display: grid; flex: 1; }
.slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; display: flex; flex-direction: column; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.slide__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.slide__media:hover img { transform: scale(1.03); }
.slide__body { padding: 20px 24px 8px; }
.slide__body h3 { font-size: 23px; margin: 10px 0 6px; }
.slide__body h3 a:hover { color: var(--red); }
.slide__body p { color: var(--muted); font-size: 15px; }
.slider__ctrl { display: flex; align-items: center; gap: 12px; padding: 12px 24px 20px; }
.slider__dots { display: flex; gap: 6px; margin-right: auto; order: -1; }
.slider__dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: var(--line-2); transition: width .3s, background-color .3s; }
.slider__dots button[aria-selected="true"] { width: 26px; background: var(--red); }

.newslist { display: flex; flex-direction: column; padding: 8px 8px 12px; }
.tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { background: var(--ink); color: #fff; }
.newslist__items { list-style: none; margin: 0; padding: 4px 8px; }
.newslist__items li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px dashed var(--line); }
.newslist__items li:last-child { border-bottom: 0; }
.newslist__items li[hidden] { display: none; }
.newslist__items .chip { min-width: 74px; justify-content: center; }
.newslist__items a { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newslist__items a:hover { color: var(--red); }
.newslist__items time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Môn phái ---------- */
.section--factions { background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 40%, #f3eee6 100%); overflow: hidden; }
.section--factions::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70%; pointer-events: none;
  background: url(../img/clouds.webp) center bottom / cover no-repeat; opacity: .9;
  -webkit-mask-image: linear-gradient(0deg, #000 45%, transparent);
  mask-image: linear-gradient(0deg, #000 45%, transparent);
}
.section--factions .wrap { position: relative; }
.faction { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.faction__art {
  margin: 0; position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 3 / 2;
  box-shadow: var(--shadow); outline: 1px solid rgba(168, 123, 34, .35); outline-offset: 6px;
}
.faction__art img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease, transform .6s ease; }
.faction__art img.is-fading { opacity: 0; transform: scale(1.02); }
.faction__info { position: relative; overflow: hidden; padding: 32px; }
.faction__cn {
  position: absolute; right: -6px; top: -14px; font: 700 128px/1 var(--cn);
  color: rgba(168, 123, 34, .1); pointer-events: none; letter-spacing: -.05em;
}
.faction__info h3 { font-size: 40px; margin: 14px 0 10px; position: relative; }
.faction__info p { color: var(--ink-2); position: relative; min-height: 78px; }
.stats { margin: 22px 0 0; display: grid; gap: 12px; position: relative; }
.stats div { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 12px; }
.stats dt { font-size: 14px; color: var(--muted); }
.stats dd { margin: 0; height: 8px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.stats dd i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-l), var(--red)); transform-origin: left; transition: width .5s ease; }
.stats span { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.fpick { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 10px; margin-top: 36px; }
.fpick button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px 12px;
  border: 1px solid transparent; border-radius: var(--radius); background: rgba(255, 253, 249, .6);
  font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background-color .2s, border-color .2s, color .2s;
}
.fpick button:hover { background: var(--card); border-color: var(--line); }
.fpick img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow .2s; }
.fpick button[aria-selected="true"] { background: var(--card); border-color: var(--line-2); color: var(--red); box-shadow: var(--shadow-sm); }
.fpick button[aria-selected="true"] img { box-shadow: 0 0 0 2px var(--red); }

/* ---------- Đặc sắc ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 3 / 4.3;
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); isolation: isolate;
}
.feat img { position: absolute; inset: 0 0 auto; width: 100%; height: 78%; object-fit: cover; object-position: top; z-index: -1; transition: transform .7s ease; }
.feat:hover img { transform: scale(1.05); }
.feat::after {
  content: ""; position: absolute; inset: 42% 0 0; z-index: -1;
  background: linear-gradient(180deg, rgba(251, 248, 241, 0) 0%, rgba(251, 248, 241, .92) 42%, var(--paper) 62%);
}
.feat__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; }
.feat__no { font: 700 14px var(--serif); color: var(--gold); letter-spacing: .1em; }
.feat h3 { font-size: 20px; margin: 4px 0 6px; }
.feat p { font-size: 14px; color: var(--ink-2); }

/* ---------- Boss ---------- */
.bosses { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.boss { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.boss__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.boss h3 { font-size: 20px; }
.boss__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.boss__meta span { display: inline-flex; align-items: center; gap: 5px; }
.boss__meta .ic { width: 14px; height: 14px; }
.boss__next { text-align: right; flex: none; }
.boss__next small { display: block; font-size: 12px; color: var(--muted); }
.boss__next b { font: 700 22px/1.2 var(--serif); color: var(--red); font-variant-numeric: tabular-nums; }
.boss__drop { font-size: 14px; color: var(--ink-2); padding: 10px 12px; background: var(--paper); border-radius: 10px; border: 1px dashed var(--line-2); }
.boss__drop b { color: var(--gold); font-weight: 600; }
.boss__times { display: flex; flex-wrap: wrap; gap: 6px; }
.boss__times span { font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--paper-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.boss__times span.is-next { background: var(--red); color: #fff; font-weight: 600; }
.boss__times span.is-past { opacity: .55; }

/* ---------- Thư viện ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; grid-auto-flow: dense; gap: 14px; }
.g { position: relative; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: var(--paper-3); }
.g img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, filter .3s; }
.g:hover img { transform: scale(1.05); }
.g .ic {
  position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; padding: 9px; border-radius: 50%;
  background: rgba(255, 253, 249, .92); color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
}
.g:hover .ic, .g:focus-visible .ic { opacity: 1; transform: none; }
.g--wide { grid-column: span 2; }
.g--tall { grid-row: span 2; }

/* ---------- Bắt đầu ---------- */
.start { position: relative; padding: 96px 0; overflow: hidden; isolation: isolate; }
.start__bg { position: absolute; inset: 0; z-index: -1; background: url(../img/cta-bg.webp) center 30% / cover no-repeat; }
.start__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(251, 248, 241, .55), rgba(251, 248, 241, .93) 45%, var(--paper) 100%); }
.start__in { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 64px; align-items: center; }
.start__poster { margin: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); border: 6px solid var(--card); transform: rotate(-2deg); }
.start__poster img { width: 100%; }
.start__content h2 { font-size: clamp(30px, 4vw, 44px); }
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { position: relative; padding-left: 58px; counter-increment: s; min-height: 42px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font: 700 18px var(--serif); color: var(--red);
  background: var(--card); border: 1px solid var(--line-2);
}
.steps b { display: block; font-size: 17px; }
.steps span { color: var(--muted); font-size: 15px; }
.start__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 28px; }
.spec { width: 100%; max-width: 520px; border-collapse: collapse; font-size: 14px; background: rgba(255, 253, 249, .85); border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.spec caption { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding-bottom: 8px; letter-spacing: .04em; text-transform: uppercase; }
.spec th, .spec td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.spec thead th { font-weight: 600; color: var(--gold); background: var(--gold-soft); }
.spec tbody th { font-weight: 500; color: var(--muted); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }

/* ---------- Cộng đồng ---------- */
.community { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ccard {
  display: flex; align-items: center; gap: 14px; padding: 20px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .2s, transform .2s;
}
.ccard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ccard b { display: block; }
.ccard small { color: var(--muted); font-size: 13px; }
.ccard__ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; flex: none; background: #e3efff; color: #1d64d8; }
.ccard__ic--gold { background: var(--gold-soft); color: var(--gold); }
.ccard__ic--sky { background: var(--sky-soft); color: var(--sky); }
.ccard__go { margin-left: auto; color: var(--muted); transition: transform .2s, color .2s; }
.ccard:hover .ccard__go { transform: translateX(3px); color: var(--red); }

/* ---------- Footer ---------- */
.footer { background: var(--paper-3) url(../img/paper.webp) center / 1200px repeat; background-blend-mode: multiply; border-top: 1px solid var(--line-2); margin-top: 24px; }
.footer__in { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.footer__brand img { height: 84px; width: auto; margin-bottom: 14px; }
.footer__brand p { color: var(--ink-2); font-size: 14px; max-width: 320px; }
.footer__col { display: flex; flex-direction: column; gap: 9px; }
.footer__col h4 { font-size: 16px; margin-bottom: 4px; }
.footer__col a { font-size: 14px; color: var(--ink-2); }
.footer__col a:hover { color: var(--red); }
.footer__bottom { border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.footer__bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 16px; padding-bottom: 18px; }

/* ---------- Thanh nút điện thoại / lên đầu ---------- */
.mbar { display: none; }
.totop {
  position: fixed; right: 20px; bottom: 24px; z-index: 30; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .25s, visibility .25s;
}
.totop.is-on { opacity: 1; visibility: visible; transform: none; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 56px 72px; background: rgba(251, 248, 241, .96); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.lightbox__close { position: absolute; top: 16px; right: 16px; }
.lightbox__nav { position: absolute; top: 50%; margin-top: -20px; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

/* ---------- Hiện dần khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* =========================== Responsive =========================== */
@media (max-width: 1240px) {
  .header__in { gap: 16px; }
  .nav { gap: 0; }
  .nav > a, .dd__btn { padding: 8px 10px; font-size: 14px; }
}

@media (max-width: 1100px) {
  .fpick { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .feat { aspect-ratio: 4 / 3.6; }
}

@media (max-width: 1080px) {
  .nav, .header__cta .btn--ghost { display: none; }
  .burger { display: inline-grid; }
  .header__cta { margin-left: auto; }
}

@media (max-width: 960px) {
  .news, .faction { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .start__in { grid-template-columns: 1fr; gap: 40px; }
  .start__poster { max-width: 300px; margin: 0 auto; }
  .start__bg::after { background: linear-gradient(180deg, rgba(251, 248, 241, .7), rgba(251, 248, 241, .95) 40%, var(--paper)); }
  .community { grid-template-columns: 1fr; }
  .footer__in { grid-template-columns: repeat(4, 1fr); }
  .footer__brand { grid-column: 1 / -1; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  :root { --header-h: 62px; }
  .wrap { padding: 0 16px; }
  .section { padding: 64px 0; }
  .topbar .status, .topbar__right a { display: none; }
  .topbar__in { justify-content: center; }
  .brand img { height: 48px; }
  .header__cta .btn--red { display: none; }

  .hero__bg { background-position: 78% top; background-size: auto 380px; background-color: var(--paper); }
  .hero__bg::after { background: linear-gradient(180deg, rgba(251, 248, 241, 0) 0, rgba(251, 248, 241, .35) 200px, var(--paper) 370px); }
  .hero__in { min-height: 0; padding-top: 210px; padding-bottom: 96px; }
  .hero__logo img { width: min(300px, 82%); }
  .hero__lead { font-size: 16px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .rates { grid-template-columns: repeat(6, 1fr); margin-top: 28px; }
  .rates li { grid-column: span 2; padding: 12px 6px; }
  .rates li:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--line); }
  .rates li:nth-child(4) { border-left: 0; }
  .rates b { font-size: 22px; }

  .quick { gap: 10px; margin-top: -56px; }
  .qcard { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .qcard__ic { width: 42px; height: 42px; }

  .sec-head--row { flex-direction: column; align-items: flex-start; }
  .sec-head__note { text-align: left; }
  .slide__body { padding: 16px 18px 4px; }
  .slide__body h3 { font-size: 19px; }
  .slider__ctrl { padding: 10px 18px 16px; }
  .newslist__items li { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .newslist__items .chip { grid-column: 1 / -1; justify-self: start; min-width: 0; }
  .newslist__items a { white-space: normal; }

  .faction__info { padding: 24px 20px; }
  .faction__info h3 { font-size: 32px; }
  .faction__cn { font-size: 96px; }
  .stats div { grid-template-columns: 80px 1fr 30px; }
  .fpick { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 28px -16px 0; padding: 4px 16px 8px; scrollbar-width: none; }
  .fpick::-webkit-scrollbar { display: none; }
  .fpick button { flex: 0 0 76px; scroll-snap-align: start; }

  .features { grid-template-columns: 1fr 1fr; gap: 12px; }
  .feat { aspect-ratio: auto; display: flex; flex-direction: column; background: var(--card); }
  .feat img { position: static; height: 190px; }
  .feat::after { display: none; }
  .feat__body { position: static; padding: 12px 14px 16px; }
  .feat h3 { font-size: 17px; }
  .feat p { font-size: 13px; }

  .bosses { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; gap: 10px; }
  .g .ic { opacity: 1; transform: none; width: 32px; height: 32px; padding: 7px; }

  .start { padding: 64px 0; }
  .start__actions .btn { flex: 1 1 100%; }
  .spec th, .spec td { padding: 9px 10px; }

  .footer__in { grid-template-columns: 1fr 1fr; padding-top: 40px; }
  .footer { padding-bottom: 72px; }

  .mbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 12px; font-weight: 600; color: var(--ink-2); border-radius: 10px; }
  .mbar__main { color: #fff !important; background: var(--red); }
  .totop { bottom: 84px; right: 14px; }
  .lightbox { padding: 56px 12px; }
  .lightbox__nav { top: auto; bottom: 16px; margin: 0; }
  .lightbox__nav--prev { left: calc(50% - 52px); }
  .lightbox__nav--next { right: calc(50% - 52px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
