/* =====================================================================
   Trang chủ Tiên Ma Lộ — bản C "Thiên Kiếm Giáng Thế" (mockup s23, session 14): đêm sâu · lục ngọc + vàng kim (Tiên) đối huyết đỏ (Ma) · ánh sáng mạnh.
   index.html + scene/home.js (đăng nhập /api/auth/*, lời mời, Open Beta) · home_fx.js (hiệu ứng) · home_hero.js (cảnh PixiJS) · ob.css (khối đếm ngược dùng chung).
   Asset: b_px/home/c_*.webp ← scripts/home_assets.py c ← raw/home/c_*.png (Codex, đề raw/home/promptC_*.md).
   Hộp đăng nhập: PC = hộp nổi #login · màn chạm hẹp (cùng điều kiện INLINE trong home.js) = hiện luôn trong đầu trang (NM4).
   ===================================================================== */
:root {
  --night: #04060a; --night-2: #0a0f17; --night-3: #121a26;
  --jade: #47e0b0; --jade-l: #a6ffe2; --gold: #f1c86a; --gold-l: #fff1c4; --blood: #ff3b3b; --blood-l: #ff9a8a; --rift: #b58cff;
  --text: #ece6da; --muted: #a59d8c; --off: #7d725f;
  --gold-1: #6f5322; --gold-2: #b08a3c; --gold-3: #e3c46e; --gold-4: #fff0c4;   /* ob.css (khối đếm ngược + quà) dùng chung tên với play.html */
  --ink-4: #1d2b2a; --ok: #8fdc6a; --bad: #ff7a6a; --line: rgba(241, 200, 106, .26);
  --f-title: 'LXGW WenKai TC', 'Noto Serif', Georgia, serif;
  --f-ui: 'Be Vietnam Pro', system-ui, 'Segoe UI', sans-serif;
  --f-num: 'Chonburi', var(--f-title);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
a[data-wiki]:not(.on) { display: none !important; }          /* link Cẩm Nang: home.js thêm .on khi /wiki/<lang>/ có thật */
[tabindex="-1"]:focus { outline: none; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--night); color: var(--text); font: 400 16px/1.6 var(--f-ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.intro_on { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip_link { position: absolute; left: 12px; top: -60px; z-index: 120; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; background: var(--gold); color: var(--night); border-radius: 4px; font-weight: 700; text-decoration: none; }
.skip_link:focus { top: 12px; }
.link { padding: 0; background: none; border: 0; color: var(--jade-l); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--gold-l); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---------- nút: ngọc phát sáng + vệt quét ánh kim khi rê ---------- */
.glow_btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 34px; overflow: hidden; isolation: isolate;
  border: 1px solid rgba(241, 200, 106, .85); border-radius: 4px; cursor: pointer; text-decoration: none; white-space: nowrap; color: #f6fffb; font: 700 20px/1 var(--f-title); letter-spacing: .06em;
  background: linear-gradient(180deg, #2fb88a, #157a5a 55%, #0b4a37); text-shadow: 0 1px 0 #000;
  box-shadow: 0 0 0 4px rgba(71, 224, 176, .12), 0 0 28px rgba(71, 224, 176, .45), inset 0 1px 0 rgba(255, 255, 255, .35); transition: box-shadow .2s, transform .15s; }
.glow_btn::before { content: ""; position: absolute; inset: -2px; z-index: -1; translate: -120% 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 241, 196, .55) 50%, transparent 70%); transition: translate .6s; }
.glow_btn:hover:not(:disabled) { box-shadow: 0 0 0 5px rgba(71, 224, 176, .2), 0 0 46px rgba(71, 224, 176, .7), inset 0 1px 0 rgba(255, 255, 255, .4); transform: translateY(-1px); }
.glow_btn:hover:not(:disabled)::before { translate: 120% 0; }
.glow_btn.sm { min-height: 42px; padding: 0 20px; font-size: 16px; gap: 8px; }
.glow_btn.lg { min-height: 66px; padding: 0 48px; font-size: 24px; animation: pulse 2.4s ease-in-out infinite; }
.glow_btn.block { display: flex; width: 100%; }
.glow_btn:disabled { opacity: .6; cursor: not-allowed; }
.glow_btn[aria-busy] { cursor: progress; }
.glow_btn.alt { background: rgba(4, 10, 9, .6); box-shadow: none; border-color: rgba(241, 200, 106, .5); color: var(--gold-l); }   /* có Google: gửi mã thành nút phụ — 1 nút nổi bật mỗi hộp */
.glow_btn.glow { animation: pulse 1.6s ease-in-out infinite; }                                              /* Open Beta vừa mở: Vào game sáng */
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(71, 224, 176, .06), 0 0 60px rgba(71, 224, 176, .75), inset 0 1px 0 rgba(255, 255, 255, .35); } }
@keyframes spin { to { rotate: 360deg; } }
.ghost_btn { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 26px; border: 1px solid rgba(236, 230, 218, .35); border-radius: 4px;
  color: var(--text); text-decoration: none; font-weight: 600; backdrop-filter: blur(6px); background: rgba(4, 6, 10, .35); transition: border-color .2s, background-color .2s; }
.ghost_btn:hover { border-color: var(--gold); background: rgba(241, 200, 106, .1); }

/* ---------- mở màn ---------- */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; pointer-events: auto; }
.intro { --cut: -19deg; }   /* góc nhát kiếm: vệt sáng + đường tách màn cùng 1 góc (chéo lên phải như kiếm quang đầu trang) */
/* 2 mảnh màn đen = 2 nửa của 1 khối vuông lớn xoay theo góc chém → mép tách trùng vệt kiếm; mở = trượt ra 2 phía vuông góc vết chém, lệch nhẹ dọc vết chém */
.intro .cut { position: absolute; left: 50%; top: 50%; width: hypot(100vw, 100vh); height: hypot(100vw, 100vh); translate: -50% -50%; rotate: var(--cut); pointer-events: none; }   /* cạnh = đường chéo màn hình: vừa phủ kín mọi góc xoay (trước 300vmax ≈ 4300 px → khung ~70/100 fps khi tách) */
.intro .half { position: absolute; left: 0; right: 0; height: 50.4%; background: #000; will-change: transform; transition: translate 1.25s cubic-bezier(.3, .05, .12, 1); }   /* khởi động mềm, không khoảng đứng im · will-change: đẩy sẵn lên GPU trước khi trượt */
.intro .up { top: 0; box-shadow: 0 2px 0 rgba(166, 255, 226, .9), 0 6px 26px rgba(166, 255, 226, .55); }
.intro .down { bottom: 0; box-shadow: 0 -2px 0 rgba(166, 255, 226, .9), 0 -6px 26px rgba(166, 255, 226, .55); }
.intro:not(.cut_on) .half { box-shadow: none; }
.intro .core { position: relative; z-index: 2; display: grid; justify-items: center; gap: 10px; will-change: transform, opacity; transition: opacity .4s, scale .7s cubic-bezier(.2, .8, .2, 1); }
.intro .core > img { width: 120px; opacity: 0; scale: .6; filter: drop-shadow(0 0 30px rgba(241, 200, 106, .7)); animation: emb .9s .1s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.intro .logo { width: min(720px, 86vw); opacity: 0; filter: blur(14px); scale: 1.12; animation: logo_in .9s .5s cubic-bezier(.2, .8, .2, 1) forwards; }
.intro .glint b { animation: glint 5s 1.35s cubic-bezier(.4, 0, .2, 1) forwards; }   /* quét 1 lượt khi chữ vừa rõ, trước nhát chém — cùng nhịp vệt tiêu đề (quét 1,1 s, xong 2,45 s) */
.intro .tag { margin: 0; font: 600 18px var(--f-title); letter-spacing: .6em; padding-left: .6em; color: var(--jade-l); opacity: 0; animation: fade .8s 1.4s forwards; text-align: center; }
.intro .slash { position: absolute; left: 0; width: 100%; will-change: transform, opacity; top: 50%; height: 4px; margin-top: -2px; opacity: 0; scale: 0 1; transform-origin: left;   /* trong .cut → cùng góc + đúng mép tách */
  background: linear-gradient(90deg, transparent, var(--jade-l) 20%, #fff 50%, var(--jade-l) 80%, transparent); box-shadow: 0 0 22px 6px rgba(166, 255, 226, .8); }
.intro.cut_on .slash { animation: slash .3s cubic-bezier(.3, 0, .1, 1) forwards; }
.intro.cut_on .core { opacity: 0; scale: 1.15; }
.intro.open .up { translate: -5% -104%; } .intro.open .down { translate: 5% 104%; }   /* mỗi nửa cao đúng nửa đường chéo → 104 % là khuất hẳn kể cả vệt sáng mép */
.intro.open .slash { animation: slash_out .55s ease-out forwards; }
.intro.open { pointer-events: none; }
.intro.gone { display: none; }
.intro .skip { position: absolute; right: 28px; bottom: 26px; z-index: 4; min-height: 40px; padding: 8px 16px; border: 1px solid rgba(236, 230, 218, .3); border-radius: 999px; background: transparent; cursor: pointer; color: var(--muted); font-size: 14px; }
.intro .skip:hover { color: var(--text); border-color: var(--text); }
@keyframes emb { to { opacity: 1; scale: 1; } }
@keyframes fade { to { opacity: 1; } }
@keyframes slash { 0% { opacity: 1; scale: 0 1; } 100% { opacity: 1; scale: 1 1; } }
@keyframes slash_out { 0% { opacity: 1; scale: 1 1; } 30% { opacity: 1; scale: 1 2.6; } 100% { opacity: 0; scale: 1 4; } }

/* vệt linh khí theo chuột */
.trail { position: fixed; inset: 0; z-index: 90; pointer-events: none; mix-blend-mode: screen; }

/* ---------- thanh trên ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 50; height: 70px; background: linear-gradient(180deg, rgba(4, 6, 10, .78), rgba(4, 6, 10, 0)); display: flex; align-items: center; gap: 28px;
  padding: 0 clamp(20px, 4vw, 64px); transition: background-color .3s, border-color .3s; border-bottom: 1px solid transparent; }
.top.solid { background: rgba(4, 6, 10, .78); backdrop-filter: blur(10px); border-color: rgba(241, 200, 106, .2); }
.mark { display: flex; align-items: center; gap: 10px; flex: none; color: var(--gold-l); text-decoration: none; font: 700 24px/1 var(--f-title); white-space: nowrap; }
.mark img { width: 40px; filter: drop-shadow(0 0 10px rgba(241, 200, 106, .5)); }
.top .links { display: flex; gap: 4px; margin-right: auto; }
.top .links a { padding: 8px 12px; color: #d8d0c0; text-shadow: 0 1px 6px #000; text-decoration: none; white-space: nowrap; transition: color .2s, text-shadow .2s; }
.top .links a:hover { color: var(--jade-l); text-shadow: 0 0 12px rgba(71, 224, 176, .8); }
.top .end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top .lang { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 6px 0 12px; border: 1px solid rgba(236, 230, 218, .3); border-radius: 4px;
  color: var(--gold-l); background: rgba(4, 6, 10, .45); cursor: pointer; }   /* đổi ngôn ngữ (game-design §Đa ngôn ngữ) — hiện cả điện thoại */
.top .lang:hover { border-color: var(--gold); }
.top .lang:focus-within { outline: 2px solid var(--jade); outline-offset: 2px; }
.top .lang select { min-height: 38px; padding: 0 4px; border: 0; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; outline: none; }
.top .lang option { color: #06100d; }
.top .cd_chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(241, 200, 106, .5); border-radius: 4px; background: rgba(4, 6, 10, .55);
  color: var(--gold-l); font-weight: 600; font-variant-numeric: tabular-nums; }
.top .cd_chip i { color: var(--gold); }
.top .go { display: none; }                                         /* "Chơi ngay": chỉ màn chạm (NM4) */
.top .me { width: 42px; height: 42px; display: grid; place-items: center; flex: none; padding: 0; border: 2px solid var(--gold); border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #2fb88a, #0b3a2c 75%); font: 700 18px/1 var(--f-title); color: var(--gold-l); }
.top .me:hover { box-shadow: 0 0 18px rgba(71, 224, 176, .6); }
.top .menu { display: none; width: 44px; height: 44px; flex: none; border: 1px solid rgba(236, 230, 218, .3); border-radius: 4px; background: rgba(4, 6, 10, .45); color: var(--gold-l); cursor: pointer; }
.top .sheet { display: none; }

/* ---------- đầu trang ---------- */
.hero { position: relative; height: 100svh; min-height: 720px; overflow: hidden; }
.stage { position: absolute; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .fallback { display: none; position: absolute; }
.nogl .stage .fallback.sky { display: block; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nogl .stage .fallback.hero_img { display: block; left: 62%; bottom: 0; height: 84%; max-width: none; translate: -50% 0; }
.flash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 78% 30%, rgba(255, 210, 200, .9), rgba(255, 60, 60, .35) 40%, transparent 70%); opacity: 0; mix-blend-mode: screen; }
.flash.on { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: .9; } 15% { opacity: .2; } 25% { opacity: .7; } 100% { opacity: 0; } }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 6, 10, .9) 0%, rgba(4, 6, 10, .62) 30%, rgba(4, 6, 10, .15) 48%, transparent 56%), linear-gradient(180deg, transparent 60%, var(--night) 100%); }
.hero_in { display: contents; }
.hero_txt, .invite { position: absolute; z-index: 2; left: clamp(28px, 6vw, 110px); top: 50%; translate: 0 -46%; }
.hero_txt { max-width: 680px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; border: 1px solid rgba(71, 224, 176, .45); border-radius: 999px; color: var(--jade-l); font-size: 13.5px;
  background: rgba(4, 6, 10, .5); backdrop-filter: blur(6px); }
.kicker.ob { text-transform: uppercase; letter-spacing: .04em; }
/* logo chữ (ảnh Codex b_px/home/c_title.webp — chỉ chữ "Tiên Ma Lộ", chung mọi ngôn ngữ) + vệt sáng quét: mặt nạ = chính ảnh logo → sáng chỉ trên nét chữ;
   mặt nạ tĩnh, chỉ dải sáng con trượt (translate) → không vẽ lại ảnh mỗi khung */
.logo { position: relative; display: block; }
.logo img { display: block; width: 100%; height: auto; }
.logo .glint { position: absolute; inset: 0; overflow: hidden; pointer-events: none; will-change: transform;
  -webkit-mask: url(../b_px/home/c_title.webp?v=61867e7b) 0 0 / 100% 100% no-repeat; mask: url(../b_px/home/c_title.webp?v=61867e7b) 0 0 / 100% 100% no-repeat; }
.logo .glint b { position: absolute; top: -10%; bottom: -10%; left: 0; width: 34%; translate: -110% 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 246, 214, .8) 50%, transparent 80%); }
h1.logo { margin: 10px 0 0 -10px; width: clamp(400px, 40vw, 620px); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .7)); }   /* lề trái âm: bù vùng trong suốt mép ảnh, nét chữ thẳng mép kicker */
h1.logo .glint b { animation: glint 5s 3.4s cubic-bezier(.4, 0, .2, 1) infinite; }      /* lượt đầu sau mở màn (2,6 s) */
@keyframes glint { 0% { translate: -110% 0; } 22%, 100% { translate: 300% 0; } }
@keyframes logo_in { to { opacity: 1; filter: blur(0); scale: 1; } }
.hero_txt .sub { margin: 14px 0 0; font: 700 clamp(22px, 2vw, 30px)/1.3 var(--f-title); color: var(--text); text-shadow: 0 2px 12px #000; }
.acts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 34px; }
.stats { display: flex; gap: 34px; margin: 44px 0 0; padding: 0; list-style: none; }
.stats li { display: grid; }
.stats b { font: 400 40px/1 var(--f-num); color: var(--gold-l); text-shadow: 0 0 18px rgba(241, 200, 106, .55); }
.stats span { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.scroll_cue { position: absolute; z-index: 2; left: 50%; bottom: 28px; translate: -50% 0; width: 28px; height: 46px; border: 2px solid rgba(236, 230, 218, .5); border-radius: 14px; }
.scroll_cue i { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; translate: -50% 0; border-radius: 2px; background: var(--jade-l); animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; top: 8px; } 30% { opacity: 1; } 100% { opacity: 0; top: 26px; } }
/* Open Beta (session 177): khối đếm .cd ở ob.css — ở đây chỉ câu + dải chip của đầu trang */
.hero_txt .cd { margin-top: 22px; }
.hero_txt .cd .u.s b { animation: ob_tick 1s steps(1) infinite; }     /* landing không theo giảm chuyển động (session 85) — ob.css tắt nhịp giây khi reduce, play.html giữ */
.hero_txt .tagline { margin: 16px 0 0; max-width: 560px; font-size: 16px; color: #efe5cf; text-shadow: 0 1px 8px rgba(0, 0, 0, .85); }
.keepset { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.keepset li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; background: rgba(4, 6, 10, .62); border: 1px solid var(--line); border-radius: 4px; font-size: 13.5px; color: #e6dcc4; }
.keepset .fa-check { color: var(--ok); }
.keepset .fa-rotate { color: var(--gold); }

/* ---------- thẻ kính chung (hộp đăng nhập · thẻ lời mời · hộp điều khoản) ---------- */
.login .card, .invite, dialog.doc { background: linear-gradient(180deg, rgba(10, 28, 24, .92), rgba(4, 10, 9, .95)); border: 1px solid rgba(241, 200, 106, .55); border-radius: 6px;
  box-shadow: 0 0 0 6px rgba(71, 224, 176, .08), 0 0 60px rgba(71, 224, 176, .3), 0 40px 90px rgba(0, 0, 0, .8); }

/* ---------- Mời bạn (/?ref=<mã>): thẻ lời mời thay khối giới thiệu + dải giữ lời mời / link sai đầu hộp đăng nhập ---------- */
.invite { width: min(440px, 40vw); padding: 24px 24px 20px; backdrop-filter: blur(8px); }
.invite .host { display: flex; align-items: center; gap: 14px; }
.invite .pt { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 6px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #1e3a30, #08120f); box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(71, 224, 176, .35); }
.invite .pt img { width: 78%; height: auto; }
.invite .pt img.px { width: 100%; height: 100%; image-rendering: pixelated; }
.invite .k { margin: 0; font-size: 13px; color: var(--jade-l); }
.invite h2 { margin: 0; font: 700 30px/1.15 var(--f-title); color: var(--gold-l); text-shadow: 0 0 20px rgba(241, 200, 106, .4); overflow-wrap: anywhere; }
.invite .m { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.invite .m b { color: var(--text); font-weight: 600; }
.invite .lead { margin: 14px 0 0; font-size: 15px; line-height: 1.55; color: #efe5cf; }
.invite .lead b { color: var(--gold-l); }
.invite h3 { margin: 16px 0 8px; font: 700 18px var(--f-title); color: var(--gold); letter-spacing: .03em; }
.invite .gifts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.invite .gifts li { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 44px; padding: 5px 10px 5px 6px;
  border-radius: 4px; background: rgba(0, 0, 0, .4); border: 1px solid rgba(241, 200, 106, .18); }
.invite .when { display: inline-flex; justify-content: center; padding: 2px 0; border-radius: 3px; background: rgba(71, 224, 176, .14); color: var(--jade-l); font-size: 12.5px; font-weight: 700; }
.invite .what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; }
.invite .what > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.invite .it { flex: none; width: 26px; height: 26px; background: url(../b_px/ui/items.png?v=8cf02b92) 0 0 / 600% 600% no-repeat; }
.invite .fine { display: flex; gap: 8px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.invite .fine i { margin-top: 3px; color: var(--gold); }

/* ---------- đăng nhập: thẻ kính trên cổng xoáy ---------- */
.login { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; }
.login.open { display: grid; }
.login .shade { position: absolute; inset: 0; background: rgba(2, 3, 6, .7); backdrop-filter: blur(4px); opacity: 0; transition: opacity .35s; }
.login .card { position: relative; width: min(440px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow: auto; padding: 40px 36px 30px; scale: .7; opacity: 0;
  transition: scale .45s cubic-bezier(.2, 1.3, .4, 1), opacity .3s; scrollbar-width: thin; scrollbar-color: var(--gold-2) transparent; }
.login .ring { position: absolute; left: 50%; top: 50%; width: min(760px, 92vmin); height: min(760px, 92vmin); max-width: none; margin: calc(min(760px, 92vmin) / -2) 0 0 calc(min(760px, 92vmin) / -2); opacity: 0; scale: .4; pointer-events: none;
  transition: opacity .5s, scale .7s cubic-bezier(.2, 1, .3, 1); filter: drop-shadow(0 0 40px rgba(71, 224, 176, .5)); animation: spin 22s linear infinite; }
.login.on .ring { opacity: .55; scale: 1; }
.login.on .shade { opacity: 1; } .login.on .card { scale: 1; opacity: 1; }
.login .x { position: absolute; right: 10px; top: 10px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--muted); font-size: 18px; }
.login .x:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

/* ---------- nội dung hộp đăng nhập (#auth — 3 bước, home.js) ---------- */
.auth .view[hidden] { display: none; }
.auth h2 { margin: 0; text-align: center; font: 700 40px/1.1 var(--f-title); color: var(--gold-l); text-shadow: 0 0 24px rgba(241, 200, 106, .5); }
.auth .sub { margin: 12px 0 20px; text-align: center; color: var(--muted); font-size: 14px; }
.auth h2:has(+ .sub[hidden]) { margin-bottom: 20px; }   /* bước 1 bỏ câu giới thiệu (s101) — giữ khoảng tiêu đề → ô Gmail */
.auth .sub b { color: var(--text); font-weight: 600; word-break: break-all; }
.auth label.lbl { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.field { position: relative; }
.field > i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--gold); pointer-events: none; }
.field input { width: 100%; height: 52px; padding: 0 14px 0 42px; border-radius: 4px; border: 1px solid rgba(241, 200, 106, .4); background: rgba(0, 0, 0, .45); font-size: 16px;
  transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: var(--off); }
.field input:focus, .otp input:focus { outline: none; border-color: var(--jade); box-shadow: 0 0 0 3px rgba(71, 224, 176, .25), 0 0 20px rgba(71, 224, 176, .3); }
.field input:disabled { opacity: .6; }
.msg { margin: 8px 0 0; font-size: 13.5px; display: flex; gap: 7px; align-items: flex-start; }
.msg:empty { display: none; }
.msg.err { color: var(--blood-l); }
.msg.ok { color: var(--ok); }
.msg i { margin-top: 3px; }
.auth form .glow_btn { margin-top: 18px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--off); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* nút Google theo hướng dẫn thương hiệu: nền trắng, viền #747775, chữ Roboto 500 */
.g_btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border: 1px solid #747775; border-radius: 4px; background: #fff; color: #1f1f1f; cursor: pointer;
  font: 500 15px/1 Roboto, var(--f-ui); }
.g_btn:hover:not(:disabled) { background: #f2f2f2; }
.g_btn:disabled { opacity: .6; cursor: progress; }
.g_btn svg { width: 20px; height: 20px; flex: none; }
.legal { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.55; }
.legal .link { font-size: inherit; font-weight: 600; color: var(--text); }
/* nút nhóm Zalo cuối hộp đăng nhập — nút phụ (viền mảnh), không tranh nút chính */
.zalo_btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; margin-top: 18px; padding: 0 14px; border: 1px solid rgba(0, 104, 255, .55); border-radius: 4px;
  background: rgba(0, 104, 255, .12); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; transition: background .2s, border-color .2s; }
.zalo_btn:hover { background: rgba(0, 104, 255, .24); border-color: #3d8bff; }
.zalo_btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.zalo_btn img { width: 22px; height: 22px; flex: none; }
.zalo_btn i { font-size: 11px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; margin-bottom: 4px; text-decoration: none; font-size: 14px; }
.resend .link { min-height: 40px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 0; padding: 0; border: 0; }
.otp input { width: 100%; height: 58px; text-align: center; border-radius: 4px; border: 1px solid rgba(241, 200, 106, .4); background: rgba(0, 0, 0, .45);
  font: 400 26px/1 var(--f-num); color: var(--gold-l); caret-color: var(--jade); transition: border-color .15s, box-shadow .15s; }
.otp input:disabled { opacity: .5; }
/* lỗi thắng cả lúc đang focus (đặt sau luật :focus) */
.invalid .field input, .invalid .field input:focus, .otp.invalid input, .otp.invalid input:focus { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255, 122, 106, .18); }
.otp.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.resend { margin-top: 14px; text-align: center; font-size: 14px; color: var(--muted); }
.resend b { color: var(--text); font-variant-numeric: tabular-nums; }
.auth .hint { margin: 14px 0 0; padding: 10px 12px; display: flex; gap: 9px; font-size: 13px; color: var(--muted); background: rgba(71, 224, 176, .1); border-left: 3px solid var(--jade); border-radius: 3px; }
.auth .hint i { color: var(--jade); margin-top: 3px; }
.auth .hint b { color: var(--jade-l); }
.who { text-align: center; }
.who .avatar { width: 72px; height: 72px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; font: 700 32px/1 var(--f-title); color: var(--gold-l);
  background: radial-gradient(circle at 35% 30%, #2fb88a, #0b2f25 75%); border: 2px solid var(--gold); box-shadow: 0 0 0 4px rgba(71, 224, 176, .12), 0 0 26px rgba(71, 224, 176, .45); }
.who .sub { margin-bottom: 18px; }
.facts_mini { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; text-align: left; }
.facts_mini li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(241, 200, 106, .16); border-radius: 4px; font-size: 13.5px; color: var(--muted); }
.facts_mini i { width: 18px; text-align: center; color: var(--gold); }
.who .out { margin-top: 16px; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; }
.auth .keep { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 9px 12px; border-radius: 4px; font-size: 13px; line-height: 1.45;
  background: linear-gradient(90deg, rgba(241, 200, 106, .2), rgba(241, 200, 106, .06)); border: 1px solid rgba(241, 200, 106, .35); }
.auth .keep > i { color: var(--gold); font-size: 16px; }
.auth .keep b { color: var(--gold-l); }
.auth .keep.bad { background: rgba(255, 59, 59, .12); border-color: rgba(255, 90, 80, .45); color: #ffd0c8; }
.auth .keep.bad > i { color: var(--blood-l); }
.who .ref_who { margin: -8px 0 16px; font-size: 14px; color: var(--muted); }
.who .ref_who b { color: var(--text); font-weight: 600; }
.who .ref_who i { color: var(--ok); }
.auth .early { margin: 0 0 16px; display: flex; gap: 9px; padding: 10px 12px; text-align: left; font-size: 13px; line-height: 1.45; color: #e6dcc4;
  background: rgba(127, 214, 90, .08); border: 1px solid rgba(127, 214, 90, .3); border-radius: 4px; }
.auth .early i { margin-top: 3px; color: var(--ok); }
.who .gift, .who #obFacts { margin: 0 0 16px; }
.who .glow_btn.wait:disabled { opacity: 1; cursor: default; color: var(--gold-l); background: linear-gradient(180deg, rgba(62, 46, 18, .9), rgba(30, 22, 12, .9)); border-color: var(--gold-1); box-shadow: none; font-size: 17px; }
.who .glow_btn.wait i { color: var(--gold); }
.who .glow_btn.wait b { font-variant-numeric: tabular-nums; }

/* ---------- tiêu đề mục ---------- */
.sec_h { text-align: center; position: relative; z-index: 2; }
.sec_h .eb { margin: 0; font: 700 13px/1 var(--f-ui); letter-spacing: .4em; padding-left: .4em; text-transform: uppercase; color: var(--jade); }
.sec_h h2 { margin: 14px 0 0; font: 700 clamp(40px, 4.6vw, 64px)/1.1 var(--f-title); color: var(--gold-l); text-shadow: 0 0 30px rgba(241, 200, 106, .35); }
.sec_h p { margin: 16px auto 0; max-width: 680px; color: var(--muted); }
/* hiện dần khi cuộn tới */
.rv { opacity: 0; translate: 0 40px; filter: blur(8px); transition: opacity .9s, translate .9s cubic-bezier(.2, .8, .2, 1), filter .9s; }
.rv.in { opacity: 1; translate: 0 0; filter: blur(0); }

/* ---------- thăng cảnh giới: khung dính, cột sáng dâng theo cuộn ---------- */
.ascend { position: relative; height: calc(var(--n) * 55vh + 100vh); }
.ascend .sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; grid-template-columns: 1fr 140px 1fr; grid-template-rows: auto 1fr auto; padding: 96px 6vw 40px; column-gap: 50px; }
.ascend .sky_bg { position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(1200px 700px at 50% 120%, rgba(71, 224, 176, calc(.08 + var(--p, 0) * .25)), transparent 60%),
              radial-gradient(900px 500px at 50% -10%, rgba(181, 140, 255, calc(var(--p, 0) * .35)), transparent 65%),
              linear-gradient(180deg, #05070c, #0b1220 60%, #04060a); }
.ascend .sky_bg::before { content: ""; position: absolute; inset: -50% 0 0; opacity: .55;   /* sao trôi lên */
  background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 60%, #cfe, transparent), radial-gradient(1.2px 1.2px at 40% 80%, #ffe, transparent),
                    radial-gradient(1px 1px at 85% 20%, #fff, transparent), radial-gradient(1.3px 1.3px at 10% 70%, #dff, transparent), radial-gradient(1px 1px at 55% 10%, #fff, transparent);
  background-size: 300px 300px; animation: stars 40s linear infinite; }
@keyframes stars { to { translate: 0 300px; } }
.ascend .sec_h { grid-column: 1 / -1; }
.pillar { grid-column: 2; grid-row: 2; position: relative; margin: 30px 0; }
.pillar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; translate: -50% 0; border-radius: 2px; background: rgba(236, 230, 218, .1); }
.pillar .fill { position: absolute; left: 50%; bottom: 0; width: 6px; translate: -50% 0; height: calc(var(--p, 0) * 100%); border-radius: 3px;
  background: linear-gradient(0deg, var(--jade), var(--gold-l)); box-shadow: 0 0 22px 4px rgba(71, 224, 176, .6); }
.pillar ol { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column-reverse; justify-content: space-between; align-items: center; }
.pillar li { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font: 400 13px/1 var(--f-num); color: var(--muted); background: var(--night-2);
  border: 1px solid rgba(236, 230, 218, .25); transition: all .35s; z-index: 1; }
.pillar li.kiep { border-color: rgba(255, 90, 80, .5); }
.pillar li.done { color: #04130e; background: var(--jade); border-color: var(--jade-l); box-shadow: 0 0 14px rgba(71, 224, 176, .7); }
.pillar li.cur { scale: 1.45; color: #1a1205; background: var(--gold-l); border-color: #fff; box-shadow: 0 0 0 6px rgba(241, 200, 106, .15), 0 0 30px rgba(241, 200, 106, .9); }
/* Tu Sĩ theo cảnh giới (cột trái, sát cột sáng — home_fx.js): đổi cảnh giới = hình mới lóe sáng rồi rõ dần từ dưới lên; quầng chân sáng dần theo --p */
.sage { grid-column: 1; grid-row: 2; position: relative; justify-self: end; align-self: center; width: min(100%, 427px); aspect-ratio: 2 / 3; max-height: 100%; min-height: 0; pointer-events: none; }   /* căn giữa dọc như thẻ chữ (chủ dự án): rộng theo cột → cao 2:3; hàng thấp thì kẹp cao, ảnh lấp đủ cao khung → phần vẽ luôn đúng tâm, chân trên quầng */
.sage::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -2%; height: 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(71, 224, 176, calc(.22 + var(--p, 0) * .4)), transparent); }
.sage img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; opacity: 0; translate: 0 22px; filter: brightness(2.4) blur(8px);
  transition: opacity .45s, translate .7s cubic-bezier(.2, .8, .2, 1), filter .7s; }
.sage img.on { opacity: 1; translate: 0 0; filter: brightness(1) blur(0); }
.realm_card { grid-column: 3; grid-row: 2; align-self: center; max-width: 480px; min-width: 0; }
.realm_card .lv { margin: 0; font: 400 18px/1 var(--f-num); color: var(--jade-l); letter-spacing: .1em; }
.realm_card h3 { margin: 14px 0 0; font: 700 clamp(56px, 6vw, 96px)/1 var(--f-title); color: var(--gold-l); text-shadow: 0 0 40px rgba(241, 200, 106, .5); overflow-wrap: break-word; }
html:not(:lang(vi)) .realm_card h3 { font-size: clamp(40px, 4.2vw, 64px); }   /* tên cảnh giới tiếng Anh dài (Foundation Establishment) */
.realm_card .kiep { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 6px 14px; border-radius: 999px; font: 700 15px var(--f-ui); color: #fff;
  background: rgba(255, 59, 59, .25); border: 1px solid var(--blood); box-shadow: 0 0 22px rgba(255, 59, 59, .5); }
.realm_card .desc { margin: 18px 0 0; font-size: 18px; color: var(--text); }
.realm_card.swap { animation: swap .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes swap { from { opacity: 0; translate: 0 26px; filter: blur(6px); } }
.ascend .hint { grid-column: 1 / -1; grid-row: 3; margin: 0; text-align: center; color: var(--muted); font-size: 14.5px; }
.bolt { position: absolute; z-index: 1; left: 14%; top: -6%; height: 90%; opacity: 0; pointer-events: none; }   /* bên trái cột — thẻ chữ cảnh giới ở bên phải không bị sét che */
.bolt img { height: 100%; width: auto; max-width: none; }
.bolt.on { animation: bolt .9s ease-out; }
@keyframes bolt { 0% { opacity: 1; } 10% { opacity: .2; } 20% { opacity: 1; } 35% { opacity: .5; } 100% { opacity: 0; } }
.ascend.strike .sticky { animation: quake .4s; }
@keyframes quake { 20% { translate: -6px 3px; } 40% { translate: 5px -4px; } 60% { translate: -3px 2px; } 80% { translate: 2px -1px; } }

/* ---------- Tiên · Ma đối đầu: 2 nửa chéo, rê bên nào bên đó lấn sang ---------- */
.clash { position: relative; padding: 120px 0 80px; }
.duel { --w: 50%; position: relative; height: 760px; margin-top: 50px; overflow: hidden; }
.side { position: absolute; top: 0; bottom: 0; outline: none; transition: clip-path .7s cubic-bezier(.2, .8, .2, 1); }
.side.tien { left: 0; right: 0; clip-path: polygon(0 0, calc(var(--w) + 6%) 0, calc(var(--w) - 6%) 100%, 0 100%);
  background: radial-gradient(70% 80% at 25% 60%, rgba(71, 224, 176, .3), transparent 70%), linear-gradient(180deg, #06231d, #04110e); }
.side.ma { left: 0; right: 0; clip-path: polygon(calc(var(--w) + 6%) 0, 100% 0, 100% 100%, calc(var(--w) - 6%) 100%);
  background: radial-gradient(70% 80% at 75% 60%, rgba(255, 59, 59, .3), transparent 70%), linear-gradient(180deg, #2a0708, #120304); }
.duel:has(.tien:hover, .tien:focus-visible) { --w: 64%; }
.duel:has(.ma:hover, .ma:focus-visible) { --w: 36%; }
.side .char { position: absolute; bottom: 0; height: 92%; width: auto; max-width: none; filter: drop-shadow(0 0 30px var(--aura)); transition: scale .7s, filter .4s; transform-origin: bottom center; }
.side.tien { --aura: rgba(71, 224, 176, .45); } .side.ma { --aura: rgba(255, 59, 59, .5); }
.side.tien .char { left: 16%; } .side.ma .char { right: 16%; }
.side::after { content: ""; position: absolute; inset: 55% 0 0; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(2, 3, 6, .92) 75%); }
.side .circle { position: absolute; bottom: -9%; width: 560px; height: 560px; max-width: none; transform: scaleY(.32); opacity: .85; animation: spin 18s linear infinite; }
.side.tien .circle { left: calc(16% - 90px); } .side.ma .circle { right: calc(16% - 90px); animation-direction: reverse; }
.side:hover .char, .side:focus-visible .char { scale: 1.04; filter: drop-shadow(0 0 50px var(--aura)) brightness(1.08); }
.side .info { position: absolute; z-index: 2; bottom: 44px; max-width: 420px; }
.side.tien .info { left: 5%; text-align: left; } .side.ma .info { right: 5%; text-align: right; }
.duel:has(.ma:hover) .tien .info, .duel:has(.tien:hover) .ma .info { opacity: .25; }
.side h3 { margin: 0; font: 700 64px/1 var(--f-title); color: #fff; text-shadow: 0 0 30px var(--aura); }
.side .k { margin: 10px 0 0; } .side.tien .k { color: var(--jade-l); } .side.ma .k { color: var(--blood-l); }
.side .info > p:not(.k) { margin: 14px 0 0; color: var(--text); }
.side ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.side.ma ul { justify-content: flex-end; }
.side li { padding: 5px 12px; border-radius: 3px; font: 700 15px var(--f-title); background: rgba(0, 0, 0, .45); border: 1px solid var(--aura); }
.seam { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.clash .note { margin: 34px auto 0; padding: 0 24px; text-align: center; color: var(--muted); }

/* ---------- bí pháp: 5 trận pháp xoay, rê vào xoay nhanh + bừng sáng ---------- */
.arts { padding: 120px 6vw 100px; background: radial-gradient(900px 500px at 50% 40%, rgba(71, 224, 176, .1), transparent 70%); }
.slots { display: flex; justify-content: center; align-items: center; gap: 30px; margin-top: 60px; }
.slots_cap { margin: 18px 0 0; text-align: center; color: var(--text); }
.slot { position: relative; width: 156px; height: 156px; display: grid; place-items: center; outline: none; cursor: default; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; animation: spin 14s linear infinite; transition: opacity .3s, filter .3s; }
.slot b { position: relative; width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(rgba(3, 10, 8, .9) 52%, transparent 72%); font: 400 40px/1 var(--f-num); color: var(--gold-l); text-shadow: 0 0 16px rgba(241, 200, 106, .9); }
.slot:hover img, .slot:focus-visible img { opacity: 1; filter: brightness(1.5) drop-shadow(0 0 16px rgba(71, 224, 176, .9)); animation-duration: 2.4s; }
.grades { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 70px 0 0; padding: 0; list-style: none; }
.grades li { min-width: 150px; padding: 14px 18px 12px; text-align: center; border-radius: 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(0, 0, 0, .3));
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 22%, transparent); }
.grades b { display: block; font: 700 24px/1.1 var(--f-title); color: var(--c); text-shadow: 0 0 14px color-mix(in srgb, var(--c) 70%, transparent); }
.grades span { font-size: 13px; color: var(--muted); }
.grades .forbid { background: linear-gradient(180deg, rgba(255, 59, 59, .2), #000); }
.arts .cap { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Tam Giới: bản đồ + sương trôi + 3 vùng ---------- */
.realms { padding: 120px 6vw 100px; }
.world { position: relative; max-width: 1240px; margin: 56px auto 0; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(241, 200, 106, .35), 0 40px 90px rgba(0, 0, 0, .7); }
.world .map { position: relative; overflow: hidden; }
.world .map img { width: 100%; height: auto; animation: breathe 18s ease-in-out infinite alternate; }
@keyframes breathe { to { scale: 1.06; } }
.world .fog { position: absolute; inset: -20%; pointer-events: none; opacity: .55;
  background: radial-gradient(30% 22% at 20% 30%, rgba(255, 255, 255, .5), transparent 70%), radial-gradient(26% 20% at 70% 70%, rgba(255, 255, 255, .45), transparent 70%),
              radial-gradient(22% 18% at 50% 15%, rgba(200, 180, 255, .4), transparent 70%); animation: fog 26s ease-in-out infinite alternate; }
@keyframes fog { to { translate: 8% 4%; } }
.world .zone { position: absolute; bottom: 24px; width: 28%; padding: 14px 18px; border-radius: 4px; background: rgba(4, 6, 10, .72); backdrop-filter: blur(8px); border-top: 3px solid var(--c); }
.world .zone h3 { margin: 0; font: 700 26px/1.2 var(--f-title); color: var(--c); }
.world .zone p { margin: 6px 0 0; font-size: 14px; color: var(--text); }
.world .t { left: 2%; --c: var(--jade-l); } .world .g { left: 36%; --c: #d9c2ff; } .world .m { right: 2%; --c: var(--blood-l); }

/* ---------- cổng Tiên Môn ---------- */
.gate { position: relative; display: grid; justify-items: center; gap: 26px; padding: 140px 24px 60px; overflow: hidden; text-align: center; }
.portal { position: relative; width: min(620px, 80vw); aspect-ratio: 1; margin-bottom: calc(min(620px, 80vw) * -.516); }
.portal img { width: 100%; height: 100%; animation: spin 30s linear infinite; filter: drop-shadow(0 0 40px rgba(71, 224, 176, .5)); }
.portal canvas { position: absolute; inset: -30%; width: 160%; height: 160%; mix-blend-mode: screen; }
.gate h2 { position: relative; margin: 0; font: 700 clamp(48px, 6vw, 84px)/1.1 var(--f-title); color: #fff; text-shadow: 0 0 40px rgba(71, 224, 176, .8), 0 0 80px rgba(71, 224, 176, .4); }
.gate .glow_btn { position: relative; }

/* ---------- chân trang ---------- */
.foot { display: grid; justify-items: center; gap: 10px; padding: 28px 24px 40px; text-align: center; border-top: 1px solid rgba(241, 200, 106, .14); font-size: 13px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }
.foot .link { min-height: 40px; display: inline-flex; align-items: center; color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.foot .link:hover { color: var(--jade-l); text-decoration: underline; }
.foot p { margin: 0; }

/* ---------- hộp đọc điều khoản ---------- */
dialog.doc { position: fixed; width: min(560px, calc(100% - 32px)); max-height: min(80vh, 680px); padding: 0; color: var(--text); overflow: visible; }
dialog.doc::backdrop { background: rgba(2, 3, 6, .7); backdrop-filter: blur(3px); }
dialog.doc .scroll { max-height: min(80vh, 680px); overflow: auto; padding: 28px 28px 24px; scrollbar-width: thin; scrollbar-color: var(--gold-2) rgba(0, 0, 0, .35); }
dialog.doc h2 { margin: 0; padding-right: 40px; font: 700 28px var(--f-title); color: var(--gold-l); }
dialog.doc ul { margin: 16px 0 0; padding-left: 20px; color: var(--muted); }
dialog.doc li { margin-bottom: 8px; }
dialog.doc .x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--muted); font-size: 18px; }
dialog.doc .x:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

/* ---------- ML6: gợi ý "Xem bằng tiếng Việt?" (trình duyệt tiếng Việt, trang tiếng Anh theo IP) ---------- */
.lang_hint { position: fixed; left: 50%; bottom: 20px; z-index: 55; transform: translateX(-50%); max-width: calc(100% - 24px); display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border: 1px solid rgba(241, 200, 106, .5); border-radius: 999px; background: rgba(6, 16, 14, .94); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.lang_hint > i { color: var(--gold); }
.lang_hint .link { white-space: nowrap; }
.lang_hint .x { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.lang_hint .x:hover { background: rgba(241, 200, 106, .12); color: var(--gold-l); }

/* ---------- ?mock=1: bảng soát trạng thái đăng nhập (không thuộc thiết kế — trên hộp nổi, dưới mở màn) ---------- */
.mock { position: fixed; right: 16px; bottom: 16px; z-index: 95; width: 300px; font-size: 13px; background: #0b0f14; color: #d6dde6; border: 1px dashed #5a7aa6; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.mock summary { padding: 10px 14px; cursor: pointer; font-weight: 600; color: #9fc2ff; list-style: none; display: flex; align-items: center; gap: 8px; }
.mock summary::-webkit-details-marker { display: none; }
.mock[open] summary { border-bottom: 1px dashed #2f4560; }
.mock .bd { padding: 10px 14px 14px; display: grid; gap: 10px; }
.mock .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mock button { padding: 6px 8px; font-size: 12.5px; text-align: left; background: #141c26; color: #d6dde6; border: 1px solid #2f4560; border-radius: 6px; cursor: pointer; }
.mock button:hover { border-color: #5a7aa6; }

/* ---------- thang đậm nhạt (chủ dự án: "cùng 1 weight, vài chỗ mỏng quá")
   LXGW WenKai chỉ có tới 700, nét bút lông vẫn mảnh ở cỡ lớn → dày thêm bằng viền chữ cùng màu (paint-order: viền dưới nét, không lẹm lòng chữ);
   chữ thường Be Vietnam Pro: nhãn 600–800, đoạn văn nhỏ 500 (400 trên nền tối nhìn mảnh). ---------- */
.sec_h h2, .realm_card h3, .side h3, .gate h2, .auth h2, .invite h2 { -webkit-text-stroke: .024em currentColor; paint-order: stroke fill; }
.hero_txt .sub, .world .zone h3, .grades b, .mark, .intro .tag, .invite h3, dialog.doc h2 { -webkit-text-stroke: .03em currentColor; paint-order: stroke fill; }
.glow_btn, .side li { -webkit-text-stroke: .035em currentColor; paint-order: stroke fill; }
.sec_h .eb { font-weight: 800; }
.top .links a, .kicker, .ghost_btn, .side .k, .auth label.lbl, .auth .link { font-weight: 600; }
.realm_card .kiep { font-weight: 700; }
.stats span, .sec_h p, .realm_card .desc, .ascend .hint, .side .info > p:not(.k), .clash .note, .arts .cap, .slots_cap, .grades span, .world .zone p, .legal, .auth .sub, .foot p, .invite .lead { font-weight: 500; }
.stats span, .ascend .hint, .arts .cap, .clash .note, .sec_h p { color: #c9c0ae; }

/* =====================================================================
   co giãn — PC hẹp / máy tính bảng
   ===================================================================== */
@media (max-width: 1240px) {
  .top { gap: 18px; }
  .top .links a { padding: 8px 9px; font-size: 15px; }
}
@media (max-width: 1100px) {                                     /* thanh trên chật (bản EN dài hơn) → gom mục vào menu ☰ */
  .top .links { display: none; }
  .top .menu { display: grid; place-items: center; }
  .top .sheet:not([hidden]) { position: absolute; top: 100%; left: 0; right: 0; display: grid; gap: 2px; padding: 8px 16px 16px; background: rgba(4, 8, 8, .97); border-bottom: 1px solid rgba(241, 200, 106, .3); }
  .top .sheet a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 4px; color: var(--text); text-decoration: none; font-weight: 600; }
  .top .sheet a:hover { background: rgba(241, 200, 106, .1); }
  .ascend .sticky { column-gap: 28px; grid-template-columns: 1fr 100px 1.2fr; }
  .duel { height: 640px; }
  .side h3 { font-size: 52px; }
  .side .info { max-width: 360px; }
  .side .circle { width: 460px; height: 460px; }
  .slots { gap: 18px; }
  .slot { width: 130px; height: 130px; }
  .grades li { min-width: 130px; }
  .world .zone { padding: 10px 14px; }
  .world .zone h3 { font-size: 22px; }
  .world .zone p { font-size: 13px; }
}
@media (max-width: 900px) {
  .hero_txt { max-width: calc(100% - 56px); }
  .invite { width: min(440px, calc(100% - 56px)); }
  .hero::after { background: linear-gradient(90deg, rgba(4, 6, 10, .88) 0%, rgba(4, 6, 10, .55) 55%, rgba(4, 6, 10, .3) 100%), linear-gradient(180deg, transparent 60%, var(--night) 100%); }
  .stats { gap: 22px; }
  .world { overflow: visible; box-shadow: none; display: grid; gap: 10px; }
  .world .map { border-radius: 8px; box-shadow: 0 0 0 1px rgba(241, 200, 106, .35), 0 24px 60px rgba(0, 0, 0, .6); }
  .world .zone { position: static; width: auto; }
}

/* =====================================================================
   điện thoại dọc / màn hẹp (chữ thân 11–15 px, nút chạm ≥ 40 px — knowledge §Điện thoại)
   ===================================================================== */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .top { height: 56px; gap: 10px; padding: 0 12px; }
  .mark { font-size: 20px; gap: 8px; }
  .mark img { width: 32px; }
  .top .end { gap: 8px; }
  .top .glow_btn.sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
  .top .lang { padding: 0 2px 0 9px; }
  .top .me { width: 40px; height: 40px; }
  .intro .core > img { width: 88px; }
  .intro .tag { font-size: 14px; letter-spacing: .3em; padding-left: .3em; max-width: calc(100vw - 32px); }
  .intro .skip { right: 16px; bottom: 18px; }
  h1.logo { width: min(86vw, 420px); }
  .hero_txt .sub { font-size: 19px; }
  .kicker { font-size: 12.5px; padding: 5px 12px; }
  .stats { flex-wrap: wrap; gap: 10px 20px; margin-top: 26px; }
  .stats b { font-size: 28px; }
  .stats span { font-size: 12.5px; }
  .glow_btn { font-size: 18px; min-height: 48px; padding: 0 24px; }
  .glow_btn.lg { min-height: 56px; padding: 0 36px; font-size: 20px; }
  .ghost_btn { min-height: 48px; }
  .sec_h .eb { font-size: 11px; letter-spacing: .3em; }
  .sec_h h2 { font-size: 32px; margin-top: 10px; }
  .sec_h p { font-size: 14px; padding: 0 4px; }
  /* thăng cảnh giới: cột sáng trái, thẻ chữ phải */
  .ascend { height: calc(var(--n) * 36vh + 100vh); }
  .ascend .sticky { grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; padding: 72px 18px 24px; column-gap: 20px; }   /* hình trên lấy hết chỗ còn lại, thẻ chữ dưới */
  .pillar { grid-column: 1; grid-row: 2 / 4; margin: 22px 0; }
  .pillar li { width: 26px; height: 26px; font-size: 11px; }
  .pillar li.cur { scale: 1.35; }
  .sage { grid-column: 2; grid-row: 2; justify-self: center; align-self: stretch; width: 100%; aspect-ratio: auto; margin: 6px 0 4px; }
  .realm_card { grid-column: 2; grid-row: 3; min-height: 190px; }   /* cao cố định: tên 1 hay 2 dòng thì hình không co giãn khi đổi cảnh giới */
  .realm_card .lv { font-size: 14px; }
  .realm_card h3, html:not(:lang(vi)) .realm_card h3 { font-size: 38px; }
  .realm_card .kiep { font-size: 13px; padding: 5px 12px; }
  .realm_card .desc { font-size: 14.5px; margin-top: 12px; }
  .ascend .hint { grid-row: 4; font-size: 12.5px; }
  .bolt { left: -10%; height: 80%; }
  /* Tiên · Ma: 2 khối chồng (không đủ ngang cho 2 nửa chéo) */
  .clash { padding: 80px 0 56px; }
  .duel { height: auto; margin-top: 32px; display: grid; }
  .side { position: relative; height: 540px; clip-path: none !important; }
  .side .char { height: 80%; bottom: 120px; }
  .side.tien .char { left: auto; right: 4%; } .side.ma .char { right: auto; left: 4%; }
  .side .circle { width: 340px; height: 340px; bottom: 40px; }
  .side.tien .circle { left: auto; right: calc(4% - 60px); } .side.ma .circle { right: auto; left: calc(4% - 60px); }
  .side::after { inset: 40% 0 0; }
  .side .info { left: 16px !important; right: 16px !important; bottom: 22px; max-width: none; opacity: 1 !important; }
  .side h3 { font-size: 40px; }
  .side .info > p:not(.k) { font-size: 14px; margin-top: 8px; }
  .side .k { font-size: 13.5px; margin-top: 6px; }
  .side ul { gap: 6px; margin-top: 12px; }
  .side li { padding: 4px 9px; font-size: 13.5px; }
  .seam { display: none; }
  .clash .note { font-size: 14px; margin-top: 24px; }
  /* bí pháp */
  .arts { padding: 80px 16px 64px; }
  .slots { gap: 6px; margin-top: 36px; }
  .slot { width: min(156px, 17.5vw); height: min(156px, 17.5vw); }
  .slot b { width: 46%; height: 46%; font-size: clamp(20px, 6vw, 40px); }
  .slots_cap { font-size: 14px; }
  .grades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 36px; }
  .grades li { min-width: 0; padding: 10px 8px 8px; }
  .grades b { font-size: 20px; }
  .grades span { font-size: 12.5px; }
  .arts .cap { font-size: 13px; }
  /* Tam Giới */
  .realms { padding: 80px 16px 64px; }
  .world { margin-top: 32px; }
  .world .zone { padding: 10px 14px; }
  .world .zone h3 { font-size: 21px; }
  .world .zone p { font-size: 13.5px; }
  /* cổng */
  .gate { padding: 90px 16px 44px; gap: 20px; }
  .gate h2 { font-size: 40px; }
  /* hộp điều khoản */
  dialog.doc .scroll { padding: 22px 18px 18px; }
  dialog.doc h2 { font-size: 24px; }
  dialog.doc ul { font-size: 14px; }
  .mock { right: 8px; bottom: 8px; width: calc(100% - 16px); max-width: 320px; }
  .mock:not([open]) { width: auto; }
}
@media (max-width: 420px) {
  .top .lang i, .top .glow_btn.sm i, .mark span { display: none; }   /* thanh trên 390 px: ấn + ngôn ngữ + Chơi ngay + ☰ — tên game to ngay đầu trang */
}

/* =====================================================================
   màn chạm hẹp (điện thoại / máy tính bảng — NM4): "Chơi ngay" ở thanh trên · hộp đăng nhập hiện LUÔN trong đầu trang (không hộp nổi)
   — cùng điều kiện INLINE trong home.js
   ===================================================================== */
@media (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  body { font-size: 14px; }                                           /* chữ thân điện thoại 11–15 px (knowledge §Điện thoại) — cả màn ngang > 760 px */
  .mark { min-height: 40px; min-width: 40px; }
  .top #navLogin { display: none; }
  .top .go:not([hidden]) { display: inline-flex; }
  .hero { height: auto; min-height: 100svh; }
  .hero::after { background: linear-gradient(180deg, rgba(4, 6, 10, .78) 0%, rgba(4, 6, 10, .5) 28%, rgba(4, 6, 10, .55) 60%, var(--night) 100%); }
  .hero_in { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 72px 16px 32px; }
  .hero_txt, .invite { position: static; translate: none; }
  .hero_txt { max-width: 520px; width: 100%; text-align: center; }
  h1.logo { margin: 10px auto 0; }
  .hero_txt .cd .t, .hero_txt .cd .at, .stats, .keepset { justify-content: center; }
  .hero_txt .cd .bar { margin-inline: auto; }
  .hero_txt .acts, .scroll_cue { display: none; }                     /* ô đăng nhập ngay dưới — bỏ nút trùng */
  .invite { width: 100%; max-width: 480px; }
  .login, .login.open { position: static; display: block; width: 100%; max-width: 440px; }
  .login .shade, .login .ring, .login .x { display: none; }
  .login .card { width: 100%; max-height: none; overflow: visible; padding: 22px 20px 18px; scale: 1; opacity: 1; transition: none; backdrop-filter: blur(6px); }
  .auth h2 { font-size: 30px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 560px) {
  .hero_in { padding-top: 66px; gap: 14px; }
  .kicker.ob { margin-bottom: 10px; }
  h1.logo { margin: 0 auto; }
  .hero_txt .sub { margin-top: 6px; font-size: 18px; }
  .stats { margin-top: 14px; gap: 6px 16px; }
  .stats b { font-size: 22px; }
  .stats span { margin-top: 2px; font-size: 12px; }
  .hero_txt .cd { margin-top: 12px; }
  .hero_txt .cd:not([hidden]) ~ .tagline { display: none; }           /* đang đếm: bỏ câu giới thiệu cho khối đếm + hộp lên gần */
  .keepset { margin-top: 12px; gap: 6px; }
  .keepset li { padding: 4px 9px; font-size: 12.5px; }
  .login .card { padding: 18px 16px 16px; }
  .auth h2 { font-size: 26px; }
  .auth .sub { margin: 6px 0 12px; font-size: 13.5px; line-height: 1.45; }
  .auth h2:has(+ .sub[hidden]) { margin-bottom: 12px; }
  .auth form .glow_btn { margin-top: 12px; }
  .field input { height: 48px; }
  .otp { gap: 6px; }
  .otp input { height: 52px; font-size: 22px; }
  .invite { padding: 18px 16px 16px; }
  .invite h2 { font-size: 26px; }
  .invite .gifts li { grid-template-columns: 68px minmax(0, 1fr); gap: 8px; }
  .top .cd_chip { display: none; }                                     /* màn hẹp: đồng hồ lớn ngay đầu trang */
}
/* điện thoại ngang (NM4 — như bản A): 2 cột — giới thiệu gọn trái, hộp đăng nhập phải ngay dưới thanh trên (thấy ô Gmail không cần cuộn) */
@media (hover: none) and (pointer: coarse) and (max-width: 1024px) and (max-height: 500px) {
  .top { height: 52px; }
  .mark { font-size: 20px; }
  .mark img { width: 32px; }
  .hero { min-height: 0; }
  .hero::after { background: linear-gradient(90deg, rgba(4, 6, 10, .88) 0%, rgba(4, 6, 10, .55) 50%, rgba(4, 6, 10, .7) 100%), linear-gradient(180deg, transparent 60%, var(--night) 100%); }
  .hero_in { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 60px 20px 20px; }
  .hero_txt, .invite { flex: 1 1 0; max-width: none; text-align: left; }
  .hero_txt .cd .t, .hero_txt .cd .at, .stats, .keepset { justify-content: flex-start; }
  .hero_txt .cd .bar { margin-inline: 0; }
  .kicker { display: inline-flex; padding: 3px 10px; font-size: 12px; }
  h1.logo { margin: 4px 0 0 -6px; width: 270px; }
  .hero_txt .sub { margin-top: 4px; font-size: 17px; }
  .stats { margin-top: 12px; gap: 4px 18px; }
  .stats b { font-size: 22px; }
  .stats span { margin-top: 2px; font-size: 12px; }
  .hero_txt .cd { margin-top: 10px; }
  .hero_txt .cd .k { display: none; }
  .hero_txt .cd .t { gap: 6px; }
  .hero_txt .cd .u { width: 72px; padding: 7px 0 5px; }
  .hero_txt .cd .u b { font-size: 34px; }
  .hero_txt .cd .u small { margin-top: 3px; font-size: 10.5px; }
  .hero_txt .cd .sep { padding-top: 6px; font-size: 24px; }
  .hero_txt .cd .at { margin-top: 8px; font-size: 13px; }
  .hero_txt .cd .bar { margin-top: 8px; }
  .hero_txt .cd .done { font-size: 30px; }
  .hero_txt .cd:not([hidden]) ~ .tagline { display: none; }
  .keepset { margin-top: 10px; gap: 6px; }
  .keepset li { padding: 4px 9px; font-size: 12.5px; }
  .login, .login.open { flex: 0 0 clamp(330px, 44vw, 372px); max-width: none; }
  .login .card { padding: 14px 18px 12px; }
  .auth h2 { font-size: 24px; }
  .auth .sub { margin: 6px 0 10px; font-size: 13.5px; line-height: 1.45; }
  .auth h2:has(+ .sub[hidden]) { margin-bottom: 10px; }
  .auth label.lbl { margin-bottom: 4px; }
  .field input { height: 46px; }
  .auth .glow_btn.block { min-height: 46px; }
  .auth form .glow_btn { margin-top: 10px; }
  .auth .or { margin: 6px 0; }
  .auth .legal { margin-top: 10px; }
  .auth .early { margin-bottom: 10px; padding: 7px 10px; }
  .auth .keep { margin-bottom: 10px; }
  .zalo_btn { min-height: 40px; margin-top: 10px; }
  .who .avatar { width: 52px; height: 52px; margin-bottom: 8px; font-size: 24px; }
  /* các mục dưới: màn thấp 390 px */
  .sec_h h2 { font-size: 30px; }
  .ascend .sticky { padding: 60px 5vw 14px; grid-template-columns: 1fr 60px 1.4fr; grid-template-rows: auto 1fr auto; column-gap: 24px; }
  .ascend .sec_h .eb { display: none; }
  .ascend .sec_h h2 { margin-top: 0; font-size: 26px; }
  .pillar { grid-column: 2; grid-row: 2; margin: 14px 0; }
  .pillar li { width: 22px; height: 22px; font-size: 11px; }
  .pillar li.cur { scale: 1.3; }
  .sage { grid-column: 1; grid-row: 2; justify-self: end; align-self: center; width: min(100%, 427px); aspect-ratio: 2 / 3; margin: 0; }   /* màn ngang hẹp ≤ 760: bỏ xếp chồng của khối 760 */
  .realm_card { grid-column: 3; grid-row: 2; min-height: 0; }
  .realm_card h3, html:not(:lang(vi)) .realm_card h3 { margin-top: 6px; font-size: 34px; }
  .realm_card .kiep { margin-top: 8px; font-size: 12.5px; padding: 3px 10px; }
  .realm_card .desc { margin-top: 8px; font-size: 14px; }
  .ascend .hint { grid-row: 3; font-size: 12px; }
  .clash { padding: 64px 0 40px; }
  .duel { height: 460px; margin-top: 24px; }
  .side h3 { font-size: 36px; }
  .side .info { bottom: 20px; max-width: 300px; }
  .side .info > p:not(.k) { font-size: 13.5px; margin-top: 6px; }
  .side .k { font-size: 13px; margin-top: 4px; }
  .side ul { margin-top: 8px; gap: 5px; }
  .side li { padding: 3px 8px; font-size: 13px; }
  .side .circle { width: 340px; height: 340px; }
  .arts, .realms { padding: 64px 5vw 48px; }
  .slots { margin-top: 28px; gap: 16px; }
  .slot { width: 96px; height: 96px; }
  .slot b { width: 46px; height: 46px; font-size: 26px; }
  .grades { margin-top: 28px; gap: 8px; }
  .grades li { min-width: 110px; padding: 8px 10px 6px; }
  .grades b { font-size: 18px; }
  .world { margin-top: 28px; }
  .world .zone { padding: 8px 12px; }
  .world .zone h3 { font-size: 19px; }
  .world .zone p { font-size: 12.5px; }
  .gate { padding: 64px 16px 36px; }
  .gate h2 { font-size: 40px; }
  .glow_btn.lg { min-height: 52px; font-size: 20px; }
}
