/* =========================================================
   Template theme — dark / rust / industrial
   Swap the display font, colors and brand text to reuse.
   ========================================================= */

/* weight range stops the browser from faking bold on these single-weight fonts */
@font-face {
  font-family: "D3 Superstructurism";
  src: url("../fonts/D3Superstructurism.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Wasteblock";
  src: url("../fonts/wasteblock.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #0d0e0c;
  --panel: #171815;
  --panel-2: #20211d;
  --line: #3d3b33;
  --rust: #1f86c4;          /* accent (deep logo blue) */
  --rust-bright: #2aa4e6;   /* logo blue */
  --sand: #d7c9ad;
  --muted: #928c7e;
  --green: #f0a830;          /* status accent (amber) */
  --white: #eee9df;
  --max: 1180px;
  /* D3 has Latin only — Thai glyphs fall through to Kanit / Noto Sans Thai */
  --display: "D3 Superstructurism", "Kanit", Impact, sans-serif;
  --mono: Consolas, "Noto Sans Thai", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
body {
  margin: 0;
  color: var(--sand);
  background:
    linear-gradient(rgba(42,164,230,.035) 1px, transparent 1px),   /* faint blue scan lines (was white on #10110f, read as green) */
    #0e1114;
  background-size: 100% 4px;
  font-family: "Segoe UI", "Noto Sans Thai", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
/* vignette over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .2;
  background: radial-gradient(circle at center, transparent 45%, #000 125%);
}
img { display: block; max-width: 100%; }
a { color: var(--rust-bright); text-decoration: none; }
a:hover { color: #6cc4f2; }
button, input, select { font: inherit; }

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #222;
  transition: opacity .65s ease, filter .65s ease, transform .65s ease, visibility .65s ease;
}
#preloader .loader-mark {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  background: url("../img/logo.png") center / contain no-repeat;
  animation: pulse 1.2s ease-in-out infinite;
}
#preloader.is-leaving { opacity: 0; filter: blur(10px); transform: scale(1.035); visibility: hidden; }
body.loader-active { overflow: hidden; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.94); } }

/* ---------- Header ---------- */
.shell { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 72px;
  border-bottom: 1px solid rgba(215,201,173,.18);
  background: rgba(10,11,9,.92);
  backdrop-filter: blur(12px);
}
.nav-wrap { height: 100%; display: flex; align-items: center; gap: 30px; }
.brand {
  margin-right: auto;
  color: var(--white);
  font-family: var(--display);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
}
.brand:hover { color: var(--white); }
.brand em { color: var(--rust-bright); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a,
.nav-back {
  color: #bbb4a6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-links a:hover, .nav-links a.active, .nav-back:hover { color: var(--white); }
.nav-links a.active::before { content: "[ "; color: var(--rust); }
.nav-links a.active::after { content: " ]"; color: var(--rust); }
.nav-toggle { display: none; border: 0; background: none; color: var(--white); font-size: 28px; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid #3aaeea;
  border-radius: 2px;
  color: #f3faff;
  background: linear-gradient(#33aaea, #1b78b5);
  box-shadow: inset 0 1px rgba(255,255,255,.16), 0 5px 18px rgba(0,0,0,.35);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: .2s ease;
}
.btn:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.1); }
.btn-ghost { border-color: #777165; background: rgba(15,15,13,.7); color: var(--sand); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 800px;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111;
}
/* Background layer: replace with <video class="hero-video"> or an image */
.hero-video,
.hero-bg {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  object-fit: cover;
  filter: blur(3px) saturate(.72) contrast(1.08) brightness(.62);
  transform: scale(1.035);
  pointer-events: none;
}
.hero-bg {
  background: url("../img/hero.svg") center / cover no-repeat;
  animation: heroDrift 24s ease-in-out infinite alternate;
}
@keyframes heroDrift { from { transform: scale(1.035) translateX(-1%); } to { transform: scale(1.08) translateX(1%); } }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 47%, rgba(8,9,7,.08) 0 24%, rgba(8,9,7,.48) 73%, rgba(8,9,7,.82) 100%),
    linear-gradient(0deg, #10110f 0, transparent 32%, rgba(0,0,0,.14));
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .1;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, #fff 4px);
  mix-blend-mode: overlay;
}
.hero-content { position: relative; z-index: 2; display: flex; max-width: 960px; flex-direction: column; align-items: center; text-align: center; }
.eyebrow { color: var(--rust-bright); font: 800 11px/1.2 var(--mono); letter-spacing: .22em; text-transform: uppercase; }
.hero h1 {
  margin: 22px 0 16px;
  color: var(--white);
  font-family: var(--display);
  font-size: clamp(72px, 12vw, 150px);
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1;
  text-shadow: 0 10px 45px #000;
}
.hero-title { animation: heroSettle 1.15s .1s cubic-bezier(.2,.8,.2,1) both; }
.hero-main, .hero-sub { display: block; }
.hero-sub { margin-top: .15em; color: var(--rust-bright); font-size: .43em; letter-spacing: .12em; }
.hero-rule { display: flex; width: min(520px, 80%); align-items: center; gap: 15px; color: #9a9385; font: 700 9px var(--mono); letter-spacing: .14em; }
.hero-rule span { height: 1px; flex: 1; background: rgba(215,201,173,.3); }
@keyframes heroSettle { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.hero-lead { max-width: 610px; margin: 24px auto 28px; color: #c9c2b3; font-size: clamp(17px, 2vw, 20px); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-status { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.status-chip { padding: 10px 14px; border: 1px solid rgba(215,201,173,.2); background: rgba(10,10,9,.72); font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.status-chip i { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.scroll-cue { position: absolute; z-index: 3; left: 50%; bottom: 27px; display: grid; justify-items: center; gap: 7px; color: #777165; font: 700 8px var(--mono); letter-spacing: .16em; text-transform: uppercase; transform: translateX(-50%); }
.scroll-cue span { width: 1px; height: 28px; overflow: hidden; background: #4e4a41; }
.scroll-cue span::after { content: ""; display: block; width: 1px; height: 12px; background: var(--rust-bright); animation: scrollLine 1.8s ease-in-out infinite; }
@keyframes scrollLine { from { transform: translateY(-13px); } to { transform: translateY(29px); } }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid #37352f; background: #191a17; color: #aaa394; }
.ticker-track { display: flex; width: max-content; animation: ticker 35s linear infinite reverse; } /* reverse = scrolls left to right */
.ticker span { padding: 13px 30px; font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.ticker b { color: var(--rust-bright); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: 110px 0; border-bottom: 1px solid rgba(215,201,173,.12); }
.section-dark { background: #0b0d10; }
.section-kicker { margin-bottom: 8px; color: var(--rust-bright); font: 800 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.section-title { margin: 0 0 38px; color: var(--white); font-family: var(--display); font-size: clamp(34px, 4.3vw, 56px); font-weight: 700; line-height: .98; }
.section-title span { color: var(--rust); }
.section-intro { max-width: 690px; margin: -20px 0 42px; color: var(--muted); font-size: 18px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 65px; align-items: center; }
.image-frame { position: relative; padding: 10px; border: 1px solid #4c493e; background: #171714; box-shadow: 20px 22px 0 #090a08; }
.image-frame img { width: 100%; aspect-ratio: 4/3; object-fit: cover; filter: saturate(.72) contrast(1.08) sepia(.1); }
.image-frame::after { content: attr(data-label); position: absolute; right: 19px; bottom: 17px; padding: 5px 8px; color: #d5cebf; background: rgba(0,0,0,.72); font: 700 10px var(--mono); letter-spacing: .12em; }
.check-list { display: grid; gap: 15px; padding: 0; margin: 30px 0; list-style: none; }
.check-list li { padding-left: 28px; position: relative; color: #bbb4a7; }
.check-list li::before { content: "+"; position: absolute; left: 0; color: var(--rust-bright); font: 900 18px var(--mono); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service-card { display: block; min-height: 250px; padding: 30px; border: 1px solid #3b3932; background: linear-gradient(135deg,#1c1d19,#131411); transition: .25s; }
.service-card:hover { border-color: #2f6f99; transform: translateY(-5px); }
.service-no { color: var(--rust); font: 700 12px var(--mono); }
.service-card h3 { margin: 48px 0 12px; color: var(--white); font-size: 22px; text-transform: uppercase; }
.service-card p { margin: 0; color: var(--muted); }

/* Downloads */
.downloads-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; gap: 20px; }
.download-card { position: relative; min-height: 410px; overflow: hidden; border: 1px solid #514d42; background: #171815; color: var(--white); }
.download-card:hover { color: var(--white); }
.download-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.68) contrast(1.15); transition: transform .6s, filter .6s; }
.download-card::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(0deg,#0a0b09 5%,rgba(10,11,9,.08) 75%); }
.download-card:hover > img { transform: scale(1.035); filter: saturate(.9) contrast(1.1); }
.download-card-content { position: absolute; z-index: 2; inset: auto 0 0; padding: 32px; }
.download-year { font-family: var(--display); font-size: clamp(56px, 6.5vw, 80px); font-weight: 700; line-height: 1; }
.download-meta { display: flex; justify-content: space-between; gap: 20px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.24); color: #c9c2b4; font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.download-meta strong { color: var(--rust-bright); white-space: nowrap; }

/* Statistics */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid #403e36; }
.stat { padding: 28px; border-right: 1px solid #403e36; background: #171815; }
.stat:last-child { border: 0; }
.stat-value { display: block; color: var(--white); font-family: Impact, "Arial Narrow", sans-serif; font-size: clamp(38px,5vw,58px); letter-spacing: .025em; line-height: 1; }
.stat-label { display: block; margin-top: 10px; color: var(--muted); font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.stat-monthly { display: block; margin-top: 7px; color: var(--green); font: 700 12px var(--mono); letter-spacing: .04em; }
.chart-panel { margin-top: 18px; padding: 20px; border: 1px solid #36342d; background: #121310; }
#playerChart { width: 100%; height: 280px; display: block; }

/* Server list */
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.table-tools label { color: var(--muted); font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
select, input, textarea { border: 1px solid #4c493f; border-radius: 2px; color: var(--white); background: #171815; outline: none; }
select:focus, input:focus { border-color: var(--rust); }
select { margin: 0 8px; padding: 9px 30px 9px 10px; }
.server-table-wrap { overflow-x: auto; border: 1px solid #403e36; }
.server-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.server-table th { padding: 14px 16px; color: var(--muted); background: #11120f; font: 700 10px var(--mono); letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.server-table td { padding: 15px 16px; border-top: 1px solid #302f29; color: #c6bfae; background: #181916; font-size: 14px; }
.server-table tr:hover td { background: #20211d; }
.server-name { color: var(--white); font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 6px; color: #f6bd4f; font: 800 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* Community */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; }
.video-frame { position: relative; padding-top: 56.25%; border: 1px solid #47443b; background: #090a08 url("../img/about.jpg") center / cover; }
.video-frame iframe, .video-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { display: grid; place-items: center; background: rgba(9,10,8,.55); color: var(--white); font: 700 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.video-placeholder b { display: grid; place-items: center; width: 68px; height: 48px; margin: 0 auto 14px; border-radius: 10px; background: var(--rust); font-size: 20px; }
.social-list { display: grid; gap: 12px; }
.social-link { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 16px 20px; border: 1px solid #3c3a33; background: #171815; color: var(--white); transition: .2s; }
.social-link:hover { border-color: var(--rust); color: var(--white); transform: translateX(5px); }
.social-link small { display: block; color: var(--muted); font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.social-link strong { color: var(--rust-bright); }
/* Community: server status boxes, orange-gold (owner's choice 2026-11-05) */
.live-boxes { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.live-box { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 120px; padding: 22px 24px; border: 1px solid rgba(240,168,48,.55); background: linear-gradient(135deg, rgba(240,168,48,.2), rgba(240,168,48,.06) 55%, rgba(16,17,15,.92)); box-shadow: inset 0 1px rgba(246,189,79,.18); }
.live-box small { color: #f6bd4f; font: 700 12px var(--mono); letter-spacing: .08em; }
.live-box b { display: flex; align-items: center; gap: 12px; color: var(--white); font: 400 40px/1 Impact, "Arial Narrow", sans-serif; letter-spacing: .02em; }
.live-box b em { color: #f6bd4f; font: 700 18px "Kanit", sans-serif; font-style: normal; }
.live-box b i { width: 12px; height: 12px; border-radius: 50%; background: #5a564c; flex: none; }
.live-box[data-state="online"] b i { background: var(--green); box-shadow: 0 0 12px var(--green); }
.live-box[data-state="offline"] b i { background: #8a3f22; }
.live-box[data-state] b span { font: 600 30px/1.1 "Kanit", sans-serif; }
@media (max-width: 640px) { .live-box { min-height: 96px; padding: 18px; } .live-box b { font-size: 34px; } .live-box[data-state] b span { font-size: 26px; } }

/* Footer */
.site-footer { padding: 34px 0; border-top: 1px solid #35332d; background: #090a08; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 25px; color: #716d63; font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.footer-row nav { display: flex; gap: 18px; }
.footer-row a { color: #aaa395; }

/* ---------- Subpages ---------- */
.subpage { min-height: 100vh; padding: 135px 0 80px; background: radial-gradient(circle at 75% 20%,rgba(42,164,230,.11) 0,transparent 38%),#0e1114; }
.subpage-center { display: grid; place-items: center; padding-block: 110px 70px; }

/* Archive */
.archive-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 30px; align-items: start; }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.gallery a { overflow: hidden; border: 1px solid #47443b; background: #090a08; }
.gallery a:first-child { grid-column: 1/-1; }
.gallery img { width: 100%; height: 160px; object-fit: cover; filter: saturate(.75); transition: .3s; }
.gallery a:first-child img { height: 510px; }
.gallery a:hover img { transform: scale(1.025); filter: saturate(1); }
.info-panel { position: sticky; top: 100px; padding: 28px; border: 1px solid #47443b; background: #181916; }
.info-panel h1 { margin: 0 0 8px; color: var(--white); font-size: 25px; font-weight: 400; }
.info-panel .version { color: var(--rust-bright); font: 800 11px var(--mono); letter-spacing: .15em; text-transform: uppercase; }
.facts { padding: 0; margin: 28px 0; border-block: 1px solid #3d3b33; list-style: none; }
.facts li { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid #302f29; color: #bdb6a7; font-size: 14px; }
.facts li:last-child { border: 0; }
.facts strong { color: var(--muted); font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.info-panel .btn { width: 100%; margin-bottom: 10px; }

/* Docs (API / Terms) */
.doc-page { max-width: 900px; }
.doc-card { padding: clamp(25px,5vw,60px); border: 1px solid #454238; background: #181916; }
.doc-card h1 { margin: 14px 0 28px; color: var(--white); font-family: var(--display); font-size: clamp(40px,6.5vw,68px); font-weight: 700; line-height: .95; }
.doc-card h2 { margin-top: 38px; color: var(--rust-bright); font-size: 18px; text-transform: uppercase; }
.doc-card li { margin-bottom: 6px; }
.code-box { overflow-x: auto; padding: 17px; border-left: 3px solid var(--rust); background: #0b0c0a; color: #c8c1b2; font: 13px/1.7 var(--mono); }
.code-box pre { margin: 0; }
.endpoint { margin: 18px 0; padding: 24px; border: 1px solid #3e3c34; background: #141512; }
.endpoint h3 { margin-top: 0; color: var(--white); font: 700 15px var(--mono); }

/* Forms */
.form-card { width: min(620px,calc(100% - 32px)); padding: clamp(25px,5vw,50px); border: 1px solid #4a473d; background: #171815; box-shadow: 22px 22px 0 #090a08; }
.form-card h1 { margin: 10px 0 18px; color: var(--white); font-family: var(--display); font-size: clamp(40px,7.5vw,66px); font-weight: 700; line-height: .95; }
.form-card p { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1/-1; }
.field label { color: var(--muted); font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.field input { width: 100%; padding: 13px 14px; }
.form-status { display: none; margin-top: 18px; padding: 14px; border: 1px solid #4b493f; background: #10110f; font: 700 12px var(--mono); letter-spacing: .06em; }
.form-status.show { display: block; }
.form-status.ok { border-color: #7a5a1c; color: #f6bd4f; }
.form-status.err { border-color: #8a3f22; color: var(--rust-bright); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .site-header { height: 64px; }
  .nav-toggle { display: block; }
  .nav-links { position: fixed; inset: 64px 0 auto; display: none; padding: 25px 20px; border-bottom: 1px solid #464339; background: #0d0e0c; flex-direction: column; align-items: flex-start; }
  .nav-links.open { display: flex; }
  .subpage-nav { position: static; display: flex; padding: 0; border: 0; background: none; flex-direction: row; gap: 16px; }
  .header-cta { display: none; }
  .hero { min-height: 680px; }
  .hero-status { display: none; }
  .about-grid, .archive-layout, .contact-grid { grid-template-columns: 1fr; }
  .info-panel { position: static; }
  .services-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid #403e36; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 28px, var(--max)); }
  .section { padding: 78px 0; }
  .hero { min-height: 720px; }
  .hero::before { background: radial-gradient(circle at 50% 43%, rgba(8,9,7,.06), rgba(8,9,7,.7) 78%), linear-gradient(0deg, rgba(8,9,7,.88), rgba(8,9,7,.1) 75%); }
  .hero-content { padding-top: 50px; }
  .hero h1 { font-size: clamp(54px, 18vw, 76px); }
  .hero-rule { width: 90%; gap: 9px; }
  .hero-lead { font-size: 16px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-actions .btn:first-child { grid-column: 1/-1; }
  .hero-actions .btn { min-height: 46px; padding-inline: 10px; font-size: 10px; }
  .scroll-cue { display: none; }
  .downloads-grid { grid-template-columns: 1fr; }
  .download-card { min-height: 340px; width: min(100%, 360px); justify-self: center; }
  .download-card-content { padding: 22px; }
  .download-year { font-size: 54px; }
  .download-meta { align-items: flex-end; font-size: 9px; }
  .section-title { font-size: clamp(30px, 10vw, 42px); }
  .section-intro { font-size: 16px; }
  .table-tools, .footer-row { align-items: flex-start; flex-direction: column; }
  .subpage-nav a:not(:first-child) { display: none; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery a:first-child img { height: 260px; }
  .gallery img { height: 130px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- v2: live server browser ---------- */
.tools-left, .tools-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.server-search { width: 260px; padding: 11px 14px; font-size: 14px; }
.server-search::placeholder { color: #6f6a5f; }
.live-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: #777165; }
.live-status[data-state="live"] { color: #f6bd4f; }
.live-status[data-state="live"] i { background: var(--green); box-shadow: 0 0 10px var(--green); animation: livePulse 2s ease-in-out infinite; }
.live-status[data-state="loading"] i { background: var(--rust-bright); }
.live-status[data-state="offline"] { color: var(--rust-bright); }
.live-status[data-state="offline"] i { background: var(--rust); }
@keyframes livePulse { 50% { opacity: .35; } }
.btn-icon { width: 48px; padding: 0; font-size: 18px; }

.sort-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort-btn:hover, .sort-btn.is-active { color: var(--white); }
.sort-btn::after { content: " ↕"; color: #5a564c; }
.sort-btn[data-dir="asc"]::after { content: " ↑"; color: var(--rust-bright); }
.sort-btn[data-dir="desc"]::after { content: " ↓"; color: var(--rust-bright); }

.copy-ip { padding: 4px 8px; margin: -4px -8px; border: 1px dashed transparent; border-radius: 2px; background: none; color: #c6bfae; font: 13px var(--mono); cursor: copy; transition: .15s; }
.copy-ip:hover { border-color: #5a564c; color: var(--white); background: #11120f; }
.copy-ip:active { border-color: var(--rust); }

.players { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.players-bar { width: 54px; height: 4px; overflow: hidden; background: #2c2b26; }
.players-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--rust), var(--rust-bright)); }
.tag { margin-left: 6px; padding: 2px 6px; border: 1px solid #2f5670; color: var(--rust-bright); font: 800 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; vertical-align: 2px; }
.table-empty { padding: 34px 16px !important; color: var(--muted) !important; text-align: center; }
.table-foot { display: flex; justify-content: space-between; gap: 18px; margin-top: 12px; color: #716d63; font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.table-foot b { color: var(--sand); text-transform: none; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; padding: 12px 18px; border: 1px solid #7a5a1c; background: #10110f; color: #f6bd4f; font: 700 12px var(--mono); letter-spacing: .06em; opacity: 0; transform: translate(-50%, 10px); transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .tools-left, .tools-right { width: 100%; }
  .server-search { flex: 1; width: auto; }
  .table-foot { flex-direction: column; }
}

/* ---------- Thai typography ----------
   Thai has no capitals, needs room for vowels/tone marks above and below,
   and reads badly with wide tracking or tiny sizes. */
html[lang="th"] .section-title,
html[lang="th"] .doc-card h1,
html[lang="th"] .form-card h1 { line-height: 1.18; letter-spacing: 0; }
html[lang="th"] .section-title { font-size: clamp(32px, 4vw, 52px); }
html[lang="th"] .nav-links a,
html[lang="th"] .nav-back,
html[lang="th"] .btn { font-size: 14px; letter-spacing: .02em; }
html[lang="th"] .eyebrow,
html[lang="th"] .section-kicker,
html[lang="th"] .info-panel .version { font-size: 13px; letter-spacing: .04em; }
html[lang="th"] .status-chip,
html[lang="th"] .ticker span,
html[lang="th"] .download-meta,
html[lang="th"] .stat-label,
html[lang="th"] .stat-monthly,
html[lang="th"] .table-tools label,
html[lang="th"] .server-table th,
html[lang="th"] .badge,
html[lang="th"] .tag,
html[lang="th"] .live-status,
html[lang="th"] .video-placeholder,
html[lang="th"] .social-link small,
html[lang="th"] .footer-row,
html[lang="th"] .facts strong,
html[lang="th"] .field label,
html[lang="th"] .table-foot,
html[lang="th"] .image-frame::after,
html[lang="th"] .form-status,
html[lang="th"] .toast { font-size: 12.5px; letter-spacing: .02em; }
html[lang="th"] .scroll-cue { font-size: 11px; letter-spacing: .04em; }
html[lang="th"] .hero-rule { font-size: 11px; letter-spacing: .06em; }
html[lang="th"] .service-card h3 { font-size: 22px; }
html[lang="th"] .hero-lead { line-height: 1.75; }
html[lang="th"] body { line-height: 1.75; }

/* ---------- Single-server layout ---------- */
.downloads-grid.single { grid-template-columns: minmax(0, 640px); }
.downloads-grid.single .download-card { min-height: 380px; }
.download-name { font-family: var(--display); font-size: clamp(34px, 4.6vw, 54px); font-weight: 700; line-height: 1.05; }
.download-name em { color: var(--rust-bright); font-style: normal; }

.server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.server-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; border: 1px solid #3b3932; background: linear-gradient(135deg, #1c1d19, #131411); transition: .25s; }
.server-card.is-online:hover { border-color: #2f6f99; transform: translateY(-4px); }
.server-card-top { display: flex; align-items: center; justify-content: space-between; }
.server-rate { color: var(--rust-bright); font: 400 46px/1 Impact, "Arial Narrow", sans-serif; letter-spacing: .02em; }
.server-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #5a4418; color: #f6bd4f; font: 700 12.5px var(--mono); }
.server-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: livePulse 2s ease-in-out infinite; }
.server-card.is-offline .server-state,
.server-card.is-unknown .server-state { border-color: #3d3b33; color: #8f8a7e; }
.server-card.is-offline .server-state i,
.server-card.is-unknown .server-state i { background: #5a564c; box-shadow: none; animation: none; }
.server-card.is-offline,
.server-card.is-unknown { opacity: .72; }
.server-card h3 { margin: 6px 0 0; color: var(--white); font-size: 19px; line-height: 1.35; }
.server-card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.server-players { display: flex; align-items: baseline; justify-content: space-between; color: var(--muted); font: 700 12.5px var(--mono); }
.server-players b { color: var(--white); font: 400 34px/1 Impact, "Arial Narrow", sans-serif; letter-spacing: .02em; }
.server-players small { color: var(--muted); font-size: 18px; }
.server-card .players-bar { width: 100%; height: 6px; }
.server-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 4px; }
.server-actions .copy-ip { min-width: 0; margin: 0; padding: 10px 12px; overflow: hidden; border-color: #3b3932; background: #10110f; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.server-actions .btn { flex: none; min-height: 42px; padding: 0 18px; white-space: nowrap; }
.server-actions .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: grayscale(1); }
.server-join { padding: 10px 12px; border: 1px dashed #2f6f99; background: #10110f; color: #b8c4cc; font-size: 14px; text-align: center; }
.server-join b { color: #9fd3f2; font-family: var(--mono); letter-spacing: .04em; }
.server-tools { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: -14px 0 22px; }

.install-steps { margin-top: 70px; }
.install-steps ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.install-steps li { position: relative; padding: 24px; border: 1px solid #3b3932; background: #171815; color: var(--muted); counter-increment: step; }
.install-steps li::before { content: "0" counter(step); display: block; margin-bottom: 14px; color: var(--rust); font: 700 13px var(--mono); }
.install-steps li b { display: block; margin-bottom: 6px; color: var(--white); font-size: 18px; }

@media (max-width: 900px) {
  .server-grid, .install-steps ol { grid-template-columns: 1fr; }
}

/* Warning variant of a feature card */
.service-card.is-warning { border-color: #1f5c85; background: linear-gradient(135deg, #0f2230, #121416); }
.service-card.is-warning:hover { border-color: var(--rust-bright); }
.service-card.is-warning .service-no { color: var(--rust-bright); }
.service-card.is-warning h3 { color: #6cc4f2; }
.service-card.is-warning p { color: #b8c4cc; }

/* Promo card: full-width "latest updates" banner in the features grid */
.service-card.is-update { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center; min-height: 0; border-color: #2f6f99; background: linear-gradient(120deg, #10232f 0%, #121b21 55%, #131411 100%); }
.service-card.is-update:hover { border-color: var(--green); }
.service-card.is-update .service-no { color: #9fd3f2; }
.service-card.is-update h3 { margin-top: 22px; font-size: 26px; }
.service-card.is-update p { color: #b8c4cc; }
.update-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; margin: 0; list-style: none; }
.update-tags li { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid #2f6f99; background: rgba(16,17,15,.7); color: var(--white); font-weight: 700; }
.update-tags b { padding: 2px 6px; background: var(--green); color: #10110f; font: 800 10px var(--mono); letter-spacing: .08em; }
.update-tags li.soon { color: var(--muted); border-style: dashed; }
.update-tags li.soon b { background: #5a564c; color: var(--white); }
@media (max-width: 900px) {
  .service-card.is-update { grid-template-columns: 1fr; }
}

/* ---------- Play section: download (left) + server status (right) ---------- */
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.play-col { display: flex; flex-direction: column; min-width: 0; }
.play-col-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-bottom: 14px; }
.play-col-head h3 { margin: 0; color: var(--white); font-size: 20px; }
.play-col-head .server-tools { margin: 0; }
.play-col .download-card { flex: 1; min-height: 420px; }
.download-note { margin: 10px 0 0; color: #d9d2c4; font-size: 15px; }
.play-col .table-foot { margin-top: 12px; }

.server-grid.compact { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.server-card-top { gap: 16px; }
.server-title { flex: 1; min-width: 0; }
.server-title h3 { margin: 0; color: var(--white); font-size: 17px; line-height: 1.35; }
.server-title p { display: -webkit-box; margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 13.5px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.compact .server-card { gap: 10px; padding: 18px 20px; }
.compact .server-rate { font-size: 40px; }
.compact .server-players b { font-size: 26px; }
.compact .server-players small { font-size: 15px; }
.compact .server-actions { flex-direction: row; align-items: center; }
.compact .server-actions .copy-ip { flex: 1; }
.compact .server-state { flex: none; }

@media (max-width: 900px) {
  .play-grid { grid-template-columns: 1fr; }
  .play-col .download-card { min-height: 340px; }
}
@media (max-width: 480px) {
  .compact .server-actions { flex-direction: column; align-items: stretch; }
}

@media (max-width: 640px) {
  .play-col-head { flex-wrap: wrap; }
  .play-col-head h3 { width: 100%; white-space: nowrap; }
  .play-col-head .server-tools { width: 100%; justify-content: space-between; }
}

/* ---------- "Why come back" highlight: image + latest updates ---------- */
.comeback { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); margin-bottom: 16px; overflow: hidden; border: 1px solid #2f6f99; background: linear-gradient(120deg, #10232f 0%, #121b21 60%, #131411 100%); }
.comeback-media { position: relative; min-height: 340px; }
.comeback-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.75) contrast(1.08) sepia(.08); }
.comeback-media::after { content: attr(data-label); position: absolute; left: 16px; bottom: 16px; padding: 5px 8px; background: rgba(0,0,0,.72); color: #d5cebf; font: 700 10px var(--mono); letter-spacing: .12em; }
.comeback-body { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 34px 36px; }
.comeback-label { color: #9fd3f2; font: 800 13px var(--mono); letter-spacing: .04em; }
.comeback-body h3 { margin: 0; color: var(--white); font-size: 28px; line-height: 1.3; }
.comeback-body p { margin: 0; color: #b8c4cc; font-size: 16px; }
.comeback-body .update-tags { margin-top: 6px; }
@media (max-width: 900px) {
  .comeback { grid-template-columns: 1fr; }
  .comeback-media { min-height: 220px; }
  .comeback-body { padding: 26px 22px; }
}
.update-tags li { white-space: nowrap; }
@media (max-width: 480px) {
  .update-tags { gap: 8px; }
  .update-tags li { gap: 8px; padding: 12px; font-size: 15px; }
}

/* Header buttons: download / login / shop */
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .btn { min-height: 42px; padding: 0 16px; }
.nav-wrap { gap: 24px; }
.nav-links .nav-mobile-only { display: none; }
@media (max-width: 1100px) {
  .nav-links { gap: 18px; }
}
@media (max-width: 900px) {
  .header-actions { display: none; }
  .nav-links .nav-mobile-only { display: block; }
}

/* ---------- Shop (preview) ---------- */
.header-actions .btn.is-current { box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 5px 18px rgba(0,0,0,.35); }
.shop-notice { display: flex; align-items: center; gap: 16px; margin: -8px 0 28px; padding: 16px 20px; border: 1px solid #2f6f99; background: linear-gradient(120deg, #10232f, #131719); }
.shop-notice p { flex: 1; margin: 0; color: #b8c4cc; }
.shop-notice p b { display: block; color: #9fd3f2; }
.shop-lock { font-size: 26px; line-height: 1; }
.shop-notice .btn { flex: none; min-height: 42px; }

.shop-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.shop-tab { padding: 9px 14px; border: 1px solid #3b3932; border-radius: 2px; background: #171815; color: #bbb4a6; font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s; }
.shop-tab span { margin-left: 4px; color: #6f6a5f; font: 700 12px var(--mono); }
.shop-tab:hover { border-color: #2f6f99; color: var(--white); }
.shop-tab.is-active { border-color: var(--rust-bright); background: #10232f; color: var(--white); }
.shop-tab.is-active span { color: var(--rust-bright); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.item-card { display: flex; flex-direction: column; border: 1px solid #3b3932; background: linear-gradient(160deg, #1c1d19, #131411); transition: .2s; }
.item-card:hover { border-color: #2f6f99; transform: translateY(-3px); }
.item-icon { position: relative; display: grid; place-items: center; height: 150px; border-bottom: 1px solid #2c2b26; background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 100% 12px,
    radial-gradient(circle at 50% 55%, #1e2a31 0, #151612 70%); color: var(--sand); }
.item-icon .icon { width: 76px; height: 76px; fill: currentColor; stroke: currentColor; stroke-width: 0; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.cat-weapon .item-icon { color: #9fd3f2; }
.cat-pack .item-icon { color: var(--green); }
.cat-ammo .item-icon { color: #e8c77a; }
.cat-resource .item-icon { color: #c9b99a; }
.cat-armor .item-icon { color: #b9c4cc; }
.cat-item .item-icon { color: #d7c9ad; }
.item-badge { position: absolute; top: 10px; left: 10px; padding: 3px 8px; background: var(--green); color: #10110f; font-size: 12px; font-weight: 800; }
.item-qty { position: absolute; right: 10px; bottom: 8px; color: #bbb4a6; font: 700 12px var(--mono); }
.item-body { flex: 1; padding: 16px 18px 6px; }
.item-body h3 { margin: 0 0 4px; color: var(--white); font-size: 18px; }
.item-body p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 18px; }
.item-price { color: var(--white); font: 400 28px/1 Impact, "Arial Narrow", sans-serif; letter-spacing: .02em; }
.btn-locked { min-height: 38px; padding: 0 12px; white-space: nowrap; border-color: #4c493f; background: #1d1e1a; color: #8f8a7e; box-shadow: none; font-size: 13px; cursor: not-allowed; }
.btn-locked:hover { transform: none; filter: none; color: #bbb4a6; }

@media (max-width: 640px) {
  .shop-notice { flex-wrap: wrap; }
  .shop-notice .btn { width: 100%; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item-icon { height: 110px; }
  .item-icon .icon { width: 56px; height: 56px; }
  .item-body { padding: 12px 12px 4px; }
  .item-body h3 { font-size: 15px; }
  .item-body p { font-size: 12.5px; }
  .item-foot { flex-direction: column; align-items: stretch; padding: 10px 12px 12px; }
  .item-price { font-size: 24px; }
}

@media (max-width: 640px) {
  .brand { white-space: nowrap; }
  .subpage-nav a { white-space: nowrap; }
}
@media (max-width: 400px) {
  .brand { font-size: 17px; }
}

/* ---------- Commands page ---------- */
.cmd-tools { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.cmd-tools .server-search { width: min(420px, 100%); }
.cmd-tools .shop-tabs { margin: 0; }
.cmd-group { margin-bottom: 18px; border: 1px solid #3b3932; background: #161714; }
.cmd-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #2c2b26; background: #11120f; }
.cmd-group-head h2 { margin: 0; color: var(--white); font-size: 19px; }
.cmd-where { color: var(--muted); font: 700 12.5px var(--mono); }
.cmd-row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 12px 20px; border-top: 1px solid #262621; }
.cmd-row:first-of-type { border-top: 0; }
.cmd-row:hover { background: #1b1c18; }
.cmd-code { color: var(--rust-bright); font: 700 15px var(--mono); overflow-wrap: anywhere; }
.cmd-arg { color: #c9b99a; font-weight: 400; }
.cmd-desc { margin: 0; color: #c6bfae; font-size: 15px; }
.cmd-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid #3d3b33; color: var(--muted); font-size: 12px; font-weight: 700; vertical-align: 1px; }
.cmd-tag.is-vip { border-color: #5a4418; color: var(--green); }
.cmd-copy { width: 38px; height: 38px; border: 1px solid #3b3932; border-radius: 2px; background: #10110f; color: var(--muted); font-size: 18px; cursor: copy; transition: .15s; }
.cmd-copy:hover { border-color: var(--rust-bright); color: var(--white); }
.cmd-legend { margin-top: 18px; color: var(--muted); font-size: 14px; }
.cmd-legend code { color: var(--rust-bright); font-family: var(--mono); }

@media (max-width: 640px) {
  .cmd-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; }
  .cmd-code { grid-column: 1; }
  .cmd-desc { grid-column: 1; font-size: 14px; }
  .cmd-copy { grid-column: 2; grid-row: 1 / span 2; }
  .cmd-group-head { padding: 12px 14px; }
}

/* ---------- Login, points, top-up, buying, back office (2026-11-04) ----------
   Colours: only the site palette (blue #2AA4E6/#1F86C4, amber #F0A830/#F6BD4F, dark panels, cream text). */
[hidden] { display: none !important; } /* .shop-notice / .topup-box set display, which would beat the hidden attribute */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field select, .field textarea { width: 100%; margin: 0; padding: 12px 14px; }
.field textarea { border: 1px solid #4c493f; border-radius: 2px; color: var(--white); background: #171815; font: 13px/1.6 var(--mono); resize: vertical; }
.field textarea:focus { border-color: var(--rust); outline: none; }
.item-price small { font: 700 12px var(--mono); color: var(--muted); letter-spacing: .04em; }
.btn-buy { min-height: 38px; padding: 0 18px; }

/* status pills */
.pill { display: inline-block; padding: 3px 9px; border: 1px solid #3b3932; border-radius: 2px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.is-ok { border-color: #2f6f99; color: var(--rust-bright); background: #10232f; }
.pill.is-wait { border-color: #7a5a1c; color: #f6bd4f; background: #241c0f; }
.pill.is-bad { border-color: #8a3f22; color: #f6bd4f; background: #1f1410; }
.pill.is-off { color: var(--muted); }

/* login */
.auth-card h1 { margin-bottom: 10px; }
.auth-submit { width: 100%; margin-top: 18px; }
.auth-card .form-status { line-height: 1.7; overflow-wrap: anywhere; }
.auth-card input:disabled, .auth-submit:disabled { opacity: .45; cursor: not-allowed; }
.auth-submit:disabled:hover { transform: none; filter: none; }
.auth-note { margin: 18px 0 0; font-size: 14px; line-height: 1.7; }
.auth-note a { color: var(--rust-bright); white-space: nowrap; }

/* account */
.wallet-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; padding: 26px 28px; border: 1px solid #2f6f99; background: linear-gradient(120deg, #10232f, #151612 70%); }
.wallet-main small { color: var(--muted); font-size: 14px; }
.wallet-main strong { display: block; margin: 4px 0 8px; color: var(--white); font: 400 54px/1 Impact, "Arial Narrow", sans-serif; letter-spacing: .02em; }
.wallet-main strong span { color: var(--rust-bright); font: 700 16px "Kanit", sans-serif; }
.wallet-main p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.wallet-main code { color: var(--sand); font-family: var(--mono); }
.wallet-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.account-box { border: 1px solid #3b3932; background: #171815; }
.account-box h2 { margin: 0; padding: 16px 20px; border-bottom: 1px solid #2c2b26; color: var(--white); font: 600 20px "Kanit", sans-serif; }
.hist-row { display: flex; justify-content: space-between; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #262621; }
.hist-row:last-child { border-bottom: 0; }
.hist-row b { display: block; color: var(--white); font-size: 15px; }
.hist-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.hist-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; color: var(--sand); font: 700 13px var(--mono); text-align: right; }
.hist .table-empty a { color: var(--rust-bright); }

/* top-up */
.shop-notice.is-promo { border-color: #7a5a1c; }
.topup-box { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 22px; align-items: start; }
.topup-form { padding: 26px; border: 1px solid #3b3932; background: #171815; }
.topup-form h2 { margin: 0 0 18px; color: var(--white); font: 600 22px "Kanit", sans-serif; }
.topup-form form > .btn { width: 100%; margin-top: 16px; }
.topup-off { margin: 0; color: var(--muted); }
.topup-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.topup-steps li { position: relative; margin-bottom: 10px; padding: 16px 18px 16px 62px; border: 1px solid #2c2b26; background: #131411; color: var(--muted); font-size: 14px; counter-increment: s; }
.topup-steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 18px; top: 15px; color: var(--rust-bright); font: 400 24px/1 Impact, sans-serif; }
.topup-steps li b { display: block; color: var(--white); font-size: 15px; }
.bank-card { display: grid; gap: 10px; margin-bottom: 18px; }
.bank-card > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid #2f6f99; background: #10232f; }
.bank-card small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.bank-card b { color: var(--white); font: 700 20px var(--mono); letter-spacing: .04em; overflow-wrap: anywhere; }
.bank-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.bank-card p b { font: 700 14px "Noto Sans Thai", sans-serif; letter-spacing: 0; }
.copy-btn { margin-left: auto; padding: 6px 12px; border: 1px solid #3b3932; border-radius: 2px; background: #10110f; color: var(--sand); font-size: 13px; font-weight: 700; cursor: copy; }
.copy-btn:hover { border-color: var(--rust-bright); color: var(--white); }
.slip-drop { display: grid; place-items: center; min-height: 160px; padding: 14px; border: 1px dashed #4c493f; background: #11120f; color: var(--muted); font: 400 14px "Noto Sans Thai", sans-serif !important; letter-spacing: 0 !important; text-transform: none !important; text-align: center; cursor: pointer; }
.slip-drop:hover { border-color: var(--rust-bright); }
.slip-drop img { max-width: 100%; max-height: 320px; object-fit: contain; }

/* buy box */
.buy-dialog { width: min(440px, calc(100% - 24px)); padding: 0; border: 1px solid #2f6f99; color: var(--sand); background: #171815; box-shadow: 14px 14px 0 #090a08; }
.buy-dialog::backdrop { background: rgba(9, 10, 8, .78); }
.buy-box { padding: 22px; }
.buy-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.buy-head .item-icon { flex: none; width: 74px; height: 74px; border: 1px solid #2c2b26; }
.buy-head .item-icon .icon { width: 46px; height: 46px; }
.buy-head small { color: var(--muted); font-size: 13px; }
.buy-head h2 { margin: 2px 0; color: var(--white); font: 600 22px/1.2 "Kanit", sans-serif; }
.buy-head p { margin: 0; color: var(--muted); font-size: 14px; }
.buy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #2c2b26; }
.buy-row-wrap { flex-wrap: wrap; }
.buy-label { color: var(--white); font-weight: 700; }
.qty-step { display: flex; align-items: center; gap: 4px; }
.qty-step button { width: 38px; height: 38px; border: 1px solid #3b3932; border-radius: 2px; background: #10110f; color: var(--white); font-size: 20px; cursor: pointer; }
.qty-step button:disabled { opacity: .35; cursor: not-allowed; }
.qty-step b { min-width: 40px; color: var(--white); font: 400 24px Impact, sans-serif; text-align: center; }
.server-pick { display: flex; gap: 6px; }
.server-pick button { min-width: 54px; height: 38px; border: 1px solid #3b3932; border-radius: 2px; background: #10110f; color: var(--sand); font: 400 18px Impact, sans-serif; cursor: pointer; }
.server-pick button.is-active { border-color: var(--rust-bright); background: #10232f; color: var(--white); }
.buy-sum { margin: 6px 0 0; padding: 12px 0 0; border-top: 1px solid #2c2b26; list-style: none; }
.buy-sum li { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.buy-sum b { color: var(--white); }
.buy-sum li.is-short b { color: #f6bd4f; }
.buy-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.buy-actions { display: flex; gap: 10px; margin-top: 16px; }
.buy-actions .btn { flex: 1; min-height: 44px; }
.buy-actions .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* back office */
.admin-tabs { margin-top: -14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-tile { padding: 18px; border: 1px solid #3b3932; background: #171815; }
.stat-tile small { display: block; color: var(--muted); font-size: 13px; }
.stat-tile b { display: block; margin: 6px 0 4px; color: var(--white); font: 400 32px/1 Impact, sans-serif; }
.stat-tile span { color: var(--muted); font-size: 12.5px; }
.adm-card { margin-bottom: 18px; padding: 20px; border: 1px solid #3b3932; background: #171815; }
.adm-card h2 { margin: 0 0 14px; color: var(--white); font: 600 19px "Kanit", sans-serif; }
.adm-hint { margin: -6px 0 14px; color: var(--muted); font-size: 13.5px; }
.adm-checks { margin: 0; padding: 0; list-style: none; }
.adm-checks li { padding: 7px 0; border-bottom: 1px solid #262621; font-size: 14px; }
.adm-checks li.is-ok { color: var(--sand); }
.adm-checks li.is-bad { color: #f6bd4f; }
.adm-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 14px; align-items: end; }
.adm-form .field-wide, .adm-form .form-status, .adm-form > .btn, .adm-acts-row { grid-column: 1 / -1; }
.adm-form > .btn { justify-self: start; }
.adm-settings > .btn { margin-top: 6px; }
.adm-check { display: flex !important; align-items: center; gap: 6px; text-transform: none !important; letter-spacing: 0 !important; font: 400 13px "Noto Sans Thai", sans-serif !important; }
.adm-check input { width: auto; }
.adm-acts-row { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.adm-filter select { margin: 0; }
.adm-filter input { flex: 1; min-width: 180px; padding: 10px 12px; }
.adm-filter .btn { min-height: 42px; }
.adm-table-wrap { overflow-x: auto; border: 1px solid #3b3932; }
.adm-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 13.5px; }
.adm-table th { padding: 10px 12px; color: var(--muted); background: #11120f; font-size: 12px; text-align: left; white-space: nowrap; }
.adm-table td { padding: 10px 12px; border-top: 1px solid #2c2b26; color: #c6bfae; background: #171815; vertical-align: top; }
.adm-table td small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.adm-table tr.is-dim td { opacity: .55; }
.adm-table a { color: var(--rust-bright); }
.adm-acts { white-space: nowrap; }
.adm-acts button { margin: 0 4px 4px 0; padding: 5px 9px; border: 1px solid #3b3932; border-radius: 2px; background: #10110f; color: var(--sand); font-size: 12.5px; cursor: pointer; }
.adm-acts button:hover { border-color: var(--rust-bright); color: var(--white); }
.adm-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; color: var(--muted); }
.adm-pager .btn { min-height: 40px; }

@media (max-width: 900px) {
  .account-grid, .topup-box { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wallet-panel { padding: 20px; }
  .wallet-main strong { font-size: 44px; }
  .wallet-actions .btn { flex: 1 1 calc(50% - 10px); }
  .hist-row { padding: 12px 14px; }
  .topup-form { padding: 20px; }
  .buy-box { padding: 18px; }
  .stat-tile b { font-size: 26px; }
  .adm-card { padding: 16px; }
  .adm-form { grid-template-columns: 1fr; }
}
