/* ยุทธภพไม่ครบบาท Reborn — palette from the logo: deep imperial blue, gold, crimson */
:root {
  --ink: #142041; --ink-2: #1c2c58; --sky: #2f7fe0; --sky-2: #5fb1ff;
  --gold: #f2c14e; --gold-2: #c8902a; --red: #d23a2b; --red-2: #9e2318;
  --paper: #fbf7ee; --paper-2: #f1e8d6; --text: #1d2233; --muted: #626b80; --line: #e4dccb;
  --card: #ffffff; --shadow: 0 10px 30px rgba(20, 32, 65, .12); --r: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Sarabun", system-ui, sans-serif; color: var(--text); background: var(--paper); line-height: 1.65; }
h1, h2, h3, .brand, .btn, .nav a { font-family: "Kanit", "Sarabun", sans-serif; }
a { color: var(--sky); text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(20, 32, 65, .92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(242, 193, 78, .25); }
.topbar-in { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 18px; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand b { color: var(--gold); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: #d8e2ff; padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.nav a:hover, .nav a.on { color: #fff; background: rgba(255, 255, 255, .1); }
.nav a.on { box-shadow: inset 0 -2px 0 var(--gold); }
.userbox { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; margin-left: auto; order: 3; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }
.demo-bar { background: #fff3cd; color: #7a5a00; text-align: center; font-size: 14px; padding: 6px 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: 12px; padding: 10px 18px; font-size: 15px; font-weight: 600; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { transform: translateY(-1px); }
.btn-gold { color: #3b2400; background: linear-gradient(180deg, #ffe08a, var(--gold) 55%, var(--gold-2)); box-shadow: 0 4px 14px rgba(200, 144, 42, .45); }
.btn-red { color: #fff; background: linear-gradient(180deg, #ef5b4a, var(--red) 55%, var(--red-2)); box-shadow: 0 4px 14px rgba(158, 35, 24, .4); }
.btn-blue { color: #fff; background: linear-gradient(180deg, var(--sky-2), var(--sky)); }
.btn-ghost { color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); }
.btn-link { color: #c9d5f5; background: none; padding: 10px 8px; }
.btn-lg { padding: 15px 26px; font-size: 18px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.off { opacity: .5; pointer-events: none; }

/* hero */
.hero { position: relative; min-height: 640px; color: #fff; display: flex; align-items: center; overflow: hidden;
  background: url(/assets/img/hero-palace.jpg) center 35% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 18, 40, .15) 0%, rgba(10, 18, 40, .25) 55%, var(--paper) 100%); }
.hero-in { position: relative; z-index: 1; width: 100%; text-align: center; padding: 60px 16px 120px; }
.hero-logo { width: min(620px, 92vw); margin: 0 auto; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .45)); }
.hero-tag { font-family: "Kanit"; font-size: clamp(18px, 2.4vw, 24px); margin: 6px 0 26px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-sm { background: linear-gradient(120deg, var(--ink), var(--ink-2) 60%, #29407d); color: #fff; padding: 48px 0 40px; position: relative; overflow: hidden; }
.hero-sm::after { content: ""; position: absolute; right: -60px; top: -40px; width: 420px; height: 260px; background: url(/assets/img/hero-palace.jpg) center / cover; opacity: .18; border-radius: 30px; transform: rotate(-6deg); }
.hero-sm h1 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 38px); }
.hero-sm p { margin: 0; color: #c9d5f5; }

/* status strip */
.status { position: relative; z-index: 2; margin-top: -70px; }
.status-in { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; border-top: 4px solid var(--gold); }
.stat b { display: block; font-family: "Kanit"; font-size: 26px; color: var(--ink); }
.stat span { color: var(--muted); font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); } .dot.off { background: #ef4444; }

/* sections & cards */
.section { padding: 56px 0; }
.section h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 6px; color: var(--ink); }
.section .lead { color: var(--muted); margin: 0 0 24px; }
.title-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 8px; color: var(--ink); }
.news-item { display: block; color: inherit; }
.news-item:hover h3 { color: var(--sky); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--paper-2); color: var(--gold-2); margin-right: 8px; }
.tag.t-ประกาศ { background: #e6efff; color: #1d4fb8; } .tag.t-กิจกรรม { background: #ffe8e4; color: var(--red-2); } .tag.t-ปรับปรุง { background: #eef2f6; color: #475569; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.feature { text-align: center; }
.feature .ico { font-size: 34px; width: 64px; height: 64px; line-height: 64px; margin: 0 auto 10px; border-radius: 18px; background: linear-gradient(180deg, #fff6d8, var(--paper-2)); }
.shots img { border-radius: 14px; box-shadow: var(--shadow); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; }
.split img { border-radius: 22px; box-shadow: var(--shadow); }

/* downloads */
.dl { display: flex; flex-direction: column; gap: 10px; text-align: center; align-items: center; }
.dl .os { font-size: 44px; }
.dl h3 { margin: 4px 0 0; } .dl .btn { margin-top: 8px; width: 100%; }
.steps { margin: 0; padding-left: 20px; } .steps li { margin: 4px 0; }

/* forms */
.form-card { max-width: 460px; margin: 40px auto; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid #d6cfbf; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(47, 127, 224, .25); border-color: var(--sky); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.form-card .btn { margin-top: 20px; }
.alert { padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; }
.alert-error { background: #fdecea; color: #9e2318; } .alert-success { background: #e8f7ee; color: #166534; } .alert-info { background: #e6efff; color: #1d4fb8; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; } .check input { width: auto; margin-top: 5px; }

/* tables */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--ink); color: #fff; font-family: "Kanit"; font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.rank-1 td:first-child, .rank-2 td:first-child, .rank-3 td:first-child { font-weight: 700; color: var(--gold-2); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* top-up */
.pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.pkg { position: relative; cursor: pointer; }
.pkg input { position: absolute; opacity: 0; }
.pkg .box { display: block; text-align: center; padding: 18px 12px; border-radius: 16px; background: #fff; border: 2px solid var(--line); transition: .12s; }
.pkg input:checked + .box { border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(242, 193, 78, .35); }
.pkg .gem { font-size: 30px; } .pkg .dia { font-family: "Kanit"; font-size: 22px; color: var(--ink); } .pkg .thb { color: var(--red); font-weight: 700; }
.qr { background: #fff; padding: 14px; border-radius: 16px; display: inline-block; box-shadow: var(--shadow); }
.qr svg { width: 260px; height: 260px; display: block; }
.status-pending { color: #b45309; } .status-approved { color: #15803d; } .status-rejected { color: #b91c1c; }

/* footer */
.foot { background: var(--ink); color: #c9d5f5; margin-top: 40px; padding: 40px 0 20px; }
.foot-in { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 24px; }
.foot-logo { width: 220px; }
.foot-links { display: flex; flex-direction: column; gap: 6px; } .foot-links b { color: var(--gold); font-family: "Kanit"; } .foot-links a { color: #c9d5f5; }
.copy { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 26px; padding-top: 14px; font-size: 13px; color: #8ea0cf; }
.prose { max-width: 820px; } .prose h2 { margin-top: 28px; } .prose p, .prose li { color: #2f3446; }

/* responsive */
@media (max-width: 960px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--ink); flex-direction: column; padding: 8px 16px 14px; }
  .nav-open .nav { display: flex; }
  .menu-btn { display: block; }
  .userbox .btn-link, .userbox .btn-ghost { display: none; }
  .status-in, .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; }
  .split, .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .brand span { font-size: 15px; }
  .hero { min-height: 520px; }
  .g2, .g3, .split { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .userbox .btn-gold { padding: 8px 12px; font-size: 14px; white-space: nowrap; }
  .brand span b { display: none; }
  .menu-btn { margin-left: 4px; }
  .table th, .table td { padding: 10px 8px; font-size: 14px; }
}
