/* Tu Tiên Vấn Đạo — trang chủ. Màu lấy từ tranh nền huyết nguyệt của game. */
@font-face { font-family: "Lora"; src: url("/home/lora.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/home/lora-italic.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --nen: #2a1418;        /* đá đêm huyết nguyệt */
  --nen-2: #341a1f;      /* vách núi */
  --mat: #45232a;        /* mặt đá được trăng chiếu */
  --vien: #5e3239;
  --trang: #f4e7cf;      /* ánh trăng */
  --suong: #cdb6a0;      /* sương núi */
  --mo: #a08877;
  --hoa: #f2a03d;        /* dung nham */
  --hoa-dam: #d9822b;
  --linh: #c4adff;       /* hoa linh thảo tím */
  --an: #c8372d;         /* dấu ấn son */
  --ok: #8fd6a8;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--trang); font: 17px/1.65 var(--serif); }
img { max-width: 100%; height: auto; }
a { color: var(--linh); text-underline-offset: 3px; }
a:hover { color: var(--trang); }
:focus-visible { outline: 2px solid var(--hoa); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.wrap-narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--trang); color: var(--nen); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---- nút ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: 999px;
  background: var(--hoa); color: #2a1206; font: 600 17px/1 var(--sans); text-decoration: none; border: 2px solid var(--hoa);
  box-shadow: 0 0 0 0 rgba(242, 160, 61, .0); transition: background .15s, box-shadow .2s, color .15s; }
.btn:hover { background: #ffb85a; color: #2a1206; box-shadow: 0 0 28px rgba(242, 160, 61, .45); }
.btn-ghost { background: rgba(42, 20, 24, .55); color: var(--trang); border-color: rgba(244, 231, 207, .55); }
.btn-ghost:hover { background: rgba(244, 231, 207, .12); color: var(--trang); box-shadow: none; border-color: var(--trang); }
.btn-sm { min-height: 38px; padding: 0 18px; font-size: 15px; }

/* ---- thanh trên ---- */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px var(--pad);
  background: rgba(42, 20, 24, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(94, 50, 57, .6); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--trang); text-decoration: none; font-weight: 700; font-size: 19px; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--suong); text-decoration: none; font: 500 15px/1 var(--sans); padding: 10px 12px; border-radius: 8px; }
.nav a:hover { color: var(--trang); background: rgba(244, 231, 207, .07); }
@media (max-width: 900px) { .nav { display: none; } .bar .btn-sm { margin-left: auto; } }

/* ---- đầu trang: tranh nền của game, tên game như khắc lên vách đá ---- */
.hero { position: relative; min-height: min(92vh, 860px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  gap: 24px; padding: 120px var(--pad) 56px; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -1; background: url("/assets/background/main_background.webp") center 30% / cover no-repeat; image-rendering: pixelated; }
.hero-art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(42, 20, 24, .92) 0%, rgba(42, 20, 24, .65) 38%, rgba(42, 20, 24, .1) 70%),
              linear-gradient(0deg, var(--nen) 0%, rgba(42, 20, 24, 0) 34%); }
.hero-walker { position: absolute; left: 47%; bottom: 17%; z-index: 1; }
.hero-in { max-width: 820px; position: relative; }
.hero-seal { display: block; width: 72px; height: 72px; margin-bottom: 18px; transform: rotate(-4deg); filter: drop-shadow(0 4px 14px rgba(200, 55, 45, .5)); }
.hero-title { font-size: clamp(54px, 10.5vw, 138px); line-height: .9; letter-spacing: -.035em; font-weight: 700; color: var(--trang);
  text-shadow: 0 2px 0 #1a0b0e, 0 10px 40px rgba(0, 0, 0, .55); margin-bottom: 26px; }
.hero-title span { display: block; }
.hero-title span + span { padding-left: .5em; white-space: nowrap; font-style: italic; font-weight: 600; color: #ffd9a6; }
.hero-lede { font-size: clamp(17px, 2vw, 20px); max-width: 32em; color: #ead8bf; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.live { width: 330px; background: rgba(42, 20, 24, .82); border: 1px solid var(--vien); border-radius: 14px; padding: 16px 18px; font-family: var(--sans);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.live-srv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; font-size: 15px; }
.live-on { color: var(--suong); font-size: 14px; }
.live-on.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 7px; box-shadow: 0 0 8px var(--ok); }
.live-boss { display: grid; grid-template-columns: 64px 1fr; gap: 4px 14px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--vien); }
.live-boss img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; grid-row: span 2; }
.live-boss p { margin: 0; }
.live-k { font-size: 13px; color: var(--suong); }
.live-name { font: 700 18px/1.2 var(--serif); }
.live-where { font-size: 13px; color: var(--mo); }
.live-time { grid-column: 2; font: 700 28px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--hoa); }
.live-time.now { color: #ff7a6b; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 72px; min-height: 0; }
  .hero-walker { left: auto; right: 4%; bottom: auto; top: 90px; }
  .live { width: 100%; }
}

/* ---- sprite pixel: khung 96×96, 8 cột ---- */
.sprite { --s: 2; --row: 0; display: block; width: calc(96px * var(--s)); height: calc(96px * var(--s));
  background-repeat: no-repeat; background-size: calc(768px * var(--s)) calc(864px * var(--s));
  background-position: 0 calc(-96px * var(--s) * var(--row)); image-rendering: pixelated; }
.sprite.run { animation: sprite-run .8s steps(8) infinite; }
@keyframes sprite-run { to { background-position: calc(-768px * var(--s)) calc(-96px * var(--s) * var(--row)); } }
.hero-walker .sprite { --s: 2; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5)); }
.sprite-sm { --s: .75; }
.sprite-lg { --s: 3.4; }
@media (max-width: 560px) { .sprite-lg { --s: 2.4; } .hero-walker .sprite { --s: 1.3; } }

/* ---- các phần ---- */
.sec { padding: clamp(64px, 9vw, 112px) 0; }
.sec-alt { background: var(--nen-2); }
.sec h2 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.02em; margin-bottom: 14px; }
.sec-lede { color: var(--suong); max-width: 40em; margin-bottom: 36px; }

/* nhân vật */
.cls { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.cls-tabs { display: flex; flex-direction: column; gap: 6px; }
.cls-tabs button { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; background: transparent; color: var(--suong);
  border: 1px solid transparent; border-radius: 12px; font: 600 16px/1.2 var(--sans); cursor: pointer; text-align: left; }
.cls-tabs button:hover { color: var(--trang); background: rgba(244, 231, 207, .05); }
.cls-tabs button[aria-selected="true"] { color: var(--trang); background: var(--mat); border-color: var(--vien); }
.cls-tabs button[aria-selected="true"] .sprite { filter: drop-shadow(0 0 6px var(--c, var(--linh))); }
.cls-body { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; background: var(--nen-2); border: 1px solid var(--vien);
  border-radius: 20px; padding: 28px 32px; min-height: 380px; }
.cls-stage { display: grid; place-items: center; width: calc(96px * 3.4); height: calc(96px * 3.4); border-radius: 50%;
  background: radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--c, #a78bfa) 34%, transparent) 0%, transparent 66%); }
.cls-info h3 { font-size: clamp(30px, 4vw, 42px); }
.cls-title { font-style: italic; color: var(--c, var(--linh)); margin: 4px 0 16px; filter: brightness(1.25); }
.stats { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; margin: 20px 0; font: 14px/1.2 var(--sans); max-width: 420px; }
.stats dt { color: var(--suong); }
.stats dd { margin: 0; height: 8px; background: rgba(0, 0, 0, .3); border-radius: 4px; overflow: hidden; }
.stats dd i { display: block; height: 100%; background: var(--c, var(--linh)); border-radius: 4px; transition: width .35s; filter: brightness(1.15); }
.stats .v { color: var(--trang); font-variant-numeric: tabular-nums; text-align: right; min-width: 3ch; background: none; height: auto; }
.cls-passive { color: var(--suong); font-size: 16px; }
.cls-passive b { color: var(--trang); margin-right: 6px; }
@media (max-width: 860px) {
  .cls { grid-template-columns: 1fr; }
  .cls-tabs { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .cls-tabs button { flex: 0 0 auto; flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 13px; }
  .cls-body { grid-template-columns: 1fr; padding: 20px; justify-items: center; }
  .cls-stage { width: calc(96px * 2.4); height: calc(96px * 2.4); }
  .cls-info { width: 100%; }
}

/* thế giới */
.feat { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.feat-r figure { order: 2; }
.feat figure { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--vien); background: var(--nen); box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
.feat figure img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feat h3 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 14px; }
.feat p { color: #e4d2bb; max-width: 30em; }
@media (max-width: 760px) { .feat { grid-template-columns: 1fr; } .feat-r figure { order: 0; } }

.path h3 { font-size: 26px; margin-bottom: 18px; }
.realms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; row-gap: 22px; }
.realms li { flex: 0 0 auto; position: relative; padding: 26px 22px 0 0; font: 600 15px/1.25 var(--serif); color: var(--suong); white-space: nowrap; }
.realms li::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 2px; background: var(--vien); }
.realms li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--nen-2); border: 2px solid var(--mo); }
.realms li.tier { color: var(--trang); }
.realms li.tier::after { background: var(--hoa); border-color: var(--hoa); }
.realms li:last-child { color: #ffd9a6; padding-right: 0; }
.realms li:last-child::after { background: var(--an); border-color: #ffd9a6; width: 14px; height: 14px; top: 3px; }

/* boss */
.boss-filter { display: flex; gap: 8px; margin-bottom: 18px; }
.chip { background: transparent; color: var(--suong); border: 1px solid var(--vien); border-radius: 999px; padding: 8px 16px; font: 500 14px/1 var(--sans); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--trang); color: var(--nen); border-color: var(--trang); }
.bosses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 0 40px; }
.bosses li { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--vien); }
.bosses li.empty { display: block; color: var(--suong); border: 0; }
.bosses img { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.bosses .n { font-weight: 700; line-height: 1.25; }
.bosses .w { display: block; font: 13px/1.35 var(--sans); color: var(--mo); }
.bosses .t { font: 600 15px/1.2 var(--sans); font-variant-numeric: tabular-nums; text-align: right; color: var(--suong); }
.bosses .t.alive { color: #ff8b7d; }
.bosses .t small { display: block; font-weight: 400; font-size: 12px; color: var(--mo); }

/* tin tức */
.news article { padding: 22px 0; border-bottom: 1px solid var(--vien); }
.news article:first-child { padding-top: 0; }
.news .meta { font: 13px/1 var(--sans); color: var(--mo); margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.news .tag { color: var(--nen); background: var(--suong); padding: 4px 8px; border-radius: 4px; font-weight: 600; }
.news .tag.su-kien { background: var(--hoa); }
.news .tag.bao-tri { background: #ff8b7d; }
.news .tag.cap-nhat { background: var(--linh); }
.news .pin { color: var(--hoa); }
.news h3 { font-size: 22px; margin-bottom: 8px; }
.news .body p { color: #e4d2bb; margin-bottom: .6em; }
.news .more { background: none; border: 0; color: var(--linh); font: 500 14px var(--sans); padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.empty { color: var(--suong); }

/* nạp */
.money { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--vien); border-radius: 18px; overflow: hidden; margin-bottom: 40px; }
.money-col { padding: 28px 32px; }
.money-col + .money-col { border-left: 1px solid var(--vien); background: var(--nen-2); }
.money h3 { display: flex; align-items: center; gap: 12px; font-size: 26px; margin-bottom: 12px; }
.money h3 img { image-rendering: pixelated; }
.money p { color: #e4d2bb; }
.rate { font: 600 15px/1 var(--sans); color: var(--hoa) !important; margin: 0; }
@media (max-width: 700px) { .money { grid-template-columns: 1fr; } .money-col + .money-col { border-left: 0; border-top: 1px solid var(--vien); } .money-col { padding: 22px; } }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.steps li { counter-increment: s; color: var(--suong); font-size: 16px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--hoa);
  color: var(--hoa); font: 700 16px/1 var(--sans); margin-bottom: 12px; }
.steps b { display: block; color: var(--trang); font-size: 18px; margin-bottom: 4px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; gap: 20px; } }

/* cộng đồng (nhóm Zalo) */
.comm { background: linear-gradient(180deg, var(--nen) 0%, #2f171c 100%); }
.comm-in { display: grid; grid-template-columns: 1fr auto; gap: clamp(28px, 6vw, 72px); align-items: center; }
.comm-text .sec-lede { margin-bottom: 26px; }
.comm-hint { color: var(--mo); font: 14px/1.5 var(--sans); margin-top: 16px; max-width: 34em; }
.comm-qr { margin: 0; background: #fff; border-radius: 18px; padding: 16px 16px 10px; text-align: center; box-shadow: 0 24px 50px rgba(0, 0, 0, .35); transform: rotate(1.5deg); }
.comm-qr img { display: block; width: 240px; height: 240px; object-fit: contain; }
.comm-qr figcaption { color: #3a2328; font: 600 14px/1 var(--sans); margin-top: 8px; }
@media (max-width: 700px) { .comm-in { grid-template-columns: 1fr; } .comm-qr { justify-self: center; transform: none; } .comm-qr img { width: 200px; height: 200px; } }

/* hỏi đáp */
details { border-bottom: 1px solid var(--vien); }
summary { cursor: pointer; padding: 18px 36px 18px 0; font-weight: 600; font-size: 19px; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 26px/1 var(--sans); color: var(--hoa); }
details[open] summary::after { content: "−"; }
details p { color: #e4d2bb; padding-bottom: 8px; }

/* cuối trang */
.last { padding: 88px 0; text-align: center; background: radial-gradient(ellipse at 50% 100%, rgba(242, 160, 61, .16), transparent 60%); }
.last img { display: block; margin: 0 auto 18px; transform: rotate(-4deg); }
.last p { font-size: clamp(24px, 3.4vw, 34px); font-style: italic; margin-bottom: 26px; }
.foot { border-top: 1px solid var(--vien); padding: 28px 0 40px; font: 14px/1.6 var(--sans); color: var(--mo); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; }
.foot p { margin: 0; }
.foot p:first-child { font: 700 16px var(--serif); color: var(--suong); }
.foot a { color: var(--suong); margin-right: 18px; }
.foot-note { margin-left: auto !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sprite.run { animation: none; }
  .btn, .stats dd i { transition: none; }
}

/* Tông Môn Chiến */
.lm .lm-ic { width: 56px; height: 56px; background: center / 34px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 64'%3E%3Cpath d='M20 2 38 28 30 62H10L2 28Z' fill='%2338bdf8' stroke='%230c4a6e' stroke-width='3'/%3E%3Cpath d='M17 12 26 28 19 52' fill='none' stroke='%23e0f2fe' stroke-width='3'/%3E%3C/svg%3E"); }
.bosses .t.held { color: var(--hoa); }
.lm-note { margin: 18px 0 0; max-width: 62ch; color: var(--mo); font-size: 15px; }
