/* YulgangLab main website — wuxia ink, antique gold, cinnabar red, jade. System fonts only. */
:root {
  --ink-950: #07090b;
  --ink-900: #0a0e11;
  --ink-850: #0f1519;
  --ink-800: #141b20;
  --ink-700: #1b252b;
  --line: rgba(214, 180, 106, .18);
  --line-strong: rgba(214, 180, 106, .42);
  --text: #eef1ec;
  --text-2: #c2ccc8;
  --text-3: #9aa7a3;
  --gold: #d6b46a;
  --gold-2: #f0d9a0;
  --gold-deep: #a9823a;
  --red: #c8352b;
  --red-deep: #7d1712;
  --red-text: #ff9b8c;
  --jade: #5ccfae;
  --jade-deep: #1a7a65;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1200px;
  --font: "Leelawadee UI", "Noto Sans Thai", "Noto Sans Thai UI", Thonburi, "Segoe UI", Tahoma, sans-serif;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .85);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; min-height: 100vh; font: 16px/1.65 var(--font); color: var(--text);
  background: var(--ink-900);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(125, 23, 18, .35), transparent 70%),
    linear-gradient(180deg, var(--ink-950), var(--ink-900) 600px);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--jade); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8be3c9; }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
p { margin: 0; }

/* Thai / English toggle: Thai is the default; html[lang=en] swaps every paired text. */
html:not([lang="en"]) .en { display: none !important; }
html[lang="en"] .th { display: none !important; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 700 16px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-play {
  color: #1d0c05;
  background: linear-gradient(180deg, #ffe7a6 0%, #e8bd5d 45%, #b9852f 100%);
  border-color: #fff0c4;
  box-shadow: 0 0 0 3px rgba(200, 53, 43, .55), 0 10px 30px -6px rgba(232, 189, 93, .55);
}
.btn-play:hover { color: #1d0c05; box-shadow: 0 0 0 3px rgba(200, 53, 43, .8), 0 14px 36px -6px rgba(232, 189, 93, .75); }
.btn-play.btn-lg { --h: 60px; padding: 0 38px; font-size: 21px; }
.btn-ghost { color: var(--text); background: rgba(20, 27, 32, .72); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--gold-2); border-color: var(--gold); }
.btn-discord { color: #fff; background: #5865f2; border-color: #7c86ff; }
.btn-discord:hover { color: #fff; background: #4752e0; }
.btn[aria-disabled="true"] { cursor: default; background: rgba(88, 101, 242, .22); border-color: rgba(124, 134, 255, .5); color: #d7dbff; transform: none; }
.btn-sm { --h: 38px; padding: 0 16px; font-size: 15px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(7, 9, 11, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold-2); text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand img { width: 40px; height: 40px; }
.brand:hover { color: var(--gold-2); }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.nav a:hover { color: var(--gold-2); background: rgba(214, 180, 106, .08); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.lang {
  display: inline-flex; padding: 3px; border-radius: 999px; background: var(--ink-850); border: 1px solid var(--line);
}
.lang button {
  font: 700 13px/1 var(--font); color: var(--text-3); background: none; border: 0; border-radius: 999px;
  min-width: 40px; min-height: 30px; padding: 0 10px; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink-950); background: var(--gold); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding: 40px 0 56px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(520px 420px at 50% 42%, rgba(200, 53, 43, .42), transparent 70%),
    radial-gradient(900px 500px at 50% 110%, rgba(26, 122, 101, .25), transparent 70%),
    repeating-linear-gradient(115deg, rgba(214, 180, 106, .025) 0 2px, transparent 2px 22px);
}
.hero-bg { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; opacity: .12; filter: saturate(.7) brightness(.8); }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 140px; z-index: -1;
  background: linear-gradient(transparent, var(--ink-900));
}
.hero-inner { display: grid; grid-template-columns: 1fr minmax(320px, 520px) 1fr; align-items: end; gap: 12px; }
.hero-side { display: flex; align-items: flex-end; justify-content: center; gap: 0; min-height: 380px; }
.hero-side img { width: 220px; filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .7)); }
.hero-side img + img { margin-inline-start: -46px; }
.hero-side.right { flex-direction: row-reverse; }
.hero-side.right img + img { margin-inline: 0 -46px; }
.hero-center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero-logo { width: min(360px, 76vw); filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .8)); }
.hero h1 { font-size: clamp(22px, 2.6vw, 30px); color: var(--gold-2); font-weight: 800; text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }
.hero-lead { color: var(--text-2); max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: rgba(10, 14, 17, .8); border: 1px solid var(--line); color: var(--text-2); font-size: 14px;
}
.status-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 3px rgba(141, 154, 150, .2); }
.status-pill[data-state="online"] .dot { background: #7bd88f; box-shadow: 0 0 0 3px rgba(123, 216, 143, .22), 0 0 12px #7bd88f; }
.status-pill[data-state="maintenance"] .dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(214, 180, 106, .25); }
.status-pill[data-state="offline"] .dot { background: var(--red-text); }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 34px;
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 14, 17, .7); overflow: hidden;
}
.hero-stats div { padding: 14px 10px; text-align: center; }
.hero-stats div + div { border-inline-start: 1px solid var(--line); }
.hero-stats b { display: block; font-size: clamp(22px, 3vw, 30px); color: var(--gold-2); line-height: 1.2; }
.hero-stats div > span { color: var(--text-2); font-size: 14px; }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: linear-gradient(180deg, rgba(20, 27, 32, .55), rgba(10, 14, 17, 0)); border-top: 1px solid var(--line); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 34px; }
.eyebrow { display: inline-block; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); color: var(--text); }
.section-head h2 em { font-style: normal; color: var(--gold-2); }
.section-head p { color: var(--text-2); margin-top: 10px; }
.divider { width: 180px; height: 10px; margin: 14px auto 0; background:
  radial-gradient(circle at 50% 50%, var(--gold) 0 3px, transparent 4px),
  linear-gradient(90deg, transparent, var(--gold) 45%, transparent 45% 55%, var(--gold) 55%, transparent) center / 100% 1px no-repeat; }

/* ---------- classes ---------- */
.group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 22px; color: var(--gold-2); }
.group-title > span:last-child { font-size: 14px; color: var(--ink-950); background: var(--gold); border-radius: 999px; padding: 2px 10px; }
.group-title.new { color: #ffb3a6; }
.group-title.new > span:last-child { background: var(--red); color: #fff; }
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.class-grid { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 18px; }
.class-grid-new { grid-template-columns: repeat(3, 1fr); }
.class-grid-classic { grid-template-columns: repeat(5, 1fr); gap: 14px; }
.class-grid-classic .class-name { font-size: 20px; }
.class-grid-classic .class-body { padding: 0 12px 14px; }
.class-grid-classic .class-desc { font-size: 13.5px; }
.class-grid-new .class-art { aspect-ratio: 6 / 5; }
.class-card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--ink-800); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.class-card.is-new { border-color: rgba(200, 53, 43, .55); }
.class-art {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 62%, rgba(214, 180, 106, .28), transparent 72%),
    linear-gradient(180deg, #1c2328, #0c1013);
}
.is-new .class-art {
  background:
    radial-gradient(70% 55% at 50% 62%, rgba(200, 53, 43, .42), transparent 72%),
    linear-gradient(180deg, #24171a, #0c0f12);
}
.class-art::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, var(--ink-800)); pointer-events: none; }
.class-art img { position: absolute; inset: 4% 0 0; width: 100%; height: 96%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .65)); }
.class-art img[hidden] { display: none; }
.badge-new {
  position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #e04a3a, #9e1f17);
  border: 1px solid #ff9b8c; box-shadow: 0 4px 14px rgba(200, 53, 43, .5);
}
.sex-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(7, 9, 11, .78); border: 1px solid var(--line); }
.sex-toggle button { font: 700 13px/1 var(--font); color: var(--text-2); background: none; border: 0; min-width: 44px; min-height: 30px; padding: 0 9px; border-radius: 999px; cursor: pointer; }
.sex-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--ink-950); }
.class-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 18px; margin-top: -26px; position: relative; z-index: 1; flex: 1; }
.class-name { font-size: 24px; color: var(--gold-2); }
.class-name small { display: block; font-size: 13px; color: var(--text-3); font-weight: 600; letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10, 14, 17, .6); color: var(--text-2); }
.chip-weapon { color: var(--gold-2); border-color: rgba(214, 180, 106, .45); }
.chip-role { color: #9de9d2; border-color: rgba(92, 207, 174, .45); }
.class-desc { color: var(--text-2); font-size: 14.5px; }
.skills { list-style: none; margin: auto 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.skills li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.skills img { width: 36px; height: 36px; border-radius: 7px; border: 1px solid var(--line-strong); background: #000; }
.skills b { display: block; font-size: 14px; color: var(--text); line-height: 1.3; }
.skills li > div > span { display: block; font-size: 12.5px; color: var(--text-3); line-height: 1.4; }

/* ---------- systems ---------- */
.sys-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sys-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--ink-800); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sys-shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ink-950); border-bottom: 1px solid var(--line); }
.sys-shot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.sys-num { position: absolute; left: 12px; bottom: 10px; font: 800 13px/1 var(--font); color: var(--gold-2); background: rgba(7, 9, 11, .8); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 10px; }
.badge-soon { position: absolute; top: 12px; right: 12px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #062a21; background: var(--jade); }
.sys-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sys-body h3 { font-size: 20px; color: var(--gold-2); }
.sys-body p { color: var(--text-2); font-size: 15px; }
.sys-body .chips { margin-top: auto; padding-top: 6px; }

/* ---------- updates ---------- */
.updates { list-style: none; margin: 0 auto; padding: 0; max-width: 900px; display: grid; gap: 16px; }
.update { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 20px 22px; border-radius: var(--radius); background: var(--ink-800); border: 1px solid var(--line); }
.update.upcoming { border-color: rgba(92, 207, 174, .45); background: linear-gradient(90deg, rgba(26, 122, 101, .16), var(--ink-800) 40%); }
.update-tag { text-align: center; }
.update-tag b { display: block; font-size: 34px; line-height: 1.1; color: var(--gold-2); }
.update-tag > span { display: block; font-size: 13px; color: var(--text-3); }
.update-tag > span > span { display: inline; }
.update-tag .state { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink-950); background: var(--gold); }
.update.upcoming .update-tag .state { background: var(--jade); }
.update ul { margin: 0; padding-inline-start: 20px; color: var(--text-2); display: grid; gap: 4px; }
.update li::marker { color: var(--gold); }

/* ---------- status + CTA ---------- */
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 900px; margin: 0 auto; }
.status-card { padding: 16px; border-radius: var(--radius); background: var(--ink-800); border: 1px solid var(--line); border-inline-start: 3px solid var(--gold); }
.status-card > span { display: block; color: var(--text-3); font-size: 13.5px; }
.status-card b { display: block; font-size: 22px; color: var(--text); margin-top: 2px; }
.status-card b.online { color: #7bd88f; }
.status-card b.maintenance { color: var(--gold-2); }
.status-card b.offline { color: var(--red-text); }
.status-note { text-align: center; color: var(--text-3); font-size: 13.5px; margin-top: 14px; }
.cta-band { padding: 64px 0; text-align: center; background:
  radial-gradient(600px 220px at 50% 50%, rgba(200, 53, 43, .35), transparent 75%), var(--ink-950);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); color: var(--gold-2); margin-bottom: 8px; }
.cta-band p { color: var(--text-2); margin-bottom: 22px; }
.cta-band .hero-cta { margin: 0; }

/* ---------- footer ---------- */
.footer { padding: 40px 0 48px; color: var(--text-3); font-size: 14px; }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.footer-brand { display: flex; gap: 12px; align-items: center; color: var(--text-2); }
.footer-brand img { width: 64px; height: 64px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--gold-2); }
.footer small { display: block; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .class-grid-classic { grid-template-columns: repeat(3, 1fr); }
  .hero-side img { width: 160px; }
}
@media (max-width: 900px) {
  .class-grid-new { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .topbar-actions { margin-inline-start: auto; }
  .sys-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
/* Phones: classes become a horizontal swipe rail with scroll-snap. */
@media (max-width: 700px) {
  .class-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(78vw, 320px);
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    padding: 4px 20px 14px; margin-inline: -20px; scroll-padding-inline: 20px; scrollbar-width: thin;
  }
  .class-card { scroll-snap-align: start; }
  .swipe-hint { display: block !important; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .section { padding: 54px 0; }
  .sys-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats div:nth-child(3) { border-inline-start: 0; }
  .hero-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .update { grid-template-columns: 1fr; gap: 10px; }
  .update-tag { display: flex; align-items: baseline; gap: 10px; text-align: start; }
  .update-tag b { font-size: 26px; }
  .update-tag .state { margin: 0 0 0 auto; }
  .brand span { display: none; }
  .topbar .btn-play { --h: 38px; padding: 0 14px; font-size: 15px; }
}
/* Phone landscape: short viewport — compact hero so the play button stays above the fold. */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: 16px 0 32px; }
  .hero-inner { grid-template-columns: minmax(200px, 260px) 1fr; align-items: center; gap: 28px; }
  .hero-center { display: contents; }
  .hero-logo { grid-row: 1 / span 5; width: 100%; }
  .hero-center > :not(.hero-logo) { grid-column: 2; justify-self: start; text-align: start; }
  .hero-cta { justify-content: flex-start; }
  .hero h1 { font-size: 22px; }
  .hero-stats { margin-top: 20px; }
  .sys-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 36px 0; }
  .section-head { margin-bottom: 20px; }
  .section-head p { margin-top: 6px; }
  .topbar-inner { min-height: 52px; }
}
.swipe-hint { display: none; text-align: center; color: var(--text-3); font-size: 13.5px; margin-top: 6px; }
