/* Vanguard 先锋 -- โครงเดียวกับเว็บ LOTJ, สีตามตัวเปิดเกม Vanguard (ดำ-เงิน-ม่วง, 2026-11-29)
   ม่วง #7c3aed / #a78bfa / #ddd6fe · เงิน #f4f4f5 / #d4d4d8 / #71717a · พื้นดำ · ฟอนต์ Prompt (ไทย) + Cinzel (อังกฤษ) */
:root {
  --bg: #09080d;
  --bg-alt: #0e0c14;
  --panel: rgba(20, 18, 28, 0.84);
  --panel-solid: #14121b;
  --line: rgba(167, 139, 250, 0.2);
  --line-strong: rgba(167, 139, 250, 0.48);
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --purple-pale: #ddd6fe;
  --purple-dark: #4c1d95;
  --silver: #f4f4f5;
  --silver-mid: #d4d4d8;
  --silver-dark: #71717a;
  --text: #e7e5e4;
  --muted: #a8a29e;
  --ok: #4ade80;
  --radius: 14px;
  --gutter: 16px;
  --font-ui: "Prompt", "Leelawadee UI", "Tahoma", sans-serif;
  --font-epic: "Cinzel", "Times New Roman", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: var(--purple-pale); text-decoration: none; }
a:hover { color: #fff; }
strong { font-weight: 500; color: #fff; }
q { quotes: "“" "”"; color: #fff; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--purple-light); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- ปุ่ม: ม่วง = ทำหลัก · เงิน = ทำรอง */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  border-radius: 10px; border: 1px solid transparent;
  font: 500 1rem/1.2 var(--font-ui);
  cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-purple {
  color: #fff;
  background: linear-gradient(180deg, var(--purple-light) 0%, var(--purple) 55%, var(--purple-dark) 100%);
  border-color: rgba(196, 181, 253, 0.55);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-purple:hover { color: #fff; box-shadow: 0 8px 32px rgba(124, 58, 237, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-silver {
  color: #18181b;
  background: linear-gradient(180deg, #ffffff 0%, var(--silver-mid) 55%, #a1a1aa 100%);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.btn-silver:hover { color: #000; box-shadow: 0 8px 28px rgba(228, 228, 231, 0.22), inset 0 1px 0 #fff; }
.btn-sm { min-height: 38px; padding: 6px 16px; font-size: 0.92rem; }
.btn-lg { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[aria-disabled="true"] {
  cursor: not-allowed; transform: none;
  color: var(--muted); background: #1a1822; border-color: #2a2733; box-shadow: none;
}

/* ---------- แถบบน */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  background: linear-gradient(180deg, rgba(7, 6, 10, 0.94), rgba(7, 6, 10, 0.6));
  border-bottom: 1px solid rgba(167, 139, 250, 0.14);
  backdrop-filter: blur(10px);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--silver); font-family: var(--font-epic); font-weight: 700; letter-spacing: 0.12em; }
.brand img { border-radius: 50%; }
.brand span { font-size: 1rem; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; }
.nav-links a:hover { color: var(--purple-pale); background: rgba(167, 139, 250, 0.1); }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-links + .nav-actions { margin-left: 8px; }

/* ---------- ปุ่มเลือกภาษา EN / 中文 / ไทย / VI */
.lang {
  display: flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: rgba(9, 8, 13, 0.6);
}
.lang button {
  min-width: 40px; min-height: 30px; padding: 2px 9px;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); font: 500 0.85rem/1 var(--font-ui);
  cursor: pointer; transition: background .2s ease, color .2s ease;
}
.lang button:hover { color: var(--purple-pale); background: rgba(167, 139, 250, 0.12); }
.lang button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(180deg, var(--purple-light) 0%, var(--purple) 60%, var(--purple-dark) 100%);
}
/* จีนตัวเต็ม: ฟอนต์ Prompt ไม่มีตัวจีน ใช้ฟอนต์จีนของเครื่องเป็นหลัก */
html:lang(zh-TW) body {
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Heiti TC", var(--font-ui);
  font-weight: 400;
}

/* ---------- หน้าแรก: คลิปมังกรของตัวเปิดเกม + โลโก้ 先锋 Vanguard */
.hero {
  position: relative; isolation: isolate;
  min-height: min(100svh, 880px);
  padding: 96px 0 64px;
  display: grid; place-items: center;
  overflow: hidden;
  background: #000;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-poster, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video { opacity: 0; transition: opacity .8s ease; }
.hero-video.is-playing { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(9, 8, 13, 0.15) 0%, rgba(9, 8, 13, 0.55) 60%, rgba(9, 8, 13, 0.9) 100%),
    linear-gradient(180deg, rgba(9, 8, 13, 0.4) 0%, rgba(9, 8, 13, 0) 30%, rgba(9, 8, 13, 0) 70%, var(--bg) 100%);
}
.hero-body { width: 100%; max-width: 780px; padding: 0 var(--gutter); text-align: center; }
/* โลโก้มีพื้นดำ: screen ทำให้ดำโปร่ง เห็นแต่ตัวอักษรเงินทับคลิป */
.hero-logo {
  width: min(640px, 100%); height: auto; margin: 0 auto -10px;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 58% 56% at 50% 50%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 58% 56% at 50% 50%, #000 70%, transparent 100%);
}
.pill {
  display: inline-block; margin-bottom: 14px; padding: 4px 14px;
  font-size: 0.88rem; font-weight: 500; color: var(--purple-pale);
  background: rgba(30, 20, 52, 0.8); border: 1px solid var(--line-strong); border-radius: 6px;
}
.hero-lead { font-size: 1.08rem; color: #f5f5f4; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95); }
.hero-cta { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- ส่วนเนื้อหา */
.section { padding: 88px 0; background: var(--bg); }
.section-alt {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.12), transparent 60%),
    var(--bg-alt);
  border-top: 1px solid rgba(167, 139, 250, 0.1);
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
}
.section-head { text-align: center; margin-bottom: 40px; }
.eyebrow { font-family: var(--font-epic); font-weight: 700; letter-spacing: 0.3em; font-size: 0.78rem; color: var(--purple-light); margin-bottom: 6px; }
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  background: linear-gradient(180deg, #ffffff, var(--silver-mid) 60%, var(--silver-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-sub { margin-top: 8px; color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}
.card-title { font-size: 1.1rem; color: var(--purple-pale); margin-bottom: 12px; }

/* ---------- ดาวน์โหลด */
.download-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.launcher-card, .register-card {
  position: relative; overflow: hidden;
  border-color: var(--line-strong);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(124, 58, 237, 0.2), transparent 55%),
    var(--panel);
}
.launcher-card::before, .register-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple-light), var(--silver), var(--purple-light), transparent);
}
.launcher-top { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.launcher-icon { border-radius: 50%; box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.4), 0 10px 30px rgba(0, 0, 0, 0.6); }
.launcher-top h3 { font-family: var(--font-epic); font-size: 1.5rem; color: #fff; letter-spacing: 0.04em; }
.facts { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.facts li { position: relative; padding-left: 26px; }
.facts li::before {
  content: ""; position: absolute; left: 4px; top: 0.62em; width: 9px; height: 9px;
  transform: rotate(45deg); background: var(--purple-light); box-shadow: 0 0 10px rgba(167, 139, 250, 0.7);
}
.btn-note { margin-top: 10px; text-align: center; font-size: 0.85rem; color: var(--muted); }
.side-stack { display: grid; gap: 20px; }
.spec { margin: 0; display: grid; gap: 10px; }
.spec div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed rgba(167, 139, 250, 0.16); }
.spec div:last-child { border-bottom: 0; padding-bottom: 0; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; }
.note-card { background: linear-gradient(180deg, rgba(46, 26, 84, 0.5), rgba(20, 18, 28, 0.84)); }

/* ---------- สมัครสมาชิก */
.register-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; max-width: 920px; margin: 0 auto; padding: 32px; }
.register-body .facts { margin-bottom: 14px; }
.register-actions { display: grid; gap: 12px; }

/* ---------- ขั้นตอน */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step {
  position: relative; padding: 26px 20px 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.step-no {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px;
  font-family: var(--font-epic); font-weight: 700; font-size: 1.25rem; color: #fff;
  background: linear-gradient(180deg, var(--purple-light), var(--purple) 60%, var(--purple-dark));
  border-radius: 50%; box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.16), 0 0 18px rgba(124, 58, 237, 0.45);
}
.step h3 { font-size: 1.12rem; margin-bottom: 8px; color: #fff; }
.step p { color: #d6d3d1; font-size: 0.95rem; }
.step-link { display: inline-block; margin-top: 12px; font-size: 0.92rem; font-weight: 500; }

/* ---------- เซิร์ฟเวอร์ */
.server-card {
  display: grid; grid-template-columns: 1.35fr 1fr; overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.server-card img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.server-body { padding: 32px 28px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.server-body h3 {
  font-family: var(--font-epic); font-size: 2.2rem; letter-spacing: 0.1em;
  background: linear-gradient(180deg, #ffffff, var(--silver-mid) 60%, var(--silver-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.server-status { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ok); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18); }
.server-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- แถบสถานะเซิร์ฟเวอร์ (ทำไปกี่ %) */
.progress {
  margin-top: 8px; padding: 16px 18px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(9, 8, 13, 0.6);
}
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.progress-label { font-weight: 500; color: #fff; font-size: 0.95rem; }
.progress-value {
  font-family: var(--font-epic); font-weight: 700; font-size: 1.6rem; line-height: 1;
  color: var(--purple-pale); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(167, 139, 250, 0.45);
}
.progress-track {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: #1a1822; border: 1px solid #2a2733;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
.progress-fill {
  position: relative; overflow: hidden;
  width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--purple-dark) 0%, var(--purple) 60%, var(--purple-light) 100%);
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.55);
  transition: width 1.6s cubic-bezier(.2, .8, .2, 1);
}
.progress-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: translateX(-100%);
  animation: progress-shine 2.6s ease-in-out infinite;
}
@keyframes progress-shine { to { transform: translateX(100%); } }
.progress-note { margin-top: 8px; font-size: 0.82rem; color: var(--muted); }

/* ---------- ชุมชน */
.social { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.social a {
  display: flex; align-items: center; gap: 10px; min-width: 200px; justify-content: center;
  padding: 14px 22px; border-radius: 12px; font-weight: 500; color: #fff;
  background: var(--panel); border: 1px solid var(--line);
}
.social a:hover { border-color: var(--line-strong); background: rgba(124, 58, 237, 0.14); color: var(--purple-pale); }
.social svg { width: 22px; height: 22px; flex: none; }

/* ---------- ท้ายหน้า */
.footer { padding: 28px 0 36px; border-top: 1px solid rgba(167, 139, 250, 0.14); background: #060509; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand-foot span { font-size: 0.9rem; }

/* ---------- ป๊อปอัป "เร็วๆ นี้" */
.popup {
  width: min(440px, calc(100% - 2 * var(--gutter)));
  padding: 32px 28px 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.22), transparent 65%), var(--panel-solid);
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(221, 214, 254, 0.14);
}
.popup::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); }
.popup[open] { animation: popup-in .22s ease-out; }
@keyframes popup-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.popup-emblem { margin: 0 auto 16px; border-radius: 50%; }
.popup-title { font-size: 1.15rem; font-weight: 500; color: #fff; }
.popup-sub {
  margin-top: 6px; font-size: 1.45rem; font-weight: 600;
  background: linear-gradient(180deg, #ffffff, var(--purple-pale) 50%, var(--purple-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.popup form { margin: 24px 0 0; }
.popup .btn { min-width: 150px; }

/* ---------- หน้าพาไปสมัคร (register/index.html) */
.jump { min-height: 100svh; display: grid; place-items: center; padding: var(--gutter); text-align: center; }
.jump .card { max-width: 440px; }
.jump img { margin: 0 auto 16px; border-radius: 50%; }
.jump .btn { margin-top: 18px; }

/* ---------- จอแคบ */
@media (max-width: 960px) {
  .download-grid, .register-card, .server-card { grid-template-columns: 1fr; }
  .server-card img { min-height: 0; aspect-ratio: 3 / 2; }
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-actions, .nav-links + .nav-actions { margin-left: auto; }
  .hero { min-height: 0; padding: 88px 0 48px; }
  .section { padding: 64px 0; }
  .card, .register-card { padding: 20px; }
  .spec div { grid-template-columns: 1fr; gap: 2px; }
  .server-body { padding: 24px 20px; }
}
@media (max-width: 960px) {
  .nav-register { display: none; }   /* ปุ่มสมัครมีในหน้าแรกอยู่แล้ว เหลือที่ให้ปุ่มภาษา */
}
@media (max-width: 520px) {
  .hero-cta .btn { width: 100%; }
  .brand span { display: none; }
  .launcher-top { gap: 14px; }
  .launcher-top img { width: 64px; height: 64px; }
  .launcher-top h3 { font-size: 1.2rem; }
}
@media (max-width: 400px) {
  .nav-inner { gap: 10px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-sm { padding: 6px 12px; }
  .lang button { min-width: 32px; padding: 2px 6px; font-size: 0.8rem; }
}

/* ---------- ปุ่มเพลงประกอบ มุมขวาล่าง -- เล่นอยู่ = แท่งม่วงเต้น · ปิด = แท่งเทานิ่ง + ขีดทับ */
.music-btn {
  position: fixed; right: var(--gutter); bottom: var(--gutter); z-index: 30;
  width: 48px; height: 48px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: rgba(9, 8, 13, 0.8); backdrop-filter: blur(8px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  cursor: pointer; transition: transform .15s ease, border-color .2s ease;
}
.music-btn:hover { transform: translateY(-1px); border-color: var(--purple-light); }
.music-bars { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.music-bars i { width: 3px; height: 6px; border-radius: 2px; background: var(--muted); transition: background .2s ease; }
.music-bars i:nth-child(2) { height: 10px; }
.music-bars i:nth-child(3) { height: 14px; }
.music-bars i:nth-child(4) { height: 8px; }
.music-btn[aria-pressed="false"] .music-bars::after {
  content: ""; position: absolute; left: -4px; right: -4px; top: 50%;
  height: 2px; background: var(--muted); transform: rotate(-35deg); border-radius: 2px;
}
.music-btn[aria-pressed="true"] .music-bars i {
  background: linear-gradient(180deg, var(--purple-pale), var(--purple-light));
  animation: music-bar 0.9s ease-in-out infinite alternate;
}
.music-btn[aria-pressed="true"] .music-bars i:nth-child(2) { animation-delay: -0.3s; }
.music-btn[aria-pressed="true"] .music-bars i:nth-child(3) { animation-delay: -0.6s; }
.music-btn[aria-pressed="true"] .music-bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes music-bar { from { height: 4px; } to { height: 18px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .music-btn[aria-pressed="true"] .music-bars i { animation: none; }
  .btn { transition: none; }
  .popup[open] { animation: none; }
  .progress-fill { transition: none; }
  .progress-fill::after { animation: none; }
}
